From d4d93cb61b058b9df3ba30b915b1acf8834ccf03 Mon Sep 17 00:00:00 2001 From: Simon Krull Date: Wed, 22 Jul 2026 08:03:32 +0200 Subject: [PATCH 1/2] [Maintenance] [XML2PHP] convert service definition configs from xml to php --- config/services.php | 89 ++++++++++++++ config/services.xml | 77 ------------ config/services/cli.php | 28 +++++ config/services/cli.xml | 28 ----- config/services/controllers.php | 39 ++++++ config/services/controllers.xml | 37 ------ config/services/converters.php | 42 +++++++ config/services/converters.xml | 37 ------ config/services/fixtures.php | 40 +++++++ config/services/fixtures.xml | 37 ------ config/services/generators.php | 112 ++++++++++++++++++ config/services/generators.xml | 88 -------------- config/services/listeners.php | 47 ++++++++ config/services/listeners.xml | 45 ------- config/services/listeners/workflow.php | 25 ++++ config/services/listeners/workflow.xml | 29 ----- config/services/twig.php | 30 +++++ config/services/twig.xml | 33 ------ config/services/ui.php | 24 ++++ config/services/ui.xml | 26 ---- .../SyliusInvoicingExtension.php | 6 +- 21 files changed, 479 insertions(+), 440 deletions(-) create mode 100644 config/services.php delete mode 100644 config/services.xml create mode 100644 config/services/cli.php delete mode 100644 config/services/cli.xml create mode 100644 config/services/controllers.php delete mode 100644 config/services/controllers.xml create mode 100644 config/services/converters.php delete mode 100644 config/services/converters.xml create mode 100644 config/services/fixtures.php delete mode 100644 config/services/fixtures.xml create mode 100644 config/services/generators.php delete mode 100644 config/services/generators.xml create mode 100644 config/services/listeners.php delete mode 100644 config/services/listeners.xml create mode 100644 config/services/listeners/workflow.php delete mode 100644 config/services/listeners/workflow.xml create mode 100644 config/services/twig.php delete mode 100644 config/services/twig.xml create mode 100644 config/services/ui.php delete mode 100644 config/services/ui.xml diff --git a/config/services.php b/config/services.php new file mode 100644 index 00000000..433bf026 --- /dev/null +++ b/config/services.php @@ -0,0 +1,89 @@ +services(); + $parameters = $container->parameters(); + $container->import('services/**/*.php'); + + $parameters->set('sylius_invoicing.default_logo_file', '@SyliusInvoicingPlugin/assets/sylius-logo.png'); + $parameters->set('sylius_invoicing.template.logo_file', '%env(default:sylius_invoicing.default_logo_file:resolve:SYLIUS_INVOICING_LOGO_FILE)%'); + + $services->set('sylius_invoicing.email.invoice_email_sender', InvoiceEmailSender::class) + ->args([ + service('sylius.email_sender'), + service('sylius_invoicing.provider.invoice_file'), + '%sylius_invoicing.pdf_generator.enabled%', + ]); + + $services->alias(InvoiceEmailSenderInterface::class, 'sylius_invoicing.email.invoice_email_sender'); + + $services->set('sylius_invoicing.command_handler.send_invoice_email', SendInvoiceEmailHandler::class) + ->args([ + service('sylius_invoicing.repository.invoice'), + service('sylius.repository.order'), + service('sylius_invoicing.email.invoice_email_sender'), + ]) + ->tag('messenger.message_handler'); + + $services->set('sylius_invoicing.security.voter.invoice', InvoiceVoter::class) + ->args([service('sylius.repository.order')]) + ->tag('security.voter'); + + $services->set('sylius_invoicing.provider.tax_rate_percentage', TaxRatePercentageProvider::class); + + $services->alias(TaxRatePercentageProviderInterface::class, 'sylius_invoicing.provider.tax_rate_percentage'); + + $services->set('sylius_invoicing.custom_factory.invoice', InvoiceFactory::class) + ->args([ + '%sylius_invoicing.model.invoice.class%', + service('sylius_invoicing.factory.shop_billing_data'), + ]); + + $services->alias(InvoiceFactoryInterface::class, 'sylius_invoicing.custom_factory.invoice'); + + $services->set('sylius_invoicing.manager.invoice_file', InvoiceFileManager::class) + ->args([service('gaufrette.sylius_invoicing_invoice_filesystem')]); + + $services->alias(InvoiceFileManagerInterface::class, 'sylius_invoicing.manager.invoice_file'); + + $services->set('sylius_invoicing.provider.invoice_file', InvoiceFileProvider::class) + ->args([ + service('sylius_invoicing.generator.invoice_file_name'), + service('gaufrette.sylius_invoicing_invoice_filesystem'), + service('sylius_invoicing.generator.invoice_pdf_file'), + service('sylius_invoicing.manager.invoice_file'), + '%sylius_invoicing.invoice_save_path%', + ]); + + $services->alias(InvoiceFileProviderInterface::class, 'sylius_invoicing.provider.invoice_file'); + + $services->set('sylius_invoicing.provider.unit_net_price', UnitNetPriceProvider::class); + + $services->alias(UnitNetPriceProviderInterface::class, 'sylius_invoicing.provider.unit_net_price'); +}; diff --git a/config/services.xml b/config/services.xml deleted file mode 100644 index 47ea616a..00000000 --- a/config/services.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - @SyliusInvoicingPlugin/assets/sylius-logo.png - %env(default:sylius_invoicing.default_logo_file:resolve:SYLIUS_INVOICING_LOGO_FILE)% - - - - - - - %sylius_invoicing.pdf_generator.enabled% - - - - - - - - - - - - - - - - - - - - %sylius_invoicing.model.invoice.class% - - - - - - - - - - - - - - - %sylius_invoicing.invoice_save_path% - - - - - - - diff --git a/config/services/cli.php b/config/services/cli.php new file mode 100644 index 00000000..9b7d0af4 --- /dev/null +++ b/config/services/cli.php @@ -0,0 +1,28 @@ +services(); + + $services->defaults() + ->public(); + + $services->set('sylius_invoicing.cli.generate_invoices', GenerateInvoicesCommand::class) + ->args([ + service('sylius_invoicing.creator.mass_invoices'), + service('sylius.repository.order'), + ]) + ->tag('console.command'); +}; diff --git a/config/services/cli.xml b/config/services/cli.xml deleted file mode 100644 index ed6cb0c0..00000000 --- a/config/services/cli.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/config/services/controllers.php b/config/services/controllers.php new file mode 100644 index 00000000..5928d2c3 --- /dev/null +++ b/config/services/controllers.php @@ -0,0 +1,39 @@ +services(); + + $services->defaults() + ->public(); + + $services->set('sylius_invoicing.controller.download_invoice', DownloadInvoiceAction::class) + ->args([ + service('sylius_invoicing.repository.invoice'), + service('security.authorization_checker'), + service('sylius_invoicing.provider.invoice_file'), + '%sylius_invoicing.pdf_generator.enabled%', + ]); + + $services->set('sylius_invoicing.controller.resend_invoice', ResendInvoiceAction::class) + ->args([ + service('sylius_invoicing.repository.invoice'), + service('sylius_invoicing.email.invoice_email_sender'), + service('sylius.repository.order'), + service('router'), + service('request_stack'), + ]); +}; diff --git a/config/services/controllers.xml b/config/services/controllers.xml deleted file mode 100644 index be58bdbc..00000000 --- a/config/services/controllers.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - %sylius_invoicing.pdf_generator.enabled% - - - - - - - - - - - diff --git a/config/services/converters.php b/config/services/converters.php new file mode 100644 index 00000000..19038959 --- /dev/null +++ b/config/services/converters.php @@ -0,0 +1,42 @@ +services(); + + $services->set('sylius_invoicing.converter.order_item_units_to_line_items', OrderItemUnitsToLineItemsConverter::class) + ->args([ + service('sylius_invoicing.provider.tax_rate_percentage'), + service('sylius_invoicing.factory.line_item'), + service('sylius_invoicing.provider.unit_net_price'), + ]); + + $services->set('sylius_invoicing.converter.shipping_adjustments_to_line_items', ShippingAdjustmentsToLineItemsConverter::class) + ->args([ + service('sylius_invoicing.provider.tax_rate_percentage'), + service('sylius_invoicing.factory.line_item'), + ]); + + $services->set('sylius_invoicing.converter.tax_items', TaxItemsConverter::class) + ->args([ + service('sylius_invoicing.provider.tax_rate_percentage'), + service('sylius_invoicing.factory.tax_item'), + ]); + + $services->alias(TaxItemsConverterInterface::class, 'sylius_invoicing.converter.tax_items'); +}; diff --git a/config/services/converters.xml b/config/services/converters.xml deleted file mode 100644 index e28df52e..00000000 --- a/config/services/converters.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/services/fixtures.php b/config/services/fixtures.php new file mode 100644 index 00000000..ac6585e3 --- /dev/null +++ b/config/services/fixtures.php @@ -0,0 +1,40 @@ +services(); + + $services->set('sylius_invoicing.fixture.example_factory.shop_billing_data', ShopBillingDataExampleFactory::class) + ->args([ + service('sylius.repository.channel'), + service('sylius.factory.shop_billing_data'), + ]); + + $services->set('sylius_invoicing.fixture.shop_billing_data', ShopBillingDataFixture::class) + ->args([ + service('sylius.manager.channel'), + service('sylius_invoicing.fixture.example_factory.shop_billing_data'), + ]) + ->tag('sylius_fixtures.fixture'); + + $services->set('sylius_invoicing.fixture.listener.invoices_purger', InvoicesPurgerListener::class) + ->args([ + service('filesystem'), + '%sylius_invoicing.invoice_save_path%', + ]) + ->tag('sylius_fixtures.listener'); +}; diff --git a/config/services/fixtures.xml b/config/services/fixtures.xml deleted file mode 100644 index ffaeae0a..00000000 --- a/config/services/fixtures.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - %sylius_invoicing.invoice_save_path% - - - - diff --git a/config/services/generators.php b/config/services/generators.php new file mode 100644 index 00000000..421cb99b --- /dev/null +++ b/config/services/generators.php @@ -0,0 +1,112 @@ +services(); + + $services->set('sylius_invoicing.generator.invoice_number', SequentialInvoiceNumberGenerator::class) + ->args([ + service('sylius_invoicing.repository.invoice_sequence'), + service('sylius_invoicing.factory.invoice_sequence'), + service('sylius_invoicing.manager.invoice_sequence'), + service('clock'), + ]); + + $services->set('sylius_invoicing.generator.invoice_identifier', UuidInvoiceIdentifierGenerator::class); + + $services->set('sylius_invoicing.generator.invoice', InvoiceGenerator::class) + ->args([ + service('sylius_invoicing.generator.invoice_identifier'), + service('sylius_invoicing.generator.invoice_number'), + service('sylius_invoicing.custom_factory.invoice'), + service('sylius_invoicing.factory.billing_data'), + service('sylius_invoicing.factory.shop_billing_data'), + service('sylius_invoicing.converter.order_item_units_to_line_items'), + service('sylius_invoicing.converter.shipping_adjustments_to_line_items'), + service('sylius_invoicing.converter.tax_items'), + ]); + + $services->alias(InvoiceGeneratorInterface::class, 'sylius_invoicing.generator.invoice'); + + $services->set('sylius_invoicing.generator.invoice_file_name', InvoiceFileNameGenerator::class); + + $services->alias(InvoiceFileNameGeneratorInterface::class, 'sylius_invoicing.generator.invoice_file_name'); + + $services->set('sylius_invoicing.generator.invoice_pdf_file', InvoicePdfFileGenerator::class) + ->args([ + service('sylius_invoicing.generator.twig_to_pdf'), + service('file_locator'), + service('sylius_invoicing.generator.invoice_file_name'), + '@SyliusInvoicingPlugin/shared/download/pdf.html.twig', + '%sylius_invoicing.template.logo_file%', + ]); + + $services->alias(InvoicePdfFileGeneratorInterface::class, 'sylius_invoicing.generator.invoice_pdf_file'); + + $services->set('sylius_invoicing.creator.invoice', InvoiceCreator::class) + ->args([ + service('sylius_invoicing.repository.invoice'), + service('sylius.repository.order'), + service('sylius_invoicing.generator.invoice'), + service('sylius_invoicing.generator.invoice_pdf_file'), + service('sylius_invoicing.manager.invoice_file'), + '%sylius_invoicing.pdf_generator.enabled%', + ]); + + $services->alias(InvoiceCreatorInterface::class, 'sylius_invoicing.creator.invoice'); + + $services->set('sylius_invoicing.creator.mass_invoices', MassInvoicesCreator::class) + ->args([ + service('sylius_invoicing.creator.invoice'), + service('clock'), + ]); + + $services->alias(MassInvoicesCreatorInterface::class, 'sylius_invoicing.creator.mass_invoices'); + + $services->set('sylius_invoicing.generator.pdf_options', PdfOptionsGenerator::class) + ->args([ + service('file_locator'), + '%knp_snappy.pdf.options%', + '%sylius_invoicing.pdf_generator.allowed_files%', + ]) + ->deprecate('sylius/invoicing-plugin', '2.2', 'The "%service_id%" service is deprecated. PDF options are now handled by sylius/pdf-generation-bundle adapters.'); + + $services->alias(PdfOptionsGeneratorInterface::class, 'sylius_invoicing.generator.pdf_options'); + + $services->set('sylius_invoicing.generator.twig_to_pdf', TwigToPdfGenerator::class) + ->args([ + service('twig'), + service('knp_snappy.pdf'), + service('sylius_invoicing.generator.pdf_options'), + ]) + ->deprecate('sylius/invoicing-plugin', '2.2', 'The "%service_id%" service is deprecated. Use Sylius\PdfGenerationBundle\Core\Renderer\TwigToPdfRendererInterface from sylius/pdf-generation-bundle instead.'); + + $services->alias(TwigToPdfGeneratorInterface::class, 'sylius_invoicing.generator.twig_to_pdf'); +}; diff --git a/config/services/generators.xml b/config/services/generators.xml deleted file mode 100644 index 2ed6f149..00000000 --- a/config/services/generators.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @SyliusInvoicingPlugin/shared/download/pdf.html.twig - %sylius_invoicing.template.logo_file% - - - - - - - - - - %sylius_invoicing.pdf_generator.enabled% - - - - - - - - - - - - %knp_snappy.pdf.options% - %sylius_invoicing.pdf_generator.allowed_files% - The "%service_id%" service is deprecated. PDF options are now handled by sylius/pdf-generation-bundle adapters. - - - - - - - - The "%service_id%" service is deprecated. Use Sylius\PdfGenerationBundle\Core\Renderer\TwigToPdfRendererInterface from sylius/pdf-generation-bundle instead. - - - - diff --git a/config/services/listeners.php b/config/services/listeners.php new file mode 100644 index 00000000..2cc5dbf9 --- /dev/null +++ b/config/services/listeners.php @@ -0,0 +1,47 @@ +services(); + + $services->defaults() + ->public(); + + $services->set('sylius_invoicing.event_producer.order_payment_paid', OrderPaymentPaidProducer::class) + ->args([ + service('sylius.event_bus'), + service('clock'), + service('sylius_invoicing.repository.invoice'), + ]); + + $services->set('sylius_invoicing.listener.order_placed', CreateInvoiceOnOrderPlacedListener::class) + ->args([service('sylius_invoicing.creator.invoice')]) + ->tag('messenger.message_handler', ['bus' => 'sylius.event_bus']); + + $services->set('sylius_invoicing.event_producer.order_placed', OrderPlacedProducer::class) + ->args([ + service('sylius.event_bus'), + service('clock'), + ]) + ->tag('doctrine.event_listener', ['event' => 'postPersist']) + ->tag('doctrine.event_listener', ['event' => 'postUpdate']); + + $services->set('sylius_invoicing.listener.order_payment_paid', OrderPaymentPaidListener::class) + ->args([service('sylius.command_bus')]) + ->tag('messenger.message_handler', ['bus' => 'sylius.event_bus']); +}; diff --git a/config/services/listeners.xml b/config/services/listeners.xml deleted file mode 100644 index 988881bd..00000000 --- a/config/services/listeners.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/services/listeners/workflow.php b/config/services/listeners/workflow.php new file mode 100644 index 00000000..83013598 --- /dev/null +++ b/config/services/listeners/workflow.php @@ -0,0 +1,25 @@ +services(); + + $services->defaults() + ->public(); + + $services->set('sylius_invoicing.event_listener.workflow.payment.produce_order_payment_paid', ProduceOrderPaymentPaidListener::class) + ->args([service('sylius_invoicing.event_producer.order_payment_paid')]) + ->tag('kernel.event_listener', ['event' => 'workflow.sylius_payment.completed.complete', 'priority' => 50]); +}; diff --git a/config/services/listeners/workflow.xml b/config/services/listeners/workflow.xml deleted file mode 100644 index 199b0148..00000000 --- a/config/services/listeners/workflow.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/config/services/twig.php b/config/services/twig.php new file mode 100644 index 00000000..6e95595e --- /dev/null +++ b/config/services/twig.php @@ -0,0 +1,30 @@ +services(); + + $services->set('sylius_invoicing.twig.extension.invoices', InvoicesExtension::class) + ->args([ + service('sylius_invoicing.repository.invoice'), + '%sylius_invoicing.pdf_generator.enabled%', + ]) + ->tag('twig.extension'); + + $services->set('sylius_invoicing.twig.component.invoice.list', ListComponent::class) + ->args([service('sylius_invoicing.repository.invoice')]) + ->tag('sylius.twig_component', ['key' => 'sylius_invoicing:invoice:list', 'template' => '@SyliusInvoicingPlugin/shared/components/invoices.html.twig']); +}; diff --git a/config/services/twig.xml b/config/services/twig.xml deleted file mode 100644 index e29f61ec..00000000 --- a/config/services/twig.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - %sylius_invoicing.pdf_generator.enabled% - - - - - - - - - - diff --git a/config/services/ui.php b/config/services/ui.php new file mode 100644 index 00000000..ec7a5ad2 --- /dev/null +++ b/config/services/ui.php @@ -0,0 +1,24 @@ +services(); + + $services->defaults() + ->public(); + + $services->set('sylius_invoicing.listener.admin_menu ', AdminMenuListener::class) + ->tag('kernel.event_listener', ['event' => 'sylius.menu.admin.main', 'method' => '__invoke']); +}; diff --git a/config/services/ui.xml b/config/services/ui.xml deleted file mode 100644 index 7459c8bd..00000000 --- a/config/services/ui.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/DependencyInjection/SyliusInvoicingExtension.php b/src/DependencyInjection/SyliusInvoicingExtension.php index 46bd0681..5fc9c590 100644 --- a/src/DependencyInjection/SyliusInvoicingExtension.php +++ b/src/DependencyInjection/SyliusInvoicingExtension.php @@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Reference; final class SyliusInvoicingExtension extends AbstractResourceExtension implements PrependExtensionInterface @@ -32,8 +32,8 @@ final class SyliusInvoicingExtension extends AbstractResourceExtension implement public function load(array $configs, ContainerBuilder $container): void { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); - $loader->load('services.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../config')); + $loader->load('services.php'); /** @var ConfigurationInterface $configuration */ $configuration = $this->getConfiguration([], $container); From 1e2d1ee5681330a45e0dc5d94c8ba419f83e03f1 Mon Sep 17 00:00:00 2001 From: Simon Krull Date: Fri, 24 Jul 2026 08:38:21 +0200 Subject: [PATCH 2/2] [Behat] [XML2PHP] convert Behat service definitions from XML to PHP --- tests/Behat/Resources/services.php | 136 ++++++++++++++++++ tests/Behat/Resources/services.xml | 108 -------------- .../TestApplication/config/services_test.php | 2 +- 3 files changed, 137 insertions(+), 109 deletions(-) create mode 100644 tests/Behat/Resources/services.php delete mode 100644 tests/Behat/Resources/services.xml diff --git a/tests/Behat/Resources/services.php b/tests/Behat/Resources/services.php new file mode 100644 index 00000000..d3311acf --- /dev/null +++ b/tests/Behat/Resources/services.php @@ -0,0 +1,136 @@ +services(); + $parameters = $container->parameters(); + $parameters->set('sylius.behat.page.admin.channel.update.class', UpdatePage::class); + + $services->set(IndexPageInterface::class, IndexPage::class) + ->public() + ->parent('sylius.behat.page.shop.account.order.index'); + + $services->set(AccountContext::class) + ->public() + ->args([service(IndexPageInterface::class)]); + + $services->set(ManagingInvoicesContext::class) + ->public() + ->args([ + service(\Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Invoice\IndexPageInterface::class), + service(ShowPageInterface::class), + service(\Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Order\ShowPageInterface::class), + service('sylius_invoicing.repository.invoice'), + service('sylius.behat.notification_checker.admin'), + ]); + + $services->set(CustomerBrowsingInvoicesContext::class) + ->public() + ->args([ + service(\Tests\Sylius\InvoicingPlugin\Behat\Page\Shop\Order\ShowPageInterface::class), + service(DownloadInvoicePageInterface::class), + service('sylius_invoicing.repository.invoice'), + ]); + + $services->set(InvoiceEmailContext::class) + ->public() + ->args([service('sylius.behat.email_checker')]); + + $services->set(GeneratingInvoiceContext::class) + ->public() + ->args([ + service('sylius_invoicing.manager.invoice'), + service('sylius_invoicing.repository.invoice'), + ]); + + $services->set(InvoicesContext::class) + ->public() + ->args(['%sylius_invoicing.invoice_save_path%']); + + $services->set(InvoicesGenerationContext::class) + ->public() + ->args([ + service('kernel'), + service('sylius_invoicing.creator.mass_invoices'), + service('sylius_invoicing.repository.invoice'), + service('sylius.repository.order'), + ]); + + $services->set(OrderContext::class) + ->public() + ->args([ + service('doctrine.orm.entity_manager'), + service('sylius_abstraction.state_machine'), + ]); + + $services->set(ManagingChannelsContext::class) + ->public() + ->args([service('sylius.behat.page.admin.channel.update')]); + + $services->set(ChannelContext::class) + ->public() + ->args([service('sylius.manager.channel')]); + + $services->set(\Tests\Sylius\InvoicingPlugin\Behat\Context\Setup\OrderContext::class) + ->public() + ->args([service('sylius.manager.order')]); + + $services->set(\Tests\Sylius\InvoicingPlugin\Behat\Context\Application\ManagingInvoicesContext::class) + ->public() + ->args([ + '%sylius_invoicing.invoice_save_path%', + service('sylius_invoicing.repository.invoice'), + ]); + + $services->set(\Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Invoice\IndexPageInterface::class, \Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Invoice\IndexPage::class) + ->public() + ->parent('sylius.behat.page.admin.crud.index') + ->args(['sylius_invoicing_admin_invoice_index']); + + $services->set(ShowPageInterface::class, ShowPage::class) + ->public() + ->parent('sylius.behat.symfony_page') + ->args([service('sylius.behat.table_accessor')]); + + $services->set(DownloadInvoicePageInterface::class, DownloadInvoicePage::class) + ->public() + ->parent('sylius.behat.symfony_page'); + + $services->set(\Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Order\ShowPageInterface::class, \Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Order\ShowPage::class) + ->public() + ->parent('sylius.behat.symfony_page'); + + $services->set(\Tests\Sylius\InvoicingPlugin\Behat\Page\Shop\Order\ShowPageInterface::class, \Tests\Sylius\InvoicingPlugin\Behat\Page\Shop\Order\ShowPage::class) + ->public() + ->parent('sylius.behat.symfony_page'); +}; diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml deleted file mode 100644 index 6d1a011d..00000000 --- a/tests/Behat/Resources/services.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - Tests\Sylius\InvoicingPlugin\Behat\Page\Admin\Channel\UpdatePage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %sylius_invoicing.invoice_save_path% - - - - - - - - - - - - - - - - - - - - - - - - - - - - %sylius_invoicing.invoice_save_path% - - - - - sylius_invoicing_admin_invoice_index - - - - - - - - - - - - - diff --git a/tests/TestApplication/config/services_test.php b/tests/TestApplication/config/services_test.php index 83a9ccbb..8f67bed5 100644 --- a/tests/TestApplication/config/services_test.php +++ b/tests/TestApplication/config/services_test.php @@ -9,7 +9,7 @@ if (str_starts_with($env, 'test')) { $container->import('../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml'); - $container->import('@SyliusInvoicingPlugin/tests/Behat/Resources/services.xml'); + $container->import('@SyliusInvoicingPlugin/tests/Behat/Resources/services.php'); } if (filter_var($_ENV['TEST_SYLIUS_INVOICING_PDF_GENERATION_DISABLED'], FILTER_VALIDATE_BOOLEAN)) {