本文整理匯總了PHP中Prophecy\Prophecy\ObjectProphecy::write方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectProphecy::write方法的具體用法?PHP ObjectProphecy::write怎麽用?PHP ObjectProphecy::write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::write方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: it_catches_exception_from_logstash_and_logs_erros
/** @test */
public function it_catches_exception_from_logstash_and_logs_erros()
{
$object = new \stdClass();
$this->logstash->write($object)->willThrow(CannotWriteToLogstash::class);
$this->middleware->handle($object, $this->dummyCallable());
$this->logger->error(Argument::cetera())->shouldBeCalled();
}
示例2: testWrites
/**
*
*/
public function testWrites()
{
$this->formatter->format(Argument::any())->shouldBeCalledTimes(1);
$this->writer->write(Argument::any(), Argument::any())->shouldBeCalledTimes(1);
$this->dumper->setEnabled(true);
$this->dumper->dump('id', ['test' => 1]);
}
示例3: testPutNew
public function testPutNew()
{
$path = 'path.txt';
$contents = 'contents';
$this->prophecy->has($path)->willReturn(false);
$this->prophecy->write($path, $contents, $this->config)->willReturn(compact('path', 'contents'));
$this->assertTrue($this->filesystem->put($path, $contents));
}
示例4: testRunLive
/**
* @dataProvider runLiveDataProvider
*/
public function testRunLive($output_type, $expected_output)
{
$this->_process->getCommandLine()->willReturn('svn log')->shouldBeCalled();
$this->_process->mustRun(Argument::type('callable'))->will(function (array $args) use($output_type) {
return call_user_func($args[0], $output_type, 'TEXT');
})->shouldBeCalled();
$this->_process->getOutput()->willReturn('OK')->shouldBeCalled();
$this->_io->isVerbose()->willReturn(false)->shouldBeCalled();
$this->_io->isDebug()->willReturn(false)->shouldBeCalled();
$this->_io->write($expected_output)->shouldBeCalled();
$this->_cacheManager->getCache(Argument::any())->shouldNotBeCalled();
$actual_result = $this->_command->runLive(array('TE' => 'KE'));
$this->assertEquals('OK', $actual_result);
}
示例5: testWrite
public function testWrite()
{
$this->output->write('text', true, OutputInterface::OUTPUT_NORMAL)->shouldBeCalled();
$this->io->write('text', true, OutputInterface::OUTPUT_NORMAL);
}