From e4b2d7148f9e41c9216c7b05d0ab0910fe4c60fd Mon Sep 17 00:00:00 2001 From: Dmitry Khaperets Date: Thu, 24 Dec 2020 20:47:51 +0200 Subject: [PATCH] Release 4.0.0 --- .gitignore | 4 +- .scrutinizer.yml | 24 ++- .sensiolabs.yml | 6 - .travis.yml | 27 ---- DependencyInjection/Configuration.php | 42 ------ DependencyInjection/JsonRequestExtension.php | 34 ----- Dockerfile | 10 ++ EventListener/RequestListenerInterface.php | 13 -- EventListener/RequestTransformerListener.php | 58 ------- LICENSE | 2 +- Makefile | 11 ++ README.md | 40 +++-- SymfonyBundlesJsonRequestBundle.php | 16 -- .../DependencyInjection/ConfigurationTest.php | 23 --- .../JsonRequestExtensionTest.php | 31 ---- .../RequestTransformerListenerTest.php | 141 ------------------ Tests/Fixtures/app/AppKernel.php | 47 ------ Tests/Fixtures/app/config/config_test.yml | 5 - Tests/Kernel.php | 25 ---- Tests/TestCase.php | 16 -- composer.json | 41 ++--- docker-compose.yaml | 9 ++ phpstan.neon | 5 + phpunit.xml.dist | 35 +++-- .../JsonRequestExtension.php | 20 +++ .../RequestTransformerListener.php | 35 +++++ src/JsonRequestBundle.php | 9 ++ tests/Controller/ExampleControllerTest.php | 52 +++++++ .../App/Controller/ExampleController.php | 18 +++ tests/Fixture/App/Kernel.php | 39 +++++ tests/Fixture/config/config.yml | 8 + tests/Fixture/config/routes.yml | 3 + 32 files changed, 299 insertions(+), 550 deletions(-) delete mode 100644 .sensiolabs.yml delete mode 100644 .travis.yml delete mode 100644 DependencyInjection/Configuration.php delete mode 100644 DependencyInjection/JsonRequestExtension.php create mode 100644 Dockerfile delete mode 100644 EventListener/RequestListenerInterface.php delete mode 100644 EventListener/RequestTransformerListener.php create mode 100644 Makefile delete mode 100644 SymfonyBundlesJsonRequestBundle.php delete mode 100644 Tests/DependencyInjection/ConfigurationTest.php delete mode 100644 Tests/DependencyInjection/JsonRequestExtensionTest.php delete mode 100644 Tests/EventListener/RequestTransformerListenerTest.php delete mode 100644 Tests/Fixtures/app/AppKernel.php delete mode 100644 Tests/Fixtures/app/config/config_test.yml delete mode 100644 Tests/Kernel.php delete mode 100644 Tests/TestCase.php create mode 100644 docker-compose.yaml create mode 100644 phpstan.neon create mode 100644 src/DependencyInjection/JsonRequestExtension.php create mode 100644 src/EventListener/RequestTransformerListener.php create mode 100644 src/JsonRequestBundle.php create mode 100644 tests/Controller/ExampleControllerTest.php create mode 100644 tests/Fixture/App/Controller/ExampleController.php create mode 100644 tests/Fixture/App/Kernel.php create mode 100644 tests/Fixture/config/config.yml create mode 100644 tests/Fixture/config/routes.yml diff --git a/.gitignore b/.gitignore index d1502b0..de4a392 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -vendor/ -composer.lock +/vendor +/composer.lock diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 181f653..785f35f 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,7 +1,7 @@ filter: excluded_paths: + - tests/* - vendor/* - - Tests/* checks: php: @@ -9,10 +9,20 @@ checks: duplication: true build: - tests: + environment: + redis: false + docker: true + + dependencies: override: - - - command: ./vendor/bin/phpunit --coverage-clover ./clover.xml - coverage: - file: clover.xml - format: clover + - docker-compose up -d --remove-orphans --build + - docker-compose exec -T php /usr/local/bin/php /usr/local/bin/composer install + + nodes: + coverage: + tests: + override: + - command: docker-compose run --rm -T php /usr/local/bin/php /app/vendor/bin/phpunit --coverage-clover=coverage.xml + coverage: + file: coverage.xml + format: clover diff --git a/.sensiolabs.yml b/.sensiolabs.yml deleted file mode 100644 index 99ae6c9..0000000 --- a/.sensiolabs.yml +++ /dev/null @@ -1,6 +0,0 @@ -ignore_branches: - - gh-pages - -global_exclude_dirs: - - vendor - - Tests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b92d611..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php -sudo: false - -php: - - 7.3 - -env: - - SYMFONY_VERSION=4.3.* - - SYMFONY_VERSION=4.4.* DEPENDENCIES=dev - - SYMFONY_VERSION=5.* DEPENDENCIES=dev - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - phpenv config-rm xdebug.ini || true - - phpenv rehash - - composer self-update - - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; - - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; - -install: - - composer install - -script: - - ./vendor/bin/phpunit diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php deleted file mode 100644 index f9aa9d9..0000000 --- a/DependencyInjection/Configuration.php +++ /dev/null @@ -1,42 +0,0 @@ -getRootNode(); - } else { - // BC layer for symfony/config 4.1 and older - $rootNode = $builder->root('maker'); - } - - $rootNode - ->children() - ->arrayNode('listener') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('request_transformer') - ->defaultValue(RequestTransformerListener::class) - ->end() - ->scalarNode('priority') - ->defaultValue(100) - ->end() - ->end() - ->end() - ->end(); - - return $builder; - } -} diff --git a/DependencyInjection/JsonRequestExtension.php b/DependencyInjection/JsonRequestExtension.php deleted file mode 100644 index bc9e2af..0000000 --- a/DependencyInjection/JsonRequestExtension.php +++ /dev/null @@ -1,34 +0,0 @@ -addTag('kernel.event_listener', [ - 'event' => 'kernel.request', - 'method' => 'onKernelRequest', - 'priority' => $configs['listener']['priority'], - ]); - - $container->setDefinition('sb_json_request.request_transformer', $listener); - } - - /** - * {@inheritdoc} - */ - public function getAlias() - { - return 'sb_json_request'; - } -} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0a5700e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM php:7.4-fpm-alpine + +ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN apk add git build-base php7-dev && \ + pecl -q install xdebug && \ + docker-php-ext-enable xdebug && \ + curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +WORKDIR /app diff --git a/EventListener/RequestListenerInterface.php b/EventListener/RequestListenerInterface.php deleted file mode 100644 index ba94e13..0000000 --- a/EventListener/RequestListenerInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -getRequest(); - - if (false === $this->isAvailable($request)) { - return; - } - - if (false === $this->transform($request)) { - $response = new Response('Unable to parse request.', Response::HTTP_BAD_REQUEST); - - $event->setResponse($response); - } - } - - /** - * @param Request $request - * - * @return bool - */ - private function isAvailable(Request $request): bool - { - return 'json' === $request->getContentType() && $request->getContent(); - } - - /** - * @param Request $request - * - * @return bool - */ - private function transform(Request $request): bool - { - $data = \json_decode($request->getContent(), true); - - if (\json_last_error() !== \JSON_ERROR_NONE) { - return false; - } - - if (\is_array($data)) { - $request->request->replace($data); - } - - return true; - } -} diff --git a/LICENSE b/LICENSE index 5c8be9a..2c61adf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2017 Symfony Bundles (Dmitry Khaperets) +Copyright (c) 2016-2021 Dmitry Khaperets Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6563013 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +phpunit: + docker-compose run --rm -T php /usr/local/bin/php /app/vendor/bin/phpunit + +phpstan: + docker-compose run --rm -T php /usr/local/bin/php /app/vendor/bin/phpstan analyse + +coverage: + docker-compose run --rm -T php /usr/local/bin/php /app/vendor/bin/phpunit --coverage-html=vendor/coverage + +composer-update: + docker-compose run --rm -T php /usr/local/bin/php /usr/local/bin/composer update diff --git a/README.md b/README.md index 5a6c894..0073da4 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,29 @@ -SymfonyBundles JsonRequest Bundle -================================= +Symfony JsonRequest Bundle +========================== -[![SensioLabsInsight][sensiolabs-insight-image]][sensiolabs-insight-link] - -[![Build Status][testing-image]][testing-link] [![Scrutinizer Code Quality][scrutinizer-code-quality-image]][scrutinizer-code-quality-link] [![Code Coverage][code-coverage-image]][code-coverage-link] [![Total Downloads][downloads-image]][package-link] [![Latest Stable Version][stable-image]][package-link] [![License][license-image]][license-link] +Installation +------------ + +* Require the bundle with composer: + +``` bash +composer req symfony-bundles/json-request-bundle +``` + What is JsonRequest Bundle? --------------------------- -This bundle will help you to work with json requests as standard requests without using «crutches». -If previously for fetching of data from the request you did like this: -`$data = json_decode($request->getContent())`, -it is now in this already there is no need to. +This bundle will help you to work with json requests as standard requests without using «crutches». If previously for +fetching of data from the request you did like this: +`$data = json_decode($request->getContent())`, it is now in this already there is no need to. + +For example when sending json-request from AngularJS, Vue.js or etc. Early: -For example when sending json-request from AngularJS, Vue.js or etc. -Early: ``` php public function indexAction(Request $request) { @@ -30,6 +35,7 @@ public function indexAction(Request $request) ``` Now you can work with json-request as with standard request: + ``` php public function indexAction(Request $request) { @@ -37,23 +43,11 @@ public function indexAction(Request $request) } ``` -Installation ------------- -* Require the bundle with composer: - -``` bash -composer require symfony-bundles/json-request-bundle -``` - [package-link]: https://packagist.org/packages/symfony-bundles/json-request-bundle [license-link]: https://github.com/symfony-bundles/json-request-bundle/blob/master/LICENSE [license-image]: https://poser.pugx.org/symfony-bundles/json-request-bundle/license -[testing-link]: https://travis-ci.org/symfony-bundles/json-request-bundle -[testing-image]: https://travis-ci.org/symfony-bundles/json-request-bundle.svg?branch=master [stable-image]: https://poser.pugx.org/symfony-bundles/json-request-bundle/v/stable [downloads-image]: https://poser.pugx.org/symfony-bundles/json-request-bundle/downloads -[sensiolabs-insight-link]: https://insight.sensiolabs.com/projects/dea68633-2368-4e12-a516-89157d2c6b07 -[sensiolabs-insight-image]: https://insight.sensiolabs.com/projects/dea68633-2368-4e12-a516-89157d2c6b07/big.png [code-coverage-link]: https://scrutinizer-ci.com/g/symfony-bundles/json-request-bundle/?branch=master [code-coverage-image]: https://scrutinizer-ci.com/g/symfony-bundles/json-request-bundle/badges/coverage.png?b=master [scrutinizer-code-quality-link]: https://scrutinizer-ci.com/g/symfony-bundles/json-request-bundle/?branch=master diff --git a/SymfonyBundlesJsonRequestBundle.php b/SymfonyBundlesJsonRequestBundle.php deleted file mode 100644 index c2b190f..0000000 --- a/SymfonyBundlesJsonRequestBundle.php +++ /dev/null @@ -1,16 +0,0 @@ -assertInstanceOf(ConfigurationInterface::class, $configuration); - - $configs = $processor->processConfiguration($configuration, []); - - $this->assertArraySubset([], $configs); - } -} diff --git a/Tests/DependencyInjection/JsonRequestExtensionTest.php b/Tests/DependencyInjection/JsonRequestExtensionTest.php deleted file mode 100644 index 8a0c160..0000000 --- a/Tests/DependencyInjection/JsonRequestExtensionTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertInstanceOf(Extension::class, $extension); - - $extension->load([], $container); - - $this->assertTrue($container->has($listenerService)); - } - - public function testAlias() - { - $extension = new JsonRequestExtension(); - - $this->assertStringEndsWith('json_request', $extension->getAlias()); - } -} diff --git a/Tests/EventListener/RequestTransformerListenerTest.php b/Tests/EventListener/RequestTransformerListenerTest.php deleted file mode 100644 index b045d8c..0000000 --- a/Tests/EventListener/RequestTransformerListenerTest.php +++ /dev/null @@ -1,141 +0,0 @@ -listener = new RequestTransformerListener(); - } - - /** - * @param string $contentType - * - * @dataProvider jsonContentTypes - */ - public function testTransformRequest(string $contentType): void - { - $data = ['foo' => 'bar']; - $request = $this->createRequest($contentType, \json_encode($data)); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals($data, $event->getRequest()->request->all()); - $this->assertNull($event->getResponse()); - } - - /** - * @param string $contentType - * - * @dataProvider jsonContentTypes - */ - public function testDoNotTransformRequestContainingScalarJsonValue(string $contentType): void - { - $content = \json_encode('foo'); - $request = $this->createRequest($contentType, $content); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals([], $event->getRequest()->request->all()); - $this->assertEquals($content, $event->getRequest()->getContent()); - } - - public function testBadRequestResponse(): void - { - $request = $this->createRequest('application/json', '{maaan}'); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals(400, $event->getResponse()->getStatusCode()); - } - - /** - * @param string $contentType - * - * @dataProvider notJsonContentTypes - */ - public function testNotTransformOtherContentType(string $contentType): void - { - $request = $this->createRequest($contentType, 'some=body'); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals($request, $event->getRequest()); - $this->assertNull($event->getResponse()); - } - - public function testNotReplaceRequestData(): void - { - $request = $this->createRequest('application/json', ''); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals($request, $event->getRequest()); - $this->assertNull($event->getResponse()); - } - - public function testNotReplaceRequestDataIfNullContent(): void - { - $request = $this->createRequest('application/json', 'null'); - $event = $this->createGetResponseEventMock($request); - - $this->listener->onKernelRequest($event); - - $this->assertEquals($request, $event->getRequest()); - $this->assertNull($event->getResponse()); - } - - private function createGetResponseEventMock(Request $request): RequestEvent - { - $event = $this - ->getMockBuilder(RequestEvent::class) - ->disableOriginalConstructor() - ->setMethods(['getRequest']) - ->getMock(); - - $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); - - return $event; - } - - private function createRequest(string $contentType, string $content): Request - { - $request = new Request([], [], [], [], [], [], $content); - $request->headers->set('CONTENT_TYPE', $contentType); - - return $request; - } - - public function jsonContentTypes(): array - { - return [ - ['application/json'], - ['application/x-json'], - ]; - } - - public function notJsonContentTypes(): array - { - return [ - ['application/x-www-form-urlencoded'], - ['text/html'], - ['text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'], - ]; - } -} diff --git a/Tests/Fixtures/app/AppKernel.php b/Tests/Fixtures/app/AppKernel.php deleted file mode 100644 index bb9de2e..0000000 --- a/Tests/Fixtures/app/AppKernel.php +++ /dev/null @@ -1,47 +0,0 @@ -remove($this->getCacheDir()); - } - - public function registerBundles() - { - $bundles = [ - new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), - new \SymfonyBundles\JsonRequestBundle\SymfonyBundlesJsonRequestBundle(), - ]; - - return $bundles; - } - - public function getRootDir() - { - return __DIR__; - } - - public function getCacheDir() - { - return '/tmp/symfony-cache'; - } - - public function getLogDir() - { - return '/tmp/symfony-cache'; - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->getRootDir() . '/config/config_test.yml'); - } -} diff --git a/Tests/Fixtures/app/config/config_test.yml b/Tests/Fixtures/app/config/config_test.yml deleted file mode 100644 index 819a588..0000000 --- a/Tests/Fixtures/app/config/config_test.yml +++ /dev/null @@ -1,5 +0,0 @@ -framework: - test: ~ - secret: test - session: - storage_id: session.storage.mock_file diff --git a/Tests/Kernel.php b/Tests/Kernel.php deleted file mode 100644 index c4a7173..0000000 --- a/Tests/Kernel.php +++ /dev/null @@ -1,25 +0,0 @@ -boot(); - } - - return static::$instance; - } -} diff --git a/Tests/TestCase.php b/Tests/TestCase.php deleted file mode 100644 index ab6f032..0000000 --- a/Tests/TestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -container = Kernel::make()->getContainer(); - } -} diff --git a/composer.json b/composer.json index 303ee0a..3ca9318 100644 --- a/composer.json +++ b/composer.json @@ -5,34 +5,37 @@ "keywords": ["json", "symfony", "bundle", "angular"], "homepage": "https://github.com/symfony-bundles/json-request-bundle", "license": "MIT", - "authors": [ - { - "name": "Dmitry Khaperets", - "email": "khaperets@gmail.com" - } - ], + "authors": [{"name": "Dmitry Khaperets", "email": "khaperets@gmail.com"}], "autoload": { "psr-4": { - "SymfonyBundles\\JsonRequestBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "SymfonyBundles\\JsonRequestBundle\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "SymfonyBundles\\JsonRequestBundle\\Tests\\": "tests" + } }, "require": { - "php": "^7.3", - "symfony/framework-bundle": "^4.3||^5.0" + "ext-json": "*", + "php": "^7.4 || ^8.0", + "symfony/framework-bundle": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^6.4", - "phpunit/php-code-coverage": "^5.0", - "symfony/phpunit-bridge": "^4.3||^5.0", - "symfony/yaml": "^4.3||^5.0" + "doctrine/annotations": "^1.0", + "phpstan/phpstan": "^0.12", + "phpunit/php-code-coverage": "^9.2", + "phpunit/phpunit": "^9.5", + "symfony/browser-kit": "^5.2", + "symfony/yaml": "^5.2" + }, + "config": { + "preferred-install": "dist", + "sort-packages": true }, "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "4.x-dev" } } } - diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4bdeb38 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: '3.2' + +services: + php: + build: . + volumes: + - ./:/app + environment: + - XDEBUG_MODE=coverage diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..09f2902 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 8 + paths: + - src + checkMissingIterableValueType: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c6dfc61..4c98467 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,35 @@ - - + + + + + - - ./Tests + + tests - - - ./ - - ./Tests - ./vendor - - - + + + src + + + + tests + vendor + + diff --git a/src/DependencyInjection/JsonRequestExtension.php b/src/DependencyInjection/JsonRequestExtension.php new file mode 100644 index 0000000..c16103d --- /dev/null +++ b/src/DependencyInjection/JsonRequestExtension.php @@ -0,0 +1,20 @@ +addTag('kernel.event_listener', ['event' => KernelEvents::REQUEST]); + + $container->setDefinition(RequestTransformerListener::class, $listener); + } +} diff --git a/src/EventListener/RequestTransformerListener.php b/src/EventListener/RequestTransformerListener.php new file mode 100644 index 0000000..ee0153d --- /dev/null +++ b/src/EventListener/RequestTransformerListener.php @@ -0,0 +1,35 @@ +getRequest(); + + if (false === $this->supports($request)) { + return; + } + + try { + $data = \json_decode((string) $request->getContent(), true, 512, \JSON_THROW_ON_ERROR); + + if (\is_array($data)) { + $request->request->replace($data); + } + } catch (\JsonException $exception) { + $event->setResponse(new JsonResponse(['message' => $exception->getMessage()], Response::HTTP_BAD_REQUEST)); + } + } + + private function supports(Request $request): bool + { + return 'json' === $request->getContentType() && $request->getContent(); + } +} diff --git a/src/JsonRequestBundle.php b/src/JsonRequestBundle.php new file mode 100644 index 0000000..a04e224 --- /dev/null +++ b/src/JsonRequestBundle.php @@ -0,0 +1,9 @@ + 'baz']); + + $response = $this->sendRequest($body); + + $this->assertSame($body, $response->getContent()); + } + + public function testInvalidBody(): void + { + $response = $this->sendRequest('{$body}'); + + $this->assertSame('{"message":"Syntax error"}', $response->getContent()); + $this->assertSame(Response::HTTP_BAD_REQUEST, $response->getStatusCode()); + } + + + public function testInvalidContentType(): void + { + $body = \json_encode(['foo' => 'baz']); + + $response = $this->sendRequest($body, 'application/javascript'); + + $this->assertSame('[]', $response->getContent()); + } + + /** + * @param mixed $body + * @param string $contentType + * + * @return Response + */ + private function sendRequest($body, string $contentType = 'application/json'): Response + { + $client = self::createClient(); + + $client->request(Request::METHOD_POST, '/', [], [], ['CONTENT_TYPE' => $contentType], $body); + + return $client->getResponse(); + } +} diff --git a/tests/Fixture/App/Controller/ExampleController.php b/tests/Fixture/App/Controller/ExampleController.php new file mode 100644 index 0000000..9866dff --- /dev/null +++ b/tests/Fixture/App/Controller/ExampleController.php @@ -0,0 +1,18 @@ +request->all()); + } +} diff --git a/tests/Fixture/App/Kernel.php b/tests/Fixture/App/Kernel.php new file mode 100644 index 0000000..3834285 --- /dev/null +++ b/tests/Fixture/App/Kernel.php @@ -0,0 +1,39 @@ +remove($this->getCacheDir()); + } + + protected function configureContainer(ContainerConfigurator $container): void + { + $container->import('../config/config.yml'); + } + + protected function configureRoutes(RoutingConfigurator $routes): void + { + $routes->import('../config/routes.yml'); + } +} diff --git a/tests/Fixture/config/config.yml b/tests/Fixture/config/config.yml new file mode 100644 index 0000000..86ffed4 --- /dev/null +++ b/tests/Fixture/config/config.yml @@ -0,0 +1,8 @@ +framework: + test: ~ + secret: test + +services: + SymfonyBundles\JsonRequestBundle\Tests\Fixture\App\Controller\: + resource: '../App/Controller' + tags: ['controller.service_arguments'] diff --git a/tests/Fixture/config/routes.yml b/tests/Fixture/config/routes.yml new file mode 100644 index 0000000..49731d9 --- /dev/null +++ b/tests/Fixture/config/routes.yml @@ -0,0 +1,3 @@ +app: + type: annotation + resource: ../App/Controller