コード例 #1
0
 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');
 }
コード例 #2
0
ファイル: loader_spec.php プロジェクト: tonjoo/tiga-framework
 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();
 }
コード例 #3
0
ファイル: loader_spec.php プロジェクト: JSilva/h2o-php
 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();
 }