PHP Classes

File: tests/unit/Sql/LogicallistTest.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   tests/unit/Sql/LogicallistTest.php   Download  
File: tests/unit/Sql/LogicallistTest.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: 722 bytes
 

Contents

Class file image Download
<?php

class Sql_LogicallistTest extends UnitTestCase {
   
    function
setUp() {
    }
   
    function
TearDown() {
    }
   
    function
testSql_LogicallistEmpty() {
         
$element = array('foo', 'bar', 'baz');
         
$list = new A_Sql_Logicallist();
       
$this->assertEqual($list->render(), '');
    }
   
    function
testSql_LogicallistArrayOneElement() {
         
$list = new A_Sql_Logicallist($element);
        
$this->assertEqual($list->addExpression(array('foo'=>'bar'))->render(), "(foo = 'bar')");
    }
   
    function
testSql_LogicallistArrayTwoElements() {
         
$list = new A_Sql_Logicallist($element);
        
$this->assertEqual($list->addExpression(array('foo'=>'bar', 'faz'=>'baz'))->render(), "(foo = 'bar' AND faz = 'baz')");
    }
   
}