Annotation of embedaddon/php/ext/soap/tests/bugs/bug36999.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #36999 (xsd:long values clamped to LONG_MAX instead of using double)
        !             3: --SKIPIF--
        !             4: <?php 
        !             5:   if (!extension_loaded('soap')) die('skip soap extension not available');
        !             6: ?>
        !             7: --INI--
        !             8: soap.wsdl_cache_enabled=0
        !             9: --FILE--
        !            10: <?php
        !            11: 
        !            12: function echoLong($num) {
        !            13:   return $num;
        !            14: }
        !            15: 
        !            16: class LocalSoapClient extends SoapClient {
        !            17: 
        !            18:   function __construct($wsdl) {
        !            19:     parent::__construct($wsdl);
        !            20:     $this->server = new SoapServer($wsdl);
        !            21:     $this->server->addFunction('echoLong');
        !            22:   }
        !            23: 
        !            24:   function __doRequest($request, $location, $action, $version, $one_way = 0) {
        !            25:     ob_start();
        !            26:     $this->server->handle($request);
        !            27:     $response = ob_get_contents();
        !            28:     ob_end_clean();
        !            29:     return $response;
        !            30:   }
        !            31: 
        !            32: }
        !            33: 
        !            34: $soap = new LocalSoapClient(dirname(__FILE__)."/bug36999.wsdl");
        !            35: 
        !            36: function test($num) {
        !            37:   global $soap;
        !            38:   try {
        !            39:          printf("%s %0.0f\n", gettype($num), $num);
        !            40:          $ret = $soap->echoLong($num);
        !            41:          printf("%s %0.0f\n", gettype($ret), $ret);
        !            42:        } catch (SoapFault $ex) {
        !            43:          var_dump($ex);
        !            44:        }
        !            45: }
        !            46: test(3706790240);
        !            47: ?>
        !            48: --EXPECTF--
        !            49: %s 3706790240
        !            50: %s 3706790240

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