◐ Shell
clean mode source ↗

Module - Codeception - Documentation

  • Uses Codeception\Util\Shared\Asserts

Basic class for Modules and Helpers. You must extend from it while implementing own helpers.

Public methods of this class start with _ prefix in order to ignore them in actor classes. Module contains HOOKS which allow to handle test execution routine.

$includeInheritedActions

public static $includeInheritedActions

By setting it to false module wan’t inherit methods of parent class.

$onlyActions

public static $onlyActions

Allows to explicitly set what methods have this class.

$excludeActions

public static $excludeActions

Allows to explicitly exclude actions from module.

$aliases

public static $aliases

Allows to rename actions

__construct()

public __construct($moduleContainer, array $config = null)

  • param \Codeception\Lib\ModuleContainer $moduleContainer
  • param ?array $config

Module constructor.

Requires module container (to provide access between modules of suite) and config.

See source

_after()

public _after($test)

  • param \Codeception\TestInterface $test

HOOK executed after test

See source

_afterStep()

public _afterStep($step)

  • param \Codeception\Step $step

HOOK executed after step

See source

_afterSuite()

public _afterSuite()

HOOK executed after suite

See source

_before()

public _before($test)

  • param \Codeception\TestInterface $test

HOOK executed before test

See source

_beforeStep()

public _beforeStep($step)

  • param \Codeception\Step $step

HOOK executed before step

See source

_beforeSuite()

public _beforeSuite(array $settings = array ( ))

  • param array $settings

HOOK executed before suite

See source

_failed()

public _failed($test, $fail)

  • param \Codeception\TestInterface $test
  • param \Exception $fail

HOOK executed when test fails but before _after

See source

_getConfig()

public _getConfig($key = null)

  • param string|null $key
  • return mixed the config item’s value or null if it doesn’t exist

Get config values or specific config item.

See source

_getName()

public _getName()

  • return string

Returns a module name for a Module, a class name for Helper

See source

_hasRequiredFields()

public _hasRequiredFields()

  • return bool

Checks if a module has required fields

See source

_initialize()

public _initialize()

HOOK triggered after module is created and configuration is loaded

See source

_reconfigure()

public _reconfigure(array $config)

  • param array $config
  • throws ModuleConfigException|ModuleException
  • return void

Allows to redefine config for a specific test.

Config is restored at the end of a test.

<?php
// cleanup DB only for specific group of tests
public function _before(Test $test) {
    if (in_array('cleanup', $test->getMetadata()->getGroups()) {
        $this->getModule('Db')->_reconfigure(['cleanup' => true]);
    }
}

See source

_resetConfig()

public _resetConfig()

  • return void

Reverts config changed by _reconfigure

See source

_setConfig()

public _setConfig(array $config)

  • param array $config
  • throws ModuleConfigException|ModuleException
  • return void

Allows to define initial module config.

Can be used in _beforeSuite hook of Helpers or Extensions

<?php
public function _beforeSuite($settings = []) {
    $this->getModule('otherModule')->_setConfig($this->myOtherConfig);
}

See source

assert()

protected assert(array $arguments, $not = false)

  • param array $arguments
  • param bool $not
  • return void

See source

assertArrayHasKey()

protected assertArrayHasKey($key, $array, $message = ‘’)

  • param string|int $key
  • param \ArrayAccess|array $array
  • param string $message
  • return void

Asserts that an array has a specified key.

See source

assertArrayNotHasKey()

protected assertArrayNotHasKey($key, $array, $message = ‘’)

  • param string|int $key
  • param \ArrayAccess|array $array
  • param string $message
  • return void

Asserts that an array does not have a specified key.

See source

assertClassHasAttribute()

protected assertClassHasAttribute($attributeName, $className, $message = ‘’)

  • param string $attributeName
  • param class-string $className
  • param string $message
  • return void

Asserts that a class has a specified attribute.

See source

assertClassHasStaticAttribute()

protected assertClassHasStaticAttribute($attributeName, $className, $message = ‘’)

  • param string $attributeName
  • param class-string $className
  • param string $message
  • return void

Asserts that a class has a specified static attribute.

See source

assertClassNotHasAttribute()

protected assertClassNotHasAttribute($attributeName, $className, $message = ‘’)

  • param string $attributeName
  • param class-string $className
  • param string $message
  • return void

Asserts that a class does not have a specified attribute.

See source

assertClassNotHasStaticAttribute()

protected assertClassNotHasStaticAttribute($attributeName, $className, $message = ‘’)

  • param string $attributeName
  • param class-string $className
  • param string $message
  • return void

Asserts that a class does not have a specified static attribute.

See source

assertContains()

protected assertContains($needle, $haystack, $message = ‘’)

  • param mixed $needle
  • param iterable<mixed> $haystack
  • param string $message
  • return void

Asserts that a haystack contains a needle.

See source

assertContainsEquals()

protected assertContainsEquals($needle, $haystack, $message = ‘’)

  • param mixed $needle
  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyArray()

protected assertContainsNotOnlyArray($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyBool()

protected assertContainsNotOnlyBool($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyCallable()

protected assertContainsNotOnlyCallable($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyClosedResource()

protected assertContainsNotOnlyClosedResource($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyFloat()

protected assertContainsNotOnlyFloat($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyInstancesOf()

protected assertContainsNotOnlyInstancesOf($className, $haystack, $message = ‘’)

  • param class-string $className
  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyInt()

protected assertContainsNotOnlyInt($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyIterable()

protected assertContainsNotOnlyIterable($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyNull()

protected assertContainsNotOnlyNull($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyNumeric()

protected assertContainsNotOnlyNumeric($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyObject()

protected assertContainsNotOnlyObject($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyResource()

protected assertContainsNotOnlyResource($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyScalar()

protected assertContainsNotOnlyScalar($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsNotOnlyString()

protected assertContainsNotOnlyString($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnly()

protected assertContainsOnly($type, $haystack, $isNativeType = null, $message = ‘’)

  • param string $type
  • param iterable<mixed> $haystack
  • param ?bool $isNativeType
  • param string $message
  • return void

Asserts that a haystack contains only values of a given type.

See source

assertContainsOnlyArray()

protected assertContainsOnlyArray($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyBool()

protected assertContainsOnlyBool($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyCallable()

protected assertContainsOnlyCallable($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyClosedResource()

protected assertContainsOnlyClosedResource($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyFloat()

protected assertContainsOnlyFloat($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyInstancesOf()

protected assertContainsOnlyInstancesOf($className, $haystack, $message = ‘’)

  • param class-string $className
  • param iterable<mixed> $haystack
  • param string $message
  • return void

Asserts that a haystack contains only instances of a given class name.

See source

assertContainsOnlyInt()

protected assertContainsOnlyInt($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyIterable()

protected assertContainsOnlyIterable($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyNull()

protected assertContainsOnlyNull($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyNumeric()

protected assertContainsOnlyNumeric($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyObject()

protected assertContainsOnlyObject($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyResource()

protected assertContainsOnlyResource($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyScalar()

protected assertContainsOnlyScalar($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertContainsOnlyString()

protected assertContainsOnlyString($haystack, $message = ‘’)

  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertCount()

protected assertCount($expectedCount, $haystack, $message = ‘’)

  • param int $expectedCount
  • param \Countable|iterable<mixed> $haystack
  • param string $message
  • return void

Asserts the number of elements of an array, Countable or Traversable.

See source

assertDirectoryDoesNotExist()

protected assertDirectoryDoesNotExist($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory does not exist.

See source

assertDirectoryExists()

protected assertDirectoryExists($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory exists.

See source

assertDirectoryIsNotReadable()

protected assertDirectoryIsNotReadable($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory exists and is not readable.

See source

assertDirectoryIsNotWritable()

protected assertDirectoryIsNotWritable($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory exists and is not writable.

See source

assertDirectoryIsReadable()

protected assertDirectoryIsReadable($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory exists and is readable.

See source

assertDirectoryIsWritable()

protected assertDirectoryIsWritable($directory, $message = ‘’)

  • param string $directory
  • param string $message
  • return void

Asserts that a directory exists and is writable.

See source

assertDoesNotMatchRegularExpression()

protected assertDoesNotMatchRegularExpression($pattern, $string, $message = ‘’)

  • param string $pattern
  • param string $string
  • param string $message
  • return void

Asserts that a string does not match a given regular expression.

See source

assertEmpty()

protected assertEmpty($actual, $message = ‘’)

  • phpstan-assert empty $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is empty.

See source

assertEquals()

protected assertEquals($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are equal.

See source

assertEqualsCanonicalizing()

protected assertEqualsCanonicalizing($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are equal (canonicalizing).

See source

assertEqualsIgnoringCase()

protected assertEqualsIgnoringCase($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are equal (ignoring case).

See source

assertEqualsWithDelta()

protected assertEqualsWithDelta($expected, $actual, $delta, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param float $delta
  • param string $message
  • return void

Asserts that two variables are equal (with delta).

See source

assertFalse()

protected assertFalse($condition, $message = ‘’)

  • phpstan-assert false $condition
  • param mixed $condition
  • param string $message
  • return void

Asserts that a condition is false.

See source

assertFileDoesNotExist()

protected assertFileDoesNotExist($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file does not exist.

See source

assertFileEquals()

protected assertFileEquals($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is equal to the contents of another file.

See source

assertFileEqualsCanonicalizing()

protected assertFileEqualsCanonicalizing($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is equal to the contents of another file (canonicalizing).

See source

assertFileEqualsIgnoringCase()

protected assertFileEqualsIgnoringCase($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is equal to the contents of another file (ignoring case).

See source

assertFileExists()

protected assertFileExists($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file exists.

See source

assertFileIsNotReadable()

protected assertFileIsNotReadable($file, $message = ‘’)

  • param string $file
  • param string $message
  • return void

Asserts that a file exists and is not readable.

See source

assertFileIsNotWritable()

protected assertFileIsNotWritable($file, $message = ‘’)

  • param string $file
  • param string $message
  • return void

Asserts that a file exists and is not writable.

See source

assertFileIsReadable()

protected assertFileIsReadable($file, $message = ‘’)

  • param string $file
  • param string $message
  • return void

Asserts that a file exists and is readable.

See source

assertFileIsWritable()

protected assertFileIsWritable($file, $message = ‘’)

  • param string $file
  • param string $message
  • return void

Asserts that a file exists and is writable.

See source

assertFileNotEquals()

protected assertFileNotEquals($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is not equal to the contents of another file.

See source

assertFileNotEqualsCanonicalizing()

protected assertFileNotEqualsCanonicalizing($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is not equal to the contents of another file (canonicalizing).

See source

assertFileNotEqualsIgnoringCase()

protected assertFileNotEqualsIgnoringCase($expected, $actual, $message = ‘’)

  • param string $expected
  • param string $actual
  • param string $message
  • return void

Asserts that the contents of one file is not equal to the contents of another file (ignoring case).

See source

assertFileNotExists()

protected assertFileNotExists($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file does not exist.

See source

assertFinite()

protected assertFinite($actual, $message = ‘’)

  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is finite.

See source

assertGreaterOrEquals()

protected assertGreaterOrEquals($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is greater than or equal to another value.

See source

assertGreaterThan()

protected assertGreaterThan($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is greater than another value.

See source

assertGreaterThanOrEqual()

protected assertGreaterThanOrEqual($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is greater than or equal to another value.

See source

assertInfinite()

protected assertInfinite($actual, $message = ‘’)

  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is infinite.

See source

assertInstanceOf()

protected assertInstanceOf($expected, $actual, $message = ‘’)

  • template ExpectedType of object
  • phpstan-assert =ExpectedType $actual
  • param class-string<ExpectedType> $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of a given type.

See source

assertIsArray()

protected assertIsArray($actual, $message = ‘’)

  • phpstan-assert array $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type array.

See source

assertIsBool()

protected assertIsBool($actual, $message = ‘’)

  • phpstan-assert bool $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type bool.

See source

assertIsCallable()

protected assertIsCallable($actual, $message = ‘’)

  • phpstan-assert callable $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type callable.

See source

assertIsClosedResource()

protected assertIsClosedResource($actual, $message = ‘’)

  • phpstan-assert resource $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type resource and is closed.

See source

assertIsEmpty()

protected assertIsEmpty($actual, $message = ‘’)

  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is empty.

See source

assertIsFloat()

protected assertIsFloat($actual, $message = ‘’)

  • phpstan-assert float $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type float.

See source

assertIsInt()

protected assertIsInt($actual, $message = ‘’)

  • phpstan-assert int $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type int.

See source

assertIsIterable()

protected assertIsIterable($actual, $message = ‘’)

  • phpstan-assert iterable $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type iterable.

See source

assertIsNotArray()

protected assertIsNotArray($actual, $message = ‘’)

  • phpstan-assert !array $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type array.

See source

assertIsNotBool()

protected assertIsNotBool($actual, $message = ‘’)

  • phpstan-assert !bool $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type bool.

See source

assertIsNotCallable()

protected assertIsNotCallable($actual, $message = ‘’)

  • phpstan-assert !callable $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type callable.

See source

assertIsNotClosedResource()

protected assertIsNotClosedResource($actual, $message = ‘’)

  • phpstan-assert !resource $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type resource.

See source

assertIsNotFloat()

protected assertIsNotFloat($actual, $message = ‘’)

  • phpstan-assert !float $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type float.

See source

assertIsNotInt()

protected assertIsNotInt($actual, $message = ‘’)

  • phpstan-assert !int $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type int.

See source

assertIsNotIterable()

protected assertIsNotIterable($actual, $message = ‘’)

  • phpstan-assert !iterable $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type iterable.

See source

assertIsNotNumeric()

protected assertIsNotNumeric($actual, $message = ‘’)

  • phpstan-assert !numeric $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type numeric.

See source

assertIsNotObject()

protected assertIsNotObject($actual, $message = ‘’)

  • phpstan-assert !object $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type object.

See source

assertIsNotReadable()

protected assertIsNotReadable($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file/dir exists and is not readable.

See source

assertIsNotResource()

protected assertIsNotResource($actual, $message = ‘’)

  • phpstan-assert !resource $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type resource.

See source

assertIsNotScalar()

protected assertIsNotScalar($actual, $message = ‘’)

  • psalm-assert !scalar $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type scalar.

See source

assertIsNotString()

protected assertIsNotString($actual, $message = ‘’)

  • phpstan-assert !string $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of type string.

See source

assertIsNotWritable()

protected assertIsNotWritable($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file/dir exists and is not writable.

See source

assertIsNumeric()

protected assertIsNumeric($actual, $message = ‘’)

  • phpstan-assert numeric $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type numeric.

See source

assertIsObject()

protected assertIsObject($actual, $message = ‘’)

  • phpstan-assert object $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type object.

See source

assertIsReadable()

protected assertIsReadable($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file/dir is readable.

See source

assertIsResource()

protected assertIsResource($actual, $message = ‘’)

  • phpstan-assert resource $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type resource.

See source

assertIsScalar()

protected assertIsScalar($actual, $message = ‘’)

  • phpstan-assert scalar $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type scalar.

See source

assertIsString()

protected assertIsString($actual, $message = ‘’)

  • phpstan-assert string $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is of type string.

See source

assertIsWritable()

protected assertIsWritable($filename, $message = ‘’)

  • param string $filename
  • param string $message
  • return void

Asserts that a file/dir exists and is writable.

See source

assertJson()

protected assertJson($actualJson, $message = ‘’)

  • param string $actualJson
  • param string $message
  • return void

Asserts that a string is a valid JSON string.

See source

assertJsonFileEqualsJsonFile()

protected assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = ‘’)

  • param string $expectedFile
  • param string $actualFile
  • param string $message
  • return void

Asserts that two JSON files are equal.

See source

assertJsonFileNotEqualsJsonFile()

protected assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = ‘’)

  • param string $expectedFile
  • param string $actualFile
  • param string $message
  • return void

Asserts that two JSON files are not equal.

See source

assertJsonStringEqualsJsonFile()

protected assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = ‘’)

  • param string $expectedFile
  • param string $actualJson
  • param string $message
  • return void

Asserts that the generated JSON encoded object and the content of the given file are equal.

See source

assertJsonStringEqualsJsonString()

protected assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = ‘’)

  • param string $expectedJson
  • param string $actualJson
  • param string $message
  • return void

Asserts that two given JSON encoded objects or arrays are equal.

See source

assertJsonStringNotEqualsJsonFile()

protected assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = ‘’)

  • param string $expectedFile
  • param string $actualJson
  • param string $message
  • return void

Asserts that the generated JSON encoded object and the content of the given file are not equal.

See source

assertJsonStringNotEqualsJsonString()

protected assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = ‘’)

  • param string $expectedJson
  • param string $actualJson
  • param string $message
  • return void

Asserts that two given JSON encoded objects or arrays are not equal.

See source

assertLessOrEquals()

protected assertLessOrEquals($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is smaller than or equal to another value.

See source

assertLessThan()

protected assertLessThan($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is smaller than another value.

See source

assertLessThanOrEqual()

protected assertLessThanOrEqual($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a value is smaller than or equal to another value.

See source

assertMatchesRegularExpression()

protected assertMatchesRegularExpression($pattern, $string, $message = ‘’)

  • param string $pattern
  • param string $string
  • param string $message
  • return void

Asserts that a string matches a given regular expression.

See source

assertNan()

protected assertNan($actual, $message = ‘’)

  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is nan.

See source

assertNot()

protected assertNot(array $arguments)

  • param array $arguments
  • return void

See source

assertNotContains()

protected assertNotContains($needle, $haystack, $message = ‘’)

  • param mixed $needle
  • param iterable<mixed> $haystack
  • param string $message
  • return void

Asserts that a haystack does not contain a needle.

See source

assertNotContainsEquals()

protected assertNotContainsEquals($needle, $haystack, $message = ‘’)

  • param mixed $needle
  • param iterable<mixed> $haystack
  • param string $message
  • return void

See source

assertNotContainsOnly()

protected assertNotContainsOnly($type, $haystack, $isNativeType = null, $message = ‘’)

  • param string $type
  • param iterable<mixed> $haystack
  • param ?bool $isNativeType
  • param string $message
  • return void

Asserts that a haystack does not contain only values of a given type.

See source

assertNotCount()

protected assertNotCount($expectedCount, $haystack, $message = ‘’)

  • param int $expectedCount
  • param \Countable|iterable<mixed> $haystack
  • param string $message
  • return void

Asserts the number of elements of an array, Countable or Traversable.

See source

assertNotEmpty()

protected assertNotEmpty($actual, $message = ‘’)

  • phpstan-assert !empty $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not empty.

See source

assertNotEquals()

protected assertNotEquals($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are not equal.

See source

assertNotEqualsCanonicalizing()

protected assertNotEqualsCanonicalizing($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are not equal (canonicalizing).

See source

assertNotEqualsIgnoringCase()

protected assertNotEqualsIgnoringCase($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables are not equal (ignoring case).

See source

assertNotEqualsWithDelta()

protected assertNotEqualsWithDelta($expected, $actual, $delta, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param float $delta
  • param string $message
  • return void

Asserts that two variables are not equal (with delta).

See source

assertNotFalse()

protected assertNotFalse($condition, $message = ‘’)

  • phpstan-assert !false $condition
  • param mixed $condition
  • param string $message
  • return void

Asserts that a condition is not false.

See source

assertNotInstanceOf()

protected assertNotInstanceOf($expected, $actual, $message = ‘’)

  • template ExpectedType of object
  • phpstan-assert !ExpectedType $actual
  • param class-string<ExpectedType> $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not of a given type.

See source

assertNotNull()

protected assertNotNull($actual, $message = ‘’)

  • phpstan-assert !null $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is not null.

See source

assertNotRegExp()

protected assertNotRegExp($pattern, $string, $message = ‘’)

  • param string $pattern
  • param string $string
  • param string $message
  • return void

Asserts that a string does not match a given regular expression.

See source

assertNotSame()

protected assertNotSame($expected, $actual, $message = ‘’)

  • param mixed $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables do not have the same type and value.

See source

assertNotSameSize()

protected assertNotSameSize($expected, $actual, $message = ‘’)

  • param \Countable|iterable<mixed> $expected
  • param \Countable|iterable<mixed> $actual
  • param string $message
  • return void

Assert that the size of two arrays (or Countable or Traversable objects) is not the same.

See source

assertNotTrue()

protected assertNotTrue($condition, $message = ‘’)

  • phpstan-assert !true $condition
  • param mixed $condition
  • param string $message
  • return void

Asserts that a condition is not true.

See source

assertNull()

protected assertNull($actual, $message = ‘’)

  • phpstan-assert null $actual
  • param mixed $actual
  • param string $message
  • return void

Asserts that a variable is null.

See source

assertObjectHasAttribute()

protected assertObjectHasAttribute($attributeName, $object, $message = ‘’)

  • param string $attributeName
  • param object $object
  • param string $message
  • return void

Asserts that an object has a specified attribute.

See source

assertObjectNotHasAttribute()

protected assertObjectNotHasAttribute($attributeName, $object, $message = ‘’)

  • param string $attributeName
  • param object $object
  • param string $message
  • return void

Asserts that an object does not have a specified attribute.

See source

assertRegExp()

protected assertRegExp($pattern, $string, $message = ‘’)

  • param string $pattern
  • param string $string
  • param string $message
  • return void

Asserts that a string matches a given regular expression.

See source

assertSame()

protected assertSame($expected, $actual, $message = ‘’)

  • template ExpectedType
  • phpstan-assert =ExpectedType $actual
  • param ExpectedType $expected
  • param mixed $actual
  • param string $message
  • return void

Asserts that two variables have the same type and value.

Used on objects, it asserts that two variables reference the same object.

See source

assertSameSize()

protected assertSameSize($expected, $actual, $message = ‘’)

  • param \Countable|iterable<mixed> $expected
  • param \Countable|iterable<mixed> $actual
  • param string $message
  • return void

Assert that the size of two arrays (or Countable or Traversable objects) is the same.

See source

assertStringContainsString()

protected assertStringContainsString($needle, $haystack, $message = ‘’)

  • param string $needle
  • param string $haystack
  • param string $message
  • return void

See source

assertStringContainsStringIgnoringCase()

protected assertStringContainsStringIgnoringCase($needle, $haystack, $message = ‘’)

  • param string $needle
  • param string $haystack
  • param string $message
  • return void

See source

assertStringEndsNotWith()

protected assertStringEndsNotWith($suffix, $string, $message = ‘’)

  • param non-empty-string $suffix
  • param string $string
  • param string $message
  • return void

Asserts that a string ends not with a given suffix.

See source

assertStringEndsWith()

protected assertStringEndsWith($suffix, $string, $message = ‘’)

  • param non-empty-string $suffix
  • param string $string
  • param string $message
  • return void

Asserts that a string ends with a given suffix.

See source

assertStringEqualsFile()

protected assertStringEqualsFile($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is equal to the contents of a file.

See source

assertStringEqualsFileCanonicalizing()

protected assertStringEqualsFileCanonicalizing($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is equal to the contents of a file (canonicalizing).

See source

assertStringEqualsFileIgnoringCase()

protected assertStringEqualsFileIgnoringCase($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is equal to the contents of a file (ignoring case).

See source

assertStringMatchesFormat()

protected assertStringMatchesFormat($format, $string, $message = ‘’)

  • param string $format
  • param string $string
  • param string $message
  • return void

Asserts that a string matches a given format string.

See source

assertStringMatchesFormatFile()

protected assertStringMatchesFormatFile($formatFile, $string, $message = ‘’)

  • param string $formatFile
  • param string $string
  • param string $message
  • return void

Asserts that a string matches a given format file.

See source

assertStringNotContainsString()

protected assertStringNotContainsString($needle, $haystack, $message = ‘’)

  • param string $needle
  • param string $haystack
  • param string $message
  • return void

See source

assertStringNotContainsStringIgnoringCase()

protected assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = ‘’)

  • param string $needle
  • param string $haystack
  • param string $message
  • return void

See source

assertStringNotEqualsFile()

protected assertStringNotEqualsFile($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is not equal to the contents of a file.

See source

assertStringNotEqualsFileCanonicalizing()

protected assertStringNotEqualsFileCanonicalizing($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is not equal to the contents of a file (canonicalizing).

See source

assertStringNotEqualsFileIgnoringCase()

protected assertStringNotEqualsFileIgnoringCase($expectedFile, $actualString, $message = ‘’)

  • param string $expectedFile
  • param string $actualString
  • param string $message
  • return void

Asserts that the contents of a string is not equal to the contents of a file (ignoring case).

See source

assertStringNotMatchesFormat()

protected assertStringNotMatchesFormat($format, $string, $message = ‘’)

  • param string $format
  • param string $string
  • param string $message
  • return void

Asserts that a string does not match a given format string.

See source

assertStringNotMatchesFormatFile()

protected assertStringNotMatchesFormatFile($formatFile, $string, $message = ‘’)

  • param string $formatFile
  • param string $string
  • param string $message
  • return void

Asserts that a string does not match a given format string.

See source

assertStringStartsNotWith()

protected assertStringStartsNotWith($prefix, $string, $message = ‘’)

  • param non-empty-string $prefix
  • param string $string
  • param string $message
  • return void

Asserts that a string starts not with a given prefix.

See source

assertStringStartsWith()

protected assertStringStartsWith($prefix, $string, $message = ‘’)

  • param non-empty-string $prefix
  • param string $string
  • param string $message
  • return void

Asserts that a string starts with a given prefix.

See source

assertThat()

protected assertThat($value, $constraint, $message = ‘’)

  • param mixed $value
  • param \PHPUnit\Framework\Constraint\Constraint $constraint
  • param string $message
  • return void

Evaluates a PHPUnit\Framework\Constraint matcher object.

See source

assertThatItsNot()

protected assertThatItsNot($value, $constraint, $message = ‘’)

  • param mixed $value
  • param \PHPUnit\Framework\Constraint\Constraint $constraint
  • param string $message
  • return void

Evaluates a PHPUnit\Framework\Constraint matcher object.

See source

assertTrue()

protected assertTrue($condition, $message = ‘’)

  • phpstan-assert true $condition
  • param mixed $condition
  • param string $message
  • return void

Asserts that a condition is true.

See source

assertXmlFileEqualsXmlFile()

protected assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = ‘’)

  • param string $expectedFile
  • param string $actualFile
  • param string $message
  • return void

Asserts that two XML files are equal.

See source

assertXmlFileNotEqualsXmlFile()

protected assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = ‘’)

  • param string $expectedFile
  • param string $actualFile
  • param string $message
  • return void

Asserts that two XML files are not equal.

See source

assertXmlStringEqualsXmlFile()

protected assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = ‘’)

  • param string $expectedFile
  • param \DOMDocument|string $actualXml
  • param string $message
  • return void

Asserts that two XML documents are equal.

See source

assertXmlStringEqualsXmlString()

protected assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = ‘’)

  • param \DOMDocument|string $expectedXml
  • param \DOMDocument|string $actualXml
  • param string $message
  • return void

Asserts that two XML documents are equal.

See source

assertXmlStringNotEqualsXmlFile()

protected assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = ‘’)

  • param string $expectedFile
  • param \DOMDocument|string $actualXml
  • param string $message
  • return void

Asserts that two XML documents are not equal.

See source

assertXmlStringNotEqualsXmlString()

protected assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = ‘’)

  • param \DOMDocument|string $expectedXml
  • param \DOMDocument|string $actualXml
  • param string $message
  • return void

Asserts that two XML documents are not equal.

See source

debug()

protected debug($message)

  • param mixed $message
  • return void

Print debug message to the screen.

See source

debugSection()

protected debugSection($title, $msg)

  • param string $title
  • param mixed $msg
  • return void

Print debug message with a title

See source

fail()

protected fail($message = ‘’)

  • param string $message
  • return never

Fails a test with the given message.

See source

getModule()

protected getModule($name)

  • param string $name
  • throws ModuleException
  • return \Codeception\Module

Get another module by its name:

<?php
$this->getModule('WebDriver')->_findElements('.items');

See source

getModules()

protected getModules()

  • return array

Get all enabled modules

See source

hasModule()

protected hasModule($name)

  • param string $name
  • return bool

Checks that module is enabled.

See source

hasStaticAttribute()

private static hasStaticAttribute($attributeName, $className)

  • see https://github.com/sebastianbergmann/phpunit/blob/9.6/src/Framework/Constraint/Object/ClassHasStaticAttribute.php
  • param string $attributeName
  • param class-string $className
  • return bool

See source

markTestIncomplete()

protected markTestIncomplete($message = ‘’)

  • param string $message
  • return never

Mark the test as incomplete.

See source

markTestSkipped()

protected markTestSkipped($message = ‘’)

  • param string $message
  • return never

Mark the test as skipped.

See source

onReconfigure()

protected onReconfigure()

HOOK to be executed when config changes with _reconfigure.

See source

scalarizeArray()

protected scalarizeArray(array $array)

  • param array $array
  • return array

See source

shortenMessage()

protected shortenMessage($message, $chars = 150)

  • param string $message
  • param int $chars
  • return string

Short text message to an amount of chars

See source

validateConfig()

protected validateConfig()

  • throws ModuleConfigException|ModuleException
  • return void

Validates current config for required fields and required packages.

See source