1--TEST-- 2SPL: RegexIterator::getMode() and setMode() basic tests 3--CREDITS-- 4Felix 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 12var_dump($regexIterator->getMode() === RegexIterator::MATCH); 13 14$regexIterator->setMode(RegexIterator::MATCH); 15var_dump($regexIterator->getMode() === RegexIterator::MATCH); 16 17$regexIterator->setMode(RegexIterator::GET_MATCH); 18var_dump($regexIterator->getMode() === RegexIterator::GET_MATCH); 19 20$regexIterator->setMode(RegexIterator::ALL_MATCHES); 21var_dump($regexIterator->getMode() === RegexIterator::ALL_MATCHES); 22 23$regexIterator->setMode(RegexIterator::SPLIT); 24var_dump($regexIterator->getMode() === RegexIterator::SPLIT); 25 26?> 27--EXPECT-- 28bool(true) 29bool(true) 30bool(true) 31bool(true) 32bool(true) 33