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

1.1       misho       1: --TEST--
                      2: Bug #31695 (Cannot redefine endpoint when using WSDL)
                      3: --SKIPIF--
                      4: <?php require_once('skipif.inc'); ?>
                      5: --FILE--
                      6: <?php
                      7: ini_set("soap.wsdl_cache_enabled", 0);
                      8: 
                      9: function Test($x) {
                     10:        return $x;
                     11: }
                     12: 
                     13: class LocalSoapClient extends SoapClient {
                     14:   function __construct($wsdl, $options=array()) {
                     15:     parent::__construct($wsdl, $options);
                     16:     $this->server = new SoapServer($wsdl, $options);
                     17:                $this->server->addFunction("Test"); 
                     18:   }
                     19: 
                     20:   function __doRequest($request, $location, $action, $version, $one_way = 0) {
                     21:        echo "$location\n";
                     22:     ob_start();
                     23:     $this->server->handle($request);
                     24:     $response = ob_get_contents();
                     25:     ob_end_clean();
                     26:     return $response;
                     27:   }
                     28: }
                     29: 
                     30: $client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl");
                     31: $client->Test("str");
                     32: $client = new LocalSoapClient(dirname(__FILE__)."/bug31695.wsdl", array("location"=>"test://1"));
                     33: $client->Test("str");
                     34: $client->__soapCall("Test", 
                     35:                     array("arg1"),
                     36:                      array("location"=>"test://2"));
                     37: $old = $client->__setLocation("test://3");
                     38: echo "$old\n";
                     39: $client->Test("str");
                     40: $client->Test("str");
                     41: $client->__setLocation($old);
                     42: $client->Test("str");
                     43: $old = $client->__setLocation();
                     44: $client->Test("str");
                     45: $client->__setLocation($old);
                     46: $client->Test("str");
                     47: $client->__setLocation(null);
                     48: $client->Test("str");
                     49: var_dump($client->__setLocation());
                     50: ?>
                     51: --EXPECT--
                     52: test://0
                     53: test://1
                     54: test://2
                     55: test://1
                     56: test://3
                     57: test://3
                     58: test://1
                     59: test://0
                     60: test://1
                     61: test://0
                     62: NULL

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