Skip to content

Commit

Permalink
SoapAbstractRequest 100% test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pinguinjkeke committed Sep 22, 2016
1 parent 437cd4e commit 5b80f8b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Message/SoapAbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ public function buildSoapClient()
}

try {
if (!$this->getEndpoint()) {
throw new SoapFault('Client', 'No endpoint provided');
}

$this->soapClient = new SoapClient($this->getWsdl(), array(
'uri' => 'http://www.sirena-travel.ru/',
'location' => $this->getEndpoint(),
Expand Down
17 changes: 17 additions & 0 deletions tests/Message/SoapAbstractRequestTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Omnipay\EgopayRu\Message;

use Omnipay\Tests\TestCase;

class SoapAbstractRequestTest extends TestCase
{
public function testBuildSoapClientFault()
{
$request = new CancelRequest($this->getHttpClient(), $this->getHttpRequest(), null);
$request->setEndpoint(null);

$this->assertNull($request->buildSoapClient());
$this->assertEquals($request->sendData(array())->getData(), 'SOAP fail');
}
}

0 comments on commit 5b80f8b

Please sign in to comment.