コード例 #1
0
ファイル: NetizenTest.php プロジェクト: xtrasmal/iinano
 public function testCredentialStrategy()
 {
     $strat = $this->getMock('Trismegiste\\SocialBundle\\Security\\Credential\\Strategy');
     $this->sut->setCredential($strat);
     $this->assertEquals($strat, $this->sut->getCredential());
     $this->sut->eraseCredentials();
     // for CC
 }
コード例 #2
0
ファイル: GuestController.php プロジェクト: xtrasmal/iinano
 /**
  * Automatic post-registration user authentication
  */
 protected function authenticateAccount(Netizen $account)
 {
     $cred = $account->getCredential();
     $token = new Token('secured_area', $cred->getProviderKey(), $cred->getUid(), $account->getRoles());
     $token->setUser($account);
     $this->get('security.context')->setToken($token);
 }