Skip to content

Commit 9c65d50

Browse files
#10045 coding standars again
1 parent b6ddaa7 commit 9c65d50

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

app/code/Magento/Sitemap/Test/Unit/Model/ItemResolver/ProductTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public function productProvider()
7979
]
8080
),
8181
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+
]
8386
),
8487
],
8588
'thumbnail' => $storeBaseMediaUrl . 't/h/thumbnail.jpg',

app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,18 @@ protected function setUp()
105105
->disableOriginalConstructor()
106106
->getMock();
107107

108+
$resourceMethods = [
109+
'_construct',
110+
'beginTransaction',
111+
'rollBack',
112+
'save',
113+
'addCommitCallback',
114+
'commit',
115+
'__wakeup',
116+
];
117+
108118
$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)
119120
->disableOriginalConstructor()
120121
->getMock();
121122

@@ -145,7 +146,6 @@ protected function setUp()
145146
->willReturn($this->directoryMock);
146147

147148
$this->configReaderMock = $this->getMockForAbstractClass(SitemapConfigReaderInterface::class);
148-
149149
$this->itemResolverMock = $this->getMockForAbstractClass(ItemResolverInterface::class);
150150
}
151151

@@ -416,13 +416,14 @@ protected function prepareSitemapModelMock(
416416
->method('write')
417417
->willReturnCallback($streamWriteCallback);
418418

419+
$checkFileCallback = function ($file) use (&$currentFile) {
420+
$currentFile = $file;
421+
};
422+
419423
// Check that all expected file descriptors were created
420424
$this->directoryMock->expects($this->exactly(count($expectedFile)))
421425
->method('openFile')
422-
->willReturnCallback(function ($file) use (&$currentFile) {
423-
$currentFile = $file;
424-
}
425-
);
426+
->willReturnCallback($checkFileCallback);
426427

427428
// Check that all file descriptors were closed
428429
$this->fileMock->expects($this->exactly(count($expectedFile)))

0 commit comments

Comments
 (0)