File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 9
9
namespace Magento \Framework \Model \Test \Unit \ResourceModel \Db \Collection ;
10
10
11
11
use Magento \Framework \DB \Select ;
12
+ use Magento \Framework \Model \AbstractModel ;
12
13
use Magento \Framework \Model \ResourceModel \Db \Collection \AbstractCollection ;
13
14
use Magento \Framework \DataObject as MagentoObject ;
14
15
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager as ObjectManagerHelper ;
@@ -257,6 +258,30 @@ public function addFieldToSelectDataProvider()
257
258
];
258
259
}
259
260
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
+
260
285
/**
261
286
* @dataProvider addExpressionFieldToSelectDataProvider
262
287
*/
You can’t perform that action at this time.
0 commit comments