当前位置: 首页>>代码示例>>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;未经允许,请勿转载。