test() 공개 메소드

Tests the expectation. True if it matches the held value.
public test ( mixed $compare ) : boolean
$compare mixed Comparison value.
리턴 boolean True if correct.
예제 #1
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);
 }
예제 #2
0
 function testEqualComparisonOfMocksDoesNotCrash()
 {
     $expectation = new EqualExpectation(new MockDummy());
     $this->assertTrue($expectation->test(new MockDummy(), true));
 }
예제 #3
0
 function test($compare)
 {
     return parent::test(str_replace('\\', '/', $compare));
 }
예제 #4
0
 function testHashWithOutOfOrderKeysShouldStillMatch()
 {
     $any_order = new EqualExpectation(array('a' => 1, 'b' => 2));
     $this->assertTrue($any_order->test(array('b' => 2, 'a' => 1)));
 }
예제 #5
0
 public function test($compare)
 {
     return parent::test(str_replace("\\", '/', $compare));
 }
예제 #6
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;
 }