createMock(JobRunner::class); $runner->expects(static::once())->method('run'); $message = $this->createMock(CommandMessage::class); $handler = new MessageHandler($runner); $handler->__invoke($message); } }