public function LogCRUDTest::testViewLog in Log entity 2.x
Display log entity.
File
- tests/
src/ Functional/ LogCRUDTest.php, line 60
Class
- LogCRUDTest
- Tests the Log CRUD.
Namespace
Drupal\Tests\log\FunctionalCode
public function testViewLog() {
$edit = [
'name' => $this
->randomMachineName(),
'created' => \Drupal::time()
->getRequestTime(),
'done' => TRUE,
];
$log = $this
->createLogEntity($edit);
$log
->save();
$this
->drupalGet($log
->toUrl('canonical'));
$this
->assertResponse(200);
$this
->assertText($edit['name']);
$this
->assertRaw(\Drupal::service('date.formatter')
->format(\Drupal::time()
->getRequestTime()));
}