Search

Codeception\Module

  • 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.

type bool

$onlyActions

public static $onlyActions

Allows to explicitly set what methods have this class.

type array

$excludeActions

public static $excludeActions

Allows to explicitly exclude actions from module.

type array

$aliases

public static $aliases

Allows to rename actions

type array

__construct()

public __construct($moduleContainer, $config = null)

Module constructor.

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

  • param ModuleContainer $moduleContainer
  • param array|null $config

See source

_after()

public _after($test)

HOOK executed after test

  • param TestInterface $test

See source

_afterStep()

public _afterStep($step)

HOOK executed after step

  • param Step $step

See source

_afterSuite()

public _afterSuite()

HOOK executed after suite

See source

_before()

public _before($test)

HOOK executed before test

  • param TestInterface $test

See source

_beforeStep()

public _beforeStep($step)

HOOK executed before step

  • param Step $step

See source

_beforeSuite()

public _beforeSuite($settings = null)

HOOK executed before suite

  • param array $settings

See source

_failed()

public _failed($test, $fail)

HOOK executed when test fails but before _after

  • param TestInterface $test
  • param \Exception $fail

See source

_getConfig()

public _getConfig($key = null)

Get config values or specific config item.

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

See source

_getName()

public _getName()

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

  • return string

See source

_hasRequiredFields()

public _hasRequiredFields()

Checks if a module has required fields

  • return bool

See source

_initialize()

public _initialize()

HOOK triggered after module is created and configuration is loaded

See source

_reconfigure()

public _reconfigure($config)

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]);
    }
}
  • param $config
  • throws Exception\ModuleConfigException
  • throws ModuleException

See source

_resetConfig()

public _resetConfig()

Reverts config changed by _reconfigure

See source

_setConfig()

public _setConfig($config)

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);
}
  • param $config
  • throws Exception\ModuleConfigException
  • throws ModuleException

See source

assert()

protected assert($arguments, $not = null)

  • param $arguments
  • param bool $not

See source

assertArrayHasKey()

protected assertArrayHasKey($key, $array, $message = null)

Asserts that an array has a specified key.

  • param int|string $key
  • param array|ArrayAccess $array
  • param string $message

See source

assertArrayNotHasKey()

protected assertArrayNotHasKey($key, $array, $message = null)

Asserts that an array does not have a specified key.

  • param int|string $key
  • param array|ArrayAccess $array
  • param string $message

See source

assertClassHasAttribute()

protected assertClassHasAttribute($attributeName, $className, $message = null)

Asserts that a class has a specified attribute.

  • param string $attributeName
  • param string $className
  • param string $message

See source

assertClassHasStaticAttribute()

protected assertClassHasStaticAttribute($attributeName, $className, $message = null)

Asserts that a class has a specified static attribute.

  • param string $attributeName
  • param string $className
  • param string $message

See source

assertClassNotHasAttribute()

protected assertClassNotHasAttribute($attributeName, $className, $message = null)

Asserts that a class does not have a specified attribute.

  • param string $attributeName
  • param string $className
  • param string $message

See source

assertClassNotHasStaticAttribute()

protected assertClassNotHasStaticAttribute($attributeName, $className, $message = null)

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

  • param string $attributeName
  • param string $className
  • param string $message

See source

assertContains()

protected assertContains($needle, $haystack, $message = null)

Asserts that a haystack contains a needle.

  • param $needle
  • param $haystack
  • param string $message

See source

assertContainsEquals()

protected assertContainsEquals($needle, $haystack, $message = null)

  • param $needle
  • param $haystack
  • param string $message

See source

assertContainsOnly()

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

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

  • param string $type
  • param $haystack
  • param bool|null $isNativeType
  • param string $message

See source

assertContainsOnlyInstancesOf()

protected assertContainsOnlyInstancesOf($className, $haystack, $message = null)

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

  • param string $className
  • param $haystack
  • param string $message

See source

assertCount()

protected assertCount($expectedCount, $haystack, $message = null)

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

  • param int $expectedCount
  • param Countable|iterable $haystack
  • param string $message

See source

assertDirectoryDoesNotExist()

protected assertDirectoryDoesNotExist($directory, $message = null)

Asserts that a directory does not exist.

  • param string $directory
  • param string $message

See source

assertDirectoryExists()

protected assertDirectoryExists($directory, $message = null)

Asserts that a directory exists.

  • param string $directory
  • param string $message

See source

assertDirectoryIsNotReadable()

protected assertDirectoryIsNotReadable($directory, $message = null)

Asserts that a directory exists and is not readable.

  • param string $directory
  • param string $message

See source

assertDirectoryIsNotWritable()

protected assertDirectoryIsNotWritable($directory, $message = null)

Asserts that a directory exists and is not writable.

  • param string $directory
  • param string $message

See source

assertDirectoryIsReadable()

protected assertDirectoryIsReadable($directory, $message = null)

Asserts that a directory exists and is readable.

  • param string $directory
  • param string $message

See source

assertDirectoryIsWritable()

protected assertDirectoryIsWritable($directory, $message = null)

Asserts that a directory exists and is writable.

  • param string $directory
  • param string $message

See source

assertDoesNotMatchRegularExpression()

protected assertDoesNotMatchRegularExpression($pattern, $string, $message = null)

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

  • param string $pattern
  • param string $string
  • param string $message

See source

assertEmpty()

protected assertEmpty($actual, $message = null)

Asserts that a variable is empty.

  • param $actual
  • param string $message

See source

assertEquals()

protected assertEquals($expected, $actual, $message = null)

Asserts that two variables are equal.

  • param $expected
  • param $actual
  • param string $message

See source

assertEqualsCanonicalizing()

protected assertEqualsCanonicalizing($expected, $actual, $message = null)

Asserts that two variables are equal (canonicalizing).

  • param $expected
  • param $actual
  • param string $message

See source

assertEqualsIgnoringCase()

protected assertEqualsIgnoringCase($expected, $actual, $message = null)

Asserts that two variables are equal (ignoring case).

  • param $expected
  • param $actual
  • param string $message

See source

assertEqualsWithDelta()

protected assertEqualsWithDelta($expected, $actual, $delta, $message = null)

Asserts that two variables are equal (with delta).

  • param $expected
  • param $actual
  • param float $delta
  • param string $message

See source

assertFalse()

protected assertFalse($condition, $message = null)

Asserts that a condition is false.

  • param $condition
  • param string $message

See source

assertFileDoesNotExist()

protected assertFileDoesNotExist($filename, $message = null)

Asserts that a file does not exist.

  • param string $filename
  • param string $message

See source

assertFileEquals()

protected assertFileEquals($expected, $actual, $message = null)

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

  • param string $expected
  • param string $actual
  • param string $message

See source

assertFileEqualsCanonicalizing()

protected assertFileEqualsCanonicalizing($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertFileEqualsIgnoringCase()

protected assertFileEqualsIgnoringCase($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertFileExists()

protected assertFileExists($filename, $message = null)

Asserts that a file exists.

  • param string $filename
  • param string $message

See source

assertFileIsNotReadable()

protected assertFileIsNotReadable($file, $message = null)

Asserts that a file exists and is not readable.

  • param string $file
  • param string $message

See source

assertFileIsNotWritable()

protected assertFileIsNotWritable($file, $message = null)

Asserts that a file exists and is not writable.

  • param string $file
  • param string $message

See source

assertFileIsReadable()

protected assertFileIsReadable($file, $message = null)

Asserts that a file exists and is readable.

  • param string $file
  • param string $message

See source

assertFileIsWritable()

protected assertFileIsWritable($file, $message = null)

Asserts that a file exists and is writable.

  • param string $file
  • param string $message

See source

assertFileNotEquals()

protected assertFileNotEquals($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertFileNotEqualsCanonicalizing()

protected assertFileNotEqualsCanonicalizing($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertFileNotEqualsIgnoringCase()

protected assertFileNotEqualsIgnoringCase($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertFileNotExists()

protected assertFileNotExists($filename, $message = null)

Asserts that a file does not exist.

  • param string $filename
  • param string $message

See source

assertFinite()

protected assertFinite($actual, $message = null)

Asserts that a variable is finite.

  • param $actual
  • param string $message

See source

assertGreaterOrEquals()

protected assertGreaterOrEquals($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertGreaterThan()

protected assertGreaterThan($expected, $actual, $message = null)

Asserts that a value is greater than another value.

  • param $expected
  • param $actual
  • param string $message

See source

assertGreaterThanOrEqual()

protected assertGreaterThanOrEqual($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertInfinite()

protected assertInfinite($actual, $message = null)

Asserts that a variable is infinite.

  • param $actual
  • param string $message

See source

assertInstanceOf()

protected assertInstanceOf($expected, $actual, $message = null)

Asserts that a variable is of a given type.

  • param $expected
  • param $actual
  • param string $message

See source

assertIsArray()

protected assertIsArray($actual, $message = null)

Asserts that a variable is of type array.

  • param $actual
  • param string $message

See source

assertIsBool()

protected assertIsBool($actual, $message = null)

Asserts that a variable is of type bool.

  • param $actual
  • param string $message

See source

assertIsCallable()

protected assertIsCallable($actual, $message = null)

Asserts that a variable is of type callable.

  • param $actual
  • param string $message

See source

assertIsClosedResource()

protected assertIsClosedResource($actual, $message = null)

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

  • param $actual
  • param string $message

See source

assertIsEmpty()

protected assertIsEmpty($actual, $message = null)

Asserts that a variable is empty.

  • param $actual
  • param string $message

See source

assertIsFloat()

protected assertIsFloat($actual, $message = null)

Asserts that a variable is of type float.

  • param $actual
  • param string $message

See source

assertIsInt()

protected assertIsInt($actual, $message = null)

Asserts that a variable is of type int.

  • param $actual
  • param string $message

See source

assertIsIterable()

protected assertIsIterable($actual, $message = null)

Asserts that a variable is of type iterable.

  • param $actual
  • param string $message

See source

assertIsNotArray()

protected assertIsNotArray($actual, $message = null)

Asserts that a variable is not of type array.

  • param $actual
  • param string $message

See source

assertIsNotBool()

protected assertIsNotBool($actual, $message = null)

Asserts that a variable is not of type bool.

  • param $actual
  • param string $message

See source

assertIsNotCallable()

protected assertIsNotCallable($actual, $message = null)

Asserts that a variable is not of type callable.

  • param $actual
  • param string $message

See source

assertIsNotClosedResource()

protected assertIsNotClosedResource($actual, $message = null)

Asserts that a variable is not of type resource.

  • param $actual
  • param string $message

See source

assertIsNotFloat()

protected assertIsNotFloat($actual, $message = null)

Asserts that a variable is not of type float.

  • param $actual
  • param string $message

See source

assertIsNotInt()

protected assertIsNotInt($actual, $message = null)

Asserts that a variable is not of type int.

  • param $actual
  • param string $message

See source

assertIsNotIterable()

protected assertIsNotIterable($actual, $message = null)

Asserts that a variable is not of type iterable.

  • param $actual
  • param string $message

See source

assertIsNotNumeric()

protected assertIsNotNumeric($actual, $message = null)

Asserts that a variable is not of type numeric.

  • param $actual
  • param string $message

See source

assertIsNotObject()

protected assertIsNotObject($actual, $message = null)

Asserts that a variable is not of type object.

  • param $actual
  • param string $message

See source

assertIsNotReadable()

protected assertIsNotReadable($filename, $message = null)

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

  • param string $filename
  • param string $message

See source

assertIsNotResource()

protected assertIsNotResource($actual, $message = null)

Asserts that a variable is not of type resource.

  • param $actual
  • param string $message

See source

assertIsNotScalar()

protected assertIsNotScalar($actual, $message = null)

Asserts that a variable is not of type scalar.

  • param $actual
  • param string $message

See source

assertIsNotString()

protected assertIsNotString($actual, $message = null)

Asserts that a variable is not of type string.

  • param $actual
  • param string $message

See source

assertIsNotWritable()

protected assertIsNotWritable($filename, $message = null)

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

  • param $filename
  • param string $message

See source

assertIsNumeric()

protected assertIsNumeric($actual, $message = null)

Asserts that a variable is of type numeric.

  • param $actual
  • param string $message

See source

assertIsObject()

protected assertIsObject($actual, $message = null)

Asserts that a variable is of type object.

  • param $actual
  • param string $message

See source

assertIsReadable()

protected assertIsReadable($filename, $message = null)

Asserts that a file/dir is readable.

  • param $filename
  • param string $message

See source

assertIsResource()

protected assertIsResource($actual, $message = null)

Asserts that a variable is of type resource.

  • param $actual
  • param string $message

See source

assertIsScalar()

protected assertIsScalar($actual, $message = null)

Asserts that a variable is of type scalar.

  • param $actual
  • param string $message

See source

assertIsString()

protected assertIsString($actual, $message = null)

Asserts that a variable is of type string.

  • param $actual
  • param string $message

See source

assertIsWritable()

protected assertIsWritable($filename, $message = null)

Asserts that a file/dir exists and is writable.

  • param $filename
  • param string $message

See source

assertJson()

protected assertJson($actualJson, $message = null)

Asserts that a string is a valid JSON string.

  • param string $actualJson
  • param string $message

See source

assertJsonFileEqualsJsonFile()

protected assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = null)

Asserts that two JSON files are equal.

  • param string $expectedFile
  • param string $actualFile
  • param string $message

See source

assertJsonFileNotEqualsJsonFile()

protected assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = null)

Asserts that two JSON files are not equal.

  • param string $expectedFile
  • param string $actualFile
  • param string $message

See source

assertJsonStringEqualsJsonFile()

protected assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = null)

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

  • param string $expectedFile
  • param string $actualJson
  • param string $message

See source

assertJsonStringEqualsJsonString()

protected assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = null)

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

  • param string $expectedJson
  • param string $actualJson
  • param string $message

See source

assertJsonStringNotEqualsJsonFile()

protected assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = null)

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

  • param string $expectedFile
  • param string $actualJson
  • param string $message

See source

assertJsonStringNotEqualsJsonString()

protected assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = null)

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

  • param string $expectedJson
  • param string $actualJson
  • param string $message

See source

assertLessOrEquals()

protected assertLessOrEquals($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertLessThan()

protected assertLessThan($expected, $actual, $message = null)

Asserts that a value is smaller than another value.

  • param $expected
  • param $actual
  • param string $message

See source

assertLessThanOrEqual()

protected assertLessThanOrEqual($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertMatchesRegularExpression()

protected assertMatchesRegularExpression($pattern, $string, $message = null)

Asserts that a string matches a given regular expression.

  • param string $pattern
  • param string $string
  • param string $message

See source

assertNan()

protected assertNan($actual, $message = null)

Asserts that a variable is nan.

  • param $actual
  • param string $message

See source

assertNot()

protected assertNot($arguments)

See source

assertNotContains()

protected assertNotContains($needle, $haystack, $message = null)

Asserts that a haystack does not contain a needle.

  • param $needle
  • param $haystack
  • param string $message

See source

assertNotContainsEquals()

protected assertNotContainsEquals($needle, $haystack, $message = null)

See source

assertNotContainsOnly()

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

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

  • param string $type
  • param $haystack
  • param bool|null $isNativeType
  • param string $message

See source

assertNotCount()

protected assertNotCount($expectedCount, $haystack, $message = null)

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

  • param int $expectedCount
  • param Countable|iterable $haystack
  • param string $message

See source

assertNotEmpty()

protected assertNotEmpty($actual, $message = null)

Asserts that a variable is not empty.

  • param $actual
  • param string $message

See source

assertNotEquals()

protected assertNotEquals($expected, $actual, $message = null)

Asserts that two variables are not equal.

  • param $expected
  • param $actual
  • param string $message

See source

assertNotEqualsCanonicalizing()

protected assertNotEqualsCanonicalizing($expected, $actual, $message = null)

Asserts that two variables are not equal (canonicalizing).

  • param $expected
  • param $actual
  • param string $message

See source

assertNotEqualsIgnoringCase()

protected assertNotEqualsIgnoringCase($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertNotEqualsWithDelta()

protected assertNotEqualsWithDelta($expected, $actual, $delta, $message = null)

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

  • param $expected
  • param $actual
  • param float $delta
  • param string $message

See source

assertNotFalse()

protected assertNotFalse($condition, $message = null)

Asserts that a condition is not false.

  • param $condition
  • param string $message

See source

assertNotInstanceOf()

protected assertNotInstanceOf($expected, $actual, $message = null)

Asserts that a variable is not of a given type.

  • param $expected
  • param $actual
  • param string $message

See source

assertNotNull()

protected assertNotNull($actual, $message = null)

Asserts that a variable is not null.

  • param $actual
  • param string $message

See source

assertNotRegExp()

protected assertNotRegExp($pattern, $string, $message = null)

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

  • param string $pattern
  • param string $string
  • param string $message

See source

assertNotSame()

protected assertNotSame($expected, $actual, $message = null)

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

  • param $expected
  • param $actual
  • param string $message

See source

assertNotSameSize()

protected assertNotSameSize($expected, $actual, $message = null)

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

  • param Countable|iterable $expected
  • param Countable|iterable $actual
  • param string $message

See source

assertNotTrue()

protected assertNotTrue($condition, $message = null)

Asserts that a condition is not true.

  • param $condition
  • param string $message

See source

assertNull()

protected assertNull($actual, $message = null)

Asserts that a variable is null.

  • param $actual
  • param string $message

See source

assertObjectHasAttribute()

protected assertObjectHasAttribute($attributeName, $object, $message = null)

Asserts that an object has a specified attribute.

  • param string $attributeName
  • param object $object
  • param string $message

See source

assertObjectNotHasAttribute()

protected assertObjectNotHasAttribute($attributeName, $object, $message = null)

Asserts that an object does not have a specified attribute.

  • param string $attributeName
  • param object $object
  • param string $message

See source

assertRegExp()

protected assertRegExp($pattern, $string, $message = null)

Asserts that a string matches a given regular expression.

  • param string $pattern
  • param string $string
  • param string $message

See source

assertSame()

protected assertSame($expected, $actual, $message = null)

Asserts that two variables have the same type and value.

  • param $expected
  • param $actual
  • param string $message

See source

assertSameSize()

protected assertSameSize($expected, $actual, $message = null)

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

  • param Countable|iterable $expected
  • param Countable|iterable $actual
  • param string $message

See source

assertStringContainsString()

protected assertStringContainsString($needle, $haystack, $message = null)

  • param string $needle
  • param string $haystack
  • param string $message

See source

assertStringContainsStringIgnoringCase()

protected assertStringContainsStringIgnoringCase($needle, $haystack, $message = null)

See source

assertStringEndsNotWith()

protected assertStringEndsNotWith($suffix, $string, $message = null)

Asserts that a string ends not with a given suffix.

  • param string $suffix
  • param string $string
  • param string $message

See source

assertStringEndsWith()

protected assertStringEndsWith($suffix, $string, $message = null)

Asserts that a string ends with a given suffix.

  • param string $suffix
  • param string $string
  • param string $message

See source

assertStringEqualsFile()

protected assertStringEqualsFile($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringEqualsFileCanonicalizing()

protected assertStringEqualsFileCanonicalizing($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringEqualsFileIgnoringCase()

protected assertStringEqualsFileIgnoringCase($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringMatchesFormat()

protected assertStringMatchesFormat($format, $string, $message = null)

Asserts that a string matches a given format string.

  • param string $format
  • param string $string
  • param string $message

See source

assertStringMatchesFormatFile()

protected assertStringMatchesFormatFile($formatFile, $string, $message = null)

Asserts that a string matches a given format file.

  • param string $formatFile
  • param string $string
  • param string $message

See source

assertStringNotContainsString()

protected assertStringNotContainsString($needle, $haystack, $message = null)

  • param string $needle
  • param string $haystack
  • param string $message

See source

assertStringNotContainsStringIgnoringCase()

protected assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = null)

  • param string $needle
  • param string $haystack
  • param string $message

See source

assertStringNotEqualsFile()

protected assertStringNotEqualsFile($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringNotEqualsFileCanonicalizing()

protected assertStringNotEqualsFileCanonicalizing($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringNotEqualsFileIgnoringCase()

protected assertStringNotEqualsFileIgnoringCase($expectedFile, $actualString, $message = null)

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

  • param string $expectedFile
  • param string $actualString
  • param string $message

See source

assertStringNotMatchesFormat()

protected assertStringNotMatchesFormat($format, $string, $message = null)

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

  • param string $format
  • param string $string
  • param string $message

See source

assertStringNotMatchesFormatFile()

protected assertStringNotMatchesFormatFile($formatFile, $string, $message = null)

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

  • param string $formatFile
  • param string $string
  • param string $message

See source

assertStringStartsNotWith()

protected assertStringStartsNotWith($prefix, $string, $message = null)

Asserts that a string starts not with a given prefix.

  • param string $prefix
  • param string $string
  • param string $message

See source

assertStringStartsWith()

protected assertStringStartsWith($prefix, $string, $message = null)

Asserts that a string starts with a given prefix.

  • param string $prefix
  • param string $string
  • param string $message

See source

assertThat()

protected assertThat($value, $constraint, $message = null)

Evaluates a PHPUnit\Framework\Constraint matcher object.

  • param $value
  • param Constraint $constraint
  • param string $message

See source

assertThatItsNot()

protected assertThatItsNot($value, $constraint, $message = null)

Evaluates a PHPUnit\Framework\Constraint matcher object.

  • param $value
  • param Constraint $constraint
  • param string $message

See source

assertTrue()

protected assertTrue($condition, $message = null)

Asserts that a condition is true.

  • param $condition
  • param string $message

See source

assertXmlFileEqualsXmlFile()

protected assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = null)

Asserts that two XML files are equal.

  • param string $expectedFile
  • param string $actualFile
  • param string $message

See source

assertXmlFileNotEqualsXmlFile()

protected assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = null)

Asserts that two XML files are not equal.

  • param string $expectedFile
  • param string $actualFile
  • param string $message

See source

assertXmlStringEqualsXmlFile()

protected assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = null)

Asserts that two XML documents are equal.

  • param string $expectedFile
  • param DOMDocument|string $actualXml
  • param string $message

See source

assertXmlStringEqualsXmlString()

protected assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = null)

Asserts that two XML documents are equal.

  • param DOMDocument|string $expectedXml
  • param DOMDocument|string $actualXml
  • param string $message

See source

assertXmlStringNotEqualsXmlFile()

protected assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = null)

Asserts that two XML documents are not equal.

  • param string $expectedFile
  • param DOMDocument|string $actualXml
  • param string $message

See source

assertXmlStringNotEqualsXmlString()

protected assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = null)

Asserts that two XML documents are not equal.

  • param DOMDocument|string $expectedXml
  • param DOMDocument|string $actualXml
  • param string $message

See source

debug()

protected debug($message)

Print debug message to the screen.

  • param $message

See source

debugSection()

protected debugSection($title, $message)

Print debug message with a title

  • param $title
  • param $message

See source

fail()

protected fail($message = null)

Fails a test with the given message.

  • param string $message

See source

getModule()

protected getModule($name)

Get another module by its name:

<?php
$this->getModule('WebDriver')->_findElements('.items');
  • param $name
  • return Module
  • throws ModuleException

See source

getModules()

protected getModules()

Get all enabled modules

  • return array

See source

hasModule()

protected hasModule($name)

Checks that module is enabled.

  • param $name
  • return bool

See source

markTestIncomplete()

protected markTestIncomplete($message = null)

Mark the test as incomplete.

  • param string $message

See source

markTestSkipped()

protected markTestSkipped($message = null)

Mark the test as skipped.

  • param string $message

See source

onReconfigure()

protected onReconfigure()

HOOK to be executed when config changes with _reconfigure.

See source

scalarizeArray()

protected scalarizeArray($array)

See source

shortenMessage()

protected shortenMessage($message, $chars = null)

Short text message to an amount of chars

  • param $message
  • param $chars
  • return string

See source

validateConfig()

protected validateConfig()

Validates current config for required fields and required packages.

  • throws Exception\ModuleConfigException
  • throws ModuleException

See source

 

Reference is taken from the source code. Help us to improve documentation. Edit module reference
Don't know how to write tests on your own? We will build or improve them for you. Request a quote for official enterprise support or trainings