Skip to content

Commit e3d74c3

Browse files
author
Sergii Kovalenko
committed
MAGETWO-61178: Inconsistent sales_order_item information after upgrade
1 parent b0e984d commit e3d74c3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db\Collection;
1010

1111
use Magento\Framework\DB\Select;
12+
use Magento\Framework\Model\AbstractModel;
1213
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
1314
use Magento\Framework\DataObject as MagentoObject;
1415
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
@@ -257,6 +258,30 @@ public function addFieldToSelectDataProvider()
257258
];
258259
}
259260

261+
public function testLoadWithItemFieldsUnserialization()
262+
{
263+
$itemMock = $this->getMockBuilder(AbstractModel::class)
264+
->disableOriginalConstructor()
265+
->getMock();
266+
$this->uut->addItem($itemMock);
267+
268+
$itemMock->expects($this->once())
269+
->method('setOrigData');
270+
$this->resourceMock->expects($this->once())
271+
->method('unserializeFields')
272+
->with($itemMock);
273+
274+
$this->managerMock->expects($this->exactly(2))
275+
->method('dispatch')
276+
->withConsecutive(
277+
['core_collection_abstract_load_before', ['collection' => $this->uut]],
278+
['core_collection_abstract_load_after', ['collection' => $this->uut]]
279+
280+
);
281+
282+
$this->uut->load();
283+
}
284+
260285
/**
261286
* @dataProvider addExpressionFieldToSelectDataProvider
262287
*/

0 commit comments

Comments
 (0)