Annotation of embedaddon/php/ext/spl/tests/regexIterator_mode_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: RegexIterator::getMode() and setMode() basic tests
3: --CREDITS--
4: Felix De Vliegher <felix.devliegher@gmail.com>
5: --FILE--
6: <?php
7:
8: $array = array('foo', 'bar', 'baz');
9: $iterator = new ArrayIterator($array);
10: $regexIterator = new RegexIterator($iterator, "/f/");
11:
12: var_dump($regexIterator->getMode() === RegexIterator::MATCH);
13:
14: $regexIterator->setMode(RegexIterator::MATCH);
15: var_dump($regexIterator->getMode() === RegexIterator::MATCH);
16:
17: $regexIterator->setMode(RegexIterator::GET_MATCH);
18: var_dump($regexIterator->getMode() === RegexIterator::GET_MATCH);
19:
20: $regexIterator->setMode(RegexIterator::ALL_MATCHES);
21: var_dump($regexIterator->getMode() === RegexIterator::ALL_MATCHES);
22:
23: $regexIterator->setMode(RegexIterator::SPLIT);
24: var_dump($regexIterator->getMode() === RegexIterator::SPLIT);
25:
26: ?>
27: --EXPECT--
28: bool(true)
29: bool(true)
30: bool(true)
31: bool(true)
32: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>