1
0
Fork 0

Add 'include-path' option to PEAR packages

pull/775/head
Alexey Prilipko 2012-06-06 12:21:52 +11:00
parent 5c16889c48
commit 71ac073ebe
2 changed files with 28 additions and 3 deletions

View File

@ -163,6 +163,7 @@ class PearRepository extends ArrayRepository
'autoload' => array(
'classmap' => array(''),
),
'include-path' => array('/'),
);
try {
@ -305,6 +306,7 @@ class PearRepository extends ArrayRepository
'autoload' => array(
'classmap' => array(''),
),
'include-path' => array('/'),
);
$packageKeys = array('l' => 'license', 'd' => 'description');
foreach ($packageKeys as $pear => $composer) {

View File

@ -12,7 +12,6 @@
namespace Composer\Repository;
use Composer\Repository\FilesystemRepository;
use Composer\Test\TestCase;
/**
@ -30,10 +29,34 @@ class PearRepositoryTest extends TestCase
*/
private $remoteFilesystem;
public function testComposerNonCompatibleRepositoryShouldSetIncludePath()
{
$url = 'pear.phpmd.org';
$expectedPackages = array(
array('name' => 'pear-phpmd/PHP_PMD', 'version' => '1.3.3'),
);
$repoConfig = array(
'url' => $url
);
$this->createRepository($repoConfig);
foreach ($expectedPackages as $expectedPackage) {
$package = $this->repository->findPackage($expectedPackage['name'], $expectedPackage['version']);
$this->assertInstanceOf('Composer\Package\PackageInterface',
$package,
'Expected package ' . $expectedPackage['name'] . ', version ' . $expectedPackage['version'] .
' not found in pear channel ' . $url
);
$this->assertSame(array('/'), $package->getIncludePaths());
}
}
/**
* @dataProvider repositoryDataProvider
* @param string $url
* @param array $expectedPackages
* @param array $expectedPackages
*/
public function testRepositoryRead($url, array $expectedPackages)
{
@ -126,4 +149,4 @@ class PearRepositoryTest extends TestCase
$this->repository = null;
$this->remoteFilesystem = null;
}
}
}