Skip to content

Commit 9cd7866

Browse files
committed
Merge remote-tracking branch 'goinc/MAGETWO-31058' into MAGETWO-31159
2 parents 1fa9415 + cdcc72a commit 9cd7866

File tree

58 files changed

+360
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+360
-397
lines changed

app/code/Magento/Backend/Test/Unit/Model/Menu/Filter/IteratorTest.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ class IteratorTest extends \PHPUnit_Framework_TestCase
1212
*/
1313
protected $_menuModel;
1414

15-
/**
16-
* @var \Magento\Backend\Model\Menu\Filter\Iterator
17-
*/
18-
protected $_filterIteratorModel;
19-
2015
/**
2116
* @var \Magento\Backend\Model\Menu\Item[]
2217
*/
@@ -42,9 +37,6 @@ protected function setUp()
4237
$loggerMock = $this->getMock('Psr\Log\LoggerInterface');
4338

4439
$this->_menuModel = new \Magento\Backend\Model\Menu($loggerMock);
45-
$this->_filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
46-
$this->_menuModel->getIterator()
47-
);
4840
}
4941

5042
public function testLoopWithAllItemsDisabledDoesntIterate()
@@ -54,8 +46,12 @@ public function testLoopWithAllItemsDisabledDoesntIterate()
5446
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
5547
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
5648
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
49+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
50+
$this->_menuModel->getIterator()
51+
);
52+
5753
$items = [];
58-
foreach ($this->_filterIteratorModel as $item) {
54+
foreach ($filterIteratorModel as $item) {
5955
$items[] = $item;
6056
}
6157
$this->assertCount(0, $items);
@@ -70,9 +66,12 @@ public function testLoopIteratesOnlyValidItems()
7066

7167
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
7268
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
69+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
70+
$this->_menuModel->getIterator()
71+
);
7372

7473
$items = [];
75-
foreach ($this->_filterIteratorModel as $item) {
74+
foreach ($filterIteratorModel as $item) {
7675
$items[] = $item;
7776
}
7877
$this->assertCount(1, $items);
@@ -88,9 +87,12 @@ public function testLoopIteratesDosntIterateDisabledItems()
8887

8988
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
9089
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
90+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
91+
$this->_menuModel->getIterator()
92+
);
9193

9294
$items = [];
93-
foreach ($this->_filterIteratorModel as $item) {
95+
foreach ($filterIteratorModel as $item) {
9496
$items[] = $item;
9597
}
9698
$this->assertCount(1, $items);
@@ -106,9 +108,12 @@ public function testLoopIteratesDosntIterateNotAllowedItems()
106108

107109
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
108110
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
111+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
112+
$this->_menuModel->getIterator()
113+
);
109114

110115
$items = [];
111-
foreach ($this->_filterIteratorModel as $item) {
116+
foreach ($filterIteratorModel as $item) {
112117
$items[] = $item;
113118
}
114119
$this->assertCount(1, $items);
@@ -125,9 +130,12 @@ public function testLoopIteratesMixedItems()
125130

126131
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
127132
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
133+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
134+
$this->_menuModel->getIterator()
135+
);
128136

129137
$items = [];
130-
foreach ($this->_filterIteratorModel as $item) {
138+
foreach ($filterIteratorModel as $item) {
131139
$items[] = $item;
132140
}
133141
$this->assertCount(1, $items);

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public function validate($processingParams, $option)
150150

151151
$upload->addFilter(new \Zend_Filter_File_Rename(['target' => $fileFullPath, 'overwrite' => true]));
152152

153-
// TODO: I don't know how change this
154153
if (!is_null($this->product)) {
155154
$this->product->getTypeInstance()->addFileQueue(
156155
[

app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveBillingTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ protected function setUp()
144144

145145
$this->resultJson = $this->getMockBuilder('Magento\Framework\Controller\Result\JSON')
146146
->disableOriginalConstructor()
147+
->setMethods(['setData'])
147148
->getMock();
148149
$resultJsonFactory = $this->getMockBuilder('Magento\Framework\Controller\Result\JSONFactory')
149150
->disableOriginalConstructor()

app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveShippingTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ protected function setUp()
144144

145145
$this->resultJson = $this->getMockBuilder('Magento\Framework\Controller\Result\Json')
146146
->disableOriginalConstructor()
147+
->setMethods(['setData'])
147148
->getMock();
148149
$resultJsonFactory = $this->getMockBuilder('Magento\Framework\Controller\Result\JsonFactory')
149150
->disableOriginalConstructor()

app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/EditTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function setUp()
5353
'Magento\Cms\Block\Adminhtml\Block\Edit',
5454
[
5555
'registry' => $this->registryMock,
56-
'escaper' => $this->escaperMock
56+
'escaper' => $this->escaperMock,
5757
]
5858
);
5959
}
@@ -91,7 +91,7 @@ public function getHeaderTextDataProvider()
9191
{
9292
return [
9393
'modelBlockId NOT EMPTY' => ['modelBlockId' => 1],
94-
'modelBlockId IS EMPTY' => ['modelBlockId' => null]
94+
'modelBlockId IS EMPTY' => ['modelBlockId' => null],
9595
];
9696
}
9797
}

app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class ConfirmTest extends \PHPUnit_Framework_TestCase
2020
{
2121
/**
22-
* @var \Magento\Customer\Controller\Account
22+
* @var \Magento\Customer\Controller\Account\Confirm
2323
*/
2424
protected $model;
2525

@@ -171,7 +171,7 @@ protected function setUp()
171171
'customerRepository' => $this->customerRepositoryMock,
172172
'addressHelper' => $this->addressHelperMock,
173173
'urlFactory' => $urlFactoryMock,
174-
'resultRedirectFactory' => $redirectFactoryMock
174+
'resultRedirectFactory' => $redirectFactoryMock,
175175
]
176176
);
177177
}
@@ -426,7 +426,7 @@ public function getSuccessRedirectDataProvider()
426426
'http://example.com/success',
427427
'http://example.com/success',
428428
true,
429-
__('Thank you for registering with')
429+
__('Thank you for registering with'),
430430
],
431431
[
432432
1,
@@ -435,7 +435,7 @@ public function getSuccessRedirectDataProvider()
435435
'http://example.com/success',
436436
'http://example.com/success',
437437
false,
438-
__('Thank you for registering with')
438+
__('Thank you for registering with'),
439439
],
440440
];
441441
}

app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function getStatusFilters($product)
262262
if (!$product->hasData($this->_keyStatusFilters)) {
263263
return [
264264
\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED,
265-
\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED
265+
\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED,
266266
];
267267
}
268268
return $product->getData($this->_keyStatusFilters);

app/code/Magento/Indexer/Test/Unit/Model/Config/ConverterTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,4 @@ public function testConvert()
2525

2626
$this->assertEquals($data['expected'], $this->_model->convert($dom));
2727
}
28-
29-
/**
30-
* @param string $xmlData
31-
* @dataProvider wrongXmlDataProvider
32-
* @expectedException \Exception
33-
*/
34-
public function testMapThrowsExceptionWhenXmlHasWrongFormat($xmlData)
35-
{
36-
$dom = new \DOMDocument();
37-
$dom->loadXML($xmlData);
38-
$this->_model->convert($dom);
39-
}
40-
41-
/**
42-
* @return array
43-
*/
44-
public function wrongXmlDataProvider()
45-
{
46-
return [['<?xml version="1.0"?><config>']];
47-
}
4828
}

app/code/Magento/Indexer/Test/Unit/Model/Resource/AbstractResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public function testSyncData()
8686

8787
/**
8888
* @expectedException \Exception
89-
* @expectedExceptionMessage array_keys() expects parameter 1 to be array, null given
9089
*/
9190
public function testSyncDataException()
9291
{
9392
$connectionMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false);
9493
$this->_resourceMock->expects($this->any())->method('getConnection')->will($this->returnValue($connectionMock));
9594
$this->_resourceMock->expects($this->any())->method('getTableName')->will($this->returnArgument(0));
95+
$connectionMock->expects($this->once())->method('rollback');
9696
$this->model->syncData();
9797
}
9898

app/code/Magento/Sales/Test/Unit/Model/Order/Total/Config/BaseTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ public function testGetTotalModelsSortingSubroutine()
114114
$this->returnValue([
115115
'some_code' => ['instance' => 'Magento\Sales\Model\Order\Total\AbstractTotal', 'sort_order' => 1903],
116116
'other_code' => ['instance' => 'Magento\Sales\Model\Order\Total\AbstractTotal', 'sort_order' => 1112],
117-
'equal_order' => ['instance' => 'Magento\Sales\Model\Order\Total\AbstractTotal', 'sort_order' => 1112],
118117
'big_order' => ['instance' => 'Magento\Sales\Model\Order\Total\AbstractTotal', 'sort_order' => 3000],
119-
'no_order' => ['instance' => 'Magento\Sales\Model\Order\Total\AbstractTotal'],
120118
])
121119
);
122120

@@ -126,8 +124,6 @@ public function testGetTotalModelsSortingSubroutine()
126124

127125
$this->assertSame(
128126
[
129-
'no_order' => $total,
130-
'equal_order' => $total,
131127
'other_code' => $total,
132128
'some_code' => $total,
133129
'big_order' => $total,

app/code/Magento/Webapi/Model/Soap/Server.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ class Server
1414
/**#@+
1515
* Path in config to Webapi settings.
1616
*/
17-
const CONFIG_PATH_WSDL_CACHE_ENABLED = 'webapi/soap/wsdl_cache_enabled';
18-
1917
const CONFIG_PATH_SOAP_CHARSET = 'webapi/soap/charset';
20-
2118
/**#@-*/
19+
2220
const REQUEST_PARAM_SERVICES = 'services';
2321

2422
const REQUEST_PARAM_WSDL = 'wsdl';
@@ -101,16 +99,6 @@ public function __construct(
10199
$this->_soapServerFactory = $soapServerFactory;
102100
$this->_typeProcessor = $typeProcessor;
103101
$this->_scopeConfig = $scopeConfig;
104-
/** Enable or disable SOAP extension WSDL cache depending on Magento configuration. */
105-
$wsdlCacheEnabled = $this->_scopeConfig->isSetFlag(
106-
self::CONFIG_PATH_WSDL_CACHE_ENABLED,
107-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
108-
);
109-
if ($wsdlCacheEnabled) {
110-
ini_set('soap.wsdl_cache_enabled', '1');
111-
} else {
112-
ini_set('soap.wsdl_cache_enabled', '0');
113-
}
114102
}
115103

116104
/**

app/code/Magento/Webapi/etc/adminhtml/system.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
<label>Default Response Charset</label>
2020
<comment>If empty, UTF-8 will be used.</comment>
2121
</field>
22-
<field id="wsdl_cache_enabled" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
23-
<label>Enable WSDL Cache</label>
24-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
25-
<backend_model>Magento\Config\Model\Config\Backend\Store</backend_model>
26-
</field>
2722
</group>
2823
</section>
2924
</system>

app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,11 @@ public function testExecuteWithoutProduct()
182182
->with('product')
183183
->willReturn(2);
184184

185-
$exception = $this->getMock('Magento\Framework\Exception\NoSuchEntityException', [], [], '', false);
186185
$this->productRepository
187186
->expects($this->once())
188187
->method('getById')
189188
->with(2)
190-
->willThrowException($exception);
189+
->willThrowException(new \Magento\Framework\Exception\NoSuchEntityException());
191190

192191
$this->messageManager
193192
->expects($this->once())
@@ -369,16 +368,15 @@ public function testExecuteAddSuccessException()
369368
->with('wishlist_update_item', ['wishlist' => $wishlist, 'product' => $product, 'item' => $item])
370369
->willReturn(true);
371370

372-
$exception = $this->getMock('\Magento\Framework\Exception\LocalizedException', [], [], '', false);
373371
$this->messageManager
374372
->expects($this->once())
375373
->method('addSuccess')
376374
->with('Test name has been updated in your wish list.', null)
377-
->willThrowException($exception);
375+
->willThrowException(new \Magento\Framework\Exception\LocalizedException('error-message'));
378376
$this->messageManager
379377
->expects($this->once())
380378
->method('addError')
381-
->with('', null)
379+
->with('error-message', null)
382380
->willReturn(true);
383381

384382
$this->redirect
@@ -399,7 +397,7 @@ public function testExecuteAddSuccessCriticalException()
399397
$item = $this->getMock('Magento\Wishlist\Model\Item', [], [], '', false);
400398
$helper = $this->getMock('Magento\Wishlist\Helper\Data', [], [], '', false);
401399
$logger = $this->getMock('Magento\Framework\Logger\Monolog', [], [], '', false);
402-
$exception = $this->getMock('Exception', [], [], '', false);
400+
$exception = new \Exception();
403401

404402
$logger
405403
->expects($this->once())

dev/tests/integration/framework/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$installConfigFile = $installConfigFile . '.dist';
3333
}
3434
$sandboxUniqueId = md5(sha1_file($installConfigFile));
35-
$installDir = "{$testsTmpDir}/sandbox-{$sandboxUniqueId}";
35+
$installDir = "{$testsTmpDir}/sandbox-{$settings->get('TESTS_PARALLEL_THREAD', 0)}-{$sandboxUniqueId}";
3636
$application = new \Magento\TestFramework\Application(
3737
$shell,
3838
$installDir,

0 commit comments

Comments
 (0)