PHP Classes

File: tests/unit/Cli/ViewTest.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   tests/unit/Cli/ViewTest.php   Download  
File: tests/unit/Cli/ViewTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 608 bytes
 

Contents

Class file image Download
<?php

class Cli_ViewTest extends UnitTestCase {
   
    function
setUp() {
    }
   
    function
TearDown() {
    }
   
    function
testCli_ViewNotNull() {
       
$locator = new A_Locator();
       
$Cli_View = new A_Cli_View($locator);
       
       
$this->assertEqual($Cli_View->render(), '');
           
       
$str = 'Hello world!';
       
$Cli_View->setContent($str);
       
$this->assertEqual($Cli_View->render(), $str);
           
       
$Cli_View->setTemplatePath(dirname(__FILE__) . '/templates'); // needed because ../menu.php runs this script
       
$Cli_View->setTemplate('test1');
       
$this->assertEqual($Cli_View->render(), "foo\nbar\n");
    }
   
}