Skip to content
  • Sponsor galette/plugin-auto

  • Notifications You must be signed in to change notification settings
  • Fork 3
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e50d7fb

Browse files
committedFeb 12, 2024·
Fix
1 parent 9eedd59 commit e50d7fb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎tests/GaletteAuto/tests/units/Model.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,15 @@ public function testCrud(): void
8484

8585
$this->assertCount(2, $brand->getList());
8686

87-
$model = new \GaletteAuto\Model($this->zdb);
88-
$this->assertCount(0, $model->getList());
87+
$models = new \GaletteAuto\Repository\Models(
88+
$this->zdb,
89+
$this->preferences,
90+
$this->login,
91+
new \GaletteAuto\ModelsList()
92+
);
93+
$this->assertCount(0, $models->getList());
8994

95+
$model = new \GaletteAuto\Model($this->zdb);
9096
$data = [];
9197
$this->assertFalse($model->check($data));
9298
$this->assertSame(
@@ -126,7 +132,9 @@ public function testCrud(): void
126132
$this->assertTrue($model->check($data));
127133
$this->assertTrue($model->store(true));
128134

129-
$this->assertCount(1, $model->getList());
135+
$this->assertCount(1, $models->getList());
136+
$this->assertCount(1, $models->getList($first_brand_id));
137+
$this->assertCount(0, $models->getList($second_brand_id));
130138

131139
/*$this->assertCount(2, $brand->getList());
132140
$this->assertSame('2 brands', $brand->displayCount());

0 commit comments

Comments
 (0)
Please sign in to comment.