diff --git a/Tests/Firewall/ContextListenerTest.php b/Tests/Firewall/ContextListenerTest.php index 4d74859..5389e54 100644 --- a/Tests/Firewall/ContextListenerTest.php +++ b/Tests/Firewall/ContextListenerTest.php @@ -366,8 +366,11 @@ public function testWithPreviousNotStartedSession() public function testSessionIsNotReported() { - $usageReporter = $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock(); - $usageReporter->expects($this->never())->method('__invoke'); + $this->expectNotToPerformAssertions(); + + $usageReporter = static function (): void { + throw new \LogicException('This should not be called'); + }; $session = new Session(new MockArraySessionStorage(), null, null, $usageReporter);