Annotation of embedaddon/php/ext/spl/tests/filesystemiterator_flags.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: FilesystemIterator::getFlags() basic tests
3: --CREDITS--
4: Joshua Thijssen <jthijssen@noxlogic.nl>
5: --FILE--
6: <?php
7:
8: $it = new FileSystemIterator(".");
9: printflags($it);
10:
11: $it->setFlags(FileSystemIterator::CURRENT_AS_SELF |
12: FileSystemIterator::KEY_AS_FILENAME |
13: FileSystemIterator::SKIP_DOTS |
14: FileSystemIterator::UNIX_PATHS);
15: printflags($it);
16:
17: $it->setFlags(-1);
18: printflags($it);
19:
20: function printflags($it) {
21: printf("%08X\n", $it->getFlags());
22: printf("%08X\n", ($it->getFlags() & FileSystemIterator::CURRENT_MODE_MASK));
23: printf("%08X\n", ($it->getFlags() & FileSystemIterator::KEY_MODE_MASK));
24: printf("%08X\n", ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK));
25: }
26:
27: ?>
28: --EXPECT--
29: 00001000
30: 00000000
31: 00000000
32: 00001000
33: 00003110
34: 00000010
35: 00000100
36: 00003000
37: 00003FF0
38: 000000F0
39: 00000F00
40: 00003000
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>