PHP Classes

File: tests/unit/Rule/RangeTest.php

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

Contents

Class file image Download
<?php

class Rule_RangeTest extends UnitTestCase {
   
    function
setUp() {
    }
   
    function
TearDown() {
    }
   
    function
testRuleRange() {
         
$dataspace = new A_Collection();

         
$rule = new A_Rule_Range(5, 10, 'test', 'error');

          foreach (array(
5,7,10) as $value) {
             
$dataspace->set('test', $value);
            
$result = $rule->isValid($dataspace);
           
$this->assertTrue($result);
          }
         
        foreach (array(
2,3,11,13) as $value) {
             
$dataspace->set('test', $value);
            
$result = $rule->isValid($dataspace);
           
$this->assertFalse($result);
          }
    }
   
}