PM-Detailseite: Direktlinks zur öffentlichen Seite je Portal

Veröffentlichte PMs zeigten im Backend nur den Status-Badge, ohne Weg
zur öffentlichen Seite. Im Seitenkopf stehen jetzt Direktlinks — bei
Portal::Both einer je Portal (QA-Befund 07.07.).

Die URL-Logik ist als PressRelease::publicPortalLinks() zentralisiert
(vorher doppelt in der Published-Mail und fehlerhaft im Nachweis-PDF:
dort fehlte das /de/press-release/-Segment, die dokumentierte URL lief
ins Leere; bei Both nennt der Nachweis jetzt beide URLs). Edition folgt
der PM-Sprache statt hart „de".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-07 15:00:40 +00:00
parent 930760a056
commit 28de92e18b
6 changed files with 128 additions and 13 deletions

View file

@ -1,5 +1,6 @@
<?php
use App\Enums\Portal;
use App\Enums\PressReleaseStatus;
use App\Enums\SinglePurchaseStatus;
use App\Enums\SinglePurchaseType;
@ -87,6 +88,19 @@ test('the rendered proof is a non-trivial pdf document', function () {
expect(strlen($pdf))->toBeGreaterThan(800);
});
test('the rendered proof documents the real public url of the release', function () {
$pr = PressRelease::factory()->published()->create([
'portal' => Portal::Presseecho,
'slug' => 'nachweis-pm',
'language' => 'de',
]);
$pdf = app(ProofPdfRenderer::class)->render($pr);
// Vorher fehlte das /de/press-release/-Segment — die URL im Nachweis lief ins Leere.
expect($pdf)->toContain(config('domains.domain_presseecho_url').'/de/press-release/nachweis-pm');
});
test('the proof download requires a prior purchase', function () {
$user = customerWithRole();
$pr = PressRelease::factory()->published()->create(['user_id' => $user->id]);