2012-04-13 14:11:54 +02: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.
|
|
|
|
*/
|
|
|
|
|
2012-04-13 14:22:07 +02:00
|
|
|
namespace Nelmio\ApiDocBundle\Tests\Extractor;
|
|
|
|
|
|
|
|
use Nelmio\ApiDocBundle\Tests\WebTestCase;
|
2012-04-13 14:11:54 +02:00
|
|
|
|
|
|
|
class ApiDocExtractorTest extends WebTestCase
|
|
|
|
{
|
|
|
|
public function testAll()
|
|
|
|
{
|
|
|
|
$container = $this->getContainer();
|
|
|
|
$extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor');
|
|
|
|
$data = $extractor->all();
|
|
|
|
|
|
|
|
$this->assertCount(2, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGet()
|
|
|
|
{
|
|
|
|
$container = $this->getContainer();
|
|
|
|
$extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor');
|
|
|
|
$data = $extractor->get('Nelmio\ApiDocBundle\Tests\Fixtures\Controller\TestController::indexAction', 'test_route_1');
|
|
|
|
|
|
|
|
$this->assertTrue(isset($data['route']));
|
|
|
|
$this->assertTrue(isset($data['annotation']));
|
|
|
|
}
|
|
|
|
}
|