45 lines
1.3 KiB
PHP
Raw Normal View History

2015-03-15 23:48:57 +01:00
<?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
2015-03-15 23:48:57 +01:00
{
protected function setUp(): void
2015-03-15 23:48:57 +01:00
{
if (!class_exists('Dunglas\ApiBundle\DunglasApiBundle')) {
2015-03-15 23:48:57 +01:00
$this->markTestSkipped(
'DunglasApiBundle is not available.'
2015-03-15 23:48:57 +01:00
);
}
}
public function testGetAnnotations()
{
$container = $this->getContainer();
$provider = $container->get('nelmio_api_doc.annotations_provider.dunglas_api_annotation_provider');
2015-03-15 23:48:57 +01:00
$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());
}
}
}