25 lines
595 B
PHP
25 lines
595 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Tests\Controller;
|
||
|
|
|
||
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||
|
|
|
||
|
|
class SonarBadgeControllerTest extends WebTestCase
|
||
|
|
{
|
||
|
|
public function testBadgeWithValidMetric(): void
|
||
|
|
{
|
||
|
|
$client = static::createClient();
|
||
|
|
$client->request('GET', '/badge/sonar/alert_status.svg');
|
||
|
|
|
||
|
|
self::assertResponseIsSuccessful();
|
||
|
|
}
|
||
|
|
|
||
|
|
public function testBadgeWithInvalidMetric(): void
|
||
|
|
{
|
||
|
|
$client = static::createClient();
|
||
|
|
$client->request('GET', '/badge/sonar/invalid_metric.svg');
|
||
|
|
|
||
|
|
self::assertResponseStatusCodeSame(404);
|
||
|
|
}
|
||
|
|
}
|