Skip to content

Commit 74f216c

Browse files
authored
Merge pull request #50 from serge-kvashnin/php-8.1-deprecated-optional-before-required
Skip "optional before required" test for PHP >= 8.1.
2 parents fc00418 + c931867 commit 74f216c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/InvokerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,16 @@ public function should_invoke_callable_with_null_for_non_optional_nullable_param
216216

217217
/**
218218
* @see https://github.com/PHP-DI/PHP-DI/issues/562
219+
* @deprecated
219220
* @test
220221
*/
221222
public function should_invoke_callable_with_optional_parameter_before_required_parameter()
222223
{
224+
if (version_compare(PHP_VERSION, '8.1') >= 0) {
225+
/** @see https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.optional-before-required */
226+
$this->markTestSkipped('An optional parameter specified before required parameters is now always treated as required.');
227+
}
228+
223229
$result = $this->invoker->call(function ($baz = 'abc', $foo) {
224230
return [$baz, $foo];
225231
}, [

0 commit comments

Comments
 (0)