Nelmio\Alice\Definition\Value\FixtureMatchReferenceValue::match PHP Method

match() public method

public match ( string $value ) : boolean
$value string
return boolean
    public function match(string $value) : bool
    {
        return 1 === preg_match($this->pattern, $value);
    }

Usage Example

 public function testCanMatchAgainstValues()
 {
     $regex = '/^d/';
     $value = new FixtureMatchReferenceValue($regex);
     $this->assertTrue($value->match('d'));
     $this->assertFalse($value->match('a'));
 }