public function should_render_inherited_template() { $h2o = new H2o('inherited.html', $this->option); expects($h2o->render())->should_be('header,extended body,footer'); # extend nested blocks $h2o->loadTemplate('nested_inherit'); expects($h2o->render())->should_be('h2o template rocks so hard ! and plays so hard'); }
public function should_be_able_to_load_template_lazily() { $h2o = new H2o('a.html', array('searchpath' => 'templates')); expects($h2o->render())->should_not_be_empty(); $h2o = new H2o(null, array('searchpath' => 'templates')); $h2o->loadTemplate('b.html'); expects($h2o->render())->should_not_be_empty(); }
function should_be_able_to_load_template_lazily() { chdir(dirname(__FILE__)); $paths = array(dirname(__FILE__) . DS . 'templates' . DS); $h2o = h2o('a.html', array('searchpath' => $paths)); expects($h2o->render())->should_not_be_empty(); $h2o = new H2o('a.html', array('searchpath' => 'templates')); expects($h2o->render())->should_not_be_empty(); $h2o = new H2o(null, array('searchpath' => 'templates')); $h2o->loadTemplate('b.html'); expects($h2o->render())->should_not_be_empty(); }