public function WorkflowsFormatterTest::testDefaultFormatter in Workflows Field 2.x
Same name and namespace in other branches
- 8 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\KernelCode
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]);
}