Skip to content

Commit

Permalink
commit test
Browse files Browse the repository at this point in the history
tests
  • Loading branch information
moseuh committed Jul 3, 2024
1 parent e3483c8 commit f29fdf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/Unit/RatingControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

namespace Tests\Unit;

Expand Down
6 changes: 2 additions & 4 deletions tests/Unit/RatingTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
&lt;?php
<?php

namespace Tests\Unit;

Expand All @@ -15,12 +15,10 @@ public function testCalculateAverageRating()
$productId = 1;
$expectedAverage = 4.5;

Rating::unguard();
Rating::insert([
Rating::factory()->createMany([
['product_id' => $productId, 'rating' => 5],
['product_id' => $productId, 'rating' => 4],
]);
Rating::reguard();

$averageRating = Rating::calculateAverageRating($productId);

Expand Down

0 comments on commit f29fdf5

Please sign in to comment.