Skip to content

Commit 9e1de18

Browse files
committed
test: add missing $this->enableDBDebug()
1 parent a6d7572 commit 9e1de18

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

tests/system/Models/DeleteModelTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function testDeleteFail(): void
4242
$result = $this->model->where('name123', 'Developer')->delete();
4343
$this->assertFalse($result);
4444
$this->seeInDatabase('job', ['name' => 'Developer']);
45+
46+
$this->enableDBDebug();
4547
}
4648

4749
public function testDeleteStringPrimaryKey(): void
@@ -77,6 +79,8 @@ public function testDeleteWithSoftDeleteFail(): void
7779
$result = $this->model->where('name123', 'Derek Jones')->delete();
7880
$this->assertFalse($result);
7981
$this->seeInDatabase('user', ['name' => 'Derek Jones', 'deleted_at IS NULL' => null]);
82+
83+
$this->enableDBDebug();
8084
}
8185

8286
public function testDeleteWithSoftDeletesPurge(): void

tests/system/Models/InsertModelTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
*/
2727
final class InsertModelTest extends LiveModelTestCase
2828
{
29-
protected function tearDown(): void
30-
{
31-
parent::tearDown();
32-
$this->setPrivateProperty($this->db, 'DBDebug', true);
33-
}
34-
3529
public function testSetWorksWithInsert(): void
3630
{
3731
$this->dontSeeInDatabase('user', [
@@ -162,6 +156,8 @@ public function testInsertResultFail(): void
162156
$lastInsertId = $this->model->getInsertID();
163157
$this->assertSame(0, $lastInsertId);
164158
$this->dontSeeInDatabase('job', ['id' => $lastInsertId]);
159+
160+
$this->enableDBDebug();
165161
}
166162

167163
public function testInsertBatchNewEntityWithDateTime(): void

tests/system/Models/SaveModelTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function testSaveNewRecordArrayFail(): void
6767
$result = $this->model->protect(false)->save($data);
6868
$this->assertFalse($result);
6969
$this->dontSeeInDatabase('job', ['name' => 'Apprentice']);
70+
71+
$this->enableDBDebug();
7072
}
7173

7274
public function testSaveUpdateRecordArray(): void
@@ -98,6 +100,8 @@ public function testSaveUpdateRecordArrayFail(): void
98100
$result = $this->model->protect(false)->save($data);
99101
$this->assertFalse($result);
100102
$this->dontSeeInDatabase('job', ['name' => 'Apprentice']);
103+
104+
$this->enableDBDebug();
101105
}
102106

103107
public function testSaveUpdateRecordObject(): void

tests/system/Models/UpdateModelTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public function testUpdateResultFail(): void
113113
$result = $this->model->update(1, ['name123' => 'Foo Bar 1']);
114114
$this->assertFalse($result);
115115
$this->dontSeeInDatabase('user', ['id' => 1, 'name' => 'Foo Bar 1']);
116+
117+
$this->enableDBDebug();
116118
}
117119

118120
public function testUpdateBatchSuccess(): void

0 commit comments

Comments
 (0)