Cest
extends Test
in package
implements
ScenarioDriven, Reported, Dependent, StrictCoverage
uses
ScenarioLoader
Executes tests delivered in Cest format.
Handles loading of Cest cases, executing specific methods, following the order from @before
and @after
annotations.
Table of Contents
Interfaces
Constants
- STATUS_ERROR = 'error'
- STATUS_FAIL = 'fail'
- STATUS_OK = 'ok'
- STATUS_PENDING = 'pending'
Properties
- $hooks : array<string|int, mixed>
- Enabled traits with methods to be called before and after the test.
- $numAssertions : mixed
- $parser : Parser
- $testClassInstance : mixed
- $testMethod : mixed
- $ignored : mixed
- $metadata : Metadata
- $scenario : Scenario
- $testResult : mixed
Methods
- __construct() : mixed
- addToAssertionCount() : mixed
- This method is not covered by the backward compatibility promise for PHPUnit, but is nice to have for extensions.
- codeCoverageEnd() : mixed
- codeCoverageStart() : mixed
- count() : mixed
- errorLoggerEnd() : mixed
- fetchDependencies() : mixed
- getFeature() : mixed
- getFileName() : mixed
- getLinesToBeCovered() : mixed
- getLinesToBeUsed() : mixed
- getMetadata() : Metadata
- getName() : mixed
- getNumAssertions() : mixed
- getReportFields() : array<string|int, mixed>
- Field values for XML/JSON/TAP reports
- getScenario() : Scenario
- getScenarioText() : mixed
- getSignature() : mixed
- getSourceCode() : mixed
- getSpecFromMethod() : mixed
- getTestClass() : mixed
- getTestMethod() : mixed
- getTestResultObject() : mixed
- preload() : mixed
- run() : TestResult
- Runs a test and collects its result in a TestResult instance.
- test() : mixed
- Everything inside this method is treated as a test.
- toString() : mixed
- Test representation
- assertionCounterEnd() : mixed
- assertionCounterStart() : mixed
- createScenario() : mixed
- executeAfterMethods() : mixed
- executeBeforeMethods() : mixed
- executeContextMethod() : mixed
- executeHook() : mixed
- executeTestMethod() : mixed
- getParser() : mixed
- ignore() : mixed
- Should a test be skipped (can be set from hooks)
- ignoreIfMetadataBlockedStart() : mixed
- invoke() : mixed
- setMetadata() : mixed
Constants
STATUS_ERROR
public
mixed
STATUS_ERROR
= 'error'
STATUS_FAIL
public
mixed
STATUS_FAIL
= 'fail'
STATUS_OK
public
mixed
STATUS_OK
= 'ok'
STATUS_PENDING
public
mixed
STATUS_PENDING
= 'pending'
Properties
$hooks
Enabled traits with methods to be called before and after the test.
protected
array<string|int, mixed>
$hooks
= ['ignoreIfMetadataBlocked', 'codeCoverage', 'assertionCounter', 'errorLogger']
$numAssertions
protected
mixed
$numAssertions
= 0
$parser
protected
Parser
$parser
$testClassInstance
protected
mixed
$testClassInstance
$testMethod
protected
mixed
$testMethod
$ignored
private
mixed
$ignored
= false
$metadata
private
Metadata
$metadata
$scenario
private
Scenario
$scenario
$testResult
private
mixed
$testResult
Methods
__construct()
public
__construct(mixed $testClass, mixed $methodName, mixed $fileName) : mixed
Parameters
- $testClass : mixed
- $methodName : mixed
- $fileName : mixed
addToAssertionCount()
This method is not covered by the backward compatibility promise for PHPUnit, but is nice to have for extensions.
public
addToAssertionCount(mixed $count) : mixed
Parameters
- $count : mixed
codeCoverageEnd()
public
codeCoverageEnd(mixed $status, mixed $time) : mixed
Parameters
- $status : mixed
- $time : mixed
codeCoverageStart()
public
codeCoverageStart() : mixed
count()
public
count() : mixed
Attributes
errorLoggerEnd()
public
errorLoggerEnd(mixed $status, mixed $time[, mixed $exception = null ]) : mixed
Parameters
- $status : mixed
- $time : mixed
- $exception : mixed = null
fetchDependencies()
public
fetchDependencies() : mixed
getFeature()
public
getFeature() : mixed
getFileName()
public
getFileName() : mixed
getLinesToBeCovered()
public
getLinesToBeCovered() : mixed
getLinesToBeUsed()
public
getLinesToBeUsed() : mixed
getMetadata()
public
abstract getMetadata() : Metadata
Return values
MetadatagetName()
public
getName() : mixed
getNumAssertions()
public
getNumAssertions() : mixed
getReportFields()
Field values for XML/JSON/TAP reports
public
getReportFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getScenario()
public
getScenario() : Scenario
Return values
ScenariogetScenarioText()
public
getScenarioText([mixed $format = 'text' ]) : mixed
Parameters
- $format : mixed = 'text'
getSignature()
public
getSignature() : mixed
getSourceCode()
public
getSourceCode() : mixed
getSpecFromMethod()
public
getSpecFromMethod() : mixed
getTestClass()
public
getTestClass() : mixed
getTestMethod()
public
getTestMethod() : mixed
getTestResultObject()
public
getTestResultObject() : mixed
preload()
public
preload() : mixed
run()
Runs a test and collects its result in a TestResult instance.
public
final run([TestResult $result = null ]) : TestResult
Executes before/after hooks coming from traits.
Parameters
- $result : TestResult = null
Return values
TestResulttest()
Everything inside this method is treated as a test.
public
test() : mixed
toString()
Test representation
public
toString() : mixed
assertionCounterEnd()
protected
assertionCounterEnd() : mixed
assertionCounterStart()
protected
assertionCounterStart() : mixed
createScenario()
protected
createScenario() : mixed
executeAfterMethods()
protected
executeAfterMethods(mixed $testMethod, mixed $I) : mixed
Parameters
- $testMethod : mixed
- $I : mixed
executeBeforeMethods()
protected
executeBeforeMethods(mixed $testMethod, mixed $I) : mixed
Parameters
- $testMethod : mixed
- $I : mixed
executeContextMethod()
protected
executeContextMethod(mixed $context, mixed $I) : mixed
Parameters
- $context : mixed
- $I : mixed
executeHook()
protected
executeHook(mixed $I, mixed $hook) : mixed
Parameters
- $I : mixed
- $hook : mixed
executeTestMethod()
protected
executeTestMethod(mixed $I) : mixed
Parameters
- $I : mixed
getParser()
protected
getParser() : mixed
ignore()
Should a test be skipped (can be set from hooks)
protected
ignore(bool $ignored) : mixed
Parameters
- $ignored : bool
ignoreIfMetadataBlockedStart()
protected
ignoreIfMetadataBlockedStart() : mixed
invoke()
protected
invoke(mixed $methodName, array<string|int, mixed> $context) : mixed
Parameters
- $methodName : mixed
- $context : array<string|int, mixed>
setMetadata()
protected
setMetadata(Metadata $metadata) : mixed
Parameters
- $metadata : Metadata