DragonBe\Vies\Vies::getSoapClient PHP Method

getSoapClient() public method

Retrieves the SOAP client that will be used to communicate with the VIES SOAP service.
public getSoapClient ( ) : SoapClient
return SoapClient
    public function getSoapClient()
    {
        if (null === $this->soapClient) {
            $this->soapClient = new \SoapClient($this->getWsdl(), $this->getOptions());
        }
        return $this->soapClient;
    }

Usage Example

Esempio n. 1
0
 /**
  * @covers \DragonBe\Vies\Vies::setOptions
  * @covers \DragonBe\Vies\Vies::getOptions
  */
 public function testSettingSoapOptions()
 {
     if (defined('HHVM_VERSION')) {
         $this->markTestSkipped('This test does not work for HipHop VM');
     }
     $options = array('soap_version' => SOAP_1_1);
     $vies = new Vies();
     $vies->setSoapClient($this->_createdStubbedViesClient('blabla')->getSoapClient());
     $vies->setOptions($options);
     $soapClient = $vies->getSoapClient();
     $actual = $soapClient->_soap_version;
     $this->assertSame($options['soap_version'], $actual);
     $this->assertSame($options, $vies->getOptions());
 }