/** * Test the field output. * * @dataProvider fieldTestCases */ public function testFieldOutput($settings, $label_visible, $field_markup) { // The entity display must be updated because the view method on fields // doesn't support passing third party settings. $this->entityViewDisplay->setComponent($this->fieldName, [ 'label' => $label_visible ? 'above' : 'hidden', 'settings' => [], 'type' => 'text_default', 'third_party_settings' => [ 'fences' => $settings, ], ])->setStatus(TRUE)->save(); $field_output = $this->entity->{$this->fieldName}->view('default'); $rendered_field_output = $this->stripWhitespace($this->container->get('renderer') ->renderRoot($field_output)); $this->assertEquals($this->stripWhitespace($field_markup), $rendered_field_output); }