1
0
Fork 0

Merge pull request #4139 from elazar/feature/tests-in-classmap

Resolves #4138: Removed *Test.php filtering from AutoloadGenerator->dump()
pull/3960/head
Jordi Boggiano 2015-06-14 10:10:46 +01:00
commit 8e9659bd83
3 changed files with 4 additions and 2 deletions

View File

@ -183,7 +183,7 @@ EOF;
continue;
}
$whitelist = sprintf(
'{%s/%s.+(?<!(?<!/)Test\.php)$}',
'{%s/%s.+$}',
preg_quote($dir),
($psrType === 'psr-0' && strpos($namespace, '_') === false) ? preg_quote(strtr($namespace, '\\', '/')) : ''
);

View File

@ -164,9 +164,10 @@ class AutoloadGeneratorTest extends TestCase
->will($this->returnValue(array()));
$this->fs->ensureDirectoryExists($this->workingDir.'/composer');
$this->fs->ensureDirectoryExists($this->workingDir.'/src/Lala');
$this->fs->ensureDirectoryExists($this->workingDir.'/src/Lala/Test');
$this->fs->ensureDirectoryExists($this->workingDir.'/lib');
file_put_contents($this->workingDir.'/src/Lala/ClassMapMain.php', '<?php namespace Lala; class ClassMapMain {}');
file_put_contents($this->workingDir.'/src/Lala/Test/ClassMapMainTest.php', '<?php namespace Lala\Test; class ClassMapMainTest {}');
$this->fs->ensureDirectoryExists($this->workingDir.'/src-fruit');
$this->fs->ensureDirectoryExists($this->workingDir.'/src-cake');

View File

@ -9,4 +9,5 @@ return array(
'Acme\\Cake\\ClassMapBar' => $baseDir . '/src-cake/ClassMapBar.php',
'ClassMapFoo' => $baseDir . '/composersrc/foo.php',
'Lala\\ClassMapMain' => $baseDir . '/src/Lala/ClassMapMain.php',
'Lala\\Test\\ClassMapMainTest' => $baseDir . '/src/Lala/Test/ClassMapMainTest.php',
);