Переглянути джерело

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

elazar 9 роки тому
батько
коміт
6c029a850c

+ 1 - 1
src/Composer/Autoload/AutoloadGenerator.php

@@ -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, '\\', '/')) : ''
                         );

+ 2 - 1
tests/Composer/Test/Autoload/AutoloadGeneratorTest.php

@@ -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');

+ 1 - 0
tests/Composer/Test/Autoload/Fixtures/autoload_classmap.php

@@ -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',
 );