set('billing.single_pm_price_cents', 1900); config()->set('billing.change_price_cents', 1000); config()->set('billing.depublication_price_cents', 3500); config()->set('billing.vat_rate', 0.19); config()->set('credits.extra_pm.starter', 15); Plan::factory()->create(['slug' => 'starter', 'name' => 'Starter', 'monthly_price_cents' => 2900, 'yearly_price_cents' => 29000, 'press_release_quota' => 3, 'is_active' => true]); }); test('the worked example lets pay-per-release win in some rows and the plan in others', function () { $data = app(PricingTransparencyData::class)->build(); expect($data['singleNet'])->toBe('19') ->and($data['singleGross'])->toBe('22,61') ->and($data['starterMonthlyNet'])->toBe('29') ->and(collect($data['examples'])->pluck('cheaper')->unique()->sort()->values()->all())->toBe(['single', 'starter']); }); test('the cost page shows the short answer with the configured price and no competitor names', function () { /** @var TestCase $this */ $response = $this->get('https://presseecho.test/de/was-kostet-eine-pressemitteilung')->assertSuccessful(); $response ->assertSee('Was kostet eine Pressemitteilung?') ->assertSee('19 € netto (22,61 € inkl. 19 % USt.)', false) ->assertSee('Woran man Folgekosten erkennt') ->assertSee('Rechenbeispiel') ->assertSee('228 €', false) ->assertSee('10 € netto') ->assertSee('35 € netto') ->assertSee('/de/pressemitteilung-loeschen-oder-aendern-lassen', false) ->assertSee('Was kostet eine Pressemitteilung? Preis, Modelle, Rechenbeispiel – presseecho', false); // Kein Anbietername, keine fremden Preise (Briefing 17.09.2026). $this->assertStringNotContainsStringIgnoringCase('presseportal.de', (string) $response->getContent()); $this->assertStringNotContainsStringIgnoringCase('openpr', (string) $response->getContent()); }); test('the no-subscription page and the change page render on every host in both editions', function (string $url) { /** @var TestCase $this */ $this->get($url)->assertSuccessful(); })->with([ 'https://businessportal24.test/de/pressemitteilung-veroeffentlichen-ohne-abo', 'https://businessportal24.test/en/pressemitteilung-veroeffentlichen-ohne-abo', 'https://pressekonto.test/de/pressemitteilung-loeschen-oder-aendern-lassen', 'https://presseecho.test/en/pressemitteilung-loeschen-oder-aendern-lassen', 'https://pressekonto.test/en/was-kostet-eine-pressemitteilung', ]); test('the change page names the five ways with their prices and points to the self-service entry', function () { /** @var TestCase $this */ $this->get('https://businessportal24.test/de/pressemitteilung-loeschen-oder-aendern-lassen') ->assertSuccessful() ->assertSee('Die fünf Wege') ->assertSee('kostenlos') ->assertSee('10 € netto') ->assertSee('35 € netto') ->assertSee('/de/melden/pm', false) ->assertSee('Die Meldung steht auf einem anderen Portal?'); }); test('the pages are linked from the pricing page, the help centre and the sitemap', function () { /** @var TestCase $this */ $this->get('https://presseecho.test/de/preise')->assertSuccessful() ->assertSee('/de/was-kostet-eine-pressemitteilung', false); $this->get('https://presseecho.test/de/hilfe')->assertSuccessful() ->assertSee('/de/pressemitteilung-loeschen-oder-aendern-lassen', false) ->assertSee('/de/pressemitteilung-veroeffentlichen-ohne-abo', false); $this->get('https://presseecho.test/sitemap.xml')->assertSuccessful() ->assertSee('https://presseecho.test/de/was-kostet-eine-pressemitteilung', false); $this->get('https://pressekonto.test/sitemap.xml')->assertSuccessful() ->assertSee('https://pressekonto.test/de/pressemitteilung-loeschen-oder-aendern-lassen', false); });