From d82681535e9ec29648812ddfbbba9a8aa888c31c Mon Sep 17 00:00:00 2001 From: Lennart Tinkloh Date: Fri, 22 Sep 2023 10:24:51 +0200 Subject: [PATCH] fix: customer objects --- src/Context/Order/Order.php | 5 ++--- tests/Context/ContextResolverTest.php | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Context/Order/Order.php b/src/Context/Order/Order.php index 4ad7127..6a99932 100644 --- a/src/Context/Order/Order.php +++ b/src/Context/Order/Order.php @@ -10,7 +10,6 @@ use Shopware\App\SDK\Context\Cart\LineItem; use Shopware\App\SDK\Context\SalesChannelContext\Address; use Shopware\App\SDK\Context\SalesChannelContext\Currency; -use Shopware\App\SDK\Context\SalesChannelContext\Customer; use Shopware\App\SDK\Context\SalesChannelContext\RoundingConfig; use Shopware\App\SDK\Context\Trait\CustomFieldsAware; @@ -84,10 +83,10 @@ public function getShippingCosts(): CalculatedPrice return new CalculatedPrice($this->data['shippingCosts']); } - public function getOrderCustomer(): Customer + public function getOrderCustomer(): OrderCustomer { \assert(\is_array($this->data['orderCustomer'])); - return new Customer($this->data['orderCustomer']); + return new OrderCustomer($this->data['orderCustomer']); } public function getCurrency(): Currency diff --git a/tests/Context/ContextResolverTest.php b/tests/Context/ContextResolverTest.php index 98663b7..c9e8065 100644 --- a/tests/Context/ContextResolverTest.php +++ b/tests/Context/ContextResolverTest.php @@ -26,6 +26,7 @@ use PHPUnit\Framework\TestCase; use Shopware\App\SDK\Context\Module\ModuleAction; use Shopware\App\SDK\Context\Order\Order; +use Shopware\App\SDK\Context\Order\OrderCustomer; use Shopware\App\SDK\Context\Order\OrderDelivery; use Shopware\App\SDK\Context\Order\OrderTransaction; use Shopware\App\SDK\Context\Order\StateMachineState; @@ -108,6 +109,7 @@ #[CoversClass(RecurringData::class)] #[CoversClass(StorefrontAction::class)] #[CoversClass(StorefrontClaims::class)] +#[CoversClass(OrderCustomer::class)] class ContextResolverTest extends TestCase { public function testAssembleWebhookMalformed(): void