本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::getVersion方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::getVersion怎么用?PHP PHPUnit_Framework_MockObject_MockObject::getVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_MockObject_MockObject
的用法示例。
在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::getVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetVersion
/**
* @dataProvider getVersionDataProvider
*/
public function testGetVersion($versionCmdOutput, $expectedVersion)
{
$cmdCallback = function ($shellCmd, array &$output = null) use($versionCmdOutput) {
$output = array($versionCmdOutput);
return !empty($shellCmd);
};
$this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpmd'))->will($this->returnCallback($cmdCallback));
$this->assertEquals($expectedVersion, $this->_cmd->getVersion());
}
示例2: testTagWithTransportException
/**
* @param string $type
* @param bool $verbose
* @param string $exceptionClass
* @param string $validTrace
*
* @dataProvider getConfigIoForException
*/
public function testTagWithTransportException($type, $verbose, $exceptionClass, $validTrace)
{
/* @var \PHPUnit_Framework_MockObject_MockObject $loader */
$loader = $this->loader;
$loader
->expects($this->any())
->method('load')
->will($this->throwException(new $exceptionClass('MESSAGE')));
$this->lazyLoader = $this->createLazyLoaderConfigured($type, $verbose);
$package = $this->lazyLoader->load($this->lazyPackage);
$this->assertFalse($package);
$filename = $this->assetType->getFilename();
$validOutput = array('');
if ($verbose) {
$validOutput = array(
'Reading ' . $filename . ' of <info>' . $this->lazyPackage->getName() . '</info> (<comment>' . $this->lazyPackage->getPrettyVersion() . '</comment>)',
'Importing empty ' . $type . ' ' . $this->lazyPackage->getPrettyVersion() . ' (' . $this->lazyPackage->getVersion() . ')',
$validTrace,
'',
);
}
$this->assertSame($validOutput, $this->io->getTraces());
$packageCache = $this->lazyLoader->load($this->lazyPackage);
$this->assertFalse($packageCache);
$this->assertSame($validOutput, $this->io->getTraces());
}
示例3: testGetPackageCopy
public function testGetPackageCopy()
{
$this->initJob([], $this->atLeastOnce());
$this->package->expects($this->atLeastOnce())->method('getName')->will($this->returnValue('foo/bar'));
$this->package->expects($this->atLeastOnce())->method('getVersion')->will($this->returnValue('1.0.0'));
$this->package->expects($this->atLeastOnce())->method('getPrettyVersion')->will($this->returnValue('1'));
$this->package->expects($this->atLeastOnce())->method('getType')->will($this->returnValue('lib'));
$copy = $this->job->getPackageCopy();
// test
$this->assertInstanceOf('\\Composer\\Package\\Package', $copy);
$this->assertEquals($this->package->getName(), $copy->getName());
$this->assertEquals($this->package->getVersion(), $copy->getVersion());
$this->assertEquals($this->package->getPrettyVersion(), $copy->getPrettyVersion());
$this->assertEquals($this->package->getType(), $copy->getType());
$this->assertEquals($this->package->getExtra(), $copy->getExtra());
}
示例4: testGetVersion
/**
* @dataProvider getVersionDataProvider
*/
public function testGetVersion($versionCmdOutput, $expectedVersion)
{
$this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpmd'))->will($this->returnValue($versionCmdOutput));
$this->assertEquals($expectedVersion, $this->_cmd->getVersion());
}