From 8b8f678eb772dfa23cb0b45d51d407ec2cbed401 Mon Sep 17 00:00:00 2001 From: Francis Hilaire Date: Mon, 13 Jan 2025 19:48:18 +0100 Subject: [PATCH] Missing bar field and use it --- .../ApiBundle/Tests/Application/config/config.yaml | 10 +++++----- .../Tests/Application/config/doctrine/Bar.orm.xml | 1 + .../Application/src/CommandHandler/BarHandler.php | 6 +++++- .../Application/src/CommandHandler/BazHandler.php | 5 ++++- .../ApiBundle/Tests/Application/src/Entity/Bar.php | 12 ++++++++++++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/Sylius/Bundle/ApiBundle/Tests/Application/config/config.yaml b/src/Sylius/Bundle/ApiBundle/Tests/Application/config/config.yaml index 44a7e609c52..7ce2b032bc3 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/Application/config/config.yaml +++ b/src/Sylius/Bundle/ApiBundle/Tests/Application/config/config.yaml @@ -13,11 +13,11 @@ parameters: sylius_core.public_dir: '%kernel.project_dir%/public' api_platform: - enable_swagger_ui: true - enable_re_doc: true - enable_swagger: true - enable_entrypoint: true - enable_docs: true + enable_swagger_ui: false + enable_re_doc: false + enable_swagger: false + enable_entrypoint: false + enable_docs: false mapping: paths: - '%kernel.project_dir%/config/api_platform' diff --git a/src/Sylius/Bundle/ApiBundle/Tests/Application/config/doctrine/Bar.orm.xml b/src/Sylius/Bundle/ApiBundle/Tests/Application/config/doctrine/Bar.orm.xml index e1fd11e41a9..9972c39fb97 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/Application/config/doctrine/Bar.orm.xml +++ b/src/Sylius/Bundle/ApiBundle/Tests/Application/config/doctrine/Bar.orm.xml @@ -18,5 +18,6 @@ + diff --git a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BarHandler.php b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BarHandler.php index 701c6c2b13b..f71b7e6411b 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BarHandler.php +++ b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BarHandler.php @@ -22,6 +22,10 @@ { public function __invoke(BarCommand $command): Bar { - return new Bar(); + $bar = new Bar(); + $bar->setFoo($command->foo); + $bar->setBar($command->bar); + + return $bar; } } diff --git a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BazHandler.php b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BazHandler.php index 516072a9aed..1c650c2f9fa 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BazHandler.php +++ b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/CommandHandler/BazHandler.php @@ -22,6 +22,9 @@ { public function __invoke(BazCommand $command): Bar { - return new Bar(); + $bar = new Bar(); + $bar->setFoo($command->foo); + + return $bar; } } diff --git a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/Entity/Bar.php b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/Entity/Bar.php index ca32b5ee5d6..751b362e84c 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/Application/src/Entity/Bar.php +++ b/src/Sylius/Bundle/ApiBundle/Tests/Application/src/Entity/Bar.php @@ -19,6 +19,8 @@ class Bar private ?string $foo = null; + private ?string $bar = null; + public function getId(): int { return $this->id; @@ -38,4 +40,14 @@ public function setFoo(?string $foo): void { $this->foo = $foo; } + + public function getBar(): ?string + { + return $this->bar; + } + + public function setBar(?string $bar): void + { + $this->bar = $bar; + } }