Öffentliche Seiten auf gemeinsames Editorial-Design (x-web.site-header/-footer,
Design-Tokens) und Ausgaben-Präfix /{edition}/ (de|en) umgestellt.
- Routing: neue Middleware SetEdition (Locale + URL::defaults), /{edition}-Gruppe
in routes/web.php, Root-Redirect auf /de, 301 für Legacy-.html-URLs,
Baseline-Default in AppServiceProvider.
- Neue URL-Schemata: /{edition}/press-release/{slug}, /{edition}/category/{slug}.
- Ausgabe = Sprache: DE/EN-Umschalter (Region/CH/AT entfernt); EditorialClock
und Livewire-Komponenten sprachdynamisch.
- Detail-, Kategorie- und Veröffentlichen-Seite mit echten Daten neu aufgebaut.
- Suche aktiviert: Volt-Komponente livewire/web/search (Titel/Text/Keywords +
Firma + Rubrik, Filter, Sortierung, Pagination, URL-Parameter q/category/sort).
- Rubriken-Navigation statt Übersichtsseite: Helper CategoryNavigation;
web/kategorien.blade.php + Route entfernt (Legacy-301).
- Tests: Edition-Routing, Kategorie-Seite/-Navigation, Detail, Veröffentlichen,
Suche, EditorialClock. Doku in "Echte öffentliche Unterseiten.md" aktualisiert.
Co-authored-by: Cursor <cursoragent@cursor.com>
138 lines
4.3 KiB
PHP
138 lines
4.3 KiB
PHP
<?php
|
|
|
|
use App\Enums\Portal;
|
|
use App\Enums\PressReleaseStatus;
|
|
use App\Models\Category;
|
|
use App\Models\Company;
|
|
use App\Models\PressRelease;
|
|
use Tests\TestCase;
|
|
|
|
test('presseecho homepage renders the editorial shell', function () {
|
|
/** @var TestCase $this */
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSee('presseecho', false)
|
|
->assertSeeText('Pressemitteilungen · DACH')
|
|
->assertSeeText('Aktuelle Meldungen')
|
|
->assertSeeText('Im Fokus')
|
|
->assertSeeText('Aktive Newsrooms')
|
|
->assertSeeText('Bleiben Sie informiert')
|
|
->assertSeeText('Veröffentlichen Sie Ihre Pressemitteilung')
|
|
->assertSeeText('Redaktioneller Qualitätsstandard')
|
|
->assertSeeText('AD-HOC')
|
|
->assertSeeText('Branchen-Index')
|
|
->assertSeeText('Heute im Fokus');
|
|
});
|
|
|
|
test('presseecho homepage feed only shows published presseecho content', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Energie & Klima',
|
|
'slug' => 'energie-klima',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create([
|
|
'name' => 'Muster Energie GmbH',
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Presseecho sichtbare Meldung',
|
|
'slug' => 'presseecho-sichtbare-meldung',
|
|
'published_at' => now()->subDay(),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Both)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Gemeinsame sichtbare Meldung',
|
|
'slug' => 'gemeinsame-sichtbare-meldung',
|
|
'published_at' => now()->subDays(2),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Businessportal24)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Businessportal24 nicht sichtbar',
|
|
'slug' => 'businessportal24-nicht-sichtbar',
|
|
'published_at' => now()->subDay(),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Entwurf nicht sichtbar',
|
|
'slug' => 'entwurf-nicht-sichtbar',
|
|
'status' => PressReleaseStatus::Draft,
|
|
'published_at' => now()->subDay(),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Presseecho sichtbare Meldung')
|
|
->assertSeeText('Gemeinsame sichtbare Meldung')
|
|
->assertDontSeeText('Businessportal24 nicht sichtbar')
|
|
->assertDontSeeText('Entwurf nicht sichtbar');
|
|
});
|
|
|
|
test('presseecho homepage shows most read releases in the sidebar', function () {
|
|
/** @var TestCase $this */
|
|
$category = Category::factory()->create([
|
|
'portal' => Portal::Presseecho,
|
|
]);
|
|
$category->translations()->create([
|
|
'locale' => 'de',
|
|
'name' => 'Technologie',
|
|
'slug' => 'technologie',
|
|
]);
|
|
|
|
$company = Company::factory()->presseecho()->create([
|
|
'name' => 'Trending Corp',
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Meistgelesene Presseecho-Meldung',
|
|
'slug' => 'meistgelesene-presseecho-meldung',
|
|
'hits' => 99999,
|
|
'published_at' => now()->subDays(3),
|
|
]);
|
|
|
|
PressRelease::factory()
|
|
->published()
|
|
->forPortal(Portal::Presseecho)
|
|
->for($category)
|
|
->for($company)
|
|
->create([
|
|
'title' => 'Wenig gelesene Presseecho-Meldung',
|
|
'slug' => 'wenig-gelesene-presseecho-meldung',
|
|
'hits' => 5,
|
|
'published_at' => now()->subDays(2),
|
|
]);
|
|
|
|
$this->get('https://presseecho.test/de')
|
|
->assertSuccessful()
|
|
->assertSeeText('Meistgelesen')
|
|
->assertSeeText('Meistgelesene Presseecho-Meldung')
|
|
->assertSeeText('Trending Corp');
|
|
});
|