当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_MockObject_MockObject::run方法代码示例

本文整理汇总了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'));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:CommandTest.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([]);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:8,代码来源:CommandTest.php

示例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);
 }
开发者ID:rorteg,项目名称:magento2,代码行数:9,代码来源:ScenarioTest.php

示例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
 }
开发者ID:ZloeSabo,项目名称:SimpleDelegator,代码行数:15,代码来源:SimpleDelegatorTest.php

示例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);
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:13,代码来源:JmeterTest.php

示例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)));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:CommandManagerTest.php

示例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);
 }
开发者ID:opexsw,项目名称:magento2,代码行数:13,代码来源:JmeterTest.php

示例8: testWritingFileHeader

 /**
  * @test
  */
 public function testWritingFileHeader()
 {
     $this->task->fileHeader(array("This is the header"));
     $this->expectOneSerializerCall(array(), "This is the header");
     $this->task->run();
 }
开发者ID:nordcode,项目名称:robo-parameters,代码行数:9,代码来源:ParametersTest.php

示例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);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:12,代码来源:ScenarioTest.php

示例10: runExecutesCorrectAction

 /**
  * @test
  * @dataProvider runDataProvider
  */
 public function runExecutesCorrectAction($parameters, $action)
 {
     $this->subject->expects(self::once())->method($action);
     $this->subject->run($parameters);
 }
开发者ID:cobwebch,项目名称:ftpimportexport,代码行数:9,代码来源:ImportExportTest.php

示例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);
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:12,代码来源:JmeterTest.php

示例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());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:9,代码来源:CommandTest.php


注:本文中的PHPUnit_Framework_MockObject_MockObject::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。