Add 'include-path' option to PEAR packages
parent
5c16889c48
commit
71ac073ebe
|
@ -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) {
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
namespace Composer\Repository;
|
namespace Composer\Repository;
|
||||||
|
|
||||||
use Composer\Repository\FilesystemRepository;
|
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,10 +29,34 @@ 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
|
||||||
* @param array $expectedPackages
|
* @param array $expectedPackages
|
||||||
*/
|
*/
|
||||||
public function testRepositoryRead($url, array $expectedPackages)
|
public function testRepositoryRead($url, array $expectedPackages)
|
||||||
{
|
{
|
||||||
|
@ -126,4 +149,4 @@ class PearRepositoryTest extends TestCase
|
||||||
$this->repository = null;
|
$this->repository = null;
|
||||||
$this->remoteFilesystem = null;
|
$this->remoteFilesystem = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue