openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

TestCase.class.php (925B)


      1 <?php
      2 
      3 
      4 namespace util\test;
      5 
      6 
      7 class TestCase
      8 {
      9 	public function run() {
     10 
     11 	}
     12 
     13 
     14 	protected function assertEquals( $expected,$reality )
     15 	{
     16 		if   ( $expected != $reality )
     17 			throw new \LogicException("Expected '$expected', but got '$reality'.");
     18 	}
     19 
     20 	protected function assertNotEmpty( $reality )
     21 	{
     22 		if   ( empty( $reality ) )
     23 			throw new \LogicException("Expected not empty, but got '$reality'.");
     24 	}
     25 
     26 	protected function assertEmpty( $reality )
     27 	{
     28 		if   ( !empty( $reality ) )
     29 			throw new \LogicException("Expected empty, but got '$reality'.");
     30 	}
     31 
     32 	protected function assertFalse( $reality )
     33 	{
     34 		if   ( $reality )
     35 			throw new \LogicException("Expected FALSE, but got '$reality'.");
     36 	}
     37 
     38 	protected function assertTrue( $reality )
     39 	{
     40 		if   ( ! $reality )
     41 			throw new \LogicException("Expected TRUE, but got '$reality'.");
     42 	}
     43 
     44 	protected function fail()
     45 	{
     46 		throw new \LogicException("This should not happen.");
     47 	}
     48 }