public function testDeveloperLogin() { try { $userAuthInfo = new UserAuthInfo(); $userAuthInfo->emailAddress = $this->emailAddress; $userAuthInfo->password = $this->password; $authenticationProfile = UserAuthenticator::authenticate($userAuthInfo, AuthenticationScope::DEVELOEPR); $this->assertNotNull($authenticationProfile->authTicket); $this->assertNotNull($authenticationProfile->authorizedScopes); UserAuthenticator::logout($authenticationProfile->authTicket); } catch (Exception $e) { parent::printError($e); $this->fail($e->getMessage()); } }
private function setUserAuth() { $newTicket = null; $authTicket = $this->apiContext->getUserAuthTicket(); if ($authTicket->authenticationScope == AuthenticationScope::CUSTOMER) { $newTicket = CustomerAuthenticator::ensureAuthTicket($authTicket); } else { $newTicket = UserAuthenticator::ensureAuthTicket($authTicket); } if ($newTicket != null) { $authTicket = $newTicket->authTicket; } $this->withHeader(Headers::X_VOL_USER_CLAIMS, $authTicket->accessToken); $this->apiContext->setUserAuthTicket($authTicket); return $this; }