当前位置: 首页>>代码示例>>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;未经允许,请勿转载。