本文整理匯總了PHP中Composer\Package\Package::setIncludePaths方法的典型用法代碼示例。如果您正苦於以下問題:PHP Package::setIncludePaths方法的具體用法?PHP Package::setIncludePaths怎麽用?PHP Package::setIncludePaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Composer\Package\Package
的用法示例。
在下文中一共展示了Package::setIncludePaths方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIncludePathsInMainPackage
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("getCanonicalPackages")->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);
}
示例2: testIncludePathsArePrependedInAutoloadFile
public function testIncludePathsArePrependedInAutoloadFile()
{
$package = new Package('a', '1.0', '1.0');
$packages = array();
$a = new Package("a/a", "1.0", "1.0");
$a->setIncludePaths(array("lib/"));
$packages[] = $a;
$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, '_11');
$oldIncludePath = get_include_path();
// suppress the class loader to avoid fatals if the class is redefined
file_put_contents($this->vendorDir . '/composer/ClassLoader.php', '');
require $this->vendorDir . "/autoload.php";
$this->assertEquals($this->vendorDir . "/a/a/lib" . PATH_SEPARATOR . $oldIncludePath, get_include_path());
set_include_path($oldIncludePath);
}