PHP Classes

File: tests/unit/Rule/RegexpTest.php

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

Contents

Class file image Download
<?php

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

       
$rule = new A_Rule_Regexp('/123$/', 'test', 'error');

       
$dataspace->set('test', 'test123');
       
$result = $rule->isValid($dataspace);
       
$this->assertTrue($result);
       
       
$dataspace->set('test', 'test234');
        
$result = $rule->isValid($dataspace);
       
$this->assertFalse($result);
    }
   
}