Ejemplo n.º 1
0
 function testHttp_ViewPartialLoop()
 {
     $locator = new A_Locator();
     $view = new A_Http_View($locator);
     $file = 'foobar.php';
     $view->setTemplatePath(dirname(__FILE__) . '/templates');
     $data = array(array('foo' => 'One, ', 'bar' => 'Two. '), array('foo' => 'Three, ', 'bar' => 'Four. '), array('foo' => 'Five, ', 'bar' => 'Six. '));
     $this->assertEqual('One, Two. Three, Four. Five, Six. ', $view->partialLoop($file, $data));
     $data = array('One, ', 'Two, ', 'Three. ');
     $view->set('bar', '');
     // so so $foo in template is null
     $this->assertEqual('One, Two, Three. ', $view->partialLoop($file, 'foo', $data));
 }