diff --git a/tests/Endpoints/CampaignsTest.php b/tests/Endpoints/CampaignsTest.php index 42c0283..65b760f 100644 --- a/tests/Endpoints/CampaignsTest.php +++ b/tests/Endpoints/CampaignsTest.php @@ -116,12 +116,19 @@ public function getOneWithOptions() */ public function getOneWithoutId() { - $soapClient = $this->getMockBuilder(\SoapClient::class) + if (!method_exists($this, 'addMethods')) { + $soapClient = $this->getMockBuilder(\SoapClient::class) + ->disableOriginalConstructor() + ->setMethods(['webservice']) + ->getMock(); + } else { + $soapClient = $this->getMockBuilder(\SoapClient::class) ->disableOriginalConstructor() - ->setMethods(['webservice']) + ->addMethods(['webservice']) ->getMock(); - $soapClient->expects($this->never()) - ->method('webservice'); + } + + $soapClient->expects($this->never())->method('webservice'); $campaignEndpoint = new Campaigns($soapClient); $result = $campaignEndpoint->getOne([]); @@ -164,10 +171,17 @@ private function getCorrectResponse() */ private function getClient($response = [], $dsMethod = '', $arguments = []) { - $soapClient = $this->getMockBuilder(\SoapClient::class) + if (!method_exists($this, 'addMethods')) { + $soapClient = $this->getMockBuilder(\SoapClient::class) + ->disableOriginalConstructor() + ->setMethods(['webservice']) + ->getMock(); + } else { + $soapClient = $this->getMockBuilder(\SoapClient::class) ->disableOriginalConstructor() - ->setMethods(['webservice']) + ->addMethods(['webservice']) ->getMock(); + } $soapClient->expects($this->atMost(1)) ->method('webservice')