TYPO3 CMS  TYPO3_6-2
DebugExceptionHandlerTest.php
Go to the documentation of this file.
1 <?php
3 
23 
27  protected $fixture = NULL;
28 
32  protected function setUp() {
33  $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Error\\DebugExceptionHandler', array('sendStatusHeaders', 'writeLogEntries'), array(), '', FALSE);
34  $this->fixture->expects($this->any())->method('discloseExceptionInformation')->will($this->returnValue(TRUE));
35  }
36 
41  $message = '<b>b</b><script>alert(1);</script>';
42  $exception = new \Exception($message);
43  ob_start();
44  $this->fixture->echoExceptionWeb($exception);
45  $output = ob_get_contents();
46  ob_end_clean();
47  $this->assertContains(htmlspecialchars($message), $output);
48  $this->assertNotContains($message, $output);
49  }
50 
51 }