Skip to content

Commit 898ee9e

Browse files
committed
improve AbstractSoapClientBase, update unit test
1 parent f94af82 commit 898ee9e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

AbstractSoapClientBase.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ abstract class AbstractSoapClientBase
147147
* @var array
148148
*/
149149
private $lastError;
150+
/**
151+
* Undeclared \SoapClient property used in this class
152+
* @var string
153+
*/
154+
public $__default_headers;
155+
/**
156+
* Undeclared \SoapClient property used in this class
157+
* @var resource
158+
*/
159+
public $_stream_context;
150160
/**
151161
* Constructor
152162
* @uses AbstractSoapClientBase::setLastError()
@@ -325,10 +335,11 @@ public function getLastRequest($asDomDocument = false)
325335
*/
326336
public function getLastResponse($asDomDocument = false)
327337
{
338+
$response = null;
328339
if (self::getSoapClient() instanceof \SoapClient) {
329-
return self::getFormatedXml(self::getSoapClient()->__getLastResponse(), $asDomDocument);
340+
$response = self::getFormatedXml(self::getSoapClient()->__getLastResponse(), $asDomDocument);
330341
}
331-
return null;
342+
return $response;
332343
}
333344
/**
334345
* Returns the last request headers used by the SoapClient object as the original value or an array
@@ -553,12 +564,4 @@ protected function setResult($result)
553564
$this->result = $result;
554565
return $this;
555566
}
556-
/**
557-
* Method returning actual class name
558-
* @return string __CLASS__
559-
*/
560-
public function __toString()
561-
{
562-
return __CLASS__;
563-
}
564567
}

Tests/SoapClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function search()
2525
try {
2626
self::getSoapClient()->search();
2727
} catch (\SoapFault $soapFault) {
28+
$this->setResult(null);
2829
$this->saveLastError(__METHOD__, $soapFault);
2930
}
3031
}

0 commit comments

Comments
 (0)