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


PHP ObjectProphecy::write方法代码示例

本文整理汇总了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();
 }
开发者ID:ClearcodeHQ,项目名称:SimpleBusElkBundle,代码行数:8,代码来源:LogEventMiddlewareTest.php

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

示例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));
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:8,代码来源:FilesystemTests.php

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

示例5: testWrite

 public function testWrite()
 {
     $this->output->write('text', true, OutputInterface::OUTPUT_NORMAL)->shouldBeCalled();
     $this->io->write('text', true, OutputInterface::OUTPUT_NORMAL);
 }
开发者ID:console-helpers,项目名称:console-kit,代码行数:5,代码来源:ConsoleIOTest.php


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