PHP Class Elgg\PersistentLoginTest

Inheritance: extends TestCase
Show file Open project: elgg/elgg

Protected Properties

Property Type Description
$cryptoMock PHPUnit_Framework_MockObject_MockObject
$dbMock PHPUnit_Framework_MockObject_MockObject
$lastCookieSet ElggCookie
$mockHash string
$mockToken string
$session ElggSession
$svc PersistentLoginService
$thirtyDaysAgo integer
$timeSlept integer
$user123 PHPUnit_Framework_MockObject_MockObject

Public Methods

Method Description
getMockElggUser ( $guid ) mock \ElggUser which will return the GUID on ->guid reads
mock_deleteAll ( $sql )
mock_deleteData ( $sql )
mock_elgg_set_cookie ( ElggCookie $cookie )
mock_getDataRow ( $sql )
mock_get_user ( $guid )
mock_insertData ( $sql )
mock_sanitizeString ( $string )
mock_sleep ( $seconds )
setUp ( )
testBootSessionWithInvalidLegacyTokenCausesDelayAndFailure ( )
testChangingOwnPasswordDeletesAllHashesAndMakesPersistent ( )
testChangingOwnPasswordWithNoCookieDoesntMakePersistent ( )
testChangingSomeoneElsesPasswordDoesntMakePersistent ( )
testGetPersistedUser_invalidModernToken ( )
testGettingMissingUserFromKnownHashReturnsNull ( )
testGettingUserFromKnownHashReturnsUser ( )
testGettingUserFromMissingHashReturnsNull ( )
testGettingUserFromValidClientReturnsUser ( )
testLegacyCookiesAreReplacedInDbCookieAndSession ( )
testLoginSavesHashAndPutsTokenInCookieAndSession ( )
testModernTokenCookiesAreNotReplaced ( )
testRemoveDeletesHashAndDeletesTokenFromCookieAndSession ( )
testRemoveWithoutCookieCantDeleteHash ( )
testReplaceLegacyTokenWithNoCookieDoesNothing ( )

Protected Methods

Method Description
getSvcWithCookie ( string $cookie_token = '' ) : PersistentLoginService

Method Details

getMockElggUser() public method

mock \ElggUser which will return the GUID on ->guid reads
public getMockElggUser ( $guid )

getSvcWithCookie() protected method

protected getSvcWithCookie ( string $cookie_token = '' ) : PersistentLoginService
$cookie_token string
return PersistentLoginService

mock_deleteAll() public method

public mock_deleteAll ( $sql )

mock_deleteData() public method

public mock_deleteData ( $sql )

mock_getDataRow() public method

public mock_getDataRow ( $sql )

mock_get_user() public method

public mock_get_user ( $guid )

mock_insertData() public method

public mock_insertData ( $sql )

mock_sanitizeString() public method

public mock_sanitizeString ( $string )

mock_sleep() public method

public mock_sleep ( $seconds )

setUp() public method

public setUp ( )

testBootSessionWithInvalidLegacyTokenCausesDelayAndFailure() public method

testChangingOwnPasswordDeletesAllHashesAndMakesPersistent() public method

testChangingOwnPasswordWithNoCookieDoesntMakePersistent() public method

testChangingSomeoneElsesPasswordDoesntMakePersistent() public method

testGetPersistedUser_invalidModernToken() public method

testGettingMissingUserFromKnownHashReturnsNull() public method

testGettingUserFromKnownHashReturnsUser() public method

testGettingUserFromMissingHashReturnsNull() public method

testGettingUserFromValidClientReturnsUser() public method

testLegacyCookiesAreReplacedInDbCookieAndSession() public method

testLoginSavesHashAndPutsTokenInCookieAndSession() public method

testModernTokenCookiesAreNotReplaced() public method

testRemoveDeletesHashAndDeletesTokenFromCookieAndSession() public method

testRemoveWithoutCookieCantDeleteHash() public method

testReplaceLegacyTokenWithNoCookieDoesNothing() public method

Property Details

$cryptoMock protected property

protected PHPUnit_Framework_MockObject_MockObject $cryptoMock
return PHPUnit_Framework_MockObject_MockObject

$dbMock protected property

protected PHPUnit_Framework_MockObject_MockObject $dbMock
return PHPUnit_Framework_MockObject_MockObject

$lastCookieSet protected property

protected ElggCookie $lastCookieSet
return ElggCookie

$mockHash protected property

protected string $mockHash
return string

$mockToken protected property

protected string $mockToken
return string

$session protected property

protected ElggSession $session
return ElggSession

$svc protected property

protected PersistentLoginService,Elgg $svc
return PersistentLoginService

$thirtyDaysAgo protected property

protected int $thirtyDaysAgo
return integer

$timeSlept protected property

protected int $timeSlept
return integer

$user123 protected property

protected PHPUnit_Framework_MockObject_MockObject $user123
return PHPUnit_Framework_MockObject_MockObject