public function testCustomTemplate() { $this->handler->set_template_loader(function () { return 'render_test'; }); $this->pump->set_output_handler($this->handler); $this->pump->QueueTask(new CustomViewTask()); TestView::SetupPaths(); ob_start(); $this->pump->StopPump(); $data = ob_get_contents(); ob_end_clean(); $expected = "This is a custom template."; $this->assertEquals($expected, $data); }
public function testRender() { TestView::SetupPaths(); $view = new TestView('render_test'); $view->name = 'Rob'; ob_start(); $view->Render(); $actual = ob_get_contents(); ob_end_clean(); $this->assertEquals('Hi, my name is Rob. This is undefined: .', $actual); }