mirror of
https://github.com/filp/whoops.git
synced 2026-09-24 09:09:37 +00:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Damnit - php errors for cool kids
|
|
* @author Filipe Dobreira <http://github.com/filp>
|
|
*/
|
|
|
|
namespace Damnit\Exception;
|
|
use Damnit\Exception\Inspector;
|
|
use Damnit\TestCase;
|
|
use \RuntimeException;
|
|
use \Exception;
|
|
|
|
class InspectorTest extends TestCase
|
|
{
|
|
/**
|
|
* @param Exception $exception|null
|
|
* @return Damnit\Exception\Inspector
|
|
*/
|
|
protected function getInspectorInstance(Exception $exception = null)
|
|
{
|
|
return new Inspector($exception);
|
|
}
|
|
|
|
/**
|
|
* @covers Damnit\Exception\Inspector::__construct
|
|
* @covers Damnit\Exception\Inspector::getException
|
|
*/
|
|
public function testExceptionIsStoredAndReturned()
|
|
{
|
|
$exception = new RuntimeException;
|
|
$inspector = $this->getInspectorInstance($exception);
|
|
|
|
$this->assertSame($exception, $inspector->getException());
|
|
}
|
|
|
|
/**
|
|
* @covers Damnit\Exception\Inspector::getFrames
|
|
*/
|
|
public function testGetFramesReturnsIterator()
|
|
{
|
|
$exception = new RuntimeException;
|
|
$inspector = $this->getInspectorInstance($exception);
|
|
|
|
$this->assertInstanceOf('Damnit\\Exception\\FrameIterator', $inspector->getFrames());
|
|
}
|
|
}
|