diff --git a/tests/Feature/Api/ApiNewsroomAssignmentTest.php b/tests/Feature/Api/ApiNewsroomAssignmentTest.php index 86cf68b0..108aec37 100644 --- a/tests/Feature/Api/ApiNewsroomAssignmentTest.php +++ b/tests/Feature/Api/ApiNewsroomAssignmentTest.php @@ -107,7 +107,7 @@ test('a company on the other portal becomes both and the release lands on the re /** @var TestCase $this */ $user = assignmentApiUser(Portal::Presseecho); $existing = Company::factory()->create(['email' => 'info@muster.de', 'name' => 'Muster GmbH', 'portal' => 'businessportal24']); - $category = Category::factory()->create(); + $category = Category::factory()->create(['portal' => Portal::Both]); Queue::fake(); $id = postApiCompany(); diff --git a/tests/Feature/Api/ApiPortalResolutionTest.php b/tests/Feature/Api/ApiPortalResolutionTest.php index ba4ad412..612577e5 100644 --- a/tests/Feature/Api/ApiPortalResolutionTest.php +++ b/tests/Feature/Api/ApiPortalResolutionTest.php @@ -95,7 +95,7 @@ test('legacy press release creation uses the request domain portal over the comp $user = portalResolutionApiUser(Portal::Businessportal24); $company = Company::factory()->businessportal24()->create(['owner_user_id' => $user->id]); $user->companies()->attach($company->id, ['role' => 'owner']); - $category = Category::factory()->create(['legacy_id' => 4711]); + $category = Category::factory()->create(['portal' => Portal::Both, 'legacy_id' => 4711]); config()->set('app.theme', 'presseecho'); @@ -113,7 +113,7 @@ test('legacy press release creation accepts an explicit portal parameter over th $user = portalResolutionApiUser(Portal::Businessportal24); $company = Company::factory()->businessportal24()->create(['owner_user_id' => $user->id]); $user->companies()->attach($company->id, ['role' => 'owner']); - $category = Category::factory()->create(['legacy_id' => 4712]); + $category = Category::factory()->create(['portal' => Portal::Both, 'legacy_id' => 4712]); config()->set('app.theme', 'businessportal24'); @@ -132,7 +132,7 @@ test('legacy press release creation falls back to the company portal without dom $user = portalResolutionApiUser(Portal::Businessportal24); $company = Company::factory()->businessportal24()->create(['owner_user_id' => $user->id]); $user->companies()->attach($company->id, ['role' => 'owner']); - $category = Category::factory()->create(['legacy_id' => 4713]); + $category = Category::factory()->create(['portal' => Portal::Both, 'legacy_id' => 4713]); config()->set('app.theme', 'portal'); @@ -147,7 +147,7 @@ test('v1 press release creation resolves the portal from parameter and domain', /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->businessportal24()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:read', 'press-releases:write']); @@ -176,7 +176,7 @@ test('v1 press release creation rejects the portal value both', function () { /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->businessportal24()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:read', 'press-releases:write']); diff --git a/tests/Feature/Api/V1/CustomerDataApiTest.php b/tests/Feature/Api/V1/CustomerDataApiTest.php index eb62d9ce..dacc9eb6 100644 --- a/tests/Feature/Api/V1/CustomerDataApiTest.php +++ b/tests/Feature/Api/V1/CustomerDataApiTest.php @@ -1,5 +1,6 @@ create(); - Category::factory()->withTranslations()->create(); + Category::factory()->withTranslations()->create(['portal' => Portal::Both]); Sanctum::actingAs($user, ['press-releases:read']); diff --git a/tests/Feature/Api/V1/PressReleaseApiTest.php b/tests/Feature/Api/V1/PressReleaseApiTest.php index 9c8e94ff..8a5ce461 100644 --- a/tests/Feature/Api/V1/PressReleaseApiTest.php +++ b/tests/Feature/Api/V1/PressReleaseApiTest.php @@ -12,7 +12,7 @@ test('api user can create list update and delete own press releases', function ( /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->presseecho()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:read', 'press-releases:write']); @@ -59,7 +59,7 @@ test('api submitted html text is sanitized before persistence', function () { /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->presseecho()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:read', 'press-releases:write']); @@ -85,7 +85,7 @@ test('api write ability is required to create press releases', function () { /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->presseecho()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:read']); @@ -131,7 +131,7 @@ test('a soft deleted company is neither listed nor usable for new press releases /** @var TestCase $this */ $user = User::factory()->create(); $company = Company::factory()->presseecho()->create(['name' => 'Geloeschte Firma']); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); $company->delete(); diff --git a/tests/Feature/Api/V1/PressReleaseSubmitApiTest.php b/tests/Feature/Api/V1/PressReleaseSubmitApiTest.php index 0744e0a6..f2ce74a4 100644 --- a/tests/Feature/Api/V1/PressReleaseSubmitApiTest.php +++ b/tests/Feature/Api/V1/PressReleaseSubmitApiTest.php @@ -1,5 +1,6 @@ create(); $company = Company::factory()->presseecho()->create(); - $category = Category::factory()->withTranslations()->create(); + $category = Category::factory()->withTranslations()->create(['portal' => Portal::Both]); $user->companies()->attach($company->id, ['role' => 'owner']); Sanctum::actingAs($user, ['press-releases:write']);