Merge branch '2.x' into 2.x-fix-ignored-description-for-lazy-datasets

This commit is contained in:
Nuno Maduro
2022-12-23 23:01:39 +00:00
committed by GitHub
11 changed files with 153 additions and 21 deletions

View File

@ -781,6 +781,9 @@
PASS Tests\PHPUnit\CustomAffixes\snakecasespec
✓ it runs file names like `snake_case_spec.php`
PASS Tests\CustomTestCase\ExecutedTest
✓ that gets executed
PASS Tests\PHPUnit\CustomTestCase\UsesPerDirectory
✓ closure was bound to CustomTestCase
@ -817,6 +820,10 @@
✓ it show the actual dataset of multiple non-named datasets in their description
✓ it show the correct description for mixed named and not-named datasets
PASS Tests\Unit\Expectations\OppositeExpectation
✓ it throw expectation failed exception with string argument
✓ it throw expectation failed exception with array argument
PASS Tests\Unit\Plugins\Environment
✓ environment is set to CI when --ci option is used
✓ environment is set to Local when --ci option is not used
@ -892,4 +899,4 @@
PASS Tests\Visual\Version
✓ visual snapshot of help command output
Tests: 4 incomplete, 2 todos, 18 skipped, 621 passed (1531 assertions)

View File

@ -0,0 +1,16 @@
<?php
use Pest\Expectations\OppositeExpectation;
use PHPUnit\Framework\ExpectationFailedException;
it('throw expectation failed exception with string argument', function (): void {
$expectation = new OppositeExpectation(expect('foo'));
$expectation->throwExpectationFailedException('toBe', 'bar');
})->throws(ExpectationFailedException::class, "Expecting 'foo' not to be 'bar'.");
it('throw expectation failed exception with array argument', function (): void {
$expectation = new OppositeExpectation(expect('foo'));
$expectation->throwExpectationFailedException('toBe', ['bar']);
})->throws(ExpectationFailedException::class, "Expecting 'foo' not to be 'bar'.");