33 $this->fixture = $this->getMock(
'TYPO3\\CMS\\Core\\Error\\ProductionExceptionHandler', array(
'discloseExceptionInformation',
'sendStatusHeaders',
'writeLogEntries'), array(),
'', FALSE);
34 $this->fixture->expects($this->any())->method(
'discloseExceptionInformation')->will($this->returnValue(TRUE));
41 $message =
'<b>b</b><script>alert(1);</script>';
42 $exception = new \Exception($message);
44 $this->fixture->echoExceptionWeb($exception);
45 $output = ob_get_contents();
47 $this->assertContains(htmlspecialchars($message), $output);
48 $this->assertNotContains($message, $output);
54 public function echoExceptionWebEscapesExceptionTitle() {
55 $title =
'<b>b</b><script>alert(1);</script>';
57 $exception = $this->getMock(
'Exception', array(
'getTitle'), array(
'some message'));
58 $exception->expects($this->any())->method(
'getTitle')->will($this->returnValue($title));
60 $this->fixture->echoExceptionWeb($exception);
61 $output = ob_get_contents();
63 $this->assertContains(htmlspecialchars($title), $output);
64 $this->assertNotContains($title, $output);
echoExceptionWebEscapesExceptionMessage()