1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

Fixed generating packageMap in AutoloaderGenerater (fixes generating include_paths.php file)

This commit is contained in:
Martin Hasoň 2012-12-17 10:54:48 +01:00
parent 321065b124
commit 45d7eb5b53
2 changed files with 32 additions and 3 deletions

View file

@ -524,6 +524,34 @@ EOF;
set_include_path($oldIncludePath);
}
public function testIncludePathsInMainPackage()
{
$package = new Package('a', '1.0', '1.0');
$package->setIncludePaths(array('/lib', '/src'));
$packages = array($a = new Package("a/a", "1.0", "1.0"));
$a->setIncludePaths(array("lib/"));
$this->repository->expects($this->once())
->method("getPackages")
->will($this->returnValue($packages));
mkdir($this->vendorDir."/composer", 0777, true);
$this->generator->dump($this->config, $this->repository, $package, $this->im, "composer", false, '_12');
$oldIncludePath = get_include_path();
require $this->vendorDir."/autoload.php";
$this->assertEquals(
$this->workingDir."/lib".PATH_SEPARATOR.$this->workingDir."/src".PATH_SEPARATOR.$this->vendorDir."/a/a/lib".PATH_SEPARATOR.$oldIncludePath,
get_include_path()
);
set_include_path($oldIncludePath);
}
public function testIncludePathFileWithoutPathsIsSkipped()
{
$package = new Package('a', '1.0', '1.0');