diff --git a/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php index 8589adc..fc39541 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterTest.php @@ -106,7 +106,7 @@ protected function setUp() { protected function renderEntityFields(FieldableEntityInterface $entity, EntityViewDisplayInterface $display) { $content = $display->build($entity); $content = $this->render($content); - return $content; + return (string) $content; } /** @@ -126,8 +126,8 @@ public function testBooleanFormatter() { $data[] = [0, $format, '✖']; $format = ['format' => 'label']; - // @todo test for empty value for 0 result? $data[] = [1, $format, $this->label]; + $data[] = [0, $format, '']; $format = [ 'format' => 'custom', @@ -148,8 +148,8 @@ public function testBooleanFormatter() { $entity->{$this->fieldName}->value = $value; // Verify that all HTML is escaped and newlines are retained. - $this->renderEntityFields($entity, $this->display); - $this->assertRaw($expected); + $content = $this->renderEntityFields($entity, $this->display); + $this->assertIdentical($expected, $content); } }