Ntb\RestAPI\OAuth\SocialMemberAuthenticatorTest
Test mechanisms in social member authenticator
- Author: Christian Blank <c.blank@notthatbad.net>
Synopsis
class SocialMemberAuthenticatorTest
extends SapphireTest
{
- // members
- protected boolean $usesDatabase = true;
- protected PHPUnit_Framework_MockObject_MockObject $mockFacebook;
- protected Member $member;
- protected SocialIdentity $identity;
- protected SocialMemberAuthenticator $sut;
- // methods
- public void setUp()
- protected void givenFacebookValidatesTheTokenAs()
- protected void givenFacebookReturnsProfileData()
- public void testValidateTokenWithWrongSocialAdapter()
- public void testCanAuthenticateWithValidToken()
- public void testInvalidToken()
- public void testInvalidService()
- public void testInvalidUserId()
- public void testCanAuthenticateWithEmailAndPassword()
- public void testInvalidPassword()
- public void testEmpty()
- public void testCanConnectSocialAccountThroughLogin()
- public void testCannotConnectSocialAccountWithMismatchedEmail()
- public void testCanDisableConnectingSocialAccountThroughLogin()
Hierarchy
Extends
- SapphireTest
Members
protected
- $identity — Ntb\SocialIdentity
- $member — Member
- $mockFacebook — PHPUnit_Framework_MockObject_MockObject
- $sut — Ntb\RestAPI\OAuth\SocialMemberAuthenticator
- $usesDatabase
Methods
protected
- givenFacebookReturnsProfileData() — Allows us to stub the facebook API's response about the profile
- givenFacebookValidatesTheTokenAs() — Allows us to stub the facebook API's response about whether the access token matches
public
- setUp()
- testCanAuthenticateWithEmailAndPassword()
- testCanAuthenticateWithValidToken()
- testCanConnectSocialAccountThroughLogin()
- testCanDisableConnectingSocialAccountThroughLogin()
- testCannotConnectSocialAccountWithMismatchedEmail()
- testEmpty()
- testInvalidPassword()
- testInvalidService()
- testInvalidToken()
- testInvalidUserId()
- testValidateTokenWithWrongSocialAdapter()