File tree 2 files changed +20
-16
lines changed
app/code/Magento/Sitemap/Test/Unit/Model
2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,10 @@ public function productProvider()
79
79
]
80
80
),
81
81
new DataObject (
82
- ['url ' => $ storeBaseMediaUrl . 'i/m/image_no_caption.png ' , 'caption ' => null ]
82
+ [
83
+ 'url ' => $ storeBaseMediaUrl . 'i/m/image_no_caption.png ' ,
84
+ 'caption ' => null
85
+ ]
83
86
),
84
87
],
85
88
'thumbnail ' => $ storeBaseMediaUrl . 't/h/thumbnail.jpg ' ,
Original file line number Diff line number Diff line change @@ -105,17 +105,18 @@ protected function setUp()
105
105
->disableOriginalConstructor ()
106
106
->getMock ();
107
107
108
+ $ resourceMethods = [
109
+ '_construct ' ,
110
+ 'beginTransaction ' ,
111
+ 'rollBack ' ,
112
+ 'save ' ,
113
+ 'addCommitCallback ' ,
114
+ 'commit ' ,
115
+ '__wakeup ' ,
116
+ ];
117
+
108
118
$ this ->resourceMock = $ this ->getMockBuilder (SitemapResource::class)
109
- ->setMethods (
110
- [
111
- '_construct ' ,
112
- 'beginTransaction ' ,
113
- 'rollBack ' ,
114
- 'save ' ,
115
- 'addCommitCallback ' ,
116
- 'commit ' ,
117
- '__wakeup ' ,
118
- ])
119
+ ->setMethods ($ resourceMethods )
119
120
->disableOriginalConstructor ()
120
121
->getMock ();
121
122
@@ -145,7 +146,6 @@ protected function setUp()
145
146
->willReturn ($ this ->directoryMock );
146
147
147
148
$ this ->configReaderMock = $ this ->getMockForAbstractClass (SitemapConfigReaderInterface::class);
148
-
149
149
$ this ->itemResolverMock = $ this ->getMockForAbstractClass (ItemResolverInterface::class);
150
150
}
151
151
@@ -416,13 +416,14 @@ protected function prepareSitemapModelMock(
416
416
->method ('write ' )
417
417
->willReturnCallback ($ streamWriteCallback );
418
418
419
+ $ checkFileCallback = function ($ file ) use (&$ currentFile ) {
420
+ $ currentFile = $ file ;
421
+ };
422
+
419
423
// Check that all expected file descriptors were created
420
424
$ this ->directoryMock ->expects ($ this ->exactly (count ($ expectedFile )))
421
425
->method ('openFile ' )
422
- ->willReturnCallback (function ($ file ) use (&$ currentFile ) {
423
- $ currentFile = $ file ;
424
- }
425
- );
426
+ ->willReturnCallback ($ checkFileCallback );
426
427
427
428
// Check that all file descriptors were closed
428
429
$ this ->fileMock ->expects ($ this ->exactly (count ($ expectedFile )))
You can’t perform that action at this time.
0 commit comments