You are here

public function PlanCRUDTest::testViewPlan in farmOS 2.x

Display plan entity.

File

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

Class

PlanCRUDTest
Tests the plan CRUD.

Namespace

Drupal\Tests\plan\Functional

Code

public function testViewPlan() {
  $edit = [
    'name' => $this
      ->randomMachineName(),
    'created' => \Drupal::time()
      ->getRequestTime(),
  ];
  $plan = $this
    ->createPlanEntity($edit);
  $plan
    ->save();
  $this
    ->drupalGet($plan
    ->toUrl('canonical'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertText($edit['name']);
  $this
    ->assertRaw(\Drupal::service('date.formatter')
    ->format(\Drupal::time()
    ->getRequestTime()));
}