當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ObjectProphecy::info方法代碼示例

本文整理匯總了PHP中Prophecy\Prophecy\ObjectProphecy::info方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectProphecy::info方法的具體用法?PHP ObjectProphecy::info怎麽用?PHP ObjectProphecy::info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Prophecy\Prophecy\ObjectProphecy的用法示例。


在下文中一共展示了ObjectProphecy::info方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: it_fails_when_connection_failed

 /**
  * @test
  * @expectedException \Clearcode\SimpleBusElkBundle\Logstash\CannotWriteToLogstash
  */
 public function it_fails_when_connection_failed()
 {
     $object = new \stdClass();
     $this->converter->toArray($object)->willReturn(['message' => 'hello world!']);
     $this->logger->info('Event recorded', ['message' => 'hello world!'])->willThrow(\UnexpectedValueException::class);
     $this->logstash->write($object);
 }
開發者ID:ClearcodeHQ,項目名稱:SimpleBusElkBundle,代碼行數:11,代碼來源:LogstashTest.php

示例2: datesAreReadFromQuery

 /**
  * @test
  */
 public function datesAreReadFromQuery()
 {
     $shortCode = 'abc123';
     $this->visitsTracker->info($shortCode, new DateRange(null, new \DateTime('2016-01-01 00:00:00')))->willReturn([])->shouldBeCalledTimes(1);
     $response = $this->action->__invoke(ServerRequestFactory::fromGlobals()->withAttribute('shortCode', $shortCode)->withQueryParams(['endDate' => '2016-01-01 00:00:00']), new Response());
     $this->assertEquals(200, $response->getStatusCode());
 }
開發者ID:shlinkio,項目名稱:shlink,代碼行數:10,代碼來源:GetVisitsActionTest.php

示例3: outputIsProperlyGenerated

 /**
  * @test
  */
 public function outputIsProperlyGenerated()
 {
     $shortCode = 'abc123';
     $this->visitsTracker->info($shortCode, Argument::any())->willReturn([(new Visit())->setReferer('foo')->setRemoteAddr('1.2.3.4')->setUserAgent('bar')])->shouldBeCalledTimes(1);
     $this->commandTester->execute(['command' => 'shortcode:visits', 'shortCode' => $shortCode]);
     $output = $this->commandTester->getDisplay();
     $this->assertTrue(strpos($output, 'foo') > 0);
     $this->assertTrue(strpos($output, '1.2.3.4') > 0);
     $this->assertTrue(strpos($output, 'bar') > 0);
 }
開發者ID:shlinkio,項目名稱:shlink,代碼行數:13,代碼來源:GetVisitsCommandTest.php

示例4: testSendMail

 /**
  * @dataProvider getDataForTestSendMail
  *
  * @param null|string $to
  * @param null|string $from
  * @param null|string $subject
  * @param null|string $body
  * @param array       $cc
  * @param null|string $attachmentName
  * @param null|string $attachmentPath
  */
 public function testSendMail($to, $from, $subject, $body, $cc, $attachmentName, $attachmentPath)
 {
     $this->message->getTo()->shouldBeCalledTimes(2)->willReturn($to);
     $this->message->getFrom()->shouldBeCalledTimes(2)->willReturn($from);
     $this->message->getSubject()->shouldBeCalledTimes(2)->willReturn($subject);
     $this->message->getBody()->shouldBeCalledTimes(1)->willReturn($body);
     $getCcCalls = count($cc) > 0 ? 2 : 1;
     $this->message->getCc()->shouldBeCalledTimes($getCcCalls)->willReturn($cc);
     $getAttachmentPathCalls = $attachmentPath ? $attachmentName ? 2 : 1 : 1;
     $this->message->getAttachmentPath()->shouldBeCalledTimes($getAttachmentPathCalls)->willReturn($attachmentPath);
     $getAttachmentNameCalls = $attachmentPath ? $attachmentName ? 2 : 1 : 0;
     $this->message->getAttachmentName()->shouldBeCalledTimes($getAttachmentNameCalls)->willReturn($attachmentName);
     $this->logger->info(sprintf(SwiftMailer::INFO_LOG_MESSAGE, $from, $to, $subject), ['SwiftMailer'])->shouldBeCalledTimes(1);
     $this->class->sendMail($this->message->reveal());
 }
開發者ID:pitechplus,項目名稱:mailer-bundle,代碼行數:26,代碼來源:SwiftMailerTest.php


注:本文中的Prophecy\Prophecy\ObjectProphecy::info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。