Skip to content

Commit

Permalink
Replace usage of deprecated PHPUnit returnCallback() function (#2085)
Browse files Browse the repository at this point in the history
This PR is meant to serve as a first step for addressing changes that
will need to be made before #1866
can be merged. The PHPUnit function `returnCallback()` is
[deprecated](sebastianbergmann/phpunit#5423),
so our usage of it was switched to its shorthand syntax, as recommended
by the docs.
  • Loading branch information
sbelsk authored Mar 17, 2024
1 parent 8d4c92a commit 97ecaf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/cdash/include/Test/CDashTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ protected function setDatabaseMocked()
$mock_pdo
->expects($this->any())
->method('quote')
->will($this->returnCallback(function ($arg) {
->willReturnCallback(function ($arg) {
return "'" . $arg . "'";
})
);
});

Database::setInstance(Database::class, $mock_pdo);
}
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12411,11 +12411,6 @@ parameters:
count: 4
path: app/cdash/include/Test/CDashTestCase.php

-
message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnCallback\\(\\)\\.$#"
count: 1
path: app/cdash/include/Test/CDashTestCase.php

-
message: "#^Method CDash\\\\Test\\\\CDashTestCase\\:\\:createMockFromBuilder\\(\\) has no return type specified\\.$#"
count: 1
Expand Down

0 comments on commit 97ecaf6

Please sign in to comment.