1
0
Fork 0

Updated the regexp and added an other test case for sub dirs

pull/2769/head
Sandy Pleyte 2014-02-28 16:30:55 +01:00
parent 1d51e54a31
commit 3e161e8ea9
2 changed files with 10 additions and 5 deletions

View File

@ -137,7 +137,7 @@ abstract class BaseExcludeFilter
$pattern .= '^/';
$rule = substr($rule, 1);
} elseif (strlen($rule) - 1 === strpos($rule, '/')) {
$pattern .= '^/';
$pattern .= '/';
$rule = substr($rule, 0, -1);
} elseif (false === strpos($rule, '/')) {
$pattern .= '/';

View File

@ -58,10 +58,12 @@ class ArchivableFilesFinderTest extends \PHPUnit_Framework_TestCase
'D/prefixD',
'D/prefixE',
'D/prefixF',
'/E/subtestA.foo',
'/F/subtestA.foo',
'/G/subtestA.foo',
'/H/subtestA.foo',
'E/subtestA.foo',
'F/subtestA.foo',
'G/subtestA.foo',
'H/subtestA.foo',
'I/J/subtestA.foo',
'K/dirJ/subtestA.foo',
'toplevelA.foo',
'toplevelB.foo',
'prefixA.foo',
@ -127,6 +129,8 @@ class ArchivableFilesFinderTest extends \PHPUnit_Framework_TestCase
'/F/subtestA.foo',
'/G/subtestA.foo',
'/H/subtestA.foo',
'/I/J/subtestA.foo',
'/K/dirJ/subtestA.foo',
'/parameters.yml',
'/parameters.yml.dist',
'/prefixB.foo',
@ -164,6 +168,7 @@ class ArchivableFilesFinderTest extends \PHPUnit_Framework_TestCase
'F/',
'G/*',
'H/**',
'J/',
'parameters.yml',
'\!important!.txt'
)));