installEntitySchema('entity_test_computed_field'); } /** * Test the computed field handler. */ public function testComputedFieldHandler() { \Drupal::state()->set('entity_test_computed_field_item_list_value', ['computed string']); $entity = EntityTestComputedField::create([]); $entity->save(); $view = Views::getView('computed_field_view'); $rendered_view = $view->preview(); $output = $this->container->get('renderer')->renderRoot($rendered_view); $this->assertContains('computed string', (string) $output); } }