diff --git a/tests/php/View/Parsers/HTML4ValueTest.php b/tests/php/View/Parsers/HTML4ValueTest.php index 5e6f9ed28..018f7b08d 100644 --- a/tests/php/View/Parsers/HTML4ValueTest.php +++ b/tests/php/View/Parsers/HTML4ValueTest.php @@ -80,4 +80,19 @@ class HTML4ValueTest extends SapphireTest $value->setContent(''); $this->assertEquals('', $value->getContent(), "'\"' character is escaped"); } + + public function testGetContent() + { + $value = new HTML4Value(); + + $value->setContent('
This is valid
'); + $this->assertEquals('This is valid
', $value->getContent(), "Valid content is returned"); + + $value->setContent('valid is false + // for instance if a content editor saves something really weird in a LiteralField + // we can manually get to this state via ->setInvalid() + $value->setInvalid(); + $this->assertEquals('', $value->getContent(), "Blank string is returned when invalid"); + } }