Skip to content

Commit

Permalink
Skip "optional before required" test for PHP >= 8.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-kvashnin committed Oct 4, 2023
1 parent fc00418 commit c931867
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 c931867

Please sign in to comment.