You are here

public function WorkflowsFormatterTest::testDefaultFormatter in Workflows Field 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/WorkflowsFormatterTest.php \Drupal\Tests\workflows_field\Kernel\WorkflowsFormatterTest::testDefaultFormatter()

Test the default formatter.

File

tests/src/Kernel/WorkflowsFormatterTest.php, line 85

Class

WorkflowsFormatterTest
Tests the Workflows Field formatters.

Namespace

Drupal\Tests\workflows_field\Kernel

Code

public function testDefaultFormatter() {
  $node = Node::create([
    'title' => 'Foo',
    'type' => 'project',
    'field_status' => 'in_discussion',
  ]);
  $node
    ->save();
  $this
    ->assertEquals([
    '#markup' => 'In Discussion',
    '#allowed_tags' => FieldFilteredMarkup::allowedTags(),
  ], $node->field_status
    ->view()[0]);
}