Ilyas Salikhov b603381139 1. Up min PHP version to 8.1
2. Up min Symfony verion to 5.0. Adopt code to sf 5.0+
3. Local env to run tests
4. Repare tests
2024-06-18 12:24:32 +03:00

45 lines
1.3 KiB
PHP

<?php
/*
* This file is part of the NelmioApiDocBundle.
*
* (c) Nelmio <hello@nelm.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests\Extractor\AnnotationsProvider;
use Nelmio\ApiDocBundle\Tests\WebTestCase;
/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class DunglasApiProviderTest extends WebTestCase
{
protected function setUp(): void
{
if (!class_exists('Dunglas\ApiBundle\DunglasApiBundle')) {
$this->markTestSkipped(
'DunglasApiBundle is not available.'
);
}
}
public function testGetAnnotations()
{
$container = $this->getContainer();
$provider = $container->get('nelmio_api_doc.annotations_provider.dunglas_api_annotation_provider');
$annotations = $provider->getAnnotations();
$this->assertCount(5, $annotations);
foreach ($annotations as $annotation) {
$this->assertInstanceOf('Nelmio\ApiDocBundle\Annotation\ApiDoc', $annotation);
$this->assertInstanceOf('Symfony\Component\Routing\Route', $annotation->getRoute());
$this->assertTrue('' != $annotation->getDescription());
}
}
}