本文整理汇总了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);
}