SoapFactoryMock.php 809 Bytes
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?php
/**
 * @copyright  Vertex. All rights reserved.  https://www.vertexinc.com/
 * @author     Mediotype                     https://www.mediotype.com/
 */

namespace Vertex\Tax\Test\Integration\Mock;

use Vertex\Utility\SoapClientFactory;

/**
 * Provides a way for tests to mock the SOAP Response and handle the SOAP Request without mocking ApiClient
 */
class SoapFactoryMock extends SoapClientFactory
{
    /** @var \SoapClient */
    private $client;

    /**
     * Set the SOAP Client to be returned from a creation
     *
     * @param \SoapClient $client
     */
    public function setSoapClient(\SoapClient $client)
    {
        $this->client = $client;
    }

    /**
     * @inheritdoc
     */
    public function create($wsdl, array $options = [])
    {
        return $this->client;
    }
}