You are here

public function PlanCRUDTest::testDeletePlan in farmOS 2.x

Delete plan entity.

File

modules/core/plan/tests/src/Functional/PlanCRUDTest.php, line 94

Class

PlanCRUDTest
Tests the plan CRUD.

Namespace

Drupal\Tests\plan\Functional

Code

public function testDeletePlan() {
  $plan = $this
    ->createPlanEntity();
  $plan
    ->save();
  $label = $plan
    ->getName();
  $plan_id = $plan
    ->id();
  $this
    ->drupalPostForm($plan
    ->toUrl('delete-form'), [], $this
    ->t('Delete'));
  $this
    ->assertRaw($this
    ->t('The @entity-type %label has been deleted.', [
    '@entity-type' => $plan
      ->getEntityType()
      ->getSingularLabel(),
    '%label' => $label,
  ]));
  $this
    ->assertNull(Plan::load($plan_id));
}