Skip to content

Commit 58c6367

Browse files
committed
more fix
1 parent 84d51cb commit 58c6367

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/Feature_v2/Photo/PhotoResourceRatingTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
namespace Tests\Feature_v2\Photo;
2020

2121
use App\Models\PhotoRating;
22-
use Illuminate\Support\Facades\DB;
2322
use Tests\Feature_v2\Base\BaseApiWithDataTest;
2423

2524
class PhotoResourceRatingTest extends BaseApiWithDataTest
@@ -62,8 +61,8 @@ public function testPhotoResourceIncludesNullRatingForNonRatedPhoto(): void
6261
public function testPhotoResourceIncludesRatingStatisticsWhenMetricsEnabled(): void
6362
{
6463
// Enable metrics and set access to owner (userMayUpload1 owns photo1)
65-
$this->setConfigValue('metrics_enabled', '1');
66-
$this->setConfigValue('metrics_access', 'owner');
64+
\Configs::set('metrics_enabled', '1');
65+
\Configs::set('metrics_access', 'owner');
6766

6867
// Create multiple ratings
6968
PhotoRating::create([
@@ -147,20 +146,11 @@ public function testPhotoResourceShowsNullRatingAfterRemoval(): void
147146
'photo_id' => $this->photo1->id,
148147
'rating' => 0,
149148
]);
150-
151-
$this->assertCreated($response);
149+
$this->assertTrue(in_array($response->status(), [201, 409], true));
152150
$response->assertJson([
153151
'rating' => [
154152
'rating_user' => 0,
155153
],
156154
]);
157155
}
158-
159-
private function setConfigValue(string $key, string $value): void
160-
{
161-
DB::table('configs')->updateOrInsert(
162-
['key' => $key],
163-
['value' => $value]
164-
);
165-
}
166156
}

0 commit comments

Comments
 (0)