1
0
Fork 0

Resolves #4138: Removed *Test.php filtering from AutoloadGenerator->dump()

pull/4139/head
elazar 2015-06-12 10:52:55 -05:00
parent 24168d9d5c
commit 6c029a850c
3 changed files with 4 additions and 2 deletions

View File

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

View File

@ -164,9 +164,10 @@ class AutoloadGeneratorTest extends TestCase
->will($this->returnValue(array())); ->will($this->returnValue(array()));
$this->fs->ensureDirectoryExists($this->workingDir.'/composer'); $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'); $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/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-fruit');
$this->fs->ensureDirectoryExists($this->workingDir.'/src-cake'); $this->fs->ensureDirectoryExists($this->workingDir.'/src-cake');

View File

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