MockLivestatus Class Reference

A mock replacement for op5Livestatus, which works on the data array passed to the constructor. More...

Public Member Functions

 __construct ($data)
 Load the mocked livestatus environment.
 query ($table, $filter, $columns, $options=array())
 Query the mocked livestatus environment.

Data Fields

 $last_columns = false
 An array of the previously requested columns.

Protected Attributes

 $data
 Storage for the mocked 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  ) 

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)

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:
MockLivestatus_Exception 
Returns:
array, as op5Livestatus returns

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 14 Jan 2015 for ninja by  doxygen 1.6.1