[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/tests/cases/ -> WactTestTemplateLocator.test.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  require_once('limb/wact/tests/cases/WactTemplateTestCase.class.php');
  11  require_once('limb/wact/tests/cases/WactTestTemplateLocator.class.php');
  12  
  13  class WactTestTemplateLocatorCase extends WactTemplateTestCase {
  14  
  15    protected $locator;
  16  
  17    function setUp()
  18    {
  19      parent :: setUp();
  20  
  21      $this->locator = new WactTestTemplateLocator($this->default_config);
  22    }
  23  
  24    function testLocatorRegisterTemplateNoAlias()
  25    {
  26      $this->locator->registerTestingTemplate($template_file_path = 'template.html',
  27                                              $templateContent = 'TemplateCode');
  28  
  29      $this->assertEqual($this->locator->locateSourceTemplate($template_file_path),
  30                         $template_file_path);
  31  
  32      $this->assertEqual($this->locator->locateCompiledTemplate($template_file_path),
  33                         $this->default_config->getCacheDir().'/'. $template_file_path . '.php');
  34  
  35      $this->assertEqual($this->locator->readTemplateFile($template_file_path),
  36                         $templateContent);
  37    }
  38  
  39    function testLocatorRegisterTemplateWithAlias()
  40    {
  41      $this->locator->registerTestingTemplate($template_file_path = '/path/to/template.html',
  42                                              $templateContent = 'TemplateCode',
  43                                              $template_file_name = 'template.html');
  44  
  45      $this->assertEqual($this->locator->locateSourceTemplate($template_file_name),
  46                         $template_file_path);
  47  
  48      $this->assertEqual($this->locator->locateCompiledTemplate($template_file_name),
  49                         $this->default_config->getCacheDir().'/'. $template_file_path . '.php');
  50  
  51      $this->assertEqual($this->locator->readTemplateFile($template_file_path),
  52                         $templateContent);
  53    }
  54  }
  55  ?>


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