feat(expectations): add toMatchRegEx

This commit is contained in:
Owen Voke
2020-09-16 18:56:16 +01:00
parent 281166475e
commit 16b9f54dc3
2 changed files with 25 additions and 0 deletions

View File

@ -505,6 +505,16 @@ final class Expectation
return $this;
}
/**
* Asserts that the value matches a regular expression.
*/
public function toMatchRegEx(string $expression): Expectation
{
Assert::assertMatchesRegularExpression($expression, $this->value);
return $this;
}
/**
* Asserts that the value matches a constraint.
*/