public function testUnescapeDoesNotUnescapeObjectMarkedAsBeingSafe() { $this->assertInstanceOf('Symfony\\Tests\\Component\\OutputEscaper\\OutputEscaperTestClass', Escaper::unescape(Escaper::escape('entities', new SafeDecorator(new OutputEscaperTestClass()))), '::unescape() returns the original value if it is marked as being safe'); Escaper::markClassAsSafe('OutputEscaperTestClass'); $this->assertInstanceOf('Symfony\\Tests\\Component\\OutputEscaper\\OutputEscaperTestClass', Escaper::unescape(Escaper::escape('entities', new OutputEscaperTestClass())), '::unescape() returns the original value if the object class is marked as being safe'); $this->assertInstanceOf('Symfony\\Tests\\Component\\OutputEscaper\\OutputEscaperTestClass', Escaper::unescape(Escaper::escape('entities', new OutputEscaperTestClassChild())), '::unescape() returns the original value if one of the object parent class is marked as being safe'); }