Files
laraundfelix/tests/Feature/PublicPageTest.php
T
LarsandCursor 2035c46edd
Deploy Test / test (push) Successful in 2m25s
Deploy Test / deploy (push) Failing after 25s
Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 08:32:14 +01:00

45 lines
1.2 KiB
PHP

<?php
namespace Tests\Feature;
use App\Domain\Cms\Page;
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PublicPageTest extends TestCase
{
use RefreshDatabase;
public function test_home_page_is_published_from_the_cms(): void
{
$response = $this->get('/');
$response->assertOk();
$response->assertSee('Lara &amp; Felix', false);
$response->assertSee('Stark im Alltag');
$response->assertSee('Anmelden');
$response->assertSee('href="'.route('login').'"', false);
$response->assertDontSee('/verwaltung');
}
public function test_known_pages_and_sitemap_are_available(): void
{
$this->get('/praevention')->assertOk()->assertSee('Prävention im Alltag');
$this->get('/angebote')->assertOk()->assertDontSee('€');
$this->get('/sitemap.xml')->assertOk()->assertSee(url('/praevention'), false);
}
public function test_missing_page_is_not_found(): void
{
$this->get('/gibt-es-nicht')->assertNotFound();
}
public function test_page_paths_are_unique(): void
{
$this->expectException(QueryException::class);
Page::query()->create(['path' => '/']);
}
}