E2E_CivicrmAdminUi_ManageGroupsTest
extends MinkBase
in package
uses
Api4TestTrait
E2E Mink tests for Manage Groups screen.
Tags
Table of Contents
Properties
- $mink : Mink|null
- $screenshotsEnabled : bool
- $testRecords : array<string|int, mixed>
- Records created which will be deleted during tearDown
Methods
- createTestRecord() : array<string|int, mixed>|null
- Inserts a test record, supplying all required values if not provided.
- getTestRecord() : array<string|int, mixed>
- saveTestRecords() : Result
- Saves one or more test records, supplying default values.
- setUpBeforeClass() : void
- tearDown() : void
- testManageGroups() : mixed
- assertSession() : WebAssert
- createMink() : Mink
- createScreenshot() : void
- Creates a screenshot.
- deleteTestRecords() : void
- Delete records previously created by the `saveTestRecords` function.
- getRequiredValuesToCreate() : array<string|int, mixed>
- Get the required fields for the api entity + action.
- login() : void
- setUp() : void
- visit() : void
- createOptionValue() : mixed|null
- Creates a dummy option value when one is required but the option list is empty
- getFkID() : int
- Get an ID for the appropriate entity.
- getRandomValue() : int|null|string
- getRequiredValue() : mixed
- Attempt to get a value using field option, defaults, FKEntity, or a random value based on the data type.
- getUserId() : int
- randomLetters() : string
- Generate some random lowercase letters.
Properties
$mink
protected
Mink|null
$mink
= NULL
$screenshotsEnabled
protected
bool
$screenshotsEnabled
= FALSE
$testRecords
Records created which will be deleted during tearDown
protected
array<string|int, mixed>
$testRecords
= []
Methods
createTestRecord()
Inserts a test record, supplying all required values if not provided.
public
createTestRecord(string $entityName[, array<string|int, mixed> $values = [] ]) : array<string|int, mixed>|null
Test records will be automatically deleted if deleteTestRecords
is called.
This is a convenience helper for saveTestRecords
when working with a
single entity.
Parameters
- $entityName : string
- $values : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>|nullgetTestRecord()
public
getTestRecord(string $entityName, array<string|int, mixed>|string|int $idOrFilters) : array<string|int, mixed>
Parameters
- $entityName : string
- $idOrFilters : array<string|int, mixed>|string|int
-
Either the entity id or filters like ['name' => 'foo']
Tags
Return values
array<string|int, mixed>saveTestRecords()
Saves one or more test records, supplying default values.
public
saveTestRecords(string $entityName, array<string|int, mixed> $saveParams) : Result
Test records will be deleted when the deleteTestRecords
function is
called, usually in tearDown
.
If the transactional method is in use (and nothing is down to cause
the transaction to commit, such as creating custom fields) then the
deleteTestRecords
function does not need to be called.
Parameters
- $entityName : string
- $saveParams : array<string|int, mixed>
Tags
Return values
ResultsetUpBeforeClass()
public
static setUpBeforeClass() : void
tearDown()
public
tearDown() : void
testManageGroups()
public
testManageGroups() : mixed
assertSession()
protected
assertSession() : WebAssert
Return values
WebAssertcreateMink()
protected
createMink() : Mink
Return values
MinkcreateScreenshot()
Creates a screenshot.
protected
createScreenshot(string $filename[, bool $set_background_color = TRUE ][, bool $force = FALSE ]) : void
Parameters
- $filename : string
-
The file name of the resulting screenshot including a writable path. For example, /tmp/test_screenshot.jpg.
- $set_background_color : bool = TRUE
-
(optional) By default this method will set the background color to white. Set to FALSE to override this behavior.
- $force : bool = FALSE
-
(optional) By default this method will not take screenshots for performance reasons. Set to TRUE to take screenshots.
Tags
deleteTestRecords()
Delete records previously created by the `saveTestRecords` function.
protected
deleteTestRecords() : void
This should be called during the tearDown
function if the test
class does not use the transactional interface.
Tags
getRequiredValuesToCreate()
Get the required fields for the api entity + action.
protected
getRequiredValuesToCreate(string $entity[, array<string|int, mixed> $values = [] ]) : array<string|int, mixed>
Parameters
- $entity : string
- $values : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>login()
protected
login(string $user) : void
Parameters
- $user : string
setUp()
protected
setUp() : void
visit()
protected
visit(string $url) : void
Parameters
- $url : string
createOptionValue()
Creates a dummy option value when one is required but the option list is empty
private
createOptionValue(string $tableName, string $fieldName) : mixed|null
Parameters
- $tableName : string
- $fieldName : string
Return values
mixed|nullgetFkID()
Get an ID for the appropriate entity.
private
getFkID(string $fkEntity) : int
Parameters
- $fkEntity : string
Tags
Return values
intgetRandomValue()
private
getRandomValue(mixed $dataType) : int|null|string
Parameters
- $dataType : mixed
Tags
Return values
int|null|stringgetRequiredValue()
Attempt to get a value using field option, defaults, FKEntity, or a random value based on the data type.
private
getRequiredValue(array<string|int, mixed> $field) : mixed
Parameters
- $field : array<string|int, mixed>
Tags
getUserId()
private
getUserId(string $user) : int
Parameters
- $user : string
Return values
intrandomLetters()
Generate some random lowercase letters.
private
randomLetters([int $len = 10 ]) : string
Parameters
- $len : int = 10