42 $this->orderAddressRepositoryMock = $this->createPartialMock(
43 \
Magento\Sales\Model\Order\AddressRepository::class,
46 $this->objectCopyMock = $this->createMock(\
Magento\Framework\
DataObject\Copy::class);
47 $this->orderInterfaceMock = $this->createMock(\
Magento\Sales\Api\Data\OrderAddressInterface::class);
48 $this->dataObjectHelper = $this->createMock(\
Magento\Framework\Api\DataObjectHelper::class);
53 'orderAddressRepository' => $this->orderAddressRepositoryMock,
54 'objectCopyService' => $this->objectCopyMock,
55 'dataObjectHelper' => $this->dataObjectHelper
60 public function testConvert()
62 $orderData = [
'test' =>
'test1'];
63 $data = [
'test' =>
'beer'];
68 $this->objectCopyMock->expects($this->once())->method(
'getDataFromFieldset')->with(
69 'sales_convert_quote_address',
72 )->willReturn($orderData);
73 $this->dataObjectHelper->expects($this->once())->method(
'populateWithArray')
74 ->with($this->orderInterfaceMock, [
'test' =>
'beer'], \
Magento\Sales\Api\Data\OrderAddressInterface::class)
76 $this->orderAddressRepositoryMock->expects($this->once())
78 ->willReturn($this->orderInterfaceMock);
79 $this->assertSame($this->orderInterfaceMock, $this->converter->convert($object,
$data));
$orderAddressRepositoryMock