Improve Mustache exception types, catchability.
* Subclass common exception types (runtime, logic, invalid argument). * Add new "unknown x" exceptions for filters, helpers and templates. * Make all Mustache exceptions implement Mustache_Exception interface… Gotta catch 'em all!
This commit is contained in:
@@ -141,7 +141,7 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException Mustache_Exception_InvalidArgumentException
|
||||
* @dataProvider getBadEscapers
|
||||
*/
|
||||
public function testNonCallableEscapeThrowsException($escape)
|
||||
@@ -158,7 +158,7 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException RuntimeException
|
||||
* @expectedException Mustache_Exception_RuntimeException
|
||||
*/
|
||||
public function testImmutablePartialsLoadersThrowException()
|
||||
{
|
||||
@@ -223,7 +223,7 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException Mustache_Exception_InvalidArgumentException
|
||||
*/
|
||||
public function testSetHelpersThrowsExceptions()
|
||||
{
|
||||
@@ -232,7 +232,7 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException Mustache_Exception_InvalidArgumentException
|
||||
*/
|
||||
public function testSetLoggerThrowsExceptions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user