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


PHP TestHandler::hasInfoThatContains方法代碼示例

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


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

示例1: test_that_query_is_handled_by_pipeline

 public function test_that_query_is_handled_by_pipeline()
 {
     $handler = new UserByEmailHandler();
     $this->queryMap->registerHandlers([UserByEmailQuery::class => $handler]);
     $query = new UserByEmailQuery('jsmith@example.com');
     $user = $this->pipeline->fetch($query);
     $this->assertTrue($this->queryMap->hasHandler(UserByEmailQuery::class) && $this->logHandler->hasInfoThatContains(sprintf('Query received {%s}', ClassName::canonical(UserByEmailQuery::class))) && $this->logHandler->hasInfoThatContains(sprintf('Query handled {%s}', ClassName::canonical(UserByEmailQuery::class))) && $user['email'] === 'jsmith@example.com');
 }
開發者ID:novuso,項目名稱:common,代碼行數:8,代碼來源:QueryPipelineTest.php

示例2: test_that_command_is_executed_by_pipeline

 public function test_that_command_is_executed_by_pipeline()
 {
     $handler = new RegisterUserHandler();
     $this->commandMap->registerHandlers([RegisterUserCommand::class => $handler]);
     $command = new RegisterUserCommand();
     $command->setFirstName('James')->setMiddleName('D')->setLastName('Smith')->setEmail('jsmith@example.com')->setPassword('secret');
     $this->pipeline->execute($command);
     $this->assertTrue($this->commandMap->hasHandler(RegisterUserCommand::class) && $this->logHandler->hasInfoThatContains(sprintf('Command received {%s}', ClassName::canonical(RegisterUserCommand::class))) && $this->logHandler->hasInfoThatContains(sprintf('Command handled {%s}', ClassName::canonical(RegisterUserCommand::class))) && $handler->isHandled());
 }
開發者ID:novuso,項目名稱:common,代碼行數:9,代碼來源:CommandPipelineTest.php

示例3: testRefreshingExistingCache

 function testRefreshingExistingCache()
 {
     $client = $this->prepare([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/profile.json')), new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/profile.json')), new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/profile.json'))], array_merge($this->conf(), ['cache' => true]));
     $req = Client\Request\Factory::create('profile');
     $result = $client->request(Client\Request\Factory::create('profile'));
     $req = Client\Request\Factory::create('profile');
     $req->setUseCache(false);
     $result = $client->request($req);
     $this->assertTrue($this->loghandler->hasInfoThatContains('Refreshing cache'));
 }
開發者ID:BureauPieper,項目名稱:storee-php-client,代碼行數:10,代碼來源:RequestTest.php

示例4: testInstanceWithLogger

 /**
  * Test instance with Monolog passed.
  *
  * @throws \WebservicesNl\Common\Exception\Client\InputException
  * @throws \InvalidArgumentException
  * @throws \WebservicesNl\Common\Exception\Server\NoServerAvailableException
  */
 public function testInstanceWithLogger()
 {
     $handler = new TestHandler();
     $logger = new Logger('unit-test', [$handler]);
     $config = new PlatformConfig();
     $factory = SoapFactory::build($config);
     $factory->setLogger($logger);
     $soapClient = $factory->create(['username' => 'johndoe', 'password' => 'fakePassword']);
     static::assertAttributeInstanceOf('\\Psr\\Log\\LoggerInterface', 'logger', $factory);
     static::assertTrue($factory->hasLogger());
     static::assertAttributeInstanceOf('\\Psr\\Log\\LoggerInterface', 'logger', $soapClient);
     static::assertTrue($handler->hasInfoThatContains('Created SoapClient for Webservices'));
     static::assertTrue($handler->hasDebugThatContains('Created SoapClient'));
     static::assertInstanceOf('WebservicesNl\\Protocol\\Soap\\Config\\Platform\\Webservices\\Converter', $soapClient->getConverter());
 }
開發者ID:webservices-nl,項目名稱:platform-connector,代碼行數:22,代碼來源:SoapClientFactoryTest.php

示例5: test_that_event_is_logged_by_subscriber

 public function test_that_event_is_logged_by_subscriber()
 {
     $event = new UserRegisteredEvent('jsmith@example.com', 'James', 'Smith', 'D');
     $this->dispatcher->dispatch($event);
     $this->assertTrue($this->logHandler->hasInfoThatContains(sprintf('Event dispatched {%s}', ClassName::canonical(UserRegisteredEvent::class))));
 }
開發者ID:novuso,項目名稱:common,代碼行數:6,代碼來源:EventLoggerTest.php


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