SoapFactoryMock.php 809 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Test\Integration\Mock;
  7. use Vertex\Utility\SoapClientFactory;
  8. /**
  9. * Provides a way for tests to mock the SOAP Response and handle the SOAP Request without mocking ApiClient
  10. */
  11. class SoapFactoryMock extends SoapClientFactory
  12. {
  13. /** @var \SoapClient */
  14. private $client;
  15. /**
  16. * Set the SOAP Client to be returned from a creation
  17. *
  18. * @param \SoapClient $client
  19. */
  20. public function setSoapClient(\SoapClient $client)
  21. {
  22. $this->client = $client;
  23. }
  24. /**
  25. * @inheritdoc
  26. */
  27. public function create($wsdl, array $options = [])
  28. {
  29. return $this->client;
  30. }
  31. }