當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PackageInterface::expects方法代碼示例

本文整理匯總了PHP中Composer\Package\PackageInterface::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP PackageInterface::expects方法的具體用法?PHP PackageInterface::expects怎麽用?PHP PackageInterface::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Package\PackageInterface的用法示例。


在下文中一共展示了PackageInterface::expects方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

    public function setUp()
    {
        $this->config = $this->getMock('Composer\Config');
        $this->config->expects($this->any())
            ->method('get')
            ->will($this->returnCallback(function ($key) {
                switch ($key) {
                    case 'cache-repo-dir':
                        return sys_get_temp_dir() . '/composer-test-repo-cache';
                    case 'vendor-dir':
                        return sys_get_temp_dir() . '/composer-test/vendor';
                }

                return null;
            }));

        $this->rootPackage = $this->getMock('Composer\Package\RootPackageInterface');
        $this->package = $this->getMock('Composer\Package\PackageInterface');
        $this->package->expects($this->any())
            ->method('getName')
            ->will($this->returnValue('foo-asset/foo'));

        $this->composer = $this->getMock('Composer\Composer');
        $this->composer->expects($this->any())
            ->method('getPackage')
            ->will($this->returnValue($this->rootPackage));
        $this->composer->expects($this->any())
            ->method('getConfig')
            ->will($this->returnValue($this->config));
    }
開發者ID:pombredanne,項目名稱:ArcherSys,代碼行數:30,代碼來源:IgnoreFactoryTest.php

示例2: createEvent

 /**
  * @param string $composerType
  *
  * @return PackageEvent
  */
 protected function createEvent($composerType)
 {
     $this->package->expects($this->any())->method('getType')->will($this->returnValue($composerType));
     $this->operation->expects($this->any())->method('getTargetPackage')->will($this->returnValue($this->package));
     $this->operation->expects($this->any())->method('getPackage')->will($this->returnValue($this->package));
     return new PackageEvent('foo-event', $this->composer, $this->io, true, $this->operation);
 }
開發者ID:songhongyu,項目名稱:idaiyan,代碼行數:12,代碼來源:ScriptHandlerTest.php

示例3: createEvent

 /**
  * @param string $composerType
  *
  * @return PackageEvent
  */
 protected function createEvent($composerType)
 {
     $this->package->expects($this->any())->method('getType')->will($this->returnValue($composerType));
     $this->operation->expects($this->any())->method('getTargetPackage')->will($this->returnValue($this->package));
     $this->operation->expects($this->any())->method('getPackage')->will($this->returnValue($this->package));
     /* @var PolicyInterface $policy */
     $policy = $this->getMock('Composer\\DependencyResolver\\PolicyInterface');
     /* @var Pool $pool */
     $pool = $this->getMockBuilder('Composer\\DependencyResolver\\Pool')->disableOriginalConstructor()->getMock();
     /* @var CompositeRepository $installedRepo */
     $installedRepo = $this->getMockBuilder('Composer\\Repository\\CompositeRepository')->disableOriginalConstructor()->getMock();
     /* @var Request $request */
     $request = $this->getMockBuilder('Composer\\DependencyResolver\\Request')->disableOriginalConstructor()->getMock();
     $operations = array($this->getMock('Composer\\DependencyResolver\\Operation\\OperationInterface'));
     return new PackageEvent('foo-event', $this->composer, $this->io, true, $policy, $pool, $installedRepo, $request, $operations, $this->operation);
 }
開發者ID:MvegaR,項目名稱:ingSotfware,代碼行數:21,代碼來源:ScriptHandlerTest.php

示例4: caseSensitivityConfigIsExtractedFromVeryDeprecatedKey

 /**
  * @test
  */
 public function caseSensitivityConfigIsExtractedFromVeryDeprecatedKey()
 {
     $this->packageMock->expects($this->any())->method('getExtra')->willReturn(array('autoload-case-sensitivity' => false));
     $subject = new Config($this->packageMock, $this->IOMock);
     $this->assertFalse($subject->get('autoload-case-sensitivity'));
 }
開發者ID:typo3,項目名稱:class-alias-loader,代碼行數:9,代碼來源:ConfigTest.php

示例5: packageExpects

 private function packageExpects($method, $value)
 {
     $this->package->expects($this->any())->method($method)->will($this->returnValue($value));
     return $this;
 }
開發者ID:norbe,項目名稱:composer,代碼行數:5,代碼來源:ArrayDumperTest.php


注:本文中的Composer\Package\PackageInterface::expects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。