Skip to content

Commit 5d58d59

Browse files
committed
ACP2E-3647: [CLOUD]: GraphQl error Internal server error placeOrder mutation
1 parent acca415 commit 5d58d59

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

app/code/Magento/SalesGraphQl/Test/Unit/Model/Resolver/OrderTotalTest.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
namespace Magento\SalesGraphQl\Test\Unit\Model\Resolver;
99

1010
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
11-
use Magento\Sales\Api\Data\OrderExtensionInterface;
11+
use Magento\Framework\Api\ExtensionAttributesInterface;
1212
use PHPUnit\Framework\MockObject\MockObject;
1313
use PHPUnit\Framework\TestCase;
1414
use Magento\SalesGraphQl\Model\Resolver\OrderTotal;
1515
use Magento\Sales\Api\Data\OrderInterface;
16-
use Magento\Quote\Model\QuoteFactory;
1716
use Magento\Framework\GraphQl\Config\Element\Field;
1817
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1918
use Magento\Framework\Exception\LocalizedException;
@@ -46,7 +45,7 @@ class OrderTotalTest extends TestCase
4645
private $resolveInfoMock;
4746

4847
/**
49-
* @var OrderExtensionInterface|MockObject
48+
* @var ExtensionAttributesInterface|MockObject
5049
*/
5150
private $extensionAttributesMock;
5251

@@ -55,7 +54,6 @@ protected function setUp(): void
5554
$this->contextMock = $this->createMock(ContextInterface::class);
5655
$this->fieldMock = $this->createMock(Field::class);
5756
$this->resolveInfoMock = $this->createMock(ResolveInfo::class);
58-
$this->extensionAttributesMock = $this->createMock(OrderExtensionInterface::class);
5957
$this->orderMock = $this->createMock(OrderInterface::class);
6058
$this->orderMock->method('getOrderCurrencyCode')->willReturn('USD');
6159
$this->orderMock->method('getBaseCurrencyCode')->willReturn('USD');
@@ -76,12 +74,12 @@ public function testResolve(): void
7674
$resolveInfoMock = $this->createMock(ResolveInfo::class);
7775
$value = ['model' => $this->orderMock];
7876
$args = [];
79-
$this->extensionAttributesMock->expects($this->once())
80-
->method('getAppliedTaxes')
81-
->willReturn([]);
82-
$this->extensionAttributesMock->expects($this->once())
83-
->method('getItemAppliedTaxes')
84-
->willReturn([]);
77+
$this->extensionAttributesMock = $this->getMockBuilder(ExtensionAttributesInterface::class)
78+
->addMethods(['getAppliedTaxes', 'getItemAppliedTaxes'])
79+
->disableOriginalConstructor()
80+
->getMock();
81+
$this->extensionAttributesMock->expects($this->once())->method('getAppliedTaxes')->willReturn([]);
82+
$this->extensionAttributesMock->expects($this->once())->method('getItemAppliedTaxes')->willReturn([]);
8583
$this->orderMock->method('getExtensionAttributes')->willReturn($this->extensionAttributesMock);
8684
$result = $this->orderTotal->resolve($fieldMock, $this->contextMock, $resolveInfoMock, $value, $args);
8785
$this->assertArrayHasKey('base_grand_total', $result);

0 commit comments

Comments
 (0)