public function testShouldBeAuthenticated() { $login = '******'; $password = '******'; $token = 'xpto321'; $httpClient = $this->getHttpClientMock(); $loginResult = $this->getLoginResultMock(); $loginResult->method('getServerUrl')->willReturn('https://cs21.salesforce.com/services/Soap/c/32.0/'); $soapClient = $this->getSoapClientMock(); $soapClient->expects($this->once())->method('authenticate')->with($login, $password, $token)->willReturn($loginResult); $client = new Client($this->getWSDLPath(), $httpClient); $client->setSoapClient($soapClient); $client->authenticate($login, $password, $token); $this->assertTrue($client->isAuthenticated()); }