2011-12-04 15 views

答えて

2

これの多くは、その目的、あなたが推測する必要があります関数ですが、これは私が自分自身を流れのOAuthの書いたテストです:

$this->loginAsTestUser(); 

$oauth_uri = $this->fbURI() 
    ->setPath('/dialog/oauth') 
    ->addQueryData('client_id', self::RELL_APP_ID) 
    ->addQueryData('redirect_uri', self::RELL_URL); 
$this->open($oauth_uri); 
$this->platform->tosApp(); 

$code = $this->getURI()->getQueryData('code'); 
$this->assertNotEmpty($code, 'No code returned in redirect url'); 

$token_uri = $this->fbURI('graph') 
    ->setSecure(true) 
    ->setPath('/oauth/access_token') 
    ->addQueryData('client_id', self::RELL_APP_ID) 
    ->addQueryData('client_secret', self::RELL_SECRET) 
    ->addQueryData('code', $code) 
    ->addQueryData('redirect_uri', self::RELL_URL); 
$this->open($token_uri); 
$this->assertRegExp(
    '/access_token=.+/', $this->source(), 
    'No access token returned in source'); 
+0

私は、これはHTTPリクエストを使用してRESTのAPIレベルであると考えていますUIログインを実行するためにSeleniumをバイパスしますか? – David

関連する問題