SoapTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Webapi\Controller;
  7. class SoapTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Webapi\Controller\Soap
  11. */
  12. protected $soapController;
  13. /**
  14. * @var \Magento\Framework\ObjectManagerInterface
  15. */
  16. protected $objectManager;
  17. protected function setUp()
  18. {
  19. $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
  20. $this->soapController = $this->objectManager->get(\Magento\Webapi\Controller\Soap::class);
  21. }
  22. /*
  23. * Get the public wsdl with anonymous credentials
  24. */
  25. public function testDispatchWsdlRequest()
  26. {
  27. $request = $this->objectManager->get(\Magento\Framework\Webapi\Request::class);
  28. $request->setParam(\Magento\Webapi\Model\Soap\Server::REQUEST_PARAM_LIST_WSDL, true);
  29. $response = $this->soapController->dispatch($request);
  30. $decoded_wsdl = json_decode($response->getContent(), true);
  31. $this->assertArrayHasKey("customerAccountManagementV1", $decoded_wsdl);
  32. $this->assertArrayHasKey("integrationAdminTokenServiceV1", $decoded_wsdl);
  33. }
  34. }