diff --git a/tst/ViewTest.php b/tst/ViewTest.php index d2e2131..484ad46 100644 --- a/tst/ViewTest.php +++ b/tst/ViewTest.php @@ -27,7 +27,7 @@ class ViewTest extends PHPUnit_Framework_TestCase private static $version = 'Version 1.2.3'; - private $_content; + private $_content = array(); public function setUp() { @@ -56,10 +56,17 @@ class ViewTest extends PHPUnit_Framework_TestCase $page->assign('EXPIREDEFAULT', self::$expire_default); $page->assign('EXPIRECLONE', true); $page->assign('URLSHORTENER', ''); - ob_start(); - $page->draw('page'); - $this->_content = ob_get_contents(); - ob_end_clean(); + + $dir = dir(PATH . 'tpl'); + while (false !== ($file = $dir->read())) { + if (substr($file, -4) === '.php') { + $template = substr($file, 0, -4); + ob_start(); + $page->draw($template); + $this->_content[$template] = ob_get_contents(); + ob_end_clean(); + } + } } public function tearDown() @@ -69,39 +76,41 @@ class ViewTest extends PHPUnit_Framework_TestCase public function testTemplateRendersCorrectly() { - $this->assertContains( - '