Skip to content

Commit

Permalink
Merge pull request #244 from creative-commoners/pulls/4/phpunit12
Browse files Browse the repository at this point in the history
MNT Fix PHPUnit 12 deprecations
  • Loading branch information
GuySartorelli authored Sep 23, 2024
2 parents c92e456 + f215d57 commit a99753e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/Util/ApiLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ protected function getLoader($cacheMock = false)
$cacheMock->expects($this->any())->method('set')->willReturn(true);
}

$loader = $this->getMockBuilder(ApiLoader::class)
->getMockForAbstractClass();
$loader = new class extends ApiLoader {
protected function getCacheKey()
{
return 'cacheKey';
}
};

$loader->setCache($cacheMock);
$loader->expects($this->any())->method('getCacheKey')->willReturn('cacheKey');

return $loader;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Util/SupportedAddonsLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testCallbackReturnsAddonsFromBody()
$this->loader->expects($this->once())
->method('doRequest')
->with($this->isType('string'), $this->isType('callable'))
->will($this->returnArgument(1));
->willReturnArgument(1);

$result = $this->loader->getAddonNames();
$mockResponse = [
Expand Down

0 comments on commit a99753e

Please sign in to comment.