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 }
/** * 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); }