/** * 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; } }
/** * Method to assert that attempting a login with no credentials raises an exception * * @expectedException \BadMethodCallException */ public function testLoginNoData() { $this->auth->doLogin(); }