createMock(RequestInterface::class); /** @var MockObject|WebhookAuthInterface $authConfig */ $authConfig = $this->createMock(WebhookAuthInterface::class); $authConfig->method('getAuthClass')->willReturn(AuthTypeFake::class); $authConfig->method('getCredentials')->willReturn(['c' => 'v']); $sender = new WebhookSender(); $sender->setServiceLocator($this->getServiceLocatorMock()); /** @var \stdClass $response */ $response = $sender->performRequest($request, $authConfig); self::assertSame($request, $response->callRequest); self::assertSame(['c' => 'v'], $response->credentials); } }