Skip to content

Commit

Permalink
Merge pull request #50 from serge-kvashnin/php-8.1-deprecated-optiona…
Browse files Browse the repository at this point in the history
…l-before-required

Skip "optional before required" test for PHP >= 8.1.
  • Loading branch information
mnapoli authored Oct 11, 2023
2 parents fc00418 + c931867 commit 74f216c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/InvokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,16 @@ public function should_invoke_callable_with_null_for_non_optional_nullable_param

/**
* @see https://github.com/PHP-DI/PHP-DI/issues/562
* @deprecated
* @test
*/
public function should_invoke_callable_with_optional_parameter_before_required_parameter()
{
if (version_compare(PHP_VERSION, '8.1') >= 0) {
/** @see https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.optional-before-required */
$this->markTestSkipped('An optional parameter specified before required parameters is now always treated as required.');
}

$result = $this->invoker->call(function ($baz = 'abc', $foo) {
return [$baz, $foo];
}, [
Expand Down

0 comments on commit 74f216c

Please sign in to comment.