本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::run方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::run方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::run怎么用?PHP PHPUnit_Framework_MockObject_MockObject::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_MockObject_MockObject
的用法示例。
在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::run方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRun
public function testRun()
{
$expectedQuoteChar = substr(escapeshellarg(' '), 0, 1);
$expectedCmd = 'phpmd' . ' "some/test/dir with space,some/test/file with space.php"' . ' xml' . ' "some/ruleset/file.xml"' . ' --reportfile "some/report/file.xml"';
$expectedCmd = str_replace('"', $expectedQuoteChar, $expectedCmd);
$this->_cmd->expects($this->once())->method('_execShellCmd')->with($expectedCmd);
$this->_cmd->run(array('some/test/dir with space', 'some/test/file with space.php'));
}
示例2: testRun
public function testRun()
{
$this->_cmd->expects($this->any())->method('_getHostScript')->will($this->returnValue('cscript'));
$this->_cmd->expects($this->any())->method('_getJsHintPath')->will($this->returnValue('jshint-path'));
$this->_cmd->expects($this->any())->method('getFileName')->will($this->returnValue('mage.js'));
$this->_cmd->expects($this->once())->method('_execShellCmd')->with('cscript "jshint-path" "mage.js" ');
$this->_cmd->run([]);
}
示例3: testRunWithScripts
public function testRunWithScripts()
{
$scenarioFile = realpath(__DIR__ . '/_files/scenario_with_scripts.jmx');
$scriptBefore = realpath(__DIR__ . '/_files/scenario_with_scripts_before.php');
$scriptAfter = realpath(__DIR__ . '/_files/scenario_with_scripts_after.php');
$this->_shell->expects($this->at(0))->method('execute')->with('php %s', array($scriptBefore))->will($this->returnValue('fixture output'));
$this->_shell->expects($this->at(3))->method('execute')->with('php %s --beforeOutput=%s --scenarioExecutions=%s', array($scriptAfter, 'fixture output', 4));
$this->_object->run($scenarioFile, $this->_scenarioParams);
}
示例4: createsDelegateeOnFirstCall
/**
* This test ensures that caller will be saved to delegatee on first call("entry") and will be used afterwards.
* So there will be no difference in delegating from inside delegate or from outside call
* @test
*/
public function createsDelegateeOnFirstCall()
{
$this->subject = $this->getMockBuilder('ZloeSabo\\SimpleDelegatorTest\\ExecuteEverythingOnCallerBehalfTarget')->setMethods(['getCaller'])->getMock();
$caller = $this->getMockBuilder('\\stdClass')->setMethods(['firstFunction', 'secondFunction'])->getMock();
$caller->expects($this->at(0))->method('firstFunction');
$caller->expects($this->at(1))->method('secondFunction');
$this->subject->expects($this->once())->method('getCaller')->willReturn($caller);
$this->subject->run();
//Delegatee should be created after first function call
}
示例5: testRunException
/**
* @param string $scenarioFile
* @param string $reportFile
* @param string $expectedException
* @param string $expectedExceptionMsg
* @dataProvider runExceptionDataProvider
*/
public function testRunException($scenarioFile, $reportFile, $expectedException, $expectedExceptionMsg = '')
{
$this->setExpectedException($expectedException, $expectedExceptionMsg);
$scenario = new Magento_Performance_Scenario('Scenario', $scenarioFile, array(), array(), array());
$this->_object->run($scenario, $reportFile);
}
示例6: _runCommandManagerMock
/**
* @param PHPUnit_Framework_MockObject_MockObject $commandManagerMock
* @param int|null $forks
*/
protected function _runCommandManagerMock(PHPUnit_Framework_MockObject_MockObject $commandManagerMock, $forks = null)
{
$forksArgument = isset($forks) ? '--forks=' . $forks : null;
/** @var CM_Cli_CommandManager $commandManagerMock */
$commandManagerMock->run(new CM_Cli_Arguments(array('', 'package-mock', 'command-mock', $forksArgument)));
}
示例7: testRunException
/**
* @param string $scenarioFile
* @param string $reportFile
* @param string $expectedException
* @param string $expectedExceptionMsg
* @dataProvider runExceptionDataProvider
*/
public function testRunException($scenarioFile, $reportFile, $expectedException, $expectedExceptionMsg = '')
{
$this->setExpectedException($expectedException, $expectedExceptionMsg);
$scenario = new \Magento\TestFramework\Performance\Scenario('Scenario', $scenarioFile, [], [], []);
$this->_object->run($scenario, $reportFile);
}
示例8: testWritingFileHeader
/**
* @test
*/
public function testWritingFileHeader()
{
$this->task->fileHeader(array("This is the header"));
$this->expectOneSerializerCall(array(), "This is the header");
$this->task->run();
}
示例9: testRunException
/**
* @param string $scenarioFile
* @param array $scenarioParams
* @param string $expectedExceptionMsg
* @dataProvider runExceptionDataProvider
* @expectedException Magento_Exception
*/
public function testRunException($scenarioFile, array $scenarioParams, $expectedExceptionMsg = '')
{
$this->setExpectedException('Magento_Exception', $expectedExceptionMsg);
$this->_object->run($scenarioFile, $scenarioParams);
}
示例10: runExecutesCorrectAction
/**
* @test
* @dataProvider runDataProvider
*/
public function runExecutesCorrectAction($parameters, $action)
{
$this->subject->expects(self::once())->method($action);
$this->subject->run($parameters);
}
示例11: testRunException
/**
* @param string $scenarioFile
* @param string $reportFile
* @param string $expectedException
* @param string $expectedExceptionMsg
* @dataProvider runExceptionDataProvider
*/
public function testRunException($scenarioFile, $reportFile, $expectedException, $expectedExceptionMsg = '')
{
$this->setExpectedException($expectedException, $expectedExceptionMsg);
$this->_object->run($scenarioFile, $this->_scenarioArgs, $reportFile);
}
示例12: testRunWithExtensions
/**
* @depends testRun
*/
public function testRunWithExtensions()
{
$this->assertSame($this->_cmd, $this->_cmd->setExtensions(array('txt', 'xml')));
$this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains(' --extensions=txt,xml '));
$this->_cmd->run(array());
}