Testomatio - Test Management for Codeception
template
RealInstanceType of objectparam
$classparam array
$params - properties and methods to setparam bool|PHPUnitTestCase
$testCasethrows RuntimeException
when class does not existthrows Exception
return PHPUnitMockObject&RealInstanceType
- mockInstantiates a class without executing a constructor.
Properties and methods can be set as a second parameter. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in second parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
param mixed
$classparam int
$numparam array
$paramsthrows Exception
return array
Creates $num instances of class through Stub::make
.
template
RealInstanceType of objectparam
$classparam string
$methodparam array
$paramsparam bool|PHPUnitTestCase
$testCasethrows Exception
return PHPUnitMockObject&RealInstanceType
Instantiates class having all methods replaced with dummies except one.
Constructor is not triggered. Properties and methods can be replaced. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in second parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
template
RealInstanceType of objectparam
$classparam array
$paramsparam bool|PHPUnitTestCase
$testCasethrows Exception
return PHPUnitMockObject&RealInstanceType
Instantiates class having all methods replaced with dummies.
Constructor is not triggered. Properties and methods can be set as a second parameter. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in second parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
param
$objparam array
$paramsthrows Exception
return mixed
Clones an object and redefines it’s properties (even protected and private)
template
RealInstanceType of objectparam
$classparam array
$constructorParamsparam array
$paramsparam bool|PHPUnitTestCase
$testCasethrows Exception
return PHPUnitMockObject&RealInstanceType
Instantiates a class instance by running constructor.
Parameters for constructor passed as second argument Properties and methods can be set in third argument. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in third parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
template
RealInstanceType of objectparam
$classparam array
$constructorParamsparam array
$paramsparam bool|PHPUnitTestCase
$testCasereturn PHPUnitMockObject&RealInstanceType
Instantiates a class instance by running constructor with all methods replaced with dummies.
Parameters for constructor passed as second argument Properties and methods can be set in third argument. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in third parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
template
RealInstanceType of objectparam
$classparam string
$methodparam array
$constructorParamsparam array
$paramsparam bool|PHPUnitTestCase
$testCasethrows ReflectionException
return PHPUnitMockObject&RealInstanceType
Instantiates a class instance by running constructor with all methods replaced with dummies, except one.
Parameters for constructor passed as second argument Properties and methods can be set in third argument. Even protected and private properties can be set.
Accepts either name of class or object of that class
To replace method provide it’s name as a key in third parameter and it’s return value or callback function as parameter
To create a mock, pass current testcase name as last argument:
param PHPUnitMockObject|object
$mockparam array
$paramsthrows LogicException
return object
Replaces properties of current stub
return \Codeception\Stub\ConsecutiveMap
Stubbing a method call to return a list of values in the specified order.