We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db4db33 commit eb1e2f3Copy full SHA for eb1e2f3
Modules/Exercise03/Tests/Unit/Repositories/ProductRepositoryTest.php
@@ -25,10 +25,16 @@ protected function setUp(): void
25
26
public function test_all()
27
{
28
- $collection = $this->repository->all();
+ Product::factory()->cravat()->create([
29
+ 'name' => 'Cà vạt',
30
+ 'thumbnail' => 'images/exercise03/cravat.jpg',
31
+ ]);
32
- $products = $collection->all();
33
+ $product = new Product();
34
+ $productRepository = new ProductRepository($product);
35
- $this->assertEquals(count($products), 3);
36
+ $products = $productRepository->all();
37
+
38
+ $this->assertEquals($products->count(), 1);
39
}
40
0 commit comments