当前位置: 首页>>代码示例>>PHP>>正文


PHP Package::setIncludePaths方法代码示例

本文整理汇总了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);
 }
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-composer,代码行数:14,代码来源:AutoloadGeneratorTest.php

示例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);
 }
开发者ID:rufinus,项目名称:composer,代码行数:17,代码来源:AutoloadGeneratorTest.php


注:本文中的Composer\Package\Package::setIncludePaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。