Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 0dfe22b

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'mainline/2.3-develop' into MAGETWO-92986
2 parents 9838f83 + 0c2fa6f commit 0dfe22b

File tree

65 files changed

+1523
-620
lines changed

Some content is hidden

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

65 files changed

+1523
-620
lines changed

app/code/Magento/Analytics/Test/Unit/ReportXml/DB/ReportValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ protected function setUp()
7979
* @dataProvider errorDataProvider
8080
* @param string $reportName
8181
* @param array $result
82-
* @param \PHPUnit_Framework_MockObject_Stub $queryReturnStub
82+
* @param \PHPUnit\Framework\MockObject\Stub $queryReturnStub
8383
*/
84-
public function testValidate($reportName, $result, \PHPUnit_Framework_MockObject_Stub $queryReturnStub)
84+
public function testValidate($reportName, $result, \PHPUnit\Framework\MockObject\Stub $queryReturnStub)
8585
{
8686
$connectionName = 'testConnection';
8787
$this->queryFactoryMock->expects($this->once())

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@
432432
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
433433
<backend_model>Magento\Config\Model\Config\Backend\Store</backend_model>
434434
<comment>
435-
<![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).]]>
435+
<![CDATA[<strong style="color:red">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).]]>
436436
</comment>
437437
</field>
438438
<field id="redirect_to_base" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ Web,Web
405405
"Url Options","Url Options"
406406
"Add Store Code to Urls","Add Store Code to Urls"
407407
"
408-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).
408+
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
409409
","
410-
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).
410+
<strong style=""color:red"">Warning!</strong> When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third-party services (e.g. PayPal etc.).
411411
"
412412
"Auto-redirect to Base URL","Auto-redirect to Base URL"
413413
"Search Engine Optimization","Search Engine Optimization"
@@ -447,7 +447,7 @@ Tags,Tags
447447
"<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>","<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>"
448448
"Community Edition","Community Edition"
449449
"Default Theme","Default Theme"
450-
"If no value is specified, the system default is used. The system default may be modified by third party extensions.","If no value is specified, the system default is used. The system default may be modified by third party extensions."
450+
"If no value is specified, the system default is used. The system default may be modified by third-party extensions.","If no value is specified, the system default is used. The system default may be modified by third-party extensions."
451451
"Applied Theme","Applied Theme"
452452
"Design Rule","Design Rule"
453453
"User Agent Rules","User Agent Rules"

app/code/Magento/Backend/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</settings>
1313
<field name="theme_theme_id" sortOrder="10" formElement="select">
1414
<settings>
15-
<notice translate="true">If no value is specified, the system default is used. The system default may be modified by third party extensions.</notice>
15+
<notice translate="true">If no value is specified, the system default is used. The system default may be modified by third-party extensions.</notice>
1616
<dataType>text</dataType>
1717
<label translate="true">Applied Theme</label>
1818
<dataScope>theme_theme_id</dataScope>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
*/
77
namespace Magento\Catalog\Controller\Adminhtml\Product\Set;
88

9+
use Magento\Framework\App\ObjectManager;
10+
11+
/**
12+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13+
*/
914
class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
1015
{
1116
/**
@@ -17,22 +22,49 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
1722
* @var \Magento\Framework\Controller\Result\JsonFactory
1823
*/
1924
protected $resultJsonFactory;
20-
25+
26+
/*
27+
* @var \Magento\Eav\Model\Entity\Attribute\SetFactory
28+
*/
29+
private $attributeSetFactory;
30+
31+
/*
32+
* @var \Magento\Framework\Filter\FilterManager
33+
*/
34+
private $filterManager;
35+
36+
/*
37+
* @var \Magento\Framework\Json\Helper\Data
38+
*/
39+
private $jsonHelper;
40+
2141
/**
2242
* @param \Magento\Backend\App\Action\Context $context
2343
* @param \Magento\Framework\Registry $coreRegistry
2444
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
2545
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
46+
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
47+
* @param \Magento\Framework\Filter\FilterManager $filterManager
48+
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
2649
*/
2750
public function __construct(
2851
\Magento\Backend\App\Action\Context $context,
2952
\Magento\Framework\Registry $coreRegistry,
3053
\Magento\Framework\View\LayoutFactory $layoutFactory,
31-
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
54+
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
55+
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory = null,
56+
\Magento\Framework\Filter\FilterManager $filterManager = null,
57+
\Magento\Framework\Json\Helper\Data $jsonHelper = null
3258
) {
3359
parent::__construct($context, $coreRegistry);
3460
$this->layoutFactory = $layoutFactory;
3561
$this->resultJsonFactory = $resultJsonFactory;
62+
$this->attributeSetFactory = $attributeSetFactory ?: ObjectManager::getInstance()
63+
->get(\Magento\Eav\Model\Entity\Attribute\SetFactory::class);
64+
$this->filterManager = $filterManager ?: ObjectManager::getInstance()
65+
->get(\Magento\Framework\Filter\FilterManager::class);
66+
$this->jsonHelper = $jsonHelper ?: ObjectManager::getInstance()
67+
->get(\Magento\Framework\Json\Helper\Data::class);
3668
}
3769

3870
/**
@@ -65,16 +97,12 @@ public function execute()
6597
$isNewSet = $this->getRequest()->getParam('gotoEdit', false) == '1';
6698

6799
/* @var $model \Magento\Eav\Model\Entity\Attribute\Set */
68-
$model = $this->_objectManager->create(\Magento\Eav\Model\Entity\Attribute\Set::class)
69-
->setEntityTypeId($entityTypeId);
70-
71-
/** @var $filterManager \Magento\Framework\Filter\FilterManager */
72-
$filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class);
100+
$model = $this->attributeSetFactory->create()->setEntityTypeId($entityTypeId);
73101

74102
try {
75103
if ($isNewSet) {
76104
//filter html tags
77-
$name = $filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
105+
$name = $this->filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
78106
$model->setAttributeSetName(trim($name));
79107
} else {
80108
if ($attributeSetId) {
@@ -85,11 +113,10 @@ public function execute()
85113
__('This attribute set no longer exists.')
86114
);
87115
}
88-
$data = $this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class)
89-
->jsonDecode($this->getRequest()->getPost('data'));
116+
$data = $this->jsonHelper->jsonDecode($this->getRequest()->getPost('data'));
90117

91118
//filter html tags
92-
$data['attribute_set_name'] = $filterManager->stripTags($data['attribute_set_name']);
119+
$data['attribute_set_name'] = $this->filterManager->stripTags($data['attribute_set_name']);
93120

94121
$model->organizeData($data);
95122
}

app/code/Magento/Catalog/Pricing/Price/RegularPrice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class RegularPrice extends AbstractPrice implements BasePriceProviderInterface
2222
/**
2323
* Get price value
2424
*
25-
* @return float|bool
25+
* @return float
2626
*/
2727
public function getValue()
2828
{
2929
if ($this->value === null) {
3030
$price = $this->product->getPrice();
3131
$priceInCurrentCurrency = $this->priceCurrency->convertAndRound($price);
32-
$this->value = $priceInCurrentCurrency ? floatval($priceInCurrentCurrency) : false;
32+
$this->value = $priceInCurrentCurrency ? floatval($priceInCurrentCurrency) : 0;
3333
}
3434
return $this->value;
3535
}

app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Magento\Customer\Model\Session;
1111
use Magento\Framework\App\Request\Http;
1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13-
use PHPUnit_Framework_MockObject_Builder_InvocationMocker as InvocationMocker;
14-
use PHPUnit_Framework_MockObject_Matcher_InvokedCount as InvokedCount;
13+
use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMocker;
14+
use PHPUnit\Framework\MockObject\Matcher\InvokedCount as InvokedCount;
1515
use PHPUnit_Framework_MockObject_MockObject as MockObject;
1616
use Magento\Checkout\Helper\Data;
1717
use Magento\Quote\Model\Quote;

app/code/Magento/Config/Test/Unit/Console/Command/ConfigShow/ValueProcessorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ protected function setUp()
7373

7474
/**
7575
* @param bool $hasBackendModel
76-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetBackendModel
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCreate
78-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetValue
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetPath
80-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScope
81-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScopeId
82-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetValue
83-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsAfterLoad
84-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSerialize
76+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetBackendModel
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsCreate
78+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetValue
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetPath
80+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScope
81+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScopeId
82+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetValue
83+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsAfterLoad
84+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSerialize
8585
* @param string $expectsValue
8686
* @param string $className
8787
* @param string $value

app/code/Magento/Config/Test/Unit/Model/Config/Structure/ElementVisibilityCompositeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function testException()
5151
}
5252

5353
/**
54-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
54+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
5555
* @param bool $firstResult
56-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
56+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
5757
* @param bool $secondResult
5858
* @param bool $expectedResult
5959
* @dataProvider visibilityDataProvider
@@ -74,9 +74,9 @@ public function testDisabled($firstExpects, $firstResult, $secondExpects, $secon
7474
}
7575

7676
/**
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
7878
* @param bool $firstResult
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
8080
* @param bool $secondResult
8181
* @param bool $expectedResult
8282
* @dataProvider visibilityDataProvider

app/code/Magento/Customer/Model/ResourceModel/Group/Collection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*/
1313
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1414
{
15+
/**
16+
* @var string
17+
*/
18+
protected $_idFieldName = 'customer_group_id';
19+
1520
/**
1621
* Resource initialization
1722
*

app/code/Magento/Customer/Model/ResourceModel/Group/Grid/Collection.php

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,62 @@
77
*/
88
namespace Magento\Customer\Model\ResourceModel\Group\Grid;
99

10-
class Collection extends \Magento\Customer\Model\ResourceModel\Group\Collection
10+
use Magento\Customer\Model\ResourceModel\Group\Collection as GroupCollection;
11+
use Magento\Framework\Api\Search\SearchResultInterface;
12+
use Magento\Framework\Search\AggregationInterface;
13+
14+
/**
15+
* Collection for displaying grid of customer groups
16+
*/
17+
class Collection extends GroupCollection implements SearchResultInterface
1118
{
19+
/**
20+
* @var AggregationInterface
21+
*/
22+
protected $aggregations;
23+
24+
/**
25+
* @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory
26+
* @param \Psr\Log\LoggerInterface $logger
27+
* @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
28+
* @param \Magento\Framework\Event\ManagerInterface $eventManager
29+
* @param string $mainTable
30+
* @param string $eventPrefix
31+
* @param string $eventObject
32+
* @param string $resourceModel
33+
* @param string $model
34+
* @param \Magento\Framework\DB\Adapter\AdapterInterface|string|null $connection
35+
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
36+
*
37+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
38+
*/
39+
public function __construct(
40+
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
41+
\Psr\Log\LoggerInterface $logger,
42+
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
43+
\Magento\Framework\Event\ManagerInterface $eventManager,
44+
$mainTable,
45+
$eventPrefix,
46+
$eventObject,
47+
$resourceModel,
48+
$model = \Magento\Framework\View\Element\UiComponent\DataProvider\Document::class,
49+
$connection = null,
50+
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
51+
) {
52+
parent::__construct(
53+
$entityFactory,
54+
$logger,
55+
$fetchStrategy,
56+
$eventManager,
57+
$connection,
58+
$resource
59+
);
60+
$this->_eventPrefix = $eventPrefix;
61+
$this->_eventObject = $eventObject;
62+
$this->_init($model, $resourceModel);
63+
$this->setMainTable($mainTable);
64+
}
65+
1266
/**
1367
* Resource initialization
1468
* @return $this
@@ -19,4 +73,78 @@ protected function _initSelect()
1973
$this->addTaxClass();
2074
return $this;
2175
}
76+
77+
/**
78+
* @return AggregationInterface
79+
*/
80+
public function getAggregations()
81+
{
82+
return $this->aggregations;
83+
}
84+
85+
/**
86+
* @param AggregationInterface $aggregations
87+
* @return $this
88+
*/
89+
public function setAggregations($aggregations)
90+
{
91+
$this->aggregations = $aggregations;
92+
return $this;
93+
}
94+
95+
/**
96+
* Get search criteria.
97+
*
98+
* @return \Magento\Framework\Api\SearchCriteriaInterface|null
99+
*/
100+
public function getSearchCriteria()
101+
{
102+
return null;
103+
}
104+
105+
/**
106+
* Set search criteria.
107+
*
108+
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
109+
* @return $this
110+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
111+
*/
112+
public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null)
113+
{
114+
return $this;
115+
}
116+
117+
/**
118+
* Get total count.
119+
*
120+
* @return int
121+
*/
122+
public function getTotalCount()
123+
{
124+
return $this->getSize();
125+
}
126+
127+
/**
128+
* Set total count.
129+
*
130+
* @param int $totalCount
131+
* @return $this
132+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
133+
*/
134+
public function setTotalCount($totalCount)
135+
{
136+
return $this;
137+
}
138+
139+
/**
140+
* Set items list.
141+
*
142+
* @param \Magento\Framework\Api\ExtensibleDataInterface[] $items
143+
* @return $this
144+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
145+
*/
146+
public function setItems(array $items = null)
147+
{
148+
return $this;
149+
}
22150
}

0 commit comments

Comments
 (0)