Fix test by using a mock instead of a stub

This commit is contained in:
Alessandro Lai
2026-02-06 22:44:52 +01:00
parent 5b49f41196
commit 668536e66f

View File

@@ -146,12 +146,14 @@ class DeprecationTest extends TestCase
public function expectDeprecationMock(string $message, string $identifier, string $package): LoggerInterface
{
$mock = $this->createMock(LoggerInterface::class);
$mock->method('notice')->with($message, $this->callback(function (array $context) use ($identifier, $package) {
$this->assertEquals($package, $context['package']);
$this->assertEquals($identifier, $context['link']);
$mock->expects($this->atLeastOnce())
->method('notice')
->with($message, $this->callback(function (array $context) use ($identifier, $package) {
$this->assertEquals($package, $context['package']);
$this->assertEquals($identifier, $context['link']);
return true;
}));
return true;
}));
return $mock;
}