ChainIteratorTest.php 794 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Components\Finder\Iterator;
  11. use Symfony\Components\Finder\Iterator\ChainIterator;
  12. require_once __DIR__.'/IteratorTestCase.php';
  13. class ChainIteratorTest extends IteratorTestCase
  14. {
  15. public function testAccept()
  16. {
  17. $inner1 = new Iterator(array('test.php', 'test.py'));
  18. $inner2 = new Iterator(array());
  19. $inner3 = new Iterator(array('foo.php'));
  20. $iterator = new ChainIterator(array($inner1, $inner2, $inner3));
  21. $this->assertIterator(array('test.php', 'test.py', 'foo.php'), $iterator);
  22. }
  23. }