* @author Kornel LesiƄski * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @version SVN: $Id: XHTMLModeTest.php 888 2010-06-08 09:48:33Z kornel $ * @link http://phptal.org/ */ class XHTMLModeTest extends PHPTAL_TestCase { function testEmpty() { $tpl = $this->newPHPTAL(); $tpl->setSource(' <base href="http://example.com/"></base> <basefont face="Helvetica" /> <meta name="test" content=""></meta> <link rel="test"></link> </head> <body> <br/> <br /> <br></br> <hr/> <img src="test"></img> <form> <textarea /> <textarea tal:content="\'\'" /> <textarea tal:content="nonexistant | nothing" /> </form> </body> </html>'); $res = $tpl->execute(); $res = normalize_html($res); $exp = normalize_html('<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>



'); $this->assertEquals($exp, $res); } function testBoolean() { $tpl = $this->newPHPTAL(); $tpl->setSource(' '); $res = $tpl->execute(); $res = normalize_html($res); $exp = normalize_html(' '); $this->assertEquals($exp, $res); } function testBooleanOrNothing() { $tpl = $this->newPHPTAL()->setSource(' '); $tpl->options = array( array( 'label' => 'Option1', 'value' => 1 ), array( 'label' => 'Option2', 'value' => 2, 'isSelected' => true ), array( 'label' => 'Option3', 'value' => 3 ) ); $this->assertEquals(normalize_html(''), normalize_html($tpl->execute())); } }