Permalink
Browse files

[Finder] Fixed tests.

  • Loading branch information...
1 parent 7ff1cb6 commit 5526b4fd1c5912ee2abe813adf46df75a1da4f3f @jfsimon jfsimon committed Oct 29, 2012
Showing with 5 additions and 12 deletions.
  1. +5 −12 Tests/FinderTest.php
View
@@ -602,7 +602,6 @@ public function getContainsTestData()
array('dolor sit amet', '@^L@m', array('dolor.txt', 'ipsum.txt')),
array('/^lorem ipsum dolor sit amet$/m', 'foobar', array('lorem.txt')),
array('lorem', 'foobar', array('lorem.txt')),
-
array('', 'lorem', array('dolor.txt', 'ipsum.txt')),
array('ipsum dolor sit amet', '/^IPSUM/m', array('lorem.txt')),
);
@@ -650,9 +649,9 @@ private function buildTestData(array $tests)
/**
* @dataProvider getTestPathData
*/
- public function testPath($matchPatterns, $noMatchPatterns, $expected)
+ public function testPath(Adapter\AdapterInterface $adapter, $matchPatterns, $noMatchPatterns, $expected)
{
- $finder = new Finder();
+ $finder = $this->buildFinder($adapter);
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures')
->path($matchPatterns)
->notPath($noMatchPatterns);
@@ -662,13 +661,11 @@ public function testPath($matchPatterns, $noMatchPatterns, $expected)
public function getTestPathData()
{
- return array(
+ $tests = array(
array('', '', array()),
-
array('/^A\/B\/C/', '/C$/',
array('A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat')
),
-
array('/^A\/B/', 'foobar',
array(
'A'.DIRECTORY_SEPARATOR.'B',
@@ -677,7 +674,6 @@ public function getTestPathData()
'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat',
)
),
-
array('A/B/C', 'foobar',
array(
'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C',
@@ -686,25 +682,22 @@ public function getTestPathData()
'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat.copy',
)
),
-
array('A/B', 'foobar',
array(
//dirs
'A'.DIRECTORY_SEPARATOR.'B',
'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C',
'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B',
'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C',
-
//files
'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat',
'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat',
'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat.copy',
'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat.copy',
)
),
-
-
);
- }
+ return $this->buildTestData($tests);
+ }
}

0 comments on commit 5526b4f

Please sign in to comment.