diff --git a/features/admin/managing_frequently_asked_questions.feature b/features/admin/managing_frequently_asked_questions.feature index f3ebfce81..393be7045 100644 --- a/features/admin/managing_frequently_asked_questions.feature +++ b/features/admin/managing_frequently_asked_questions.feature @@ -13,7 +13,7 @@ Feature: Managing frequently asked questions Given the store has a frequently asked question When I go to the frequently asked questions page And I delete this frequently asked question - Then I should be notified that the fequently asked question has been deleted + Then I should be notified that the frequently asked question has been deleted And I should see empty list of frequently asked questions @ui diff --git a/features/shop/displaying_media.feature b/features/shop/displaying_media.feature index 00c81bec8..91c16f6e1 100644 --- a/features/shop/displaying_media.feature +++ b/features/shop/displaying_media.feature @@ -12,6 +12,6 @@ Feature: Displaying media @ui Scenario: Displaying media no standard template - And there is an existing "image" media with "media_with_parameteres" code + And there is an existing "image" media with "media_with_parameters" code When I go to the homepage - And I want to see a media with code "media_with_parameteres" \ No newline at end of file + And I want to see a media with code "media_with_parameters" diff --git a/src/Assigner/SectionsAssignerInterface.php b/src/Assigner/SectionsAssignerInterface.php index f67f40f84..ef30f7542 100644 --- a/src/Assigner/SectionsAssignerInterface.php +++ b/src/Assigner/SectionsAssignerInterface.php @@ -14,5 +14,5 @@ interface SectionsAssignerInterface { - public function assign(SectionableInterface $sectionable, array $sectionsCodes): void; + public function assign(SectionableInterface $sectionsAware, array $sectionsCodes): void; } diff --git a/src/Controller/Action/Admin/ImportDataAction.php b/src/Controller/Action/Admin/ImportDataAction.php index 704d32eac..e9164a177 100644 --- a/src/Controller/Action/Admin/ImportDataAction.php +++ b/src/Controller/Action/Admin/ImportDataAction.php @@ -26,38 +26,14 @@ final class ImportDataAction { - /** @var ImportProcessorInterface */ - private $importProcessor; - - /** @var FormFactoryInterface */ - private $formFactory; - - /** @var RequestStack */ - private $requestStack; - - /** @var FormErrorsFlashHelperInterface */ - private $formErrorsFlashHelper; - - /** @var TranslatorInterface */ - private $translator; - - /** @var Environment */ - private $twig; - public function __construct( - ImportProcessorInterface $importProcessor, - FormFactoryInterface $formFactory, - RequestStack $requestStack, - FormErrorsFlashHelperInterface $formErrorsFlashHelper, - TranslatorInterface $translator, - Environment $twig, + private ImportProcessorInterface $importProcessor, + private FormFactoryInterface $formFactory, + private RequestStack $requestStack, + private FormErrorsFlashHelperInterface $formErrorsFlashHelper, + private TranslatorInterface $translator, + private Environment $twig, ) { - $this->importProcessor = $importProcessor; - $this->formFactory = $formFactory; - $this->requestStack = $requestStack; - $this->formErrorsFlashHelper = $formErrorsFlashHelper; - $this->translator = $translator; - $this->twig = $twig; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/Admin/ProductSearchAction.php b/src/Controller/Action/Admin/ProductSearchAction.php index 0711eb890..feb882ef6 100644 --- a/src/Controller/Action/Admin/ProductSearchAction.php +++ b/src/Controller/Action/Admin/ProductSearchAction.php @@ -19,23 +19,11 @@ final class ProductSearchAction { - /** @var ProductRepositoryInterface */ - private $productRepository; - - /** @var LocaleContextInterface */ - private $localeContext; - - /** @var ViewHandler */ - private $viewHandler; - public function __construct( - ProductRepositoryInterface $productRepository, - LocaleContextInterface $localeContext, - ViewHandler $viewHandler, + private ProductRepositoryInterface $productRepository, + private LocaleContextInterface $localeContext, + private ViewHandler $viewHandler, ) { - $this->productRepository = $productRepository; - $this->localeContext = $localeContext; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/Admin/TaxonSearchAction.php b/src/Controller/Action/Admin/TaxonSearchAction.php index eeefdd9c8..8e8883700 100644 --- a/src/Controller/Action/Admin/TaxonSearchAction.php +++ b/src/Controller/Action/Admin/TaxonSearchAction.php @@ -19,23 +19,11 @@ final class TaxonSearchAction { - /** @var TaxonRepositoryInterface */ - private $taxonRepository; - - /** @var LocaleContextInterface */ - private $localeContext; - - /** @var ViewHandler */ - private $viewHandler; - public function __construct( - TaxonRepositoryInterface $taxonRepository, - LocaleContextInterface $localeContext, - ViewHandler $viewHandler, + private TaxonRepositoryInterface $taxonRepository, + private LocaleContextInterface $localeContext, + private ViewHandler $viewHandler, ) { - $this->taxonRepository = $taxonRepository; - $this->localeContext = $localeContext; - $this->viewHandler = $viewHandler; } public function __invoke(Request $request): Response diff --git a/src/Controller/Action/Admin/UploadEditorImageAction.php b/src/Controller/Action/Admin/UploadEditorImageAction.php index 198a81490..d45b500b5 100644 --- a/src/Controller/Action/Admin/UploadEditorImageAction.php +++ b/src/Controller/Action/Admin/UploadEditorImageAction.php @@ -23,23 +23,11 @@ final class UploadEditorImageAction { - /** @var MediaProviderResolverInterface */ - private $mediaProviderResolver; - - /** @var MediaRepositoryInterface */ - private $mediaRepository; - - /** @var FactoryInterface */ - private $mediaFactory; - public function __construct( - MediaProviderResolverInterface $mediaProviderResolver, - MediaRepositoryInterface $mediaRepository, - FactoryInterface $mediaFactory, + private MediaProviderResolverInterface $mediaProviderResolver, + private MediaRepositoryInterface $mediaRepository, + private FactoryInterface $mediaFactory, ) { - $this->mediaProviderResolver = $mediaProviderResolver; - $this->mediaRepository = $mediaRepository; - $this->mediaFactory = $mediaFactory; } public function __invoke(Request $request): Response diff --git a/src/Controller/Helper/FormErrorsFlashHelper.php b/src/Controller/Helper/FormErrorsFlashHelper.php index 9bcdc0233..ab03bedc8 100644 --- a/src/Controller/Helper/FormErrorsFlashHelper.php +++ b/src/Controller/Helper/FormErrorsFlashHelper.php @@ -17,16 +17,10 @@ final class FormErrorsFlashHelper implements FormErrorsFlashHelperInterface { - /** @var RequestStack */ - private $requestStack; - - /** @var TranslatorInterface */ - private $translator; - - public function __construct(RequestStack $requestStack, TranslatorInterface $translator) - { - $this->requestStack = $requestStack; - $this->translator = $translator; + public function __construct( + private RequestStack $requestStack, + private TranslatorInterface $translator, + ) { } public function addFlashErrors(FormInterface $form): void diff --git a/src/Controller/PageSlugController.php b/src/Controller/PageSlugController.php index 9fc6c94c5..2714b16aa 100755 --- a/src/Controller/PageSlugController.php +++ b/src/Controller/PageSlugController.php @@ -17,12 +17,8 @@ final class PageSlugController { - /** @var SlugGeneratorInterface */ - private $slugGenerator; - - public function __construct(SlugGeneratorInterface $slugGenerator) + public function __construct(private SlugGeneratorInterface $slugGenerator) { - $this->slugGenerator = $slugGenerator; } public function generateAction(Request $request): JsonResponse diff --git a/src/EventListener/ResourceDeleteSubscriber.php b/src/EventListener/ResourceDeleteSubscriber.php index fc7a3fcd4..cc28175f7 100644 --- a/src/EventListener/ResourceDeleteSubscriber.php +++ b/src/EventListener/ResourceDeleteSubscriber.php @@ -23,8 +23,10 @@ final class ResourceDeleteSubscriber implements EventSubscriberInterface { - public function __construct(private UrlGeneratorInterface $router, private RequestStack $requestStack) - { + public function __construct( + private UrlGeneratorInterface $router, + private RequestStack $requestStack, + ) { } public static function getSubscribedEvents(): array diff --git a/src/Form/Type/WysiwygType.php b/src/Form/Type/WysiwygType.php index d247222cf..6318c3d0a 100644 --- a/src/Form/Type/WysiwygType.php +++ b/src/Form/Type/WysiwygType.php @@ -17,12 +17,8 @@ final class WysiwygType extends AbstractType { - /** @var UrlGeneratorInterface */ - private $urlGenerator; - - public function __construct(UrlGeneratorInterface $urlGenerator) + public function __construct(private UrlGeneratorInterface $urlGenerator) { - $this->urlGenerator = $urlGenerator; } public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index feaf3e0f8..169ee6614 100755 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -2,7 +2,7 @@ imports: - { resource: "@BitBagSyliusCmsPlugin/Resources/config/resources.yml" } - { resource: "@BitBagSyliusCmsPlugin/Resources/config/fos_ck_editor/fos_ck_editor.yml" } - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/services.yml" } + - { resource: "@BitBagSyliusCmsPlugin/Resources/config/services.xml" } parameters: sylius.sitemap.path: "%kernel.project_dir%/var/sitemap" diff --git a/src/Resources/config/serializer/Entity.Media.yml b/src/Resources/config/serializer/Entity.Media.yml old mode 100755 new mode 100644 diff --git a/src/Resources/config/serializer/Entity.Section.yml b/src/Resources/config/serializer/Entity.Section.yml old mode 100755 new mode 100644 diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml new file mode 100644 index 000000000..a2879038d --- /dev/null +++ b/src/Resources/config/services.xml @@ -0,0 +1,47 @@ + + + + + + + + + BitBag\SyliusCmsPlugin\MediaProvider\ProviderInterface + + + + + + + + + + + + + + + + + + + + + + + %bitbag_sylius_cms_plugin.media_provider.interface% + Media provider + + + + + + + + + %bitbag_sylius_cms_plugin.uploader.filesystem% + + + + + diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml deleted file mode 100755 index fbc0ca5fd..000000000 --- a/src/Resources/config/services.yml +++ /dev/null @@ -1,56 +0,0 @@ -imports: - - { resource: services/twig.yml } - - { resource: services/form.yml } - - { resource: services/event_listener.yml } - - { resource: services/controller.yml } - - { resource: services/fixture.yml } - - { resource: services/importer.yml } - - { resource: services/resolver.yml } - - { resource: services/media_provider.yml } - - { resource: services/assigner.yml } - -parameters: - bitbag_sylius_cms_plugin.media_provider.interface: BitBag\SyliusCmsPlugin\MediaProvider\ProviderInterface - -services: - bitbag_sylius_cms_plugin.reader.csv: - class: BitBag\SyliusCmsPlugin\Reader\CsvReader - - bitbag_sylius_cms_plugin.processor.import: - class: BitBag\SyliusCmsPlugin\Processor\ImportProcessor - arguments: - - "@bitbag_sylius_cms_plugin.importer.chain" - - "@bitbag_sylius_cms_plugin.reader.csv" - - "@doctrine.orm.entity_manager" - - bitbag_sylius_cms_plugin.command.import_from_csv: - class: BitBag\SyliusCmsPlugin\Command\ImportFromCsvCommand - arguments: - - "@bitbag_sylius_cms_plugin.processor.import" - tags: - - { name: console.command } - - bitbag_sylius_cms_plugin.downloader.image: - class: BitBag\SyliusCmsPlugin\Downloader\ImageDownloader - arguments: - - "@filesystem" - - bitbag_sylius_cms_plugin.registry.media_provider: - class: Sylius\Component\Registry\ServiceRegistry - arguments: - - "%bitbag_sylius_cms_plugin.media_provider.interface%" - - "Media provider" - - bitbag_sylius_cms_plugin.media_uploader: - class: BitBag\SyliusCmsPlugin\Uploader\MediaUploader - arguments: - - "@bitbag_sylius_cms_plugin.media.filesystem" - - bitbag_sylius_cms_plugin.media.filesystem: - class: Gaufrette\Filesystem - factory: ['@knp_gaufrette.filesystem_map', get] - arguments: - - "%bitbag_sylius_cms_plugin.uploader.filesystem%" - - bitbag_sylius_cms_plugin.sorter.sections: - class: BitBag\SyliusCmsPlugin\Sorter\SectionsSorter diff --git a/src/Resources/config/services/assigner.xml b/src/Resources/config/services/assigner.xml new file mode 100644 index 000000000..ae5fe46c4 --- /dev/null +++ b/src/Resources/config/services/assigner.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/assigner.yml b/src/Resources/config/services/assigner.yml deleted file mode 100644 index d329e496b..000000000 --- a/src/Resources/config/services/assigner.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - bitbag_sylius_cms_plugin.assigner.channels: - class: BitBag\SyliusCmsPlugin\Assigner\ChannelsAssigner - arguments: - - "@sylius.repository.channel" - - bitbag_sylius_cms_plugin.assigner.products: - class: BitBag\SyliusCmsPlugin\Assigner\ProductsAssigner - arguments: - - "@sylius.repository.product" - - bitbag_sylius_cms_plugin.assigner.taxons: - class: BitBag\SyliusCmsPlugin\Assigner\TaxonsAssigner - arguments: - - "@sylius.repository.taxon" - - bitbag_sylius_cms_plugin.assigner.sections: - class: BitBag\SyliusCmsPlugin\Assigner\SectionsAssigner - arguments: - - "@bitbag_sylius_cms_plugin.repository.section" diff --git a/src/Resources/config/services/controller.xml b/src/Resources/config/services/controller.xml new file mode 100644 index 000000000..9f40680ed --- /dev/null +++ b/src/Resources/config/services/controller.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/controller.yml b/src/Resources/config/services/controller.yml deleted file mode 100755 index b6b96d8e3..000000000 --- a/src/Resources/config/services/controller.yml +++ /dev/null @@ -1,73 +0,0 @@ -services: - bitbag_sylius_cms_plugin.controller.page_slug: - class: BitBag\SyliusCmsPlugin\Controller\PageSlugController - public: true - arguments: - - "@sylius.generator.slug" - - bitbag_sylius_cms_plugin.controller.action.admin.product_search: - class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\ProductSearchAction - public: true - arguments: - - "@sylius.repository.product" - - "@sylius.context.locale" - - "@fos_rest.view_handler.default" - - bitbag_sylius_cms_plugin.controller.action.admin.taxon_search: - class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\TaxonSearchAction - public: true - arguments: - - "@sylius.repository.taxon" - - "@sylius.context.locale" - - "@fos_rest.view_handler.default" - - bitbag_sylius_cms_plugin.controller.action.admin.import_data: - class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\ImportDataAction - public: true - arguments: - - "@bitbag_sylius_cms_plugin.processor.import" - - "@form.factory" - - "@request_stack" - - "@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash" - - "@translator" - - "@twig" - - bitbag_sylius_cms_plugin.controller.action.admin.upload_editor_image: - class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\UploadEditorImageAction - public: true - arguments: - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - - "@bitbag_sylius_cms_plugin.repository.media" - - "@bitbag_sylius_cms_plugin.factory.media" - - bitbag_sylius_cms_plugin.controller.helper.form_errors_flash: - class: BitBag\SyliusCmsPlugin\Controller\Helper\FormErrorsFlashHelper - public: true - arguments: - - "@request_stack" - - "@translator" - - bitbag_sylius_cms_plugin.controller.media.overriden: - class: BitBag\SyliusCmsPlugin\Controller\MediaController - public: true - parent: "bitbag_sylius_cms_plugin.controller.media" - calls: - - setMediaProviderResolver: ["@bitbag_sylius_cms_plugin.resolver.media_provider"] - - setMediaResourceResolver: ["@bitbag_sylius_cms_plugin.resolver.media_resource"] - - setFormErrorsFlashHelper: ["@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash"] - - setCacheManager: ["@liip_imagine.cache.manager"] - - setDataManager: ["@liip_imagine.data.manager"] - - bitbag_sylius_cms_plugin.controller.page.overriden: - class: BitBag\SyliusCmsPlugin\Controller\PageController - public: true - parent: "bitbag_sylius_cms_plugin.controller.page" - calls: - - setPageResourceResolver: ["@bitbag_sylius_cms_plugin.resolver.page_resource"] - - setFormErrorsFlashHelper: ["@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash"] - - setCacheManager: ["@liip_imagine.cache.manager"] - - setDataManager: ["@liip_imagine.data.manager"] - - bitbag_sylius_cms_plugin.controller.action.admin.retrieve_package_info: - public: true - class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\RetrievePackageInfoAction diff --git a/src/Resources/config/services/event_listener.xml b/src/Resources/config/services/event_listener.xml new file mode 100644 index 000000000..fc6c51187 --- /dev/null +++ b/src/Resources/config/services/event_listener.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/event_listener.yml b/src/Resources/config/services/event_listener.yml deleted file mode 100755 index 812d55491..000000000 --- a/src/Resources/config/services/event_listener.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.menu.content_management: - class: BitBag\SyliusCmsPlugin\Menu\ContentManagementMenuBuilder - tags: - - { name: kernel.event_listener, event: sylius.menu.admin.main, method: buildMenu } - - bitbag_sylius_cms_plugin.event_listener.media_upload: - class: BitBag\SyliusCmsPlugin\EventListener\MediaUploadListener - arguments: - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - tags: - - { name: kernel.event_listener, event: bitbag_sylius_cms_plugin.media.pre_create, method: uploadMedia } - - { name: kernel.event_listener, event: bitbag_sylius_cms_plugin.media.pre_update, method: uploadMedia } - - bitbag_sylius.event_subscriber.resource_delete: - class: BitBag\SyliusCmsPlugin\EventListener\ResourceDeleteSubscriber - arguments: - - "@router" - - "@request_stack" - tags: - - { name: kernel.event_subscriber, event: kernel.exception } diff --git a/src/Resources/config/services/fixture.xml b/src/Resources/config/services/fixture.xml new file mode 100644 index 000000000..1b862c9ca --- /dev/null +++ b/src/Resources/config/services/fixture.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/fixture.yml b/src/Resources/config/services/fixture.yml deleted file mode 100755 index 0f1149bb7..000000000 --- a/src/Resources/config/services/fixture.yml +++ /dev/null @@ -1,89 +0,0 @@ -services: - bitbag_sylius_cms_plugin.fixture.block: - class: BitBag\SyliusCmsPlugin\Fixture\BlockFixture - arguments: - - "@bitbag_sylius_cms_plugin.fixture.factory.block" - tags: - - { name: sylius_fixtures.fixture } - - bitbag_sylius_cms_plugin.fixture.page: - class: BitBag\SyliusCmsPlugin\Fixture\PageFixture - arguments: - - "@bitbag_sylius_cms_plugin.fixture.factory.page" - tags: - - { name: sylius_fixtures.fixture } - - bitbag_sylius_cms_plugin.fixture.frequently_asked_question: - class: BitBag\SyliusCmsPlugin\Fixture\FrequentlyAskedQuestionFixture - arguments: - - "@bitbag_sylius_cms_plugin.fixture.factory.frequently_asked_question" - tags: - - { name: sylius_fixtures.fixture } - - bitbag_sylius_cms_plugin.fixture.section: - class: BitBag\SyliusCmsPlugin\Fixture\SectionFixture - arguments: - - "@bitbag_sylius_cms_plugin.fixture.factory.section" - tags: - - { name: sylius_fixtures.fixture } - - bitbag_sylius_cms_plugin.fixture.media: - class: BitBag\SyliusCmsPlugin\Fixture\MediaFixture - arguments: - - "@bitbag_sylius_cms_plugin.fixture.factory.media" - tags: - - { name: sylius_fixtures.fixture } - - bitbag_sylius_cms_plugin.fixture.factory.block: - class: BitBag\SyliusCmsPlugin\Fixture\Factory\BlockFixtureFactory - arguments: - - "@bitbag_sylius_cms_plugin.factory.block" - - "@bitbag_sylius_cms_plugin.factory.block_translation" - - "@bitbag_sylius_cms_plugin.repository.block" - - "@sylius.repository.product" - - "@sylius.context.channel" - - "@sylius.context.locale" - - "@bitbag_sylius_cms_plugin.assigner.products" - - "@bitbag_sylius_cms_plugin.assigner.taxons" - - "@bitbag_sylius_cms_plugin.assigner.sections" - - "@bitbag_sylius_cms_plugin.assigner.channels" - - bitbag_sylius_cms_plugin.fixture.factory.page: - class: BitBag\SyliusCmsPlugin\Fixture\Factory\PageFixtureFactory - arguments: - - "@bitbag_sylius_cms_plugin.factory.page" - - "@bitbag_sylius_cms_plugin.factory.page_translation" - - "@bitbag_sylius_cms_plugin.repository.page" - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - - "@bitbag_sylius_cms_plugin.assigner.products" - - "@bitbag_sylius_cms_plugin.assigner.sections" - - "@bitbag_sylius_cms_plugin.assigner.channels" - - "@sylius.repository.product" - - "@sylius.context.locale" - - "@sylius.repository.channel" - - bitbag_sylius_cms_plugin.fixture.factory.frequently_asked_question: - class: BitBag\SyliusCmsPlugin\Fixture\Factory\FrequentlyAskedQuestionFixtureFactory - arguments: - - "@bitbag_sylius_cms_plugin.factory.frequently_asked_question" - - "@bitbag_sylius_cms_plugin.factory.frequently_asked_question_translation" - - "@bitbag_sylius_cms_plugin.repository.frequently_asked_question" - - "@bitbag_sylius_cms_plugin.assigner.channels" - - bitbag_sylius_cms_plugin.fixture.factory.section: - class: BitBag\SyliusCmsPlugin\Fixture\Factory\SectionFixtureFactory - arguments: - - "@bitbag_sylius_cms_plugin.factory.section" - - "@bitbag_sylius_cms_plugin.factory.section_translation" - - "@bitbag_sylius_cms_plugin.repository.section" - - bitbag_sylius_cms_plugin.fixture.factory.media: - class: BitBag\SyliusCmsPlugin\Fixture\Factory\MediaFixtureFactory - arguments: - - "@bitbag_sylius_cms_plugin.factory.media" - - "@bitbag_sylius_cms_plugin.factory.media_translation" - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - - "@bitbag_sylius_cms_plugin.repository.media" - - "@bitbag_sylius_cms_plugin.assigner.products" - - "@bitbag_sylius_cms_plugin.assigner.sections" - - "@bitbag_sylius_cms_plugin.assigner.channels" diff --git a/src/Resources/config/services/form.xml b/src/Resources/config/services/form.xml new file mode 100644 index 000000000..70601a9ae --- /dev/null +++ b/src/Resources/config/services/form.xml @@ -0,0 +1,84 @@ + + + + + + + + %bitbag_sylius_cms_plugin.model.block.class% + %bitbag_sylius_cms_plugin.form.type.block.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.block_translation.class% + %bitbag_sylius_cms_plugin.form.type.translation.block.validation_groups% + + + + + BitBag\SyliusCmsPlugin\Entity\BlockImage + %bitbag_sylius_cms_plugin.form.type.block_image.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.page.class% + %bitbag_sylius_cms_plugin.form.type.page.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.page_translation.class% + %bitbag_sylius_cms_plugin.form.type.translation.page.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.frequently_asked_question.class% + %bitbag_sylius_cms_plugin.form.type.frequently_asked_question.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.frequently_asked_question_translation.class% + %bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.section.class% + %bitbag_sylius_cms_plugin.form.type.section.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.section_translation.class% + %bitbag_sylius_cms_plugin.form.type.translation.section.validation_groups% + + + + + + + + + %bitbag_sylius_cms_plugin.model.media_translation.class% + %bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups% + + + + + %bitbag_sylius_cms_plugin.model.media.class% + %bitbag_sylius_cms_plugin.form.type.media.validation_groups% + %bitbag_sylius_cms_plugin.media_providers% + + + + + + + + + + diff --git a/src/Resources/config/services/form.yml b/src/Resources/config/services/form.yml deleted file mode 100755 index b47173a3d..000000000 --- a/src/Resources/config/services/form.yml +++ /dev/null @@ -1,101 +0,0 @@ -services: - bitbag_sylius_cms_plugin.form.type.block: - class: BitBag\SyliusCmsPlugin\Form\Type\BlockType - arguments: - - "%bitbag_sylius_cms_plugin.model.block.class%" - - "%bitbag_sylius_cms_plugin.form.type.block.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.translation.block: - class: BitBag\SyliusCmsPlugin\Form\Type\Translation\BlockTranslationType - arguments: - - "%bitbag_sylius_cms_plugin.model.block_translation.class%" - - "%bitbag_sylius_cms_plugin.form.type.translation.block.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.block_image: - class: BitBag\SyliusCmsPlugin\Form\Type\BlockImageType - arguments: - - BitBag\SyliusCmsPlugin\Entity\BlockImage - - "%bitbag_sylius_cms_plugin.form.type.block_image.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.page: - class: BitBag\SyliusCmsPlugin\Form\Type\PageType - arguments: - - "%bitbag_sylius_cms_plugin.model.page.class%" - - "%bitbag_sylius_cms_plugin.form.type.page.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.translation.page: - class: BitBag\SyliusCmsPlugin\Form\Type\Translation\PageTranslationType - arguments: - - "%bitbag_sylius_cms_plugin.model.page_translation.class%" - - "%bitbag_sylius_cms_plugin.form.type.translation.page.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.frequently_asked_question: - class: BitBag\SyliusCmsPlugin\Form\Type\FrequentlyAskedQuestionType - arguments: - - "%bitbag_sylius_cms_plugin.model.frequently_asked_question.class%" - - "%bitbag_sylius_cms_plugin.form.type.frequently_asked_question.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question: - class: BitBag\SyliusCmsPlugin\Form\Type\Translation\FrequentlyAskedQuestionTranslationType - arguments: - - "%bitbag_sylius_cms_plugin.model.frequently_asked_question_translation.class%" - - "%bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.section: - class: BitBag\SyliusCmsPlugin\Form\Type\SectionType - arguments: - - "%bitbag_sylius_cms_plugin.model.section.class%" - - "%bitbag_sylius_cms_plugin.form.type.section.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.translation.section: - class: BitBag\SyliusCmsPlugin\Form\Type\Translation\SectionTranslationType - arguments: - - "%bitbag_sylius_cms_plugin.model.section_translation.class%" - - "%bitbag_sylius_cms_plugin.form.type.translation.section.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.import: - class: BitBag\SyliusCmsPlugin\Form\Type\ImportType - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.translation.media: - class: BitBag\SyliusCmsPlugin\Form\Type\Translation\MediaTranslationType - arguments: - - "%bitbag_sylius_cms_plugin.model.media_translation.class%" - - "%bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.media: - class: BitBag\SyliusCmsPlugin\Form\Type\MediaType - arguments: - - "%bitbag_sylius_cms_plugin.model.media.class%" - - "%bitbag_sylius_cms_plugin.form.type.media.validation_groups%" - - "%bitbag_sylius_cms_plugin.media_providers%" - tags: - - { name: form.type } - - bitbag_sylius_cms_plugin.form.type.wysiwyg: - class: BitBag\SyliusCmsPlugin\Form\Type\WysiwygType - arguments: - - "@router.default" - tags: - - { name: form.type } diff --git a/src/Resources/config/services/importer.xml b/src/Resources/config/services/importer.xml new file mode 100644 index 000000000..636f252e4 --- /dev/null +++ b/src/Resources/config/services/importer.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/importer.yml b/src/Resources/config/services/importer.yml deleted file mode 100644 index d2874b62c..000000000 --- a/src/Resources/config/services/importer.yml +++ /dev/null @@ -1,44 +0,0 @@ -services: - bitbag_sylius_cms_plugin.importer.chain: - class: BitBag\SyliusCmsPlugin\Importer\ImporterChain - - bitbag_sylius_cms_plugin.importer.page: - class: BitBag\SyliusCmsPlugin\Importer\PageImporter - arguments: - - "@bitbag_sylius_cms_plugin.resolver.resource.page" - - "@sylius.context.locale" - - "@bitbag_sylius_cms_plugin.downloader.image" - - "@bitbag_sylius_cms_plugin.factory.media" - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - - "@bitbag_sylius_cms_plugin.resolver.importer_sections" - - "@bitbag_sylius_cms_plugin.resolver.importer_channels" - - "@bitbag_sylius_cms_plugin.resolver.importer_products" - - "@validator" - - "@doctrine.orm.entity_manager" - tags: - - { name: bitbag.cmsplugin.importer } - - bitbag_sylius_cms_plugin.importer.block: - class: BitBag\SyliusCmsPlugin\Importer\BlockImporter - arguments: - - "@bitbag_sylius_cms_plugin.resolver.resource.block" - - "@sylius.context.locale" - - "@bitbag_sylius_cms_plugin.resolver.importer_sections" - - "@bitbag_sylius_cms_plugin.resolver.importer_channels" - - "@bitbag_sylius_cms_plugin.resolver.importer_products" - - "@validator" - - "@bitbag_sylius_cms_plugin.repository.block" - tags: - - { name: bitbag.cmsplugin.importer } - - bitbag_sylius_cms_plugin.importer.media: - class: BitBag\SyliusCmsPlugin\Importer\MediaImporter - arguments: - - "@bitbag_sylius_cms_plugin.resolver.resource.media" - - "@sylius.context.locale" - - "@bitbag_sylius_cms_plugin.resolver.importer_sections" - - "@bitbag_sylius_cms_plugin.resolver.importer_products" - - "@validator" - - "@bitbag_sylius_cms_plugin.repository.media" - tags: - - { name: bitbag.cmsplugin.importer } diff --git a/src/Resources/config/services/media_provider.xml b/src/Resources/config/services/media_provider.xml new file mode 100644 index 000000000..52f284517 --- /dev/null +++ b/src/Resources/config/services/media_provider.xml @@ -0,0 +1,31 @@ + + + + + + + + + + @BitBagSyliusCmsPlugin/Shop/Media/Show/image.html.twig + media/image + + + + + + + @BitBagSyliusCmsPlugin/Shop/Media/Show/video.html.twig + media/video + + + + + + + @BitBagSyliusCmsPlugin/Shop/Media/Show/file.html.twig + media/file + + + + diff --git a/src/Resources/config/services/media_provider.yml b/src/Resources/config/services/media_provider.yml deleted file mode 100644 index c3b5a12c5..000000000 --- a/src/Resources/config/services/media_provider.yml +++ /dev/null @@ -1,30 +0,0 @@ -services: - bitbag_sylius_cms_plugin.media_provider.image: - class: BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider - arguments: - - "@bitbag_sylius_cms_plugin.media_uploader" - - "@twig" - - "@@BitBagSyliusCmsPlugin/Shop/Media/Show/image.html.twig" - - "media/image" - tags: - - { name: bitbag_sylius_cms_plugin.media_provider, type: image, label: bitbag_sylius_cms_plugin.ui.image_provider } - - bitbag_sylius_cms_plugin.media_provider.video: - class: BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider - arguments: - - "@bitbag_sylius_cms_plugin.media_uploader" - - "@twig" - - "@@BitBagSyliusCmsPlugin/Shop/Media/Show/video.html.twig" - - "media/video" - tags: - - { name: bitbag_sylius_cms_plugin.media_provider, type: video, label: bitbag_sylius_cms_plugin.ui.video_provider } - - bitbag_sylius_cms_plugin.media_provider.file: - class: BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider - arguments: - - "@bitbag_sylius_cms_plugin.media_uploader" - - "@twig" - - "@@BitBagSyliusCmsPlugin/Shop/Media/Show/file.html.twig" - - "media/file" - tags: - - { name: bitbag_sylius_cms_plugin.media_provider, type: file, label: bitbag_sylius_cms_plugin.ui.file_provider } diff --git a/src/Resources/config/services/resolver.xml b/src/Resources/config/services/resolver.xml new file mode 100644 index 000000000..6fce6c8a0 --- /dev/null +++ b/src/Resources/config/services/resolver.xml @@ -0,0 +1,66 @@ + + + + + + + + + + code + + + + + + code + + + + + + code + + + + + + code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/resolver.yml b/src/Resources/config/services/resolver.yml deleted file mode 100644 index ca512634a..000000000 --- a/src/Resources/config/services/resolver.yml +++ /dev/null @@ -1,74 +0,0 @@ -services: - bitbag_sylius_cms_plugin.resolver.resource.page: - class: BitBag\SyliusCmsPlugin\Resolver\ResourceResolver - arguments: - - "@bitbag_sylius_cms_plugin.repository.page" - - "@bitbag_sylius_cms_plugin.factory.page" - - "code" - - bitbag_sylius_cms_plugin.resolver.resource.section: - class: BitBag\SyliusCmsPlugin\Resolver\ResourceResolver - arguments: - - "@bitbag_sylius_cms_plugin.repository.section" - - "@bitbag_sylius_cms_plugin.factory.section" - - "code" - - bitbag_sylius_cms_plugin.resolver.resource.block: - class: BitBag\SyliusCmsPlugin\Resolver\ResourceResolver - arguments: - - "@bitbag_sylius_cms_plugin.repository.block" - - "@bitbag_sylius_cms_plugin.factory.block" - - "code" - - bitbag_sylius_cms_plugin.resolver.resource.media: - class: BitBag\SyliusCmsPlugin\Resolver\ResourceResolver - arguments: - - "@bitbag_sylius_cms_plugin.repository.media" - - "@bitbag_sylius_cms_plugin.factory.media" - - "code" - - bitbag_sylius_cms_plugin.resolver.block_resource: - class: BitBag\SyliusCmsPlugin\Resolver\BlockResourceResolver - public: true - arguments: - - "@bitbag_sylius_cms_plugin.repository.block" - - "@logger" - - "@sylius.context.channel" - - bitbag_sylius_cms_plugin.resolver.page_resource: - class: BitBag\SyliusCmsPlugin\Resolver\PageResourceResolver - public: true - arguments: - - "@bitbag_sylius_cms_plugin.repository.page" - - "@sylius.context.locale" - - "@logger" - - bitbag_sylius_cms_plugin.resolver.media_resource: - class: BitBag\SyliusCmsPlugin\Resolver\MediaResourceResolver - public: true - arguments: - - "@bitbag_sylius_cms_plugin.repository.media" - - "@sylius.context.locale" - - "@sylius.context.channel" - - "@logger" - - bitbag_sylius_cms_plugin.resolver.media_provider: - class: BitBag\SyliusCmsPlugin\Resolver\MediaProviderResolver - public: true - arguments: - - "@bitbag_sylius_cms_plugin.registry.media_provider" - - bitbag_sylius_cms_plugin.resolver.importer_sections: - class: BitBag\SyliusCmsPlugin\Resolver\ImporterSectionsResolver - arguments: - - "@bitbag_sylius_cms_plugin.assigner.sections" - - bitbag_sylius_cms_plugin.resolver.importer_channels: - class: BitBag\SyliusCmsPlugin\Resolver\ImporterChannelsResolver - arguments: - - "@bitbag_sylius_cms_plugin.assigner.channels" - - bitbag_sylius_cms_plugin.resolver.importer_products: - class: BitBag\SyliusCmsPlugin\Resolver\ImporterProductsResolver - arguments: - - "@bitbag_sylius_cms_plugin.assigner.products" diff --git a/src/Resources/config/services/twig.xml b/src/Resources/config/services/twig.xml new file mode 100644 index 000000000..7ab15a413 --- /dev/null +++ b/src/Resources/config/services/twig.xml @@ -0,0 +1,76 @@ + + + + + + bitbag_cms_render_block + bitbag_cms_render_media + + @BitBagSyliusCmsPlugin/Page/link.html.twig + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %bitbag_cms.twig.admin_functions% + + + + + + + + + + + %bitbag_cms.twig.link_template% + + + + diff --git a/src/Resources/config/services/twig.yml b/src/Resources/config/services/twig.yml deleted file mode 100755 index 90dd7ffc7..000000000 --- a/src/Resources/config/services/twig.yml +++ /dev/null @@ -1,86 +0,0 @@ -parameters: - bitbag_cms.twig.admin_functions: - - bitbag_cms_render_block - - bitbag_cms_render_media - bitbag_cms.twig.link_template: "@@BitBagSyliusCmsPlugin/Page/link.html.twig" - -services: - bitbag_sylius_cms_plugin.twig.extension.block: - class: BitBag\SyliusCmsPlugin\Twig\Extension\RenderBlockExtension - arguments: - - "@bitbag_sylius_cms_plugin.twig.runtime.block" - tags: - - { name: twig.extension } - - bitbag_sylius_cms_plugin.twig.runtime.block: - class: BitBag\SyliusCmsPlugin\Twig\Runtime\RenderBlockRuntime - arguments: - - "@bitbag_sylius_cms_plugin.resolver.block_resource" - - "@twig" - tags: - - { name: twig.runtime } - - bitbag_sylius_cms_plugin.twig.extension.media: - class: BitBag\SyliusCmsPlugin\Twig\Extension\RenderMediaExtension - arguments: - - "@bitbag_sylius_cms_plugin.twig.runtime.media" - tags: - - { name: twig.extension } - - bitbag_sylius_cms_plugin.twig.runtime.media: - class: BitBag\SyliusCmsPlugin\Twig\Runtime\RenderMediaRuntime - arguments: - - "@bitbag_sylius_cms_plugin.resolver.media_provider" - - "@bitbag_sylius_cms_plugin.resolver.media_resource" - tags: - - { name: twig.runtime } - - bitbag_sylius_cms_plugin.twig.extension.product_pages: - class: BitBag\SyliusCmsPlugin\Twig\Extension\RenderProductPagesExtension - arguments: - - "@bitbag_sylius_cms_plugin.twig.runtime.product_pages" - tags: - - { name: twig.extension } - - bitbag_sylius_cms_plugin.twig.runtime.product_pages: - class: BitBag\SyliusCmsPlugin\Twig\Runtime\RenderProductPagesRuntime - arguments: - - "@bitbag_sylius_cms_plugin.repository.page" - - "@sylius.context.channel" - - "@twig" - - "@bitbag_sylius_cms_plugin.sorter.sections" - tags: - - { name: twig.runtime } - - bitbag_sylius_cms_plugin.twig.extension.render_content: - class: BitBag\SyliusCmsPlugin\Twig\Extension\RenderContentExtension - tags: - - { name: twig.extension } - - bitbag_sylius_cms_plugin.twig.runtime.render_content: - class: BitBag\SyliusCmsPlugin\Twig\Runtime\RenderContentRuntime - arguments: - - "@bitbag_sylius_cms_plugin.twig.parser.content" - tags: - - { name: twig.runtime } - - bitbag_sylius_cms_plugin.twig.parser.content: - class: BitBag\SyliusCmsPlugin\Twig\Parser\ContentParser - arguments: - - "@twig" - - "%bitbag_cms.twig.admin_functions%" - - bitbag_sylius_cms_plugin.twig.extension.render_link: - class: BitBag\SyliusCmsPlugin\Twig\Extension\RenderLinkExtension - tags: - - { name: twig.extension } - - bitbag_sylius_cms_plugin.twig.runtime.render_link: - class: BitBag\SyliusCmsPlugin\Twig\Runtime\RenderLinkRuntime - arguments: - - "@sylius.context.locale" - - "@bitbag_sylius_cms_plugin.repository.page" - - "@router.default" - - "%bitbag_cms.twig.link_template%" - tags: - - { name: twig.runtime } diff --git a/src/Resources/config/validation/Block.xml b/src/Resources/config/validation/Block.xml new file mode 100644 index 000000000..26e369571 --- /dev/null +++ b/src/Resources/config/validation/Block.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/Block.yml b/src/Resources/config/validation/Block.yml deleted file mode 100755 index 65bab367c..000000000 --- a/src/Resources/config/validation/Block.yml +++ /dev/null @@ -1,23 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\Block: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [code] - groups: ['bitbag'] - message: 'bitbag_sylius_cms_plugin.block.code.unique' - properties: - code: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.block.code.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - max: 250 - minMessage: 'bitbag_sylius_cms_plugin.block.code.min_length' - maxMessage: 'bitbag_sylius_cms_plugin.block.code.max_length' - groups: ['bitbag'] - - Regex: - pattern: '/^[\w-]*$/' - message: 'bitbag_sylius_cms_plugin.block.code.regex' - groups: [ 'bitbag' ] - translations: - - Valid: ~ diff --git a/src/Resources/config/validation/BlockTranslation.xml b/src/Resources/config/validation/BlockTranslation.xml new file mode 100644 index 000000000..bd3e547f1 --- /dev/null +++ b/src/Resources/config/validation/BlockTranslation.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/BlockTranslation.yml b/src/Resources/config/validation/BlockTranslation.yml deleted file mode 100755 index 9d8fd8d42..000000000 --- a/src/Resources/config/validation/BlockTranslation.yml +++ /dev/null @@ -1,21 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\BlockTranslation: - properties: - name: - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.block.name.min_length - maxMessage: bitbag_sylius_cms_plugin.block.name.max_length - groups: ['bitbag'] - link: - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.block.link.min_length - maxMessage: bitbag_sylius_cms_plugin.block.link.max_length - groups: ['bitbag'] - content: - - Length: - min: 2 - minMessage: bitbag_sylius_cms_plugin.block.content.min_length - groups: ['bitbag'] diff --git a/src/Resources/config/validation/FrequentlyAskedQuestion.xml b/src/Resources/config/validation/FrequentlyAskedQuestion.xml new file mode 100644 index 000000000..ead67ad2c --- /dev/null +++ b/src/Resources/config/validation/FrequentlyAskedQuestion.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/FrequentlyAskedQuestion.yml b/src/Resources/config/validation/FrequentlyAskedQuestion.yml deleted file mode 100755 index 75b4b1808..000000000 --- a/src/Resources/config/validation/FrequentlyAskedQuestion.yml +++ /dev/null @@ -1,29 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [position] - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.position.unique' - groups: ['bitbag'] - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [code] - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.code.unique' - groups: ['bitbag'] - properties: - code: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.code.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - minMessage: 'bitbag_sylius_cms_plugin.frequently_asked_question.code.min_length' - groups: ['bitbag'] - - Regex: - pattern: '/^[\w-]*$/' - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.code.regex' - groups: [ 'bitbag' ] - position: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.position.not_blank' - groups: ['bitbag'] - translations: - - Valid: ~ diff --git a/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml b/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml new file mode 100644 index 000000000..8bc83fdcf --- /dev/null +++ b/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.yml b/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.yml deleted file mode 100755 index 934d3b2bc..000000000 --- a/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.yml +++ /dev/null @@ -1,18 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation: - properties: - question: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.question.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - minMessage: 'bitbag_sylius_cms_plugin.frequently_asked_question.question.min_length' - groups: ['bitbag'] - answer: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.frequently_asked_question.answer.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - minMessage: 'bitbag_sylius_cms_plugin.frequently_asked_question.answer.min_length' - groups: ['bitbag'] diff --git a/src/Resources/config/validation/Media.xml b/src/Resources/config/validation/Media.xml new file mode 100644 index 000000000..e7c2f4e1e --- /dev/null +++ b/src/Resources/config/validation/Media.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/Media.yml b/src/Resources/config/validation/Media.yml deleted file mode 100755 index 54d8eeb30..000000000 --- a/src/Resources/config/validation/Media.yml +++ /dev/null @@ -1,33 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\Media: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [code] - groups: ['bitbag'] - message: 'bitbag_sylius_cms_plugin.media.code.unique' - - BitBag\SyliusCmsPlugin\Validator\Constraint\FileMatchesType: - groups: [ 'bitbag' ] - messageImage: 'bitbag_sylius_cms_plugin.media.file.type_image' - messageVideo: 'bitbag_sylius_cms_plugin.media.file.type_video' - field: 'type' - properties: - code: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.media.code.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - max: 250 - minMessage: 'bitbag_sylius_cms_plugin.media.code.min_length' - maxMessage: 'bitbag_sylius_cms_plugin.media.code.max_length' - groups: ['bitbag'] - - Regex: - pattern: '/^[\w-]*$/' - message: 'bitbag_sylius_cms_plugin.media.code.regex' - groups: [ 'bitbag' ] - file: - - Expression: - expression: '!(this.getPath() == null and this.getFile() == null)' - message: 'bitbag_sylius_cms_plugin.media.file.not_blank' - groups: ['bitbag'] - translations: - - Valid: ~ diff --git a/src/Resources/config/validation/MediaTranslation.xml b/src/Resources/config/validation/MediaTranslation.xml new file mode 100644 index 000000000..1e3495124 --- /dev/null +++ b/src/Resources/config/validation/MediaTranslation.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/MediaTranslation.yml b/src/Resources/config/validation/MediaTranslation.yml deleted file mode 100755 index 1421772eb..000000000 --- a/src/Resources/config/validation/MediaTranslation.yml +++ /dev/null @@ -1,29 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\MediaTranslation: - properties: - name: - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.media.name.min_length - maxMessage: bitbag_sylius_cms_plugin.media.name.max_length - groups: [bitbag] - alt: - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.media.alt.min_length - maxMessage: bitbag_sylius_cms_plugin.media.alt.max_length - groups: [bitbag] - link: - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.media.link.min_length - maxMessage: bitbag_sylius_cms_plugin.media.link.max_length - groups: [bitbag] - content: - - Length: - min: 2 - minMessage: bitbag_sylius_cms_plugin.media.content.min_length - maxMessage: bitbag_sylius_cms_plugin.media.content.max_length - groups: [bitbag] diff --git a/src/Resources/config/validation/Page.xml b/src/Resources/config/validation/Page.xml new file mode 100644 index 000000000..5cf0e3316 --- /dev/null +++ b/src/Resources/config/validation/Page.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/Page.yml b/src/Resources/config/validation/Page.yml deleted file mode 100755 index c8c54ab33..000000000 --- a/src/Resources/config/validation/Page.yml +++ /dev/null @@ -1,23 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\Page: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [code] - message: 'bitbag_sylius_cms_plugin.page.code.unique' - groups: ['bitbag'] - properties: - code: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.page.code.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - max: 250 - minMessage: 'bitbag_sylius_cms_plugin.page.code.min_length' - maxMessage: 'bitbag_sylius_cms_plugin.page.code.max_length' - groups: ['bitbag'] - - Regex: - pattern: '/^[\w-]*$/' - message: 'bitbag_sylius_cms_plugin.page.code.regex' - groups: [ 'bitbag' ] - translations: - - Valid: ~ diff --git a/src/Resources/config/validation/PageTranslation.xml b/src/Resources/config/validation/PageTranslation.xml new file mode 100644 index 000000000..cd4f86842 --- /dev/null +++ b/src/Resources/config/validation/PageTranslation.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/PageTranslation.yml b/src/Resources/config/validation/PageTranslation.yml deleted file mode 100755 index 0c166e06e..000000000 --- a/src/Resources/config/validation/PageTranslation.yml +++ /dev/null @@ -1,50 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\PageTranslation: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [slug, locale] - errorPath: slug - groups: [bitbag] - message: bitbag_sylius_cms_plugin.page.slug.unique - properties: - name: - - NotBlank: - message: bitbag_sylius_cms_plugin.page.name.not_blank - groups: [bitbag] - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.page.name.min_length - maxMessage: bitbag_sylius_cms_plugin.page.name.max_length - groups: [bitbag] - slug: - - NotBlank: - message: bitbag_sylius_cms_plugin.page.slug.not_blank - groups: [bitbag] - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.page.slug.min_length - maxMessage: bitbag_sylius_cms_plugin.page.slug.max_length - groups: [bitbag] - metaKeywords: - - Length: - min: 2 - max: 1000 - minMessage: bitbag_sylius_cms_plugin.page.meta_keywords.min_length - maxMessage: bitbag_sylius_cms_plugin.page.meta_keywords.max_length - groups: [bitbag] - metaDescription: - - Length: - min: 2 - max: 5000 - minMessage: bitbag_sylius_cms_plugin.page.meta_description.min_length - maxMessage: bitbag_sylius_cms_plugin.page.meta_description.max_length - groups: [bitbag] - content: - - NotBlank: - message: bitbag_sylius_cms_plugin.page.content.not_blank - groups: [bitbag] - - Length: - min: 2 - minMessage: bitbag_sylius_cms_plugin.page.content.min_length - groups: [bitbag] diff --git a/src/Resources/config/validation/Section.xml b/src/Resources/config/validation/Section.xml new file mode 100644 index 000000000..a9034efda --- /dev/null +++ b/src/Resources/config/validation/Section.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/Section.yml b/src/Resources/config/validation/Section.yml deleted file mode 100755 index c13f41001..000000000 --- a/src/Resources/config/validation/Section.yml +++ /dev/null @@ -1,23 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\Section: - constraints: - - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: - fields: [code] - message: 'bitbag_sylius_cms_plugin.section.code.unique' - groups: ['bitbag'] - properties: - code: - - NotBlank: - message: 'bitbag_sylius_cms_plugin.section.code.not_blank' - groups: ['bitbag'] - - Length: - min: 2 - max: 250 - minMessage: 'bitbag_sylius_cms_plugin.section.code.min_length' - maxMessage: 'bitbag_sylius_cms_plugin.section.code.max_length' - groups: ['bitbag'] - - Regex: - pattern: '/^[\w-]*$/' - message: 'bitbag_sylius_cms_plugin.section.code.regex' - groups: ['bitbag'] - translations: - - Valid: ~ diff --git a/src/Resources/config/validation/SectionTranslation.xml b/src/Resources/config/validation/SectionTranslation.xml new file mode 100644 index 000000000..4c1bd58cc --- /dev/null +++ b/src/Resources/config/validation/SectionTranslation.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/config/validation/SectionTranslation.yml b/src/Resources/config/validation/SectionTranslation.yml deleted file mode 100755 index 50a2d23bd..000000000 --- a/src/Resources/config/validation/SectionTranslation.yml +++ /dev/null @@ -1,12 +0,0 @@ -BitBag\SyliusCmsPlugin\Entity\SectionTranslation: - properties: - name: - - NotBlank: - message: bitbag_sylius_cms_plugin.section.name.not_blank - groups: [bitbag] - - Length: - min: 2 - max: 250 - minMessage: bitbag_sylius_cms_plugin.section.name.min_length - maxMessage: bitbag_sylius_cms_plugin.section.name.max_length - groups: [bitbag] diff --git a/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml b/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml index 6853a167b..12b0a714b 100644 --- a/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml +++ b/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml @@ -203,7 +203,7 @@ sylius_fixtures: - "666F_boyfriend_jeans_with_rips" - "727F_patched_cropped_jeans" - "111F_patched_jeans_with_fancy_badges" - media_with_parameteres: + media_with_parameters: channels: - "FASHION_WEB" type: image diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml index a925faa16..7eada644f 100644 --- a/tests/Application/config/services_test.yaml +++ b/tests/Application/config/services_test.yaml @@ -1,3 +1,3 @@ imports: - - { resource: "../../Behat/Resources/services.yml" } + - { resource: "../../Behat/Resources/services.xml" } - { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } diff --git a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig index 31a8922d4..ab008b882 100755 --- a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig +++ b/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig @@ -33,7 +33,7 @@
- {{ bitbag_cms_render_media('media_with_parameteres', "examples/media_custom_template.html.twig")}} + {{ bitbag_cms_render_media('media_with_parameters', "examples/media_custom_template.html.twig")}}
diff --git a/tests/Behat/Context/Api/BlockContext.php b/tests/Behat/Context/Api/BlockContext.php index 836397c95..588f4b147 100644 --- a/tests/Behat/Context/Api/BlockContext.php +++ b/tests/Behat/Context/Api/BlockContext.php @@ -18,16 +18,10 @@ final class BlockContext implements Context { - private ApiClientInterface $apiClient; - - private ResponseCheckerInterface $responseChecker; - public function __construct( - ApiClientInterface $apiClient, - ResponseCheckerInterface $responseChecker, + private ApiClientInterface $apiClient, + private ResponseCheckerInterface $responseChecker, ) { - $this->apiClient = $apiClient; - $this->responseChecker = $responseChecker; } /** diff --git a/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php index ce03e0538..c431078e1 100644 --- a/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php +++ b/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php @@ -19,16 +19,10 @@ final class FrequentlyAskedQuestionContext implements Context { - private ApiClientInterface $apiClient; - - private ResponseCheckerInterface $responseChecker; - public function __construct( - ApiClientInterface $apiClient, - ResponseCheckerInterface $responseChecker, + private ApiClientInterface $apiClient, + private ResponseCheckerInterface $responseChecker, ) { - $this->apiClient = $apiClient; - $this->responseChecker = $responseChecker; } /** diff --git a/tests/Behat/Context/Api/MediaContext.php b/tests/Behat/Context/Api/MediaContext.php index 463f7741e..6f6788c18 100644 --- a/tests/Behat/Context/Api/MediaContext.php +++ b/tests/Behat/Context/Api/MediaContext.php @@ -19,16 +19,10 @@ final class MediaContext implements Context { - private ApiClientInterface $apiClient; - - private ResponseCheckerInterface $responseChecker; - public function __construct( - ApiClientInterface $apiClient, - ResponseCheckerInterface $responseChecker, + private ApiClientInterface $apiClient, + private ResponseCheckerInterface $responseChecker, ) { - $this->apiClient = $apiClient; - $this->responseChecker = $responseChecker; } /** diff --git a/tests/Behat/Context/Api/PageContext.php b/tests/Behat/Context/Api/PageContext.php index f4c3c37dd..30c1e85d1 100644 --- a/tests/Behat/Context/Api/PageContext.php +++ b/tests/Behat/Context/Api/PageContext.php @@ -20,16 +20,10 @@ final class PageContext implements Context { - private ApiClientInterface $apiClient; - - private ResponseCheckerInterface $responseChecker; - public function __construct( - ApiClientInterface $apiClient, - ResponseCheckerInterface $responseChecker, + private ApiClientInterface $apiClient, + private ResponseCheckerInterface $responseChecker, ) { - $this->apiClient = $apiClient; - $this->responseChecker = $responseChecker; } /** diff --git a/tests/Behat/Context/Api/SectionContext.php b/tests/Behat/Context/Api/SectionContext.php index a13e610eb..076874ab0 100644 --- a/tests/Behat/Context/Api/SectionContext.php +++ b/tests/Behat/Context/Api/SectionContext.php @@ -19,16 +19,10 @@ final class SectionContext implements Context { - private ApiClientInterface $apiClient; - - private ResponseCheckerInterface $responseChecker; - public function __construct( - ApiClientInterface $apiClient, - ResponseCheckerInterface $responseChecker, + private ApiClientInterface $apiClient, + private ResponseCheckerInterface $responseChecker, ) { - $this->apiClient = $apiClient; - $this->responseChecker = $responseChecker; } /** diff --git a/tests/Behat/Context/Setup/BlockContext.php b/tests/Behat/Context/Setup/BlockContext.php index 68804109c..0d25adb70 100755 --- a/tests/Behat/Context/Setup/BlockContext.php +++ b/tests/Behat/Context/Setup/BlockContext.php @@ -20,28 +20,12 @@ final class BlockContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var FactoryInterface */ - private $blockFactory; - - /** @var BlockRepositoryInterface */ - private $blockRepository; - public function __construct( - SharedStorageInterface $sharedStorage, - RandomStringGeneratorInterface $randomStringGenerator, - FactoryInterface $blockFactory, - BlockRepositoryInterface $blockRepository, + private SharedStorageInterface $sharedStorage, + private RandomStringGeneratorInterface $randomStringGenerator, + private FactoryInterface $blockFactory, + private BlockRepositoryInterface $blockRepository, ) { - $this->sharedStorage = $sharedStorage; - $this->randomStringGenerator = $randomStringGenerator; - $this->blockFactory = $blockFactory; - $this->blockRepository = $blockRepository; } /** diff --git a/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php index c7f7ac1b2..46cd7b725 100755 --- a/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php +++ b/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php @@ -20,30 +20,14 @@ final class FrequentlyAskedQuestionContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var FactoryInterface */ - private $frequentlyAskedQuestionFactory; - public function __construct( - SharedStorageInterface $sharedStorage, - RandomStringGeneratorInterface $randomStringGenerator, - FactoryInterface $frequentlyAskedQuestionFactory, - FrequentlyAskedQuestionRepositoryInterface $frequentlyAskedQuestionRepository, + private SharedStorageInterface $sharedStorage, + private RandomStringGeneratorInterface $randomStringGenerator, + private FactoryInterface $frequentlyAskedQuestionFactory, + private FrequentlyAskedQuestionRepositoryInterface $frequentlyAskedQuestionRepository, ) { - $this->sharedStorage = $sharedStorage; - $this->randomStringGenerator = $randomStringGenerator; - $this->frequentlyAskedQuestionFactory = $frequentlyAskedQuestionFactory; - $this->frequentlyAskedQuestionRepository = $frequentlyAskedQuestionRepository; } - /** @var FrequentlyAskedQuestionRepositoryInterface */ - private $frequentlyAskedQuestionRepository; - /** * @Given the store has a frequently asked question */ diff --git a/tests/Behat/Context/Setup/MediaContext.php b/tests/Behat/Context/Setup/MediaContext.php index 3d856a233..3de6ea4a5 100755 --- a/tests/Behat/Context/Setup/MediaContext.php +++ b/tests/Behat/Context/Setup/MediaContext.php @@ -13,60 +13,22 @@ use Behat\Behat\Context\Context; use BitBag\SyliusCmsPlugin\Entity\MediaInterface; use BitBag\SyliusCmsPlugin\Repository\MediaRepositoryInterface; -use BitBag\SyliusCmsPlugin\Repository\SectionRepositoryInterface; use BitBag\SyliusCmsPlugin\Resolver\MediaProviderResolverInterface; -use Doctrine\ORM\EntityManagerInterface; use Sylius\Behat\Service\SharedStorageInterface; use Sylius\Component\Core\Model\ChannelInterface; -use Sylius\Component\Core\Repository\ProductRepositoryInterface; use Sylius\Component\Resource\Factory\FactoryInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; use Tests\BitBag\SyliusCmsPlugin\Behat\Service\RandomStringGeneratorInterface; final class MediaContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var FactoryInterface */ - private $mediaFactory; - - /** @var MediaRepositoryInterface */ - private $mediaRepository; - - /** @var EntityManagerInterface */ - private $entityManager; - - /** @var ProductRepositoryInterface */ - private $productRepository; - - /** @var SectionRepositoryInterface */ - private $sectionRepository; - - /** @var MediaProviderResolverInterface */ - private $mediaProviderResolver; - public function __construct( - SharedStorageInterface $sharedStorage, - RandomStringGeneratorInterface $randomStringGenerator, - FactoryInterface $mediaFactory, - MediaRepositoryInterface $mediaRepository, - EntityManagerInterface $entityManager, - ProductRepositoryInterface $productRepository, - SectionRepositoryInterface $sectionRepository, - MediaProviderResolverInterface $mediaProviderResolver, + private SharedStorageInterface $sharedStorage, + private RandomStringGeneratorInterface $randomStringGenerator, + private FactoryInterface $mediaFactory, + private MediaRepositoryInterface $mediaRepository, + private MediaProviderResolverInterface $mediaProviderResolver, ) { - $this->sharedStorage = $sharedStorage; - $this->randomStringGenerator = $randomStringGenerator; - $this->mediaFactory = $mediaFactory; - $this->mediaRepository = $mediaRepository; - $this->entityManager = $entityManager; - $this->productRepository = $productRepository; - $this->sectionRepository = $sectionRepository; - $this->mediaProviderResolver = $mediaProviderResolver; } /** diff --git a/tests/Behat/Context/Setup/PageContext.php b/tests/Behat/Context/Setup/PageContext.php index 044be81eb..d0314dffd 100755 --- a/tests/Behat/Context/Setup/PageContext.php +++ b/tests/Behat/Context/Setup/PageContext.php @@ -28,48 +28,16 @@ final class PageContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var FactoryInterface */ - private $pageFactory; - - /** @var PageRepositoryInterface */ - private $pageRepository; - - /** @var EntityManagerInterface */ - private $entityManager; - - /** @var ProductRepositoryInterface */ - private $productRepository; - - /** @var SectionRepositoryInterface */ - private $sectionRepository; - - /** @var ProviderInterface */ - private $imageProvider; - public function __construct( - SharedStorageInterface $sharedStorage, - RandomStringGeneratorInterface $randomStringGenerator, - FactoryInterface $pageFactory, - PageRepositoryInterface $pageRepository, - EntityManagerInterface $entityManager, - ProductRepositoryInterface $productRepository, - SectionRepositoryInterface $sectionRepository, - ProviderInterface $imageProvider, + private SharedStorageInterface $sharedStorage, + private RandomStringGeneratorInterface $randomStringGenerator, + private FactoryInterface $pageFactory, + private PageRepositoryInterface $pageRepository, + private EntityManagerInterface $entityManager, + private ProductRepositoryInterface $productRepository, + private SectionRepositoryInterface $sectionRepository, + private ProviderInterface $imageProvider, ) { - $this->sharedStorage = $sharedStorage; - $this->randomStringGenerator = $randomStringGenerator; - $this->pageFactory = $pageFactory; - $this->pageRepository = $pageRepository; - $this->entityManager = $entityManager; - $this->productRepository = $productRepository; - $this->sectionRepository = $sectionRepository; - $this->imageProvider = $imageProvider; } /** diff --git a/tests/Behat/Context/Setup/SectionContext.php b/tests/Behat/Context/Setup/SectionContext.php index 6b824993a..3721813e5 100755 --- a/tests/Behat/Context/Setup/SectionContext.php +++ b/tests/Behat/Context/Setup/SectionContext.php @@ -20,30 +20,14 @@ final class SectionContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var FactoryInterface */ - private $sectionFactory; - public function __construct( - SharedStorageInterface $sharedStorage, - RandomStringGeneratorInterface $randomStringGenerator, - FactoryInterface $sectionFactory, - SectionRepositoryInterface $sectionRepository, + private SharedStorageInterface $sharedStorage, + private RandomStringGeneratorInterface $randomStringGenerator, + private FactoryInterface $sectionFactory, + private SectionRepositoryInterface $sectionRepository, ) { - $this->sharedStorage = $sharedStorage; - $this->randomStringGenerator = $randomStringGenerator; - $this->sectionFactory = $sectionFactory; - $this->sectionRepository = $sectionRepository; } - /** @var SectionRepositoryInterface */ - private $sectionRepository; - /** * @Given there is a section in the store */ diff --git a/tests/Behat/Context/Transform/BlockContext.php b/tests/Behat/Context/Transform/BlockContext.php index 81d8e1db2..ea177a624 100644 --- a/tests/Behat/Context/Transform/BlockContext.php +++ b/tests/Behat/Context/Transform/BlockContext.php @@ -17,16 +17,10 @@ final class BlockContext implements Context { - /** @var BlockRepositoryInterface */ - private $blockRepository; - - /** @var string */ - private $locale; - - public function __construct(BlockRepositoryInterface $blockRepository, string $locale = 'en_US') - { - $this->blockRepository = $blockRepository; - $this->locale = $locale; + public function __construct( + private BlockRepositoryInterface $blockRepository, + private string $locale = 'en_US', + ) { } /** diff --git a/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php index 6a0264086..6c836d251 100644 --- a/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php +++ b/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php @@ -17,13 +17,9 @@ final class FrequentlyAskedQuestionContext implements Context { - /** @var FrequentlyAskedQuestionRepositoryInterface */ - private $frequentlyAskedQuestionRepository; - public function __construct( - FrequentlyAskedQuestionRepositoryInterface $frequentlyAskedQuestionRepository, + private FrequentlyAskedQuestionRepositoryInterface $frequentlyAskedQuestionRepository, ) { - $this->frequentlyAskedQuestionRepository = $frequentlyAskedQuestionRepository; } /** diff --git a/tests/Behat/Context/Transform/MediaContext.php b/tests/Behat/Context/Transform/MediaContext.php index 484d7b322..896d88b41 100644 --- a/tests/Behat/Context/Transform/MediaContext.php +++ b/tests/Behat/Context/Transform/MediaContext.php @@ -18,18 +18,10 @@ final class MediaContext implements Context { - /** @var MediaRepositoryInterface */ - private $mediaRepositoryInterface; - - /** @var SharedStorageInterface */ - private $sharedStorage; - public function __construct( - MediaRepositoryInterface $mediaRepositoryInterface, - SharedStorageInterface $sharedStorage, + private MediaRepositoryInterface $mediaRepositoryInterface, + private SharedStorageInterface $sharedStorage, ) { - $this->mediaRepositoryInterface = $mediaRepositoryInterface; - $this->sharedStorage = $sharedStorage; } /** diff --git a/tests/Behat/Context/Transform/PageContext.php b/tests/Behat/Context/Transform/PageContext.php index 752e98db3..2de812ab4 100644 --- a/tests/Behat/Context/Transform/PageContext.php +++ b/tests/Behat/Context/Transform/PageContext.php @@ -17,16 +17,10 @@ final class PageContext implements Context { - /** @var PageRepositoryInterface */ - private $pageRepository; - - /** @var string */ - private $locale; - - public function __construct(PageRepositoryInterface $pageRepository, string $locale = 'en_US') - { - $this->pageRepository = $pageRepository; - $this->locale = $locale; + public function __construct( + private PageRepositoryInterface $pageRepository, + private string $locale = 'en_US', + ) { } /** diff --git a/tests/Behat/Context/Transform/SectionContext.php b/tests/Behat/Context/Transform/SectionContext.php index a857f1f12..461cad274 100644 --- a/tests/Behat/Context/Transform/SectionContext.php +++ b/tests/Behat/Context/Transform/SectionContext.php @@ -17,16 +17,10 @@ final class SectionContext implements Context { - /** @var SectionRepositoryInterface */ - private $sectionRepository; - - /** @var string */ - private $locale; - - public function __construct(SectionRepositoryInterface $sectionRepository, string $locale = 'en_US') - { - $this->sectionRepository = $sectionRepository; - $this->locale = $locale; + public function __construct( + private SectionRepositoryInterface $sectionRepository, + private string $locale = 'en_US', + ) { } /** diff --git a/tests/Behat/Context/Ui/Admin/BlockContext.php b/tests/Behat/Context/Ui/Admin/BlockContext.php index 6e723a55f..67959e2cf 100755 --- a/tests/Behat/Context/Ui/Admin/BlockContext.php +++ b/tests/Behat/Context/Ui/Admin/BlockContext.php @@ -25,48 +25,16 @@ final class BlockContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var CurrentPageResolverInterface */ - private $currentPageResolver; - - /** @var NotificationCheckerInterface */ - private $notificationChecker; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var CreatePageInterface */ - private $createPage; - - /** @var UpdatePageInterface */ - private $updatePage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - - /** @var BlockRepositoryInterface */ - private $blockRepository; - public function __construct( - SharedStorageInterface $sharedStorage, - CurrentPageResolverInterface $currentPageResolver, - NotificationCheckerInterface $notificationChecker, - IndexPageInterface $indexPage, - CreatePageInterface $createPage, - UpdatePageInterface $updatePage, - RandomStringGeneratorInterface $randomStringGenerator, - BlockRepositoryInterface $blockRepository, + private SharedStorageInterface $sharedStorage, + private CurrentPageResolverInterface $currentPageResolver, + private NotificationCheckerInterface $notificationChecker, + private IndexPageInterface $indexPage, + private CreatePageInterface $createPage, + private UpdatePageInterface $updatePage, + private RandomStringGeneratorInterface $randomStringGenerator, + private BlockRepositoryInterface $blockRepository, ) { - $this->sharedStorage = $sharedStorage; - $this->currentPageResolver = $currentPageResolver; - $this->notificationChecker = $notificationChecker; - $this->indexPage = $indexPage; - $this->createPage = $createPage; - $this->updatePage = $updatePage; - $this->randomStringGenerator = $randomStringGenerator; - $this->blockRepository = $blockRepository; } /** diff --git a/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php index b12e17efc..defc5b025 100755 --- a/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php +++ b/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php @@ -24,43 +24,15 @@ final class FrequentlyAskedQuestionContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var CurrentPageResolverInterface */ - private $currentPageResolver; - - /** @var NotificationCheckerInterface */ - private $notificationChecker; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var CreatePageInterface */ - private $createPage; - - /** @var UpdatePageInterface */ - private $updatePage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - public function __construct( - SharedStorageInterface $sharedStorage, - CurrentPageResolverInterface $currentPageResolver, - NotificationCheckerInterface $notificationChecker, - IndexPageInterface $indexPage, - CreatePageInterface $createPage, - UpdatePageInterface $updatePage, - RandomStringGeneratorInterface $randomStringGenerator, + private SharedStorageInterface $sharedStorage, + private CurrentPageResolverInterface $currentPageResolver, + private NotificationCheckerInterface $notificationChecker, + private IndexPageInterface $indexPage, + private CreatePageInterface $createPage, + private UpdatePageInterface $updatePage, + private RandomStringGeneratorInterface $randomStringGenerator, ) { - $this->sharedStorage = $sharedStorage; - $this->currentPageResolver = $currentPageResolver; - $this->notificationChecker = $notificationChecker; - $this->indexPage = $indexPage; - $this->createPage = $createPage; - $this->updatePage = $updatePage; - $this->randomStringGenerator = $randomStringGenerator; } /** @@ -164,7 +136,7 @@ public function iShouldBeNotifiedThatANewFrequentlyAskedQuestionHasBeenCreated() } /** - * @Then I should be notified that the fequently asked question has been deleted + * @Then I should be notified that the frequently asked question has been deleted */ public function iShouldBeNotifiedThatTheFrequentlyAskedQuestionHasBeenDeleted(): void { diff --git a/tests/Behat/Context/Ui/Admin/MediaContext.php b/tests/Behat/Context/Ui/Admin/MediaContext.php index 41819fd30..d4800a777 100755 --- a/tests/Behat/Context/Ui/Admin/MediaContext.php +++ b/tests/Behat/Context/Ui/Admin/MediaContext.php @@ -11,12 +11,10 @@ namespace Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin; use Behat\Behat\Context\Context; -use BitBag\SyliusCmsPlugin\Repository\MediaRepositoryInterface; use FriendsOfBehat\PageObjectExtension\Page\SymfonyPageInterface; use Sylius\Behat\NotificationType; use Sylius\Behat\Service\NotificationCheckerInterface; use Sylius\Behat\Service\Resolver\CurrentPageResolverInterface; -use Sylius\Behat\Service\SharedStorageInterface; use Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\CreatePageInterface; use Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\IndexPageInterface; use Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\UpdatePageInterface; @@ -25,48 +23,14 @@ final class MediaContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var CurrentPageResolverInterface */ - private $currentPageResolver; - - /** @var NotificationCheckerInterface */ - private $notificationChecker; - - /** @var MediaRepositoryInterface */ - private $mediaRepository; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var CreatePageInterface */ - private $createPage; - - /** @var UpdatePageInterface */ - private $updatePage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - public function __construct( - SharedStorageInterface $sharedStorage, - CurrentPageResolverInterface $currentPageResolver, - NotificationCheckerInterface $notificationChecker, - IndexPageInterface $indexPage, - CreatePageInterface $createPage, - UpdatePageInterface $updatePage, - RandomStringGeneratorInterface $randomStringGenerator, - MediaRepositoryInterface $mediaRepository, + private CurrentPageResolverInterface $currentPageResolver, + private NotificationCheckerInterface $notificationChecker, + private IndexPageInterface $indexPage, + private CreatePageInterface $createPage, + private UpdatePageInterface $updatePage, + private RandomStringGeneratorInterface $randomStringGenerator, ) { - $this->sharedStorage = $sharedStorage; - $this->currentPageResolver = $currentPageResolver; - $this->notificationChecker = $notificationChecker; - $this->indexPage = $indexPage; - $this->createPage = $createPage; - $this->updatePage = $updatePage; - $this->randomStringGenerator = $randomStringGenerator; - $this->mediaRepository = $mediaRepository; } /** diff --git a/tests/Behat/Context/Ui/Admin/PageContext.php b/tests/Behat/Context/Ui/Admin/PageContext.php index 11b808a75..24307a15c 100755 --- a/tests/Behat/Context/Ui/Admin/PageContext.php +++ b/tests/Behat/Context/Ui/Admin/PageContext.php @@ -25,48 +25,16 @@ final class PageContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var CurrentPageResolverInterface */ - private $currentPageResolver; - - /** @var NotificationCheckerInterface */ - private $notificationChecker; - - /** @var PageRepositoryInterface */ - private $pageRepository; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var CreatePageInterface */ - private $createPage; - - /** @var UpdatePageInterface */ - private $updatePage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - public function __construct( - SharedStorageInterface $sharedStorage, - CurrentPageResolverInterface $currentPageResolver, - NotificationCheckerInterface $notificationChecker, - IndexPageInterface $indexPage, - CreatePageInterface $createPage, - UpdatePageInterface $updatePage, - RandomStringGeneratorInterface $randomStringGenerator, - PageRepositoryInterface $pageRepository, + private SharedStorageInterface $sharedStorage, + private CurrentPageResolverInterface $currentPageResolver, + private NotificationCheckerInterface $notificationChecker, + private IndexPageInterface $indexPage, + private CreatePageInterface $createPage, + private UpdatePageInterface $updatePage, + private RandomStringGeneratorInterface $randomStringGenerator, + private PageRepositoryInterface $pageRepository, ) { - $this->sharedStorage = $sharedStorage; - $this->currentPageResolver = $currentPageResolver; - $this->notificationChecker = $notificationChecker; - $this->indexPage = $indexPage; - $this->createPage = $createPage; - $this->updatePage = $updatePage; - $this->randomStringGenerator = $randomStringGenerator; - $this->pageRepository = $pageRepository; } /** diff --git a/tests/Behat/Context/Ui/Admin/SectionContext.php b/tests/Behat/Context/Ui/Admin/SectionContext.php index 43518855a..1c80d1ceb 100755 --- a/tests/Behat/Context/Ui/Admin/SectionContext.php +++ b/tests/Behat/Context/Ui/Admin/SectionContext.php @@ -24,43 +24,15 @@ final class SectionContext implements Context { - /** @var SharedStorageInterface */ - private $sharedStorage; - - /** @var CurrentPageResolverInterface */ - private $currentPageResolver; - - /** @var NotificationCheckerInterface */ - private $notificationChecker; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var CreatePageInterface */ - private $createPage; - - /** @var UpdatePageInterface */ - private $updatePage; - - /** @var RandomStringGeneratorInterface */ - private $randomStringGenerator; - public function __construct( - SharedStorageInterface $sharedStorage, - CurrentPageResolverInterface $currentPageResolver, - NotificationCheckerInterface $notificationChecker, - IndexPageInterface $indexPage, - CreatePageInterface $createPage, - UpdatePageInterface $updatePage, - RandomStringGeneratorInterface $randomStringGenerator, + private SharedStorageInterface $sharedStorage, + private CurrentPageResolverInterface $currentPageResolver, + private NotificationCheckerInterface $notificationChecker, + private IndexPageInterface $indexPage, + private CreatePageInterface $createPage, + private UpdatePageInterface $updatePage, + private RandomStringGeneratorInterface $randomStringGenerator, ) { - $this->sharedStorage = $sharedStorage; - $this->currentPageResolver = $currentPageResolver; - $this->notificationChecker = $notificationChecker; - $this->indexPage = $indexPage; - $this->createPage = $createPage; - $this->updatePage = $updatePage; - $this->randomStringGenerator = $randomStringGenerator; } /** diff --git a/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php index bb4f75a08..201344a53 100755 --- a/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php +++ b/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php @@ -16,12 +16,8 @@ final class FrequentlyAskedQuestionContext implements Context { - /** @var IndexPageInterface */ - private $indexPage; - - public function __construct(IndexPageInterface $indexPage) + public function __construct(private IndexPageInterface $indexPage) { - $this->indexPage = $indexPage; } /** diff --git a/tests/Behat/Context/Ui/Shop/HomepageBlocksContext.php b/tests/Behat/Context/Ui/Shop/HomepageBlocksContext.php index 78f6b5456..22aed16d9 100755 --- a/tests/Behat/Context/Ui/Shop/HomepageBlocksContext.php +++ b/tests/Behat/Context/Ui/Shop/HomepageBlocksContext.php @@ -16,12 +16,8 @@ final class HomepageBlocksContext implements Context { - /** @var HomePageInterface */ - private $blockHomePage; - - public function __construct(HomePageInterface $blockHomePage) + public function __construct(private HomePageInterface $blockHomePage) { - $this->blockHomePage = $blockHomePage; } /** diff --git a/tests/Behat/Context/Ui/Shop/MediaContext.php b/tests/Behat/Context/Ui/Shop/MediaContext.php index 21f86a950..8a63fd2fd 100644 --- a/tests/Behat/Context/Ui/Shop/MediaContext.php +++ b/tests/Behat/Context/Ui/Shop/MediaContext.php @@ -15,22 +15,12 @@ use Behat\Mink\Element\DocumentElement; use Behat\MinkExtension\Context\RawMinkContext; use BitBag\SyliusCmsPlugin\Repository\MediaRepositoryInterface; -use Tests\BitBag\SyliusCmsPlugin\Behat\Page\Shop\HomePageInterface; class MediaContext extends RawMinkContext implements Context { - /** @var MediaRepositoryInterface */ - private $mediaRepository; - - /** @var HomePageInterface */ - private $blockHomePage; - public function __construct( - MediaRepositoryInterface $mediaRepository, - HomePageInterface $blockHomePage, + private MediaRepositoryInterface $mediaRepository, ) { - $this->mediaRepository = $mediaRepository; - $this->blockHomePage = $blockHomePage; } /** diff --git a/tests/Behat/Context/Ui/Shop/PageContext.php b/tests/Behat/Context/Ui/Shop/PageContext.php index f0b5cc837..b5663034d 100755 --- a/tests/Behat/Context/Ui/Shop/PageContext.php +++ b/tests/Behat/Context/Ui/Shop/PageContext.php @@ -18,23 +18,11 @@ final class PageContext implements Context { - /** @var ShowPageInterface */ - private $showPage; - - /** @var IndexPageInterface */ - private $indexPage; - - /** @var SharedStorageInterface */ - private $sharedStorage; - public function __construct( - ShowPageInterface $showPage, - IndexPageInterface $indexPage, - SharedStorageInterface $sharedStorage, + private ShowPageInterface $showPage, + private IndexPageInterface $indexPage, + private SharedStorageInterface $sharedStorage, ) { - $this->showPage = $showPage; - $this->indexPage = $indexPage; - $this->sharedStorage = $sharedStorage; } /** diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml new file mode 100644 index 000000000..5ac3b08aa --- /dev/null +++ b/tests/Behat/Resources/services.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/tests/Behat/Resources/services.yml b/tests/Behat/Resources/services.yml deleted file mode 100755 index 57d86579b..000000000 --- a/tests/Behat/Resources/services.yml +++ /dev/null @@ -1,8 +0,0 @@ -imports: - - { resource: "services/contexts.yml" } - - { resource: "services/pages.yml" } - - { resource: "services/api.yml" } - -services: - bitbag_sylius_cms_plugin.behat.random_string_generator: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Service\RandomStringGenerator diff --git a/tests/Behat/Resources/services/api.xml b/tests/Behat/Resources/services/api.xml new file mode 100644 index 000000000..a925620b4 --- /dev/null +++ b/tests/Behat/Resources/services/api.xml @@ -0,0 +1,27 @@ + + + + + + + + shop/cms-plugin + + + + shop/cms-plugin + + + + shop/cms-plugin + + + + shop/cms-plugin + + + + shop/cms-plugin + + + diff --git a/tests/Behat/Resources/services/api.yml b/tests/Behat/Resources/services/api.yml deleted file mode 100644 index 8d1c85733..000000000 --- a/tests/Behat/Resources/services/api.yml +++ /dev/null @@ -1,30 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.api_platform_client.shop.block: - class: Sylius\Behat\Client\ApiPlatformClient - parent: sylius.behat.api_platform_client - arguments: - - 'shop/cms-plugin' - - bitbag_sylius_cms_plugin.behat.api_platform_client.shop.frequently_asked_question: - class: Sylius\Behat\Client\ApiPlatformClient - parent: sylius.behat.api_platform_client - arguments: - - 'shop/cms-plugin' - - bitbag_sylius_cms_plugin.behat.api_platform_client.shop.media: - class: Sylius\Behat\Client\ApiPlatformClient - parent: sylius.behat.api_platform_client - arguments: - - 'shop/cms-plugin' - - bitbag_sylius_cms_plugin.behat.api_platform_client.shop.page: - class: Sylius\Behat\Client\ApiPlatformClient - parent: sylius.behat.api_platform_client - arguments: - - 'shop/cms-plugin' - - bitbag_sylius_cms_plugin.behat.api_platform_client.shop.section: - class: Sylius\Behat\Client\ApiPlatformClient - parent: sylius.behat.api_platform_client - arguments: - - 'shop/cms-plugin' diff --git a/tests/Behat/Resources/services/contexts.xml b/tests/Behat/Resources/services/contexts.xml new file mode 100644 index 000000000..b1c0d3182 --- /dev/null +++ b/tests/Behat/Resources/services/contexts.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/Behat/Resources/services/contexts.yml b/tests/Behat/Resources/services/contexts.yml deleted file mode 100755 index af12f4fb4..000000000 --- a/tests/Behat/Resources/services/contexts.yml +++ /dev/null @@ -1,5 +0,0 @@ -imports: - - { resource: contexts/setup.yml } - - { resource: contexts/ui.yml } - - { resource: contexts/api.yml } - - { resource: contexts/transform.yml } diff --git a/tests/Behat/Resources/services/contexts/api.xml b/tests/Behat/Resources/services/contexts/api.xml new file mode 100644 index 000000000..518fc0fc2 --- /dev/null +++ b/tests/Behat/Resources/services/contexts/api.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Behat/Resources/services/contexts/api.yml b/tests/Behat/Resources/services/contexts/api.yml deleted file mode 100755 index 8b0cddf40..000000000 --- a/tests/Behat/Resources/services/contexts/api.yml +++ /dev/null @@ -1,32 +0,0 @@ -services: - _defaults: { public: true } - - bitbag_sylius_cms_plugin.behat.context.api.block: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Api\BlockContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.api_platform_client.shop.block" - - "@Sylius\\Behat\\Client\\ResponseCheckerInterface" - - bitbag_sylius_cms_plugin.behat.context.api.frequently_asked_question: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Api\FrequentlyAskedQuestionContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.api_platform_client.shop.frequently_asked_question" - - "@Sylius\\Behat\\Client\\ResponseCheckerInterface" - - bitbag_sylius_cms_plugin.behat.context.api.media: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Api\MediaContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.api_platform_client.shop.media" - - "@Sylius\\Behat\\Client\\ResponseCheckerInterface" - - bitbag_sylius_cms_plugin.behat.context.api.page: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Api\PageContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.api_platform_client.shop.page" - - "@Sylius\\Behat\\Client\\ResponseCheckerInterface" - - bitbag_sylius_cms_plugin.behat.context.api.section: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Api\SectionContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.api_platform_client.shop.section" - - "@Sylius\\Behat\\Client\\ResponseCheckerInterface" diff --git a/tests/Behat/Resources/services/contexts/setup.xml b/tests/Behat/Resources/services/contexts/setup.xml new file mode 100644 index 000000000..1d30199f2 --- /dev/null +++ b/tests/Behat/Resources/services/contexts/setup.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Behat/Resources/services/contexts/setup.yml b/tests/Behat/Resources/services/contexts/setup.yml deleted file mode 100755 index f4a0a5afa..000000000 --- a/tests/Behat/Resources/services/contexts/setup.yml +++ /dev/null @@ -1,50 +0,0 @@ -services: - _defaults: { public: true } - - bitbag_sylius_cms_plugin.behat.context.setup.block: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Setup\BlockContext - arguments: - - "@sylius.behat.shared_storage" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.factory.block" - - "@bitbag_sylius_cms_plugin.repository.block" - - bitbag_sylius_cms_plugin.behat.context.setup.page: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Setup\PageContext - arguments: - - "@sylius.behat.shared_storage" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.factory.page" - - "@bitbag_sylius_cms_plugin.repository.page" - - "@doctrine.orm.entity_manager" - - "@sylius.repository.product" - - "@bitbag_sylius_cms_plugin.repository.section" - - "@bitbag_sylius_cms_plugin.media_provider.image" - - bitbag_sylius_cms_plugin.behat.context.setup.frequently_asked_question: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Setup\FrequentlyAskedQuestionContext - arguments: - - "@sylius.behat.shared_storage" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.factory.frequently_asked_question" - - "@bitbag_sylius_cms_plugin.repository.frequently_asked_question" - - bitbag_sylius_cms_plugin.behat.context.setup.section: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Setup\SectionContext - arguments: - - "@sylius.behat.shared_storage" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.factory.section" - - "@bitbag_sylius_cms_plugin.repository.section" - - bitbag_sylius_cms_plugin.behat.context.setup.media: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Setup\MediaContext - arguments: - - "@sylius.behat.shared_storage" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.factory.media" - - "@bitbag_sylius_cms_plugin.repository.media" - - "@doctrine.orm.entity_manager" - - "@sylius.repository.product" - - "@bitbag_sylius_cms_plugin.repository.section" - - "@bitbag_sylius_cms_plugin.resolver.media_provider" diff --git a/tests/Behat/Resources/services/contexts/transform.xml b/tests/Behat/Resources/services/contexts/transform.xml new file mode 100644 index 000000000..57acb102b --- /dev/null +++ b/tests/Behat/Resources/services/contexts/transform.xml @@ -0,0 +1,31 @@ + + + + + + + + + %locale% + + + + + + + + + + + + + + %locale% + + + + + %locale% + + + diff --git a/tests/Behat/Resources/services/contexts/transform.yml b/tests/Behat/Resources/services/contexts/transform.yml deleted file mode 100644 index 848d7c05c..000000000 --- a/tests/Behat/Resources/services/contexts/transform.yml +++ /dev/null @@ -1,31 +0,0 @@ -services: - _defaults: { public: true } - - bitbag_sylius_cms_plugin.behat.context.transform.block: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Transform\BlockContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.block" - - "%locale%" - - bitbag_sylius_cms_plugin.behat.context.transform.frequently_asked_question: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Transform\FrequentlyAskedQuestionContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.frequently_asked_question" - - bitbag_sylius_cms_plugin.behat.context.transform.media: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Transform\MediaContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.media" - - '@sylius.behat.shared_storage' - - bitbag_sylius_cms_plugin.behat.context.transform.page: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Transform\PageContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.page" - - "%locale%" - - bitbag_sylius_cms_plugin.behat.context.transform.section: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Transform\SectionContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.section" - - "%locale%" diff --git a/tests/Behat/Resources/services/contexts/ui.xml b/tests/Behat/Resources/services/contexts/ui.xml new file mode 100644 index 000000000..ce646296a --- /dev/null +++ b/tests/Behat/Resources/services/contexts/ui.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Behat/Resources/services/contexts/ui.yml b/tests/Behat/Resources/services/contexts/ui.yml deleted file mode 100755 index 25f64809b..000000000 --- a/tests/Behat/Resources/services/contexts/ui.yml +++ /dev/null @@ -1,83 +0,0 @@ -services: - _defaults: { public: true } - - bitbag_sylius_cms_plugin.behat.context.ui.admin.block: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin\BlockContext - arguments: - - "@sylius.behat.shared_storage" - - "@sylius.behat.current_page_resolver" - - "@sylius.behat.notification_checker" - - "@bitbag_sylius_cms_plugin.behat.page.admin.block.index" - - "@bitbag_sylius_cms_plugin.behat.page.admin.block.create" - - "@bitbag_sylius_cms_plugin.behat.page.admin.block.update" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.repository.block" - - bitbag_sylius_cms_plugin.behat.context.ui.admin.page: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin\PageContext - arguments: - - "@sylius.behat.shared_storage" - - "@sylius.behat.current_page_resolver" - - "@sylius.behat.notification_checker" - - "@bitbag_sylius_cms_plugin.behat.page.admin.page.index" - - "@bitbag_sylius_cms_plugin.behat.page.admin.page.create" - - "@bitbag_sylius_cms_plugin.behat.page.admin.page.update" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.repository.page" - - bitbag_sylius_cms_plugin.behat.context.ui.admin.frequently_asked_question: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin\FrequentlyAskedQuestionContext - arguments: - - "@sylius.behat.shared_storage" - - "@sylius.behat.current_page_resolver" - - "@sylius.behat.notification_checker" - - "@bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.index" - - "@bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.create" - - "@bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.update" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - bitbag_sylius_cms_plugin.behat.context.ui.admin.section: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin\SectionContext - arguments: - - "@sylius.behat.shared_storage" - - "@sylius.behat.current_page_resolver" - - "@sylius.behat.notification_checker" - - "@bitbag_sylius_cms_plugin.behat.page.admin.section.index" - - "@bitbag_sylius_cms_plugin.behat.page.admin.section.create" - - "@bitbag_sylius_cms_plugin.behat.page.admin.section.update" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - bitbag_sylius_cms_plugin.behat.context.ui.shop.homepage_blocks: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Shop\HomepageBlocksContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.page.shop.home" - - bitbag_sylius_cms_plugin.behat.context.ui.shop.page: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Shop\PageContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.page.shop.page.show" - - "@bitbag_sylius_cms_plugin.behat.page.shop.page.index" - - "@sylius.behat.shared_storage" - - bitbag_sylius_cms_plugin.behat.context.ui.shop.frequently_asked_question: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Shop\FrequentlyAskedQuestionContext - arguments: - - "@bitbag_sylius_cms_plugin.behat.page.shop.frequently_asked_question.index" - - bitbag_sylius_cms_plugin.behat.context.ui.admin.media: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Admin\MediaContext - arguments: - - "@sylius.behat.shared_storage" - - "@sylius.behat.current_page_resolver" - - "@sylius.behat.notification_checker" - - "@bitbag_sylius_cms_plugin.behat.page.admin.media.index" - - "@bitbag_sylius_cms_plugin.behat.page.admin.media.create" - - "@bitbag_sylius_cms_plugin.behat.page.admin.media.update" - - "@bitbag_sylius_cms_plugin.behat.random_string_generator" - - "@bitbag_sylius_cms_plugin.repository.media" - - - bitbag_sylius_cms_plugin.behat.context.ui.shop.media: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Context\Ui\Shop\MediaContext - arguments: - - "@bitbag_sylius_cms_plugin.repository.media" - - "@bitbag_sylius_cms_plugin.behat.page.shop.home" \ No newline at end of file diff --git a/tests/Behat/Resources/services/pages.xml b/tests/Behat/Resources/services/pages.xml new file mode 100644 index 000000000..b93f3d9d6 --- /dev/null +++ b/tests/Behat/Resources/services/pages.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + behat.mink.default_session + behat.mink.parameters + + + diff --git a/tests/Behat/Resources/services/pages.yml b/tests/Behat/Resources/services/pages.yml deleted file mode 100755 index 7e412ce81..000000000 --- a/tests/Behat/Resources/services/pages.yml +++ /dev/null @@ -1,8 +0,0 @@ -imports: - - { resource: "pages/admin.yml" } - - { resource: "pages/shop.yml" } -services: - bitbag_sylius_cms_plugin.behat.page: - class: FriendsOfBehat\PageObjectExtension\Page\Page - arguments: - [ 'behat.mink.default_session', 'behat.mink.parameters' ] diff --git a/tests/Behat/Resources/services/pages/admin.xml b/tests/Behat/Resources/services/pages/admin.xml new file mode 100644 index 000000000..b7c554614 --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/Behat/Resources/services/pages/admin.yml b/tests/Behat/Resources/services/pages/admin.yml deleted file mode 100755 index 81e110116..000000000 --- a/tests/Behat/Resources/services/pages/admin.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: "admin/block.yml" } - - { resource: "admin/page.yml" } - - { resource: "admin/frequently_asked_question.yml" } - - { resource: "admin/section.yml" } - - { resource: "admin/media.yml" } diff --git a/tests/Behat/Resources/services/pages/admin/block.xml b/tests/Behat/Resources/services/pages/admin/block.xml new file mode 100644 index 000000000..6e3d7720f --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin/block.xml @@ -0,0 +1,19 @@ + + + + + + + + bitbag_sylius_cms_plugin_admin_block_index + + + + bitbag_sylius_cms_plugin_admin_block_create + + + + bitbag_sylius_cms_plugin_admin_block_update + + + diff --git a/tests/Behat/Resources/services/pages/admin/block.yml b/tests/Behat/Resources/services/pages/admin/block.yml deleted file mode 100755 index 13a06f4d4..000000000 --- a/tests/Behat/Resources/services/pages/admin/block.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.admin.block.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Block\IndexPage - parent: sylius.behat.page.admin.crud.index - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_block_index' - - bitbag_sylius_cms_plugin.behat.page.admin.block.create: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Block\CreatePage - parent: sylius.behat.page.admin.crud.create - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_block_create' - - bitbag_sylius_cms_plugin.behat.page.admin.block.update: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Block\UpdatePage - parent: sylius.behat.page.admin.crud.update - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_block_update' diff --git a/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml b/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml new file mode 100644 index 000000000..d12b00f9e --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml @@ -0,0 +1,19 @@ + + + + + + + + bitbag_sylius_cms_plugin_admin_frequently_asked_question_index + + + + bitbag_sylius_cms_plugin_admin_frequently_asked_question_create + + + + bitbag_sylius_cms_plugin_admin_frequently_asked_question_update + + + diff --git a/tests/Behat/Resources/services/pages/admin/frequently_asked_question.yml b/tests/Behat/Resources/services/pages/admin/frequently_asked_question.yml deleted file mode 100755 index ae149c731..000000000 --- a/tests/Behat/Resources/services/pages/admin/frequently_asked_question.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\FrequentlyAskedQuestion\IndexPage - parent: sylius.behat.page.admin.crud.index - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_index' - - bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.create: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\FrequentlyAskedQuestion\CreatePage - parent: sylius.behat.page.admin.crud.create - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_create' - - bitbag_sylius_cms_plugin.behat.page.admin.frequently_asked_question.update: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\FrequentlyAskedQuestion\UpdatePage - parent: sylius.behat.page.admin.crud.update - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_update' diff --git a/tests/Behat/Resources/services/pages/admin/media.xml b/tests/Behat/Resources/services/pages/admin/media.xml new file mode 100644 index 000000000..1ecf98438 --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin/media.xml @@ -0,0 +1,19 @@ + + + + + + + + bitbag_sylius_cms_plugin_admin_media_index + + + + bitbag_sylius_cms_plugin_admin_media_create + + + + bitbag_sylius_cms_plugin_admin_media_update + + + diff --git a/tests/Behat/Resources/services/pages/admin/media.yml b/tests/Behat/Resources/services/pages/admin/media.yml deleted file mode 100755 index 8ae61ad9c..000000000 --- a/tests/Behat/Resources/services/pages/admin/media.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.admin.media.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\IndexPage - parent: sylius.behat.page.admin.crud.index - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_media_index' - - bitbag_sylius_cms_plugin.behat.page.admin.media.create: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\CreatePage - parent: sylius.behat.page.admin.crud.create - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_media_create' - - bitbag_sylius_cms_plugin.behat.page.admin.media.update: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Media\UpdatePage - parent: sylius.behat.page.admin.crud.update - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_media_update' diff --git a/tests/Behat/Resources/services/pages/admin/page.xml b/tests/Behat/Resources/services/pages/admin/page.xml new file mode 100644 index 000000000..39d7c6024 --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin/page.xml @@ -0,0 +1,19 @@ + + + + + + + + bitbag_sylius_cms_plugin_admin_page_index + + + + bitbag_sylius_cms_plugin_admin_page_create + + + + bitbag_sylius_cms_plugin_admin_page_update + + + diff --git a/tests/Behat/Resources/services/pages/admin/page.yml b/tests/Behat/Resources/services/pages/admin/page.yml deleted file mode 100755 index c00219ab2..000000000 --- a/tests/Behat/Resources/services/pages/admin/page.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.admin.page.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Page\IndexPage - parent: sylius.behat.page.admin.crud.index - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_page_index' - - bitbag_sylius_cms_plugin.behat.page.admin.page.create: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Page\CreatePage - parent: sylius.behat.page.admin.crud.create - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_page_create' - - bitbag_sylius_cms_plugin.behat.page.admin.page.update: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Page\UpdatePage - parent: sylius.behat.page.admin.crud.update - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_page_update' diff --git a/tests/Behat/Resources/services/pages/admin/section.xml b/tests/Behat/Resources/services/pages/admin/section.xml new file mode 100644 index 000000000..6aeefa32a --- /dev/null +++ b/tests/Behat/Resources/services/pages/admin/section.xml @@ -0,0 +1,19 @@ + + + + + + + + bitbag_sylius_cms_plugin_admin_section_index + + + + bitbag_sylius_cms_plugin_admin_section_create + + + + bitbag_sylius_cms_plugin_admin_section_update + + + diff --git a/tests/Behat/Resources/services/pages/admin/section.yml b/tests/Behat/Resources/services/pages/admin/section.yml deleted file mode 100755 index 49cd42bc8..000000000 --- a/tests/Behat/Resources/services/pages/admin/section.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.admin.section.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Section\IndexPage - parent: sylius.behat.page.admin.crud.index - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_section_index' - - bitbag_sylius_cms_plugin.behat.page.admin.section.create: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Section\CreatePage - parent: sylius.behat.page.admin.crud.create - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_section_create' - - bitbag_sylius_cms_plugin.behat.page.admin.section.update: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Admin\Section\UpdatePage - parent: sylius.behat.page.admin.crud.update - public: false - arguments: - - 'bitbag_sylius_cms_plugin_admin_section_update' diff --git a/tests/Behat/Resources/services/pages/shop.xml b/tests/Behat/Resources/services/pages/shop.xml new file mode 100644 index 000000000..8b7f5f2f0 --- /dev/null +++ b/tests/Behat/Resources/services/pages/shop.xml @@ -0,0 +1,17 @@ + + + + + + + + sylius_shop_homepage + + + + + + + + + diff --git a/tests/Behat/Resources/services/pages/shop.yml b/tests/Behat/Resources/services/pages/shop.yml deleted file mode 100755 index 123f7b3ed..000000000 --- a/tests/Behat/Resources/services/pages/shop.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - bitbag_sylius_cms_plugin.behat.page.shop.home: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Shop\HomePage - parent: sylius.behat.page.shop.home - public: false - arguments: - - 'sylius_shop_homepage' - - bitbag_sylius_cms_plugin.behat.page.shop.page.show: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Shop\Page\ShowPage - parent: sylius.behat.symfony_page - public: false - - bitbag_sylius_cms_plugin.behat.page.shop.page.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Shop\Page\IndexPage - parent: sylius.behat.symfony_page - public: false - - bitbag_sylius_cms_plugin.behat.page.shop.frequently_asked_question.index: - class: Tests\BitBag\SyliusCmsPlugin\Behat\Page\Shop\FrequentlyAskedQuestion\IndexPage - parent: sylius.behat.symfony_page - public: false diff --git a/tests/Behat/Resources/suites.yml b/tests/Behat/Resources/suites.yml old mode 100755 new mode 100644 diff --git a/tests/Functional/Api/FrequentlyAskedQuestionTest.php b/tests/Functional/Api/FrequentlyAskedQuestionTest.php index 61640c33b..6bff6ca3f 100644 --- a/tests/Functional/Api/FrequentlyAskedQuestionTest.php +++ b/tests/Functional/Api/FrequentlyAskedQuestionTest.php @@ -25,7 +25,7 @@ public function setUp(): void $this->loadFixturesFromFile('Api/FrequentlyAskedQuestionTest/frequently_asked_question.yml'); } - public function test_block_response(): void + public function test_faq_response(): void { /** @var FrequentlyAskedQuestionInterface $faq */ $faq = $this->getRepository()->findOneEnabledByCode('faq1-code'); @@ -35,6 +35,14 @@ public function test_block_response(): void $this->assertResponse($response, 'Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_question_by_id', Response::HTTP_OK); } + public function test_faqs_response(): void + { + $this->client->request('GET', '/api/v2/shop/cms-plugin/faq', [], [], self::CONTENT_TYPE_HEADER); + $response = $this->client->getResponse(); + + $this->assertResponse($response, 'Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_questions', Response::HTTP_OK); + } + private function getRepository(): FrequentlyAskedQuestionRepositoryInterface { /** @var FrequentlyAskedQuestionRepositoryInterface $repository */