當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。