create([ 'username' => 'schema_admin', 'password_hash' => 'unused', 'name' => '管理员', 'status' => 'active', ])); $competition = Competition::query()->create([ 'slug' => 'xxf', 'name' => '测试赛', 'published' => true, ]); $this->postJson("/api/v1/admin/competitions/{$competition->id}/form-schemas", [ 'purpose' => FormSchemaDefinition::PURPOSE_SIGNUP, 'name' => '含自定义字段', 'schema_json' => [ [ 'key' => 'field_x', 'type' => 'text', 'label' => '自定义字段', ], ], 'is_published' => false, ])->assertCreated() ->assertJsonPath('schema_json.0.key', 'field_x'); } }