Skip to content

Commit 765823e

Browse files
committed
MAGETWO-37935: Bugfix PR
- fixes for L1
1 parent 061bdf5 commit 765823e

File tree

17 files changed

+108
-62
lines changed

17 files changed

+108
-62
lines changed

app/code/Magento/Backend/Test/Unit/App/UserConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class UserConfigTest extends \PHPUnit_Framework_TestCase
1010
{
1111
public function testUserRequestCreation()
1212
{
13-
$factoryMock = $this->getMock('Magento\Config\Model\Config\Factory', [], [], '', false);
13+
$factoryMock = $this->getMock('Magento\Config\Model\Config\Factory', ['create'], [], '', false);
1414
$responseMock = $this->getMock('Magento\Framework\App\Console\Response', [], [], '', false);
1515
$configMock = $this->getMock('Magento\Config\Model\Config', [], [], '', false);
1616

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected function setUp()
177177
);
178178
$this->orderFactoryMock = $this->getMock(
179179
'Magento\Sales\Model\OrderFactory',
180-
[],
180+
['create'],
181181
[],
182182
'',
183183
false

app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public function setUp()
9494
->getMock();
9595
$this->backupModelFactoryMock = $this->getMockBuilder('Magento\Backup\Model\BackupFactory')
9696
->disableOriginalConstructor()
97+
->setMethods(['create'])
9798
->getMock();
9899
$this->backupModelMock = $this->getMockBuilder('Magento\Backup\Model\Backup')
99100
->disableOriginalConstructor()

app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class PriceTest extends \PHPUnit_Framework_TestCase
6262
protected function setUp()
6363
{
6464
$this->ruleFactoryMock = $this->getMock(
65-
'\Magento\CatalogRule\Model\Resource\RuleFactory',
66-
[],
65+
'Magento\CatalogRule\Model\Resource\RuleFactory',
66+
['create'],
6767
[],
6868
'',
6969
false
@@ -77,8 +77,20 @@ protected function setUp()
7777
$this->priceCurrency = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface')->getMock();
7878
$this->groupManagement = $this->getMockBuilder('Magento\Customer\Api\GroupManagementInterface')
7979
->getMockForAbstractClass();
80-
$gpFactory = $this->getMock('Magento\Catalog\Api\Data\ProductGroupPriceInterfaceFactory', [], [], '', false);
81-
$tpFactory = $this->getMock('Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory', [], [], '', false);
80+
$gpFactory = $this->getMock(
81+
'Magento\Catalog\Api\Data\ProductGroupPriceInterfaceFactory',
82+
['create'],
83+
[],
84+
'',
85+
false
86+
);
87+
$tpFactory = $this->getMock(
88+
'Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory',
89+
['create'],
90+
[],
91+
'',
92+
false
93+
);
8294
$scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface');
8395

8496
$objectManagerHelper = new ObjectManagerHelper($this);

app/code/Magento/Captcha/Test/Unit/Helper/DataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testGetCaptcha()
7171
new \Magento\Captcha\Model\DefaultModel(
7272
$this->getMock('Magento\Framework\Session\SessionManager', [], [], '', false),
7373
$this->getMock('Magento\Captcha\Helper\Data', [], [], '', false),
74-
$this->getMock('Magento\Captcha\Model\Resource\LogFactory', [], [], '', false),
74+
$this->getMock('Magento\Captcha\Model\Resource\LogFactory', ['create'], [], '', false),
7575
'user_create'
7676
)
7777
)

app/code/Magento/Captcha/Test/Unit/Model/CronTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function setUp()
6969
);
7070

7171
$this->_model = new \Magento\Captcha\Model\Cron(
72-
$this->getMock('Magento\Captcha\Model\Resource\LogFactory', [], [], '', false),
72+
$this->getMock('Magento\Captcha\Model\Resource\LogFactory', ['create'], [], '', false),
7373
$this->_helper,
7474
$this->_adminHelper,
7575
$this->_filesystem,

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/Edit/FormTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function setUp()
8282
);
8383
$this->categoryFactoryMock = $this->getMock(
8484
'Magento\Catalog\Model\CategoryFactory',
85-
[],
85+
['create'],
8686
[],
8787
'',
8888
false

app/code/Magento/Catalog/Test/Unit/Block/Product/View/OptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testGetOptionHtml()
5959

6060
$optValFactoryMock = $this->getMock(
6161
'Magento\Catalog\Model\Product\Option\ValueFactory',
62-
[],
62+
['create'],
6363
[],
6464
'',
6565
false

app/code/Magento/Catalog/Test/Unit/Controller/Product/Compare/IndexTest.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class IndexTest extends \PHPUnit_Framework_TestCase
6969

7070
protected function setUp()
7171
{
72-
$this->contextMock = $this->getMock('Magento\Framework\App\Action\Context',
72+
$this->contextMock = $this->getMock(
73+
'Magento\Framework\App\Action\Context',
7374
['getRequest', 'getResponse', 'getResultRedirectFactory'],
7475
[],
7576
'',
@@ -90,10 +91,16 @@ protected function setUp()
9091
->method('getResultRedirectFactory')
9192
->willReturn($this->redirectFactoryMock);
9293

93-
$this->itemFactoryMock = $this->getMock('Magento\Catalog\Model\Product\Compare\ItemFactory', [], [], '', false);
94+
$this->itemFactoryMock = $this->getMock(
95+
'Magento\Catalog\Model\Product\Compare\ItemFactory',
96+
['create'],
97+
[],
98+
'',
99+
false
100+
);
94101
$this->collectionFactoryMock = $this->getMock(
95102
'Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory',
96-
[],
103+
['create'],
97104
[],
98105
'',
99106
false
@@ -131,10 +138,12 @@ public function testExecute()
131138
$beforeUrl = 'test_url';
132139
$this->request->expects($this->any())
133140
->method('getParam')
134-
->willReturnMap([
141+
->willReturnMap(
142+
[
135143
['items', null, null],
136144
['uenc', null, $beforeUrl],
137-
]);
145+
]
146+
);
138147
$this->decoderMock->expects($this->once())
139148
->method('decode')
140149
->with($beforeUrl)
@@ -152,10 +161,12 @@ public function testExecuteWithItems()
152161
{
153162
$this->request->expects($this->any())
154163
->method('getParam')
155-
->willReturnMap([
164+
->willReturnMap(
165+
[
156166
['items', null, '1,2,3'],
157167
['uenc', null, null],
158-
]);
168+
]
169+
);
159170
$this->decoderMock->expects($this->never())->method('decode');
160171
$this->catalogSession->expects($this->never())->method('setBeforeCompareUrl');
161172

app/code/Magento/Catalog/Test/Unit/Helper/Product/Flat/IndexerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ public function setUp()
6565

6666
$resourceConfigFactoryMock = $this->getMock(
6767
'Magento\Catalog\Model\Resource\ConfigFactory',
68-
[],
68+
['create'],
6969
[],
7070
'',
7171
false
7272
);
7373

74-
$eavFactoryMock = $this->getMock('Magento\Eav\Model\Entity\AttributeFactory', [], [], '', false);
74+
$eavFactoryMock = $this->getMock('Magento\Eav\Model\Entity\AttributeFactory', ['create'], [], '', false);
7575

7676
$this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface');
7777

0 commit comments

Comments
 (0)