1--TEST--
2SPL: CachingInterator constructor flag checks
3--CREDITS--
4Sean Burlington www.practicalweb.co.uk
5TestFest London May 2009
6--FILE--
7<?php
8  //line 681 ...
9  $array = array(array(7,8,9),1,2,3,array(4,5,6));
10$arrayIterator = new ArrayIterator($array);
11new CachingIterator($arrayIterator, 0); /* TODO Should this throw? */
12new CachingIterator($arrayIterator, CachingIterator::CALL_TOSTRING);
13new CachingIterator($arrayIterator, CachingIterator::TOSTRING_USE_KEY);
14new CachingIterator($arrayIterator, CachingIterator::TOSTRING_USE_CURRENT);
15new CachingIterator($arrayIterator, CachingIterator::TOSTRING_USE_INNER);
16try {
17    $test = new CachingIterator($arrayIterator, 3); // this throws an exception
18} catch (\ValueError $e){
19  print  $e->getMessage() . "\n";
20}
21
22
23?>
24--EXPECT--
25CachingIterator::__construct(): Argument #2 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER
26