Expanded class hierarchy of ExceptionDataCollectorTest
class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase {
protected function setUp() {
if (!class_exists('Symfony\\Component\\HttpFoundation\\Request')) {
$this
->markTestSkipped('The "HttpFoundation" component is not available');
}
}
public function testCollect() {
$e = new \Exception('foo', 500);
$c = new ExceptionDataCollector();
$flattened = FlattenException::create($e);
$trace = $flattened
->getTrace();
$this
->assertFalse($c
->hasException());
$c
->collect(new Request(), new Response(), $e);
$this
->assertTrue($c
->hasException());
$this
->assertEquals($flattened, $c
->getException());
$this
->assertSame('foo', $c
->getMessage());
$this
->assertSame(500, $c
->getCode());
$this
->assertSame('exception', $c
->getName());
$this
->assertSame($trace, $c
->getTrace());
}
}
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExceptionDataCollectorTest:: |
protected | function | ||
ExceptionDataCollectorTest:: |
public | function |