MockLivestatus Class Reference
A mock replacement for op5Livestatus, which works on the data array passed to the constructor.
More...
Public Member Functions |
| __construct ($data, $options=array()) |
| Load the mocked livestatus environment.
|
| query ($table, $filter, $columns, $options=array()) |
| Query the mocked livestatus environment.
|
Data Fields |
| $data |
| Storage for the mocked environment.
|
| $last_columns = false |
| An array of the previously requested columns.
|
Protected Attributes |
| $options |
| Options for behaviour of mock environment.
|
Detailed Description
A mock replacement for op5Livestatus, which works on the data array passed to the constructor.
Useful for unit testing
Constructor & Destructor Documentation
MockLivestatus::__construct |
( |
$ |
data, |
|
|
$ |
options = array() | |
|
) |
| | |
Load the mocked livestatus environment.
- Parameters:
-
| $data | Data to be available in the mocked environemnt, indexed by table, structure as livestatus result (but with names as keys) |
| $options | Attributes to change behaviour of MockLivestatus. An array containing flags, if not set, use defaults. set 'allow_undefined_columns' to true to make all undefined columns get the value of an empty string. |
Member Function Documentation
MockLivestatus::query |
( |
$ |
table, |
|
|
$ |
filter, |
|
|
$ |
columns, |
|
|
$ |
options = array() | |
|
) |
| | |
Query the mocked livestatus environment.
- Parameters:
-
| $table | Table to search in |
| $filter | Filter, as an array, or multiline string |
| $columns | Columns to request |
| $options | Options (not used ATM) |
- Exceptions:
-
- Returns:
- array, as op5Livestatus returns
Field Documentation
MockLivestatus::$options [protected] |
Initial value: array (
'allow_undefined_columns' => false
)
Options for behaviour of mock environment.
The documentation for this class was generated from the following file: