ClientTest.php 24 KB

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