some modifications for test isolation in DEBUG environment

This commit is contained in:
Anton Grebnev
2011-10-28 13:50:15 +04:00
parent 6cee0efa6f
commit c7993193de
5 changed files with 62 additions and 28 deletions

View File

@ -56,7 +56,23 @@ class ErrorHandlerTest extends PHPUnit_Framework_TestCase
$this->assertStringStartsWith('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', $result);
$this->assertStringEndsWith('</html>', $result);
}
}
/**
* @TODO: ErrorHandler::wrapTrace not used
* @TODO: nl2br() adds html <br /> but leaves original linebreak line \n
*/
public function testWrapTrace()
{
$class = new ReflectionClass('ErrorHandler');
$method = $class->getMethod('WrapTrace');
$method->setAccessible(true);
$result = $method->invoke(null, "first line\nsecond line");
$this->assertEquals("<code>first line<br />\nsecond line</code>", $result);
$result = $method->invoke(null, "first line\r\nsecond line");
$this->assertEquals("<code>first line<br />\r\nsecond line</code>", $result);
$result = $method->invoke(null, "first line\r\n\r\nsecond line");
$this->assertEquals("<code>first line<br />\r\n<br />\r\nsecond line</code>", $result);
}
public function tearDown()