$this->
assertSession()->
responseContains('</body>'
);
// Verifying BigPipe assets are present.
$this->
assertNotEmpty($this->
getDrupalSettings());
$this->
assertContains('big_pipe/big_pipe',
explode(',',
$this->
getDrupalSettings()['ajaxPageState'
]['libraries'
]), 'BigPipe asset library is present.'
);
// Verify that the two expected exceptions are logged as errors.
$this->
assertEquals($log_count + 2,
(int) $connection->
select('watchdog'
)->
countQuery()->
execute()->
fetchField(), 'Two new watchdog entries.'
);
// Using dynamic select queries with the method range() allows contrib
// database drivers the ability to insert their own limit and offset
// functionality.
$records =
$connection->
select('watchdog', 'w'
)->
fields('w'
)->
orderBy('wid', 'DESC'
)->
range(0, 2
)->
execute()->
fetchAll();
$this->
assertEquals(RfcLogLevel::ERROR,
$records[0
]->severity
);
$this->
assertStringContainsString('Oh noes!',
(string) unserialize($records[0
]->variables
)['@message'
]);
$this->
assertEquals(RfcLogLevel::ERROR,
$records[1
]->severity
);
$this->
assertStringContainsString('You are not allowed to say llamas are not cool!',
(string) unserialize($records[1
]->variables
)['@message'
]);
// Verify that 4xx responses work fine. (4xx responses are handled by
// subrequests to a route pointing to a controller with the desired output.)
$this->
drupalGet(Url::
fromUri('base:non-existing-path'
));
// Simulate development.
// Verifying BigPipe provides useful error output when an error occurs