diff --git a/src/Command/ServiceChangesCommand.php b/src/Command/ServiceChangesCommand.php index 345e00c..9923264 100644 --- a/src/Command/ServiceChangesCommand.php +++ b/src/Command/ServiceChangesCommand.php @@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($class !== null && class_exists($class)) { $decoratedServicesAssociation[$alias] = $class; $this->outputVerbose(sprintf('Sylius service "%s" has been replaced with "%s"', $decoratedServiceId, $alias)); - $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' %s", $class)); + $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' strategy: %s", $class)); continue; } @@ -167,7 +167,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $decoratedServicesAssociation[$definitionClass] = $decoratedDefClass; if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { $this->outputVerbose(sprintf('Sylius service "%s" has been replaced with "%s"', $alias, $definitionClass)); - $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' %s", $decoratedDefClass)); + $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' strategy: %s", $decoratedDefClass)); } continue; @@ -179,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (class_exists($alias)) { $decoratedServicesAssociation[$definitionClass] = $alias; if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { - $this->outputVerbose(sprintf("\tFound classpath by alias %s", $alias)); + $this->outputVerbose(sprintf("\tFound classpath by 'alias' strategy: %s", $alias)); } continue; @@ -190,7 +190,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $class = $decoratedDefintion['definition']?->getClass(); if ($class !== null && class_exists($class)) { $decoratedServicesAssociation[$definitionClass] = $class; - $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' %s", $class)); + $this->outputVerbose(sprintf("\tFound classpath by 'decorated definitions' strategy: %s", $class)); continue; } @@ -201,7 +201,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // $class = str_replace('Interface', '', $alias); // if (class_exists($class)) { // $decoratedServicesAssociation[$definitionClass] = $class; -// $this->outputVerbose(sprintf("\tFound classpath with 'Interface substitution' %s", $class)); +// $this->outputVerbose(sprintf("\tFound classpath by 'Interface substitution' strategy: %s", $class)); // // continue; // } @@ -215,7 +215,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $class = $decoratedDefintion['definition']?->getClass(); if ($class !== null && class_exists($class)) { $decoratedServicesAssociation[$definitionClass] = $class; - $this->outputVerbose(sprintf("\tFound classpath with '.inner substitution' %s", $class)); + $this->outputVerbose(sprintf("\tFound classpath by '.inner substitution' strategy: %s", $class)); continue; } diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml index be6d76e..81bf7e6 100644 --- a/tests/Application/config/services_test.yaml +++ b/tests/Application/config/services_test.yaml @@ -20,59 +20,59 @@ services: ### ServiceChangesCommandTest ### - ## test_it_detects_directly_decorated_services_that_changed + ## test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed # decorate via alias - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_directly_decorated_services_that_changed.decorate_new_shop_based: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_directly_decorated_services_that_changed\DecorateNewShopBased + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_new_shop_based: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateNewShopBased decorates: sylius.context.cart.new_shop_based # decorate via class # NOTE: This case does not exist in "sylius/sylius". It is only by interface or by alias. -# webgriffe_sylius_upgrade.service_changes_command.test_it_detects_directly_decorated_services_that_changed.decorate_minimum_price_distributor: -# class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_directly_decorated_services_that_changed\DecorateMinimumPriceDistributor +# webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_minimum_price_distributor: +# class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateMinimumPriceDistributor # decorates: Sylius\Component\Core\Distributor\MinimumPriceDistributor # decorate via interface - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_directly_decorated_services_that_changed.decorate_order_email_manager: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_directly_decorated_services_that_changed\DecorateOrderEmailManagerInterface + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_order_email_manager: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateOrderEmailManagerInterface decorates: 'Sylius\Bundle\AdminBundle\EmailManager\OrderEmailManagerInterface' # decorated BUT not changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_directly_decorated_services_that_changed.decorate_customer_unique_address_adder: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_directly_decorated_services_that_changed\DecorateCustomerUniqueAddressAdder + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_customer_unique_address_adder: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateCustomerUniqueAddressAdder decorates: sylius.customer_unique_address_adder - ## test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed.decorate_province_naming_provider: + ## test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed.decorate_province_naming_provider: public: true - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed\DecorateProvinceNamingProvider + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed\DecorateProvinceNamingProvider decorates: sylius.province_naming_provider arguments: - '@.inner' - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed.decorate_order_payment_processor: + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed.decorate_order_payment_processor: public: true - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed\DecorateOrderPaymentProcessor + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed\DecorateOrderPaymentProcessor decorates: sylius.order_processing.order_payment_processor.after_checkout decoration_priority: 100 arguments: - '@.inner' # decorated BUT not changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed.decorate_customer_order_addresses_saver: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_directly_decorated_services_that_changed\DecorateCustomerOrderAddressesSaver + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed.decorate_customer_order_addresses_saver: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed\DecorateCustomerOrderAddressesSaver decorates: sylius.customer_order_addresses_saver arguments: - '@.inner' - ## test_it_detects_with_alias_strategy_those_directly_decorated_services_that_changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_directly_decorated_services_that_changed.decorate_send_order_confirmation: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_directly_decorated_services_that_changed\DecorateSendOrderConfirmationHandler + ## test_it_detects_with_alias_strategy_those_decorated_services_that_changed + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_decorated_services_that_changed.decorate_send_order_confirmation: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateSendOrderConfirmationHandler decorates: Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendOrderConfirmationHandler # decorated BUT not changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_directly_decorated_services_that_changed.decorate_send_shipment_confirmation_email_handler: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_directly_decorated_services_that_changed\DecorateSendShipmentConfirmationEmailHandler + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_decorated_services_that_changed.decorate_send_shipment_confirmation_email_handler: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateSendShipmentConfirmationEmailHandler decorates: Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendShipmentConfirmationEmailHandler diff --git a/tests/Integration/Command/ServiceChangesCommandTest.php b/tests/Integration/Command/ServiceChangesCommandTest.php index 203972a..101658b 100644 --- a/tests/Integration/Command/ServiceChangesCommandTest.php +++ b/tests/Integration/Command/ServiceChangesCommandTest.php @@ -35,7 +35,7 @@ protected function tearDown(): void } } - public function test_it_detects_directly_decorated_services_that_changed(): void + public function test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed(): void { Git::$diffToReturn = file_get_contents(self::FIXTURE_DIR . $this->getName() . '/git.diff'); @@ -53,15 +53,15 @@ public function test_it_detects_directly_decorated_services_that_changed(): void $output = $this->commandTester->getDisplay(); $expectedOutput = <<getName() . '/git.diff'); @@ -79,15 +79,15 @@ public function test_it_detects_with_decorated_definition_strategy_those_directl $output = $this->commandTester->getDisplay(); $expectedOutput = <<getName() . '/git.diff'); @@ -105,7 +105,7 @@ public function test_it_detects_with_alias_strategy_those_directly_decorated_ser $output = $this->commandTester->getDisplay(); $expectedOutput = <<