Example #1
0
 public function testRenderWithPartials()
 {
     $view = new View();
     $view->setViewsDir('unit-tests/views/');
     $expectedParams = array('cool_var' => 'FooBar');
     ob_start();
     $view->partial('partials/_partial1', $expectedParams);
     ob_clean();
     $this->assertEquals('Hey, this is a partial, also FooBar', $view->getContent());
     $view->setVars($expectedParams);
     $this->assertEquals('Hey, this is a partial, also FooBar', $view->render('test5/index'));
     $this->assertEquals('Hey, this is a partial, also FooBar<br />Hey, this is a second partial, also FooBar', $view->render('test9/index'));
 }