testMessage() public method

Returns a human readable test message.
public testMessage ( mixed $compare ) : string
$compare mixed Comparison value.
return string Description of success or failure.
 /**
  *    Returns a human readable test message.
  *    @param mixed $compare      Comparison value.
  *    @return string             Description of success
  *                               or failure.
  */
 function testMessage($actual)
 {
     return parent::testMessage($this->getProperty($this->name, $actual));
 }
 function testMessage($compare)
 {
     $compare->message = '';
     return parent::testMessage($compare);
 }
Beispiel #3
0
 function testType()
 {
     $string = new IdenticalExpectation("37");
     $this->assertTrue($string->test("37"));
     $this->assertFalse($string->test(37));
     $this->assertFalse($string->test("38"));
     $this->assertPattern('/identical.*?string.*?37/i', $string->testMessage("37"));
     $this->assertPattern('/fails.*?37/', $string->testMessage(37));
     $this->assertPattern('/at character 1/', $string->testMessage("38"));
 }