mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Merge branch '3.x'
This commit is contained in:
commit
58f791c0f7
@ -29,7 +29,6 @@ matrix:
|
||||
|
||||
before_install:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- if [ "$SYMFONY_VERSION" == "^5.0" ]; then composer remove friendsofsymfony/rest-bundle --dev; fi;
|
||||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi;
|
||||
|
||||
install: composer update --no-interaction $COMPOSER_FLAGS
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Nelmio\ApiDocBundle\Tests\Functional;
|
||||
|
||||
use FOS\RestBundle\FOSRestBundle;
|
||||
use OpenApi\Annotations as OA;
|
||||
|
||||
class FOSRestTest extends WebTestCase
|
||||
@ -25,10 +24,6 @@ class FOSRestTest extends WebTestCase
|
||||
|
||||
public function testFOSRestAction()
|
||||
{
|
||||
if (!class_exists(FOSRestBundle::class)) {
|
||||
$this->markTestSkipped('FOSRestBundle is not installed.');
|
||||
}
|
||||
|
||||
$operation = $this->getOperation('/api/fosrest', 'post');
|
||||
|
||||
$this->assertHasParameter('foo', 'query', $operation);
|
||||
|
@ -58,12 +58,9 @@ class TestKernel extends Kernel
|
||||
new ApiPlatformBundle(),
|
||||
new NelmioApiDocBundle(),
|
||||
new TestBundle(),
|
||||
new FOSRestBundle(),
|
||||
];
|
||||
|
||||
if (class_exists(FOSRestBundle::class)) {
|
||||
$bundles[] = new FOSRestBundle();
|
||||
}
|
||||
|
||||
if ($this->useJMS) {
|
||||
$bundles[] = new JMSSerializerBundle();
|
||||
|
||||
@ -87,15 +84,12 @@ class TestKernel extends Kernel
|
||||
$routes->import('', '/api', 'api_platform');
|
||||
$routes->add('/docs/{area}', 'nelmio_api_doc.controller.swagger_ui')->setDefault('area', 'default');
|
||||
$routes->add('/docs.json', 'nelmio_api_doc.controller.swagger');
|
||||
$routes->import(__DIR__.'/Controller/FOSRestController.php', '/', 'annotation');
|
||||
|
||||
if (class_exists(SerializedName::class)) {
|
||||
$routes->import(__DIR__.'/Controller/SerializedNameController.php', '/', 'annotation');
|
||||
}
|
||||
|
||||
if (class_exists(FOSRestBundle::class)) {
|
||||
$routes->import(__DIR__.'/Controller/FOSRestController.php', '/', 'annotation');
|
||||
}
|
||||
|
||||
if ($this->useJMS) {
|
||||
$routes->import(__DIR__.'/Controller/JMSController.php', '/', 'annotation');
|
||||
}
|
||||
@ -134,6 +128,7 @@ class TestKernel extends Kernel
|
||||
|
||||
$c->loadFromExtension('twig', [
|
||||
'strict_variables' => '%kernel.debug%',
|
||||
'exception_controller' => null,
|
||||
]);
|
||||
|
||||
$c->loadFromExtension('sensio_framework_extra', [
|
||||
@ -146,7 +141,6 @@ class TestKernel extends Kernel
|
||||
'mapping' => ['paths' => ['%kernel.project_dir%/Tests/Functional/Entity']],
|
||||
]);
|
||||
|
||||
if (class_exists(FOSRestBundle::class)) {
|
||||
$c->loadFromExtension('fos_rest', [
|
||||
'format_listener' => [
|
||||
'rules' => [
|
||||
@ -157,6 +151,18 @@ class TestKernel extends Kernel
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
// If FOSRestBundle 2.8
|
||||
if (class_exists(\FOS\RestBundle\EventListener\ResponseStatusCodeListener::class)) {
|
||||
$c->loadFromExtension('fos_rest', [
|
||||
'exception' => [
|
||||
'enabled' => false,
|
||||
'exception_listener' => false,
|
||||
'serialize_exceptions' => false,
|
||||
],
|
||||
'body_listener' => false,
|
||||
'routing_loader' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter routes
|
||||
|
@ -43,7 +43,7 @@
|
||||
"doctrine/common": "^2.4",
|
||||
|
||||
"api-platform/core": "^2.4",
|
||||
"friendsofsymfony/rest-bundle": "^2.0",
|
||||
"friendsofsymfony/rest-bundle": "^2.0|^3.0@beta",
|
||||
"willdurand/hateoas-bundle": "^1.0|^2.0",
|
||||
"jms/serializer-bundle": "^2.3|^3.0",
|
||||
"jms/serializer": "^1.14|^3.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user