本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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'));
}
示例5: packageExpects
private function packageExpects($method, $value)
{
$this->package->expects($this->any())->method($method)->will($this->returnValue($value));
return $this;
}