コード例 #1
0
ファイル: NetizenTest.php プロジェクト: xtrasmal/iinano
 public function testRoles()
 {
     $this->sut->setGroup('ROLE_ADMIN');
     $this->assertEquals('ROLE_ADMIN', $this->sut->getGroup());
     $this->assertEquals(['ROLE_ADMIN'], $this->sut->getRoles());
     // for BC
 }
コード例 #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);
 }