mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
45 lines
1.3 KiB
PHP
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(): void
|
|
{
|
|
$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());
|
|
}
|
|
}
|
|
}
|