public function testGetViewFolder() { $o = new testView(); $t = 'test'; $o->setFolder($t); $this->assertEquals($t, $o->getViewFolder()); }
public function testSetMainTemplateBroken() { $o = new testView(); $t = ''; try { $o->setMainTemplate($t); } catch (\Exception $e) { $this->assertInstanceOf(Exception::class, $e); $this->assertInstanceOf(ExceptionPath::class, $e); } $this->assertEmpty($o->getMainTemplate()); }
public function testGetModel() { $o = new testView(); try { // empty $o->getModel(); } catch (\Exception $e) { $this->assertInstanceOf(Exception::class, $e); $this->assertInstanceOf(ExceptionView::class, $e); } $f = new ModelFixture(); $o->setModel($f); $m = $o->getModel(); $this->assertInstanceOf(ModelA::class, $m); $this->assertInstanceOf(ModelFixture::class, $m); $this->assertEquals($f, $m); }
public function testGetOutput() { $o = new testView(); try { $o->getOutput(); } catch (\Exception $e) { $this->assertInstanceOf(Exception::class, $e); $this->assertInstanceOf(ExceptionView::class, $e); } $t = 'main.tpl.php'; $oMap = new ClassMap(__FILE__, '\\A.*\\Z'); $oMap->setTemplatePath(VSC_FIXTURE_PATH . 'templates/'); $oMap->setTemplate($t); $o->setMap($oMap); $f = new ModelFixture(); $o->setModel($f); $output = $o->getOutput(); $this->assertEquals(file_get_contents(VSC_FIXTURE_PATH . 'templates/' . $t), $output); }
public function testGetTitleFromModel() { $o = new testView(); try { $this->assertEmpty($o->getTitle()); } catch (\Exception $e) { // catching a model exception } $oMap = new ClassMap(__FILE__, '\\A.*\\Z'); $oMap->setTemplatePath(VSC_FIXTURE_PATH . 'templates/'); $oMap->setTemplate('main.tpl.php'); $o->setMap($oMap); $f = new EmptyModel(); $o->setModel($f); $this->assertEmpty($o->getTitle()); $t = uniqid('test:'); $f->setPageTitle($t); $this->assertEquals($t, $o->getTitle()); }
public function testGetMainTemplateEmpty() { $o = new testView(); $path = $o->getMainTemplate(); $this->assertEmpty($path); }
public function testGetUriParser() { $o = new testView(); $p = $o->getUriParser(); $this->assertInstanceOf(UrlParserA::class, $p); }
public function testGetContentTypeEmpty() { $o = new testView(); $this->assertEmpty($o->getContentType()); }