Inheritance: implements iteratorAggregate
コード例 #1
0
ファイル: factory.php プロジェクト: xihewang/atoum
 public function testGetIterator()
 {
     $this->mockGenerator->shunt('__construct')->generate('recursiveDirectoryIterator')->if($iterator = new testedClass())->and($iterator->setIteratorFactory(function ($path) use(&$recursiveDirectoryIterator) {
         return $recursiveDirectoryIterator = new \mock\recursiveDirectoryIterator($path);
     }))->and($iterator->setDotFilterFactory(function ($iterator) use(&$dotFilterIterator) {
         return $dotFilterIterator = new filters\recursives\dot($iterator);
     }))->and($iterator->setExtensionFilterFactory(function ($iterator, $extensions) use(&$extensionFilterIterator) {
         return $extensionFilterIterator = new filters\recursives\extension($iterator, $extensions);
     }))->then->object($filterIterator = $iterator->getIterator($path = uniqid()))->isIdenticalTo($extensionFilterIterator)->object($filterIterator->getInnerIterator())->isIdenticalTo($dotFilterIterator)->object($filterIterator->getInnerIterator()->getInnerIterator())->isIdenticalTo($recursiveDirectoryIterator)->mock($filterIterator->getInnerIterator()->getInnerIterator())->call('__construct')->withArguments($path)->once()->if($iterator->acceptDots())->then->object($filterIterator = $iterator->getIterator($path = uniqid()))->isIdenticalTo($extensionFilterIterator)->object($filterIterator->getInnerIterator())->isIdenticalTo($recursiveDirectoryIterator)->mock($filterIterator->getInnerIterator())->call('__construct')->withArguments($path)->once()->if($iterator->refuseDots())->and($iterator->acceptExtensions(array()))->then->object($filterIterator = $iterator->getIterator($path = uniqid()))->isIdenticalTo($dotFilterIterator)->object($filterIterator->getInnerIterator())->isIdenticalTo($recursiveDirectoryIterator)->mock($filterIterator->getInnerIterator())->call('__construct')->withArguments($path)->once()->if($iterator->acceptDots())->and($iterator->acceptExtensions(array()))->then->object($filterIterator = $iterator->getIterator($path = uniqid()))->isIdenticalTo($recursiveDirectoryIterator)->mock($filterIterator)->call('__construct')->withArguments($path)->once();
 }