[ Index ]

PHP Cross Reference of Web Application Component Toolkit

title

Body

[close]

/tests/cases/template/compiler/ -> tagdictionary.test.php (source)

   1  <?php
   2  /**
   3  * @package WACT_TESTS
   4  * @version $Id: tagdictionary.test.php,v 1.7 2004/11/12 21:25:15 jeffmoore Exp $
   5  */
   6  require_once WACT_ROOT . 'template/compiler/compilercomponent.inc.php';
   7  require_once WACT_ROOT . 'template/compiler/servercomponent.inc.php';
   8  require_once WACT_ROOT . 'template/compiler/servertagcomponent.inc.php';
   9  require_once WACT_ROOT . 'template/compiler/tagdictionary.inc.php';
  10  
  11  /**
  12  * @package WACT_TESTS
  13  */
  14  class TagDictionaryTestCase extends UnitTestCase {
  15  	function TagDictionaryTestCase($name = 'TagDictionary test cases') {
  16          $this->UnitTestCase($name);
  17      }
  18  	function setUp() {
  19          $this->dict = & new TagDictionary();
  20          $this->dict->_registerTag(new TagInfo('testtag', 'Blah'));
  21      }
  22  	function tearDown() {
  23          unset ( $this->dict );
  24      }
  25  	function testGetTagInfo() {
  26          $this->assertIsA($this->dict->getTagInfo('TeStTag'), 'TagInfo');
  27      }
  28  	function testGetInstance() {
  29          $this->assertIsA($this->dict->getInstance(),'TagDictionary');
  30      }
  31  
  32  	function testNotATag() {
  33          $KnownParent =& new ServerTagComponentTag($this);
  34          $tag = 'notatag';
  35          $attrs = array();
  36          $this->assertFalse($this->dict->findComponent($tag, $attrs, FALSE, $KnownParent));
  37      }
  38  
  39  	function testRunatEqualsClient() {
  40          $KnownParent =& new ServerTagComponentTag($this);
  41          $tag = 'foo';
  42          $attrs = array('runat'=>'client');
  43          $this->assertNull($this->dict->findComponent($tag, $attrs, FALSE, $KnownParent));
  44      }
  45  
  46  	function testComponentWithRunatServer() {
  47          $KnownParent =& new ServerTagComponentTag($this);
  48          $this->dict->_registerTag(new TagInfo('isatag', 'blah'));
  49          $tag = 'iSaTag';
  50          $attrs = array('runat'=>'server');
  51          $this->assertIsA($this->dict->findComponent($tag, $attrs, FALSE, $KnownParent), 'TagInfo');
  52      }
  53  
  54  	function testGenericTag() {
  55          $KnownParent = & new ServerTagComponentTag($this);
  56          $tag = 'iSaGenericTag';
  57          $attrs = array('runat' => 'server');
  58          $this->assertIsA($this->dict->findComponent($tag, $attrs, TRUE, $KnownParent), 'TagInfo');
  59      }
  60  
  61  	function testGenericContainerTag() {
  62          $KnownParent =& new ServerTagComponentTag($this);
  63          $tag = 'iSaGenericContainerTag';
  64          $attrs = array('runat'=>'server');
  65          $this->assertIsA($this->dict->findComponent($tag, $attrs, FALSE, $KnownParent), 'TagInfo');
  66      }
  67  
  68  }
  69  ?>


Generated: Sun Nov 28 19:36:09 2004 Cross-referenced by PHPXref 0.5