From 6912c5f20510f03acb4c4c9b97cc180128faf547 Mon Sep 17 00:00:00 2001 From: Joona Melartin Date: Wed, 6 May 2026 09:42:50 +0300 Subject: [PATCH] Fixed issue in one of the module unit tests that wasn't compatible with different Magento versions --- Test/Unit/Model/Cart/FullUpdateTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Test/Unit/Model/Cart/FullUpdateTest.php b/Test/Unit/Model/Cart/FullUpdateTest.php index a646471..0877f62 100644 --- a/Test/Unit/Model/Cart/FullUpdateTest.php +++ b/Test/Unit/Model/Cart/FullUpdateTest.php @@ -6,7 +6,7 @@ * and LICENSE files that were distributed with this source code. */ -namespace Klarna\Kco\Test\Unit\Model\Checkout; +namespace Klarna\Kco\Test\Unit\Model\Cart; use Klarna\Kco\Model\Cart\FullUpdate; use Klarna\Base\Test\Unit\Mock\MockFactory; @@ -112,7 +112,12 @@ protected function setUp(): void $this->quote->method('getShippingAddress') ->willReturn($quoteShippingAddress); - $extensionAttributes = $this->mockFactory->create(CartExtension::class, [], ['getShippingAssignments']); + if (method_exists(CartExtension::class, 'getShippingAssignments')) { + $extensionAttributes = $this->mockFactory->create(CartExtension::class, ['getShippingAssignments']); + } else { + $extensionAttributes = $this->mockFactory->create(CartExtension::class, [], ['getShippingAssignments']); + } + $extensionAttributes->method('getShippingAssignments') ->willReturn([]);