/** * @Given /^I have an OAuth access token$/ */ public function iHaveAnOauthAccessToken() { $params = array('grant_type' => 'client_credentials', 'client_id' => $this->app->getPublicId(), 'client_secret' => $this->app->getSecret()); $this->getClient()->request('GET', '/oauth/v2/token', $params); $data = json_decode($this->getClient()->getResponse()->getContent()); $this->access_token = $data->access_token; }
public function testRememberAuthorization() { $this->login('*****@*****.**', 'password'); $token = $this->performOAuthUserLogin(''); $this->assertTrue(is_string($token)); //Go to auth page a second time $params = array('client_id' => $this->app->getPublicId(), 'response_type' => 'code', 'redirect_uri' => '/authenticate', 'scope' => ''); $this->userClient->request('GET', '/oauth/v2/auth', $params); $this->assertEquals(302, $this->userClient->getResponse()->getStatusCode()); }