Files
clinicpro/tests/Shared/AboutPageTest.php
T
hamedandClaude Opus 5 1ca20b6f53 feat(public): add About Us page
Adds a public "درباره ما" page at /درباره-ما reusing the landing theme
(same webpack entry, header, footer, registration modal). Section ids
match the header anchors so the nav works on this page too.

The explicit route takes precedence over LandingController's catch-all
/{slug}, which is registered with priority -10.

Also links it from the header nav and footer quick links, and lists it
in sitemap.xml.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 14:54:06 +03:30

49 lines
1.7 KiB
PHP

<?php
namespace App\Tests\Shared;
use App\Shared\Controller\AboutController;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
* صفحهٔ «دربارهٔ ما» رندر می‌شود و در سایت‌مپ و منو دیده می‌شود.
*
* روت `/{slug}` صفحات فرود هر مسیر تک‌بخشی را می‌گیرد؛ این تست تضمین می‌کند
* اسلاگ فارسیِ این صفحه به آن نیفتد و ۴۰۴ نشود.
*/
class AboutPageTest extends WebTestCase
{
private KernelBrowser $client;
protected function setUp(): void
{
$this->client = static::createClient();
}
public function testAboutPageRenders(): void
{
$this->client->request('GET', '/' . AboutController::SLUG);
$html = $this->client->getResponse()->getContent();
self::assertSame(200, $this->client->getResponse()->getStatusCode());
self::assertStringContainsString('<h1 class="reveal">دربارهٔ کلینیک پرو</h1>', $html);
self::assertStringContainsString('<title>دربارهٔ ما | کلینیک پرو</title>', $html);
self::assertStringContainsString('شرکت توسعه فناوری اطلاعات حامی', $html);
}
public function testHeaderLinksToAbout(): void
{
$this->client->request('GET', '/');
self::assertStringContainsString('href="/درباره-ما"', $this->client->getResponse()->getContent());
}
public function testSitemapListsAbout(): void
{
$this->client->request('GET', '/sitemap.xml');
self::assertStringContainsString(rawurlencode(AboutController::SLUG), $this->client->getResponse()->getContent());
}
}