UTFileLock Class Reference
[Unit Tests - Unit tests for all classes/functions in fareofficelib.]

Unit test for all functions in FileLock.php. More...

List of all members.

Public Member Functions

 doTest ()

Private Member Functions

 _test ()


Detailed Description

Unit test for all functions in FileLock.php.

Author:
Daniel Lindh <[email protected]>

Definition at line 8 of file UTFileLock.class.php.


Member Function Documentation

UTFileLock::_test (  )  [private]

Definition at line 15 of file UTFileLock.class.php.

Referenced by doTest().

00016   {
00017     $this->setSectionLabel('deleteAllLocks');
00018     $lockRoot = new FileLock('/');
00019     eval($this->needFalse('$lockRoot->deleteAllLocks()'));
00020 
00021     $lockEmpty = new FileLock('');
00022     eval($this->needFalse('$lockEmpty->deleteAllLocks()'));
00023 
00024     $this->setSectionLabel('isLockExpired');
00025     $lock = new FileLock('/tmp/locks/');
00026     eval($this->needTrue('$lock->deleteAllLocks()'));
00027 
00028     eval($this->needTrue('$lock->isLockExpired("SMS", 60, false)'));
00029     eval($this->needFalse('$lock->isLockExpired("SMS", 60, false)'));
00030     eval($this->needFalse('$lock->isLockExpired("SMS", 60, false)'));
00031 
00032     eval($this->needTrue('$lock->isLockExpired("SMS", 60, true)'));
00033     eval($this->needFalse('$lock->isLockExpired("SMS", 60, true)'));
00034     eval($this->needFalse('$lock->isLockExpired("SMS", 60, true)'));
00035 
00036     eval($this->needTrue('$lock->isLockExpired("EMAIL")'));
00037     eval($this->needFalse('$lock->isLockExpired("EMAIL")'));
00038 
00039     eval($this->needTrue('$lock->isLockExpired("PHONE", 0)'));
00040     sleep(1);
00041     eval($this->needTrue('$lock->isLockExpired("PHONE", 0)'));
00042   }

UTFileLock::doTest (  ) 

Definition at line 10 of file UTFileLock.class.php.

References _test().

00011   {
00012     $this->_test();
00013   }


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:28:24 2009 for fareofficelib by  doxygen 1.5.8