Check
in package
implements
Checkable
AbstractYes
Convenience base class for binary checks.
When Check::execute() is called, it uses the Check::check() method to determine if the test was successful. If so, CheckResult::success() using the values from Check::getGroup() and Check::getName(). Otherwise, the check result from Check::getError() is enriched with the name and the group and returned.
Table of Contents
Interfaces
- Checkable
- Interface all checks should implement.
Methods
- check() : bool
- Function to check against. This is used by the execute() function to check if a positive or negative result is returned.
- execute() : CheckResult
- This executes the check and returns a positive result or the result of getError(). You can overwrite this to implement more complex checks.
- getError() : CheckResult
- This value is returned if check() fails.
- getGroup() : string
- Group of the check to partition the results.
- getName() : string
- Name of the check to identify the result.
Methods
check()
Function to check against. This is used by the execute() function to check if a positive or negative result is returned.
public
abstract check() : bool
Tags
Return values
boolexecute()
This executes the check and returns a positive result or the result of getError(). You can overwrite this to implement more complex checks.
public
execute() : CheckResult
Tags
Return values
CheckResultgetError()
This value is returned if check() fails.
public
abstract getError() : CheckResult
Tags
Return values
CheckResultgetGroup()
Group of the check to partition the results.
public
abstract getGroup() : string
Return values
stringgetName()
Name of the check to identify the result.
public
abstract getName() : string