Skip to content

Commit

Permalink
Merge pull request #27 from encreinformatique/encreinformatique-patch-1
Browse files Browse the repository at this point in the history
removed psr/log dependency as not used
  • Loading branch information
encreinformatique committed Jul 28, 2023
2 parents eba203a + b644421 commit 7cdbe7f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
},
"require": {
"php": ">=7.2",
"psr/log": "^1.0",
"ext-soap": "*"
},
"require-dev": {
"phpunit/phpunit": ">=5.7"
},
"conflict": {
"phpunit/phpunit": "^10.0"
},
"scripts": {
"test": "vendor/bin/phpunit"
}
Expand Down
26 changes: 20 additions & 6 deletions tests/Endpoints/CampaignsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 7cdbe7f

Please sign in to comment.