Skip to content

Commit e463d74

Browse files
committed
ext/soap: applied fixers to improve test robustness
1 parent c5511d7 commit e463d74

17 files changed

Lines changed: 56 additions & 57 deletions

ext/soap/tests/bugs/bug31755.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $client = new MySoapClient(null, array(
1717
try {
1818
new SOAPHeader('', 'foo', 'bar');
1919
} catch (ValueError $exception) {
20-
echo $exception->getMessage() . "\n";
20+
echo $exception::class, ': ', $exception->getMessage(), "\n";
2121
}
2222

2323
$header = new SOAPHeader('namespace', 'foo', 'bar');
@@ -26,6 +26,6 @@ $response= $client->__soapCall('function', array(), null, $header);
2626
print $client->__getLastRequest();
2727
?>
2828
--EXPECT--
29-
SoapHeader::__construct(): Argument #1 ($namespace) must not be empty
29+
ValueError: SoapHeader::__construct(): Argument #1 ($namespace) must not be empty
3030
<?xml version="1.0" encoding="UTF-8"?>
3131
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myNS" xmlns:ns2="namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:foo>bar</ns2:foo></SOAP-ENV:Header><SOAP-ENV:Body><ns1:function/></SOAP-ENV:Body></SOAP-ENV:Envelope>

ext/soap/tests/bugs/bug42151.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ try {
2121
$bar = new bar();
2222
$foo = new foo();
2323
} catch (Exception $e){
24-
echo $e->getMessage() . "\n";
24+
echo $e::class, ': ', $e->getMessage(), "\n";
2525
}
2626
echo "ok\n";
2727
?>
2828
--EXPECTF--
29-
SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s
29+
SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s
3030

3131
ok
3232
I don't get executed either.

ext/soap/tests/bugs/bug42692.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ try {
3333
$result = $client->checkAuth(1,"two");
3434
echo "Auth for 1 is $result\n";
3535
} catch (Exception $e) {
36-
echo $e->getMessage();
36+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
3737
}
3838
?>
3939
--EXPECT--

ext/soap/tests/bugs/bug55639.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ $client = new soapclient(NULL, [
4444
try {
4545
$client->__soapCall("foo", []);
4646
} catch (Throwable $e) {
47-
echo $e->getMessage(), "\n";
47+
echo $e::class, ': ', $e->getMessage(), "\n";
4848
}
4949

5050
$headers = $client->__getLastRequestHeaders();
5151
var_dump($headers);
5252

5353
?>
5454
--EXPECTF--
55-
Unauthorized
55+
SoapFault: Unauthorized
5656
string(%d) "POST / HTTP/1.1
5757
Host: %s
5858
Connection: Keep-Alive

ext/soap/tests/bugs/bug71610.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ $exploit = unserialize($ser);
2121
try {
2222
$exploit->blahblah();
2323
} catch(SoapFault $e) {
24-
echo $e->getMessage()."\n";
24+
echo $e::class, ': ', $e->getMessage(), "\n";
2525
}
2626
?>
2727
--EXPECT--
28-
looks like we got no XML document
28+
SoapFault: looks like we got no XML document

ext/soap/tests/bugs/bug73037.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,3 @@ Iteration 6
175175
Function 'CATALOG' doesn't exist
176176

177177
Function 'CATALOG' doesn't exist
178-

ext/soap/tests/bugs/bug80672.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ try {
88
$client = new SoapClient(__DIR__ . "/bug80672.xml");
99
$query = $soap->query(array('sXML' => 'something'));
1010
} catch(SoapFault $e) {
11-
print $e->getMessage();
11+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
1212
}
1313
?>
1414
--EXPECT--
15-
SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <>
15+
SoapFault: SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <>

ext/soap/tests/bugs/gh16237.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ $server = new SoapServer(null, ['uri'=>"http://testuri.org"]);
99
try {
1010
clone $server;
1111
} catch (Error $e) {
12-
echo $e->getMessage(), "\n";
12+
echo $e::class, ': ', $e->getMessage(), "\n";
1313
}
1414

1515
?>
1616
--EXPECT--
17-
Trying to clone an uncloneable object of class SoapServer
17+
Error: Trying to clone an uncloneable object of class SoapServer

ext/soap/tests/bugs/gh16256.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ $wsdl = __DIR__."/ext/soap/tests/bug41004.wsdl";
1111
try {
1212
new SoapClient($wsdl, ["classmap" => $classmap]);
1313
} catch (Throwable $e) {
14-
echo $e->getMessage(), "\n";
14+
echo $e::class, ': ', $e->getMessage(), "\n";
1515
}
1616
try {
1717
new SoapServer($wsdl, ["classmap" => $classmap]);
1818
} catch (Throwable $e) {
19-
echo $e->getMessage(), "\n";
19+
echo $e::class, ': ', $e->getMessage(), "\n";
2020
}
2121
?>
2222
--EXPECT--
23-
SoapClient::__construct(): Argument #2 ($options) "classmap" option must be an associative array
24-
SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array
23+
ValueError: SoapClient::__construct(): Argument #2 ($options) "classmap" option must be an associative array
24+
ValueError: SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array

ext/soap/tests/bugs/gh16429.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ $client = new SoapClient(__DIR__."/../interop/Round2/GroupB/round2_groupB.wsdl",
1414
try {
1515
$client->echo2DStringArray($fusion);
1616
} catch (Exception $e) {
17-
echo $e->getMessage(), "\n";
17+
echo $e::class, ': ', $e->getMessage(), "\n";
1818
}
1919
?>
2020
--EXPECT--
2121
string(10) "xxxxxxxxxx"
22-
Cannot traverse an already closed generator
22+
Exception: Cannot traverse an already closed generator

0 commit comments

Comments
 (0)