Annotation of embedaddon/php/ext/soap/tests/bugs/bug43045.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #43045i (SOAP encoding violation on "INF" for type double/float)
                      3: --SKIPIF--
                      4: <?php require_once('skipif.inc'); ?>
                      5: --FILE--
                      6: <?php
                      7: function test($x) {
                      8:   return $x;
                      9: }
                     10: 
                     11: class TestSoapClient extends SoapClient {
                     12:   function __construct($wsdl, $options) {
                     13:     parent::__construct($wsdl, $options);
                     14:     $this->server = new SoapServer($wsdl, $options);
                     15:     $this->server->addFunction('test');
                     16:   }
                     17:   function __doRequest($request, $location, $action, $version, $one_way = 0) {
                     18:     ob_start();
                     19:     $this->server->handle($request);
                     20:     $response = ob_get_contents();
                     21:     ob_end_clean();
                     22:     return $response;
                     23: 
                     24:     echo $request;
                     25:     return '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     26: xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                     27: xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     28: soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     29: xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                     30: <soap:Body><testResponse xmlns="urn:TestSOAP">
                     31: <s-gensym3>
                     32: <doubleInfinity xsi:type="xsd:double">INF</doubleInfinity>
                     33: </s-gensym3>
                     34: </testResponse>
                     35: </soap:Body></soap:Envelope>';
                     36:   }
                     37: }
                     38: $client = new TestSoapClient(NULL, array(
                     39:                        "location" => "test://",
                     40:                        "uri"      => 'urn:TestSOAP',
                     41:                        "style"    => SOAP_RPC,
                     42:                        "use"      => SOAP_ENCODED                        
                     43:                        ));
                     44: var_dump($client->test(0.1));
                     45: var_dump($client->test(NAN));
                     46: var_dump($response = $client->test(INF));
                     47: var_dump($response = $client->test(-INF));
                     48: --EXPECT--
                     49: float(0.1)
                     50: float(NAN)
                     51: float(INF)
                     52: float(-INF)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>