assertEquals($expected, (string) $escapeable_string, $message); $this->assertEquals($expected, $escapeable_string->jsonSerialize()); } /** * Data provider for testToString(). * * @see testToString() */ public function providerToString() { // Checks that invalid multi-byte sequences are escaped. $tests[] = ["Foo\xC0barbaz", 'Foo�barbaz', 'Escapes invalid sequence "Foo\xC0barbaz"']; $tests[] = ["\xc2\"", '�"', 'Escapes invalid sequence "\xc2\""']; $tests[] = ["Fooÿñ", "Fooÿñ", 'Does not escape valid sequence "Fooÿñ"']; // Checks that special characters are escaped. $script_tag = $this->prophesize(MarkupInterface::class); $script_tag->__toString()->willReturn('