Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to PHP 8.4 #256

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix message matching in RepeatTest::testNegativeRepeatedtimes
PHP 8.4 has changed the format of __FUNCTION__ for closures, at least.
  • Loading branch information
redbeardcreator committed Dec 9, 2024
commit bdfef5f03589778dcf50f052f3d4c83f45815280
9 changes: 7 additions & 2 deletions tests/Functional/RepeatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ public function test(): void
public function testNegativeRepeatedTimes(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
'Functional\{closure}() expects parameter 1 to be positive integer, negative integer given'

// See https://3v4l.org/Ms79G for message formats
// See https://regex101.com/r/hTvW3o/1 for regex setup
$this->expectExceptionMessageMatches(
'/(Functional\\\\{closure}' // PHP < 8.4
. '|{closure:Functional\\\\repeat\(\):[0-9]+})' // PHP 8.4+
. '\(\) expects parameter 1 to be positive integer, negative integer given/'
);

repeat([$this->repeated, 'foo'])(-1);
Expand Down