You are here

public function LogCRUDTest::testViewLog in Log entity 8

Display log entity.

File

src/Tests/LogCRUDTest.php, line 56

Class

LogCRUDTest
Tests the Log CRUD.

Namespace

Drupal\log\Tests

Code

public function testViewLog() {
  $edit = [
    'name' => $this
      ->randomMachineName(),
    'created' => REQUEST_TIME,
    'done' => TRUE,
  ];
  $log = $this
    ->createLogEntity($edit);
  $log
    ->save();
  $this
    ->drupalGet($log
    ->toUrl('canonical'));
  $this
    ->assertResponse(200);
  $this
    ->assertText($edit['name']);
  $this
    ->assertRaw(format_date(REQUEST_TIME));
  $this
    ->assertText($this->loggedInUser
    ->getDisplayName());
}