1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/soap/tests/fault_warning.phpt
T
2020-01-16 19:14:31 +01:00

29 lines
1.0 KiB
PHP

--TEST--
SoapFault class: Invalid Fault code warning given? Can't be an empty string, an array of not 2 elements etc.
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$fault = new SoapFault("", "message"); // Can't be an empty string
$fault = new SoapFault(0, "message"); // Can't be a non-string (except for null)
$fault = new SoapFault("Sender", "message");
echo get_class($fault) . "\n";
$fault = new SoapFault(null, "message");
echo get_class($fault) . "\n";
$fault = new SoapFault(["more"], "message"); // two elements in array required
$fault = new SoapFault(["m", "more", "superfluous"], "message"); // two required
$fault = new SoapFault(["more-ns", "Sender"], "message"); // two given
echo get_class($fault);
?>
--EXPECTF--
Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
SoapFault
SoapFault
Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
SoapFault