UnknownTemplateExceptionTest.php 936 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of Mustache.php.
  4. *
  5. * (c) 2013 Justin Hileman
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Mustache_Test_Exception_UnknownTemplateExceptionTest extends PHPUnit_Framework_TestCase
  11. {
  12. public function testInstance()
  13. {
  14. $e = new Mustache_Exception_UnknownTemplateException('mario');
  15. $this->assertTrue($e instanceof InvalidArgumentException);
  16. $this->assertTrue($e instanceof Mustache_Exception);
  17. }
  18. public function testMessage()
  19. {
  20. $e = new Mustache_Exception_UnknownTemplateException('luigi');
  21. $this->assertEquals('Unknown template: luigi', $e->getMessage());
  22. }
  23. public function testGetTemplateName()
  24. {
  25. $e = new Mustache_Exception_UnknownTemplateException('yoshi');
  26. $this->assertEquals('yoshi', $e->getTemplateName());
  27. }
  28. }