本文整理汇总了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');
}
示例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());
}
示例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'));
}
示例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());
}
示例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))));
}