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


PHP Process::expects方法代码示例

本文整理汇总了PHP中Symfony\Component\Process\Process::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::expects方法的具体用法?PHP Process::expects怎么用?PHP Process::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Process\Process的用法示例。


在下文中一共展示了Process::expects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testProcessFailure

 /**
  * Test proper behavior if Process is not successful
  */
 public function testProcessFailure()
 {
     $command = rand();
     $this->process->method('isSuccessful')->willReturn(false);
     $this->process->method('getCommandLine')->willReturn($command);
     $this->process->expects($this->never())->method('getOutput');
     $logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     $this->fixture->setLogger($logger);
     $logger->expects($this->at(0))->method('warning')->with('Problem executing command');
     $logger->expects($this->at(1))->method('warning')->with('Details: `' . $command . '`');
     $actual = $this->fixture->find();
     $this->assertEquals('', $actual);
 }
开发者ID:jimlind,项目名称:tivo-php,代码行数:16,代码来源:TiVoFinderTest.php

示例2: test_it_will_not_try_to_initialize_behat_if_installation_fails

 public function test_it_will_not_try_to_initialize_behat_if_installation_fails()
 {
     $this->packageMock->expects(static::any())->method('hasPackage')->with('behat/behat', null, $this->inputMock, $this->outputMock)->willReturn(false);
     $this->requireMock->expects(static::any())->method('requirePackage')->willReturn($status = 7);
     $this->processMock->expects(static::never())->method('mustRun');
     static::assertEquals($status, $this->sut->run($this->inputMock, $this->outputMock));
 }
开发者ID:quickstrap,项目名称:quickstrap,代码行数:7,代码来源:BehatCommandTest.php

示例3: testStop

 public function testStop()
 {
     $this->process->expects($this->once())->method('getOutput')->will($this->returnValue($this->getPsOutput()));
     $this->process->expects($this->once())->method('isSuccessful')->will($this->returnValue(true));
     $this->assertTrue($this->object->stop());
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:6,代码来源:DaemonTest.php

示例4: testProcessRun

 /**
  * Test Process run method
  */
 public function testProcessRun()
 {
     $this->process->expects($this->once())->method('run');
     $this->fixture->decode(null, null);
 }
开发者ID:jimlind,项目名称:tivo-php,代码行数:8,代码来源:VideoDecoderTest.php


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