Files
e-ticket/tests/Controller/RobotsControllerTest.php
Serreau Jovann a9a7019a6f Fix failing controller tests: Content-Type matching, missing logo.jpg
- Use assertStringContainsString for Content-Type (Symfony adds charset)
- Create fake logo.jpg in CI for EmailTracking test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 23:04:31 +01:00

36 lines
1.1 KiB
PHP

<?php
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class RobotsControllerTest extends WebTestCase
{
public function testRobotsReturnsPlainText(): void
{
$client = static::createClient();
$client->request('GET', '/robots.txt');
self::assertResponseIsSuccessful();
self::assertStringContainsString('text/plain', $client->getResponse()->headers->get('Content-Type'));
}
public function testRobotsContainsSitemap(): void
{
$client = static::createClient();
$client->request('GET', '/robots.txt');
self::assertStringContainsString('Sitemap:', $client->getResponse()->getContent());
}
public function testRobotsContainsDisallowRules(): void
{
$client = static::createClient();
$client->request('GET', '/robots.txt');
$content = $client->getResponse()->getContent();
self::assertStringContainsString('Disallow: /external-redirect', $content);
self::assertStringContainsString('Disallow: /my-csp-report', $content);
}
}