class LoginContext implements Context (View source)

LoginContext

Context used to define steps related to login and logout functionality

Traits

Represents a behat context which is aware of a main {SilverStripeContext} context.

Properties

protected SilverStripeContext $mainContext from  MainContextAwareTrait

Methods

public
getMainContext()

Get the main context

public
$this
setMainContext(SilverStripeContext $mainContext)

No description

public
detectMainContext(BeforeScenarioScope $scope)

Helper method to detect the main context

public
stepIAmLoggedIn()

No description

public
iAmLoggedInWithPermissions(string $permCode)

Creates a member in a group with the correct permissions.

public
iAmLoggedInAsMemberOfGroup(string $groupName)

Creates and login as a member of a group with the correct permissions.

public
stepIAmNotLoggedIn()

No description

public
stepILogInWith(string $email, string $password)

No description

public
stepILogInWithWithoutSkippingMfa(string $email, string $password)

No description

public
stepIShouldSeeALogInForm()

No description

public
stepIShouldSeeALogOutForm()

No description

public
stepIWillSeeALogInMessage(string $type)

No description

public
stepPasswordForEmailShouldBe(string $id, string $password)

No description

protected
generateMemberWithPermission(string $email, string $password, string $permCode)

Get or generate a member with the given permission code

protected
generateGroupWithPermission(string $permCode)

Get or generate a group with the given permission code

protected
generateMember(string $email, string $password, object $group, string $identifier)

Get or generate a member with the given permission code and permission group

Details

SilverStripeContext getMainContext()

Get the main context

Return Value

SilverStripeContext

$this setMainContext(SilverStripeContext $mainContext)

No description

Parameters

SilverStripeContext $mainContext

Return Value

$this

detectMainContext(BeforeScenarioScope $scope)

Helper method to detect the main context

Parameters

BeforeScenarioScope $scope

stepIAmLoggedIn()

No description

iAmLoggedInWithPermissions(string $permCode)

Creates a member in a group with the correct permissions.

Example: Given I am logged in with "ADMIN" permissions

Parameters

string $permCode

iAmLoggedInAsMemberOfGroup(string $groupName)

Creates and login as a member of a group with the correct permissions.

Example: Given I am logged in as a member of "ADMIN" group

Parameters

string $groupName

stepIAmNotLoggedIn()

No description

stepILogInWith(string $email, string $password)

No description

Parameters

string $email
string $password

stepILogInWithWithoutSkippingMfa(string $email, string $password)

No description

Parameters

string $email
string $password

stepIShouldSeeALogInForm()

No description

stepIShouldSeeALogOutForm()

No description

stepIWillSeeALogInMessage(string $type)

No description

Parameters

string $type

stepPasswordForEmailShouldBe(string $id, string $password)

No description

Parameters

string $id
string $password

protected Member generateMemberWithPermission(string $email, string $password, string $permCode)

Get or generate a member with the given permission code

Parameters

string $email
string $password
string $permCode

Return Value

Member

protected Member generateGroupWithPermission(string $permCode)

Get or generate a group with the given permission code

Parameters

string $permCode

Return Value

Member

protected Member generateMember(string $email, string $password, object $group, string $identifier)

Get or generate a member with the given permission code and permission group

Parameters

string $email
string $password
object $group
string $identifier

Return Value

Member