/** * Method to return the SoapClient object, initiating a connection if one doesn't already exist. * * @return \SoapClient * @throws \SoapFault */ protected function getSoapClient() { switch (true) { case !$this->SoapClient instanceof SoapClient: if ($this->SoapOpts) { $this->SoapClient = new SoapClient($this->SoapUrl, $this->SoapOpts); } else { $this->SoapClient = new SoapClient($this->SoapUrl); } default: $this->SoapClient->__setSoapHeaders($this->Auth->doLogin()); return $this->SoapClient; } }
/** * Assert that a non-string value passed to setPassword results in an exception * * @dataProvider BadCredentialData */ public function testBadPassword($password) { $this->setExpectedException('InvalidArgumentException', sprintf('Argument "%s" passed to WebServices\\Soap\\SalesNet\\Authentication::setPassword must be a string', $password)); $this->auth->setPassword($password); }