Craft

Type
Class
Namespace
craft\test
Inherits
craft\test\Craft ยป Codeception\Module\Yii2
Since
3.2

Craft module for codeception

View source

Public Properties

PropertyDescription
currentTest\Codeception\TestInterface
testConfigarray

currentTest

Type
\Codeception\TestInterface

View source

testConfig

Type
array

View source

Protected Properties

addedConfig

Type
array

View source

requiredEvents

Type
array

View source

triggeredEvents

Type
array

View source

Public Methods

__construct()

Craft constructor. We need to merge the config settings here as this is the earliest point in the instance's existence. Doing it in _initialize() won't work as the config variables have already been added.

View source

Arguments

  • $moduleContainer (\Codeception\Lib\ModuleContainer)
  • $config (null)

_before()

View source

Arguments

  • $test (\Codeception\TestInterface)

Throws

_initialize()

View source

assertElementsExist()

View source

Arguments

  • $elementType (string)
  • $searchProperties (array)
  • $amount (integer)
  • $searchAll (boolean) โ€“ - Wether anyStatus() and trashed(null) should be applied

Returns

array

assertEqualDates()

View source

Arguments

  • $test (\Codeception\TestInterface)
  • $dateOne (string)
  • $dateTwo (string)
  • $secondsDelta (float)

Throws

assertPushedToQueue()

View source

Arguments

assertTestFails()

View source

Arguments

createDbConfig()

Creates a DB config according to the loaded .env variables.

View source

Returns

craft\config\DbConfig

createEventItems()

View source

Arguments

Returns

array

expectEvent()

Ensure that an event is triggered by the $callback() function.

View source

Arguments

getCodeceptionName()

View source

Returns

string

getFieldLayoutByFieldHandle()

View source

Arguments

Returns

craft\models\FieldLayout, null

installPlugin()

View source

Arguments

Throws

mockCraftMethods()

View source

Arguments

Throws

mockMethods()

View source

Arguments

Throws

normalizePathSeparators()

View source

Arguments

  • $path

Returns

string, boolean

runQueue()

An easy way of handling the testing of queue jobs.

View source

Arguments

Throws

saveElement()

View source

Arguments

Returns

boolean

Throws

setupDb()

View source

Throws

Protected Methods

addModule()

View source

Arguments

  • $test (\Codeception\PHPUnit\TestCase)
  • $moduleClass (string)

Throws

mockModulesAndPlugins()

View source

Arguments

  • $test (\Codeception\PHPUnit\TestCase)

Throws

recreateClient()

View source

validateEventValue()

View source

Arguments