/** * @cover \Alchemy\Phrasea\Controller\Root\Developers::authorizeGrantpassword */ public function testAuthorizeGrantpasswordToken() { $oauthApp = self::$DI['oauth2-app-user']; $this->XMLHTTPRequest('POST', '/developers/application/' . $oauthApp->get_id() . '/authorize_grant_password/', ['grant' => '1']); $this->assertTrue(self::$DI['client']->getResponse()->isOk()); $content = json_decode(self::$DI['client']->getResponse()->getContent()); $this->assertTrue($content->success); $oauthApp = new \API_OAuth2_Application(self::$DI['app'], $oauthApp->get_id()); $this->assertTrue($oauthApp->is_password_granted()); }