mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
chore(expectations): rename 'toMatchRegEx' to 'toMatch'
This commit is contained in:
@ -508,7 +508,7 @@ final class Expectation
|
||||
/**
|
||||
* Asserts that the value matches a regular expression.
|
||||
*/
|
||||
public function toMatchRegEx(string $expression): Expectation
|
||||
public function toMatch(string $expression): Expectation
|
||||
{
|
||||
Assert::assertMatchesRegularExpression($expression, $this->value);
|
||||
|
||||
|
||||
@ -195,6 +195,11 @@
|
||||
PASS Tests\Expect\toHaveProperty
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Expect\toMatch
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Expect\toMatchConstraint
|
||||
@ -205,11 +210,6 @@
|
||||
PASS Tests\Expect\toMatchObject
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Expect\toMatchRegEx
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Expect\toStartWith
|
||||
@ -383,5 +383,5 @@
|
||||
✓ depends with defined arguments
|
||||
✓ depends run test only once
|
||||
|
||||
Tests: 6 skipped, 223 passed
|
||||
Tests: 6 skipped, 226 passed
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect('Hello World')->toMatchRegEx('/^hello wo.*$/i');
|
||||
expect('Hello World')->toMatch('/^hello wo.*$/i');
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect('Hello World')->toMatchRegEx('/^hello$/i');
|
||||
expect('Hello World')->toMatch('/^hello$/i');
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect('Hello World')->not->toMatchRegEx('/^hello wo.*$/i');
|
||||
expect('Hello World')->not->toMatch('/^hello wo.*$/i');
|
||||
})->throws(ExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user