mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fixed path analysis
This commit is contained in:
parent
05ffc605f1
commit
3c0a620ad5
4 changed files with 44 additions and 9 deletions
|
@ -869,6 +869,37 @@ EOF;
|
|||
$this->assertEquals($expectedClassmap, file_get_contents($this->vendorDir.'/composer/autoload_classmap.php'));
|
||||
}
|
||||
|
||||
public function testVendorSubstringPath()
|
||||
{
|
||||
$package = new Package('a', '1.0', '1.0');
|
||||
$package->setAutoload(array(
|
||||
'psr-0' => array('Foo' => 'composer-test-autoload-src/src'),
|
||||
));
|
||||
|
||||
$this->repository->expects($this->once())
|
||||
->method('getCanonicalPackages')
|
||||
->will($this->returnValue(array()));
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->vendorDir.'/a');
|
||||
|
||||
$expectedNamespace = <<<'EOF'
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Foo' => array($baseDir . '/composer-test-autoload-src/src'),
|
||||
);
|
||||
|
||||
EOF;
|
||||
|
||||
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, 'VendorSubstring');
|
||||
$this->assertEquals($expectedNamespace, file_get_contents($this->vendorDir.'/composer/autoload_namespaces.php'));
|
||||
}
|
||||
|
||||
private function assertAutoloadFiles($name, $dir, $type = 'namespaces')
|
||||
{
|
||||
$a = __DIR__.'/Fixtures/autoload_'.$name.'.php';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue