Skip to content

Commit

Permalink
PHP 8.3 | ComposerRepositoryTest: fix test failure
Browse files Browse the repository at this point in the history
Prior to PHP 8.3, ReflectionMethod could set a private method on a parent class to accessible. This is no longer possible in PHP 8.3 since php/php-src 9470 and breaks the Composer\Test\Repository\ComposerRepositoryTest::testWhatProvides test.
Also see: https://3v4l.org/8YcIk/rfc#vgit.master

Fixed now.

Co-authored-by: Christophe Coevoet <stof@notk.org>
  • Loading branch information
jrfnl and stof committed Aug 28, 2023
1 parent f605389 commit 5ef05f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Composer/Test/Repository/ComposerRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function testWhatProvides(): void
],
]));

$reflMethod = new \ReflectionMethod($repo, 'whatProvides');
$reflMethod = new \ReflectionMethod(ComposerRepository::class, 'whatProvides');
$reflMethod->setAccessible(true);
$packages = $reflMethod->invoke($repo, 'a');

Expand Down

0 comments on commit 5ef05f0

Please sign in to comment.