You are here

public function LogCRUDTest::testDeleteLog in Log entity 8

Delete log entity.

File

src/Tests/LogCRUDTest.php, line 92

Class

LogCRUDTest
Tests the Log CRUD.

Namespace

Drupal\log\Tests

Code

public function testDeleteLog() {
  $log = $this
    ->createLogEntity();
  $log
    ->save();
  $label = $log
    ->getName();
  $log_id = $log
    ->id();
  $this
    ->drupalPostForm($log
    ->toUrl('delete-form'), [], t('Delete'));
  $this
    ->assertRaw(t('The @entity-type %label has been deleted.', array(
    '@entity-type' => $log
      ->getEntityType()
      ->getLowercaseLabel(),
    '%label' => $label,
  )));
  $this
    ->assertNull(Log::load($log_id));
}