summaryrefslogtreecommitdiff
path: root/ext/standard/tests/directory/DirectoryClass_basic_001.phpt
blob: 559420781251093af1e1474a823d1f06a2b1b90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--TEST--
Directory class behaviour.
--FILE--
<?php
/*
 * Prototype: object dir(string directory[, resource context])
 * Description: Directory class with properties, handle and class and methods read, rewind and close
 * Class is defined in ext/standard/dir.c
 */

echo "Structure of Directory class:\n";
$rc = new ReflectionClass("Directory");
echo $rc;

echo "Cannot instantiate a valid Directory directly:\n";
$d = new Directory(getcwd());
var_dump($d);

try {
    var_dump($d->read());
} catch (\Error $e) {
    echo $e->getMessage() . "\n";
}

?>
--EXPECTF--
Structure of Directory class:
Class [ <internal%s> class Directory ] {

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [0] {
  }

  - Methods [3] {
    Method [ <internal:standard> public method close ] {

      - Parameters [1] {
        Parameter #0 [ <optional> $dir_handle ]
      }
    }

    Method [ <internal:standard> public method rewind ] {

      - Parameters [1] {
        Parameter #0 [ <optional> $dir_handle ]
      }
    }

    Method [ <internal:standard> public method read ] {

      - Parameters [1] {
        Parameter #0 [ <optional> $dir_handle ]
      }
    }
  }
}
Cannot instantiate a valid Directory directly:
object(Directory)#%d (0) {
}
Unable to find my handle property