test() public method

Tests the expectation. True if the Perl regex matches the comparison value.
public test ( string $compare ) : boolean
$compare string Comparison value.
return boolean True if correct.
 /**
  *    Tests the expectation. False if the Perl regex
  *    matches the comparison value.
  *    @param string $compare        Comparison value.
  *    @return boolean               True if correct.
  *    @access public
  */
 function test($compare)
 {
     return !parent::test($compare);
 }
Example #2
0
 function testWanted()
 {
     $pattern = new PatternExpectation('/hello/i');
     $this->assertTrue($pattern->test("Hello world"));
     $this->assertFalse($pattern->test("Goodbye world"));
 }