createMock(HttpClient::class); $clientMock->expects($this->once()) ->method('request') ->willReturn($this->createMock(CreateAlertResponse::class)); $requestMock = $this->createMock(CreateAlertRequest::class); $client = new AlertApiClient($clientMock); $this->assertInstanceOf(CreateAlertResponse::class, $client->createAlert($requestMock)); } public function testCanSendGetAlertRequest() { $clientMock = $this->createMock(HttpClient::class); $clientMock->expects($this->once()) ->method('request') ->willReturn($this->createMock(GetAlertResponse::class)); $requestMock = $this->createMock(GetAlertRequest::class); $client = new AlertApiClient($clientMock); $this->assertInstanceOf(GetAlertResponse::class, $client->getAlert($requestMock)); } public function testCanSendCloseAlertRequest() { $clientMock = $this->createMock(HttpClient::class); $clientMock->expects($this->once()) ->method('request') ->willReturn($this->createMock(CloseAlertResponse::class)); $requestMock = $this->createMock(CloseAlertRequest::class); $client = new AlertApiClient($clientMock); $this->assertInstanceOf(CloseAlertResponse::class, $client->closeAlert($requestMock)); } }