SoapFaultWithTracingData now provides request / response information from Server SoapFaults
This commit is contained in:
@ -4,7 +4,6 @@ namespace BeSimple;
|
||||
|
||||
use BeSimple\SoapBundle\Soap\SoapAttachment;
|
||||
use BeSimple\SoapClient\SoapClientBuilder;
|
||||
use BeSimple\SoapClient\SoapClientBuilderTest;
|
||||
use BeSimple\SoapClient\SoapClientOptionsBuilder;
|
||||
use BeSimple\SoapClient\SoapFaultWithTracingData;
|
||||
use BeSimple\SoapCommon\ClassMap;
|
||||
@ -17,7 +16,6 @@ use Fixtures\DummyServiceMethodWithIncomingLargeSwaRequest;
|
||||
use Fixtures\DummyServiceMethodWithOutgoingLargeSwaRequest;
|
||||
use Fixtures\GenerateTestRequest;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use SoapFault;
|
||||
use SoapHeader;
|
||||
|
||||
class SoapServerAndSoapClientCommunicationTest extends PHPUnit_Framework_TestCase
|
||||
@ -25,6 +23,7 @@ class SoapServerAndSoapClientCommunicationTest extends PHPUnit_Framework_TestCas
|
||||
const CACHE_DIR = __DIR__ . '/../../cache';
|
||||
const FIXTURES_DIR = __DIR__ . '/../Fixtures';
|
||||
const TEST_HTTP_URL = 'http://localhost:8000/tests';
|
||||
const TEST_HTTP_URL_INVALID = 'http://nosuchserverexists1234.com:9911';
|
||||
const LARGE_SWA_FILE = self::FIXTURES_DIR.'/large-test-file.docx';
|
||||
|
||||
private $localWebServerProcess;
|
||||
@ -125,44 +124,6 @@ class SoapServerAndSoapClientCommunicationTest extends PHPUnit_Framework_TestCas
|
||||
);
|
||||
}
|
||||
|
||||
public function testSoapCallSwaWithLargeSwaResponseWithSoapFault()
|
||||
{
|
||||
$soapClient = $this->getSoapBuilder()->buildWithSoapHeader(
|
||||
SoapClientOptionsBuilder::createWithEndpointLocation(
|
||||
self::TEST_HTTP_URL.'/SwaSenderSoapFaultEndpoint.php'
|
||||
),
|
||||
SoapOptionsBuilder::createSwaWithClassMap(
|
||||
self::TEST_HTTP_URL.'/SwaSenderEndpoint.php?wsdl',
|
||||
new ClassMap([
|
||||
'GenerateTestRequest' => GenerateTestRequest::class,
|
||||
]),
|
||||
SoapOptions::SOAP_CACHE_TYPE_NONE
|
||||
),
|
||||
new SoapHeader('http://schema.testcase', 'SoapHeader', [
|
||||
'user' => 'admin',
|
||||
])
|
||||
);
|
||||
|
||||
$this->setExpectedException(SoapFault::class);
|
||||
|
||||
try {
|
||||
$soapClient->soapCall('dummyServiceMethodWithOutgoingLargeSwa', []);
|
||||
} catch (SoapFault $e) {
|
||||
self::assertEquals(
|
||||
'911',
|
||||
$e->faultcode
|
||||
);
|
||||
self::assertEquals(
|
||||
'SOAP HTTP call failed: Curl error "0" with message: occurred while connecting to http://localhost:8000/tests/SwaSenderSoapFaultEndpoint.php with HTTP response code 500 with Message: This is a dummy SoapFault. and Code: 911',
|
||||
$e->getMessage()
|
||||
);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
self::fail('Expected SoapFault was not thrown');
|
||||
}
|
||||
|
||||
public function testSoapCallWithLargeSwaRequest()
|
||||
{
|
||||
$soapClient = $this->getSoapBuilder()->buildWithSoapHeader(
|
||||
|
Reference in New Issue
Block a user