...
The function takes an array as a parmater:
key | description | example |
---|---|---|
table | table we are selecting from | table' => 'test' |
orderby | order by columns | 'orderby' => array('c2') |
columns | columns we are interested in | 'columns' => array('c1','c2') |
where | filter to apply - an array (column, value, operator) | 'where' => array(array('column' => 'c2', 'value' => 1, 'operator' => '=') |
The function returns a results array you can use the phpunit assertEquals fucntion to comapre against an expected result set.
Code Block | ||||
---|---|---|---|---|
| ||||
$querytable = $this->query(array('columns' => array('property_id', 'idMod'), 'table' => 'properties_modules'));
// example result set
array(0 =>
array(
'property_id' => 1,
'idMod' => 2
),
array(
'property_id' => 2,
'idMod' => 4
),
) |
If you need to do more and wanted to access the rogo database object all you would have to do is use the $this->db
variable.
...