mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37: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.
|
* 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);
|
Assert::assertMatchesRegularExpression($expression, $this->value);
|
||||||
|
|
||||||
|
|||||||
@ -195,6 +195,11 @@
|
|||||||
PASS Tests\Expect\toHaveProperty
|
PASS Tests\Expect\toHaveProperty
|
||||||
✓ pass
|
✓ pass
|
||||||
✓ failures
|
✓ failures
|
||||||
|
✓ not failures
|
||||||
|
|
||||||
|
PASS Tests\Expect\toMatch
|
||||||
|
✓ pass
|
||||||
|
✓ failures
|
||||||
✓ not failures
|
✓ not failures
|
||||||
|
|
||||||
PASS Tests\Expect\toMatchConstraint
|
PASS Tests\Expect\toMatchConstraint
|
||||||
@ -205,11 +210,6 @@
|
|||||||
PASS Tests\Expect\toMatchObject
|
PASS Tests\Expect\toMatchObject
|
||||||
✓ pass
|
✓ pass
|
||||||
✓ failures
|
✓ failures
|
||||||
✓ not failures
|
|
||||||
|
|
||||||
PASS Tests\Expect\toMatchRegEx
|
|
||||||
✓ pass
|
|
||||||
✓ failures
|
|
||||||
✓ not failures
|
✓ not failures
|
||||||
|
|
||||||
PASS Tests\Expect\toStartWith
|
PASS Tests\Expect\toStartWith
|
||||||
@ -383,5 +383,5 @@
|
|||||||
✓ depends with defined arguments
|
✓ depends with defined arguments
|
||||||
✓ depends run test only once
|
✓ depends run test only once
|
||||||
|
|
||||||
Tests: 6 skipped, 223 passed
|
Tests: 6 skipped, 226 passed
|
||||||
|
|
||||||
@ -3,13 +3,13 @@
|
|||||||
use PHPUnit\Framework\ExpectationFailedException;
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
|
|
||||||
test('pass', function () {
|
test('pass', function () {
|
||||||
expect('Hello World')->toMatchRegEx('/^hello wo.*$/i');
|
expect('Hello World')->toMatch('/^hello wo.*$/i');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('failures', function () {
|
test('failures', function () {
|
||||||
expect('Hello World')->toMatchRegEx('/^hello$/i');
|
expect('Hello World')->toMatch('/^hello$/i');
|
||||||
})->throws(ExpectationFailedException::class);
|
})->throws(ExpectationFailedException::class);
|
||||||
|
|
||||||
test('not failures', function () {
|
test('not failures', function () {
|
||||||
expect('Hello World')->not->toMatchRegEx('/^hello wo.*$/i');
|
expect('Hello World')->not->toMatch('/^hello wo.*$/i');
|
||||||
})->throws(ExpectationFailedException::class);
|
})->throws(ExpectationFailedException::class);
|
||||||
Reference in New Issue
Block a user