Skip to content

Commit 549fa8b

Browse files
committed
ACP2E-2213: Loading order through repository loads the order multiple times from DB
1 parent 495a2ed commit 549fa8b

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Sales\Test\Unit\Model\Order;
9+
10+
use Magento\Sales\Model\OrderFactory;
11+
use Magento\Sales\Api\Data\ShippingInterfaceFactory;
12+
use Magento\Sales\Api\Data\TotalInterfaceFactory;
13+
use Magento\Sales\Model\Order\ShippingBuilder;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
16+
17+
class ShippingBuilderTest extends TestCase
18+
{
19+
/**
20+
* @var ShippingBuilder
21+
*/
22+
private $shippingBuilder;
23+
24+
/**
25+
* @var OrderFactory|MockObject
26+
*/
27+
private $orderFactory;
28+
29+
/**
30+
* @var ShippingInterfaceFactory|Mockobject
31+
*/
32+
private $shippingFactory;
33+
34+
/**
35+
* @var TotalInterfaceFactory|MockObject
36+
*/
37+
private $totalFactory;
38+
39+
/**
40+
* @return void
41+
*/
42+
protected function setUp(): void
43+
{
44+
$this->orderFactory = $this->getMockBuilder(OrderFactory::class)
45+
->getMock();
46+
$this->shippingFactory = $this->getMockBuilder(ShippingInterfaceFactory::class)
47+
->getMock();
48+
$this->totalFactory = $this->getMockBuilder(TotalInterfaceFactory::class)
49+
->getMock();
50+
$this->shippingBuilder = new ShippingBuilder($this->orderFactory, $this->shippingFactory, $this->totalFactory);
51+
}
52+
}

0 commit comments

Comments
 (0)