Location: PHPKode > scripts > RogePHP > RoguePHP-0.9.4/RoguePHP-0.9.4/tests/views/TestReferences.php
<?php

//define ('LIB_CACHE_ENABLE', true);
define ('VIEW_DIR', dirname(__FILE__) . '/');
require '/usr/local/etc/tm.php';
define ('ROGUE_DIR', '/code/rogue');

define('XHTML_EOL', "");
define('XHTML_EOT', "");
define('XHTML_DEBUG', true);
/**
 * Description of TestConditionals
 *
 * @author cory
 */
class TestConditionals extends PHPUnit_Framework_TestCase
{

    public function testSimpleList()
    {
        $view = new XhtmlView('listReferences.xhtml');
        $view->add('baz', array('num1', 'num2', 'num3'));
        $result = $view->render('body', 'test1');
        $this->assertEquals("<div><ul><li>num1</li><li>num2</li><li>num3</li></ul></div>", $result);
    }

	public function testBasicList()
    {
        $view = new XhtmlView('listReferences.xhtml');
        $view->add('baz', array(array('foo' =>'num1'), array('foo' => 'num2'), array('foo' => 'num3')));
        $result = $view->render('body', 'test2');
        $this->assertEquals("<div><ul><li>num1</li><li>num2</li><li>num3</li></ul></div>", $result);
    }

	public function testBasicListWithRef()
    {
        $view = new XhtmlView('listReferences.xhtml');
        $view->add('baz', array(array('foo' =>'num1'), array('foo' => 'num2')));
	$view->add('extra', 'data');
        $result = $view->render('body', 'test3');
        $this->assertEquals("<div><ul><li>num1<p>data</p></li><li>num2<p>data</p></li></ul></div>", $result);
    }

}
?>
Return current item: RogePHP