This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/Finder/Iterator/IteratorTestCase.php
2011-03-06 12:40:06 +01:00

35 lines
1003 B
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\Finder\Iterator;
require_once __DIR__.'/Iterator.php';
class IteratorTestCase extends \PHPUnit_Framework_TestCase
{
protected function assertIterator($expected, \Iterator $iterator)
{
$values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator));
sort($values);
sort($expected);
$this->assertEquals($expected, array_values($values));
}
protected function assertOrderedIterator($expected, \Iterator $iterator)
{
$values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator));
$this->assertEquals($expected, array_values($values));
}
}