Permalink
Browse files

Move atoum's source iterator in the iterators directory.

  • Loading branch information...
1 parent c3e7f1b commit f74241cf875ae0119bcc61703ebbce4103ecc40a @mageekguy mageekguy committed Apr 17, 2012
View
4 classes/src/iterator.php → ...ses/iterators/recursives/atoum/source.php
@@ -1,13 +1,13 @@
<?php
-namespace mageekguy\atoum\src;
+namespace mageekguy\atoum\iterators\recursives\atoum;
use
mageekguy\atoum,
mageekguy\atoum\iterators
;
-class iterator implements \outerIterator
+class source implements \outerIterator
{
protected $pharDirectory = '';
protected $sourceDirectory = '';
View
3 classes/scripts/phar/generator.php
@@ -6,6 +6,7 @@
use
mageekguy\atoum,
+ mageekguy\atoum\iterators,
mageekguy\atoum\exceptions
;
@@ -190,7 +191,7 @@ protected function generate()
)
);
- $phar->buildFromIterator(new atoum\src\iterator($this->originDirectory, '1'));
+ $phar->buildFromIterator(new iterators\recursives\atoum\source($this->originDirectory, '1'));
$phar->setSignatureAlgorithm(\phar::SHA1);
return $this;
View
32 tests/units/classes/src/iterator.php → ...s/iterators/recursives/atoum/iterator.php
@@ -1,16 +1,16 @@
<?php
-namespace mageekguy\atoum\tests\units\src;
+namespace mageekguy\atoum\tests\units\iterators\recursives\atoum;
-require_once __DIR__ . '/../../runner.php';
+require_once __DIR__ . '/../../../../runner.php';
use
mageekguy\atoum,
- mageekguy\atoum\src,
- mageekguy\atoum\mock
+ mageekguy\atoum\mock,
+ mageekguy\atoum\iterators
;
-class iterator extends atoum\test
+class source extends atoum\test
{
public function testClass()
{
@@ -26,12 +26,12 @@ public function test__construct()
$sourceDirectoryController->dir_readdir = false;
$this->assert
- ->if($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->if($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->string($iterator->getSourceDirectory())->isEqualTo($sourceDirectory)
->variable($iterator->getPharDirectory())->isNull()
->object($iterator->getInnerIterator())->isInstanceOf('recursiveIteratorIterator')
- ->if($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
+ ->if($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
->then
->string($iterator->getSourceDirectory())->isEqualTo($sourceDirectory)
->string($iterator->getPharDirectory())->isEqualTo($pharDirectory)
@@ -51,17 +51,17 @@ public function testCurrent()
$sourceDirectoryController->closedir = true;
$this->assert
- ->if($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->if($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->variable($iterator->current())->isNull()
->if($sourceDirectoryController->readdir[1] = 'file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->string($iterator->current())->isEqualTo('atoum://sourceDirectory/file')
->if($sourceDirectoryController->readdir[1] = '.file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->variable($iterator->current())->isNull()
;
@@ -79,30 +79,30 @@ public function testKey()
$sourceDirectoryController->closedir = true;
$this->assert
- ->if($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->if($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->integer($iterator->key())->isZero()
->if($sourceDirectoryController->readdir[1] = 'file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->string($iterator->key())->isEqualTo('atoum://sourceDirectory/file')
->if($sourceDirectoryController->readdir[1] = '.file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory'))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory'))
->then
->integer($iterator->key())->isZero()
- ->if($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
+ ->if($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
->then
->string($iterator->key())->isEmpty()
->if($sourceDirectoryController->readdir[1] = 'file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
->then
->string($iterator->key())->isEqualTo($pharDirectory . '/file')
->if($sourceDirectoryController->readdir[1] = '.file')
->and($sourceDirectoryController->readdir[2] = false)
- ->and($iterator = new src\iterator($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
+ ->and($iterator = new iterators\recursives\atoum\source($sourceDirectory = 'atoum://sourceDirectory', $pharDirectory = uniqid()))
->then
->string($iterator->key())->isEmpty()
;
View
5 tests/units/classes/scripts/phar/generator.php
@@ -5,6 +5,7 @@
use
mageekguy\atoum,
mageekguy\atoum\mock,
+ mageekguy\atoum\iterators,
mageekguy\atoum\scripts\phar
;
@@ -372,7 +373,7 @@ public function testRun()
->once()
->call('setStub')->withArguments($stub, null)->once()
->call('buildFromIterator')
- ->withArguments(new atoum\src\iterator($generator->getOriginDirectory(), '1'), null)
+ ->withArguments(new iterators\recursives\atoum\source($generator->getOriginDirectory(), '1'), null)
->once()
->call('setSignatureAlgorithm')
->withArguments(\phar::SHA1, null)
@@ -428,7 +429,7 @@ public function testRun()
->once()
->call('setStub')->withArguments($stub, null)->once()
->call('buildFromIterator')
- ->withArguments(new atoum\src\iterator($generator->getOriginDirectory(), '1'), null)
+ ->withArguments(new iterators\recursives\atoum\source($generator->getOriginDirectory(), '1'), null)
->once()
->call('setSignatureAlgorithm')
->withArguments(\phar::SHA1, null)

0 comments on commit f74241c

Please sign in to comment.