Skip to content

Commit 68d2202

Browse files
author
Magento CICD
authored
merge magento/2.2-develop into magento-pangolin/MQE-1139-2.2
2 parents 0be104a + bb68603 commit 68d2202

File tree

20 files changed

+209
-98
lines changed

20 files changed

+209
-98
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Attribute.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class Attribute extends \Magento\Framework\Model\AbstractExtensibleModel implements
1919
\Magento\ConfigurableProduct\Api\Data\OptionInterface
2020
{
21-
/**#@+
21+
/**
2222
* Constants for field names
2323
*/
2424
const KEY_ATTRIBUTE_ID = 'attribute_id';
@@ -27,9 +27,10 @@ class Attribute extends \Magento\Framework\Model\AbstractExtensibleModel impleme
2727
const KEY_IS_USE_DEFAULT = 'is_use_default';
2828
const KEY_VALUES = 'values';
2929
const KEY_PRODUCT_ID = 'product_id';
30-
/**#@-*/
3130

32-
/**#@-*/
31+
/**
32+
* @var MetadataPool|\Magento\Framework\EntityManager\MetadataPool
33+
*/
3334
private $metadataPool;
3435

3536
/**
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Cron\Test\Unit\Model\System\Config\Initial;
9+
10+
use Magento\Cron\Model\Groups\Config\Data as GroupsConfigModel;
11+
use Magento\Cron\Model\System\Config\Initial\Converter as ConverterPlugin;
12+
use Magento\Framework\App\Config\Initial\Converter;
13+
14+
/**
15+
* Class ConverterTest
16+
*
17+
* Unit test for \Magento\Cron\Model\System\Config\Initial\Converter
18+
*/
19+
class ConverterTest extends \PHPUnit\Framework\TestCase
20+
{
21+
/**
22+
* @var GroupsConfigModel|\PHPUnit_Framework_MockObject_MockObject
23+
*/
24+
private $groupsConfigMock;
25+
26+
/**
27+
* @var Converter|\PHPUnit_Framework_MockObject_MockObject
28+
*/
29+
private $converterMock;
30+
31+
/**
32+
* @var ConverterPlugin
33+
*/
34+
private $converterPlugin;
35+
36+
/**
37+
* @inheritdoc
38+
*/
39+
protected function setUp()
40+
{
41+
$this->groupsConfigMock = $this->getMockBuilder(
42+
GroupsConfigModel::class
43+
)->disableOriginalConstructor()->getMock();
44+
$this->converterMock = $this->getMockBuilder(Converter::class)->getMock();
45+
$this->converterPlugin = new ConverterPlugin($this->groupsConfigMock);
46+
}
47+
48+
/**
49+
* Tests afterConvert method with no $result['data']['default']['system'] set
50+
*/
51+
public function testAfterConvertWithNoData()
52+
{
53+
$expectedResult = ['test'];
54+
$this->groupsConfigMock->expects($this->never())
55+
->method('get');
56+
57+
$result = $this->converterPlugin->afterConvert($this->converterMock, $expectedResult);
58+
59+
self::assertSame($expectedResult, $result);
60+
}
61+
62+
/**
63+
* Tests afterConvert method with $result['data']['default']['system'] set
64+
*/
65+
public function testAfterConvertWithData()
66+
{
67+
$groups = [
68+
'group1' => ['val1' => ['value' => '1']],
69+
'group2' => ['val2' => ['value' => '2']]
70+
];
71+
$expectedResult['data']['default']['system']['cron'] = [
72+
'group1' => [
73+
'val1' => '1'
74+
],
75+
'group2' => [
76+
'val2' => '2'
77+
]
78+
];
79+
$result['data']['default']['system']['cron'] = '1';
80+
81+
$this->groupsConfigMock->expects($this->once())
82+
->method('get')
83+
->willReturn($groups);
84+
85+
$result = $this->converterPlugin->afterConvert($this->converterMock, $result);
86+
87+
self::assertEquals($expectedResult, $result);
88+
}
89+
}

app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
namespace Magento\Customer\Controller\Adminhtml\Index;
77

88
use Magento\Backend\App\Action;
9+
use Magento\Customer\Api\CustomerRepositoryInterface;
10+
use Magento\Customer\Api\Data\CustomerInterface;
911
use Magento\Customer\Model\EmailNotificationInterface;
10-
use Magento\Customer\Test\Block\Form\Login;
1112
use Magento\Customer\Ui\Component\Listing\AttributeRepository;
12-
use Magento\Customer\Api\Data\CustomerInterface;
13-
use Magento\Customer\Api\CustomerRepositoryInterface;
13+
use Magento\Framework\Message\MessageInterface;
1414

1515
/**
16+
* Customer inline edit action
17+
*
1618
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1719
*/
1820
class InlineEdit extends \Magento\Backend\App\Action
@@ -101,7 +103,11 @@ private function getEmailNotification()
101103
}
102104

103105
/**
106+
* Inline edit action execute
107+
*
104108
* @return \Magento\Framework\Controller\Result\Json
109+
* @throws \Magento\Framework\Exception\LocalizedException
110+
* @throws \Magento\Framework\Exception\NoSuchEntityException
105111
*/
106112
public function execute()
107113
{
@@ -249,7 +255,7 @@ protected function processAddressData(array $data)
249255
protected function getErrorMessages()
250256
{
251257
$messages = [];
252-
foreach ($this->getMessageManager()->getMessages()->getItems() as $error) {
258+
foreach ($this->getMessageManager()->getMessages()->getErrors() as $error) {
253259
$messages[] = $error->getText();
254260
}
255261
return $messages;
@@ -262,7 +268,7 @@ protected function getErrorMessages()
262268
*/
263269
protected function isErrorExists()
264270
{
265-
return (bool)$this->getMessageManager()->getMessages(true)->getCount();
271+
return (bool)$this->getMessageManager()->getMessages(true)->getCountByType(MessageInterface::TYPE_ERROR);
266272
}
267273

268274
/**

app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index;
77

88
use Magento\Customer\Model\EmailNotificationInterface;
9+
use Magento\Framework\Message\MessageInterface;
910

1011
/**
1112
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -242,10 +243,11 @@ protected function prepareMocksForErrorMessagesProcessing()
242243
->method('getMessages')
243244
->willReturn($this->messageCollection);
244245
$this->messageCollection->expects($this->once())
245-
->method('getItems')
246+
->method('getErrors')
246247
->willReturn([$this->message]);
247248
$this->messageCollection->expects($this->once())
248-
->method('getCount')
249+
->method('getCountByType')
250+
->with(MessageInterface::TYPE_ERROR)
249251
->willReturn(1);
250252
$this->message->expects($this->once())
251253
->method('getText')

app/code/Magento/CustomerImportExport/Model/Export/Customer.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class Customer extends \Magento\ImportExport\Model\Export\Entity\AbstractEav
1717
{
18-
/**#@+
18+
/**
1919
* Permanent column names.
2020
*
2121
* Names that begins with underscore is not an attribute. This name convention is for
@@ -27,23 +27,19 @@ class Customer extends \Magento\ImportExport\Model\Export\Entity\AbstractEav
2727

2828
const COLUMN_STORE = '_store';
2929

30-
/**#@-*/
31-
32-
/**#@+
30+
/**
3331
* Attribute collection name
3432
*/
3533
const ATTRIBUTE_COLLECTION_NAME = \Magento\Customer\Model\ResourceModel\Attribute\Collection::class;
3634

37-
/**#@-*/
38-
39-
/**#@+
35+
/**
4036
* XML path to page size parameter
4137
*/
4238
const XML_PATH_PAGE_SIZE = 'export/customer_page_size/customer';
4339

44-
/**#@-*/
45-
46-
/**#@-*/
40+
/**
41+
* @var array
42+
*/
4743
protected $_attributeOverrides = [
4844
'created_at' => ['backend_type' => 'datetime'],
4945
'reward_update_notification' => ['source_model' => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::class],

app/code/Magento/InstantPurchase/Model/ShippingMethodChoose/CarrierFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Store\Model\StoreManagerInterface;
1212

1313
/**
14-
* Collect shipping rates for customer address without packaging estiamtion.
14+
* Collect shipping rates for customer address without packaging estimation.
1515
*/
1616
class CarrierFinder
1717
{

app/code/Magento/Multishipping/Helper/Data.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313
*/
1414
class Data extends \Magento\Framework\App\Helper\AbstractHelper
1515
{
16-
/**#@+
16+
/*
1717
* Xml paths for multishipping checkout
18+
*
1819
**/
1920
const XML_PATH_CHECKOUT_MULTIPLE_AVAILABLE = 'multishipping/options/checkout_multiple';
2021

2122
const XML_PATH_CHECKOUT_MULTIPLE_MAXIMUM_QUANTITY = 'multishipping/options/checkout_multiple_maximum_qty';
2223

23-
/**#@-*/
24-
25-
/**#@-*/
24+
/**
25+
* Checkout session
26+
*
27+
* @var \Magento\Checkout\Model\Session
28+
*/
2629
protected $checkoutSession;
2730

2831
/**

0 commit comments

Comments
 (0)