Add exception chaining

This commit is contained in:
Chris Wilkinson
2016-02-23 07:49:22 +00:00
parent 865de4114a
commit c858bb1f1a
8 changed files with 82 additions and 13 deletions
@@ -29,4 +29,15 @@ class Mustache_Test_Exception_UnknownHelperExceptionTest extends PHPUnit_Framewo
$e = new Mustache_Exception_UnknownHelperException('gamma');
$this->assertEquals('gamma', $e->getHelperName());
}
public function testPrevious()
{
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
$this->markTestSkipped('Exception chaining requires at least PHP 5.3');
}
$previous = new Exception();
$e = new Mustache_Exception_UnknownHelperException('foo', $previous);
$this->assertSame($previous, $e->getPrevious());
}
}