<?php/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    Samuel Blume <sam at blueshoes dot org>
* @author    Andrej Arn <andrej at blueshoes dot org>
*/?><?php
require_once($APP['path']['core'] . 'html/form/Bs_FormTemplateParser.class.php');class Bs_FormTemplateParser_PhpUnit extends Bs_TestCase {var $_Bs_FormTemplateParser;function Bs_FormTemplateParser_PhpUnit($name) {$this->Bs_TestCase($name);$this->_Bs_FormTemplateParser =& new Bs_FormTemplateParser;}
function __Bs_FormTemplateParser_getTagName() {$expected = 'something';$tag      = '<something param=value>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = 'something';$tag      = '<!something param=value>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = 'something';$tag      = '<something>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = 'something';$tag      = '<!something>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = 'something';$tag      = '<something/>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = 'something';$tag      = '<!something/>';$actual = $this->_Bs_FormTemplateParser->getTagName($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");}
function __Bs_FormTemplateParser_isCommentedOut() {$expected = FALSE;$tag      = "<!bs type=\"formelement\" name=\"name\" multiple value='sam&#039;s pizzaland'/>";$actual   = $this->_Bs_FormTemplateParser->isCommentedOut($tag, FALSE);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "' not using strict.");$expected = TRUE;$tag      = "<!bs type=\"formelement\" name=\"name\" multiple value='sam&#039;s pizzaland'/>";$actual   = $this->_Bs_FormTemplateParser->isCommentedOut($tag, TRUE);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "' using strict.");$expected = FALSE;$tag      = "<bs type=\"formelement\" name=\"name\" multiple value='sam&#039;s pizzaland'/>";$actual   = $this->_Bs_FormTemplateParser->isCommentedOut($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");}
function __Bs_FormTemplateParser_parseTag() {$expected = array('type'=>'formelement', 'name'=>'name', 'multiple'=>TRUE, 'value'=>'sam\'s pizzaland');$tag      = "<bs type=\"formelement\" name=\"name\" multiple value='sam&#039;s pizzaland'/>";$actual   = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = array();$tag      = "<bs/>";$actual = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = array('multiple'=>TRUE);$tag      = "<bs multiple/>";$actual   = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = array('key'=>'value');$tag      = "<bs key=value>";$actual   = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = array('key'=>'value');$tag      = "<bs key=value/>";$actual   = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");$expected = array('key'=>'value');$tag      = "<!bs key=value />";$actual   = $this->_Bs_FormTemplateParser->parseTag($tag);$this->assertEquals($expected, $actual, "tag was '" . htmlSpecialChars($tag) . "'");}
}
?>