Skip to content

Commit 05f4768

Browse files
committed
test: add disableDBDebug() and enableDBDebug()
1 parent 5f0233f commit 05f4768

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

system/Test/DatabaseTestTrait.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,22 @@ public function seeNumRecords(int $expected, string $table, array $where)
323323

324324
$this->assertEquals($expected, $count, 'Wrong number of matching rows in database.');
325325
}
326+
327+
/**
328+
* Sets $DBDebug to false.
329+
*
330+
* WARNING: this value will persist! take care to roll it back.
331+
*/
332+
protected function disableDBDebug(): void
333+
{
334+
$this->setPrivateProperty($this->db, 'DBDebug', false);
335+
}
336+
337+
/**
338+
* Sets $DBDebug to true.
339+
*/
340+
protected function enableDBDebug(): void
341+
{
342+
$this->setPrivateProperty($this->db, 'DBDebug', true);
343+
}
326344
}

0 commit comments

Comments
 (0)