Skip to content

Commit eb1e2f3

Browse files
committed
fix CI fail
1 parent db4db33 commit eb1e2f3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Modules/Exercise03/Tests/Unit/Repositories/ProductRepositoryTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ protected function setUp(): void
2525

2626
public function test_all()
2727
{
28-
$collection = $this->repository->all();
28+
Product::factory()->cravat()->create([
29+
'name' => 'Cà vạt',
30+
'thumbnail' => 'images/exercise03/cravat.jpg',
31+
]);
2932

30-
$products = $collection->all();
33+
$product = new Product();
34+
$productRepository = new ProductRepository($product);
3135

32-
$this->assertEquals(count($products), 3);
36+
$products = $productRepository->all();
37+
38+
$this->assertEquals($products->count(), 1);
3339
}
3440
}

0 commit comments

Comments
 (0)