matches() public static méthode

Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
public static matches ( string $string ) : PHPUnit_Framework_Constraint_StringMatches
$string string
Résultat PHPUnit_Framework_Constraint_StringMatches
Exemple #1
0
/**
 * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
 *
 * @param  string $string
 * @return PHPUnit_Framework_Constraint_StringMatches
 * @since  Method available since Release 3.5.0
 */
function matches($string)
{
    return PHPUnit_Framework_Assert::matches($string);
}
 /**
  * @covers PHPUnit_Framework_Constraint_StringMatches
  * @covers PHPUnit_Framework_Assert::matches
  * @covers PHPUnit_Framework_Constraint::count
  */
 public function testConstraintStringMatches6()
 {
     $constraint = PHPUnit_Framework_Assert::matches('*%f*');
     $this->assertFalse($constraint->evaluate('**', '', true));
     $this->assertTrue($constraint->evaluate('*1.0*', '', true));
     $this->assertEquals('matches PCRE pattern "/^\\*[+-]?\\.?\\d+\\.?\\d*(?:[Ee][+-]?\\d+)?\\*$/s"', $constraint->toString());
     $this->assertEquals(1, count($constraint));
 }