NelmioApiDocBundle/Tests/ApiDocGeneratorTest.php
Guilhem N 393a6c061e
Add areas support (#1169)
* Add areas support

* Document the Areas feature

* Allow to expose swagger area as JSON

* Fixes

* last fixes
2018-01-05 13:08:02 +01:00

37 lines
1023 B
PHP

<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests;
use Nelmio\ApiDocBundle\ApiDocGenerator;
use Nelmio\ApiDocBundle\Describer\DefaultDescriber;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
class ApiDocGeneratorTest extends TestCase
{
public function testCache()
{
$adapter = new ArrayAdapter();
$generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter);
$this->assertEquals($generator->generate(), $adapter->getItem('swagger_doc')->get());
}
public function testCacheWithCustomId()
{
$adapter = new ArrayAdapter();
$generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter, 'custom_id');
$this->assertEquals($generator->generate(), $adapter->getItem('custom_id')->get());
}
}