Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }