Add test coverage for new exception types.

This commit is contained in:
Justin Hileman
2013-01-20 10:50:00 -08:00
parent 0436c59477
commit 8b02366a3f
4 changed files with 123 additions and 0 deletions
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of Mustache.php.
*
* (c) 2013 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class Mustache_Test_Exception_UnknownTemplateExceptionTest extends PHPUnit_Framework_TestCase
{
public function testInstance()
{
$e = new Mustache_Exception_UnknownTemplateException('mario');
$this->assertTrue($e instanceof InvalidArgumentException);
$this->assertTrue($e instanceof Mustache_Exception);
}
public function testMessage()
{
$e = new Mustache_Exception_UnknownTemplateException('luigi');
$this->assertEquals('Unknown template: luigi', $e->getMessage());
}
public function testGetTemplateName()
{
$e = new Mustache_Exception_UnknownTemplateException('yoshi');
$this->assertEquals('yoshi', $e->getTemplateName());
}
}