Cept
extends Test
in package
implements
Plain, ScenarioDriven, Reported, Dependent
uses
ScenarioLoader
Executes tests delivered in Cept format.
Prepares metadata, parses test body on preload, and executes a test in test
method.
Table of Contents
Interfaces
- Plain
- TestCases that do not follow OOP
- ScenarioDriven
- Reported
- Dependent
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
- $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
- 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
- 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
- getParser() : Parser
- ignore() : mixed
- Should a test be skipped (can be set from hooks)
- ignoreIfMetadataBlockedStart() : 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
$ignored
private
mixed
$ignored
= false
$metadata
private
Metadata
$metadata
$scenario
private
Scenario
$scenario
$testResult
private
mixed
$testResult
Methods
__construct()
public
__construct(mixed $name, mixed $file) : mixed
Parameters
- $name : mixed
- $file : 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
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
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
getParser()
protected
getParser() : Parser
Return values
Parserignore()
Should a test be skipped (can be set from hooks)
protected
ignore(bool $ignored) : mixed
Parameters
- $ignored : bool
ignoreIfMetadataBlockedStart()
protected
ignoreIfMetadataBlockedStart() : mixed
setMetadata()
protected
setMetadata(Metadata $metadata) : mixed
Parameters
- $metadata : Metadata