ClientTest.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Soap
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. define('PHPUnit_MAIN_METHOD', 'Zend_Soap_ClientTest::main');
  24. }
  25. require_once dirname(__FILE__)."/../../TestHelper.php";
  26. /** PHPUnit Test Case */
  27. require_once "PHPUnit/Framework/TestCase.php";
  28. /** Zend_Soap_Server */
  29. require_once 'Zend/Soap/Server.php';
  30. /** Zend_Soap_Client */
  31. require_once 'Zend/Soap/Client.php';
  32. require_once 'Zend/Config.php';
  33. /**
  34. * @category Zend
  35. * @package Zend_Soap
  36. * @subpackage UnitTests
  37. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  38. * @license http://framework.zend.com/license/new-bsd New BSD License
  39. * @group Zend_Soap
  40. */
  41. class Zend_Soap_ClientTest extends PHPUnit_Framework_TestCase
  42. {
  43. /**
  44. * Runs this test suite
  45. *
  46. * @return void
  47. */
  48. public static function main()
  49. {
  50. $suite = new PHPUnit_Framework_TestSuite(__CLASS__);
  51. $result = PHPUnit_TextUI_TestRunner::run($suite);
  52. }
  53. public function setUp()
  54. {
  55. if (!extension_loaded('soap')) {
  56. $this->markTestSkipped('SOAP Extension is not loaded');
  57. }
  58. }
  59. public function testSetOptions()
  60. {
  61. /*************************************************************
  62. * ------ Test WSDL mode options -----------------------------
  63. *************************************************************/
  64. $client = new Zend_Soap_Client();
  65. $this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  66. $ctx = stream_context_create();
  67. $nonWsdlOptions = array('soap_version' => SOAP_1_1,
  68. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  69. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  70. 'encoding' => 'ISO-8859-1',
  71. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  72. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  73. 'use' => SOAP_ENCODED,
  74. 'style' => SOAP_RPC,
  75. 'login' => 'http_login',
  76. 'password' => 'http_password',
  77. 'proxy_host' => 'proxy.somehost.com',
  78. 'proxy_port' => 8080,
  79. 'proxy_login' => 'proxy_login',
  80. 'proxy_password' => 'proxy_password',
  81. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  82. 'passphrase' => 'some pass phrase',
  83. 'stream_context' => $ctx,
  84. 'cache_wsdl' => 8,
  85. 'features' => 4,
  86. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  87. $client->setOptions($nonWsdlOptions);
  88. $this->assertTrue($client->getOptions() == $nonWsdlOptions);
  89. /*************************************************************
  90. * ------ Test non-WSDL mode options -----------------------------
  91. *************************************************************/
  92. $client1 = new Zend_Soap_Client();
  93. $this->assertTrue($client1->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  94. $wsdlOptions = array('soap_version' => SOAP_1_1,
  95. 'wsdl' => dirname(__FILE__).'/_files/wsdl_example.wsdl',
  96. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  97. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  98. 'encoding' => 'ISO-8859-1',
  99. 'login' => 'http_login',
  100. 'password' => 'http_password',
  101. 'proxy_host' => 'proxy.somehost.com',
  102. 'proxy_port' => 8080,
  103. 'proxy_login' => 'proxy_login',
  104. 'proxy_password' => 'proxy_password',
  105. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  106. 'passphrase' => 'some pass phrase',
  107. 'stream_context' => $ctx,
  108. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  109. $client1->setOptions($wsdlOptions);
  110. $this->assertTrue($client1->getOptions() == $wsdlOptions);
  111. }
  112. public function testGetOptions()
  113. {
  114. $client = new Zend_Soap_Client();
  115. $this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  116. $options = array('soap_version' => SOAP_1_1,
  117. 'wsdl' => dirname(__FILE__).'/_files/wsdl_example.wsdl',
  118. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  119. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  120. 'encoding' => 'ISO-8859-1',
  121. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  122. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  123. 'use' => SOAP_ENCODED,
  124. 'style' => SOAP_RPC,
  125. 'login' => 'http_login',
  126. 'password' => 'http_password',
  127. 'proxy_host' => 'proxy.somehost.com',
  128. 'proxy_port' => 8080,
  129. 'proxy_login' => 'proxy_login',
  130. 'proxy_password' => 'proxy_password',
  131. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  132. 'passphrase' => 'some pass phrase',
  133. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  134. $client->setOptions($options);
  135. $this->assertTrue($client->getOptions() == $options);
  136. }
  137. /**
  138. * @group ZF-8053
  139. */
  140. public function testGetAndSetUserAgentOption()
  141. {
  142. $client = new Zend_Soap_Client();
  143. $this->assertNull($client->getUserAgent());
  144. $client->setUserAgent('agent1');
  145. $this->assertEquals('agent1', $client->getUserAgent());
  146. $client->setOptions(array(
  147. 'user_agent' => 'agent2'
  148. ));
  149. $this->assertEquals('agent2', $client->getUserAgent());
  150. $client->setOptions(array(
  151. 'useragent' => 'agent3'
  152. ));
  153. $this->assertEquals('agent3', $client->getUserAgent());
  154. $client->setOptions(array(
  155. 'userAgent' => 'agent4'
  156. ));
  157. $this->assertEquals('agent4', $client->getUserAgent());
  158. $options = $client->getOptions();
  159. $this->assertEquals('agent4', $options['user_agent']);
  160. }
  161. /**
  162. * @group ZF-6954
  163. */
  164. public function testUserAgentAllowsEmptyString()
  165. {
  166. $client = new Zend_Soap_Client();
  167. $this->assertNull($client->getUserAgent());
  168. $options = $client->getOptions();
  169. $this->assertArrayNotHasKey('user_agent', $options);
  170. $client->setUserAgent('');
  171. $this->assertEquals('', $client->getUserAgent());
  172. $options = $client->getOptions();
  173. $this->assertEquals('', $options['user_agent']);
  174. $client->setUserAgent(null);
  175. $this->assertNull($client->getUserAgent());
  176. $options = $client->getOptions();
  177. $this->assertArrayNotHasKey('user_agent', $options);
  178. }
  179. /**
  180. * @group ZF-10524
  181. */
  182. public function testAllowNumericZeroAsValueForCacheWsdlOption()
  183. {
  184. $client = new Zend_Soap_Client();
  185. $this->assertNull($client->getWsdlCache());
  186. $options = $client->getOptions();
  187. $this->assertArrayNotHasKey('cache_wsdl', $options);
  188. $client->setWsdlCache(WSDL_CACHE_NONE);
  189. $this->assertSame(WSDL_CACHE_NONE, $client->getWsdlCache());
  190. $options = $client->getOptions();
  191. $this->assertSame(WSDL_CACHE_NONE, $options['cache_wsdl']);
  192. $client->setWsdlCache(null);
  193. $this->assertNull($client->getWsdlCache());
  194. $options = $client->getOptions();
  195. $this->assertArrayNotHasKey('cache_wsdl', $options);
  196. }
  197. /**
  198. * @group ZF-10524
  199. */
  200. public function testAllowNumericZeroAsValueForCompressionOptions()
  201. {
  202. $client = new Zend_Soap_Client();
  203. $this->assertNull($client->getCompressionOptions());
  204. $options = $client->getOptions();
  205. $this->assertArrayNotHasKey('compression', $options);
  206. $client->setCompressionOptions(SOAP_COMPRESSION_GZIP);
  207. $this->assertSame(SOAP_COMPRESSION_GZIP, $client->getCompressionOptions());
  208. $options = $client->getOptions();
  209. $this->assertSame(SOAP_COMPRESSION_GZIP, $options['compression']);
  210. $client->setCompressionOptions(null);
  211. $this->assertNull($client->getCompressionOptions());
  212. $options = $client->getOptions();
  213. $this->assertArrayNotHasKey('compression', $options);
  214. }
  215. public function testGetFunctions()
  216. {
  217. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  218. $server->setClass('Zend_Soap_Client_TestClass');
  219. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  220. $this->assertTrue($client->getFunctions() == array('string testFunc1()',
  221. 'string testFunc2(string $who)',
  222. 'string testFunc3(string $who, int $when)',
  223. 'string testFunc4()'));
  224. }
  225. /**
  226. * @todo Implement testGetTypes().
  227. */
  228. public function testGetTypes()
  229. {
  230. // Remove the following line when you implement this test.
  231. $this->markTestIncomplete(
  232. "This test has not been implemented yet."
  233. );
  234. }
  235. public function testGetLastRequest()
  236. {
  237. if (headers_sent()) {
  238. $this->markTestSkipped('Cannot run testGetLastRequest() when headers have already been sent; enable output buffering to run this test');
  239. return;
  240. }
  241. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  242. $server->setClass('Zend_Soap_Client_TestClass');
  243. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  244. // Perform request
  245. $client->testFunc2('World');
  246. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  247. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  248. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  249. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  250. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  251. . '<env:Body>'
  252. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  253. . '<who xsi:type="xsd:string">World</who>'
  254. . '</env:testFunc2>'
  255. . '</env:Body>'
  256. . '</env:Envelope>' . "\n";
  257. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  258. }
  259. public function testGetLastResponse()
  260. {
  261. if (headers_sent()) {
  262. $this->markTestSkipped('Cannot run testGetLastResponse() when headers have already been sent; enable output buffering to run this test');
  263. return;
  264. }
  265. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  266. $server->setClass('Zend_Soap_Client_TestClass');
  267. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  268. // Perform request
  269. $client->testFunc2('World');
  270. $expectedResponse = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  271. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  272. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  273. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  274. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  275. . '<env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">'
  276. . '<env:testFunc2Response env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  277. . '<rpc:result>testFunc2Return</rpc:result>'
  278. . '<testFunc2Return xsi:type="xsd:string">Hello World!</testFunc2Return>'
  279. . '</env:testFunc2Response>'
  280. . '</env:Body>'
  281. . '</env:Envelope>' . "\n";
  282. $this->assertEquals($client->getLastResponse(), $expectedResponse);
  283. }
  284. public function testCallInvoke()
  285. {
  286. if (headers_sent()) {
  287. $this->markTestSkipped('Cannot run testCallInvoke() when headers have already been sent; enable output buffering to run this test');
  288. return;
  289. }
  290. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  291. $server->setClass('Zend_Soap_Client_TestClass');
  292. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  293. $this->assertEquals($client->testFunc2('World'), 'Hello World!');
  294. }
  295. public function testSetOptionsWithZendConfig()
  296. {
  297. $ctx = stream_context_create();
  298. $nonWsdlOptions = array('soap_version' => SOAP_1_1,
  299. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  300. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  301. 'encoding' => 'ISO-8859-1',
  302. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  303. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  304. 'use' => SOAP_ENCODED,
  305. 'style' => SOAP_RPC,
  306. 'login' => 'http_login',
  307. 'password' => 'http_password',
  308. 'proxy_host' => 'proxy.somehost.com',
  309. 'proxy_port' => 8080,
  310. 'proxy_login' => 'proxy_login',
  311. 'proxy_password' => 'proxy_password',
  312. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  313. 'passphrase' => 'some pass phrase',
  314. 'stream_context' => $ctx,
  315. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5
  316. );
  317. $config = new Zend_Config($nonWsdlOptions);
  318. $client = new Zend_Soap_Client(null, $config);
  319. $this->assertEquals($nonWsdlOptions, $client->getOptions());
  320. }
  321. public function testSetInputHeaders()
  322. {
  323. if (headers_sent()) {
  324. $this->markTestSkipped('Cannot run testSetInputHeaders() when headers have already been sent; enable output buffering to run this test');
  325. return;
  326. }
  327. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  328. $server->setClass('Zend_Soap_Client_TestClass');
  329. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  330. // Add request header
  331. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader1', 'SOAP header content 1'));
  332. // Add permanent request header
  333. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader2', 'SOAP header content 2'), true);
  334. // Perform request
  335. $client->testFunc2('World');
  336. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  337. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  338. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  339. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  340. . 'xmlns:ns1="http://www.example.com/namespace" '
  341. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  342. . '<env:Header>'
  343. . '<ns1:MyHeader2>SOAP header content 2</ns1:MyHeader2>'
  344. . '<ns1:MyHeader1>SOAP header content 1</ns1:MyHeader1>'
  345. . '</env:Header>'
  346. . '<env:Body>'
  347. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  348. . '<who xsi:type="xsd:string">World</who>'
  349. . '</env:testFunc2>'
  350. . '</env:Body>'
  351. . '</env:Envelope>' . "\n";
  352. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  353. // Add request header
  354. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader3', 'SOAP header content 3'));
  355. // Perform request
  356. $client->testFunc2('World');
  357. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  358. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  359. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  360. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  361. . 'xmlns:ns1="http://www.example.com/namespace" '
  362. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  363. . '<env:Header>'
  364. . '<ns1:MyHeader2>SOAP header content 2</ns1:MyHeader2>'
  365. . '<ns1:MyHeader3>SOAP header content 3</ns1:MyHeader3>'
  366. . '</env:Header>'
  367. . '<env:Body>'
  368. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  369. . '<who xsi:type="xsd:string">World</who>'
  370. . '</env:testFunc2>'
  371. . '</env:Body>'
  372. . '</env:Envelope>' . "\n";
  373. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  374. $client->resetSoapInputHeaders();
  375. // Add request header
  376. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader4', 'SOAP header content 4'));
  377. // Perform request
  378. $client->testFunc2('World');
  379. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  380. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  381. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  382. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  383. . 'xmlns:ns1="http://www.example.com/namespace" '
  384. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  385. . '<env:Header>'
  386. . '<ns1:MyHeader4>SOAP header content 4</ns1:MyHeader4>'
  387. . '</env:Header>'
  388. . '<env:Body>'
  389. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  390. . '<who xsi:type="xsd:string">World</who>'
  391. . '</env:testFunc2>'
  392. . '</env:Body>'
  393. . '</env:Envelope>' . "\n";
  394. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  395. }
  396. /**
  397. * @group ZF-6955
  398. */
  399. public function testSetCookieIsDelegatedToSoapClient()
  400. {
  401. $fixtureCookieKey = "foo";
  402. $fixtureCookieValue = "bar";
  403. $clientMock = $this->getMock('SoapClient', array('__setCookie'), array(null, array('uri' => 'http://www.zend.com', 'location' => 'http://www.zend.com')));
  404. $clientMock->expects($this->once())
  405. ->method('__setCookie')
  406. ->with($fixtureCookieKey, $fixtureCookieValue);
  407. $soap = new Zend_Soap_Client();
  408. $soap->setSoapClient($clientMock);
  409. $soap->setCookie($fixtureCookieKey, $fixtureCookieValue);
  410. }
  411. public function testSetSoapClient()
  412. {
  413. $clientMock = $this->getMock('SoapClient', array('__setCookie'), array(null, array('uri' => 'http://www.zend.com', 'location' => 'http://www.zend.com')));
  414. $soap = new Zend_Soap_Client();
  415. $soap->setSoapClient($clientMock);
  416. $this->assertSame($clientMock, $soap->getSoapClient());
  417. }
  418. }
  419. /** Test Class */
  420. class Zend_Soap_Client_TestClass {
  421. /**
  422. * Test Function 1
  423. *
  424. * @return string
  425. */
  426. function testFunc1()
  427. {
  428. return "Hello World";
  429. }
  430. /**
  431. * Test Function 2
  432. *
  433. * @param string $who Some Arg
  434. * @return string
  435. */
  436. function testFunc2($who)
  437. {
  438. return "Hello $who!";
  439. }
  440. /**
  441. * Test Function 3
  442. *
  443. * @param string $who Some Arg
  444. * @param int $when Some
  445. * @return string
  446. */
  447. function testFunc3($who, $when)
  448. {
  449. return "Hello $who, How are you $when";
  450. }
  451. /**
  452. * Test Function 4
  453. *
  454. * @return string
  455. */
  456. static function testFunc4()
  457. {
  458. return "I'm Static!";
  459. }
  460. }
  461. /** Test class 2 */
  462. class Zend_Soap_Client_TestData1 {
  463. /**
  464. * Property1
  465. *
  466. * @var string
  467. */
  468. public $property1;
  469. /**
  470. * Property2
  471. *
  472. * @var float
  473. */
  474. public $property2;
  475. }
  476. /** Test class 2 */
  477. class Zend_Soap_Client_TestData2 {
  478. /**
  479. * Property1
  480. *
  481. * @var integer
  482. */
  483. public $property1;
  484. /**
  485. * Property1
  486. *
  487. * @var float
  488. */
  489. public $property2;
  490. }
  491. /* Test Functions */
  492. /**
  493. * Test Function
  494. *
  495. * @param string $arg
  496. * @return string
  497. */
  498. function Zend_Soap_Client_TestFunc1($who)
  499. {
  500. return "Hello $who";
  501. }
  502. /**
  503. * Test Function 2
  504. */
  505. function Zend_Soap_Client_TestFunc2()
  506. {
  507. return "Hello World";
  508. }
  509. /**
  510. * Return false
  511. *
  512. * @return bool
  513. */
  514. function Zend_Soap_Client_TestFunc3()
  515. {
  516. return false;
  517. }
  518. /**
  519. * Return true
  520. *
  521. * @return bool
  522. */
  523. function Zend_Soap_Client_TestFunc4()
  524. {
  525. return true;
  526. }
  527. /**
  528. * Return integer
  529. *
  530. * @return int
  531. */
  532. function Zend_Soap_Client_TestFunc5()
  533. {
  534. return 123;
  535. }
  536. /**
  537. * Return string
  538. *
  539. * @return string
  540. */
  541. function Zend_Soap_Client_TestFunc6()
  542. {
  543. return "string";
  544. }
  545. if (PHPUnit_MAIN_METHOD == 'Zend_Soap_ClientTest::main') {
  546. Zend_Soap_ClientTest::main();
  547. }