@package SimpleTest
상속: extends SimpleExpectation
예제 #1
0
 function testEqualComparisonOfMocksDoesNotCrash()
 {
     $expectation = new EqualExpectation(new MockDummy());
     $this->assertTrue($expectation->test(new MockDummy(), true));
 }
예제 #2
0
 /**
  *    Tests the expectation. True if it differs from the
  *    held value.
  *    @param mixed $compare        Comparison value.
  *    @return boolean              True if correct.
  *    @access public
  */
 function test($compare)
 {
     return !parent::test($compare);
 }
예제 #3
0
 function test($compare)
 {
     return parent::test(str_replace('\\', '/', $compare));
 }
예제 #4
0
 /**
  *    Sets the value to compare against.
  *    @param mixed $value       Test value to match.
  *    @param string $message    Customised message on failure.
  *    @access public
  */
 function __construct($value, $message = '%s')
 {
     parent::__construct($value, $message);
 }
예제 #5
0
 function testHashWithOutOfOrderKeysShouldStillMatch()
 {
     $any_order = new EqualExpectation(array('a' => 1, 'b' => 2));
     $this->assertTrue($any_order->test(array('b' => 2, 'a' => 1)));
 }
예제 #6
0
 public function test($compare)
 {
     return parent::test(str_replace("\\", '/', $compare));
 }
예제 #7
0
 function testMessage($compare)
 {
     $message = '';
     foreach ($this->expected as $key => $value) {
         if (isset($compare[$key])) {
             $e = new EqualExpectation($value);
             if ($e->test($compare[$key])) {
                 $message .= $key . ' ok.';
             } else {
                 $message .= $key . ' => ' . $e->overlayMessage($compare[$key], $this->_dumper);
             }
         } else {
             return $key . ' not found';
         }
     }
     return $message;
 }