diff -u b/core/modules/field/src/Tests/String/UuidFormatterTest.php b/core/modules/field/src/Tests/String/UuidFormatterTest.php --- b/core/modules/field/src/Tests/String/UuidFormatterTest.php +++ b/core/modules/field/src/Tests/String/UuidFormatterTest.php @@ -47,12 +47,14 @@ $uuid_field = $entity->get('uuid'); $render_array = $uuid_field->view([]); - $this->assertIdentical($render_array[0]['#context']['value'], $entity->uuid(), 'The rendered UUID matches the entity UUID.'); + $value = $this->render($render_array); + $this->assertTrue(strpos($value, $entity->uuid()), 'The rendered UUID matches the entity UUID.'); $render_array = $uuid_field->view(['settings' => ['link_to_entity' => TRUE]]); $this->assertIdentical($render_array[0]['#type'], 'link'); - $this->assertIdentical($render_array[0]['#title']['#context']['value'], $entity->uuid()); $this->assertIdentical($render_array[0]['#url']->toString(), $entity->url()); + $value = $this->render($render_array); + $this->assertTrue(strpos($value, $entity->uuid())); } }