| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- require_once dirname(__FILE__)."/../../../TestHelper.php";
- require_once dirname(__FILE__)."/../_files/commontypes.php";
- /** Zend_Soap_Server */
- require_once 'Zend/Soap/Client.php';
- class Zend_Soap_AutoDiscover_OnlineTest extends PHPUnit_Framework_TestCase
- {
- protected $baseuri;
- public function setUp()
- {
- if(!defined('TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI') || constant('TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI') == false) {
- $this->markTestSkipped('The constant TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI has to be defined to allow the Online test to work.');
- }
- $this->baseuri = TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI;
- }
- public function testNestedObjectArrayResponse()
- {
- $wsdl = $this->baseuri."/server1.php?wsdl";
- $b = new Zend_Soap_Wsdl_ComplexTypeB();
- $b->bar = "test";
- $b->foo = "test";
- $client = new Zend_Soap_Client($wsdl);
- $ret = $client->request($b);
- $this->assertTrue( is_array($ret) );
- $this->assertEquals(1, count($ret) );
- $this->assertTrue( is_array($ret[0]->baz) );
- $this->assertEquals(3, count($ret[0]->baz) );
- $baz = $ret[0]->baz;
- $this->assertEquals("bar", $baz[0]->bar);
- $this->assertEquals("bar", $baz[0]->foo);
- $this->assertEquals("foo", $baz[1]->bar);
- $this->assertEquals("foo", $baz[1]->foo);
- $this->assertEquals("test", $baz[2]->bar);
- $this->assertEquals("test", $baz[2]->foo);
- }
- public function testObjectResponse()
- {
- $wsdl = $this->baseuri."/server2.php?wsdl";
- $client = new Zend_Soap_Client($wsdl);
- $ret = $client->request("test", "test");
- $this->assertTrue( ($ret instanceof stdClass) );
- $this->assertEquals("test", $ret->foo);
- $this->assertEquals("test", $ret->bar);
- }
- }
|