Improve Whoops\Run test coverage

This commit is contained in:
filp
2013-04-24 19:05:28 +01:00
parent 2c1daf7fda
commit 71ec6e3981
+20
View File
@@ -78,6 +78,26 @@ class RunTest extends TestCase
$this->assertContains($handlerTwo, $handlers);
}
/**
* @expectedException InvalidArgumentException
* @covers Whoops\Run::pushHandler
*/
public function testPushInvalidHandler()
{
$run = $this->getRunInstance();
$run->pushHandler($banana = 'actually turnip');
}
/**
* @covers Whoops\Run::pushHandler
*/
public function testPushClosureBecomesHandler()
{
$run = $this->getRunInstance();
$run->pushHandler(function() {});
$this->assertInstanceOf('Whoops\\Handler\\CallbackHandler', $run->popHandler());
}
/**
* @covers Whoops\Run::popHandler
* @covers Whoops\Run::getHandlers