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

View File

@ -12,7 +12,6 @@
namespace Composer\Repository; namespace Composer\Repository;
use Composer\Repository\FilesystemRepository;
use Composer\Test\TestCase; use Composer\Test\TestCase;
/** /**
@ -30,6 +29,30 @@ class PearRepositoryTest extends TestCase
*/ */
private $remoteFilesystem; 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 * @dataProvider repositoryDataProvider
* @param string $url * @param string $url