Changed channel categories from DB-backed Category records to a backed PHP enum

This commit is contained in:
2026-05-18 06:55:03 +03:30
parent 295a408965
commit 59e4ae60da
20 changed files with 221 additions and 130 deletions

View File

@@ -2,7 +2,7 @@
namespace Tests\Feature;
use App\Models\Category;
use App\Enums\ChannelCategory;
use App\Models\Channel;
use App\Models\PlatformSetting;
use App\Models\StreamKey;
@@ -17,13 +17,12 @@ class CreatorChannelTest extends TestCase
public function test_user_with_creator_access_can_create_one_channel_and_receives_one_time_stream_key(): void
{
$user = User::factory()->create(['can_create_channel' => true]);
$category = Category::factory()->create();
$response = $this->actingAs($user)->post(route('creator.channel.store'), [
'display_name' => 'Nyone Live',
'slug' => 'nyone-live',
'description' => 'Live builds and demos.',
'category_id' => $category->id,
'category' => ChannelCategory::Creative->value,
]);
$response
@@ -34,7 +33,7 @@ class CreatorChannelTest extends TestCase
'user_id' => $user->id,
'slug' => 'nyone-live',
'display_name' => 'Nyone Live',
'category_id' => $category->id,
'category' => ChannelCategory::Creative->value,
]);
$this->assertDatabaseCount(StreamKey::class, 1);