Skip to content

Commit ad5cbcf

Browse files
committed
Fixing the SOAP temperature webservice tests, since the previous service doesn't work anymore
1 parent 0b97749 commit ad5cbcf

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/VCR/LibraryHooks/SoapHook.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function __construct(AbstractCodeTransform $codeTransformer, StreamProces
4747
throw new \BadMethodCallException('For soap support you need to install the soap extension.');
4848
}
4949

50+
if (!class_exists('\DOMDocument')) {
51+
throw new \BadMethodCallException('For soap support you need to install the xml extension.');
52+
}
53+
5054
$this->processor = $processor;
5155
$this->codeTransformer = $codeTransformer;
5256
}

tests/integration/soap/src/VCR/Example/ExampleSoapClient.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
namespace VCR\Example;
33

44
/**
5-
* Checks cdyne.com for local weather information.
5+
* Converts temperature units from webservicex
66
*
7-
* @link http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL
7+
* @link http://www.webservicex.net/New/Home/ServiceDetail/31
88
*/
99
class ExampleSoapClient
1010
{
11-
const EXAMPLE_WSDL = 'http://www.w3schools.com/webservices/tempconvert.asmx?wsdl';
11+
const EXAMPLE_WSDL = 'http://www.webservicex.net/ConvertTemperature.asmx?WSDL';
1212

1313
public function call($zip = '10')
1414
{
1515
$client = new \SoapClient(self::EXAMPLE_WSDL, array('soap_version' => SOAP_1_2));
16-
$response = $client->CelsiusToFahrenheit(array('Celsius' => $zip));
16+
$response = $client->ConvertTemp(array('Temperature' => $zip, 'FromUnit' => 'degreeCelsius', 'ToUnit' => 'degreeFahrenheit'));
1717

18-
return (int) $response->CelsiusToFahrenheitResult;
18+
return (int) $response->ConvertTempResult;
1919
}
2020
}

tests/integration/soap/test/VCR/Example/ExampleSoapClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use org\bovigo\vfs\vfsStream;
66

77
/**
8-
* Checks cdyne.com for local weather information.
8+
* Converts temperature units from webservicex
99
*
10-
* @link http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL
10+
* @link http://www.webservicex.net/New/Home/ServiceDetail/31
1111
*/
1212
class ExampleSoapClientTest extends \PHPUnit_Framework_TestCase
1313
{

0 commit comments

Comments
 (0)