File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Modules/Exercise03/Tests/Unit Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments