コード例 #1
0
 public function testPost()
 {
     $expected = '{"test":"cool"}';
     $token = array('oauth_token' => 'requestkey', 'oauth_token_secret' => 'requestsecret');
     Consumer::config(array('classes' => array('socket' => '\\li3_oauth\\tests\\mocks\\extensions\\service\\MockSocket')));
     $result = Consumer::post('search', array(), compact('token'));
     $this->assertEqual($expected, $result);
 }
コード例 #2
0
 protected function _init()
 {
     parent::_init();
     Consumer::config(array('host' => $this->request->env('SERVER_NAME'), 'oauth_consumer_key' => '59f87a2f8e430bbad5c84b61ed06304fc9204bcb', 'oauth_consumer_secret' => '4b498c24588bc56685e68f0d2c52ee6becf96ba3', 'request' => $this->request->env('base') . '/oauth/request_token', 'access' => $this->request->env('base') . '/oauth/access_token', 'authorize' => $this->request->env('base') . '/oauth/authorize', 'port' => 30501));
 }
コード例 #3
0
 protected function _init()
 {
     parent::_init();
     Consumer::config(array('service' => 'oauth2', 'scheme' => 'https', 'port' => '443', 'host' => 'graph.facebook.com', 'secondary_host' => 'www.facebook.com', 'client_id' => 'your_client_id', 'scope' => 'email,read_stream', 'client_secret' => 'your_client_secret', 'success' => 'http://localhost/facebook/success'));
 }
コード例 #4
0
 protected function _init()
 {
     parent::_init();
     Consumer::config(array('host' => 'twitter.com', 'oauth_consumer_key' => '', 'oauth_consumer_secret' => ''));
 }