Add new chat effects and shop items

This commit is contained in:
2026-04-12 16:48:58 +08:00
parent 33a3e5d118
commit 70cb170f2c
25 changed files with 1707 additions and 60 deletions
@@ -0,0 +1,48 @@
<?php
/**
* 文件功能:管理员聊天命令功能测试
* 负责验证聊天室管理员命令接口对新特效类型的支持情况。
*/
namespace Tests\Feature\Feature;
use App\Models\Room;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
/**
* 管理员聊天命令功能测试
* 覆盖全屏特效命令的新增特效校验。
*/
class AdminCommandControllerTest extends TestCase
{
use RefreshDatabase;
/**
* 测试站长可以触发全部新增全屏特效。
*/
public function test_super_admin_can_trigger_all_new_effect_types(): void
{
$admin = User::factory()->create([
'user_level' => 100,
]);
$room = Room::create([
'room_name' => '特效房',
]);
$types = ['sakura', 'meteors', 'gold-rain', 'hearts', 'confetti', 'fireflies'];
foreach ($types as $type) {
$response = $this->actingAs($admin)->postJson(route('command.effect'), [
'room_id' => $room->id,
'type' => $type,
]);
$response->assertOk();
$response->assertJson([
'status' => 'success',
]);
}
}
}