1
0
Fork 0

Fixed obscure code

pull/273/head
Martin Hasoň 2012-01-31 15:04:49 +01:00
parent 2e9de65ae0
commit d27989c808
2 changed files with 7 additions and 1 deletions

View File

@ -54,7 +54,7 @@ EOF;
$filesystem = new Filesystem();
$vendorPath = strtr(realpath($installationManager->getVendorPath()), '\\', '/');
$relVendorPath = ltrim(substr($vendorPath, strlen(getcwd())), '/');
$relVendorPath = $filesystem->findShortestPath(getcwd(), $vendorPath);
$vendorDirCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
$namespacesFile = <<<EOF

View File

@ -77,6 +77,12 @@ class AutoloadGeneratorTest extends \PHPUnit_Framework_TestCase
$this->assertAutoloadFiles('main', $this->vendorDir.'/.composer');
}
public function testVendorDirSameAsWorkingDir()
{
chdir($this->vendorDir);
$this->testMainPackageAutoloading();
}
public function testMainPackageAutoloadingAlternativeVendorDir()
{
$package = new MemoryPackage('a', '1.0', '1.0');