Skip to content

Commit

Permalink
Merge pull request #14 from shopware/fix/customer-objects
Browse files Browse the repository at this point in the history
fix: customer objects
  • Loading branch information
shyim authored Oct 10, 2023
2 parents 5337c99 + d826815 commit 7cc1c16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Context/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/Context/ContextResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -108,6 +109,7 @@
#[CoversClass(RecurringData::class)]
#[CoversClass(StorefrontAction::class)]
#[CoversClass(StorefrontClaims::class)]
#[CoversClass(OrderCustomer::class)]
class ContextResolverTest extends TestCase
{
public function testAssembleWebhookMalformed(): void
Expand Down

0 comments on commit 7cc1c16

Please sign in to comment.