Skip to content

Commit bc2ce0f

Browse files
committed
fix CI fail
1 parent db4db33 commit bc2ce0f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
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
}

Modules/Exercise03/Tests/Unit/Services/ProductServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ public function test_get_all_products()
149149

150150
$products = $this->service->getAllProducts();
151151

152-
$this->assertEquals($products->count(), 6);
152+
$this->assertEquals($products->count(), 3);
153153
}
154154
}

0 commit comments

Comments
 (0)