Skip to content

Commit 79bacd3

Browse files
committed
MAGETWO-57868: Search fails with an error when used user-defined price attribute as searchable - for mainline
2 parents 8949550 + 0cb8b17 commit 79bacd3

File tree

48 files changed

+842
-1257
lines changed

Some content is hidden

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

48 files changed

+842
-1257
lines changed

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testToHtml()
5353
->disableOriginalConstructor()
5454
->setMethods(['dispatch'])
5555
->getMock();
56-
$eventManager->expects($this->once())->method('dispatch')->will($this->returnValue(true));
56+
$eventManager->expects($this->exactly(2))->method('dispatch')->will($this->returnValue(true));
5757

5858
$scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config::class)
5959
->setMethods(['getValue'])

app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function testGetProductsCount()
186186

187187
protected function generalGetProductCollection()
188188
{
189-
$this->eventManager->expects($this->once())->method('dispatch')
189+
$this->eventManager->expects($this->exactly(2))->method('dispatch')
190190
->will($this->returnValue(true));
191191
$this->scopeConfig->expects($this->once())->method('getValue')->withAnyParameters()
192192
->willReturn(false);

app/code/Magento/CatalogInventory/Model/Stock/Status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getWebsiteId()
100100
*/
101101
public function getStockId()
102102
{
103-
return $this->getData(self::KEY_WEBSITE_ID);
103+
return $this->getData(self::KEY_STOCK_ID);
104104
}
105105

106106
/**

app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php

Lines changed: 177 additions & 397 deletions
Large diffs are not rendered by default.

app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,14 @@ public function testSetData()
245245
*/
246246
public function testSetDataWithMultidimensionalArray()
247247
{
248-
$this->markTestSkipped('Need to revert changes from MAGETWO-39106 and then modify this test.');
249248
$expected = [
250249
'key' => 'value',
251-
'array' => 'value1',
250+
'street' => 'value1',
252251
];
253252

254253
$key = [
255254
'key' => 'value',
256-
'array' => [
255+
'street' => [
257256
'key1' => 'value1',
258257
]
259258
];

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,13 +663,13 @@ public function getTemplateFilter()
663663
* Save current design config and replace with design config from specified store
664664
* Event is not dispatched.
665665
*
666-
* @param int|string $storeId
666+
* @param null|bool|int|string $storeId
667667
* @param string $area
668668
* @return void
669669
*/
670670
public function emulateDesign($storeId, $area = self::DEFAULT_DESIGN_AREA)
671671
{
672-
if ($storeId) {
672+
if ($storeId !== null && $storeId !== false) {
673673
// save current design settings
674674
$this->emulatedDesignConfig = clone $this->getDesignConfig();
675675
if (

app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,24 @@ public function testEmulateDesignAndRevertDesign()
331331
{
332332
$model = $this->getModelMock();
333333
$originalConfig = ['area' => 'some_area', 'store' => 1];
334-
$expectedConfig = ['area' => 'frontend', 'store' => 2];
335334
$model->setDesignConfig($originalConfig);
336335

337-
$model->emulateDesign(2);
338-
// assert config data has been emulated
339-
$this->assertEquals($expectedConfig, $model->getDesignConfig()->getData());
340-
341-
$model->revertDesign();
342-
// assert config data has been reverted to the original state
343-
$this->assertEquals($originalConfig, $model->getDesignConfig()->getData());
336+
$expectedConfigs = [
337+
['in' => ['area' => 'frontend', 'store' => null], 'out' => $originalConfig],
338+
['in' => ['area' => 'frontend', 'store' => false], 'out' => $originalConfig],
339+
['in' => ['area' => 'frontend', 'store' => 0], 'out' => ['area' => 'frontend', 'store' => 0]],
340+
['in' => ['area' => 'frontend', 'store' => 1], 'out' => ['area' => 'frontend', 'store' => 1]],
341+
['in' => ['area' => 'frontend', 'store' => 2], 'out' => ['area' => 'frontend', 'store' => 2]],
342+
];
343+
foreach ($expectedConfigs as $set) {
344+
$model->emulateDesign($set['in']['store'], $set['in']['area']);
345+
// assert config data has been emulated
346+
$this->assertEquals($set['out'], $model->getDesignConfig()->getData());
347+
348+
$model->revertDesign();
349+
// assert config data has been reverted to the original state
350+
$this->assertEquals($originalConfig, $model->getDesignConfig()->getData());
351+
}
344352
}
345353

346354
public function testGetDesignConfig()

app/code/Magento/Paypal/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ public function isOrderReviewStepDisabled()
866866
*/
867867
public function getExpressCheckoutStartUrl($token)
868868
{
869-
return sprintf('https://www.%spaypal.com/checkoutnow/2%s',
869+
return sprintf('https://www.%spaypal.com/checkoutnow%s',
870870
$this->getValue('sandboxFlag') ? 'sandbox.' : '',
871871
'?token=' . urlencode($token));
872872
}

app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,14 @@ public function testGetWizardPaymentMethodOptions()
235235
public function testToHtml()
236236
{
237237
$this->eventManager
238-
->expects($this->once())
238+
->expects($this->at(0))
239239
->method('dispatch')
240240
->with('view_block_abstract_to_html_before', ['block' => $this->block]);
241+
$transport = new \Magento\Framework\DataObject(['html' => '']);
242+
$this->eventManager
243+
->expects($this->at(1))
244+
->method('dispatch')
245+
->with('view_block_abstract_to_html_after', ['block' => $this->block, 'transport' => $transport]);
241246
$this->scopeConfig
242247
->expects($this->once())
243248
->method('getValue')

app/code/Magento/Persistent/Test/Unit/Block/Header/AdditionalTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,12 @@ public function testToHtml($customerId)
261261
$this->additional->setData('cache_lifetime', 789);
262262
$this->additional->setData('cache_key', 'cache-key');
263263

264-
$this->eventManagerMock->expects($this->once())
264+
$this->eventManagerMock->expects($this->at(0))
265265
->method('dispatch')
266266
->with('view_block_abstract_to_html_before', ['block' => $this->additional]);
267+
$this->eventManagerMock->expects($this->at(1))
268+
->method('dispatch')
269+
->with('view_block_abstract_to_html_after');
267270
$this->scopeConfigMock->expects($this->once())
268271
->method('getValue')
269272
->with(

0 commit comments

Comments
 (0)