[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/tests/cases/functional/ -> WactProcessingInstructionTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  class WactProcessingInstructionTest extends WactTemplateTestCase
  11  {
  12    function testXmlProcessingInstruction()
  13    {
  14      $template = '<?xml version="1.0"?>';
  15      $this->registerTestingTemplate('/procinst/xml_processing_instruction.html', $template);
  16  
  17      $page = $this->initTemplate('/procinst/xml_processing_instruction.html');
  18      $this->assertEqual($page->capture(),$template."\n");
  19    }
  20  
  21    function testPHPProcessingInstruction()
  22    {
  23      $template = '<?php
  24  /*
  25   * Limb PHP Framework
  26   *
  27   * @link http://limb-project.com 
  28   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
  29   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
  30   */
  31   echo "Foo"; ?>';
  32      $this->registerTestingTemplate('/procinst/php_processing_instruction.html', $template);
  33  
  34      $page = $this->initTemplate('/procinst/php_processing_instruction.html');
  35      $this->assertEqual($page->capture(),'Foo');
  36    }
  37  
  38    function testSeveralPHPBlocks()
  39    {
  40      $template = '<?php echo "Foo"; ?><tr><td><?php echo "Foo"; ?></td></tr>';
  41      $this->registerTestingTemplate('/procinst/several_php_blocks.html', $template);
  42  
  43      $page = $this->initTemplate('/procinst/several_php_blocks.html');
  44      $this->assertEqual($page->capture(), 'Foo<tr><td>Foo</td></tr>');
  45    }
  46  
  47    function testPHPWithHtmlBlocks()
  48    {
  49      $template = '<?php foreach(array("foo", "bar") as $item) { ?><b><?php echo $item; ?></b><?php } ?>';
  50      $this->registerTestingTemplate('/procinst/php_html_blocks.html', $template);
  51  
  52      $page = $this->initTemplate('/procinst/php_html_blocks.html');
  53      $this->assertEqual($page->capture(), '<b>foo</b><b>bar</b>');
  54    }
  55  }
  56  ?>


Generated: Thu Jan 8 04:06:23 2009 Cross-referenced by PHPXref 0.7