WsdlFactoryTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Test \Magento\Webapi\Model\Soap\WsdlFactory
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Webapi\Test\Unit\Model\Soap;
  9. class WsdlFactoryTest extends \PHPUnit\Framework\TestCase
  10. {
  11. /** @var \PHPUnit_Framework_MockObject_MockObject */
  12. protected $_objectManagerMock;
  13. /** @var \Magento\Webapi\Model\Soap\WsdlFactory */
  14. protected $_soapWsdlFactory;
  15. protected function setUp()
  16. {
  17. $this->_objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class);
  18. $this->_soapWsdlFactory = new \Magento\Webapi\Model\Soap\WsdlFactory($this->_objectManagerMock);
  19. parent::setUp();
  20. }
  21. protected function tearDown()
  22. {
  23. unset($this->_objectManagerMock);
  24. unset($this->_soapWsdlFactory);
  25. parent::tearDown();
  26. }
  27. public function testCreate()
  28. {
  29. $wsdlName = 'wsdlName';
  30. $endpointUrl = 'endpointUrl';
  31. $this->_objectManagerMock->expects(
  32. $this->once()
  33. )->method(
  34. 'create'
  35. )->with(
  36. \Magento\Webapi\Model\Soap\Wsdl::class,
  37. ['name' => $wsdlName, 'uri' => $endpointUrl]
  38. );
  39. $this->_soapWsdlFactory->create($wsdlName, $endpointUrl);
  40. }
  41. }