Skip to content

Commit e1994e0

Browse files
committed
MAGETWO-61628: [Backport] - Match products by rule in admin not working - for 2.0
1 parent 1079153 commit e1994e0

File tree

2 files changed

+29
-28
lines changed
  • app/code/Magento/Catalog

2 files changed

+29
-28
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
namespace Magento\Catalog\Controller\Adminhtml\Category;
7+
78
use Magento\Store\Model\StoreManagerInterface;
89

910
/**
@@ -227,7 +228,7 @@ public function execute()
227228
private function getStoreManager()
228229
{
229230
if ($this->storeManager == null) {
230-
$this->storeManager = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface');
231+
$this->storeManager = $this->_objectManager->get(StoreManagerInterface::class);
231232
}
232233

233234
return $this->storeManager;

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/SaveTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function setUp()
8787
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
8888

8989
$this->contextMock = $this->getMock(
90-
'Magento\Backend\App\Action\Context',
90+
\Magento\Backend\App\Action\Context::class,
9191
[
9292
'getTitle',
9393
'getRequest',
@@ -102,47 +102,47 @@ protected function setUp()
102102
false
103103
);
104104
$this->resultRedirectFactoryMock = $this->getMock(
105-
'Magento\Backend\Model\View\Result\RedirectFactory',
105+
\Magento\Backend\Model\View\Result\RedirectFactory::class,
106106
['create'],
107107
[],
108108
'',
109109
false
110110
);
111111
$this->resultRawFactoryMock = $this->getMock(
112-
'Magento\Framework\Controller\Result\RawFactory',
112+
\Magento\Framework\Controller\Result\RawFactory::class,
113113
[],
114114
[],
115115
'',
116116
false
117117
);
118118
$this->resultJsonFactoryMock = $this->getMock(
119-
'Magento\Framework\Controller\Result\JsonFactory',
119+
\Magento\Framework\Controller\Result\JsonFactory::class,
120120
['create'],
121121
[],
122122
'',
123123
false
124124
);
125125
$this->layoutFactoryMock = $this->getMock(
126-
'Magento\Framework\View\LayoutFactory',
126+
\Magento\Framework\View\LayoutFactory::class,
127127
['create'],
128128
[],
129129
'',
130130
false
131131
);
132132
$this->requestMock = $this->getMockForAbstractClass(
133-
'Magento\Framework\App\RequestInterface',
133+
\Magento\Framework\App\RequestInterface::class,
134134
[],
135135
'',
136136
false,
137137
true,
138138
true,
139139
['getParam', 'getPost', 'getPostValue']
140140
);
141-
$this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
141+
$this->objectManagerMock = $this->getMockBuilder(\Magento\Framework\ObjectManagerInterface::class)
142142
->disableOriginalConstructor()
143143
->getMock();
144144
$this->eventManagerMock = $this->getMockForAbstractClass(
145-
'Magento\Framework\Event\ManagerInterface',
145+
\Magento\Framework\Event\ManagerInterface::class,
146146
[],
147147
'',
148148
false,
@@ -151,13 +151,13 @@ protected function setUp()
151151
['dispatch']
152152
);
153153
$this->responseMock = $this->getMockForAbstractClass(
154-
'Magento\Framework\App\ResponseInterface',
154+
\Magento\Framework\App\ResponseInterface::class,
155155
[],
156156
'',
157157
false
158158
);
159159
$this->messageManagerMock = $this->getMockForAbstractClass(
160-
'Magento\Framework\Message\ManagerInterface',
160+
\Magento\Framework\Message\ManagerInterface::class,
161161
[],
162162
'',
163163
false,
@@ -177,7 +177,7 @@ protected function setUp()
177177
->willReturn($this->resultRedirectFactoryMock);
178178

179179
$this->save = $this->objectManager->getObject(
180-
'Magento\Catalog\Controller\Adminhtml\Category\Save',
180+
\Magento\Catalog\Controller\Adminhtml\Category\Save::class,
181181
[
182182
'context' => $this->contextMock,
183183
'resultRawFactory' => $this->resultRawFactoryMock,
@@ -212,7 +212,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
212212
* |\PHPUnit_Framework_MockObject_MockObject $resultRedirectMock
213213
*/
214214
$resultRedirectMock = $this->getMock(
215-
'Magento\Backend\Model\View\Result\Redirect',
215+
\Magento\Backend\Model\View\Result\Redirect::class,
216216
[],
217217
[],
218218
'',
@@ -223,7 +223,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
223223
* |\PHPUnit_Framework_MockObject_MockObject $blockMock
224224
*/
225225
$blockMock = $this->getMock(
226-
'Magento\Framework\View\Element\Messages',
226+
\Magento\Framework\View\Element\Messages::class,
227227
['setMessages', 'getGroupedHtml'],
228228
[],
229229
'',
@@ -234,7 +234,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
234234
* |\PHPUnit_Framework_MockObject_MockObject $categoryMock
235235
*/
236236
$categoryMock = $this->getMock(
237-
'Magento\Catalog\Model\Category',
237+
\Magento\Catalog\Model\Category::class,
238238
[
239239
'setStoreId',
240240
'load',
@@ -263,7 +263,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
263263
* |\PHPUnit_Framework_MockObject_MockObject $parentCategoryMock
264264
*/
265265
$parentCategoryMock = $this->getMock(
266-
'Magento\Catalog\Model\Category',
266+
\Magento\Catalog\Model\Category::class,
267267
[
268268
'setStoreId',
269269
'load',
@@ -287,7 +287,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
287287
* |\PHPUnit_Framework_MockObject_MockObject $sessionMock
288288
*/
289289
$sessionMock = $this->getMock(
290-
'Magento\Backend\Model\Auth\Session',
290+
\Magento\Backend\Model\Auth\Session::class,
291291
['setActiveTabId'],
292292
[],
293293
'',
@@ -298,7 +298,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
298298
* |\PHPUnit_Framework_MockObject_MockObject $registryMock
299299
*/
300300
$registryMock = $this->getMock(
301-
'Magento\Framework\Registry',
301+
\Magento\Framework\Registry::class,
302302
['register'],
303303
[],
304304
'',
@@ -309,7 +309,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
309309
* |\PHPUnit_Framework_MockObject_MockObject $wysiwygConfigMock
310310
*/
311311
$wysiwygConfigMock = $this->getMock(
312-
'Magento\Cms\Model\Wysiwyg\Config',
312+
\Magento\Cms\Model\Wysiwyg\Config::class,
313313
['setStoreId'],
314314
[],
315315
'',
@@ -320,7 +320,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
320320
* |\PHPUnit_Framework_MockObject_MockObject $storeManagerMock
321321
*/
322322
$storeManagerMock = $this->getMockForAbstractClass(
323-
'Magento\Store\Model\StoreManagerInterface',
323+
\Magento\Store\Model\StoreManagerInterface::class,
324324
[],
325325
'',
326326
false,
@@ -333,7 +333,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
333333
* |\PHPUnit_Framework_MockObject_MockObject $layoutMock
334334
*/
335335
$layoutMock = $this->getMockForAbstractClass(
336-
'Magento\Framework\View\Layout',
336+
\Magento\Framework\View\Layout::class,
337337
[],
338338
'',
339339
false,
@@ -346,7 +346,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
346346
* |\PHPUnit_Framework_MockObject_MockObject $resultJsonMock
347347
*/
348348
$resultJsonMock = $this->getMock(
349-
'Magento\Cms\Model\Wysiwyg\Config',
349+
\Magento\Cms\Model\Wysiwyg\Config::class,
350350
['setData'],
351351
[],
352352
'',
@@ -357,7 +357,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
357357
* |\PHPUnit_Framework_MockObject_MockObject $messagesMock
358358
*/
359359
$messagesMock = $this->getMock(
360-
'Magento\Framework\Message\Collection',
360+
\Magento\Framework\Message\Collection::class,
361361
[],
362362
[],
363363
'',
@@ -410,10 +410,10 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
410410
->will(
411411
$this->returnValueMap(
412412
[
413-
['Magento\Backend\Model\Auth\Session', $sessionMock],
414-
['Magento\Framework\Registry', $registryMock],
415-
['Magento\Cms\Model\Wysiwyg\Config', $wysiwygConfigMock],
416-
['Magento\Store\Model\StoreManagerInterface', $storeManagerMock],
413+
[\Magento\Backend\Model\Auth\Session::class, $sessionMock],
414+
[\Magento\Framework\Registry::class, $registryMock],
415+
[\Magento\Cms\Model\Wysiwyg\Config::class, $wysiwygConfigMock],
416+
[\Magento\Store\Model\StoreManagerInterface::class, $storeManagerMock],
417417
]
418418
)
419419
);
@@ -525,7 +525,7 @@ public function testExecute($categoryId, $storeId, $activeTabId, $parentId)
525525
);
526526

527527
$categoryResource = $this->getMock(
528-
'Magento\Catalog\Model\ResourceModel\Category',
528+
\Magento\Catalog\Model\ResourceModel\Category::class,
529529
[],
530530
[],
531531
'',

0 commit comments

Comments
 (0)