diff --git a/database/migrations/2024_01_11_150113_update_attributes.php b/database/migrations/2024_01_11_150113_update_attributes.php index 5629c407d1..b9333f86ec 100644 --- a/database/migrations/2024_01_11_150113_update_attributes.php +++ b/database/migrations/2024_01_11_150113_update_attributes.php @@ -15,7 +15,7 @@ public function up(): void //$table->tinyInteger('is_hidden')->default(0)->change(); }); - Illuminate\Support\Facades\DB::statement('ALTER TABLE `attributes` MODIFY `is_hidden` tinyint(1) DEFAULT 0 NOT NULL;'); + Illuminate\Support\Facades\DB::raw('ALTER TABLE `attributes` MODIFY `is_hidden` tinyint(1) DEFAULT 0 NOT NULL;'); } /** diff --git a/phpunit.xml b/phpunit.xml index 3bc069f8a8..7a9fd90d97 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -26,5 +26,6 @@ + diff --git a/tests/Feature/Entities/EntityTest.php b/tests/Feature/Entities/EntityTest.php index 2334536c8b..06a76c03dd 100644 --- a/tests/Feature/Entities/EntityTest.php +++ b/tests/Feature/Entities/EntityTest.php @@ -1,6 +1,5 @@ asUser() ->withCampaign() @@ -41,11 +40,30 @@ ->assertStatus(200) ; +it('POSTS a new character with a mention and checks that a new entity is created') + ->asUser() + ->withCampaign() + ->postJson('/api/1.0/campaigns/1/characters', [ + 'name' => fake()->name(), + 'entry' => '[new:item|Mega sword]', + ]) + ->assertStatus(201) + ->assertJsonStructure([ + 'data' => [ + 'id', + 'entity_id', + ] + ]) + ->assertJsonFragment(['entry_parsed' => 'Mega sword']) +; + it('Transfers entities') ->asUser() ->withCampaign() + ->withCampaigns(['created_by' => 1]) ->withCharacters() - ->withCampaigns() ->postJson('/api/1.0/campaigns/1/transfer', [ 'entities' => [1,2,3], 'campaign_id' => 2, @@ -57,8 +75,8 @@ it('Copies entities') ->asUser() ->withCampaign() + ->withCampaigns(['created_by' => 1]) ->withCharacters() - ->withCampaigns() ->postJson('/api/1.0/campaigns/1/transfer', [ 'entities' => [1,2,3], 'campaign_id' => 2, diff --git a/tests/Feature/FrontCampaignTest.php b/tests/Feature/FrontCampaignTest.php index e8a765e8c6..767aa4d495 100644 --- a/tests/Feature/FrontCampaignTest.php +++ b/tests/Feature/FrontCampaignTest.php @@ -8,7 +8,7 @@ ->assertJsonStructure([ 'filters' => [ 'language', - 'system', + 'system[]', 'is_boosted', 'is_open', 'genre'