|
@@ 102-111 (lines=10) @@
|
| 99 |
|
* |
| 100 |
|
* @return bool |
| 101 |
|
*/ |
| 102 |
|
public function dontSeeInDatabase($table, array $where) |
| 103 |
|
{ |
| 104 |
|
$this->checkDbConnId(); |
| 105 |
|
|
| 106 |
|
$this->db->from($table); |
| 107 |
|
$this->db->where($where); |
| 108 |
|
$count = $this->db->count_all_results(); |
| 109 |
|
|
| 110 |
|
$this->assertTrue($count == 0, 'Row was found in database'); |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
//-------------------------------------------------------------------- |
| 114 |
|
|
|
@@ 124-133 (lines=10) @@
|
| 121 |
|
* |
| 122 |
|
* @return bool |
| 123 |
|
*/ |
| 124 |
|
public function seeInDatabase($table, array $where) |
| 125 |
|
{ |
| 126 |
|
$this->checkDbConnId(); |
| 127 |
|
|
| 128 |
|
$this->db->from($table); |
| 129 |
|
$this->db->where($where); |
| 130 |
|
$count = $this->db->count_all_results(); |
| 131 |
|
|
| 132 |
|
$this->assertTrue($count > 0, 'Row not found in database'); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
//-------------------------------------------------------------------- |
| 136 |
|
|
|
@@ 192-201 (lines=10) @@
|
| 189 |
|
* |
| 190 |
|
* @return bool |
| 191 |
|
*/ |
| 192 |
|
public function seeNumRecords($expected, $table, array $where = []) |
| 193 |
|
{ |
| 194 |
|
$this->checkDbConnId(); |
| 195 |
|
|
| 196 |
|
$this->db->from($table); |
| 197 |
|
$this->db->where($where); |
| 198 |
|
$count = $this->db->count_all_results(); |
| 199 |
|
|
| 200 |
|
$this->assertEquals($expected, $count, 'Wrong number of matching rows in database.'); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
//-------------------------------------------------------------------- |
| 204 |
|
|