- 21 test files covering controllers, services, entities, enums, messages - CI: add test job with Xdebug coverage (clover + text) - SonarQube: configure coverage report path and test sources Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
1.0 KiB
PHP
36 lines
1.0 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::assertResponseHeaderSame('Content-Type', 'text/plain');
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|