mirror of
https://github.com/filp/whoops.git
synced 2026-09-15 12:16:18 +00:00
Skip test if Error class does not exist
This commit is contained in:
@@ -49,13 +49,17 @@ class InspectorTest extends TestCase
|
||||
*/
|
||||
public function testDoesNotFailOnPHP7ErrorObject()
|
||||
{
|
||||
if (class_exists('Error')) {
|
||||
$inner = new \Error('inner');
|
||||
$outer = $this->getException('outer', 0, $inner);
|
||||
$inspector = $this->getInspectorInstance($outer);
|
||||
$frames = $inspector->getFrames();
|
||||
$this->assertSame($outer->getLine(), $frames[0]->getLine());
|
||||
if (!class_exists('Error')) {
|
||||
$this->markTestSkipped(
|
||||
'PHP 5.x, the Error class is not available.'
|
||||
);
|
||||
}
|
||||
|
||||
$inner = new \Error('inner');
|
||||
$outer = $this->getException('outer', 0, $inner);
|
||||
$inspector = $this->getInspectorInstance($outer);
|
||||
$frames = $inspector->getFrames();
|
||||
$this->assertSame($outer->getLine(), $frames[0]->getLine());
|
||||
}
|
||||
/**
|
||||
* @covers Whoops\Exception\Inspector::getExceptionName
|
||||
|
||||
Reference in New Issue
Block a user