diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index 40b0a67cc..1869f165a 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -261,12 +261,12 @@ class AutoloadGeneratorTest extends TestCase $this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, '_6'); $this->assertTrue(file_exists($this->vendorDir.'/composer/autoload_classmap.php'), "ClassMap file needs to be generated."); $this->assertEquals( - $this->normalizePaths(array( + array( 'ClassMapBar' => $this->vendorDir.'/b/b/src/b.php', 'ClassMapBaz' => $this->vendorDir.'/b/b/lib/c.php', 'ClassMapFoo' => $this->vendorDir.'/a/a/src/a.php', - )), - $this->normalizePaths(include $this->vendorDir.'/composer/autoload_classmap.php') + ), + include $this->vendorDir.'/composer/autoload_classmap.php' ); $this->assertAutoloadFiles('classmap4', $this->vendorDir.'/composer', 'classmap'); } @@ -297,12 +297,12 @@ class AutoloadGeneratorTest extends TestCase $this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, '_6'); $this->assertTrue(file_exists($this->vendorDir.'/composer/autoload_classmap.php'), "ClassMap file needs to be generated."); $this->assertEquals( - $this->normalizePaths(array( + array( 'ClassMapBar' => $this->vendorDir.'/a/a/target/lib/b.php', 'ClassMapBaz' => $this->vendorDir.'/b/b/src/c.php', 'ClassMapFoo' => $this->vendorDir.'/a/a/target/src/a.php', - )), - $this->normalizePaths(include $this->vendorDir.'/composer/autoload_classmap.php') + ), + include $this->vendorDir.'/composer/autoload_classmap.php' ); } @@ -333,12 +333,12 @@ class AutoloadGeneratorTest extends TestCase $this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, '_7'); $this->assertTrue(file_exists($this->vendorDir.'/composer/autoload_classmap.php'), "ClassMap file needs to be generated."); $this->assertEquals( - $this->normalizePaths(array( + array( 'ClassMapBar' => $this->vendorDir.'/b/b/test.php', 'ClassMapBaz' => $this->vendorDir.'/c/c/foo/test.php', 'ClassMapFoo' => $this->vendorDir.'/a/a/src/a.php', - )), - $this->normalizePaths(include $this->vendorDir.'/composer/autoload_classmap.php') + ), + include $this->vendorDir.'/composer/autoload_classmap.php' ); $this->assertAutoloadFiles('classmap5', $this->vendorDir.'/composer', 'classmap'); } @@ -469,7 +469,6 @@ class AutoloadGeneratorTest extends TestCase file_put_contents($this->vendorDir.'/a/a/lib/A/B/C.php', 'vendorDir.'/a/a/classmap/classes.php', 'workingDir, '\\', '/'); $expectedNamespace = << \$vendorDir . '/b/b/src/', - 'A\\\\B' => array('$workDir/lib', \$vendorDir . '/a/a/lib/'), - 'A' => \$vendorDir . '/a/a/src/', + 'B\\\\Sub\\\\Name' => \$vendorDir . '/b/b/src', + 'A\\\\B' => array(\$baseDir . '/lib', \$vendorDir . '/a/a/lib'), + 'A' => \$vendorDir . '/a/a/src', ); EOF; @@ -755,23 +754,6 @@ EOF; { $a = __DIR__.'/Fixtures/autoload_'.$name.'.php'; $b = $dir.'/autoload_'.$type.'.php'; - $this->assertEquals( - str_replace('%vendorDir%', basename($this->vendorDir), file_get_contents($a)), - file_get_contents($b), - $a .' does not equal '. $b - ); - } - - private function normalizePaths($paths) - { - if (!is_array($paths)) { - return strtr($paths, '\\', '/'); - } - - foreach ($paths as $key => $path) { - $paths[$key] = strtr($path, '\\', '/'); - } - - return $paths; + $this->assertFileEquals($a, $b); } } diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap3.php b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap3.php index cda9a4d82..eee309d87 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap3.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap3.php @@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = $vendorDir; return array( - 'ClassMapFoo' => $baseDir . '/composersrc/foo.php', - 'Main\\Foo' => $baseDir . '/src/Main/Foo.php', + 'ClassMapFoo' => $vendorDir . '/composersrc/foo.php', + 'Main\\Foo' => $vendorDir . '/src/Main/Foo.php', ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap4.php b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap4.php index f6731f823..fbc63dc06 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap4.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap4.php @@ -6,7 +6,7 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'ClassMapBar' => $baseDir . '/%vendorDir%/b/b/src/b.php', - 'ClassMapBaz' => $baseDir . '/%vendorDir%/b/b/lib/c.php', - 'ClassMapFoo' => $baseDir . '/%vendorDir%/a/a/src/a.php', + 'ClassMapBar' => $vendorDir . '/b/b/src/b.php', + 'ClassMapBaz' => $vendorDir . '/b/b/lib/c.php', + 'ClassMapFoo' => $vendorDir . '/a/a/src/a.php', ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap5.php b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap5.php index 1fb28ec5a..5d9dfb28b 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap5.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap5.php @@ -6,7 +6,7 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'ClassMapBar' => $baseDir . '/%vendorDir%/b/b/test.php', - 'ClassMapBaz' => $baseDir . '/%vendorDir%/c/c/foo/test.php', - 'ClassMapFoo' => $baseDir . '/%vendorDir%/a/a/src/a.php', + 'ClassMapBar' => $vendorDir . '/b/b/test.php', + 'ClassMapBaz' => $vendorDir . '/c/c/foo/test.php', + 'ClassMapFoo' => $vendorDir . '/a/a/src/a.php', ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_main.php b/tests/Composer/Test/Autoload/Fixtures/autoload_main.php index be588255f..f011a7364 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_main.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_main.php @@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Main' => $baseDir . '/src/', - 'Lala' => array($baseDir . '/src/', $baseDir . '/lib/'), + 'Main' => $baseDir . '/src', + 'Lala' => array($baseDir . '/src', $baseDir . '/lib'), ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_main2.php b/tests/Composer/Test/Autoload/Fixtures/autoload_main2.php index 93d797879..afc146e2c 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_main2.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_main2.php @@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( - 'Main' => $baseDir . '/src/', - 'Lala' => $baseDir . '/src/', + 'Main' => $baseDir . '/src', + 'Lala' => $baseDir . '/src', ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_main3.php b/tests/Composer/Test/Autoload/Fixtures/autoload_main3.php index 5a98309e0..b2b596e64 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_main3.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_main3.php @@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = $vendorDir; return array( - 'Main' => $baseDir . '/src/', - 'Lala' => $baseDir . '/src/', + 'Main' => $baseDir . '/src', + 'Lala' => $baseDir . '/src', ); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_vendors.php b/tests/Composer/Test/Autoload/Fixtures/autoload_vendors.php index bb589771c..5cecf729f 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_vendors.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_vendors.php @@ -6,7 +6,7 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'B\\Sub\\Name' => $vendorDir . '/b/b/src/', - 'A\\B' => $vendorDir . '/a/a/lib/', - 'A' => $vendorDir . '/a/a/src/', + 'B\\Sub\\Name' => $vendorDir . '/b/b/src', + 'A\\B' => $vendorDir . '/a/a/lib', + 'A' => $vendorDir . '/a/a/src', );