[Finder] Added filename containing space to tests.
This commit is contained in:
parent
9681973676
commit
9bf7cb0941
@ -57,13 +57,13 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->files());
|
$this->assertSame($finder, $finder->files());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$finder->files();
|
$finder->files();
|
||||||
$finder->directories();
|
$finder->directories();
|
||||||
$finder->files();
|
$finder->files();
|
||||||
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,11 +73,11 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->depth('< 1'));
|
$this->assertSame($finder, $finder->depth('< 1'));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->depth('<= 0'));
|
$this->assertSame($finder, $finder->depth('<= 0'));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->depth('>= 1'));
|
$this->assertSame($finder, $finder->depth('>= 1'));
|
||||||
@ -118,12 +118,12 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->notName('*.php'));
|
$this->assertSame($finder, $finder->notName('*.php'));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$finder->notName('*.php');
|
$finder->notName('*.php');
|
||||||
$finder->notName('*.py');
|
$finder->notName('*.py');
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$finder->name('test.ph*');
|
$finder->name('test.ph*');
|
||||||
@ -172,7 +172,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->exclude('foo'));
|
$this->assertSame($finder, $finder->exclude('foo'));
|
||||||
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -182,15 +182,15 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->ignoreVCS(false)->ignoreDotFiles(false));
|
$this->assertSame($finder, $finder->ignoreVCS(false)->ignoreDotFiles(false));
|
||||||
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$finder->ignoreVCS(false)->ignoreVCS(false)->ignoreDotFiles(false);
|
$finder->ignoreVCS(false)->ignoreVCS(false)->ignoreDotFiles(false);
|
||||||
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->ignoreVCS(true)->ignoreDotFiles(false));
|
$this->assertSame($finder, $finder->ignoreVCS(true)->ignoreDotFiles(false));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -200,15 +200,15 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->ignoreDotFiles(false)->ignoreVCS(false));
|
$this->assertSame($finder, $finder->ignoreDotFiles(false)->ignoreVCS(false));
|
||||||
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$finder->ignoreDotFiles(false)->ignoreDotFiles(false)->ignoreVCS(false);
|
$finder->ignoreDotFiles(false)->ignoreDotFiles(false)->ignoreVCS(false);
|
||||||
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->ignoreDotFiles(true)->ignoreVCS(false));
|
$this->assertSame($finder, $finder->ignoreDotFiles(true)->ignoreVCS(false));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sortByName());
|
$this->assertSame($finder, $finder->sortByName());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -229,7 +229,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sortByType());
|
$this->assertSame($finder, $finder->sortByType());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'toto', 'foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'toto', 'foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -239,7 +239,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sortByAccessedTime());
|
$this->assertSame($finder, $finder->sortByAccessedTime());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -249,7 +249,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sortByChangedTime());
|
$this->assertSame($finder, $finder->sortByChangedTime());
|
||||||
$this->assertIterator($this->toAbsolute(array('toto', 'test.py', 'test.php', 'foo/bar.tmp', 'foo')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('toto', 'test.py', 'test.php', 'foo/bar.tmp', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -259,7 +259,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sortByModifiedTime());
|
$this->assertSame($finder, $finder->sortByModifiedTime());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -269,7 +269,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
{
|
{
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }));
|
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }));
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -293,7 +293,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
|
|
||||||
$finder = $this->buildFinder($adapter);
|
$finder = $this->buildFinder($adapter);
|
||||||
$this->assertSame($finder, $finder->followLinks());
|
$this->assertSame($finder, $finder->followLinks());
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -366,7 +366,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
$paths[] = $file->getRelativePath();
|
$paths[] = $file->getRelativePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = array("", "", "", "", "foo");
|
$ref = array("", "", "", "", "foo", "");
|
||||||
|
|
||||||
sort($ref);
|
sort($ref);
|
||||||
sort($paths);
|
sort($paths);
|
||||||
@ -389,7 +389,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
$paths[] = $file->getRelativePathname();
|
$paths[] = $file->getRelativePathname();
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = array("test.php", "toto", "test.py", "foo", "foo".DIRECTORY_SEPARATOR."bar.tmp");
|
$ref = array("test.php", "toto", "test.py", "foo", "foo".DIRECTORY_SEPARATOR."bar.tmp", "foo bar");
|
||||||
|
|
||||||
sort($paths);
|
sort($paths);
|
||||||
sort($ref);
|
sort($ref);
|
||||||
|
@ -31,8 +31,8 @@ class DateRangeFilterIteratorTest extends RealIteratorTestCase
|
|||||||
public function getAcceptData()
|
public function getAcceptData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array(new DateComparator('since 20 years ago')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar')),
|
array(array(new DateComparator('since 20 years ago')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/foo bar')),
|
||||||
array(array(new DateComparator('since 2 months ago')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar')),
|
array(array(new DateComparator('since 2 months ago')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/foo bar')),
|
||||||
array(array(new DateComparator('until last month')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.foo')),
|
array(array(new DateComparator('until last month')), array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.foo')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase
|
|||||||
public function getAcceptData()
|
public function getAcceptData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(0, 0, array($this->getAbsolutePath('/.git'), $this->getAbsolutePath('/test.py'), $this->getAbsolutePath('/foo'), $this->getAbsolutePath('/test.php'), $this->getAbsolutePath('/toto'), $this->getAbsolutePath('/.foo'), $this->getAbsolutePath('/.bar'))),
|
array(0, 0, array($this->getAbsolutePath('/.git'), $this->getAbsolutePath('/test.py'), $this->getAbsolutePath('/foo'), $this->getAbsolutePath('/test.php'), $this->getAbsolutePath('/toto'), $this->getAbsolutePath('/.foo'), $this->getAbsolutePath('/.bar'), $this->getAbsolutePath('/foo bar'))),
|
||||||
array(0, 1, array($this->getAbsolutePath('/.git'), $this->getAbsolutePath('/test.py'), $this->getAbsolutePath('/foo'), $this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/test.php'), $this->getAbsolutePath('/toto'), $this->getAbsolutePath('/.foo'), $this->getAbsolutePath('/.foo/.bar'), $this->getAbsolutePath('/.bar'))),
|
array(0, 1, array($this->getAbsolutePath('/.git'), $this->getAbsolutePath('/test.py'), $this->getAbsolutePath('/foo'), $this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/test.php'), $this->getAbsolutePath('/toto'), $this->getAbsolutePath('/.foo'), $this->getAbsolutePath('/.foo/.bar'), $this->getAbsolutePath('/.bar'), $this->getAbsolutePath('/foo bar'))),
|
||||||
array(2, INF, array()),
|
array(2, INF, array()),
|
||||||
array(1, INF, array($this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/.foo/.bar'))),
|
array(1, INF, array($this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/.foo/.bar'))),
|
||||||
array(1, 1, array($this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/.foo/.bar'))),
|
array(1, 1, array($this->getAbsolutePath('/foo/bar.tmp'), $this->getAbsolutePath('/.foo/.bar'))),
|
||||||
|
@ -40,7 +40,8 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
|
|||||||
$tmpDir.DIRECTORY_SEPARATOR.'.git',
|
$tmpDir.DIRECTORY_SEPARATOR.'.git',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'test.py',
|
$tmpDir.DIRECTORY_SEPARATOR.'test.py',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'test.php',
|
$tmpDir.DIRECTORY_SEPARATOR.'test.php',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'toto'
|
$tmpDir.DIRECTORY_SEPARATOR.'toto',
|
||||||
|
$tmpDir.DIRECTORY_SEPARATOR.'foo bar',
|
||||||
)),
|
)),
|
||||||
array(array('fo'), array(
|
array(array('fo'), array(
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'.bar',
|
$tmpDir.DIRECTORY_SEPARATOR.'.bar',
|
||||||
@ -51,7 +52,8 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
|
|||||||
$tmpDir.DIRECTORY_SEPARATOR.'foo',
|
$tmpDir.DIRECTORY_SEPARATOR.'foo',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp',
|
$tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'test.php',
|
$tmpDir.DIRECTORY_SEPARATOR.'test.php',
|
||||||
$tmpDir.DIRECTORY_SEPARATOR.'toto'
|
$tmpDir.DIRECTORY_SEPARATOR.'toto',
|
||||||
|
$tmpDir.DIRECTORY_SEPARATOR.'foo bar',
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class FileTypeFilterIteratorTest extends RealIteratorTestCase
|
|||||||
public function getAcceptData()
|
public function getAcceptData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(FileTypeFilterIterator::ONLY_FILES, array(sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo/.bar')),
|
array(FileTypeFilterIterator::ONLY_FILES, array(sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/foo bar')),
|
||||||
array(FileTypeFilterIterator::ONLY_DIRECTORIES, array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.foo')),
|
array(FileTypeFilterIterator::ONLY_DIRECTORIES, array(sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.foo')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,8 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
|||||||
$tmpDir.'/foo/',
|
$tmpDir.'/foo/',
|
||||||
$tmpDir.'/foo/bar.tmp',
|
$tmpDir.'/foo/bar.tmp',
|
||||||
$tmpDir.'/test.php',
|
$tmpDir.'/test.php',
|
||||||
$tmpDir.'/toto/'
|
$tmpDir.'/toto/',
|
||||||
|
$tmpDir.'/foo bar',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_dir($tmpDir)) {
|
if (is_dir($tmpDir)) {
|
||||||
|
@ -40,9 +40,9 @@ class SortableIteratorTest extends RealIteratorTestCase
|
|||||||
public function getAcceptData()
|
public function getAcceptData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(SortableIterator::SORT_BY_NAME, array(sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/toto')),
|
array(SortableIterator::SORT_BY_NAME, array(sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo bar', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/toto')),
|
||||||
array(SortableIterator::SORT_BY_TYPE, array(sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py')),
|
array(SortableIterator::SORT_BY_TYPE, array(sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/toto', sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/foo bar', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py')),
|
||||||
array(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }, array(sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/toto')),
|
array(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealpath(), $b->getRealpath()); }, array(sys_get_temp_dir().'/symfony2_finder/.bar', sys_get_temp_dir().'/symfony2_finder/.foo', sys_get_temp_dir().'/symfony2_finder/.foo/.bar', sys_get_temp_dir().'/symfony2_finder/.git', sys_get_temp_dir().'/symfony2_finder/foo', sys_get_temp_dir().'/symfony2_finder/foo bar', sys_get_temp_dir().'/symfony2_finder/foo/bar.tmp', sys_get_temp_dir().'/symfony2_finder/test.php', sys_get_temp_dir().'/symfony2_finder/test.py', sys_get_temp_dir().'/symfony2_finder/toto')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user