PHP Classes

File: tests/unit/Rule/LengthTest.php

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

Contents

Class file image Download
<?php

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

       
$rule = new A_Rule_Length(5, 10, 'test', 'error');
 
       
$dataspace->set('test', 'TEST123');
       
$this->assertTrue($rule->isValid($dataspace));

       
$dataspace->set('test', 'TEST');
       
$this->assertFalse($rule->isValid($dataspace));

       
$dataspace->set('test', 'TEST1234567890');
       
$this->assertFalse($rule->isValid($dataspace));
    }
   
}