Example #1
0
 public function testChainInitialization()
 {
     $client = new \sociall\LinkedIn();
     $client->setAppId($this->_app_id)->setAppSecret($this->_app_secret)->setAuthCallbackURL($this->_callback_url);
     $this->assertEquals($client->getAppId(), $this->_app_id);
     $this->assertEquals($client->getAppSecret(), $this->_app_secret);
     $this->assertEquals($client->getAuthCallbackURL(), $this->_callback_url);
 }
 public function testCSRFRandomness()
 {
     $client1 = new \sociall\LinkedIn(["app_id" => $this->_app_id, "app_secret" => $this->_app_secret, "auth_callback_url" => $this->_callback_url]);
     $client2 = new \sociall\LinkedIn(["app_id" => $this->_app_id, "app_secret" => $this->_app_secret, "auth_callback_url" => $this->_callback_url]);
     // even if both clients use the same App ID and secret,
     // the CSRF token generated should be unique!
     $url1 = $client1->getAuthorizationURL();
     $url2 = $client2->getAuthorizationURL();
     $this->assertNotEquals($client1->getLastCSRF(), $client2->getLastCSRF());
 }