mirror of
https://github.com/pestphp/pest.git
synced 2026-09-05 22:33:35 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b2293f67a | |||
| 7d49828491 | |||
| 3223d50607 |
@@ -235,8 +235,8 @@ final class TestCaseMethodFactory
|
|||||||
$attributesCode
|
$attributesCode
|
||||||
public function $methodName(...\$arguments)
|
public function $methodName(...\$arguments)
|
||||||
{
|
{
|
||||||
if (count(\$arguments) === 1 && \$arguments[0] instanceof __PestDatasetProviderError) {
|
if (count(\$arguments) === 1 && \$arguments[array_key_first(\$arguments)] instanceof __PestDatasetProviderError) {
|
||||||
throw \$arguments[0]->getPrevious() ?? \$arguments[0];
|
throw \$arguments[array_key_first(\$arguments)]->getPrevious() ?? \$arguments[array_key_first(\$arguments)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return \$this->__runTest(
|
return \$this->__runTest(
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '4.7.7';
|
return '4.7.8';
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDirectory(string $file = ''): string
|
function testDirectory(string $file = ''): string
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Pest Testing Framework 4.7.7.
|
Pest Testing Framework 4.7.8.
|
||||||
|
|
||||||
USAGE: pest <file> [options]
|
USAGE: pest <file> [options]
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Pest Testing Framework 4.7.7.
|
Pest Testing Framework 4.7.8.
|
||||||
|
|
||||||
|
|||||||
@@ -275,6 +275,7 @@
|
|||||||
✓ dataset items can mix named and sequential styles with ('Taylor', 'taylor@laravel.com')
|
✓ dataset items can mix named and sequential styles with ('Taylor', 'taylor@laravel.com')
|
||||||
✓ dataset items can mix named and sequential styles with ('James', 'james@laravel.com') #1
|
✓ dataset items can mix named and sequential styles with ('James', 'james@laravel.com') #1
|
||||||
✓ dataset items can mix named and sequential styles with ('James', 'james@laravel.com') #2
|
✓ dataset items can mix named and sequential styles with ('James', 'james@laravel.com') #2
|
||||||
|
✓ named parameters work with a single argument with ('Taylor')
|
||||||
|
|
||||||
PASS Tests\Features\Depends
|
PASS Tests\Features\Depends
|
||||||
✓ first
|
✓ first
|
||||||
@@ -1905,4 +1906,4 @@
|
|||||||
✓ pass with dataset with ('my-datas-set-value')
|
✓ pass with dataset with ('my-datas-set-value')
|
||||||
✓ within describe → pass with dataset with ('my-datas-set-value')
|
✓ within describe → pass with dataset with ('my-datas-set-value')
|
||||||
|
|
||||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1296 passed (2979 assertions)
|
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1297 passed (2980 assertions)
|
||||||
@@ -542,3 +542,9 @@ test('dataset items can mix named and sequential styles', function (string $name
|
|||||||
['James', 'james@laravel.com'],
|
['James', 'james@laravel.com'],
|
||||||
['James', 'email' => 'james@laravel.com'],
|
['James', 'email' => 'james@laravel.com'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
test('named parameters work with a single argument', function (string $name) {
|
||||||
|
expect($name)->toBe('Taylor');
|
||||||
|
})->with([
|
||||||
|
['name' => 'Taylor'],
|
||||||
|
]);
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ test('parallel', function () use ($run) {
|
|||||||
$file = file_get_contents(__FILE__);
|
$file = file_get_contents(__FILE__);
|
||||||
$file = preg_replace(
|
$file = preg_replace(
|
||||||
'/\$expected = \'.*?\';/',
|
'/\$expected = \'.*?\';/',
|
||||||
"\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1280 passed (2928 assertions)';",
|
"\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1281 passed (2929 assertions)';",
|
||||||
$file,
|
$file,
|
||||||
);
|
);
|
||||||
file_put_contents(__FILE__, $file);
|
file_put_contents(__FILE__, $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1280 passed (2928 assertions)';
|
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1281 passed (2929 assertions)';
|
||||||
|
|
||||||
expect($output)
|
expect($output)
|
||||||
->toContain("Tests: {$expected}")
|
->toContain("Tests: {$expected}")
|
||||||
|
|||||||
Reference in New Issue
Block a user