/** * @covers Intacct\Credentials\SessionCredentials::__construct * @covers Intacct\Credentials\SessionCredentials::getEndpoint */ public function testCredsFromArrayNoEndpoint() { $config = ['session_id' => 'faKEsesSiOnId..', 'endpoint_url' => null]; $sessionCreds = new SessionCredentials($config, $this->senderCreds); $endpoint = $sessionCreds->getEndpoint(); $this->assertEquals('https://api.intacct.com/ia/xml/xmlgw.phtml', $endpoint->getEndpoint()); }
/** * Generate an Intacct session based on existing session credentials * * @param SessionCredentials $sessionCreds * @return SessionCredentials */ public function fromSessionCredentials(SessionCredentials $sessionCreds) { $senderCreds = $sessionCreds->getSenderCredentials(); $endpoint = $sessionCreds->getEndpoint(); $config = $this->getConfig($senderCreds, $endpoint); $config['session_id'] = $sessionCreds->getSessionId(); $config['mock_handler'] = $sessionCreds->getMockHandler(); $session = $this->getAPISession($config); return new SessionCredentials($session, $senderCreds); }