diff --git a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php
index 2fbfc43aa8775..f49911c3e7a93 100644
--- a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php
+++ b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php
@@ -62,6 +62,9 @@ public function testGetIdentity($expectedSum, $cacheTypes)
$this->assertEquals($expectedSum, $this->_messageModel->getIdentity());
}
+ /**
+ * @return array
+ */
public function getIdentityDataProvider()
{
$cacheTypeMock1 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
@@ -95,6 +98,9 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes)
$this->assertEquals($expected, $this->_messageModel->isDisplayed());
}
+ /**
+ * @return array
+ */
public function isDisplayedDataProvider()
{
$cacheTypesMock = $this->createPartialMock(\stdClass::class, ['getCacheType']);
diff --git a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php
index 2c259db868851..b490efd8e9683 100644
--- a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php
+++ b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php
@@ -72,6 +72,9 @@ public function testIsDisplayed($expectedFirstRun, $data)
$this->assertEquals($expectedFirstRun, $model->isDisplayed());
}
+ /**
+ * @return array
+ */
public function isDisplayedDataProvider()
{
return [
diff --git a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php
index 1e71570a5e30b..c6f61fee862ba 100644
--- a/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php
+++ b/app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php
@@ -76,6 +76,9 @@ public function testIsDisplayed($expectedResult, $cached, $response)
$this->assertEquals($expectedResult, $this->_messageModel->isDisplayed());
}
+ /**
+ * @return array
+ */
public function isDisplayedDataProvider()
{
return [
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
index 62a7aefa77550..3122a0a7ee648 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
@@ -103,7 +103,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
* @param ImportProduct\StoreResolver $storeResolver
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
- * @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -192,6 +191,7 @@ protected function initTypeModels()
* Export process
*
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
public function export()
{
@@ -461,6 +461,7 @@ protected function getTierPrices(array $productLinksIds, $table)
*
* @param int $websiteId
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _getWebsiteCode(int $websiteId): string
{
@@ -491,6 +492,8 @@ protected function _getWebsiteCode(int $websiteId): string
* @param int $customerGroupId
* @param int $allGroups
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _getCustomerGroupById(
int $customerGroupId,
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
index 0e8acb37104e6..754f5fd6c8c20 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
@@ -8,7 +8,6 @@
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
-use Magento\Framework\App\ResourceConnection;
/**
* Class AdvancedPricing
@@ -619,6 +618,7 @@ protected function processCountNewPrices(array $tierPrices)
* Get product entity link field
*
* @return string
+ * @throws \Exception
*/
private function getProductEntityLinkField()
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
index 25a9fc244fe51..d939a3f7c392e 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
@@ -28,6 +28,7 @@ public function __construct($validators = [])
*
* @param array $value
* @return bool
+ * @throws \Zend_Validate_Exception
*/
public function isValid($value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
index 48b4c58918740..c927aad6ac714 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
@@ -213,7 +213,7 @@ protected function setUp()
'_getCustomerGroupById',
'correctExportData'
]);
- $this->advancedPricing = $this->getMockbuilder(
+ $this->advancedPricing = $this->getMockBuilder(
\Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing::class
)
->setMethods($mockMethods)
@@ -347,6 +347,7 @@ protected function tearDown()
* @param $object
* @param $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -362,6 +363,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
+ * @return mixed
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
index bb64acb558320..2c930237da831 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
@@ -181,6 +181,9 @@ public function testIsValidAddMessagesCall($value, $hasEmptyColumns, $customerGr
$this->tierPrice->isValid($value);
}
+ /**
+ * @return array
+ */
public function isValidResultFalseDataProvider()
{
return [
@@ -286,6 +289,9 @@ public function isValidResultFalseDataProvider()
];
}
+ /**
+ * @return array
+ */
public function isValidAddMessagesCallDataProvider()
{
return [
@@ -340,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
* @param object $object
* @param string $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -357,6 +364,7 @@ protected function getPropertyValue($object, $property)
* @param string $property
* @param mixed $value
* @return object
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php
index 9a380ff75da24..b46e286e75007 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php
@@ -114,6 +114,9 @@ public function testGetAllWebsitesValue()
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public function isValidReturnDataProvider()
{
return [
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php
index d9fce98826105..5ca534284a48d 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php
@@ -77,6 +77,9 @@ public function testInit()
$this->validator->init(null);
}
+ /**
+ * @return array
+ */
public function isValidDataProvider()
{
return [
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
index 6d130d93ee6a5..15a3ae3a22d4a 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
@@ -209,6 +209,10 @@ public function testGetEntityTypeCode()
* Test method validateRow against its result.
*
* @dataProvider validateRowResultDataProvider
+ * @param array $rowData
+ * @param string|null $behavior
+ * @param bool $expectedResult
+ * @throws \ReflectionException
*/
public function testValidateRowResult($rowData, $behavior, $expectedResult)
{
@@ -234,6 +238,10 @@ public function testValidateRowResult($rowData, $behavior, $expectedResult)
* Test method validateRow whether AddRowError is called.
*
* @dataProvider validateRowAddRowErrorCallDataProvider
+ * @param array $rowData
+ * @param string|null $behavior
+ * @param string $error
+ * @throws \ReflectionException
*/
public function testValidateRowAddRowErrorCall($rowData, $behavior, $error)
{
@@ -324,6 +332,13 @@ public function testSaveAdvancedPricing()
* Take into consideration different data and check relative internal calls.
*
* @dataProvider saveAndReplaceAdvancedPricesAppendBehaviourDataProvider
+ * @param array $data
+ * @param string $tierCustomerGroupId
+ * @param string $groupCustomerGroupId
+ * @param string $tierWebsiteId
+ * @param string $groupWebsiteId
+ * @param array $expectedTierPrices
+ * @throws \ReflectionException
*/
public function testSaveAndReplaceAdvancedPricesAppendBehaviourDataAndCalls(
$data,
@@ -768,6 +783,9 @@ public function testSaveProductPrices($priceData, $oldSkus, $priceIn, $callNum)
$this->invokeMethod($this->advancedPricing, 'saveProductPrices', [$priceData, 'table']);
}
+ /**
+ * @return array
+ */
public function saveProductPricesDataProvider()
{
return [
@@ -839,6 +857,9 @@ public function testDeleteProductTierPrices(
);
}
+ /**
+ * @return array
+ */
public function deleteProductTierPricesDataProvider()
{
return [
@@ -921,6 +942,9 @@ public function testProcessCountExistingPrices(
$this->invokeMethod($this->advancedPricing, 'processCountExistingPrices', [$prices, 'table']);
}
+ /**
+ * @return array
+ */
public function processCountExistingPricesDataProvider()
{
return [
@@ -947,6 +971,7 @@ public function processCountExistingPricesDataProvider()
* @param $object
* @param $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -963,6 +988,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
+ * @return mixed
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
@@ -981,7 +1008,8 @@ protected function setPropertyValue(&$object, $property, $value)
* @param string $method
* @param array $args
*
- * @return mixed the method result.
+ * @return mixed
+ * @throws \ReflectionException
*/
private function invokeMethod($object, $method, $args = [])
{
@@ -998,6 +1026,7 @@ private function invokeMethod($object, $method, $args = [])
* @param array $methods
*
* @return \PHPUnit_Framework_MockObject_MockObject
+ * @throws \ReflectionException
*/
private function getAdvancedPricingMock($methods = [])
{
diff --git a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/AdditionalCommentTest.php b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/AdditionalCommentTest.php
index cbf06264096ac..407e323aeaae6 100644
--- a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/AdditionalCommentTest.php
+++ b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/AdditionalCommentTest.php
@@ -65,11 +65,11 @@ public function testRender()
->method('getLabel')
->willReturn('Comment label');
$html = $this->additionalComment->render($this->abstractElementMock);
- $this->assertRegexp(
+ $this->assertRegExp(
"/New comment/",
$html
);
- $this->assertRegexp(
+ $this->assertRegExp(
"/Comment label/",
$html
);
diff --git a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php
index a652cf6b3d548..54612076a757f 100644
--- a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php
+++ b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php
@@ -73,7 +73,7 @@ public function testRender()
$this->abstractElementMock->expects($this->any())
->method('getComment')
->willReturn('Eastern Standard Time (America/New_York)');
- $this->assertRegexp(
+ $this->assertRegExp(
"/Eastern Standard Time \(America\/New_York\)/",
$this->collectionTimeLabel->render($this->abstractElementMock)
);
diff --git a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php
index 09e753e4ac8aa..0806187ebac01 100644
--- a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php
+++ b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php
@@ -77,7 +77,7 @@ public function testRender()
$this->abstractElementMock->expects($this->any())
->method('getComment')
->willReturn('Subscription status: Enabled');
- $this->assertRegexp(
+ $this->assertRegExp(
"/Subscription status: Enabled/",
$this->subscriptionStatusLabel->render($this->abstractElementMock)
);
diff --git a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php
index abce48c36c86a..6a0cecc781062 100644
--- a/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php
+++ b/app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php
@@ -65,7 +65,7 @@ public function testRender()
->method('getHint')
->willReturn('New hint');
$html = $this->vertical->render($this->abstractElementMock);
- $this->assertRegexp(
+ $this->assertRegExp(
"/New comment/",
$html
);
diff --git a/app/code/Magento/Analytics/Test/Unit/ReportXml/QueryTest.php b/app/code/Magento/Analytics/Test/Unit/ReportXml/QueryTest.php
index a4b08a9ce5e0a..fd924abdd9f44 100644
--- a/app/code/Magento/Analytics/Test/Unit/ReportXml/QueryTest.php
+++ b/app/code/Magento/Analytics/Test/Unit/ReportXml/QueryTest.php
@@ -49,7 +49,7 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();
- $this->selectHydratorMock = $this->getMockBuilder(selectHydrator::class)
+ $this->selectHydratorMock = $this->getMockBuilder(SelectHydrator::class)
->disableOriginalConstructor()
->getMock();
diff --git a/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php b/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php
index bd1a3616a746e..58720ad9c9f5c 100644
--- a/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php
+++ b/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php
@@ -78,6 +78,9 @@ public function testGetAllowedResourcesByUser()
);
}
+ /**
+ * @return AclRetriever
+ */
protected function createAclRetriever()
{
$this->roleMock = $this->createPartialMock(\Magento\Authorization\Model\Role::class, ['getId', '__wakeup']);
diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/ResponseTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/ResponseTest.php
index 6e5d55e52675e..b4274e87401ca 100644
--- a/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/ResponseTest.php
+++ b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/ResponseTest.php
@@ -37,6 +37,9 @@ public function testGenerateHash($merchantMd5, $merchantApiLogin, $amount, $amou
);
}
+ /**
+ * @return array
+ */
public function generateHashDataProvider()
{
return [
@@ -57,6 +60,14 @@ public function generateHashDataProvider()
];
}
+ /**
+ * @param $merchantMd5
+ * @param $merchantApiLogin
+ * @param $amount
+ * @param $transactionId
+ *
+ * @return string
+ */
protected function generateHash($merchantMd5, $merchantApiLogin, $amount, $transactionId)
{
return strtoupper(md5($merchantMd5 . $merchantApiLogin . $transactionId . $amount));
diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php
index ac470238e588f..13b104c5ec4c0 100644
--- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php
+++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php
@@ -37,8 +37,6 @@ public function execute()
try {
$model->delete();
- $this->_eventManager->dispatch('store_delete', ['store' => $model]);
-
$this->messageManager->addSuccess(__('You deleted the store view.'));
return $redirectResult->setPath('adminhtml/*/');
} catch (\Magento\Framework\Exception\LocalizedException $e) {
diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php
index 1d6862a6ff845..8ca783f887ec4 100644
--- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php
+++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php
@@ -46,7 +46,6 @@ private function processWebsiteSave($postData)
*/
private function processStoreSave($postData)
{
- $eventName = 'store_edit';
/** @var \Magento\Store\Model\Store $storeModel */
$storeModel = $this->_objectManager->create(\Magento\Store\Model\Store::class);
$postData['store']['name'] = $this->filterManager->removeTags($postData['store']['name']);
@@ -56,7 +55,6 @@ private function processStoreSave($postData)
$storeModel->setData($postData['store']);
if ($postData['store']['store_id'] == '') {
$storeModel->setId(null);
- $eventName = 'store_add';
}
$groupModel = $this->_objectManager->create(
\Magento\Store\Model\Group::class
@@ -70,8 +68,6 @@ private function processStoreSave($postData)
);
}
$storeModel->save();
- $this->_objectManager->get(\Magento\Store\Model\StoreManager::class)->reinitStores();
- $this->_eventManager->dispatch($eventName, ['store' => $storeModel]);
$this->messageManager->addSuccess(__('You saved the store view.'));
return $postData;
@@ -102,7 +98,6 @@ private function processGroupSave($postData)
);
}
$groupModel->save();
- $this->_eventManager->dispatch('store_group_save', ['group' => $groupModel]);
$this->messageManager->addSuccess(__('You saved the store.'));
return $postData;
diff --git a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php
index 7e4c426de9452..88b994a6b93b7 100644
--- a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php
+++ b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php
@@ -146,6 +146,9 @@ public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForw
$this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request));
}
+ /**
+ * @return array
+ */
public function processNotLoggedInUserDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php
index 2f808eaf2d1b8..d793a80cdeacf 100644
--- a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php
+++ b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php
@@ -74,6 +74,9 @@ public function testBeforeDispatchWhenMassactionPrepareKeyRequestExists($postDat
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
+ /**
+ * @return array
+ */
public function beforeDispatchDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/App/Action/Stub/ActionStub.php b/app/code/Magento/Backend/Test/Unit/App/Action/Stub/ActionStub.php
index 4eff6218961af..2d60bef3f3e8c 100644
--- a/app/code/Magento/Backend/Test/Unit/App/Action/Stub/ActionStub.php
+++ b/app/code/Magento/Backend/Test/Unit/App/Action/Stub/ActionStub.php
@@ -8,6 +8,9 @@
class ActionStub extends \Magento\Backend\App\Action
{
+ /**
+ * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
+ */
public function execute()
{
// Empty method stub for test
diff --git a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php
index bc7dce6f20bac..642c6283decae 100644
--- a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php
+++ b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php
@@ -118,6 +118,9 @@ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminU
$this->assertEquals($this->model->isHostBackend(), $expectedValue);
}
+ /**
+ * @return array
+ */
public function hostsDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php b/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php
index 114c57867badf..53640a81e722f 100644
--- a/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php
+++ b/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php
@@ -70,6 +70,9 @@ public function testIsSetFlag($configPath, $configValue, $expectedResult)
$this->assertEquals($expectedResult, $this->model->isSetFlag($configPath));
}
+ /**
+ * @return array
+ */
public function isSetFlagDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/AnchorRendererTest.php b/app/code/Magento/Backend/Test/Unit/Block/AnchorRendererTest.php
index f52f4ab337712..eccb08e788a95 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/AnchorRendererTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/AnchorRendererTest.php
@@ -141,6 +141,9 @@ public function testRenderAnchorLevelIsNotOne($hasTarget)
);
}
+ /**
+ * @return array
+ */
public function targetDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Cache/AdditionalTest.php b/app/code/Magento/Backend/Test/Unit/Block/Cache/AdditionalTest.php
index 160cfe609f85f..7a56536eaef44 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Cache/AdditionalTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Cache/AdditionalTest.php
@@ -88,6 +88,9 @@ public function testIsInProductionMode($mode, $expected)
$this->assertEquals($expected, $this->additonalBlock->isInProductionMode());
}
+ /**
+ * @return array
+ */
public function isInProductionModeDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/GlobalSearchTest.php b/app/code/Magento/Backend/Test/Unit/Block/GlobalSearchTest.php
index 0010ffad87524..f08a0098578b9 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/GlobalSearchTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/GlobalSearchTest.php
@@ -103,6 +103,9 @@ public function testGetEntitiesToShow(array $results, int $expectedEntitiesQty)
$this->assertSame($expectedEntitiesQty, count($this->globalSearch->getEntitiesToShow()));
}
+ /**
+ * @return array
+ */
public function getEntitiesToShowDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/MenuItemCheckerTest.php b/app/code/Magento/Backend/Test/Unit/Block/MenuItemCheckerTest.php
index a79050faeb84a..aca719b2e65e9 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/MenuItemCheckerTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/MenuItemCheckerTest.php
@@ -74,6 +74,9 @@ public function testIsItemActiveLevelNotZero()
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php
index bcf5d1adbc12b..e64d1a97af4ae 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php
@@ -61,6 +61,9 @@ public function testGetAttributesHtml($data, $expect)
$this->assertRegExp($expect, $attributes);
}
+ /**
+ * @return array
+ */
public function getAttributesHtmlDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/Radio/ExtendedTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/Radio/ExtendedTest.php
index 35e21d7d194aa..81f104dbb636b 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/Radio/ExtendedTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/Radio/ExtendedTest.php
@@ -54,6 +54,9 @@ public function testRender(array $rowData, $expectedResult)
$this->assertEquals($expectedResult, $this->_object->render(new \Magento\Framework\DataObject($rowData)));
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/RadioTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/RadioTest.php
index 67ead0ddd8f35..6f838634c6bed 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/RadioTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/RadioTest.php
@@ -63,6 +63,9 @@ public function testRender(array $rowData, $expectedResult)
$this->assertEquals($expectedResult, $this->_object->render(new \Magento\Framework\DataObject($rowData)));
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php
index c5c56fd75fbe7..2e6bed4783e7f 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php
@@ -86,6 +86,9 @@ public function testGetSortable($value)
$this->assertFalse($this->_block->getSortable());
}
+ /**
+ * @return array
+ */
public function getSortableDataProvider()
{
return ['zero' => ['0'], 'false' => [false], 'null' => [null]];
@@ -374,6 +377,9 @@ public function testColumnIsGrouped($groupedData, $expected)
$this->assertEquals($expected, $block->isGrouped());
}
+ /**
+ * @return array
+ */
public function columnGroupedDataProvider()
{
return [[[], false], [['grouped' => 0], false], [['grouped' => 1], true]];
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Massaction/ExtendedTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Massaction/ExtendedTest.php
index 4525de1fee542..f81928c4540ba 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Massaction/ExtendedTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Massaction/ExtendedTest.php
@@ -152,6 +152,9 @@ public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
$this->assertEquals($result, $this->_block->getGridIdsJson());
}
+ /**
+ * @return array
+ */
public function dataProviderGetGridIdsJsonWithUseSelectAll()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php
index 29ce448a04ecb..e8143b5f6b43a 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php
@@ -243,6 +243,9 @@ public function testSelected($param, $expectedJson, $expected)
$this->assertEquals($expected, $this->_block->getSelected());
}
+ /**
+ * @return array
+ */
public function selectedDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/TabTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/TabTest.php
index 1670233324f8e..ad7c6fa99afd2 100644
--- a/app/code/Magento/Backend/Test/Unit/Block/Widget/TabTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/TabTest.php
@@ -34,6 +34,9 @@ public function testGetters($method, $field, $value, $expected)
$this->assertEquals($expected, $object->{$method}());
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php b/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php
index b7a33ab883b69..50c3a8571b48f 100644
--- a/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php
@@ -60,6 +60,9 @@ public function testPrepareFilterStringValues(array $inputString, array $expecte
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function getPrepareFilterStringValuesDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php
index 391deac5a1f4e..f1a4bc355b08e 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php
@@ -120,6 +120,9 @@ public function testRefreshAcl($isUserPassedViaParams)
$this->assertSame($aclMock, $this->session->getAcl());
}
+ /**
+ * @return array
+ */
public function refreshAclDataProvider()
{
return [
@@ -234,6 +237,9 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect
$this->assertEquals($expectedResult, $this->session->isAllowed('resource'));
}
+ /**
+ * @return array
+ */
public function isAllowedDataProvider()
{
return [
@@ -254,6 +260,9 @@ public function testFirstPageAfterLogin($isFirstPageAfterLogin)
$this->assertEquals($isFirstPageAfterLogin, $this->session->isFirstPageAfterLogin());
}
+ /**
+ * @return array
+ */
public function firstPageAfterLoginDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php b/app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php
index 2f0102ffd410d..4695ef00d5d05 100755
--- a/app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php
@@ -28,6 +28,9 @@ public function testBeforeSave($value, $errorMessage = null)
$this->assertEquals($model, $object);
}
+ /**
+ * @return array
+ */
public function adminSessionLifetimeDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php
index bc18bd44f4be4..a6b728ceb392f 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php
@@ -140,6 +140,9 @@ public function testGetMenuExceptionLogged($expectedException)
$this->model->getMenu();
}
+ /**
+ * @return array
+ */
public function getMenuExceptionLoggedDataProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Item/ValidatorTest.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/Item/ValidatorTest.php
index 3c1f1e43900be..dec85f4b98e3d 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Item/ValidatorTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Item/ValidatorTest.php
@@ -79,6 +79,9 @@ public function testValidateWithMissingRequiredParamThrowsException($requiredPar
}
}
+ /**
+ * @return array
+ */
public function requiredParamsProvider()
{
return [['id'], ['title'], ['resource']];
@@ -102,6 +105,9 @@ public function testValidateWithNonValidPrimitivesThrowsException($param, $inval
}
}
+ /**
+ * @return array
+ */
public function invalidParamsProvider()
{
return [
diff --git a/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php b/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php
index 23d1ed5da1425..5d026a2b1fc32 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php
@@ -35,6 +35,9 @@ public function testAfterGetResult($isPub, $times)
);
}
+ /**
+ * @return array
+ */
public function afterGetResultDataProvider()
{
return [[true, 1], [false, 0],];
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php b/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
index 49fcdf4fc8770..00ae8c2f44a69 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php
@@ -136,6 +136,9 @@ public function testSetSessionSettingsByConstructor($secureRequest)
$this->assertSame($secureRequest, $adminConfig->getCookieSecure());
}
+ /**
+ * @return array
+ */
public function requestSecureDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Widget/Grid/ParserTest.php b/app/code/Magento/Backend/Test/Unit/Model/Widget/Grid/ParserTest.php
index 569c5ffc16c9c..98f1965477b2c 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Widget/Grid/ParserTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Widget/Grid/ParserTest.php
@@ -58,6 +58,9 @@ public function testIsOperation($operation, $expected)
$this->assertEquals($expected, $this->_model->isOperation($operation));
}
+ /**
+ * @return array
+ */
public function isOperationDataProvider()
{
return [
diff --git a/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
index e89e604867baa..32abeac4c8ffb 100644
--- a/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
@@ -85,7 +85,7 @@ public function handle(array $handlingSubject, array $response)
private function getCreditCardType($type)
{
$replaced = str_replace(' ', '-', strtolower($type));
- $mapper = $this->config->getCctypesMapper();
+ $mapper = $this->config->getCcTypesMapper();
return $mapper[$replaced];
}
diff --git a/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
index 89bf7f14692b0..ca46e3b0ab93c 100644
--- a/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
@@ -156,7 +156,7 @@ private function convertDetailsToJSON($details)
private function getCreditCardType($type)
{
$replaced = str_replace(' ', '-', strtolower($type));
- $mapper = $this->config->getCctypesMapper();
+ $mapper = $this->config->getCcTypesMapper();
return $mapper[$replaced];
}
diff --git a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
index 6ab69923760ce..5c4a1c9598d1d 100644
--- a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
+++ b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
@@ -70,7 +70,7 @@ public function getConfig()
self::CODE => [
'isActive' => $this->config->isActive($storeId),
'clientToken' => $this->getClientToken(),
- 'ccTypesMapper' => $this->config->getCctypesMapper(),
+ 'ccTypesMapper' => $this->config->getCcTypesMapper(),
'sdkUrl' => $this->config->getSdkUrl(),
'countrySpecificCardTypes' => $this->config->getCountrySpecificCardTypeConfig($storeId),
'availableCardTypes' => $this->config->getAvailableCardTypes($storeId),
diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
index 7b9d59a5bc482..36ea3aea465dd 100644
--- a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
@@ -142,7 +142,7 @@ public function testGetCcTypesMapper($value, $expected)
static::assertEquals(
$expected,
- $this->model->getCctypesMapper()
+ $this->model->getCcTypesMapper()
);
}
diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/Items/RendererTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/Items/RendererTest.php
index 414b460a1b81d..473fbbd035b00 100644
--- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/Items/RendererTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/Items/RendererTest.php
@@ -46,6 +46,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
$this->assertSame(null, $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenEmptyItemsDataProvider()
{
return [
@@ -97,6 +100,9 @@ public function testGetChildren($parentItem)
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenDataProvider()
{
return [
@@ -116,6 +122,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isShipmentSeparately());
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithoutItemDataProvider()
{
return [
@@ -145,6 +154,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare
$this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithItemDataProvider()
{
return [
@@ -166,6 +178,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isChildCalculated());
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithoutItemDataProvider()
{
return [
@@ -195,6 +210,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI
$this->assertSame($result, $this->model->isChildCalculated($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithItemDataProvider()
{
return [
@@ -257,6 +275,9 @@ public function testCanShowPriceInfo($parentItem, $productOptions, $result)
$this->assertSame($result, $this->model->canShowPriceInfo($this->orderItem));
}
+ /**
+ * @return array
+ */
public function canShowPriceInfoDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/View/Items/RendererTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/View/Items/RendererTest.php
index 95dcb48f84be1..5d8cabdd8c1b9 100644
--- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/View/Items/RendererTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/View/Items/RendererTest.php
@@ -41,6 +41,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isShipmentSeparately());
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithoutItemDataProvider()
{
return [
@@ -70,6 +73,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare
$this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithItemDataProvider()
{
return [
@@ -91,6 +97,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isChildCalculated());
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithoutItemDataProvider()
{
return [
@@ -120,6 +129,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI
$this->assertSame($result, $this->model->isChildCalculated($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithItemDataProvider()
{
return [
@@ -151,6 +163,9 @@ public function testGetSelectionAttributesWithBundle()
$this->assertEquals($unserializedResult, $this->model->getSelectionAttributes($this->orderItem));
}
+ /**
+ * @return array
+ */
public function getSelectionAttributesDataProvider()
{
return [
@@ -184,6 +199,9 @@ public function testCanShowPriceInfo($parentItem, $productOptions, $result)
$this->assertSame($result, $this->model->canShowPriceInfo($this->orderItem));
}
+ /**
+ * @return array
+ */
public function canShowPriceInfoDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php
index 2353dc8251b6a..0f36049a86cac 100644
--- a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php
@@ -330,6 +330,11 @@ private function updateBundleBlock($options, $priceInfo, $priceType)
->will($this->returnArgument(0));
}
+ /**
+ * @param $price
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getPriceInfoMock($price)
{
$priceInfoMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceInfo\Base::class)
@@ -354,6 +359,11 @@ private function getPriceInfoMock($price)
return $priceInfoMock;
}
+ /**
+ * @param $prices
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getPriceMock($prices)
{
$methods = [];
diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Sales/Order/Items/RendererTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Sales/Order/Items/RendererTest.php
index d79afdddfb7ae..2f5dcef391063 100644
--- a/app/code/Magento/Bundle/Test/Unit/Block/Sales/Order/Items/RendererTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Block/Sales/Order/Items/RendererTest.php
@@ -47,6 +47,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
$this->assertSame(null, $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenEmptyItemsDataProvider()
{
return [
@@ -96,6 +99,9 @@ public function testGetChildren($parentItem)
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenDataProvider()
{
return [
@@ -115,6 +121,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isShipmentSeparately());
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithoutItemDataProvider()
{
return [
@@ -144,6 +153,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare
$this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithItemDataProvider()
{
return [
@@ -165,6 +177,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isChildCalculated());
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithoutItemDataProvider()
{
return [
@@ -194,6 +209,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI
$this->assertSame($result, $this->model->isChildCalculated($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithItemDataProvider()
{
return [
@@ -238,6 +256,9 @@ public function testCanShowPriceInfo($parentItem, $productOptions, $result)
$this->assertSame($result, $this->model->canShowPriceInfo($this->orderItem));
}
+ /**
+ * @return array
+ */
public function canShowPriceInfoDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php
index ecce34363819e..3e9aeaed5c5b4 100644
--- a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php
@@ -49,6 +49,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
$this->assertSame(null, $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenEmptyItemsDataProvider()
{
return [
@@ -97,6 +100,9 @@ public function testGetChildren($parentItem)
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
}
+ /**
+ * @return array
+ */
public function getChildrenDataProvider()
{
return [
@@ -116,6 +122,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isShipmentSeparately());
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithoutItemDataProvider()
{
return [
@@ -146,6 +155,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare
$this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isShipmentSeparatelyWithItemDataProvider()
{
return [
@@ -167,6 +179,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result)
$this->assertSame($result, $this->model->isChildCalculated());
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithoutItemDataProvider()
{
return [
@@ -197,6 +212,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI
$this->assertSame($result, $this->model->isChildCalculated($this->orderItem));
}
+ /**
+ * @return array
+ */
public function isChildCalculatedWithItemDataProvider()
{
return [
@@ -217,6 +235,9 @@ public function testGetBundleOptions($productOptions, $result)
$this->assertSame($result, $this->model->getBundleOptions());
}
+ /**
+ * @return array
+ */
public function getBundleOptionsDataProvider()
{
return [
@@ -277,6 +298,9 @@ public function testCanShowPriceInfo($parentItem, $productOptions, $result)
$this->assertSame($result, $this->model->canShowPriceInfo($this->orderItem));
}
+ /**
+ * @return array
+ */
public function canShowPriceInfoDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php
index f7f6b30daa300..8d29908b75280 100644
--- a/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php
@@ -585,6 +585,9 @@ public function testGetOptionsAmount($searchMin, $useRegularPrice)
$this->assertEquals($expectedResult, $result, 'Incorrect result');
}
+ /**
+ * @return array
+ */
public function getOptionsAmountDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php
index 26a7b46683330..2d8a73164008b 100644
--- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php
@@ -145,6 +145,9 @@ private function prepareOptionMocks($selectionCollection)
->will($this->returnValue($priceTypeMock));
}
+ /**
+ * @return array
+ */
public function getOptionsDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php
index 700bfd4f3c084..cbcfb1b85fc97 100644
--- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php
@@ -103,6 +103,9 @@ protected function setUp()
$this->setupSelectionPrice();
}
+ /**
+ * @param bool $useRegularPrice
+ */
protected function setupSelectionPrice($useRegularPrice = false)
{
$this->selectionPrice = new \Magento\Bundle\Pricing\Price\BundleSelectionPrice(
@@ -339,6 +342,9 @@ public function testFixedPriceWithMultipleQty($useRegularPrice)
$this->assertEquals($expectedPrice, $selectionPrice->getValue());
}
+ /**
+ * @return array
+ */
public function useRegularPriceDataProvider()
{
return [
diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/BundleDataProviderTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/BundleDataProviderTest.php
index 7b4d42568f686..1c3cf33cbf73b 100644
--- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/BundleDataProviderTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/BundleDataProviderTest.php
@@ -76,6 +76,9 @@ protected function setUp()
->getMock();
}
+ /**
+ * @return object
+ */
protected function getModel()
{
return $this->objectManager->getObject(BundleDataProvider::class, [
diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php
index 013ec3a467104..c66e27ea41025 100644
--- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php
+++ b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php
@@ -84,6 +84,9 @@ public function testSendPurgeRequest($hosts)
$this->assertTrue($this->model->sendPurgeRequest('tags'));
}
+ /**
+ * @return array
+ */
public function sendPurgeRequestDataProvider()
{
return [
diff --git a/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php b/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php
index 429c13e802a87..0500b29f787c2 100644
--- a/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php
+++ b/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php
@@ -354,6 +354,9 @@ public function testIsShownToLoggedInUser($expectedResult, $formId)
$this->assertEquals($expectedResult, $captcha->isShownToLoggedInUser());
}
+ /**
+ * @return array
+ */
public function isShownToLoggedInUserDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
index dfbaf3a62420a..e9c383901b5ff 100644
--- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
+++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
@@ -196,7 +196,7 @@ public function setCollection($collection)
$this->_collection->addAttributeToSort(
$this->getCurrentOrder(),
$this->getCurrentDirection()
- )->addAttributeToSort('entity_id', $this->getCurrentDirection());
+ );
} else {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
index 962cd52d39338..9384397b67f93 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
@@ -38,7 +38,11 @@ public function execute()
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();
- return $resultJson->setData(['id' => $categoryId, 'path' => $category->getPath()]);
+ return $resultJson->setData([
+ 'id' => $categoryId,
+ 'path' => $category->getPath(),
+ 'parentId' => $category->getParentId(),
+ ]);
}
}
}
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
index 3c07f081a0ce0..fb08070be5494 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
@@ -138,6 +138,9 @@ public function execute()
$parentId = isset($categoryPostData['parent']) ? $categoryPostData['parent'] : null;
if ($categoryPostData) {
$category->addData($categoryPostData);
+ if ($parentId) {
+ $category->setParentId($parentId);
+ }
if ($isNewCategory) {
$parentCategory = $this->getParentCategory($parentId, $storeId);
$category->setPath($parentCategory->getPath());
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php
index 98d5182bbadb2..b9f9b739f4fa3 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php
@@ -115,6 +115,7 @@ public function execute()
{
$data = $this->getRequest()->getPostValue();
if ($data) {
+ $this->preprocessOptionsData($data);
$setId = $this->getRequest()->getParam('set');
$attributeSet = null;
@@ -210,7 +211,7 @@ public function execute()
$data['attribute_code'] = $model->getAttributeCode();
$data['is_user_defined'] = $model->getIsUserDefined();
- $data['frontend_input'] = $model->getFrontendInput();
+ $data['frontend_input'] = $data['frontend_input'] ?? $model->getFrontendInput();
} else {
/**
* @todo add to helper and specify all relations for properties
@@ -311,6 +312,28 @@ public function execute()
return $this->returnResult('catalog/*/', [], ['error' => true]);
}
+ /**
+ * Extract options data from serialized options field and append to data array.
+ *
+ * This logic is required to overcome max_input_vars php limit
+ * that may vary and/or be inaccessible to change on different instances.
+ *
+ * @param array $data
+ * @return void
+ */
+ private function preprocessOptionsData(&$data)
+ {
+ if (isset($data['serialized_options'])) {
+ $serializedOptions = json_decode($data['serialized_options'], JSON_OBJECT_AS_ARRAY);
+ foreach ($serializedOptions as $serializedOption) {
+ $option = [];
+ parse_str($serializedOption, $option);
+ $data = array_replace_recursive($data, $option);
+ }
+ }
+ unset($data['serialized_options']);
+ }
+
/**
* @param string $path
* @param array $params
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php
index 4fa61b2b372c2..125406061aed7 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php
@@ -11,6 +11,9 @@
use Magento\Store\Model\StoreFactory;
use Psr\Log\LoggerInterface as Logger;
use Magento\Framework\Registry;
+use Magento\Catalog\Api\ProductRepositoryInterface;
+use Magento\Catalog\Model\Product;
+use Magento\Catalog\Model\Product\Type as ProductTypes;
class Builder
{
@@ -39,6 +42,11 @@ class Builder
*/
protected $storeFactory;
+ /**
+ * @var ProductRepositoryInterface
+ */
+ private $productRepository;
+
/**
* Constructor
*
@@ -47,13 +55,15 @@ class Builder
* @param Registry $registry
* @param WysiwygModel\Config $wysiwygConfig
* @param StoreFactory|null $storeFactory
+ * @param ProductRepositoryInterface|null $productRepository
*/
public function __construct(
ProductFactory $productFactory,
Logger $logger,
Registry $registry,
WysiwygModel\Config $wysiwygConfig,
- StoreFactory $storeFactory = null
+ StoreFactory $storeFactory = null,
+ ProductRepositoryInterface $productRepository = null
) {
$this->productFactory = $productFactory;
$this->logger = $logger;
@@ -61,6 +71,8 @@ public function __construct(
$this->wysiwygConfig = $wysiwygConfig;
$this->storeFactory = $storeFactory ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Store\Model\StoreFactory::class);
+ $this->productRepository = $productRepository ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(ProductRepositoryInterface::class);
}
/**
@@ -68,40 +80,62 @@ public function __construct(
*
* @param RequestInterface $request
* @return \Magento\Catalog\Model\Product
+ * @throws \RuntimeException
*/
public function build(RequestInterface $request)
{
- $productId = (int)$request->getParam('id');
- /** @var $product \Magento\Catalog\Model\Product */
- $product = $this->productFactory->create();
- $product->setStoreId($request->getParam('store', 0));
- $store = $this->storeFactory->create();
- $store->load($request->getParam('store', 0));
-
+ $productId = (int) $request->getParam('id');
+ $storeId = $request->getParam('store', 0);
+ $attributeSetId = (int) $request->getParam('set');
$typeId = $request->getParam('type');
- if (!$productId && $typeId) {
- $product->setTypeId($typeId);
- }
- $product->setData('_edit_mode', true);
if ($productId) {
try {
- $product->load($productId);
+ $product = $this->productRepository->getById($productId, true, $storeId);
} catch (\Exception $e) {
- $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE);
+ $product = $this->createEmptyProduct(ProductTypes::DEFAULT_TYPE, $attributeSetId, $storeId);
$this->logger->critical($e);
}
+ } else {
+ $product = $this->createEmptyProduct($typeId, $attributeSetId, $storeId);
}
- $setId = (int)$request->getParam('set');
- if ($setId) {
- $product->setAttributeSetId($setId);
- }
+ $store = $this->storeFactory->create();
+ $store->load($storeId);
$this->registry->register('product', $product);
$this->registry->register('current_product', $product);
$this->registry->register('current_store', $store);
- $this->wysiwygConfig->setStoreId($request->getParam('store'));
+
+ $this->wysiwygConfig->setStoreId($storeId);
+
+ return $product;
+ }
+
+ /**
+ * @param int $typeId
+ * @param int $attributeSetId
+ * @param int $storeId
+ * @return \Magento\Catalog\Model\Product
+ */
+ private function createEmptyProduct($typeId, $attributeSetId, $storeId): Product
+ {
+ /** @var $product \Magento\Catalog\Model\Product */
+ $product = $this->productFactory->create();
+ $product->setData('_edit_mode', true);
+
+ if ($typeId !== null) {
+ $product->setTypeId($typeId);
+ }
+
+ if ($storeId !== null) {
+ $product->setStoreId($storeId);
+ }
+
+ if ($attributeSetId) {
+ $product->setAttributeSetId($attributeSetId);
+ }
+
return $product;
}
}
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php
index 00a836309e58e..dfddcf7e92b97 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php
@@ -6,6 +6,11 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product\Set;
+use Magento\Framework\App\ObjectManager;
+
+/**
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
{
/**
@@ -17,22 +22,49 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
protected $resultJsonFactory;
-
+
+ /*
+ * @var \Magento\Eav\Model\Entity\Attribute\SetFactory
+ */
+ private $attributeSetFactory;
+
+ /*
+ * @var \Magento\Framework\Filter\FilterManager
+ */
+ private $filterManager;
+
+ /*
+ * @var \Magento\Framework\Json\Helper\Data
+ */
+ private $jsonHelper;
+
/**
* @param \Magento\Backend\App\Action\Context $context
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
+ * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
+ * @param \Magento\Framework\Filter\FilterManager $filterManager
+ * @param \Magento\Framework\Json\Helper\Data $jsonHelper
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $coreRegistry,
\Magento\Framework\View\LayoutFactory $layoutFactory,
- \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
+ \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
+ \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory = null,
+ \Magento\Framework\Filter\FilterManager $filterManager = null,
+ \Magento\Framework\Json\Helper\Data $jsonHelper = null
) {
parent::__construct($context, $coreRegistry);
$this->layoutFactory = $layoutFactory;
$this->resultJsonFactory = $resultJsonFactory;
+ $this->attributeSetFactory = $attributeSetFactory ?: ObjectManager::getInstance()
+ ->get(\Magento\Eav\Model\Entity\Attribute\SetFactory::class);
+ $this->filterManager = $filterManager ?: ObjectManager::getInstance()
+ ->get(\Magento\Framework\Filter\FilterManager::class);
+ $this->jsonHelper = $jsonHelper ?: ObjectManager::getInstance()
+ ->get(\Magento\Framework\Json\Helper\Data::class);
}
/**
@@ -65,16 +97,12 @@ public function execute()
$isNewSet = $this->getRequest()->getParam('gotoEdit', false) == '1';
/* @var $model \Magento\Eav\Model\Entity\Attribute\Set */
- $model = $this->_objectManager->create(\Magento\Eav\Model\Entity\Attribute\Set::class)
- ->setEntityTypeId($entityTypeId);
-
- /** @var $filterManager \Magento\Framework\Filter\FilterManager */
- $filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class);
+ $model = $this->attributeSetFactory->create()->setEntityTypeId($entityTypeId);
try {
if ($isNewSet) {
//filter html tags
- $name = $filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
+ $name = $this->filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
$model->setAttributeSetName(trim($name));
} else {
if ($attributeSetId) {
@@ -85,11 +113,10 @@ public function execute()
__('This attribute set no longer exists.')
);
}
- $data = $this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class)
- ->jsonDecode($this->getRequest()->getPost('data'));
+ $data = $this->jsonHelper->jsonDecode($this->getRequest()->getPost('data'));
//filter html tags
- $data['attribute_set_name'] = $filterManager->stripTags($data['attribute_set_name']);
+ $data['attribute_set_name'] = $this->filterManager->stripTags($data['attribute_set_name']);
$model->organizeData($data);
}
diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php
index 4ccea0436f2d8..90027ffb65a58 100644
--- a/app/code/Magento/Catalog/Helper/Product/View.php
+++ b/app/code/Magento/Catalog/Helper/Product/View.php
@@ -113,10 +113,9 @@ private function preparePageMetadata(ResultPage $resultPage, $product)
{
$pageConfig = $resultPage->getConfig();
- $title = $product->getMetaTitle();
- if ($title) {
- $pageConfig->getTitle()->set($title);
- }
+ $metaTitle = $product->getMetaTitle();
+ $pageConfig->setMetaTitle($metaTitle);
+ $pageConfig->getTitle()->set($metaTitle ?: $product->getName());
$keyword = $product->getMetaKeyword();
$currentCategory = $this->_coreRegistry->registry('current_category');
diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php
index 971f34e02f9e5..ffae39cb6ed05 100644
--- a/app/code/Magento/Catalog/Model/Product/Image.php
+++ b/app/code/Magento/Catalog/Model/Product/Image.php
@@ -826,7 +826,7 @@ public function getResizedImageInfo()
$image = $this->imageAsset->getPath();
}
- $imageProperties = $this->getimagesize($image);
+ $imageProperties = $this->getImageSize($image);
return $imageProperties;
} finally {
diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php
index 95c3346028a80..7594089ca114c 100644
--- a/app/code/Magento/Catalog/Model/ProductRepository.php
+++ b/app/code/Magento/Catalog/Model/ProductRepository.php
@@ -234,19 +234,13 @@ public function get($sku, $editMode = false, $storeId = null, $forceReload = fal
$cacheKey = $this->getCacheKey([$editMode, $storeId]);
$cachedProduct = $this->getProductFromLocalCache($sku, $cacheKey);
if ($cachedProduct === null || $forceReload) {
- $product = $this->productFactory->create();
-
$productId = $this->resourceModel->getIdBySku($sku);
if (!$productId) {
throw new NoSuchEntityException(__('Requested product doesn\'t exist'));
}
- if ($editMode) {
- $product->setData('_edit_mode', true);
- }
- if ($storeId !== null) {
- $product->setData('store_id', $storeId);
- }
- $product->load($productId);
+
+ $product = $this->getById($productId, $editMode, $storeId, $forceReload);
+
$this->cacheProduct($cacheKey, $product);
$cachedProduct = $product;
}
diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php
index c93c038828bcd..8457e5d0eaa5c 100644
--- a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php
+++ b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php
@@ -141,11 +141,13 @@ public function deleteEntity(\Magento\Framework\Model\AbstractModel $object)
->getMetadata(ProductInterface::class)
->getLinkField();
+ $backendLinkField = $attribute->getBackend()->getEntityIdField();
+
$select = $this->getConnection()->select()
->from(['b' => $backendTable])
->join(
['e' => $attribute->getEntity()->getEntityTable()],
- "b.$linkField = e.$linkField"
+ "b.$backendLinkField = e.$linkField"
)->where('b.attribute_id = ?', $attribute->getId())
->where('e.attribute_set_id = ?', $result['attribute_set_id']);
diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php
index 6c9867359d40b..1f3b2642953c8 100644
--- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php
+++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php
@@ -11,6 +11,8 @@
*/
namespace Magento\Catalog\Model\ResourceModel;
+use Magento\Catalog\Model\Indexer\Category\Product\Processor;
+use Magento\Framework\DataObject;
use Magento\Framework\EntityManager\EntityManager;
/**
@@ -82,6 +84,11 @@ class Category extends AbstractResource
*/
protected $aggregateCount;
+ /**
+ * @var Processor
+ */
+ private $indexerProcessor;
+
/**
* Category constructor.
* @param \Magento\Eav\Model\Entity\Context $context
@@ -92,6 +99,7 @@ class Category extends AbstractResource
* @param Category\CollectionFactory $categoryCollectionFactory
* @param array $data
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
+ * @param Processor|null $indexerProcessor
*/
public function __construct(
\Magento\Eav\Model\Entity\Context $context,
@@ -101,7 +109,8 @@ public function __construct(
\Magento\Catalog\Model\ResourceModel\Category\TreeFactory $categoryTreeFactory,
\Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory,
$data = [],
- \Magento\Framework\Serialize\Serializer\Json $serializer = null
+ \Magento\Framework\Serialize\Serializer\Json $serializer = null,
+ Processor $indexerProcessor = null
) {
parent::__construct(
$context,
@@ -115,6 +124,8 @@ public function __construct(
$this->connectionName = 'catalog';
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\Json::class);
+ $this->indexerProcessor = $indexerProcessor ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(Processor::class);
}
/**
@@ -197,6 +208,19 @@ protected function _beforeDelete(\Magento\Framework\DataObject $object)
$this->deleteChildren($object);
}
+ /**
+ * Mark Category indexer as invalid to be picked up by cron.
+ *
+ * @param DataObject $object
+ * @return $this
+ */
+ protected function _afterDelete(DataObject $object): Category
+ {
+ $this->indexerProcessor->markIndexerAsInvalid();
+
+ return parent::_afterDelete($object);
+ }
+
/**
* Delete children categories of specific category
*
diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php
index ee5b55905d45c..5a77c9664787c 100644
--- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php
+++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php
@@ -1079,14 +1079,15 @@ public function getAllAttributeValues($attribute)
$select = clone $this->getSelect();
$attribute = $this->getEntity()->getAttribute($attribute);
- $aiField = $this->getConnection()->getAutoIncrementField($this->getMainTable());
+ $fieldMainTable = $this->getConnection()->getAutoIncrementField($this->getMainTable());
+ $fieldJoinTable = $attribute->getEntity()->getLinkField();
$select->reset()
->from(
['cpe' => $this->getMainTable()],
['entity_id']
)->join(
['cpa' => $attribute->getBackend()->getTable()],
- 'cpe.' . $aiField . ' = cpa.' . $aiField,
+ 'cpe.' . $fieldMainTable . ' = cpa.' . $fieldJoinTable,
['store_id', 'value']
)->where('attribute_id = ?', (int)$attribute->getId());
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php
index b45df0380dcc6..5d8db5d5ba589 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php
@@ -55,6 +55,9 @@ public function testCanShowTab($priceAllow, $stockAllow, $canShowTab)
$this->assertEquals($canShowTab, $this->alerts->canShowTab());
}
+ /**
+ * @return array
+ */
public function canShowTabDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php
index 5e899263519da..1fc105686011f 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php
@@ -50,6 +50,9 @@ public function testIsAllowed($isAllowed)
}
}
+ /**
+ * @return array
+ */
public function isAllowedDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Category/Rss/LinkTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Category/Rss/LinkTest.php
index 8932d77a81247..0cff8b2d0f207 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Category/Rss/LinkTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Category/Rss/LinkTest.php
@@ -72,6 +72,9 @@ public function testIsRssAllowed($isAllowed)
$this->assertEquals($isAllowed, $this->link->isRssAllowed());
}
+ /**
+ * @return array
+ */
public function isRssAllowedDataProvider()
{
return [
@@ -98,6 +101,9 @@ public function testIsTopCategory($isTop, $categoryLevel)
$this->assertEquals($isTop, $this->link->isTopCategory());
}
+ /**
+ * @return array
+ */
public function isTopCategoryDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/RelatedTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/RelatedTest.php
index 1d927a6e04ef5..deb84b7b2d3c4 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/RelatedTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/RelatedTest.php
@@ -72,6 +72,9 @@ public function testCanItemsAddToCart($isComposite, $isSaleable, $hasRequiredOpt
);
}
+ /**
+ * @return array
+ */
public function canItemsAddToCartDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/ToolbarTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/ToolbarTest.php
index dce0be8e62df3..ac963326dbfa1 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/ToolbarTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ProductList/ToolbarTest.php
@@ -216,6 +216,9 @@ public function testSetModes($mode, $expected)
$this->assertEquals($expected, $block->getModes());
}
+ /**
+ * @return array
+ */
public function setModesDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php
index e0ba6531c8ab2..ae5176e78df7b 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php
@@ -100,6 +100,9 @@ public function testGetGalleryImagesJsonWithoutLabel()
$this->assertEquals('test_product_name', $decodedJson[0]['caption']);
}
+ /**
+ * @param bool $hasLabel
+ */
private function prepareGetGalleryImagesJsonMocks($hasLabel = true)
{
$storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/NewProductsTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/NewProductsTest.php
index e2e0fa2f27667..129dea37b185e 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/NewProductsTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/NewProductsTest.php
@@ -91,6 +91,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function isAllowedDataProvider()
{
return [
@@ -108,6 +111,9 @@ public function testIsAllowed($configValue, $expectedResult)
$this->assertEquals($expectedResult, $this->block->isAllowed());
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getItemMock()
{
$methods = [
diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/SpecialTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/SpecialTest.php
index 6509aa138802e..3c9f19d61d16a 100644
--- a/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/SpecialTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/SpecialTest.php
@@ -167,6 +167,9 @@ public function testGetRssData()
);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getItemMock()
{
$item = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Image/UploadTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Image/UploadTest.php
index 07dacae7298cf..e2cd01fd1c23a 100644
--- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Image/UploadTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Image/UploadTest.php
@@ -23,6 +23,9 @@ protected function setUp()
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php
new file mode 100644
index 0000000000000..4077ecb11f355
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php
@@ -0,0 +1,147 @@
+resultJsonFactoryMock = $this->getMockBuilder(JsonFactory::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['create', 'setData'])
+ ->getMock();
+
+ $this->contextMock = $this->getMockBuilder(Context::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getRequest'])
+ ->getMock();
+ }
+
+ /**
+ * Sets object non-public property.
+ *
+ * @param mixed $object
+ * @param string $propertyName
+ * @param mixed $value
+ *
+ * @return void
+ */
+ private function setObjectProperty($object, string $propertyName, $value)
+ {
+ $reflectionClass = new \ReflectionClass($object);
+ $reflectionProperty = $reflectionClass->getProperty($propertyName);
+ $reflectionProperty->setAccessible(true);
+ $reflectionProperty->setValue($object, $value);
+ }
+
+ /**
+ * @return void
+ */
+ public function testExecute()
+ {
+ $value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2];
+ $result = '{"id":3,"path":"1/2/3","parentId":"2"}';
+
+ $requestMock = $this->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
+
+ $refreshPath = $this->getMockBuilder(RefreshPath::class)
+ ->setMethods(['getRequest', 'create'])
+ ->setConstructorArgs([
+ $this->contextMock,
+ $this->resultJsonFactoryMock,
+ ])->getMock();
+
+ $refreshPath->expects($this->any())->method('getRequest')->willReturn($requestMock);
+ $requestMock->expects($this->any())->method('getParam')->with('id')->willReturn($value['id']);
+
+ $categoryMock = $this->getMockBuilder(\Magento\Catalog\Model\Category::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getPath', 'getParentId', 'getResource'])
+ ->getMock();
+
+ $categoryMock->expects($this->any())->method('getPath')->willReturn($value['path']);
+ $categoryMock->expects($this->any())->method('getParentId')->willReturn($value['parentId']);
+
+ $categoryResource = $this->createMock(\Magento\Catalog\Model\ResourceModel\Category::class);
+
+ $objectManagerMock = $this->getMockBuilder(ObjectManager::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['create'])
+ ->getMock();
+
+ $this->setObjectProperty($refreshPath, '_objectManager', $objectManagerMock);
+ $this->setObjectProperty($categoryMock, '_resource', $categoryResource);
+
+ $objectManagerMock->expects($this->once())
+ ->method('create')
+ ->with(\Magento\Catalog\Model\Category::class)
+ ->willReturn($categoryMock);
+
+ $this->resultJsonFactoryMock->expects($this->any())->method('create')->willReturnSelf();
+ $this->resultJsonFactoryMock->expects($this->any())
+ ->method('setData')
+ ->with($value)
+ ->willReturn($result);
+
+ $this->assertEquals($result, $refreshPath->execute());
+ }
+
+ /**
+ * @return void
+ */
+ public function testExecuteWithoutCategoryId()
+ {
+ $requestMock = $this->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
+
+ $refreshPath = $this->getMockBuilder(RefreshPath::class)
+ ->setMethods(['getRequest', 'create'])
+ ->setConstructorArgs([
+ $this->contextMock,
+ $this->resultJsonFactoryMock,
+ ])->getMock();
+
+ $refreshPath->expects($this->any())->method('getRequest')->willReturn($requestMock);
+ $requestMock->expects($this->any())->method('getParam')->with('id')->willReturn(null);
+
+ $objectManagerMock = $this->getMockBuilder(ObjectManager::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['create'])
+ ->getMock();
+
+ $this->setObjectProperty($refreshPath, '_objectManager', $objectManagerMock);
+
+ $objectManagerMock->expects($this->never())
+ ->method('create')
+ ->with(\Magento\Catalog\Model\Category::class)
+ ->willReturnSelf();
+
+ $refreshPath->execute();
+ }
+}
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php
index 450cf4663c99c..9c747393cc72a 100644
--- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php
@@ -195,6 +195,9 @@ public function testUniqueValidation(array $options, $isError)
$this->assertInstanceOf(ResultJson::class, $this->getModel()->execute());
}
+ /**
+ * @return array
+ */
public function provideUniqueData()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/BuilderTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/BuilderTest.php
index 4113ce636d66b..c71fa90fb02dd 100644
--- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/BuilderTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/BuilderTest.php
@@ -14,6 +14,9 @@
use Magento\Framework\Registry;
use Magento\Cms\Model\Wysiwyg\Config as WysiwygConfig;
use Magento\Framework\App\Request\Http;
+use Magento\Catalog\Api\ProductRepositoryInterface;
+use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Catalog\Model\Product\Type as ProductTypes;
/**
* Class BuilderTest
@@ -67,6 +70,11 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
*/
protected $storeFactoryMock;
+ /**
+ * @var ProductRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $productRepositoryMock;
+
/**
* @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject
*/
@@ -90,9 +98,10 @@ protected function setUp()
->setMethods(['load'])
->getMockForAbstractClass();
- $this->storeFactoryMock->expects($this->any())
- ->method('create')
- ->willReturn($this->storeMock);
+ $this->productRepositoryMock = $this->getMockBuilder(ProductRepositoryInterface::class)
+ ->setMethods(['getById'])
+ ->disableOriginalConstructor()
+ ->getMockForAbstractClass();
$this->builder = $this->objectManager->getObject(
Builder::class,
@@ -102,140 +111,198 @@ protected function setUp()
'registry' => $this->registryMock,
'wysiwygConfig' => $this->wysiwygConfigMock,
'storeFactory' => $this->storeFactoryMock,
+ 'productRepository' => $this->productRepositoryMock
]
);
}
public function testBuildWhenProductExistAndPossibleToLoadProduct()
{
+ $productId = 2;
+ $productType = 'type_id';
+ $productStore = 'store';
+ $productSet = 3;
+
$valueMap = [
- ['id', null, 2],
- ['store', 0, 'some_store'],
- ['type', null, 'type_id'],
- ['set', null, 3],
- ['store', null, 'store'],
+ ['id', null, $productId],
+ ['type', null, $productType],
+ ['set', null, $productSet],
+ ['store', 0, $productStore],
];
+
$this->requestMock->expects($this->any())
->method('getParam')
->willReturnMap($valueMap);
- $this->productFactoryMock->expects($this->once())
+
+ $this->productRepositoryMock->expects($this->any())
+ ->method('getById')
+ ->with($productId, true, $productStore)
+ ->willReturn($this->productMock);
+
+ $this->storeFactoryMock->expects($this->any())
->method('create')
- ->will($this->returnValue($this->productMock));
- $this->productMock->expects($this->once())
- ->method('setStoreId')
- ->with('some_store')
- ->willReturnSelf();
- $this->productMock->expects($this->never())
- ->method('setTypeId');
- $this->productMock->expects($this->once())
+ ->willReturn($this->storeMock);
+
+ $this->storeMock->expects($this->any())
->method('load')
- ->with(2)
- ->will($this->returnSelf());
- $this->productMock->expects($this->once())
- ->method('setAttributeSetId')
- ->with(3)
- ->will($this->returnSelf());
+ ->with($productStore)
+ ->willReturnSelf();
+
$registryValueMap = [
['product', $this->productMock, $this->registryMock],
['current_product', $this->productMock, $this->registryMock],
+ ['current_store', $this->registryMock, $this->storeMock],
];
+
$this->registryMock->expects($this->any())
->method('register')
->willReturn($registryValueMap);
+
$this->wysiwygConfigMock->expects($this->once())
->method('setStoreId')
- ->with('store');
+ ->with($productStore);
+
$this->assertEquals($this->productMock, $this->builder->build($this->requestMock));
}
public function testBuildWhenImpossibleLoadProduct()
{
+ $productId = 2;
+ $productType = 'type_id';
+ $productStore = 'store';
+ $productSet = 3;
+
$valueMap = [
- ['id', null, 15],
- ['store', 0, 'some_store'],
- ['type', null, 'type_id'],
- ['set', null, 3],
- ['store', null, 'store'],
+ ['id', null, $productId],
+ ['type', null, $productType],
+ ['set', null, $productSet],
+ ['store', 0, $productStore],
];
+
$this->requestMock->expects($this->any())
->method('getParam')
- ->will($this->returnValueMap($valueMap));
+ ->willReturnMap($valueMap);
+
+ $this->productRepositoryMock->expects($this->any())
+ ->method('getById')
+ ->with($productId, true, $productStore)
+ ->willThrowException(new NoSuchEntityException());
+
$this->productFactoryMock->expects($this->once())
->method('create')
- ->willReturn($this->productMock);
- $this->productMock->expects($this->once())
- ->method('setStoreId')
- ->with('some_store')
- ->willReturnSelf();
- $this->productMock->expects($this->once())
+ ->will($this->returnValue($this->productMock));
+
+ $this->productMock->expects($this->any())
+ ->method('setData')
+ ->with('_edit_mode', true);
+
+ $this->productMock->expects($this->any())
->method('setTypeId')
- ->with(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE)
- ->willReturnSelf();
- $this->productMock->expects($this->once())
- ->method('load')
- ->with(15)
- ->willThrowException(new \Exception());
+ ->with(ProductTypes::DEFAULT_TYPE);
+
+ $this->productMock->expects($this->any())
+ ->method('setStoreId')
+ ->with($productStore);
+
+ $this->productMock->expects($this->any())
+ ->method('setAttributeSetId')
+ ->with($productSet);
+
$this->loggerMock->expects($this->once())
->method('critical');
- $this->productMock->expects($this->once())
- ->method('setAttributeSetId')
- ->with(3)
- ->will($this->returnSelf());
+
+ $this->storeFactoryMock->expects($this->any())
+ ->method('create')
+ ->willReturn($this->storeMock);
+
+ $this->storeMock->expects($this->any())
+ ->method('load')
+ ->with($productStore)
+ ->willReturnSelf();
+
$registryValueMap = [
['product', $this->productMock, $this->registryMock],
['current_product', $this->productMock, $this->registryMock],
+ ['current_store', $this->registryMock, $this->storeMock],
];
+
$this->registryMock->expects($this->any())
->method('register')
- ->will($this->returnValueMap($registryValueMap));
+ ->willReturn($registryValueMap);
+
$this->wysiwygConfigMock->expects($this->once())
->method('setStoreId')
- ->with('store');
+ ->with($productStore);
+
$this->assertEquals($this->productMock, $this->builder->build($this->requestMock));
}
public function testBuildWhenProductNotExist()
{
+ $productId = 0;
+ $productType = 'type_id';
+ $productStore = 'store';
+ $productSet = 3;
+
$valueMap = [
- ['id', null, null],
- ['store', 0, 'some_store'],
- ['type', null, 'type_id'],
- ['set', null, 3],
- ['store', null, 'store'],
+ ['id', null, $productId],
+ ['type', null, $productType],
+ ['set', null, $productSet],
+ ['store', 0, $productStore],
];
+
$this->requestMock->expects($this->any())
->method('getParam')
- ->will($this->returnValueMap($valueMap));
+ ->willReturnMap($valueMap);
+
+ $this->productRepositoryMock->expects($this->any())
+ ->method('getById')
+ ->with($productId, true, $productStore)
+ ->willThrowException(new NoSuchEntityException());
+
$this->productFactoryMock->expects($this->once())
->method('create')
- ->willReturn($this->productMock);
- $this->productMock->expects($this->once())
- ->method('setStoreId')
- ->with('some_store')
- ->willReturnSelf();
- $productValueMap = [
- ['type_id', $this->productMock],
- [\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE, $this->productMock],
- ];
+ ->will($this->returnValue($this->productMock));
+
+ $this->productMock->expects($this->any())
+ ->method('setData')
+ ->with('_edit_mode', true);
+
$this->productMock->expects($this->any())
->method('setTypeId')
- ->willReturnMap($productValueMap);
- $this->productMock->expects($this->never())
- ->method('load');
- $this->productMock->expects($this->once())
+ ->with($productType);
+
+ $this->productMock->expects($this->any())
+ ->method('setStoreId')
+ ->with($productStore);
+
+ $this->productMock->expects($this->any())
->method('setAttributeSetId')
- ->with(3)
- ->will($this->returnSelf());
+ ->with($productSet);
+
+ $this->storeFactoryMock->expects($this->any())
+ ->method('create')
+ ->willReturn($this->storeMock);
+
+ $this->storeMock->expects($this->any())
+ ->method('load')
+ ->with($productStore)
+ ->willReturnSelf();
+
$registryValueMap = [
['product', $this->productMock, $this->registryMock],
['current_product', $this->productMock, $this->registryMock],
+ ['current_store', $this->registryMock, $this->storeMock],
];
+
$this->registryMock->expects($this->any())
->method('register')
- ->will($this->returnValueMap($registryValueMap));
+ ->willReturn($registryValueMap);
+
$this->wysiwygConfigMock->expects($this->once())
->method('setStoreId')
- ->with('store');
+ ->with($productStore);
+
$this->assertEquals($this->productMock, $this->builder->build($this->requestMock));
}
}
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ShowUpdateResultTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ShowUpdateResultTest.php
index ba716fdb53c89..47a60a1916142 100644
--- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ShowUpdateResultTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ShowUpdateResultTest.php
@@ -58,7 +58,7 @@ protected function getContext()
$objectManagerMock = $this->getMockForAbstractClass(\Magento\Framework\ObjectManagerInterface::class);
$objectManagerMock->expects($this->any())
->method('get')
- ->willreturn($productActionMock);
+ ->willReturn($productActionMock);
$eventManager = $this->getMockBuilder(\Magento\Framework\Event\Manager::class)
->setMethods(['dispatch'])
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php
index a0a563e1e070e..779630b9559c6 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php
@@ -39,6 +39,9 @@ public function testExemplarXml($fixtureXml, array $expectedErrors)
$this->assertEquals($expectedErrors, $actualErrors);
}
+ /**
+ * @return array
+ */
public function exemplarXmlDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php
index d4e09714d0522..49e6a58b52032 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php
@@ -205,6 +205,9 @@ private function setUpModelForAfterSave()
return $model->setAttribute($this->attribute);
}
+ /**
+ * @return array
+ */
public function attributeValueDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php
index 3b99f2697f6b8..073a07818b52e 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php
@@ -70,6 +70,9 @@ public function testBeforeSave($attributeCode, $data, $expected)
$this->assertSame($expected, $object->getData($attributeCode));
}
+ /**
+ * @return array
+ */
public function beforeSaveDataProvider()
{
return [
@@ -116,6 +119,9 @@ public function testAfterLoad($attributeCode, $data, $expected)
$this->assertSame($expected, $object->getData($attributeCode));
}
+ /**
+ * @return array
+ */
public function afterLoadDataProvider()
{
return [
@@ -158,6 +164,9 @@ public function testValidate($attributeData, $data, $expected)
$this->assertSame($expected, $this->_model->validate($object));
}
+ /**
+ * @return array
+ */
public function validateDataProvider()
{
return [
@@ -250,6 +259,9 @@ public function testValidateDefaultSort($attributeCode, $data)
$this->assertTrue($this->_model->validate($object));
}
+ /**
+ * @return array
+ */
public function validateDefaultSortDataProvider()
{
return [
@@ -293,6 +305,9 @@ public function testValidateDefaultSortException($attributeCode, $data)
$this->_model->validate($object);
}
+ /**
+ * @return array
+ */
public function validateDefaultSortException()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php
index f77a6fec283a5..7d448302666cc 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php
@@ -280,6 +280,9 @@ public function testSaveWithValidateCategoryException($error, $expectedException
$this->model->save($categoryMock);
}
+ /**
+ * @return array
+ */
public function saveWithValidateCategoryExceptionDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php
index b989cba2927d6..a53b87dcf1567 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php
@@ -259,6 +259,9 @@ public function testGetUseFlatResourceTrue()
$this->assertEquals(true, $category->getUseFlatResource());
}
+ /**
+ * @return object
+ */
protected function getCategoryModel()
{
return $this->objectManager->getObject(
@@ -287,6 +290,9 @@ protected function getCategoryModel()
);
}
+ /**
+ * @return array
+ */
public function reindexFlatEnabledTestDataProvider()
{
return [
@@ -336,6 +342,9 @@ public function testReindexFlatEnabled($flatScheduled, $productScheduled, $expec
$this->category->reindex();
}
+ /**
+ * @return array
+ */
public function reindexFlatDisabledTestDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/Plugin/IndexerConfigDataTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/Plugin/IndexerConfigDataTest.php
index 56bd04594018c..f69cbeb91631f 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/Plugin/IndexerConfigDataTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/Plugin/IndexerConfigDataTest.php
@@ -48,6 +48,9 @@ public function testAroundGet($isFlat, $path, $default, $inputData, $outputData)
$this->assertEquals($outputData, $this->model->afterGet($this->subjectMock, $inputData, $path, $default));
}
+ /**
+ * @return array
+ */
public function aroundGetDataProvider()
{
$flatIndexerData = [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/StateTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/StateTest.php
index 3beb9a3ffb773..6916cef2dfa61 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/StateTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/StateTest.php
@@ -102,6 +102,9 @@ public function testIsAvailable($isAvailable, $isFlatEnabled, $isValid, $result)
$this->assertEquals($result, $this->model->isAvailable());
}
+ /**
+ * @return array
+ */
public function isAvailableDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/System/Config/ModeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/System/Config/ModeTest.php
index 3b3941d116fde..fb02b80a60175 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/System/Config/ModeTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Flat/System/Config/ModeTest.php
@@ -57,6 +57,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueEqual()
{
return [['0', '0'], ['', '0'], ['0', ''], ['1', '1']];
@@ -92,6 +95,9 @@ public function testProcessValueEqual($oldValue, $value)
$this->model->processValue();
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueOn()
{
return [['0', '1'], ['', '1']];
@@ -143,6 +149,9 @@ public function testProcessValueOn($oldValue, $value)
$this->model->processValue();
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueOff()
{
return [['1', '0'], ['1', '']];
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreGroupTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreGroupTest.php
index 8310f3692d966..e134407d547ac 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreGroupTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreGroupTest.php
@@ -89,6 +89,9 @@ public function testBeforeAndAfterSaveNotNew($valueMap)
$this->assertSame($this->subject, $this->model->afterSave($this->subject, $this->subject, $this->groupMock));
}
+ /**
+ * @return array
+ */
public function changedDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/AbstractActionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/AbstractActionTest.php
index 52bbff6eb5597..a2ca4ef616926 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/AbstractActionTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/AbstractActionTest.php
@@ -177,6 +177,9 @@ public function testReindexWithNotNullArgumentExecutesReindexEntities(
$this->_model->reindex($ids);
}
+ /**
+ * @return array
+ */
public function reindexEntitiesDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php
index 8c63d77b74f53..d30a8da0e77a2 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php
@@ -129,6 +129,9 @@ public function testReindexRow(
$this->_model->reindexRow(1, $forceReindex);
}
+ /**
+ * @return array
+ */
public function dataProviderReindexRow()
{
return [
@@ -198,6 +201,9 @@ public function testReindexList(
$this->_model->reindexList([1], $forceReindex);
}
+ /**
+ * @return array
+ */
public function dataProviderReindexList()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/System/Config/ModeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/System/Config/ModeTest.php
index ca67185203738..34cc5c70418b9 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/System/Config/ModeTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/System/Config/ModeTest.php
@@ -50,6 +50,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueEqual()
{
return [['0', '0'], ['', '0'], ['0', ''], ['1', '1']];
@@ -84,6 +87,9 @@ public function testProcessValueEqual($oldValue, $value)
$this->model->processValue();
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueOn()
{
return [['0', '1'], ['', '1']];
@@ -134,6 +140,9 @@ public function testProcessValueOn($oldValue, $value)
$this->model->processValue();
}
+ /**
+ * @return array
+ */
public function dataProviderProcessValueOff()
{
return [['1', '0'], ['1', '']];
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/CategoryTest.php
index 3e5daf1a98a9c..257a84e50248d 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/CategoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/CategoryTest.php
@@ -77,6 +77,9 @@ protected function setUp()
);
}
+ /**
+ * @return \Magento\Catalog\Model\Layer\Filter\DataProvider\Category
+ */
public function testGetCategoryWithAppliedId()
{
$storeId = 1234;
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php
index 3a23ebcdf4518..f2c77627e38d0 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php
@@ -165,6 +165,9 @@ public function testValidateFilter($filter, $expectedResult)
$this->assertSame($expectedResult, $this->target->validateFilter($filter));
}
+ /**
+ * @return array
+ */
public function validateFilterDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php
index 8cf075f4d8504..a97e4650b49bd 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php
@@ -164,6 +164,9 @@ public function testUpdateWebsites($type, $methodName)
$this->assertEquals($this->model->getDataByKey('action_type'), $type);
}
+ /**
+ * @return array
+ */
public function updateWebsitesDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/CartConfigurationTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/CartConfigurationTest.php
index 6f1f5e120b100..2144cf34c2a09 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/CartConfigurationTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/CartConfigurationTest.php
@@ -21,6 +21,9 @@ public function testIsProductConfigured($productType, $config, $expected)
$this->assertEquals($expected, $cartConfiguration->isProductConfigured($productMock, $config));
}
+ /**
+ * @return array
+ */
public function isProductConfiguredDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/ProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/ProcessorTest.php
index d52aad50f05f3..15f003282dc04 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/ProcessorTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/ProcessorTest.php
@@ -151,6 +151,9 @@ public function testValidate($value)
$this->assertEquals(!$value, $this->model->validate($this->dataObject));
}
+ /**
+ * @return array
+ */
public function validateDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php
index 0e29aeab697af..c1e5559dbfd66 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php
@@ -111,6 +111,9 @@ public function testGetItemAttributes($type, $typeId)
$this->assertEquals($expectedResult, $this->model->getItemAttributes($type));
}
+ /**
+ * @return array
+ */
public function getItemAttributesDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php
index 046ee703c850e..95a9b961c8d81 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php
@@ -69,6 +69,9 @@ public function testIsValidSuccess($expectedResult, array $value)
$this->assertEquals($expectedResult, $this->validator->isValid($this->valueMock));
}
+ /**
+ * @return array
+ */
public function isValidSuccessDataProvider()
{
return [
@@ -154,6 +157,9 @@ public function testIsValidateWithInvalidData($priceType, $price, $title)
$this->assertEquals($messages, $this->validator->getMessages());
}
+ /**
+ * @return array
+ */
public function isValidateWithInvalidDataDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php
index 84a9e9ded094b..3789ba4ee126d 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php
@@ -112,6 +112,9 @@ public function testGetCurrentPageNoParam()
$this->assertEquals(1, $this->toolbarModel->getCurrentPage());
}
+ /**
+ * @return array
+ */
public function stringParamProvider()
{
return [
@@ -119,6 +122,9 @@ public function stringParamProvider()
];
}
+ /**
+ * @return array
+ */
public function intParamProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php
index 7506b4adc1d3a..5080e64f46e27 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php
@@ -40,6 +40,9 @@ public function testIsReservedAttribute($isUserDefined, $attributeCode, $expecte
$this->assertEquals($expected, $this->model->isReservedAttribute($attribute));
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php
index 6d42a33d1fc73..bbd0886442fd3 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php
@@ -147,6 +147,9 @@ public function testGetList($configValue, $customerGroupId, $groupData, $expecte
}
}
+ /**
+ * @return array
+ */
public function getListDataProvider()
{
return [
@@ -399,6 +402,9 @@ public function testAddWithInvalidData($price, $qty)
$this->service->add('product_sku', 1, $price, $qty);
}
+ /**
+ * @return array
+ */
public function addDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/AbstractTypeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/AbstractTypeTest.php
index dcddab60fb0b9..b34375256a959 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/AbstractTypeTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/AbstractTypeTest.php
@@ -96,6 +96,9 @@ public function testAttributesCompare($attr1, $attr2, $expectedResult)
$this->assertEquals($expectedResult, $this->model->attributesCompare($attribute, $attribute2));
}
+ /**
+ * @return array
+ */
public function attributeCompareProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/UrlTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/UrlTest.php
index 9fa820d64bae1..ef7aad2cbb802 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/Product/UrlTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/UrlTest.php
@@ -169,6 +169,9 @@ public function testGetUrl(
}
}
+ /**
+ * @return array
+ */
public function getUrlDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
index a9760d81bbac4..efec13e1817d0 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
@@ -195,6 +195,7 @@ protected function setUp()
'load',
'getOptions',
'getSku',
+ 'getId',
'hasGalleryAttribute',
'getMediaConfig',
'getMediaAttributes',
@@ -282,7 +283,7 @@ protected function setUp()
*/
public function testGetAbsentProduct()
{
- $this->productFactory->expects($this->once())->method('create')
+ $this->productFactory->expects($this->never())->method('create')
->will($this->returnValue($this->product));
$this->resourceModelMock->expects($this->once())->method('getIdBySku')->with('test_sku')
->will($this->returnValue(null));
@@ -293,25 +294,27 @@ public function testGetAbsentProduct()
public function testCreateCreatesProduct()
{
$sku = 'test_sku';
- $this->productFactory->expects($this->once())->method('create')
- ->will($this->returnValue($this->product));
$this->resourceModelMock->expects($this->once())->method('getIdBySku')->with($sku)
->will($this->returnValue('test_id'));
+ $this->productFactory->expects($this->once())->method('create')
+ ->will($this->returnValue($this->product));
$this->product->expects($this->once())->method('load')->with('test_id');
- $this->product->expects($this->once())->method('getSku')->willReturn($sku);
+ $this->product->expects($this->any())->method('getId')->willReturn('test_id');
+ $this->product->expects($this->any())->method('getSku')->willReturn($sku);
$this->assertEquals($this->product, $this->model->get($sku));
}
public function testGetProductInEditMode()
{
$sku = 'test_sku';
- $this->productFactory->expects($this->once())->method('create')
- ->will($this->returnValue($this->product));
$this->resourceModelMock->expects($this->once())->method('getIdBySku')->with($sku)
->will($this->returnValue('test_id'));
+ $this->productFactory->expects($this->once())->method('create')
+ ->will($this->returnValue($this->product));
$this->product->expects($this->once())->method('setData')->with('_edit_mode', true);
$this->product->expects($this->once())->method('load')->with('test_id');
- $this->product->expects($this->once())->method('getSku')->willReturn($sku);
+ $this->product->expects($this->any())->method('getId')->willReturn('test_id');
+ $this->product->expects($this->any())->method('getSku')->willReturn($sku);
$this->assertEquals($this->product, $this->model->get($sku, true));
}
@@ -319,12 +322,13 @@ public function testGetBySkuWithSpace()
{
$trimmedSku = 'test_sku';
$sku = 'test_sku ';
- $this->productFactory->expects($this->once())->method('create')
- ->will($this->returnValue($this->product));
$this->resourceModelMock->expects($this->once())->method('getIdBySku')->with($sku)
->will($this->returnValue('test_id'));
+ $this->productFactory->expects($this->once())->method('create')
+ ->will($this->returnValue($this->product));
$this->product->expects($this->once())->method('load')->with('test_id');
- $this->product->expects($this->once())->method('getSku')->willReturn($trimmedSku);
+ $this->product->expects($this->any())->method('getId')->willReturn('test_id');
+ $this->product->expects($this->any())->method('getSku')->willReturn($trimmedSku);
$this->assertEquals($this->product, $this->model->get($sku));
}
@@ -333,12 +337,12 @@ public function testGetWithSetStoreId()
$productId = 123;
$sku = 'test-sku';
$storeId = 7;
- $this->productFactory->expects($this->once())->method('create')->willReturn($this->product);
$this->resourceModelMock->expects($this->once())->method('getIdBySku')->with($sku)->willReturn($productId);
+ $this->productFactory->expects($this->once())->method('create')->willReturn($this->product);
$this->product->expects($this->once())->method('setData')->with('store_id', $storeId);
$this->product->expects($this->once())->method('load')->with($productId);
- $this->product->expects($this->once())->method('getId')->willReturn($productId);
- $this->product->expects($this->once())->method('getSku')->willReturn($sku);
+ $this->product->expects($this->any())->method('getId')->willReturn($productId);
+ $this->product->expects($this->any())->method('getSku')->willReturn($sku);
$this->assertSame($this->product, $this->model->get($sku, false, $storeId));
}
@@ -498,13 +502,13 @@ public function testGetForcedReload()
$editMode = false;
$storeId = 0;
+ $this->resourceModelMock->expects($this->exactly(2))->method('getIdBySku')
+ ->with($sku)->willReturn($id);
$this->productFactory->expects($this->exactly(2))->method('create')
->will($this->returnValue($this->product));
$this->product->expects($this->exactly(2))->method('load');
- $this->product->expects($this->exactly(2))->method('getId')->willReturn($sku);
- $this->resourceModelMock->expects($this->exactly(2))->method('getIdBySku')
- ->with($sku)->willReturn($id);
- $this->product->expects($this->exactly(2))->method('getSku')->willReturn($sku);
+ $this->product->expects($this->any())->method('getId')->willReturn($id);
+ $this->product->expects($this->any())->method('getSku')->willReturn($sku);
$this->assertEquals($this->product, $this->model->get($sku, $editMode, $storeId));
//second invocation should just return from cache
@@ -550,8 +554,9 @@ public function testGetBySkuFromCacheInitializedInGetById()
public function testSaveExisting()
{
+ $id = 100;
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
- $this->resourceModelMock->expects($this->any())->method('getIdBySku')->will($this->returnValue(100));
+ $this->resourceModelMock->expects($this->any())->method('getIdBySku')->will($this->returnValue($id));
$this->productFactory->expects($this->any())
->method('create')
->will($this->returnValue($this->product));
@@ -565,15 +570,20 @@ public function testSaveExisting()
->will($this->returnValue($this->productData));
$this->product->expects($this->once())->method('getWebsiteIds')->willReturn([]);
$this->product->expects($this->atLeastOnce())->method('getSku')->willReturn($this->productData['sku']);
+ $this->product->expects($this->at(0))->method('getId')->willReturn(null);
+ $this->product->expects($this->any())->method('getId')->willReturn($id);
$this->assertEquals($this->product, $this->model->save($this->product));
}
public function testSaveNew()
{
+ $id = 100;
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
$this->resourceModelMock->expects($this->at(0))->method('getIdBySku')->will($this->returnValue(null));
- $this->resourceModelMock->expects($this->at(3))->method('getIdBySku')->will($this->returnValue(100));
+ $this->resourceModelMock->expects($this->at(3))->method('getIdBySku')->will($this->returnValue($id));
+ $this->product->expects($this->at(0))->method('getId')->willReturn(null);
+ $this->product->expects($this->any())->method('getId')->willReturn($id);
$this->productFactory->expects($this->any())
->method('create')
->will($this->returnValue($this->product));
@@ -603,7 +613,7 @@ public function testSaveUnableToSaveException()
$this->resourceModelMock->expects($this->exactly(1))
->method('getIdBySku')
->willReturn(null);
- $this->productFactory->expects($this->exactly(2))
+ $this->productFactory->expects($this->exactly(1))
->method('create')
->will($this->returnValue($this->product));
$this->initializationHelperMock->expects($this->never())->method('initialize');
@@ -633,7 +643,7 @@ public function testSaveException()
$this->resourceModelMock->expects($this->exactly(1))
->method('getIdBySku')
->willReturn(null);
- $this->productFactory->expects($this->exactly(2))
+ $this->productFactory->expects($this->exactly(1))
->method('create')
->will($this->returnValue($this->product));
$this->initializationHelperMock->expects($this->never())->method('initialize');
@@ -662,7 +672,7 @@ public function testSaveInvalidProductException()
{
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
$this->resourceModelMock->expects($this->exactly(1))->method('getIdBySku')->will($this->returnValue(null));
- $this->productFactory->expects($this->exactly(2))
+ $this->productFactory->expects($this->exactly(1))
->method('create')
->will($this->returnValue($this->product));
$this->initializationHelperMock->expects($this->never())->method('initialize');
@@ -744,6 +754,7 @@ public function testDeleteById()
->will($this->returnValue('42'));
$this->product->expects($this->once())->method('load')->with('42');
$this->product->expects($this->atLeastOnce())->method('getSku')->willReturn($sku);
+ $this->product->expects($this->atLeastOnce())->method('getId')->willReturn(42);
$this->assertTrue($this->model->deleteById($sku));
}
@@ -842,8 +853,9 @@ public function cacheKeyDataProvider()
*/
public function testSaveExistingWithOptions(array $newOptions, array $existingOptions, array $expectedData)
{
+ $id = 100;
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
- $this->resourceModelMock->expects($this->any())->method('getIdBySku')->will($this->returnValue(100));
+ $this->resourceModelMock->expects($this->any())->method('getIdBySku')->will($this->returnValue($id));
$this->productFactory->expects($this->any())
->method('create')
->will($this->returnValue($this->initializedProductMock));
@@ -863,6 +875,8 @@ public function testSaveExistingWithOptions(array $newOptions, array $existingOp
$this->initializedProductMock->expects($this->atLeastOnce())
->method('getSku')->willReturn($this->productData['sku']);
$this->product->expects($this->atLeastOnce())->method('getSku')->willReturn($this->productData['sku']);
+ $this->initializedProductMock->expects($this->at(0))->method('getId')->willReturn(null);
+ $this->initializedProductMock->expects($this->any())->method('getId')->willReturn($id);
$this->assertEquals($this->initializedProductMock, $this->model->save($this->product));
}
@@ -1019,6 +1033,7 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $
$this->productFactory->expects($this->any())
->method('create')
->will($this->returnValue($this->initializedProductMock));
+ $this->initializedProductMock->method('getId')->willReturn(100);
$this->initializationHelperMock->expects($this->never())->method('initialize');
$this->resourceModelMock->expects($this->once())->method('validate')->with($this->initializedProductMock)
->willReturn(true);
@@ -1112,6 +1127,9 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $
$this->assertEquals($this->initializedProductMock, $results);
}
+ /**
+ * @return mixed
+ */
public function saveWithLinksDataProvider()
{
// Scenario 1
@@ -1260,10 +1278,15 @@ public function testSaveExistingWithNewMediaGalleryEntries()
$this->initializedProductMock->expects($this->atLeastOnce())
->method('getSku')->willReturn($this->productData['sku']);
$this->product->expects($this->atLeastOnce())->method('getSku')->willReturn($this->productData['sku']);
+ $this->initializedProductMock->expects($this->at(0))->method('getId')->willReturn(null);
+ $this->initializedProductMock->expects($this->any())->method('getId')->willReturn(100);
$this->model->save($this->product);
}
+ /**
+ * @return array
+ */
public function websitesProvider()
{
return [
@@ -1301,6 +1324,8 @@ public function testSaveWithDifferentWebsites()
$this->product->method('setWebsiteIds')->willReturn([2,3]);
$this->product->method('getSku')
->willReturn('simple');
+ $this->product->expects($this->at(0))->method('getId')->willReturn(null);
+ $this->product->expects($this->any())->method('getId')->willReturn(100);
$this->assertEquals($this->product, $this->model->save($this->product));
}
@@ -1353,6 +1378,7 @@ public function testSaveExistingWithMediaGalleryEntries()
->method('getSku')->willReturn($this->productData['sku']);
$this->product->expects($this->atLeastOnce())->method('getSku')->willReturn($this->productData['sku']);
$this->product->expects($this->any())->method('getMediaGalleryEntries')->willReturn(null);
+ $this->initializedProductMock->expects($this->any())->method('getId')->willReturn(100);
$this->model->save($this->product);
}
}
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php
index 26199eb3fabbe..a2e9a8e5060cc 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php
@@ -513,6 +513,9 @@ public function testGetCategoryCollectionCollectionNull($initCategoryCollection,
$this->assertEquals($initCategoryCollection, $result);
}
+ /**
+ * @return array
+ */
public function getCategoryCollectionCollectionNullDataProvider()
{
return [
@@ -623,6 +626,9 @@ public function testReindex($productChanged, $isScheduled, $productFlatCount, $c
$this->model->reindex();
}
+ /**
+ * @return array
+ */
public function getProductReindexProvider()
{
return array(
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php
index e6de1d33e564d..fb289c7beaac6 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php
@@ -68,6 +68,9 @@ public function testGetType($value, $expected)
$this->assertEquals($expected, $this->config->getType('global'));
}
+ /**
+ * @return array
+ */
public function getTypeDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AttributeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AttributeTest.php
new file mode 100644
index 0000000000000..29a579bbae5c7
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AttributeTest.php
@@ -0,0 +1,230 @@
+selectMock = $this->getMockBuilder(Select::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['from', 'where', 'join', 'deleteFromSelect'])
+ ->getMock();
+
+ $this->connectionMock = $this->getMockBuilder(Adapter::class)->getMockForAbstractClass();
+ $this->connectionMock->expects($this->once())->method('select')->willReturn($this->selectMock);
+ $this->connectionMock->expects($this->once())->method('query')->willReturn($this->selectMock);
+ $this->connectionMock->expects($this->once())->method('delete')->willReturn($this->selectMock);
+ $this->selectMock->expects($this->once())->method('from')->willReturnSelf();
+ $this->selectMock->expects($this->once())->method('join')->willReturnSelf();
+ $this->selectMock->expects($this->any())->method('where')->willReturnSelf();
+ $this->selectMock->expects($this->any())->method('deleteFromSelect')->willReturnSelf();
+
+ $this->resourceMock = $this->getMockBuilder(ResourceConnection::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['delete', 'getConnection'])
+ ->getMock();
+
+ $this->contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
+ $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class)->getMock();
+ $this->eavEntityTypeMock = $this->getMockBuilder(Type::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->eavConfigMock = $this->getMockBuilder(\Magento\Eav\Model\Config::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getAttribute'])
+ ->getMock();
+ $this->lockValidatorMock = $this->getMockBuilder(LockValidatorInterface::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['validate'])
+ ->getMock();
+ $this->entityMetaDataInterfaceMock = $this->getMockBuilder(EntityMetadataInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ }
+
+ /**
+ * Sets object non-public property.
+ *
+ * @param mixed $object
+ * @param string $propertyName
+ * @param mixed $value
+ *
+ * @return void
+ */
+ private function setObjectProperty($object, string $propertyName, $value)
+ {
+ $reflectionClass = new \ReflectionClass($object);
+ $reflectionProperty = $reflectionClass->getProperty($propertyName);
+ $reflectionProperty->setAccessible(true);
+ $reflectionProperty->setValue($object, $value);
+ }
+
+ /**
+ * @return void
+ */
+ public function testDeleteEntity()
+ {
+ $entityAttributeId = 196;
+ $entityTypeId = 4;
+ $result = [
+ 'entity_attribute_id' => 196,
+ 'entity_type_id' => 4,
+ 'attribute_set_id'=> 4,
+ 'attribute_group_id' => 7,
+ 'attribute_id' => 177,
+ 'sort_order' => 3,
+ ];
+
+ $backendTableName = 'weee_tax';
+ $backendFieldName = 'value_id';
+
+ $attributeModel = $this->getMockBuilder(Attribute::class)
+ ->setMethods(['getEntityAttribute', 'getMetadataPool', 'getConnection', 'getTable'])
+ ->setConstructorArgs([
+ $this->contextMock,
+ $this->storeManagerMock,
+ $this->eavEntityTypeMock,
+ $this->eavConfigMock,
+ $this->lockValidatorMock,
+ null,
+ ])->getMock();
+ $attributeModel->expects($this->any())
+ ->method('getEntityAttribute')
+ ->with($entityAttributeId)
+ ->willReturn($result);
+ $metadataPoolMock = $this->getMockBuilder(MetadataPool::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getMetadata'])
+ ->getMock();
+
+ $this->setObjectProperty($attributeModel, 'metadataPool', $metadataPoolMock);
+
+ $eavAttributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $eavAttributeMock->expects($this->any())->method('getId')->willReturn($result['attribute_id']);
+
+ $this->eavConfigMock->expects($this->any())
+ ->method('getAttribute')
+ ->with($entityTypeId, $result['attribute_id'])
+ ->willReturn($eavAttributeMock);
+
+ $abstractModelMock = $this->getMockBuilder(AbstractModel::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getEntityAttributeId','getEntityTypeId'])
+ ->getMockForAbstractClass();
+ $abstractModelMock->expects($this->any())->method('getEntityAttributeId')->willReturn($entityAttributeId);
+ $abstractModelMock->expects($this->any())->method('getEntityTypeId')->willReturn($entityTypeId);
+
+ $this->lockValidatorMock->expects($this->any())
+ ->method('validate')
+ ->with($eavAttributeMock, $result['attribute_set_id'])
+ ->willReturn(true);
+
+ $backendModelMock = $this->getMockBuilder(AbstractBackend::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getBackend', 'getTable', 'getEntityIdField'])
+ ->getMock();
+
+ $abstractAttributeMock = $this->getMockBuilder(AbstractAttribute::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getEntity'])
+ ->getMockForAbstractClass();
+
+ $eavAttributeMock->expects($this->any())->method('getBackend')->willReturn($backendModelMock);
+ $eavAttributeMock->expects($this->any())->method('getEntity')->willReturn($abstractAttributeMock);
+
+ $backendModelMock->expects($this->any())->method('getTable')->willReturn($backendTableName);
+ $backendModelMock->expects($this->once())->method('getEntityIdField')->willReturn($backendFieldName);
+
+ $metadataPoolMock->expects($this->any())
+ ->method('getMetadata')
+ ->with(ProductInterface::class)
+ ->willReturn($this->entityMetaDataInterfaceMock);
+
+ $this->entityMetaDataInterfaceMock->expects($this->any())
+ ->method('getLinkField')
+ ->willReturn('row_id');
+
+ $attributeModel->expects($this->any())->method('getConnection')->willReturn($this->connectionMock);
+ $attributeModel->expects($this->any())
+ ->method('getTable')
+ ->with('eav_entity_attribute')
+ ->willReturn('eav_entity_attribute');
+
+ $attributeModel->deleteEntity($abstractModelMock);
+ }
+}
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/CategoryTest.php
index 4812751792f18..2ac0b65c22e03 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/CategoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/CategoryTest.php
@@ -7,6 +7,7 @@
namespace Magento\Catalog\Test\Unit\Model\ResourceModel;
use Magento\Catalog\Model\Factory;
+use Magento\Catalog\Model\Indexer\Category\Product\Processor;
use Magento\Catalog\Model\ResourceModel\Category;
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
use Magento\Eav\Model\Config;
@@ -91,6 +92,11 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
private $serializerMock;
+ /**
+ * @var Processor|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $indexerProcessorMock;
+
/**
* {@inheritDoc}
*/
@@ -121,6 +127,9 @@ protected function setUp()
$this->collectionFactoryMock = $this->getMockBuilder(CollectionFactory::class)
->disableOriginalConstructor()
->getMock();
+ $this->indexerProcessorMock = $this->getMockBuilder(Processor::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$this->serializerMock = $this->getMockBuilder(Json::class)->getMock();
@@ -132,7 +141,8 @@ protected function setUp()
$this->treeFactoryMock,
$this->collectionFactoryMock,
[],
- $this->serializerMock
+ $this->serializerMock,
+ $this->indexerProcessorMock
);
}
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php
index 517b5949ee8ea..405c1ced44ba3 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php
@@ -145,6 +145,9 @@ public function testGetUrl($filePath, $miscParams)
);
}
+ /**
+ * @return array
+ */
public function getPathDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/PlaceholderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/PlaceholderTest.php
index 96a6c15e35651..58007145d21a4 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/PlaceholderTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/PlaceholderTest.php
@@ -147,6 +147,9 @@ public function testGetUrl($imageType, $placeholderPath)
$this->assertEquals($expectedResult, $imageModel->getUrl());
}
+ /**
+ * @return array
+ */
public function getPathDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php
index 25c3c3ab24ad8..78cc028b51de7 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php
@@ -108,6 +108,9 @@ public function testGetValue($specialPriceValue, $expectedResult)
$this->assertSame($expectedResult, $this->basePrice->getValue());
}
+ /**
+ * @return array
+ */
public function getValueDataProvider()
{
return [[77, 77], [0, 0], [false, 99]];
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php
index 9225a37c3e5b4..4a206d023ec16 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php
@@ -77,6 +77,11 @@ protected function setUp()
);
}
+ /**
+ * @param array $optionsData
+ *
+ * @return array
+ */
protected function setupOptions(array $optionsData)
{
$options = [];
@@ -105,6 +110,11 @@ protected function setupOptions(array $optionsData)
return $options;
}
+ /**
+ * @param $optionsData
+ *
+ * @return array
+ */
protected function setupSingleValueOptions($optionsData)
{
$options = [];
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/MinimalTierPriceCalculatorTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/MinimalTierPriceCalculatorTest.php
index d04bb4c681e67..1c50271976d15 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/MinimalTierPriceCalculatorTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/MinimalTierPriceCalculatorTest.php
@@ -61,6 +61,9 @@ public function setUp()
);
}
+ /**
+ * @return int
+ */
private function getValueTierPricesExistShouldReturnMinTierPrice()
{
$minPrice = 5;
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php
index fd13439d7d34c..64a6324a35620 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php
@@ -411,6 +411,9 @@ public function testGetQuantity($quantity, $expectedValue)
$this->assertEquals($expectedValue, $tierPrice->getQuantity());
}
+ /**
+ * @return array
+ */
public function getQuantityDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php
index 6322fc76ff442..42f537228ddf8 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php
@@ -347,6 +347,9 @@ public function testHasSpecialPrice($regularPrice, $finalPrice, $expectedResult)
$this->assertEquals($expectedResult, $this->object->hasSpecialPrice());
}
+ /**
+ * @return array
+ */
public function hasSpecialPriceProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/PriceBoxTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/PriceBoxTest.php
index 986a1f7710919..e4d531e91fa07 100644
--- a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/PriceBoxTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/PriceBoxTest.php
@@ -88,6 +88,9 @@ public function testGetCanDisplayQty($typeCode, $expected)
$this->assertEquals($expected, $this->object->getCanDisplayQty($product));
}
+ /**
+ * @return array
+ */
public function getCanDisplayQtyDataProvider()
{
return [
diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/CatalogEavValidationRulesTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/CatalogEavValidationRulesTest.php
index 9b0ade2b1288f..57b277a786ea3 100644
--- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/CatalogEavValidationRulesTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/CatalogEavValidationRulesTest.php
@@ -53,6 +53,9 @@ public function testBuild($frontendInput, $frontendClass, array $eavConfig, arra
$this->assertEquals($expectedResult, $this->catalogEavValidationRules->build($attribute, $eavConfig));
}
+ /**
+ * @return array
+ */
public function buildDataProvider()
{
$data['required'] = true;
diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php
index 528f54fd69730..bac75a20ea691 100755
--- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php
@@ -20,6 +20,7 @@
use Magento\Catalog\Model\ResourceModel\Eav\Attribute as EavAttribute;
use Magento\Eav\Model\Entity\Type as EntityType;
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection as AttributeCollection;
+use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory;
use Magento\Ui\DataProvider\Mapper\FormElement as FormElementMapper;
use Magento\Ui\DataProvider\Mapper\MetaProperties as MetaPropertiesMapper;
use Magento\Framework\Api\SearchCriteriaBuilder;
@@ -88,6 +89,11 @@ class EavTest extends AbstractModifierTest
*/
private $entityTypeMock;
+ /**
+ * @var AttributeCollectionFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $attributeCollectionFactoryMock;
+
/**
* @var AttributeCollection|\PHPUnit_Framework_MockObject_MockObject
*/
@@ -226,6 +232,10 @@ protected function setUp()
$this->entityTypeMock = $this->getMockBuilder(EntityType::class)
->disableOriginalConstructor()
->getMock();
+ $this->attributeCollectionFactoryMock = $this->getMockBuilder(AttributeCollectionFactory::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['create'])
+ ->getMock();
$this->attributeCollectionMock = $this->getMockBuilder(AttributeCollection::class)
->disableOriginalConstructor()
->getMock();
@@ -332,7 +342,7 @@ protected function setUp()
$this->eavAttributeMock->expects($this->any())
->method('load')
->willReturnSelf();
-
+
$this->eav =$this->getModel();
$this->objectManager->setBackwardCompatibleProperty(
$this->eav,
@@ -361,7 +371,8 @@ protected function createModel()
'attributeRepository' => $this->attributeRepositoryMock,
'arrayManager' => $this->arrayManagerMock,
'eavAttributeFactory' => $this->eavAttributeFactoryMock,
- '_eventManager' => $this->eventManagerMock
+ '_eventManager' => $this->eventManagerMock,
+ 'attributeCollectionFactory' => $this->attributeCollectionFactoryMock
]);
}
@@ -375,84 +386,68 @@ public function testModifyData()
]
];
- $this->locatorMock->expects($this->any())
- ->method('getProduct')
+ $this->attributeCollectionFactoryMock->expects($this->once())->method('create')
+ ->willReturn($this->attributeCollectionMock);
+
+ $this->attributeCollectionMock->expects($this->any())->method('getItems')
+ ->willReturn([
+ $this->eavAttributeMock
+ ]);
+
+ $this->locatorMock->expects($this->any())->method('getProduct')
->willReturn($this->productMock);
- $this->productMock->expects($this->any())
- ->method('getId')
+ $this->productMock->expects($this->any())->method('getId')
->willReturn(1);
- $this->productMock->expects($this->once())
- ->method('getAttributeSetId')
+ $this->productMock->expects($this->once())->method('getAttributeSetId')
->willReturn(4);
- $this->productMock->expects($this->once())
- ->method('getData')
+ $this->productMock->expects($this->once())->method('getData')
->with(ProductAttributeInterface::CODE_PRICE)->willReturn('19.9900');
- $this->searchCriteriaBuilderMock->expects($this->any())
- ->method('addFilter')
+ $this->searchCriteriaBuilderMock->expects($this->any())->method('addFilter')
->willReturnSelf();
- $this->searchCriteriaBuilderMock->expects($this->any())
- ->method('create')
+ $this->searchCriteriaBuilderMock->expects($this->any())->method('create')
->willReturn($this->searchCriteriaMock);
- $this->attributeGroupRepositoryMock->expects($this->any())
- ->method('getList')
+ $this->attributeGroupRepositoryMock->expects($this->any())->method('getList')
->willReturn($this->searchCriteriaMock);
- $this->searchCriteriaMock->expects($this->once())
- ->method('getItems')
+ $this->searchCriteriaMock->expects($this->once())->method('getItems')
->willReturn([$this->attributeGroupMock]);
- $this->sortOrderBuilderMock->expects($this->once())
- ->method('setField')
+ $this->sortOrderBuilderMock->expects($this->once())->method('setField')
->willReturnSelf();
- $this->sortOrderBuilderMock->expects($this->once())
- ->method('setAscendingDirection')
+ $this->sortOrderBuilderMock->expects($this->once())->method('setAscendingDirection')
->willReturnSelf();
$dataObjectMock = $this->createMock(\Magento\Framework\Api\AbstractSimpleObject::class);
- $this->sortOrderBuilderMock->expects($this->once())
- ->method('create')
+ $this->sortOrderBuilderMock->expects($this->once())->method('create')
->willReturn($dataObjectMock);
- $this->searchCriteriaBuilderMock->expects($this->any())
- ->method('addFilter')
+ $this->searchCriteriaBuilderMock->expects($this->any())->method('addFilter')
->willReturnSelf();
- $this->searchCriteriaBuilderMock->expects($this->once())
- ->method('addSortOrder')
+ $this->searchCriteriaBuilderMock->expects($this->once())->method('addSortOrder')
->willReturnSelf();
- $this->searchCriteriaBuilderMock->expects($this->any())
- ->method('create')
+ $this->searchCriteriaBuilderMock->expects($this->any())->method('create')
->willReturn($this->searchCriteriaMock);
- $this->attributeRepositoryMock->expects($this->once())
- ->method('getList')
+ $this->attributeRepositoryMock->expects($this->once())->method('getList')
->with($this->searchCriteriaMock)
->willReturn($this->searchResultsMock);
- $this->eavAttributeMock->expects($this->any())
- ->method('getAttributeGroupCode')
+ $this->eavAttributeMock->expects($this->any())->method('getAttributeGroupCode')
->willReturn('product-details');
- $this->eavAttributeMock->expects($this->once())
- ->method('getApplyTo')
+ $this->eavAttributeMock->expects($this->once())->method('getApplyTo')
->willReturn([]);
- $this->eavAttributeMock->expects($this->once())
- ->method('getFrontendInput')
+ $this->eavAttributeMock->expects($this->once())->method('getFrontendInput')
->willReturn('price');
- $this->eavAttributeMock->expects($this->any())
- ->method('getAttributeCode')
+ $this->eavAttributeMock->expects($this->any())->method('getAttributeCode')
->willReturn(ProductAttributeInterface::CODE_PRICE);
- $this->searchResultsMock->expects($this->once())
- ->method('getItems')
+ $this->searchResultsMock->expects($this->once())->method('getItems')
->willReturn([$this->eavAttributeMock]);
- $this->storeMock->expects(($this->once()))
- ->method('getBaseCurrencyCode')
+ $this->storeMock->expects(($this->once()))->method('getBaseCurrencyCode')
->willReturn('en_US');
- $this->storeManagerMock->expects($this->once())
- ->method('getStore')
+ $this->storeManagerMock->expects($this->once())->method('getStore')
->willReturn($this->storeMock);
- $this->currencyMock->expects($this->once())
- ->method('toCurrency')
+ $this->currencyMock->expects($this->once())->method('toCurrency')
->willReturn('19.99');
- $this->currencyLocaleMock->expects($this->once())
- ->method('getCurrency')
+ $this->currencyLocaleMock->expects($this->once())->method('getCurrency')
->willReturn($this->currencyMock);
$this->assertEquals($sourceData, $this->eav->modifyData([]));
diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GeneralTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GeneralTest.php
index b4460b314513b..0eeaa11d57b63 100644
--- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GeneralTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GeneralTest.php
@@ -5,8 +5,11 @@
*/
namespace Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Form\Modifier;
-use Magento\Catalog\Model\Product\Type;
+use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\General;
+use Magento\Eav\Api\AttributeRepositoryInterface;
+use Magento\Eav\Api\Data\AttributeInterface;
+use Magento\Framework\Stdlib\ArrayManager;
/**
* Class GeneralTest
@@ -15,6 +18,38 @@
*/
class GeneralTest extends AbstractModifierTest
{
+ /**
+ * @var AttributeRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $attributeRepositoryMock;
+
+ /**
+ * @var General
+ */
+ private $generalModifier;
+
+ /**
+ * @inheritdoc
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->attributeRepositoryMock = $this->getMockBuilder(AttributeRepositoryInterface::class)
+ ->getMockForAbstractClass();
+
+ $arrayManager = $this->objectManager->getObject(ArrayManager::class);
+
+ $this->generalModifier = $this->objectManager->getObject(
+ General::class,
+ [
+ 'attributeRepository' => $this->attributeRepositoryMock,
+ 'locator' => $this->locatorMock,
+ 'arrayManager' => $arrayManager,
+ ]
+ );
+ }
+
/**
* {@inheritdoc}
*/
@@ -40,4 +75,59 @@ public function testModifyMeta()
]
]));
}
+
+ /**
+ * @param array $data
+ * @param int $defaultStatusValue
+ * @param array $expectedResult
+ * @dataProvider modifyDataDataProvider
+ * @return void
+ */
+ public function testModifyDataNewProduct(array $data, int $defaultStatusValue, array $expectedResult)
+ {
+ $attributeMock = $this->getMockBuilder(AttributeInterface::class)
+ ->getMockForAbstractClass();
+ $attributeMock
+ ->method('getDefaultValue')
+ ->willReturn($defaultStatusValue);
+ $this->attributeRepositoryMock
+ ->method('get')
+ ->with(
+ ProductAttributeInterface::ENTITY_TYPE_CODE,
+ ProductAttributeInterface::CODE_STATUS
+ )
+ ->willReturn($attributeMock);
+ $this->assertSame($expectedResult, $this->generalModifier->modifyData($data));
+ }
+
+ /**
+ * @return array
+ */
+ public function modifyDataDataProvider(): array
+ {
+ return [
+ 'With default status value' => [
+ 'data' => [],
+ 'defaultStatusAttributeValue' => 5,
+ 'expectedResult' => [
+ null => [
+ General::DATA_SOURCE_DEFAULT => [
+ ProductAttributeInterface::CODE_STATUS => 5,
+ ],
+ ],
+ ],
+ ],
+ 'Without default status value' => [
+ 'data' => [],
+ 'defaultStatusAttributeValue' => 0,
+ 'expectedResult' => [
+ null => [
+ General::DATA_SOURCE_DEFAULT => [
+ ProductAttributeInterface::CODE_STATUS => 1,
+ ],
+ ],
+ ],
+ ],
+ ];
+ }
}
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
index a4cc15c0a52dd..d6103e18c6e36 100755
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php
@@ -31,6 +31,7 @@
use Magento\Ui\Component\Form\Fieldset;
use Magento\Ui\DataProvider\Mapper\FormElement as FormElementMapper;
use Magento\Ui\DataProvider\Mapper\MetaProperties as MetaPropertiesMapper;
+use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory;
/**
* Class Eav
@@ -187,6 +188,17 @@ class Eav extends AbstractModifier
*/
private $localeCurrency;
+ /**
+ * internal cache for attribute models
+ * @var array
+ */
+ private $attributesCache = [];
+
+ /**
+ * @var AttributeCollectionFactory
+ */
+ private $attributeCollectionFactory;
+
/**
* @param LocatorInterface $locator
* @param CatalogEavValidationRules $catalogEavValidationRules
@@ -207,6 +219,7 @@ class Eav extends AbstractModifier
* @param DataPersistorInterface $dataPersistor
* @param array $attributesToDisable
* @param array $attributesToEliminate
+ * @param AttributeCollectionFactory $attributeCollectionFactory
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -228,7 +241,8 @@ public function __construct(
ScopeOverriddenValue $scopeOverriddenValue,
DataPersistorInterface $dataPersistor,
$attributesToDisable = [],
- $attributesToEliminate = []
+ $attributesToEliminate = [],
+ AttributeCollectionFactory $attributeCollectionFactory = null
) {
$this->locator = $locator;
$this->catalogEavValidationRules = $catalogEavValidationRules;
@@ -249,6 +263,8 @@ public function __construct(
$this->dataPersistor = $dataPersistor;
$this->attributesToDisable = $attributesToDisable;
$this->attributesToEliminate = $attributesToEliminate;
+ $this->attributeCollectionFactory = $attributeCollectionFactory
+ ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeCollectionFactory::class);
}
/**
@@ -485,39 +501,59 @@ private function getAttributeSetId()
private function getAttributes()
{
if (!$this->attributes) {
- foreach ($this->getGroups() as $group) {
- $this->attributes[$this->calculateGroupCode($group)] = $this->loadAttributes($group);
- }
+ $this->attributes = $this->loadAttributesForGroups($this->getGroups());
}
return $this->attributes;
}
/**
- * Loading product attributes from group
+ * Loads attributes for specified groups at once
*
- * @param AttributeGroupInterface $group
- * @return ProductAttributeInterface[]
+ * @param AttributeGroupInterface[] ...$groups
+ * @return @return ProductAttributeInterface[]
*/
- private function loadAttributes(AttributeGroupInterface $group)
+ private function loadAttributesForGroups(array $groups)
{
$attributes = [];
+ $groupIds = [];
+
+ foreach ($groups as $group) {
+ $groupIds[$group->getAttributeGroupId()] = $this->calculateGroupCode($group);
+ $attributes[$this->calculateGroupCode($group)] = [];
+ }
+
+ $collection = $this->attributeCollectionFactory->create();
+ $collection->setAttributeGroupFilter(array_keys($groupIds));
+
+ $mapAttributeToGroup = [];
+
+ foreach ($collection->getItems() as $attribute) {
+ $mapAttributeToGroup[$attribute->getAttributeId()] = $attribute->getAttributeGroupId();
+ }
+
$sortOrder = $this->sortOrderBuilder
->setField('sort_order')
->setAscendingDirection()
->create();
+
$searchCriteria = $this->searchCriteriaBuilder
- ->addFilter(AttributeGroupInterface::GROUP_ID, $group->getAttributeGroupId())
+ ->addFilter(AttributeGroupInterface::GROUP_ID, array_keys($groupIds), 'in')
->addFilter(ProductAttributeInterface::IS_VISIBLE, 1)
->addSortOrder($sortOrder)
->create();
+
$groupAttributes = $this->attributeRepository->getList($searchCriteria)->getItems();
+
$productType = $this->getProductType();
+
foreach ($groupAttributes as $attribute) {
$applyTo = $attribute->getApplyTo();
$isRelated = !$applyTo || in_array($productType, $applyTo);
if ($isRelated) {
- $attributes[] = $attribute;
+ $attributeGroupId = $mapAttributeToGroup[$attribute->getAttributeId()];
+ $attributeGroupCode = $groupIds[$attributeGroupId];
+ $attributes[$attributeGroupCode][] = $attribute;
}
}
@@ -905,7 +941,13 @@ private function isScopeGlobal($attribute)
*/
private function getAttributeModel($attribute)
{
- return $this->eavAttributeFactory->create()->load($attribute->getAttributeId());
+ $attributeId = $attribute->getAttributeId();
+
+ if (!array_key_exists($attributeId, $this->attributesCache)) {
+ $this->attributesCache[$attributeId] = $this->eavAttributeFactory->create()->load($attributeId);
+ }
+
+ return $this->attributesCache[$attributeId];
}
/**
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
index b0c25e1066e98..819788d6aa6be 100755
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php
@@ -7,6 +7,7 @@
use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Catalog\Model\Locator\LocatorInterface;
+use Magento\Eav\Api\AttributeRepositoryInterface;
use Magento\Ui\Component\Form;
use Magento\Framework\Stdlib\ArrayManager;
@@ -35,16 +36,25 @@ class General extends AbstractModifier
*/
private $localeCurrency;
+ /**
+ * @var AttributeRepositoryInterface
+ */
+ private $attributeRepository;
+
/**
* @param LocatorInterface $locator
* @param ArrayManager $arrayManager
+ * @param AttributeRepositoryInterface|null $attributeRepository
*/
public function __construct(
LocatorInterface $locator,
- ArrayManager $arrayManager
+ ArrayManager $arrayManager,
+ AttributeRepositoryInterface $attributeRepository = null
) {
$this->locator = $locator;
$this->arrayManager = $arrayManager;
+ $this->attributeRepository = $attributeRepository
+ ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeRepositoryInterface::class);
}
/**
@@ -58,7 +68,12 @@ public function modifyData(array $data)
$modelId = $this->locator->getProduct()->getId();
if (!isset($data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS])) {
- $data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS] = '1';
+ $attributeStatus = $this->attributeRepository->get(
+ ProductAttributeInterface::ENTITY_TYPE_CODE,
+ ProductAttributeInterface::CODE_STATUS
+ );
+ $data[$modelId][static::DATA_SOURCE_DEFAULT][ProductAttributeInterface::CODE_STATUS] =
+ $attributeStatus->getDefaultValue() ?: 1;
}
return $data;
diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
index 2f2048b2a3013..e897c330b7e0f 100644
--- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
+++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
@@ -7,7 +7,10 @@
use Magento\Catalog\Helper\Data;
use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\DataObject;
+use Magento\Framework\Escaper;
+use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\View\Element\Block\ArgumentInterface;
/**
@@ -27,18 +30,33 @@ class Breadcrumbs extends DataObject implements ArgumentInterface
*/
private $scopeConfig;
+ /**
+ * @var Json
+ */
+ private $json;
+ /**
+ * @var Escaper
+ */
+ private $escaper;
+
/**
* @param Data $catalogData
* @param ScopeConfigInterface $scopeConfig
+ * @param Json $json
+ * @param Escaper $escaper
*/
public function __construct(
Data $catalogData,
- ScopeConfigInterface $scopeConfig
+ ScopeConfigInterface $scopeConfig,
+ Json $json = null,
+ Escaper $escaper = null
) {
parent::__construct();
$this->catalogData = $catalogData;
$this->scopeConfig = $scopeConfig;
+ $this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
+ $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
}
/**
@@ -78,4 +96,20 @@ public function getProductName()
? $this->catalogData->getProduct()->getName()
: '';
}
+
+ /**
+ * Returns breadcrumb json.
+ *
+ * @return string
+ */
+ public function getJsonConfiguration()
+ {
+ return $this->escaper->escapeHtml($this->json->serialize([
+ 'breadcrumbs' => [
+ 'categoryUrlSuffix' => $this->escaper->escapeHtml($this->getCategoryUrlSuffix()),
+ 'userCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(),
+ 'product' => $this->getProductName()
+ ]
+ ]));
+ }
}
diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv
index a316bac5d3584..b8b2d25d58b48 100644
--- a/app/code/Magento/Catalog/i18n/en_US.csv
+++ b/app/code/Magento/Catalog/i18n/en_US.csv
@@ -516,6 +516,9 @@ Groups,Groups
"Maximum image width","Maximum image width"
"Maximum image height","Maximum image height"
"Maximum number of characters:","Maximum number of characters:"
+"Maximum %1 characters", "Maximum %1 characters"
+"too many", "too many"
+"remaining", "remaining"
"start typing to search template","start typing to search template"
"Product online","Product online"
"Product offline","Product offline"
diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
index 0f6689b88db06..0a04358e41123 100644
--- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
+++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
@@ -14,6 +14,7 @@ define([
options: {
categoryIdSelector: 'input[name="id"]',
categoryPathSelector: 'input[name="path"]',
+ categoryParentSelector: 'input[name="parent"]',
refreshUrl: config.refreshUrl
},
@@ -45,6 +46,7 @@ define([
} else {
$(this.options.categoryIdSelector).val(data.id).change();
$(this.options.categoryPathSelector).val(data.path).change();
+ $(this.options.categoryParentSelector).val(data.parentId).change();
}
}
};
diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/options.js b/app/code/Magento/Catalog/view/adminhtml/web/js/options.js
index 787516a9abf29..6ea005915763c 100644
--- a/app/code/Magento/Catalog/view/adminhtml/web/js/options.js
+++ b/app/code/Magento/Catalog/view/adminhtml/web/js/options.js
@@ -13,12 +13,16 @@ define([
'jquery/ui',
'prototype',
'form',
- 'validation'
+ 'validation',
+ 'mage/translate'
], function (jQuery, mageTemplate, rg) {
'use strict';
return function (config) {
- var attributeOption = {
+ var optionPanel = jQuery('#manage-options-panel'),
+ optionsValues = [],
+ editForm = jQuery('#edit_form'),
+ attributeOption = {
table: $('attribute-options-table'),
itemCount: 0,
totalItems: 0,
@@ -150,7 +154,7 @@ define([
attributeOption.remove(event);
});
- jQuery('#manage-options-panel').on('render', function () {
+ optionPanel.on('render', function () {
attributeOption.ignoreValidate();
if (attributeOption.rendered) {
@@ -176,7 +180,31 @@ define([
});
});
}
+ editForm.on('submit', function () {
+ optionPanel.find('input')
+ .each(function () {
+ if (this.disabled) {
+ return;
+ }
+ if (this.type === 'checkbox' || this.type === 'radio') {
+ if (this.checked) {
+ optionsValues.push(this.name + '=' + jQuery(this).val());
+ }
+ } else {
+ optionsValues.push(this.name + '=' + jQuery(this).val());
+ }
+ });
+ jQuery(' ')
+ .attr({
+ type: 'hidden',
+ name: 'serialized_options'
+ })
+ .val(JSON.stringify(optionsValues))
+ .prependTo(editForm);
+ optionPanel.find('table')
+ .replaceWith(jQuery('
').text(jQuery.mage.__('Sending attribute values as package.')));
+ });
window.attributeOption = attributeOption;
window.optionDefaultInputType = attributeOption.getOptionInputType();
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml
index 063f8857329e5..c54ce5340851c 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml
@@ -7,11 +7,4 @@
/** @var \Magento\Catalog\ViewModel\Product\Breadcrumbs $viewModel */
$viewModel = $block->getData('viewModel');
?>
-
-
+
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml
index 11aedc33c2d42..852e0095f2f66 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml
@@ -61,8 +61,23 @@ $class = ($_option->getIsRequire()) ? ' required' : '';
cols="25">= $block->escapeHtml($block->getDefaultValue()) ?>
getMaxCharacters()): ?>
-
= /* @escapeNotVerified */ __('Maximum number of characters:') ?>
- = /* @escapeNotVerified */ $_option->getMaxCharacters() ?>
+
+ = /* @escapeNotVerified */ __('Maximum %1 characters', $_option->getMaxCharacters()) ?>
+
+
+ getMaxCharacters()): ?>
+
+
diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/remaining-characters.js b/app/code/Magento/Catalog/view/frontend/web/js/product/remaining-characters.js
new file mode 100644
index 0000000000000..3e29e1ebd4d9c
--- /dev/null
+++ b/app/code/Magento/Catalog/view/frontend/web/js/product/remaining-characters.js
@@ -0,0 +1,62 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+define([
+ 'jquery',
+ 'mage/translate',
+ 'jquery/ui'
+], function ($, $t) {
+ 'use strict';
+
+ $.widget('mage.remainingCharacters', {
+ options: {
+ remainingText: $t('remaining'),
+ tooManyText: $t('too many'),
+ errorClass: 'mage-error',
+ noDisplayClass: 'no-display'
+ },
+
+ /**
+ * Initializes custom option component
+ *
+ * @private
+ */
+ _create: function () {
+ this.note = $(this.options.noteSelector);
+ this.counter = $(this.options.counterSelector);
+
+ this.updateCharacterCount();
+ this.element.on('change keyup paste', this.updateCharacterCount.bind(this));
+ },
+
+ /**
+ * Updates counter message
+ */
+ updateCharacterCount: function () {
+ var length = this.element.val().length,
+ diff = this.options.maxLength - length;
+
+ this.counter.text(this._formatMessage(diff));
+ this.counter.toggleClass(this.options.noDisplayClass, length === 0);
+ this.note.toggleClass(this.options.errorClass, diff < 0);
+ },
+
+ /**
+ * Format remaining characters message
+ *
+ * @param {int} diff
+ * @returns {String}
+ * @private
+ */
+ _formatMessage: function (diff) {
+ var count = Math.abs(diff),
+ qualifier = diff < 0 ? this.options.tooManyText : this.options.remainingText;
+
+ return '(' + count + ' ' + qualifier + ')';
+ }
+ });
+
+ return $.mage.remainingCharacters;
+});
diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js b/app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js
index 014002bdc4af9..e571baa23e497 100644
--- a/app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js
+++ b/app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js
@@ -47,7 +47,7 @@ define([
* @param {*} data
*/
add: function (data) {
- if (!utils.compare(data, this.data()).equal) {
+ if (!_.isEmpty(data) && !utils.compare(data, this.data()).equal) {
this.data(_.extend(utils.copy(this.data()), data));
}
},
diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
index 2199936101357..362433598b7c9 100644
--- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php
+++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
@@ -2675,7 +2675,12 @@ protected function checkUrlKeyDuplicates()
);
foreach ($urlKeyDuplicates as $entityData) {
$rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];
- $this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum);
+ $message = sprintf(
+ $this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),
+ $entityData['request_path'],
+ $entityData['sku']
+ );
+ $this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);
}
}
}
diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php
index 0a6e8032d484a..d2b03936f4f0f 100644
--- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php
+++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php
@@ -1214,7 +1214,7 @@ protected function _importData()
$optionsToRemove = [];
foreach ($bunch as $rowNumber => $rowData) {
- if (isset($optionId, $valueId) && empty($rowData[PRODUCT::COL_STORE_VIEW_CODE])) {
+ if (isset($optionId, $valueId) && empty($rowData[Product::COL_STORE_VIEW_CODE])) {
$nextOptionId = $optionId;
$nextValueId = $valueId;
}
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/CategoryProcessorTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/CategoryProcessorTest.php
index bf47ec4f9da13..e56cb62e042bb 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/CategoryProcessorTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/CategoryProcessorTest.php
@@ -135,6 +135,9 @@ public function testGetCategoryById($categoriesCache, $expectedResult)
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function getCategoryByIdDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/AbstractTypeTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/AbstractTypeTest.php
index e24b4e1948149..70ac3a4fa2e97 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/AbstractTypeTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/AbstractTypeTest.php
@@ -269,6 +269,9 @@ public function testIsRowValidError()
$this->assertFalse($this->simpleType->isRowValid($rowData, $rowNum));
}
+ /**
+ * @return array
+ */
public function addAttributeOptionDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Validator/TierPriceTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Validator/TierPriceTest.php
index 4e902024769f7..f1965e3063217 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Validator/TierPriceTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Validator/TierPriceTest.php
@@ -48,6 +48,11 @@ protected function setUp()
);
}
+ /**
+ * @param $groupId
+ *
+ * @return \Magento\CatalogImportExport\Model\Import\Product\Validator\TierPrice
+ */
protected function processInit($groupId)
{
$searchResult = $this->createMock(\Magento\Customer\Api\Data\GroupSearchResultsInterface::class);
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
index 6d183fc8e6e20..1cd19852f393c 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php
@@ -790,6 +790,9 @@ public function testGetCategoryProcessor()
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function getStoreIdByCodeDataProvider()
{
return [
@@ -1239,6 +1242,9 @@ public function uploadMediaFilesDataProvider()
];
}
+ /**
+ * @return array
+ */
public function getImagesFromRowDataProvider()
{
return [
@@ -1265,6 +1271,9 @@ public function getImagesFromRowDataProvider()
];
}
+ /**
+ * @return array
+ */
public function validateRowValidateNewProductTypeAddRowErrorCallDataProvider()
{
return [
@@ -1299,6 +1308,9 @@ public function validateRowValidateNewProductTypeAddRowErrorCallDataProvider()
];
}
+ /**
+ * @return array
+ */
public function validateRowCheckSpecifiedSkuDataProvider()
{
return [
@@ -1317,6 +1329,9 @@ public function validateRowCheckSpecifiedSkuDataProvider()
];
}
+ /**
+ * @return array
+ */
public function validateRowDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php
index e28c2e1f3c01d..0c21538889498 100644
--- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php
+++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php
@@ -193,6 +193,9 @@ public function testMoveFileUrlDrivePool($fileUrl, $expectedHost, $expectedDrive
$this->assertNull($result);
}
+ /**
+ * @return array
+ */
public function moveFileUrlDriverPoolDataProvider()
{
return [
@@ -211,6 +214,9 @@ public function moveFileUrlDriverPoolDataProvider()
];
}
+ /**
+ * @return array
+ */
public function moveFileUrlDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php
index 2fe40c118b06a..bd04df0da0a4a 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php
@@ -167,6 +167,9 @@ public function testAddInStockFilterToCollection($configMock)
$this->assertNull($this->stock->addInStockFilterToCollection($collectionMock));
}
+ /**
+ * @return array
+ */
public function filterProvider()
{
$configMock = $this->getMockBuilder(\Magento\Framework\App\Config::class)
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php
index ea562da2f01c0..3788b1bc401fe 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php
@@ -48,6 +48,9 @@ public function testAfterGetProductCollectionShow($status, $callCount)
$this->assertEquals($collectionMock, $this->model->afterGetProductCollection($subjectMock, $collectionMock));
}
+ /**
+ * @return array
+ */
private function buildMocks()
{
/** @var \Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection $collectionMock */
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php
index 11a04d26994ae..7e2bad0b96354 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QuantityValidatorTest.php
@@ -450,6 +450,10 @@ public function testException()
$this->quantityValidator->validate($this->observerMock);
}
+ /**
+ * @param $qty
+ * @param $hasError
+ */
private function setUpStubForQuantity($qty, $hasError)
{
$this->productMock->expects($this->any())
@@ -480,6 +484,9 @@ private function setUpStubForQuantity($qty, $hasError)
->willReturn('');
}
+ /**
+ * @param $qty
+ */
private function createInitialStub($qty)
{
$this->storeMock->expects($this->any())
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php
index 5c75249b7cbf8..b542dd219af1d 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php
@@ -243,41 +243,67 @@ public function testCheckQuoteItemQty(StockItemInterface $stockItem, $expectedRe
);
}
+ /**
+ * @return array
+ */
public function verifyStockDataProvider()
{
return $this->prepareDataForMethod('verifyStock');
}
+ /**
+ * @return array
+ */
public function verifyNotificationDataProvider()
{
return $this->prepareDataForMethod('verifyNotification');
}
+ /**
+ * @return array
+ */
public function checkQtyDataProvider()
{
return $this->prepareDataForMethod('checkQty');
}
+ /**
+ * @return array
+ */
public function suggestQtyDataProvider()
{
return $this->prepareDataForMethod('suggestQty');
}
+ /**
+ * @return array
+ */
public function getStockQtyDataProvider()
{
return $this->prepareDataForMethod('getStockQty');
}
+ /**
+ * @return array
+ */
public function checkQtyIncrementsDataProvider()
{
return $this->prepareDataForMethod('checkQtyIncrements');
}
+ /**
+ * @return array
+ */
public function checkQuoteItemQtyDataProvider()
{
return $this->prepareDataForMethod('checkQuoteItemQty');
}
+ /**
+ * @param $methodName
+ *
+ * @return array
+ */
protected function prepareDataForMethod($methodName)
{
$variations = [];
@@ -318,6 +344,9 @@ protected function prepareDataForMethod($methodName)
return $variations;
}
+ /**
+ * @return array
+ */
protected function getVariations()
{
$stockQty = 100;
@@ -430,6 +459,9 @@ public function testCheckQtyIncrementsMsg($isChildItem, $expectedMsg)
$this->assertEquals($expectedMsg, $result->getMessage()->render());
}
+ /**
+ * @return array
+ */
public function checkQtyIncrementsMsgDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php
index d1d8e171bea16..359b0e80f1b74 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php
@@ -482,6 +482,9 @@ public function testDispatchEvents($eventName, $methodName, $objectName)
);
}
+ /**
+ * @return array
+ */
public function eventsDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/StockTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/StockTest.php
index c3abad50ef9f4..9ecab4dca77e3 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Model/StockTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/StockTest.php
@@ -125,7 +125,10 @@ public function testDispatchEvents($eventName, $methodName, $objectName)
sprintf('Event "%s" with object name "%s" doesn\'t dispatched properly', $eventName, $objectName)
);
}
-
+
+ /**
+ * @return array
+ */
public function eventsDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Ui/Component/Product/Form/Element/UseConfigSettingsTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Ui/Component/Product/Form/Element/UseConfigSettingsTest.php
index db183ae5c0da0..0ce62133d6f9b 100644
--- a/app/code/Magento/CatalogInventory/Test/Unit/Ui/Component/Product/Form/Element/UseConfigSettingsTest.php
+++ b/app/code/Magento/CatalogInventory/Test/Unit/Ui/Component/Product/Form/Element/UseConfigSettingsTest.php
@@ -106,6 +106,9 @@ public function testPrepareSource(
$this->assertEquals($expectedResult, $this->useConfigSettings->getData('config'));
}
+ /**
+ * @return array
+ */
public function prepareSourceDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php
index b1e27bf973404..ccc86920a7e74 100644
--- a/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php
+++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php
@@ -56,6 +56,9 @@ public function testModifyPriceIfPriceExists($resultPrice, $expectedPrice)
$this->assertEquals($expectedPrice, $this->priceModifier->modifyPrice(100, $this->productMock));
}
+ /**
+ * @return array
+ */
public function modifyPriceDataProvider()
{
return ['resulted_price_exists' => [150, 150], 'resulted_price_not_exists' => [null, 100]];
diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/Condition/MappableConditionProcessorTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/Condition/MappableConditionProcessorTest.php
index 1643b3473ae27..59c0322678759 100644
--- a/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/Condition/MappableConditionProcessorTest.php
+++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Rule/Condition/MappableConditionProcessorTest.php
@@ -1006,6 +1006,12 @@ public function testException()
$this->mappableConditionProcessor->rebuildConditionsTree($inputCondition);
}
+ /**
+ * @param $subConditions
+ * @param $aggregator
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getMockForCombinedCondition($subConditions, $aggregator)
{
$mock = $this->getMockBuilder(CombinedCondition::class)
@@ -1020,6 +1026,11 @@ protected function getMockForCombinedCondition($subConditions, $aggregator)
return $mock;
}
+ /**
+ * @param $attribute
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getMockForSimpleCondition($attribute)
{
$mock = $this->getMockBuilder(SimpleCondition::class)
diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php
new file mode 100644
index 0000000000000..fe68c6321e472
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php
@@ -0,0 +1,45 @@
+fulltextIndexerProcessor = $fulltextIndexerProcessor;
+ }
+
+ /**
+ * Mark fulltext indexer as invalid post-deletion of category.
+ *
+ * @param Resource $subjectCategory
+ * @param Resource $resultCategory
+ * @return Resource
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function afterDelete(Resource $subjectCategory, Resource $resultCategory): Resource
+ {
+ $this->fulltextIndexerProcessor->markIndexerAsInvalid();
+
+ return $resultCategory;
+ }
+}
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php
index f4c512916465f..01108358da2e0 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php
@@ -314,6 +314,9 @@ public function testProcessTermFilter($frontendInput, $fieldValue, $isNegation,
$this->assertSame($expected, $this->removeWhitespaces($actualResult));
}
+ /**
+ * @return array
+ */
public function testTermFilterDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php
index ac3e84a5c8fef..a04affcf810c1 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php
@@ -99,6 +99,9 @@ protected function setUp()
->willReturn($this->store);
}
+ /**
+ * @return array
+ */
public function addFiltersDataProvider()
{
return array_merge(
@@ -269,6 +272,11 @@ private function createBackend($table)
return $backend;
}
+ /**
+ * @param string $optionText
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function createSource($optionText = 'optionText')
{
$source = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::class)
@@ -281,6 +289,9 @@ private function createSource($optionText = 'optionText')
return $source;
}
+ /**
+ * @return array
+ */
private function addFiltersPriceDataProvider()
{
return [
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Autocomplete/DataProviderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Autocomplete/DataProviderTest.php
index 75daf438f7bf2..b54a02ffb3cf9 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Autocomplete/DataProviderTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Autocomplete/DataProviderTest.php
@@ -107,6 +107,9 @@ public function testGetItems()
$this->assertEquals($expected, $result[0]->toArray());
}
+ /**
+ * @param array $data
+ */
private function buildCollection(array $data)
{
$collectionData = [];
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Fulltext/CollectionTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Fulltext/CollectionTest.php
index c0f1f3fcaa5e6..ffdb849c81d65 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Fulltext/CollectionTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/Fulltext/CollectionTest.php
@@ -206,6 +206,12 @@ protected function getFilterBuilder()
return $filterBuilder;
}
+ /**
+ * @param MockObject $filterBuilder
+ * @param array $filters
+ *
+ * @return MockObject
+ */
protected function addFiltersToFilterBuilder(MockObject $filterBuilder, array $filters)
{
$i = 1;
@@ -222,6 +228,9 @@ protected function addFiltersToFilterBuilder(MockObject $filterBuilder, array $f
return $filterBuilder;
}
+ /**
+ * @return MockObject
+ */
protected function createFilter()
{
$filter = $this->getMockBuilder(\Magento\Framework\Api\Filter::class)
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/BaseSelectStrategy/StrategyMapperTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/BaseSelectStrategy/StrategyMapperTest.php
index 1ff1131e5f002..5fa5b0333c6ba 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/BaseSelectStrategy/StrategyMapperTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/BaseSelectStrategy/StrategyMapperTest.php
@@ -91,6 +91,9 @@ public function testBaseSelectFullTextSearchStrategy(
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/CustomAttributeFilterCheckTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/CustomAttributeFilterCheckTest.php
index 2022492ed1c86..175407bda677f 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/CustomAttributeFilterCheckTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/CustomAttributeFilterCheckTest.php
@@ -78,6 +78,9 @@ public function testIsCustomPositive($attributeFrontEndType)
);
}
+ /**
+ * @return array
+ */
public function dataProviderForIsCustomPositive()
{
return [
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php
index c393f91f21fe1..02d6bec162c56 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Indexer/IndexStructureTest.php
@@ -120,6 +120,13 @@ private function createDimensionMock($name, $value)
return $dimension;
}
+ /**
+ * @param $callNumber
+ * @param $tableName
+ * @param $isTableExist
+ *
+ * @return mixed
+ */
private function mockDropTable($callNumber, $tableName, $isTableExist)
{
$this->connection->expects($this->at($callNumber++))
@@ -135,6 +142,12 @@ private function mockDropTable($callNumber, $tableName, $isTableExist)
return $callNumber;
}
+ /**
+ * @param $callNumber
+ * @param $tableName
+ *
+ * @return mixed
+ */
private function mockFulltextTable($callNumber, $tableName)
{
$table = $this->getMockBuilder(\Magento\Framework\DB\Ddl\Table::class)
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/QueryChecker/FullTextSearchCheckTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/QueryChecker/FullTextSearchCheckTest.php
index bb6e4ab8b4281..d13dcc11628f2 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/QueryChecker/FullTextSearchCheckTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/QueryChecker/FullTextSearchCheckTest.php
@@ -78,6 +78,9 @@ public function testInvalidArgumentException2()
$this->fullTextSearchCheck->isRequiredForQuery($filterMock);
}
+ /**
+ * @return array
+ */
public function positiveDataProvider()
{
$boolQueryMock = $this->getBoolQueryMock();
@@ -114,6 +117,9 @@ public function positiveDataProvider()
];
}
+ /**
+ * @return array
+ */
public function negativeDataProvider()
{
$emptyBoolQueryMock = $this->getBoolQueryMock();
@@ -147,6 +153,9 @@ public function negativeDataProvider()
];
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getMatchQueryMock()
{
$matchQueryMock = $this->getMockBuilder(\Magento\Framework\Search\Request\QueryInterface::class)
@@ -161,6 +170,9 @@ private function getMatchQueryMock()
return $matchQueryMock;
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getBoolQueryMock()
{
$boolQueryMock = $this->getMockBuilder(\Magento\Framework\Search\Request\Query\BoolExpression::class)
@@ -175,6 +187,9 @@ private function getBoolQueryMock()
return $boolQueryMock;
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getFilterQueryMock()
{
$filterQueryMock = $this->getMockBuilder(\Magento\Framework\Search\Request\Query\Filter::class)
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php
index 259c8e5d7f897..560de27ccdbc7 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php
@@ -239,6 +239,11 @@ private function createAttributeMock($attributeOptions)
return $attribute;
}
+ /**
+ * @param $value
+ *
+ * @return int|void
+ */
private function countVal(&$value)
{
return !empty($value) ? count($value) : 0;
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/SelectContainer/SelectContainerBuilderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/SelectContainer/SelectContainerBuilderTest.php
index ef4d8d314825b..374d0390f937c 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/SelectContainer/SelectContainerBuilderTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/SelectContainer/SelectContainerBuilderTest.php
@@ -190,6 +190,9 @@ public function testBuildByRequest()
);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function mockQuery()
{
return $this->getMockBuilder(QueryInterface::class)
@@ -197,6 +200,9 @@ private function mockQuery()
->getMockForAbstractClass();
}
+ /**
+ * @return array
+ */
private function mockFilters()
{
$visibilityFilter = $this->getMockBuilder(Term::class)
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/TableMapperTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/TableMapperTest.php
index 1521b38d8c298..cfddc07bceecc 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/TableMapperTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/TableMapperTest.php
@@ -275,6 +275,9 @@ function (FilterInterface $filter) {
$this->tableMapper->addTables($select, $request);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getSelectMock()
{
return $this->getMockBuilder(\Magento\Framework\DB\Select::class)
@@ -282,6 +285,9 @@ private function getSelectMock()
->getMock();
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getRequestMock()
{
return $this->getMockBuilder(\Magento\Framework\Search\RequestInterface::class)
@@ -289,6 +295,9 @@ private function getRequestMock()
->getMock();
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getQueryMock()
{
return $this->getMockBuilder(QueryInterface::class)
@@ -296,6 +305,9 @@ private function getQueryMock()
->getMockForAbstractClass();
}
+ /**
+ * @return array
+ */
private function getDifferentFiltersMock()
{
$visibilityFilter = $this->getMockBuilder(Term::class)
@@ -316,6 +328,9 @@ private function getDifferentFiltersMock()
return [$visibilityFilter, $customFilter, $nonCustomFilter];
}
+ /**
+ * @return array
+ */
private function getSameFiltersMock()
{
$visibilityFilter1 = $this->getMockBuilder(Term::class)
diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml
index 7877ff04b24fd..2d41d17889e49 100644
--- a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml
+++ b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml
@@ -26,4 +26,12 @@
+
+
+ Magento\CatalogSearch\Ui\DataProvider\Product\AddFulltextFilterToCollection
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/etc/webapi_rest/di.xml b/app/code/Magento/CatalogSearch/etc/webapi_rest/di.xml
new file mode 100644
index 0000000000000..c7293783dc609
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/etc/webapi_rest/di.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/etc/webapi_soap/di.xml b/app/code/Magento/CatalogSearch/etc/webapi_soap/di.xml
new file mode 100644
index 0000000000000..c7293783dc609
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/etc/webapi_soap/di.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php
index 2e192d895c6d5..64f032f2d16e9 100644
--- a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php
+++ b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php
@@ -120,11 +120,12 @@ public function getCanonicalUrlPath($product, $category = null)
* Generate product url key based on url_key entered by merchant or product name
*
* @param \Magento\Catalog\Model\Product $product
- * @return string
+ * @return string|null
*/
public function getUrlKey($product)
{
- return $product->getUrlKey() === false ? false : $this->prepareProductUrlKey($product);
+ $generatedProductUrlKey = $this->prepareProductUrlKey($product);
+ return ($product->getUrlKey() === false || empty($generatedProductUrlKey)) ? null : $generatedProductUrlKey;
}
/**
diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php
index b201ae31b680a..28afff56c019f 100644
--- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php
+++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php
@@ -33,6 +33,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
{
/** @var Product $product */
$product = $observer->getEvent()->getProduct();
- $product->setUrlKey($this->productUrlPathGenerator->getUrlKey($product));
+ $urlKey = $this->productUrlPathGenerator->getUrlKey($product);
+ if (null !== $urlKey) {
+ $product->setUrlKey($urlKey);
+ }
}
}
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php
index b32b0216b9bdf..956fe1b88e0ad 100644
--- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductUrlPathGeneratorTest.php
@@ -105,7 +105,7 @@ public function testGetUrlKey($productUrlKey, $expectedUrlKey)
{
$this->product->expects($this->any())->method('getUrlKey')->will($this->returnValue($productUrlKey));
$this->product->expects($this->any())->method('formatUrlKey')->will($this->returnValue($productUrlKey));
- $this->assertEquals($expectedUrlKey, $this->productUrlPathGenerator->getUrlKey($this->product));
+ $this->assertSame($expectedUrlKey, $this->productUrlPathGenerator->getUrlKey($this->product));
}
/**
@@ -114,7 +114,7 @@ public function testGetUrlKey($productUrlKey, $expectedUrlKey)
public function getUrlKeyDataProvider()
{
return [
- 'URL Key use default' => [false, false],
+ 'URL Key use default' => [false, null],
'URL Key empty' => ['product-url', 'product-url'],
];
}
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php
new file mode 100644
index 0000000000000..001543da8a2d7
--- /dev/null
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php
@@ -0,0 +1,91 @@
+productUrlPathGenerator = $this->getMockBuilder(ProductUrlPathGenerator::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getUrlKey'])
+ ->getMock();
+
+ $this->productUrlKeyAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject(
+ \Magento\CatalogUrlRewrite\Observer\ProductUrlKeyAutogeneratorObserver::class,
+ [
+ 'productUrlPathGenerator' => $this->productUrlPathGenerator
+ ]
+ );
+ }
+
+ public function testExecuteWithUrlKey()
+ {
+ $urlKey = 'product_url_key';
+
+ $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['setUrlKey'])
+ ->getMock();
+ $product->expects($this->atLeastOnce())->method('setUrlKey')->with($urlKey);
+ $event = $this->getMockBuilder(\Magento\Framework\Event::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getProduct'])
+ ->getMock();
+ $event->expects($this->atLeastOnce())->method('getProduct')->willReturn($product);
+ /** @var \Magento\Framework\Event\Observer|\PHPUnit_Framework_MockObject_MockObject $observer */
+ $observer = $this->getMockBuilder(\Magento\Framework\Event\Observer::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getEvent'])
+ ->getMock();
+ $observer->expects($this->atLeastOnce())->method('getEvent')->willReturn($event);
+ $this->productUrlPathGenerator->expects($this->atLeastOnce())->method('getUrlKey')->with($product)
+ ->willReturn($urlKey);
+
+ $this->productUrlKeyAutogeneratorObserver->execute($observer);
+ }
+
+ public function testExecuteWithEmptyUrlKey()
+ {
+ $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['setUrlKey'])
+ ->getMock();
+ $product->expects($this->never())->method('setUrlKey');
+ $event = $this->getMockBuilder(\Magento\Framework\Event::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getProduct'])
+ ->getMock();
+ $event->expects($this->atLeastOnce())->method('getProduct')->willReturn($product);
+ /** @var \Magento\Framework\Event\Observer|\PHPUnit_Framework_MockObject_MockObject $observer */
+ $observer = $this->getMockBuilder(\Magento\Framework\Event\Observer::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getEvent'])
+ ->getMock();
+ $observer->expects($this->atLeastOnce())->method('getEvent')->willReturn($event);
+ $this->productUrlPathGenerator->expects($this->atLeastOnce())->method('getUrlKey')->with($product)
+ ->willReturn(null);
+
+ $this->productUrlKeyAutogeneratorObserver->execute($observer);
+ }
+}
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ProductUrlRewriteTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ProductUrlRewriteTest.php
index 763f78ac1fea6..40f7642f35383 100644
--- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ProductUrlRewriteTest.php
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ProductUrlRewriteTest.php
@@ -27,6 +27,9 @@ protected function setUp()
->getMockForAbstractClass();
}
+ /**
+ * @return \Magento\Ui\DataProvider\Modifier\ModifierInterface|object
+ */
protected function createModel()
{
return $this->objectManager->getObject(ProductUrlRewrite::class, [
diff --git a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php
index 9c679b8bfe9b0..f41318fcd5c24 100644
--- a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php
+++ b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php
@@ -118,7 +118,7 @@ public function addToCollection($collection)
{
$attribute = $this->getAttributeObject();
- if ($collection->isEnabledFlat()) {
+ if ($attribute->getUsedInProductListing() && $collection->isEnabledFlat()) {
$alias = array_keys($collection->getSelect()->getPart('from'))[0];
$this->joinedAttributes[$attribute->getAttributeCode()] = $alias . '.' . $attribute->getAttributeCode();
return $this;
diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php
index 3039066ad1388..5de8b9d9632fc 100644
--- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php
+++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php
@@ -316,6 +316,9 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP
$this->assertSame($collection, $this->productsList->createCollection());
}
+ /**
+ * @return array
+ */
public function createCollectionDataProvider()
{
return [
diff --git a/app/code/Magento/Checkout/Setup/InstallData.php b/app/code/Magento/Checkout/Setup/InstallData.php
index 38879e06d65ac..58b118c482307 100644
--- a/app/code/Magento/Checkout/Setup/InstallData.php
+++ b/app/code/Magento/Checkout/Setup/InstallData.php
@@ -816,7 +816,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
$connection->commit();
} catch (\Exception $e) {
- $connection->rollback();
+ $connection->rollBack();
throw $e;
}
}
diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php
index aecaf0ec9f039..1a9c5555c91c0 100644
--- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php
@@ -124,6 +124,9 @@ public function testGetTotalsCache($expectedResult, $isVirtual)
$this->assertEquals($expectedResult, $model->getTotalsCache());
}
+ /**
+ * @return array
+ */
public function getTotalsCacheDataProvider()
{
return [
diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LinkTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LinkTest.php
index 2478270e0aec6..417c1e4295ea1 100644
--- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LinkTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LinkTest.php
@@ -82,6 +82,9 @@ public function testGetLabel($productCount, $label)
$this->assertSame($label, (string)$block->getLabel());
}
+ /**
+ * @return array
+ */
public function getLabelDataProvider()
{
return [[1, 'My Cart (1 item)'], [2, 'My Cart (2 items)'], [0, 'My Cart']];
diff --git a/app/code/Magento/Checkout/Test/Unit/Block/LinkTest.php b/app/code/Magento/Checkout/Test/Unit/Block/LinkTest.php
index 24065c1f54eb3..7db5d7ecb19fd 100644
--- a/app/code/Magento/Checkout/Test/Unit/Block/LinkTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Block/LinkTest.php
@@ -68,6 +68,9 @@ public function testToHtml($canOnepageCheckout, $isOutputEnabled)
$this->assertEquals('', $block->toHtml());
}
+ /**
+ * @return array
+ */
public function toHtmlDataProvider()
{
return [[false, true], [true, false], [false, false]];
diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php
index 18281494029b6..36d37d07ef752 100644
--- a/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php
@@ -153,6 +153,9 @@ public function testToHtmlOrderVisibleOnFront(array $invisibleStatuses, $expecte
$this->assertEquals($expectedResult, $this->block->getIsOrderVisible());
}
+ /**
+ * @return array
+ */
public function invisibleStatusesProvider()
{
return [
diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php b/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php
index 26771c1531267..1a8fecd8356bb 100644
--- a/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php
+++ b/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php
@@ -8,6 +8,9 @@
class OnepageStub extends \Magento\Checkout\Controller\Onepage
{
+ /**
+ * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
+ */
public function execute()
{
// Empty method stub for test
diff --git a/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php b/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php
index 40de71e28c05e..6bd0bdf258a0a 100644
--- a/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php
@@ -279,6 +279,9 @@ public function testGetSummaryQty($useQty)
$this->assertEquals($itemsCount, $this->cart->getSummaryQty());
}
+ /**
+ * @return array
+ */
public function useQtyDataProvider()
{
return [
diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php
index fec1d6d4d003f..2751a54d2d2fe 100644
--- a/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php
@@ -90,6 +90,11 @@ public function testIsValidTrue()
$this->assertTrue($this->createSuccessValidator($checkoutSession)->isValid($checkoutSession));
}
+ /**
+ * @param \PHPUnit_Framework_MockObject_MockObject $checkoutSession
+ *
+ * @return object
+ */
protected function createSuccessValidator(\PHPUnit_Framework_MockObject_MockObject $checkoutSession)
{
return $this->objectManagerHelper->getObject(
diff --git a/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php b/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php
index 29537e8ec0526..77b9469285b96 100644
--- a/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php
@@ -45,6 +45,9 @@ public function testGetResponseData($error, $result)
$this->assertEquals($result, $this->sidebar->getResponseData($error));
}
+ /**
+ * @return array
+ */
public function dataProviderGetResponseData()
{
return [
diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php
index 684ad9264f77c..1733aff33228d 100644
--- a/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php
+++ b/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php
@@ -264,6 +264,9 @@ public function testInitCheckout($stepData, $isLoggedIn, $isSetStepDataCalled)
$this->onepage->initCheckout();
}
+ /**
+ * @return array
+ */
public function initCheckoutDataProvider()
{
return [
@@ -296,6 +299,9 @@ public function testGetCheckoutMethod($isLoggedIn, $quoteCheckoutMethod, $isAllo
$this->assertEquals($expected, $this->onepage->getCheckoutMethod());
}
+ /**
+ * @return array
+ */
public function getCheckoutMethodDataProvider()
{
return [
diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml
index 7b435db200f19..26c601a4e9f38 100644
--- a/app/code/Magento/Checkout/etc/webapi.xml
+++ b/app/code/Magento/Checkout/etc/webapi.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/app/code/Magento/Checkout/i18n/en_US.csv b/app/code/Magento/Checkout/i18n/en_US.csv
index f746d454a159c..6db1fd74734d6 100644
--- a/app/code/Magento/Checkout/i18n/en_US.csv
+++ b/app/code/Magento/Checkout/i18n/en_US.csv
@@ -176,5 +176,5 @@ Payment,Payment
"Not yet calculated","Not yet calculated"
"We received your order!","We received your order!"
"Thank you for your purchase!","Thank you for your purchase!"
-"optional", "optional"
+"Password", "Password"
"Something went wrong while saving the page. Please refresh the page and try again.","Something went wrong while saving the page. Please refresh the page and try again."
\ No newline at end of file
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js
index a0bdf0a17d7fe..aba0c31b998d1 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js
@@ -14,20 +14,17 @@ define([
'use strict';
var quoteItems = ko.observable(quote.totals().items),
- cartData = customerData.get('cart');
+ cartData = customerData.get('cart'),
+ quoteSubtotal = parseFloat(quote.totals().subtotal),
+ subtotalAmount = parseFloat(cartData().subtotalAmount);
quote.totals.subscribe(function (newValue) {
quoteItems(newValue.items);
});
- cartData.subscribe(function () {
- var quoteSubtotal = parseFloat(quote.totals().subtotal),
- subtotalAmount = parseFloat(cartData().subtotalAmount);
-
- if (quoteSubtotal !== subtotalAmount) {
- customerData.reload(['cart'], false);
- }
- }, this);
+ if (quoteSubtotal !== subtotalAmount) {
+ customerData.reload(['cart'], false);
+ }
return {
totals: quote.totals,
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js
index 33223e9ae3c24..a2f8c8c56ff33 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js
@@ -94,10 +94,6 @@ define([
this.isLoading(addToCartCalls > 0);
sidebarInitialized = false;
this.update(updatedCart);
-
- if (cartData()['website_id'] !== window.checkout.websiteId) {
- customerData.reload(['cart'], false);
- }
initSidebar();
}, this);
$('[data-block="minicart"]').on('contentLoading', function () {
@@ -105,6 +101,10 @@ define([
self.isLoading(true);
});
+ if (cartData()['website_id'] !== window.checkout.websiteId) {
+ customerData.reload(['cart'], false);
+ }
+
return this._super();
},
isLoading: ko.observable(false),
diff --git a/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html b/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html
index 0dee6cb0708e6..bb68e24835b67 100644
--- a/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html
+++ b/app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html
@@ -41,7 +41,7 @@
assertEquals($this->elementMock, $this->this->prepareElementHtml($this->elementMock));
}
+ /**
+ * @return array
+ */
public function prepareElementHtmlDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Page/Widget/ChooserTest.php b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Page/Widget/ChooserTest.php
index 174e3a68b7c66..7b91d54ec3aa1 100644
--- a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Page/Widget/ChooserTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Page/Widget/ChooserTest.php
@@ -236,6 +236,9 @@ public function testPrepareElementHtml($elementValue, $cmsPageId)
$this->assertEquals($this->elementMock, $this->this->prepareElementHtml($this->elementMock));
}
+ /**
+ * @return array
+ */
public function prepareElementHtmlDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php b/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php
index 8b41f0e3ac0d4..c50f33caa6bc2 100644
--- a/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php
@@ -367,6 +367,9 @@ public function testPrepareResultPage(
);
}
+ /**
+ * @return array
+ */
public function renderPageExtendedDataProvider()
{
return [
@@ -467,6 +470,9 @@ public function testGetPageUrl(
$this->assertEquals($expectedResult, $this->object->getPageUrl($pageId));
}
+ /**
+ * @return array
+ */
public function getPageUrlDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php
index 3fba04cd5604d..ba32f41c62f24 100644
--- a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php
@@ -384,6 +384,9 @@ public function testGetCurrentPathThrowException()
$this->fail('An expected exception has not been raised.');
}
+ /**
+ * @return array
+ */
public function providerGetCurrentPath()
{
return [
@@ -431,6 +434,9 @@ public function testGetImageHtmlDeclarationRenderingAsTag($baseUrl, $fileName, $
$this->assertEquals($expectedHtml, $this->imagesHelper->getImageHtmlDeclaration($fileName, true));
}
+ /**
+ * @return array
+ */
public function providerGetImageHtmlDeclarationRenderingAsTag()
{
return [
@@ -465,6 +471,9 @@ public function testGetImageHtmlDeclaration($baseUrl, $fileName, $isUsingStaticU
$this->assertEquals($expectedHtml, $this->imagesHelper->getImageHtmlDeclaration($fileName));
}
+ /**
+ * @return array
+ */
public function providerGetImageHtmlDeclaration()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Block/CollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Block/CollectionTest.php
index b9b0d6f772c62..26b5d74ffb961 100644
--- a/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Block/CollectionTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Block/CollectionTest.php
@@ -119,6 +119,9 @@ public function testAfterLoad($item, $storesData)
$this->assertEquals($expectedResult[$item->getId()], $item->getStoreId());
}
+ /**
+ * @return array
+ */
public function getItemsDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Page/CollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Page/CollectionTest.php
index dd31650cb3a3a..6d45e7bf6ab1d 100644
--- a/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Page/CollectionTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Model/ResourceModel/Page/CollectionTest.php
@@ -119,6 +119,9 @@ public function testAfterLoad($item, $storesData)
$this->assertEquals($expectedResult[$item->getId()], $item->getStoreId());
}
+ /**
+ * @return array
+ */
public function getItemsDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/ConfigTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/ConfigTest.php
index d633c5a21fe32..7a5a6fe7b0c8c 100644
--- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/ConfigTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/ConfigTest.php
@@ -187,6 +187,9 @@ public function testGetConfig($data, $isAuthorizationAllowed, $expectedResults)
$this->assertEquals('localhost/pub/static/', $config->getData('baseStaticDefaultUrl'));
}
+ /**
+ * @return array
+ */
public function getConfigDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php b/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php
index 8c09d42ec556e..cbb13c6f254eb 100644
--- a/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php
@@ -139,6 +139,9 @@ public function testNoCookies($pageUrl)
$this->assertEquals($this->noCookiesObserver, $this->noCookiesObserver->execute($this->observerMock));
}
+ /**
+ * @return array
+ */
public function noCookiesDataProvider()
{
return [
diff --git a/app/code/Magento/Cms/Ui/Component/AddFilterInterface.php b/app/code/Magento/Cms/Ui/Component/AddFilterInterface.php
new file mode 100644
index 0000000000000..406b40fbc1647
--- /dev/null
+++ b/app/code/Magento/Cms/Ui/Component/AddFilterInterface.php
@@ -0,0 +1,26 @@
+meta = array_replace_recursive($meta, $this->prepareMetadata());
+ $this->additionalFilterPool = $additionalFilterPool;
}
/**
@@ -95,4 +105,16 @@ public function prepareMetadata()
return $metadata;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function addFilter(Filter $filter)
+ {
+ if (!empty($this->additionalFilterPool[$filter->getField()])) {
+ $this->additionalFilterPool[$filter->getField()]->addFilter($this->searchCriteriaBuilder, $filter);
+ } else {
+ parent::addFilter($filter);
+ }
+ }
}
diff --git a/app/code/Magento/Cms/Ui/Component/Page/FulltextFilter.php b/app/code/Magento/Cms/Ui/Component/Page/FulltextFilter.php
new file mode 100644
index 0000000000000..9b0c69a4f10c4
--- /dev/null
+++ b/app/code/Magento/Cms/Ui/Component/Page/FulltextFilter.php
@@ -0,0 +1,44 @@
+filterBuilder = $filterBuilder;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function addFilter(SearchCriteriaBuilder $searchCriteriaBuilder, Filter $filter)
+ {
+ $titleFilter = $this->filterBuilder->setField('title')
+ ->setValue(sprintf('%%%s%%', $filter->getValue()))
+ ->setConditionType('like')
+ ->create();
+ $searchCriteriaBuilder->addFilter($titleFilter);
+ }
+}
diff --git a/app/code/Magento/Cms/etc/di.xml b/app/code/Magento/Cms/etc/di.xml
index d262ebca1591c..16629cf0143e1 100644
--- a/app/code/Magento/Cms/etc/di.xml
+++ b/app/code/Magento/Cms/etc/di.xml
@@ -189,4 +189,12 @@
Magento\Cms\Model\Api\SearchCriteria\BlockCollectionProcessor
+
+
+
+
+ - Magento\Cms\Ui\Component\Page\FulltextFilter
+
+
+
diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/DwstreeTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/DwstreeTest.php
index d3750022d93de..1cb393b212199 100644
--- a/app/code/Magento/Config/Test/Unit/Block/System/Config/DwstreeTest.php
+++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/DwstreeTest.php
@@ -121,6 +121,9 @@ public function testInitTabs($section, $website, $store)
);
}
+ /**
+ * @return array
+ */
public function initTabsDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Field/Select/AllowspecificTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Field/Select/AllowspecificTest.php
index be3b8e2ead0c1..f5c65e848b3bf 100644
--- a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Field/Select/AllowspecificTest.php
+++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Field/Select/AllowspecificTest.php
@@ -85,6 +85,9 @@ public function testGetHtmlWhenValueIsEmpty($value)
$this->assertNotEmpty($this->_object->getHtml());
}
+ /**
+ * @return array
+ */
public function getHtmlWhenValueIsEmptyDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Fieldset/Modules/DisableOutputTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Fieldset/Modules/DisableOutputTest.php
index 9d76363213d0b..bb109bcb25f06 100644
--- a/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Fieldset/Modules/DisableOutputTest.php
+++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Fieldset/Modules/DisableOutputTest.php
@@ -224,6 +224,9 @@ public function testRender($expanded, $nested, $extra)
}
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php
index 72e8386bddaf6..83b7bd5fda42e 100644
--- a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php
+++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php
@@ -224,6 +224,9 @@ public function testInitForm($sectionIsVisible)
$this->assertEquals($this->_formMock, $object->getForm());
}
+ /**
+ * @return array
+ */
public function initFormDataProvider()
{
return [
@@ -337,6 +340,9 @@ public function testInitGroup($shouldCloneFields, $prefixes, $callNum)
$object->initForm();
}
+ /**
+ * @return array
+ */
public function initGroupDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/AddressTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/AddressTest.php
index bacbda537fb1d..e6b774db041c3 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/AddressTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/AddressTest.php
@@ -40,6 +40,9 @@ public function testBeforeSave($value, $expectedValue)
$this->assertEquals($expectedValue, $this->model->getValue());
}
+ /**
+ * @return array
+ */
public function beforeSaveDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/SenderTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/SenderTest.php
index 8e559ff8284ed..e38c247c3861a 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/SenderTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/SenderTest.php
@@ -41,6 +41,9 @@ public function testBeforeSave($value, $expectedValue)
$this->assertEquals($expectedValue, $this->model->getValue());
}
+ /**
+ * @return array
+ */
public function beforeSaveDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/SerializedTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/SerializedTest.php
index 493fdf9505c4c..bb1e0e0225901 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/SerializedTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/SerializedTest.php
@@ -52,6 +52,9 @@ public function testAfterLoad($expected, $value, $numCalls, $unserializedValue =
$this->assertEquals($expected, $this->serializedConfig->getValue());
}
+ /**
+ * @return array
+ */
public function afterLoadDataProvider()
{
return [
@@ -87,6 +90,9 @@ public function testBeforeSave($expected, $value, $numCalls, $serializedValue =
$this->assertEquals($expected, $this->serializedConfig->getValue());
}
+ /**
+ * @return array
+ */
public function beforeSaveDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php
index 51432366bb441..e602e0407feff 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php
@@ -141,6 +141,9 @@ public function testIsVisibleReturnsTrueForProperScopes($settings, $scope)
$this->assertTrue($this->_model->isVisible());
}
+ /**
+ * @return array
+ */
public function isVisibleReturnsTrueForProperScopesDataProvider()
{
return [
@@ -170,6 +173,9 @@ public function testIsVisibleReturnsFalseForNonProperScopes($settings, $scope)
$this->assertFalse($this->_model->isVisible());
}
+ /**
+ * @return array
+ */
public function isVisibleReturnsFalseForNonProperScopesDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php
index 30c567fb490e6..750a829eef7ec 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php
@@ -88,6 +88,9 @@ public function testIsNegative($data, $isNegative)
$this->assertEquals($isNegative, $this->_getFieldObject($data, $isNegative)->isNegative());
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
@@ -110,6 +113,9 @@ public function testIsValueSatisfy($data, $isNegative, $value, $expected)
$this->assertEquals($expected, $this->_getFieldObject($data, $isNegative)->isValueSatisfy($value));
}
+ /**
+ * @return array
+ */
public function isValueSatisfyDataProvider()
{
return [
@@ -135,6 +141,9 @@ public function testGetValues($data, $isNegative, $expected)
$this->assertEquals($expected, $this->_getFieldObject($data, $isNegative)->getValues());
}
+ /**
+ * @return array
+ */
public function getValuesDataProvider()
{
$complexDataValues = [self::COMPLEX_VALUE1, self::COMPLEX_VALUE2, self::COMPLEX_VALUE3];
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/MapperTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/MapperTest.php
index 2f081ea4285b9..c6cd03cf8f35b 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/MapperTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/MapperTest.php
@@ -150,6 +150,9 @@ public function testGetDependenciesWhenDependentIsInvisible($isValueSatisfy)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function getDependenciesDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/IteratorTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/IteratorTest.php
index 1a0f3d03b060c..dcb7a90e55290 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/IteratorTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/IteratorTest.php
@@ -68,6 +68,9 @@ public function testIsLast($elementId, $result)
$this->assertEquals($result, $this->_model->isLast($elementMock));
}
+ /**
+ * @return array
+ */
public function isLastDataProvider()
{
return [[1, false], [2, false], [3, true]];
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/ExtendsTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/ExtendsTest.php
index 95e8246c6a3d3..7762c8993b24b 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/ExtendsTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/ExtendsTest.php
@@ -44,6 +44,9 @@ public function testMapWithBadPath()
$this->_sut->map($sourceData);
}
+ /**
+ * @return array
+ */
public function mapDataProvider()
{
return [
@@ -55,6 +58,9 @@ public function mapDataProvider()
];
}
+ /**
+ * @return array
+ */
protected function _emptySectionsNodeData()
{
$data = ['config' => ['system' => ['sections' => 'some_non_array']]];
@@ -62,6 +68,9 @@ protected function _emptySectionsNodeData()
return [$data, $data];
}
+ /**
+ * @return array
+ */
protected function _extendFromASiblingData()
{
$source = $result = [
@@ -81,6 +90,9 @@ protected function _extendFromASiblingData()
return [$source, $result];
}
+ /**
+ * @return array
+ */
protected function _extendFromNodeOnHigherLevelData()
{
$source = $result = [
@@ -114,6 +126,9 @@ protected function _extendFromNodeOnHigherLevelData()
return [$source, $result];
}
+ /**
+ * @return array
+ */
protected function _extendWithMerge()
{
$source = $result = [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/Helper/RelativePathConverterTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/Helper/RelativePathConverterTest.php
index 058f9a380a27d..dd95574ffa62d 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/Helper/RelativePathConverterTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Mapper/Helper/RelativePathConverterTest.php
@@ -52,11 +52,17 @@ public function testConvert($nodePath, $relativePath, $result)
$this->assertEquals($result, $this->_sut->convert($nodePath, $relativePath));
}
+ /**
+ * @return array
+ */
public function convertWithInvalidArgumentsDataProvider()
{
return [['', ''], ['some/node', ''], ['', 'some/node']];
}
+ /**
+ * @return array
+ */
public function convertDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php
index e67ea6ec0fba1..6c059f4b69b70 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php
@@ -221,6 +221,9 @@ private function getElementReturnsEmptyElementIfNotExistingElementIsRequested(
return $elementMock;
}
+ /**
+ * @return array
+ */
public function emptyElementDataProvider()
{
return [
@@ -389,6 +392,9 @@ public function testGetFieldPathsByAttribute($attributeName, $attributeValue, $p
$this->assertEquals($paths, $this->_model->getFieldPathsByAttribute($attributeName, $attributeValue));
}
+ /**
+ * @return array
+ */
public function getFieldPathsByAttributeDataProvider()
{
return [
diff --git a/app/code/Magento/Config/Test/Unit/Model/Placeholder/EnvironmentTest.php b/app/code/Magento/Config/Test/Unit/Model/Placeholder/EnvironmentTest.php
index 8217ff09c0541..e4c01e794fb0f 100644
--- a/app/code/Magento/Config/Test/Unit/Model/Placeholder/EnvironmentTest.php
+++ b/app/code/Magento/Config/Test/Unit/Model/Placeholder/EnvironmentTest.php
@@ -52,6 +52,9 @@ public function testGenerate($path, $scope, $scopeId, $expected)
);
}
+ /**
+ * @return array
+ */
public function getGenerateDataProvider()
{
return [
diff --git a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Import/Product/Type/ConfigurableTest.php b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Import/Product/Type/ConfigurableTest.php
index 54552364de13b..1ff78ed89709a 100644
--- a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Import/Product/Type/ConfigurableTest.php
+++ b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Import/Product/Type/ConfigurableTest.php
@@ -392,6 +392,9 @@ protected function _getBunch()
];
}
+ /**
+ * @return array
+ */
protected function _getSuperAttributes()
{
return [
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Steps/SelectAttributesTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Steps/SelectAttributesTest.php
index 040329dbb3d87..33b87467950fd 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Steps/SelectAttributesTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Steps/SelectAttributesTest.php
@@ -114,6 +114,9 @@ public function testGetAddNewAttributeButton($isAllowed, $result)
$this->assertEquals($result, $this->selectAttributes->getAddNewAttributeButton());
}
+ /**
+ * @return array
+ */
public function attributesDataProvider()
{
return [
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php
index 090c464d49307..3565aba66427c 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php
@@ -108,6 +108,11 @@ public function testValidateException()
$this->validate(true);
}
+ /**
+ * @param $exception
+ *
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
public function validate($exception)
{
$attrTable = 'someAttributeTable';
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php
index ab3fd33322aa5..7991d8fececb4 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php
@@ -389,6 +389,9 @@ public function testValidateNewOptionData($attributeId, $label, $optionValues, $
$this->model->validateNewOptionData($optionMock);
}
+ /**
+ * @return array
+ */
public function validateOptionDataProvider()
{
return [
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php
index 3bad81126f510..114fb7168ab33 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php
@@ -59,6 +59,12 @@ private function createTarget(\PHPUnit_Framework_MockObject_MockObject $request,
);
}
+ /**
+ * @param $popup
+ * @param string $productTab
+ *
+ * @return MockObject
+ */
private function createRequestMock($popup, $productTab = 'variations')
{
$request = $this->getMockBuilder(RequestInterface::class)
@@ -107,6 +113,9 @@ public function testExecuteWithDefaultTypes(array $supportedTypes, array $origin
$this->assertEquals(null, $target->execute($event));
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
@@ -143,11 +152,23 @@ public function executeDataProvider()
];
}
+ /**
+ * @param $value
+ * @param $label
+ *
+ * @return array
+ */
private function createFrontendInputValue($value, $label)
{
return ['value' => $value, 'label' => $label];
}
+ /**
+ * @param array $originalValues
+ * @param array $expectedValues
+ *
+ * @return MockObject
+ */
private function createForm(array $originalValues = [], array $expectedValues = [])
{
$form = $this->getMockBuilder(\Magento\Framework\Data\Form::class)
diff --git a/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php b/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php
index 0213173737b9b..f01922f42f40c 100644
--- a/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php
+++ b/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php
@@ -144,6 +144,9 @@ public function testExecutePostValidation($postData, $exceptionExpected)
$this->controller->execute();
}
+ /**
+ * @return array
+ */
public function postDataProvider()
{
return [
diff --git a/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php b/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php
index a238daafaafaf..cabcebda061f9 100644
--- a/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php
+++ b/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php
@@ -8,6 +8,9 @@
class IndexStub extends \Magento\Contact\Controller\Index
{
+ /**
+ * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
+ */
public function execute()
{
// Empty method stub for test
diff --git a/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php b/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php
index 5694f3f3cab56..62ce6baf6c101 100644
--- a/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php
+++ b/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php
@@ -79,6 +79,9 @@ public function testGetCookieRestrictionLifetime()
$this->assertEquals($this->_object->getCookieRestrictionLifetime(), 60 * 60 * 24 * 365);
}
+ /**
+ * @return $this
+ */
protected function _initMock()
{
$scopeConfig = $this->_getConfigStub();
diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php
index 453a06651f354..0ae099fd78edc 100644
--- a/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php
+++ b/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php
@@ -236,6 +236,9 @@ public function testGetCurrencySymbol(
$this->assertEquals($expectedSymbol, $currencySymbol);
}
+ /**
+ * @return array
+ */
public function getCurrencySymbolDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php
index eb541850a1bc1..4b7926c54f0ab 100644
--- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php
+++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php
@@ -13,6 +13,8 @@
use Magento\Customer\Api\Data\RegionInterfaceFactory;
use Magento\Customer\Model\Data\Address as AddressData;
use Magento\Framework\Model\AbstractExtensibleModel;
+use Magento\Framework\App\ObjectManager;
+use Magento\Store\Model\ScopeInterface;
/**
* Address abstract model
@@ -119,6 +121,16 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt
*/
protected $dataObjectHelper;
+ /**
+ * @var \Magento\Directory\Model\AllowedCountries
+ */
+ private $allowedCountriesReader;
+
+ /**
+ * @var \Magento\Customer\Model\Config\Share
+ */
+ private $shareConfig;
+
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
@@ -154,7 +166,9 @@ public function __construct(
\Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
- array $data = []
+ array $data = [],
+ \Magento\Directory\Model\AllowedCountries $allowedCountriesReader = null,
+ \Magento\Customer\Model\Config\Share $shareConfig = null
) {
$this->_directoryData = $directoryData;
$data = $this->_implodeArrayField($data);
@@ -166,6 +180,10 @@ public function __construct(
$this->addressDataFactory = $addressDataFactory;
$this->regionDataFactory = $regionDataFactory;
$this->dataObjectHelper = $dataObjectHelper;
+ $this->allowedCountriesReader = $allowedCountriesReader
+ ?: ObjectManager::getInstance()->get(\Magento\Directory\Model\AllowedCountries::class);
+ $this->shareConfig = $shareConfig
+ ?: ObjectManager::getInstance()->get(\Magento\Customer\Model\Config\Share::class);
parent::__construct(
$context,
$registry,
@@ -623,7 +641,7 @@ public function validate()
$errors[] = __('%fieldName is a required field.', ['fieldName' => 'countryId']);
} else {
//Checking if such country exists.
- if (!in_array($countryId, $this->_directoryData->getCountryCollection()->getAllIds(), true)) {
+ if (!in_array($countryId, $this->getWebsiteAllowedCountries(), true)) {
$errors[] = __(
'Invalid value of "%value" provided for the %fieldName field.',
[
@@ -667,6 +685,22 @@ public function validate()
return $errors;
}
+ /**
+ * Return allowed counties per website.
+ *
+ * @return array
+ */
+ private function getWebsiteAllowedCountries(): array
+ {
+ $websiteId = null;
+
+ if (!$this->shareConfig->isGlobalScope()) {
+ $websiteId = $this->getCustomer() ? $this->getCustomer()->getWebsiteId() : null;
+ }
+
+ return $this->allowedCountriesReader->getAllowedCountries(ScopeInterface::SCOPE_WEBSITE, $websiteId);
+ }
+
/**
* @return \Magento\Directory\Model\Region
*/
diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php
index b43b1d1aa39a9..618173e886e66 100644
--- a/app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php
@@ -128,6 +128,9 @@ public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUr
$this->assertEquals($result, $this->model->getConfig());
}
+ /**
+ * @return array
+ */
public function dataProviderGetConfig()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/CustomerTest.php
index 6489fea91e43e..793975c0b3191 100644
--- a/app/code/Magento/Customer/Test/Unit/Block/Account/CustomerTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Block/Account/CustomerTest.php
@@ -22,6 +22,9 @@ protected function setUp()
->getObject(\Magento\Customer\Block\Account\Customer::class, ['httpContext' => $this->httpContext]);
}
+ /**
+ * @return array
+ */
public function customerLoggedInDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php
index 02d31d69e73df..ec84f53b7584e 100644
--- a/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php
@@ -204,6 +204,9 @@ public function testIsNewsletterEnabled($isNewsletterEnabled, $expectedValue)
$this->assertEquals($expectedValue, $this->_block->isNewsletterEnabled());
}
+ /**
+ * @return array
+ */
public function isNewsletterEnabledProvider()
{
return [[true, true], [false, false]];
diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/Grid/Renderer/ItemTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/Grid/Renderer/ItemTest.php
index c12da66cdc616..92c2bcfeb8e59 100644
--- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/Grid/Renderer/ItemTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/Grid/Renderer/ItemTest.php
@@ -14,6 +14,10 @@ class ItemTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Item */
protected $itemBlock;
+ /**
+ * @param $amountOption
+ * @param bool $withoutOptions
+ */
public function configure($amountOption, $withoutOptions = false)
{
$options = [];
@@ -95,6 +99,9 @@ public function testRender($amountOption, $expectedHtml)
$this->assertXmlStringEqualsXmlString($expectedHtml, $realHtml);
}
+ /**
+ * @return array
+ */
public function optionHtmlProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php
index 3f174484df3e1..70ce9a234560f 100644
--- a/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php
@@ -159,6 +159,9 @@ public function testMethodWithNoSuchEntityException($method)
$this->assertFalse($this->_block->{$method}());
}
+ /**
+ * @return array
+ */
public function methodDataProvider()
{
return [
@@ -453,7 +456,7 @@ private function _setUpIsAttributeRequired()
*/
$this->_block->setForceUseCustomerAttributes(false);
$this->_block->setForceUseCustomerRequiredAttributes(true);
- $this->_block->setObject(new \StdClass());
+ $this->_block->setObject(new \stdClass());
/**
* The first call to isRequired() is false so that the second if conditional in the other code path
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php
index 759d5f661c509..d9bf6a435ac15 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php
@@ -529,6 +529,9 @@ public function testSuccessRedirect(
$this->model->execute();
}
+ /**
+ * @return array
+ */
public function getSuccessRedirectDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
index 2b5438991b113..4ad1b5cbc96bd 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
@@ -578,6 +578,9 @@ public function testExecute(
$this->assertEquals($this->resultRedirect, $this->model->execute());
}
+ /**
+ * @return array
+ */
public function dataProviderTestExecute()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php
index 22c5003544bed..913c41070856e 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php
@@ -164,6 +164,9 @@ protected function setUp()
];
}
+ /**
+ * @param int $populateSequence
+ */
protected function prepareMocksForTesting($populateSequence = 0)
{
$this->resultJsonFactory->expects($this->once())
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Section/LoadTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Section/LoadTest.php
index 2552beeca463d..8fc4df1515b94 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Section/LoadTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Section/LoadTest.php
@@ -123,6 +123,9 @@ public function testExecute($sectionNames, $updateSectionID, $sectionNamesAsArra
$this->loadAction->execute();
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/Plugin/SessionCheckerTest.php b/app/code/Magento/Customer/Test/Unit/CustomerData/Plugin/SessionCheckerTest.php
index a4246b6398fd1..5beea22bda3d7 100644
--- a/app/code/Magento/Customer/Test/Unit/CustomerData/Plugin/SessionCheckerTest.php
+++ b/app/code/Magento/Customer/Test/Unit/CustomerData/Plugin/SessionCheckerTest.php
@@ -86,6 +86,9 @@ public function testBeforeStart($result, $callCount)
$this->plugin->beforeStart($this->sessionManager);
}
+ /**
+ * @return array
+ */
public function beforeStartDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php
index 50785247d7965..b2aa3161b36bf 100644
--- a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php
@@ -78,6 +78,9 @@ public function testGetStreetLines($numLines, $expectedNumLines)
$this->assertEquals($expectedNumLines, $this->helper->getStreetLines());
}
+ /**
+ * @return array
+ */
public function providerGetStreetLines()
{
return [
@@ -190,6 +193,9 @@ public function testConvertStreetLines($origStreets, $toCount, $result)
$this->assertEquals($result, $this->helper->convertStreetLines($origStreets, $toCount));
}
+ /**
+ * @return array
+ */
public function getConvertStreetLinesDataProvider()
{
return [
@@ -330,6 +336,9 @@ public function testGetFormatTypeRenderer($code, $result)
$this->assertEquals($result, $this->helper->getFormatTypeRenderer($code));
}
+ /**
+ * @return array
+ */
public function getFormatTypeRendererDataProvider()
{
$renderer = $this->getMockBuilder(\Magento\Customer\Block\Address\Renderer\RendererInterface::class)
@@ -366,6 +375,9 @@ public function testGetFormat($code, $result)
$this->assertEquals($result, $this->helper->getFormat($code));
}
+ /**
+ * @return array
+ */
public function getFormatDataProvider()
{
return [
@@ -396,6 +408,9 @@ public function testIsAttributeVisible($attributeCode, $isMetadataExists)
$this->assertEquals($isMetadataExists, $this->helper->isAttributeVisible($attributeCode));
}
+ /**
+ * @return array
+ */
public function isAttributeVisibleDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php
index 453ec208e8846..178cfac467cd2 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Address/AbstractAddressTest.php
@@ -6,6 +6,8 @@
namespace Magento\Customer\Test\Unit\Model\Address;
+use Magento\Store\Model\ScopeInterface;
+
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
@@ -38,6 +40,16 @@ class AbstractAddressTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\Data\Collection\AbstractDb|\PHPUnit_Framework_MockObject_MockObject */
protected $resourceCollectionMock;
+ /**
+ * @var \Magento\Directory\Model\AllowedCountries|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $allowedCountriesReaderMock;
+
+ /**
+ * @var \Magento\Customer\Model\Config\Share|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $shareConfigMock;
+
/** @var \Magento\Customer\Model\Address\AbstractAddress */
protected $model;
@@ -72,6 +84,15 @@ protected function setUp()
$this->resourceCollectionMock = $this->getMockBuilder(\Magento\Framework\Data\Collection\AbstractDb::class)
->disableOriginalConstructor()
->getMockForAbstractClass();
+ $this->allowedCountriesReaderMock = $this->createPartialMock(
+ \Magento\Directory\Model\AllowedCountries::class,
+ ['getAllowedCountries']
+ );
+ $this->shareConfigMock = $this->createPartialMock(
+ \Magento\Customer\Model\Config\Share::class,
+ ['isGlobalScope']
+ );
+
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->model = $this->objectManager->getObject(
\Magento\Customer\Model\Address\AbstractAddress::class,
@@ -84,7 +105,9 @@ protected function setUp()
'regionFactory' => $this->regionFactoryMock,
'countryFactory' => $this->countryFactoryMock,
'resource' => $this->resourceMock,
- 'resourceCollection' => $this->resourceCollectionMock
+ 'resourceCollection' => $this->resourceCollectionMock,
+ 'allowedCountriesReader' => $this->allowedCountriesReaderMock,
+ 'shareConfig' => $this->shareConfigMock,
]
);
}
@@ -302,16 +325,11 @@ public function testValidate(array $data, $expected)
$this->directoryDataMock->expects($this->any())
->method('isRegionRequired');
- $countryCollectionMock = $this->getMockBuilder(\Magento\Directory\Model\ResourceModel\Country\Collection::class)
- ->disableOriginalConstructor()
- ->setMethods(['getAllIds'])
- ->getMock();
-
- $this->directoryDataMock->expects($this->any())
- ->method('getCountryCollection')
- ->willReturn($countryCollectionMock);
-
- $countryCollectionMock->expects($this->any())->method('getAllIds')->willReturn([$countryId]);
+ $this->shareConfigMock->method('isGlobalScope')->willReturn(false);
+ $this->allowedCountriesReaderMock
+ ->method('getAllowedCountries')
+ ->with(ScopeInterface::SCOPE_WEBSITE, null)
+ ->willReturn([$countryId]);
$regionModelMock = $this->getMockBuilder(\Magento\Directory\Model\Region::class)
->disableOriginalConstructor()
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php
index 1b013a913b9f8..c64f7aca96fe6 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/XsdTest.php
@@ -39,6 +39,9 @@ public function testExemplarXml($fixtureXml, array $expectedErrors)
$this->assertEquals($expectedErrors, $actualErrors);
}
+ /**
+ * @return array
+ */
public function exemplarXmlDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/AttributeCheckerTest.php b/app/code/Magento/Customer/Test/Unit/Model/AttributeCheckerTest.php
index 480f5be96e318..8454b793cf5ff 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/AttributeCheckerTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/AttributeCheckerTest.php
@@ -75,6 +75,9 @@ public function testIsAttributeAllowedOnForm(
$this->assertEquals($isAllowed, $this->model->isAttributeAllowedOnForm($attributeCode, $formName));
}
+ /**
+ * @return array
+ */
public function attributeOnFormDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php b/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php
index ee788913373e5..14adc7bcf8795 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php
@@ -196,6 +196,9 @@ public function testProcessAuthenticationFailureFirstAttempt(
$this->authentication->processAuthenticationFailure($customerId);
}
+ /**
+ * @return array
+ */
public function processAuthenticationFailureDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php
index 9a9449a64ecbd..368e7cfd47f2f 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php
@@ -39,6 +39,9 @@ public function testValidatePositive()
$this->assertTrue($this->testable->validate($object));
}
+ /**
+ * @return array
+ */
public function passwordNegativeDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php
index 029949c5f35b0..50c21379054bf 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php
@@ -493,6 +493,9 @@ private function attributeGetUsingMethodCallback()
};
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getCountryAttrMock()
{
$countryByWebsiteMock = $this->getMockBuilder(CountryWithWebsites::class)
@@ -1266,7 +1269,7 @@ public function testGetDataWithVisibleAttributesWithAccountEdit()
$helper = new ObjectManager($this);
$context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class)
->setMethods(['getRequestParam'])
- ->getMockforAbstractClass();
+ ->getMockForAbstractClass();
$context->expects($this->any())
->method('getRequestParam')
->with('request-field-name')
diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php
index f2db8c6cab6be..dc7cfbef3fa03 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php
@@ -71,6 +71,12 @@ protected function setUp()
->getMock();
}
+ /**
+ * @param $entityTypeCode
+ * @param array $allowedExtensions
+ *
+ * @return FileProcessor
+ */
private function getModel($entityTypeCode, array $allowedExtensions = [])
{
$model = new FileProcessor(
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/AbstractDataTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/AbstractDataTest.php
index b9f8564d3616a..e4dc22ba40e31 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/AbstractDataTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/AbstractDataTest.php
@@ -94,6 +94,9 @@ public function testSetRequestScopeOnly($bool)
$this->assertSame($bool, $this->_model->isRequestScopeOnly());
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
@@ -122,6 +125,9 @@ public function testApplyInputFilter($input, $output, $filter)
$this->assertEquals($output, $this->_model->applyInputFilter($input));
}
+ /**
+ * @return array
+ */
public function applyInputFilterProvider()
{
return [
@@ -160,6 +166,9 @@ public function testDateFilterFormat($format, $output)
$this->assertEquals($output, $actual);
}
+ /**
+ * @return array
+ */
public function dateFilterFormatProvider()
{
return [[null, 'Whatever I put'], [false, self::MODEL], ['something else', self::MODEL]];
@@ -231,6 +240,9 @@ public function testValidateInputRule($value, $label, $inputValidation, $expecte
$this->assertEquals($expectedOutput, $this->_model->validateInputRule($value));
}
+ /**
+ * @return array
+ */
public function validateInputRuleDataProvider()
{
return [
@@ -319,6 +331,9 @@ public function testGetRequestValue($request, $attributeCode, $requestScope, $re
$this->assertEquals($expectedValue, $this->_model->getRequestValue($request));
}
+ /**
+ * @return array
+ */
public function getRequestValueDataProvider()
{
$expectedValue = 'EXPECTED_VALUE';
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/BooleanTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/BooleanTest.php
index 4315340d65bff..d9f101b922cc8 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/BooleanTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/BooleanTest.php
@@ -28,6 +28,9 @@ public function testGetOptionText($value, $expected)
$this->assertSame($expected, (string)$boolean->outputValue());
}
+ /**
+ * @return array
+ */
public function getOptionTextDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php
index 2c09555374aef..6329970e0ca9c 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php
@@ -112,6 +112,9 @@ public function testValidateValue($value, $validation, $required, $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function validateValueDataProvider()
{
return [
@@ -163,6 +166,9 @@ public function testCompactValue($value, $expected)
$this->assertSame($expected, $this->date->compactValue($value));
}
+ /**
+ * @return array
+ */
public function compactAndRestoreValueDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php
index 97452b995ba0b..1cffaa6fe0379 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php
@@ -118,6 +118,9 @@ public function testExtractValueNoRequestScope($expected, $attributeCode = '', $
}
}
+ /**
+ * @return array
+ */
public function extractValueNoRequestScopeDataProvider()
{
return [
@@ -178,6 +181,9 @@ public function testExtractValueWithRequestScope($expected, $requestScope, $main
}
}
+ /**
+ * @return array
+ */
public function extractValueWithRequestScopeDataProvider()
{
return [
@@ -228,6 +234,9 @@ public function testValidateValueNotToUpload($expected, $value, $isAjax = false,
$this->assertEquals($expected, $model->validateValue($value));
}
+ /**
+ * @return array
+ */
public function validateValueNotToUploadDataProvider()
{
return [
@@ -285,6 +294,9 @@ public function testValidateValueToUpload($expected, $value, $parameters = [])
$this->assertEquals($expected, $model->validateValue($value));
}
+ /**
+ * @return array
+ */
public function validateValueToUploadDataProvider()
{
return [
@@ -429,6 +441,9 @@ public function testOutputValueNonJson($format)
$this->assertSame('', $model->outputValue($format));
}
+ /**
+ * @return array
+ */
public function outputValueDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php
index 25f10d7bb93c6..e74ddebdb597b 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/MultilineTest.php
@@ -42,6 +42,9 @@ public function testValidateValueRequired($value, $expected)
parent::testValidateValueRequired($value, $expected);
}
+ /**
+ * @return array
+ */
public function validateValueRequiredDataProvider()
{
return array_merge(
@@ -66,6 +69,9 @@ public function testValidateValueLength($value, $expected)
parent::testValidateValueLength($value, $expected);
}
+ /**
+ * @return array
+ */
public function validateValueLengthDataProvider()
{
return array_merge(
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/SelectTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/SelectTest.php
index c8564df6b086f..5861ef1f93784 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/SelectTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/SelectTest.php
@@ -42,6 +42,9 @@ public function testValidateValue($value, $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function validateValueDataProvider()
{
return [
@@ -74,6 +77,9 @@ public function testValidateValueRequired($value, $expected)
}
}
+ /**
+ * @return array
+ */
public function validateValueRequiredDataProvider()
{
return [
@@ -145,6 +151,9 @@ public function testOutputValue($value, $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function outputValueDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/TextTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/TextTest.php
index 9a3e1c1d8a7cb..b95987cba1dcf 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/TextTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/TextTest.php
@@ -52,6 +52,9 @@ public function testValidateValue($value, $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function validateValueDataProvider()
{
return [
@@ -84,6 +87,9 @@ public function testValidateValueRequired($value, $expected)
}
}
+ /**
+ * @return array
+ */
public function validateValueRequiredDataProvider()
{
return [
@@ -150,6 +156,9 @@ public function testValidateValueLength($value, $expected)
}
}
+ /**
+ * @return array
+ */
public function validateValueLengthDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php
index bef2db9bf2694..354932b0ede0b 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php
@@ -79,6 +79,9 @@ public function testIsValid($isValid)
$this->assertEquals($isValid, $this->validator->isValid(new \Magento\Framework\DataObject($data)));
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php b/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php
index 759c823eec7f9..c655ff7056ed6 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php
@@ -90,6 +90,9 @@ public function testRender($regionCollection)
$this->assertContains('required-entry', $html);
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php
index 723ce6fa1826a..466d44c58ca3f 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php
@@ -227,6 +227,9 @@ protected function prepareValidatorFactory()
return $validatorFactory;
}
+ /**
+ * @return \Magento\Customer\Model\CustomerFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
protected function prepareCustomerFactory()
{
$this->customerFactory = $this->createPartialMock(\Magento\Customer\Model\CustomerFactory::class, ['create']);
@@ -248,16 +251,27 @@ class SubResourceModelAddress extends \Magento\Customer\Model\ResourceModel\Addr
{
protected $attributeLoader;
+ /**
+ * @param null $object
+ *
+ * @return \Magento\Customer\Model\ResourceModel\Address|\Magento\Eav\Model\Entity\AbstractEntity
+ */
public function loadAllAttributes($object = null)
{
return $this->getAttributeLoader()->loadAllAttributes($this, $object);
}
+ /**
+ * @param $attributeLoader
+ */
public function setAttributeLoader($attributeLoader)
{
$this->attributeLoader = $attributeLoader;
}
+ /**
+ * @return \Magento\Eav\Model\Entity\AttributeLoaderInterface
+ */
protected function getAttributeLoader()
{
return $this->attributeLoader;
diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php
index 61081e1aaf224..76651f9f07589 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php
@@ -227,6 +227,9 @@ public function testAddFieldToFilterInconsistentArrays($fields, $conditions)
$this->serviceCollection->addFieldToFilter($fields, $conditions);
}
+ /**
+ * @return array
+ */
public function addFieldToFilterInconsistentArraysDataProvider()
{
return [
diff --git a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php
index 939e2856f5eaa..8592d1bda66c1 100644
--- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php
@@ -411,6 +411,9 @@ public function testAfterAddressSaveDefaultGroup(
$this->model->execute($observer);
}
+ /**
+ * @return array
+ */
public function dataProviderAfterAddressSaveDefaultGroup()
{
return [
@@ -600,6 +603,9 @@ public function testAfterAddressSaveNewGroup(
$this->model->execute($observer);
}
+ /**
+ * @return array
+ */
public function dataProviderAfterAddressSaveNewGroup()
{
return [
diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
index 15df80f360bf7..c4672c48e1f4a 100644
--- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
+++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
@@ -232,11 +232,9 @@ define([
if (!_.isEmpty(privateContent)) {
countryData = this.get('directory-data');
- countryData.subscribe(function () {
- if (_.isEmpty(countryData())) {
- customerData.reload(['directory-data'], false);
- }
- }, this);
+ if (_.isEmpty(countryData())) {
+ customerData.reload(['directory-data'], false);
+ }
}
},
diff --git a/app/code/Magento/Deploy/Test/Unit/Console/Command/App/ConfigStatusCommandTest.php b/app/code/Magento/Deploy/Test/Unit/Console/Command/App/ConfigStatusCommandTest.php
index 7822e75930eba..737ad55d5e09b 100644
--- a/app/code/Magento/Deploy/Test/Unit/Console/Command/App/ConfigStatusCommandTest.php
+++ b/app/code/Magento/Deploy/Test/Unit/Console/Command/App/ConfigStatusCommandTest.php
@@ -57,6 +57,9 @@ public function testExecute(bool $hasChanges, $expectedMessage, $expectedCode)
$this->assertSame($expectedCode, $tester->getStatusCode());
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/Deploy/Test/Unit/Service/DeployStaticContentTest.php b/app/code/Magento/Deploy/Test/Unit/Service/DeployStaticContentTest.php
index 3fe1c9800a730..75edc8cb4f6ee 100644
--- a/app/code/Magento/Deploy/Test/Unit/Service/DeployStaticContentTest.php
+++ b/app/code/Magento/Deploy/Test/Unit/Service/DeployStaticContentTest.php
@@ -187,6 +187,9 @@ public function testDeploy($options, $expectedContentVersion)
$this->assertEquals(null, $this->service->deploy($options));
}
+ /**
+ * @return array
+ */
public function deployDataProvider()
{
return [
diff --git a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php
index 94d7cd250adda..9b964566f6093 100644
--- a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php
@@ -68,6 +68,9 @@ public function testIsDevAllowed($allowedIps, $expected, $callNum = 1)
$this->assertEquals($expected, $this->helper->isDevAllowed($storeId));
}
+ /**
+ * @return array
+ */
public function isDevAllowedDataProvider()
{
return [
diff --git a/app/code/Magento/Developer/Test/Unit/Model/TemplateEngine/Decorator/DebugHintsTest.php b/app/code/Magento/Developer/Test/Unit/Model/TemplateEngine/Decorator/DebugHintsTest.php
index d23fc89acc1b3..fd2475320261a 100644
--- a/app/code/Magento/Developer/Test/Unit/Model/TemplateEngine/Decorator/DebugHintsTest.php
+++ b/app/code/Magento/Developer/Test/Unit/Model/TemplateEngine/Decorator/DebugHintsTest.php
@@ -33,6 +33,9 @@ public function testRender($showBlockHints)
$this->assertNotNull($actualResult);
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return ['block hints disabled' => [false], 'block hints enabled' => [true]];
diff --git a/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/ConfigTest.php b/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/ConfigTest.php
index 76b23e4e79ec2..7ec34f609a29f 100644
--- a/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/ConfigTest.php
+++ b/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/ConfigTest.php
@@ -34,6 +34,9 @@ public function testConstructorException(array $configData, $expectedException)
new \Magento\Directory\Model\Currency\Import\Config($configData);
}
+ /**
+ * @return array
+ */
public function constructorExceptionDataProvider()
{
return [
@@ -79,6 +82,9 @@ public function testGetServiceClass($serviceName, $expectedResult)
$this->assertEquals($expectedResult, $this->_model->getServiceClass($serviceName));
}
+ /**
+ * @return array
+ */
public function getServiceClassDataProvider()
{
return ['known' => ['service_one', 'Service_One'], 'unknown' => ['unknown', null]];
@@ -94,6 +100,9 @@ public function testGetServiceLabel($serviceName, $expectedResult)
$this->assertEquals($expectedResult, $this->_model->getServiceLabel($serviceName));
}
+ /**
+ * @return array
+ */
public function getServiceLabelDataProvider()
{
return ['known' => ['service_one', 'Service One'], 'unknown' => ['unknown', null]];
diff --git a/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php
index 915c11fe1b787..67dbe573b32d5 100644
--- a/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php
+++ b/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php
@@ -183,6 +183,9 @@ public function testGetCurrencySymbol()
$this->assertEquals($currencySymbol, $this->priceCurrency->getCurrencySymbol($storeId, $currencyMock));
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getCurrentCurrencyMock()
{
$currency = $this->getMockBuilder(\Magento\Directory\Model\Currency::class)
@@ -192,6 +195,11 @@ protected function getCurrentCurrencyMock()
return $currency;
}
+ /**
+ * @param $baseCurrency
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getStoreMock($baseCurrency)
{
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
@@ -205,6 +213,13 @@ protected function getStoreMock($baseCurrency)
return $store;
}
+ /**
+ * @param $amount
+ * @param $convertedAmount
+ * @param $currency
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getBaseCurrencyMock($amount, $convertedAmount, $currency)
{
$baseCurrency = $this->getMockBuilder(\Magento\Directory\Model\Currency::class)
diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml
index 59de895927dbe..e45fccd9c3f36 100644
--- a/app/code/Magento/Directory/etc/zip_codes.xml
+++ b/app/code/Magento/Directory/etc/zip_codes.xml
@@ -196,7 +196,7 @@
- ^[0-9]{5}$
+ ^[0-9]{7}$
diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php
index 13f474e5f0bf8..be0ebeabee62c 100644
--- a/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php
+++ b/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php
@@ -156,6 +156,12 @@ public function testGetJsonConfig()
$this->assertEquals(json_encode($config), $encodedJsonConfig);
}
+ /**
+ * @param $linkPrice
+ * @param $linkId
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getLinkMock($linkPrice, $linkId)
{
$linkMock = $this->createPartialMock(\Magento\Downloadable\Model\Link::class, ['getPrice',
diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php
index 3b3683c6af3e7..25a5d86b0385c 100644
--- a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php
+++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php
@@ -99,6 +99,9 @@ public function testAfterInitializeWithNoDataToSave($downloadable)
$this->downloadablePlugin->afterInitialize($this->subjectMock, $this->productMock);
}
+ /**
+ * @return array
+ */
public function afterInitializeWithEmptyDataDataProvider()
{
return [
diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php
index 3142900613296..7749c5980c864 100644
--- a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php
+++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php
@@ -155,6 +155,9 @@ public function testGetContentTypeThroughHelper($functionExistsResult, $mimeCont
$this->assertEquals(self::MIME_TYPE, $this->_helper->getContentType());
}
+ /**
+ * @return array
+ */
public function dataProviderForTestGetContentTypeThroughHelper()
{
return [[false, ''], [true, false]];
@@ -187,6 +190,11 @@ public function testGetFileNameUrlWithContentDisposition()
$this->assertEquals($fileName, $this->_helper->getFilename());
}
+ /**
+ * @param bool $doesExist
+ * @param int $size
+ * @param string $path
+ */
protected function _setupFileMocks($doesExist = true, $size = self::FILE_SIZE, $path = self::FILE_PATH)
{
$this->_handleMock->expects($this->any())->method('stat')->will($this->returnValue(['size' => $size]));
@@ -199,6 +207,11 @@ protected function _setupFileMocks($doesExist = true, $size = self::FILE_SIZE, $
$this->_helper->setResource($path, DownloadHelper::LINK_TYPE_FILE);
}
+ /**
+ * @param int $size
+ * @param string $url
+ * @param array $additionalStatData
+ */
protected function _setupUrlMocks($size = self::FILE_SIZE, $url = self::URL, $additionalStatData = [])
{
$this->_handleMock->expects(
diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php
index d835f25523353..9ce917433ff1f 100644
--- a/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php
+++ b/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php
@@ -539,6 +539,10 @@ public function testGetList()
$this->assertEquals([$linkInterfaceMock], $this->service->getList($productSku));
}
+ /**
+ * @param $resource
+ * @param $inputData
+ */
protected function setLinkAssertions($resource, $inputData)
{
$resource->expects($this->any())->method('getId')->will($this->returnValue($inputData['id']));
diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php
index 5a138d83d2673..e63ce2437035b 100644
--- a/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php
+++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php
@@ -104,6 +104,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function setLinkStatusPendingDataProvider()
{
return [
diff --git a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php
index 467e1f428206b..e634f0ffa341d 100644
--- a/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php
+++ b/app/code/Magento/Downloadable/Test/Unit/_files/download_mock.php
@@ -7,11 +7,17 @@
use Magento\Downloadable\Test\Unit\Helper\DownloadTest;
+/**
+ * @return bool
+ */
function function_exists()
{
return DownloadTest::$functionExists;
}
+/**
+ * @return string
+ */
function mime_content_type()
{
return DownloadTest::$mimeContentType;
diff --git a/app/code/Magento/Eav/Model/AttributeRepository.php b/app/code/Magento/Eav/Model/AttributeRepository.php
index 3f20558d03d78..5ea3ec485f4d9 100644
--- a/app/code/Magento/Eav/Model/AttributeRepository.php
+++ b/app/code/Magento/Eav/Model/AttributeRepository.php
@@ -141,7 +141,16 @@ public function getList($entityTypeCode, \Magento\Framework\Api\SearchCriteriaIn
$searchResults = $this->searchResultsFactory->create();
$searchResults->setSearchCriteria($searchCriteria);
$searchResults->setItems($attributes);
- $searchResults->setTotalCount($attributeCollection->getSize());
+
+ // if $searchCriteria has no page size - we can use count() on $attributeCollection
+ // otherwise - we have to use getSize() on $attributeCollection
+ // with this approach we can eliminate excessive COUNT requests in case page size is empty
+ if ($searchCriteria->getPageSize()) {
+ $searchResults->setTotalCount($attributeCollection->getSize());
+ } else {
+ $searchResults->setTotalCount(count($attributeCollection));
+ }
+
return $searchResults;
}
diff --git a/app/code/Magento/Eav/Model/ResourceModel/Helper.php b/app/code/Magento/Eav/Model/ResourceModel/Helper.php
index 65e2fb250cecd..fc8a47994a6aa 100644
--- a/app/code/Magento/Eav/Model/ResourceModel/Helper.php
+++ b/app/code/Magento/Eav/Model/ResourceModel/Helper.php
@@ -46,6 +46,19 @@ public function __construct(\Magento\Framework\App\ResourceConnection $resource,
\Magento\Framework\DB\Ddl\Table::TYPE_VARBINARY => 'blob',
];
+ /**
+ * Attribute types that can be united via UNION into one query
+ * while selecting attribute`s data from tables like `catalog_product_entity_datatype`
+ *
+ * This helps to run one query with all data types instead of one per each data type
+ *
+ * This data types are determined as 'groupable' because their tables have the same structure
+ * which means that they can be used in one UNION query
+ *
+ * @var array
+ */
+ private $_groupableTypes = ['varchar', 'text', 'decimal', 'datetime', 'int'];
+
/**
* Returns DDL type by column type in database
*
@@ -72,15 +85,41 @@ public function getDdlTypeByColumnType($columnType)
/**
* Groups selects to separate unions depend on type
*
+ * E.g. for input array:
+ * [
+ * varchar => [select1, select2],
+ * text => [select3],
+ * int => [select4],
+ * bool => [select5]
+ * ]
+ *
+ * The result array will be:
+ * [
+ * 0 => [select1, select2, select3, select4] // contains queries for varchar & text & int
+ * 1 => [select5] // contains queries for bool
+ * ]
+ *
* @param array $selects
* @return array
*/
public function getLoadAttributesSelectGroups($selects)
{
$mainGroup = [];
- foreach ($selects as $selectGroup) {
- $mainGroup = array_merge($mainGroup, $selectGroup);
+
+ foreach ($selects as $dataType => $selectGroup) {
+ if (in_array($dataType, $this->_groupableTypes)) {
+ $mainGroup['all'][] = $selectGroup;
+ continue;
+ }
+
+ $mainGroup[$dataType] = $selectGroup;
}
- return $mainGroup;
+
+ if (array_key_exists('all', $mainGroup)) {
+ // it is better to call array_merge once after loop instead of calling it on each loop
+ $mainGroup['all'] = array_merge(...$mainGroup['all']);
+ }
+
+ return array_values($mainGroup);
}
}
diff --git a/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php b/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php
index 572e7192d810e..3699851f6b0e6 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php
@@ -50,6 +50,12 @@ public function testCreateAttribute()
$this->assertEquals($this->_className, $this->_factory->createAttribute($this->_className, $this->_arguments));
}
+ /**
+ * @param $className
+ * @param $arguments
+ *
+ * @return mixed
+ */
public function getModelInstance($className, $arguments)
{
$this->assertInternalType('array', $arguments);
diff --git a/app/code/Magento/Eav/Test/Unit/Model/AttributeRepositoryTest.php b/app/code/Magento/Eav/Test/Unit/Model/AttributeRepositoryTest.php
index c225941c9eb35..5db0fc3ff5426 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/AttributeRepositoryTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/AttributeRepositoryTest.php
@@ -124,8 +124,13 @@ public function testGetList()
$collectionSize = 1;
$searchCriteriaMock = $this->getMockBuilder(SearchCriteriaInterface::class)
+ ->setMethods(['getPageSize'])
->getMockForAbstractClass();
+ $searchCriteriaMock->expects($this->any())
+ ->method('getPageSize')
+ ->willReturn($collectionSize);
+
$attributeMock = $this->createAttributeMock($attributeCode, $attributeId);
$attributeCollectionMock = $this->getMockBuilder(Collection::class)
diff --git a/app/code/Magento/Eav/Test/Unit/Model/CustomAttributesMapperTest.php b/app/code/Magento/Eav/Test/Unit/Model/CustomAttributesMapperTest.php
index d2067bccef0bb..67cb65c21443e 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/CustomAttributesMapperTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/CustomAttributesMapperTest.php
@@ -198,6 +198,9 @@ public function testDatabaseToEntity()
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
private function getAttributes()
{
/* Attribute with the code we want to copy */
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php
index 67899dc3902eb..1203e2cecb477 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php
@@ -61,6 +61,9 @@ public function testCompareAttributes($attribute1Sort, $attribute2Sort, $expecte
$this->assertEquals($expected, $this->_model->attributesCompare($attribute1, $attribute2));
}
+ /**
+ * @return array
+ */
public static function compareAttributesDataProvider()
{
return [
@@ -313,6 +316,9 @@ function ($entityType, $attributeCode) use ($attributes) {
$model->save($object);
}
+ /**
+ * @return array
+ */
public function productAttributesDataProvider()
{
$attributeSetId = 10;
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Backend/ArrayBackendTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Backend/ArrayBackendTest.php
index 3c0e304dbf628..475ffea98e90e 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Backend/ArrayBackendTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Backend/ArrayBackendTest.php
@@ -40,6 +40,9 @@ public function testValidate($data)
$this->assertEquals(null, $product->getEmpty());
}
+ /**
+ * @return array
+ */
public static function attributeValueDataProvider()
{
return [[[1, 2, 3]], ['1,2,3']];
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php
index 31bf623b4bbdd..e309248168e89 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php
@@ -207,6 +207,9 @@ public function testGetSpecificOptions($optionIds, $withEmpty)
$this->assertEquals($options, $this->model->getSpecificOptions($optionIds, $withEmpty));
}
+ /**
+ * @return array
+ */
public function specificOptionsProvider()
{
return [
@@ -266,6 +269,9 @@ public function testGetOptionText($optionsIds, $value, $options, $expectedResult
$this->assertEquals($expectedResult, $this->model->getOptionText($value));
}
+ /**
+ * @return array
+ */
public function getOptionTextProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php
index 27957e8090d3e..911aecf8e7cfb 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php
@@ -33,6 +33,9 @@ public function testGetBackendTypeByInput($givenFrontendInput, $expectedBackendT
$this->assertEquals($expectedBackendType, $this->_model->getBackendTypeByInput($givenFrontendInput));
}
+ /**
+ * @return array
+ */
public static function dataGetBackendTypeByInput()
{
return [
@@ -61,6 +64,9 @@ public function testGetDefaultValueByInput($givenFrontendInput, $expectedDefault
$this->assertEquals($expectedDefaultValue, $this->_model->getDefaultValueByInput($givenFrontendInput));
}
+ /**
+ * @return array
+ */
public static function dataGetDefaultValueByInput()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php
index 88185387ed398..13c07740eb203 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php
@@ -178,6 +178,9 @@ public function testRemoveItemByKey($values, $count)
$this->assertNull($this->model->getItemById($testId));
}
+ /**
+ * @return array
+ */
public function getItemsDataProvider()
{
return [
@@ -187,6 +190,9 @@ public function getItemsDataProvider()
];
}
+ /**
+ * @return \Magento\Framework\DataObject
+ */
public function getMagentoObject()
{
return new \Magento\Framework\DataObject();
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php
index d281b8d1095f4..cce7b43786a76 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php
@@ -68,6 +68,9 @@ public function testFetchItem(array $data)
}
}
+ /**
+ * @return array
+ */
public static function fetchItemDataProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/AlphanumTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/AlphanumTest.php
index 16ba85f4905ea..50e7f185a24e5 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/AlphanumTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/AlphanumTest.php
@@ -37,6 +37,9 @@ public function testGetNextId($lastId, $prefix, $expectedResult)
$this->assertEquals($expectedResult, $this->model->getNextId());
}
+ /**
+ * @return array
+ */
public function getLastIdDataProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/NumericTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/NumericTest.php
index a976fc1f3e654..16767fb633028 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/NumericTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Increment/NumericTest.php
@@ -32,6 +32,9 @@ public function testGetNextId($lastId, $prefix, $expectedResult)
$this->assertEquals($expectedResult, $this->model->getNextId());
}
+ /**
+ * @return array
+ */
public function getLastIdDataProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Attribute/CollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Attribute/CollectionTest.php
index 823f32f46b9a5..785493080c998 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Attribute/CollectionTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Attribute/CollectionTest.php
@@ -112,7 +112,7 @@ protected function setUp()
$this->connectionMock->expects($this->any())->method('quoteIdentifier')->will($this->returnArgument(0));
$this->connectionMock->expects($this->any())
->method('describeTable')
- ->will($this->returnvalueMap(
+ ->will($this->returnValueMap(
[
[
'some_main_table',
@@ -174,6 +174,9 @@ public function testInitSelect($column, $value)
$this->model->getSelectCountSql()->assemble();
}
+ /**
+ * @return array
+ */
public function initSelectDataProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/AttributeLoaderTest.php b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/AttributeLoaderTest.php
index 8e6fa3afd15b9..ea02ec71a7bbd 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/AttributeLoaderTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/AttributeLoaderTest.php
@@ -90,6 +90,9 @@ public function testGetAttributes($entityType, $attributeSetId, $expectedConditi
$this->assertEquals([$attributeMock], $this->attributeLoader->getAttributes($entityType, $attributeSetId));
}
+ /**
+ * @return array
+ */
public function getAttributesDataProvider()
{
return [
diff --git a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/ReadHandlerTest.php b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/ReadHandlerTest.php
index 4565b75e5f415..82e9033496b78 100644
--- a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/ReadHandlerTest.php
+++ b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/ReadHandlerTest.php
@@ -115,6 +115,9 @@ public function testExecute($eavEntityType, $callNum, array $expected, $isStatic
$this->assertEquals($expected, $this->readHandler->execute('entity_type', $entityData));
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php
index 76bbba7406609..e26df4f6d1197 100644
--- a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php
@@ -383,6 +383,9 @@ public function testSetDesignConfigWithValidInputParametersReturnsSuccess()
$this->assertEquals($config, $model->getDesignConfig()->getData());
}
+ /**
+ * @return array
+ */
public function invalidInputParametersDataProvider()
{
return [[[]], [['area' => 'some_area']], [['store' => 'any_store']]];
diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php
index f7ba4b7424cc6..5f8bef5c0c489 100644
--- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php
@@ -29,6 +29,9 @@ public function testMergedXml($fixtureXml, array $expectedErrors)
$this->_testXmlAgainstXsd($fixtureXml, $schemaFile, $expectedErrors);
}
+ /**
+ * @return array
+ */
public function mergedXmlDataProvider()
{
return [
diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
index 6a565ca08eb9b..ac14d07d4fa58 100644
--- a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
@@ -190,6 +190,9 @@ public function testParseTemplateIdParts($input, $expectedOutput)
$this->assertEquals($this->model->parseTemplateIdParts($input), $expectedOutput);
}
+ /**
+ * @return array
+ */
public function parseTemplateCodePartsDataProvider()
{
return [
@@ -301,6 +304,9 @@ public function testGetterMethodUnknownTemplate($getterMethod, $argument = null)
}
}
+ /**
+ * @return array
+ */
public function getterMethodUnknownTemplateDataProvider()
{
return [
@@ -348,6 +354,9 @@ public function testGetterMethodUnknownField(
}
}
+ /**
+ * @return array
+ */
public function getterMethodUnknownFieldDataProvider()
{
return [
diff --git a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
index 3e6661816945a..6750fc3d3f49d 100644
--- a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
@@ -298,6 +298,9 @@ public function testLoadDefault(
$this->assertEquals($expectedTemplateStyles, $model->getTemplateStyles());
}
+ /**
+ * @return array
+ */
public function loadDefaultDataProvider()
{
return [
@@ -453,6 +456,9 @@ public function testIsValidForSend($senderName, $senderEmail, $templateSubject,
$this->assertEquals($expectedValue, $model->isValidForSend());
}
+ /**
+ * @return array
+ */
public function isValidForSendDataProvider()
{
return [
@@ -548,6 +554,9 @@ public function testGetVariablesOptionArray($withGroup, $templateVariables, $exp
$this->assertEquals($expectedResult, $model->getVariablesOptionArray($withGroup));
}
+ /**
+ * @return array
+ */
public function getVariablesOptionArrayDataProvider()
{
return [
@@ -648,6 +657,9 @@ public function testProcessTemplate($templateId, $expectedResult)
$this->assertTrue($model->getUseAbsoluteLinks());
}
+ /**
+ * @return array
+ */
public function processTemplateVariable()
{
return [
@@ -744,6 +756,9 @@ public function testGetType($templateType, $expectedResult)
$this->assertEquals($expectedResult, $model->getType());
}
+ /**
+ * @return array
+ */
public function getTypeDataProvider()
{
return [['text', 1], ['html', 2]];
diff --git a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php
index 35759f4d3f44a..f83f2304143a1 100644
--- a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php
+++ b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php
@@ -39,6 +39,9 @@ public function testProcess($itemId, array $jsLayout, array $result)
$this->assertEquals($result, $this->model->process($jsLayout, $itemMock));
}
+ /**
+ * @return array
+ */
public function dataProviderProcess()
{
return [
diff --git a/app/code/Magento/GoogleAdwords/Test/Unit/Helper/DataTest.php b/app/code/Magento/GoogleAdwords/Test/Unit/Helper/DataTest.php
index faa28603af62e..794837f9d6e74 100644
--- a/app/code/Magento/GoogleAdwords/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/GoogleAdwords/Test/Unit/Helper/DataTest.php
@@ -91,6 +91,9 @@ public function testGetLanguageCodes()
$this->assertEquals($languages, $this->_helper->getLanguageCodes());
}
+ /**
+ * @return array
+ */
public function dataProviderForTestConvertLanguage()
{
return [
diff --git a/app/code/Magento/GoogleAdwords/Test/Unit/Model/Filter/UppercaseTitleTest.php b/app/code/Magento/GoogleAdwords/Test/Unit/Model/Filter/UppercaseTitleTest.php
index cf013780105a7..76a746ea77b92 100644
--- a/app/code/Magento/GoogleAdwords/Test/Unit/Model/Filter/UppercaseTitleTest.php
+++ b/app/code/Magento/GoogleAdwords/Test/Unit/Model/Filter/UppercaseTitleTest.php
@@ -17,6 +17,9 @@ protected function setUp()
$this->_model = new \Magento\GoogleAdwords\Model\Filter\UppercaseTitle();
}
+ /**
+ * @return array
+ */
public function dataProviderForFilterValues()
{
return [['some name', 'Some Name'], ['test', 'Test']];
diff --git a/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php b/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php
index ccda04d052fc9..ab8e4f7f8dca8 100644
--- a/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php
+++ b/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php
@@ -56,6 +56,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function dataProviderForDisabled()
{
return [[false, false], [false, true], [true, false]];
@@ -88,6 +91,9 @@ function () use ($isDynamic) {
$this->assertSame($this->_model, $this->_model->execute($this->_eventObserverMock));
}
+ /**
+ * @return array
+ */
public function dataProviderForOrdersIds()
{
return [[[]], ['']];
diff --git a/app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/Grouped/LinksTest.php b/app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/Grouped/LinksTest.php
index ffcfa5c0a90d7..9a4ddeb4f55f5 100644
--- a/app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/Grouped/LinksTest.php
+++ b/app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/Grouped/LinksTest.php
@@ -57,6 +57,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function linksDataProvider()
{
return [
@@ -107,6 +110,9 @@ public function testSaveLinksDataWithProductsAttrs($linksData)
$this->links->saveLinksData($linksData);
}
+ /**
+ * @return array
+ */
public function attributesDataProvider()
{
return [
@@ -135,6 +141,9 @@ public function attributesDataProvider()
];
}
+ /**
+ * @param $dbAttributes
+ */
protected function processAttributeGetter($dbAttributes)
{
$select = $this->createMock(\Magento\Framework\DB\Select::class);
@@ -162,6 +171,9 @@ public function testGetAttributes($dbAttributes, $returnedAttributes)
$this->assertEquals($returnedAttributes, $actualAttributes);
}
+ /**
+ * @param $behavior
+ */
protected function processBehaviorGetter($behavior)
{
$dataSource = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Block/Product/View/Type/GroupedTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Block/Product/View/Type/GroupedTest.php
index 77ffb200f84e0..e8ed2e5d6f880 100644
--- a/app/code/Magento/GroupedProduct/Test/Unit/Block/Product/View/Type/GroupedTest.php
+++ b/app/code/Magento/GroupedProduct/Test/Unit/Block/Product/View/Type/GroupedTest.php
@@ -111,6 +111,9 @@ public function testSetPreconfiguredValue($id)
$this->groupedView->setPreconfiguredValue();
}
+ /**
+ * @return array
+ */
public function setPreconfiguredValueDataProvider()
{
return ['item_id_exist_in_config' => ['id_one'], 'item_id_not_exist_in_config' => ['id_two']];
diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php
index 309794a6cc37d..2dbdbb551f97a 100644
--- a/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php
+++ b/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php
@@ -92,6 +92,9 @@ public function testBeforeInitializeLinksRequestDoesNotHaveGrouped($productType)
$this->model->beforeInitializeLinks($this->subjectMock, $this->productMock, []);
}
+ /**
+ * @return array
+ */
public function productTypeDataProvider()
{
return [
@@ -141,6 +144,9 @@ public function testBeforeInitializeLinksRequestHasGrouped($linksData)
$this->model->beforeInitializeLinks($this->subjectMock, $this->productMock, ['associated' => $linksData]);
}
+ /**
+ * @return array
+ */
public function linksDataProvider()
{
return [
diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php
index 13e1dde0c526c..dd640579ca65e 100644
--- a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php
+++ b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php
@@ -102,6 +102,11 @@ public function testGetValueWithoutMinProduct()
$this->assertEquals(0.00, $this->finalPrice->getValue());
}
+ /**
+ * @param $price
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getProductMock($price)
{
$priceTypeMock = $this->createMock(\Magento\Catalog\Pricing\Price\FinalPrice::class);
diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/GroupedProductDataProviderTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/GroupedProductDataProviderTest.php
index 8dc8fc0483d41..9a4662ffa42cc 100644
--- a/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/GroupedProductDataProviderTest.php
+++ b/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/GroupedProductDataProviderTest.php
@@ -75,6 +75,9 @@ protected function setUp()
->getMockForAbstractClass();
}
+ /**
+ * @return object
+ */
protected function getModel()
{
return $this->objectManager->getObject(GroupedProductDataProvider::class, [
diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php
index 953f76f6cf702..f9d0cf11179dc 100644
--- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php
+++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php
@@ -65,6 +65,9 @@ public function testGetEntities($value, $expected)
$this->assertEquals($expected, $this->model->getEntities('entities'));
}
+ /**
+ * @return array
+ */
public function getEntitiesDataProvider()
{
return [
@@ -100,6 +103,9 @@ public function testGetEntityTypes($configData, $entity, $expectedResult)
$this->assertEquals($expectedResult, $this->model->getEntityTypes($entity));
}
+ /**
+ * @return array
+ */
public function getEntityTypesDataProvider()
{
return [
@@ -154,6 +160,9 @@ public function testGetFileFormats($value, $expected)
$this->assertEquals($expected, $this->model->getFileFormats('fileFormats'));
}
+ /**
+ * @return array
+ */
public function getFileFormatsDataProvider()
{
return [
diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php
index 688e3a2659c6d..aa37551034a25 100644
--- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php
+++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php
@@ -65,6 +65,9 @@ public function testGetEntities($value, $expected)
$this->assertEquals($expected, $this->model->getEntities('entities'));
}
+ /**
+ * @return array
+ */
public function getEntitiesDataProvider()
{
return [
@@ -100,6 +103,9 @@ public function testGetEntityTypes($configData, $entity, $expectedResult)
$this->assertEquals($expectedResult, $this->model->getEntityTypes($entity));
}
+ /**
+ * @return array
+ */
public function getEntityTypesDataProvider()
{
return [
diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php
index 6ef2ef02865f1..7fb9457c2d704 100644
--- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php
+++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php
@@ -39,6 +39,9 @@ public function testConstructorFileDestinationMatch($fileName, $expectedfileName
$this->_invokeConstructor($fileName);
}
+ /**
+ * @return array
+ */
public function constructorFileDestinationMatchDataProvider()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php b/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php
index 5bc20e0633191..490d9437941f6 100644
--- a/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php
@@ -62,6 +62,9 @@ public function testExecute($isExist, $callCount)
$this->assertEquals(0, $this->entryPoint->launch()->getCode());
}
+ /**
+ * @return array
+ */
public function executeProvider()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/ScheduledTest.php b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/ScheduledTest.php
index 6ae005efa0550..1a226e073ca5e 100644
--- a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/ScheduledTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/ScheduledTest.php
@@ -31,6 +31,9 @@ public function testRender($rowValue, $class, $text)
$this->assertEquals($result, $html);
}
+ /**
+ * @return array
+ */
public function typeProvider()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/StatusTest.php b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/StatusTest.php
index e419a010ad96d..705a9e3998ae8 100644
--- a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/StatusTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/StatusTest.php
@@ -33,6 +33,9 @@ public function testRender($indexValues, $expectedResult)
);
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/UpdatedTest.php b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/UpdatedTest.php
index e1ad5c50f3c91..369a4d46abf49 100644
--- a/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/UpdatedTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/Block/Backend/Grid/Column/Renderer/UpdatedTest.php
@@ -27,6 +27,9 @@ public function testRender($defaultValue, $assert)
$this->assertEquals($result, $assert);
}
+ /**
+ * @return array
+ */
public function renderProvider()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php
index e9c82906121cc..6b7cc12218990 100644
--- a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php
@@ -323,6 +323,9 @@ function () {
$this->model->reindexAll();
}
+ /**
+ * @return array
+ */
protected function getIndexerData()
{
return [
diff --git a/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php b/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php
index f7b99fdb8d23f..46ae79fc92f4a 100644
--- a/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php
+++ b/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php
@@ -165,6 +165,9 @@ public function testInsertFromTable($readToIndex)
);
}
+ /**
+ * @return array
+ */
public function insertFromTableData()
{
return [[false], [true]];
diff --git a/app/code/Magento/Indexer/Ui/DataProvider/Indexer/DataCollection.php b/app/code/Magento/Indexer/Ui/DataProvider/Indexer/DataCollection.php
index 5ba4521791c50..0b6477e550c7e 100644
--- a/app/code/Magento/Indexer/Ui/DataProvider/Indexer/DataCollection.php
+++ b/app/code/Magento/Indexer/Ui/DataProvider/Indexer/DataCollection.php
@@ -23,6 +23,13 @@ class DataCollection extends Collection
*/
private $indexerRegistry;
+ /**
+ * DataCollection constructor.
+ *
+ * @param EntityFactoryInterface $entityFactory
+ * @param ConfigInterface $config
+ * @param IndexerRegistry $indexerRegistry
+ */
public function __construct(
EntityFactoryInterface $entityFactory,
ConfigInterface $config,
diff --git a/app/code/Magento/InstantPurchase/Controller/Button/PlaceOrder.php b/app/code/Magento/InstantPurchase/Controller/Button/PlaceOrder.php
index 56ed9ca583a2b..3d46e1ef7466e 100644
--- a/app/code/Magento/InstantPurchase/Controller/Button/PlaceOrder.php
+++ b/app/code/Magento/InstantPurchase/Controller/Button/PlaceOrder.php
@@ -76,6 +76,18 @@ class PlaceOrder extends Action
*/
private $orderRepository;
+ /**
+ * PlaceOrder constructor.
+ *
+ * @param Context $context
+ * @param StoreManagerInterface $storeManager
+ * @param Session $customerSession
+ * @param FormKeyValidator $formKeyValidator
+ * @param InstantPurchaseOptionLoadingFactory $instantPurchaseOptionLoadingFactory
+ * @param ProductRepositoryInterface $productRepository
+ * @param PlaceOrderModel $placeOrder
+ * @param OrderRepositoryInterface $orderRepository
+ */
public function __construct(
Context $context,
StoreManagerInterface $storeManager,
diff --git a/app/code/Magento/InstantPurchase/Model/ShippingMethodChoose/DeferredShippingMethodChooserPool.php b/app/code/Magento/InstantPurchase/Model/ShippingMethodChoose/DeferredShippingMethodChooserPool.php
index 5a43783ceea6a..a5bb2e2a834a8 100644
--- a/app/code/Magento/InstantPurchase/Model/ShippingMethodChoose/DeferredShippingMethodChooserPool.php
+++ b/app/code/Magento/InstantPurchase/Model/ShippingMethodChoose/DeferredShippingMethodChooserPool.php
@@ -15,6 +15,11 @@ class DeferredShippingMethodChooserPool
{
private $choosers;
+ /**
+ * DeferredShippingMethodChooserPool constructor.
+ *
+ * @param array $choosers
+ */
public function __construct(array $choosers)
{
foreach ($choosers as $chooser) {
@@ -28,6 +33,11 @@ public function __construct(array $choosers)
$this->choosers = $choosers;
}
+ /**
+ * @param $type
+ *
+ * @return DeferredShippingMethodChooserInterface
+ */
public function get($type) : DeferredShippingMethodChooserInterface
{
if (!isset($this->choosers[$type])) {
diff --git a/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Integration/Edit/Tab/WebapiTest.php b/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Integration/Edit/Tab/WebapiTest.php
index b5f2b22186187..7738e9939fcdd 100644
--- a/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Integration/Edit/Tab/WebapiTest.php
+++ b/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Integration/Edit/Tab/WebapiTest.php
@@ -83,6 +83,9 @@ public function testCanShowTab($integrationData, $expectedValue)
$this->assertEquals($expectedValue, $this->webapiBlock->canShowTab());
}
+ /**
+ * @return array
+ */
public function canShowTabProvider()
{
return [
@@ -127,6 +130,9 @@ public function testIsEverythingAllowed($rootResourceId, $integrationData, $sele
$this->assertEquals($expectedValue, $this->webapiBlock->isEverythingAllowed());
}
+ /**
+ * @return array
+ */
public function isEverythingAllowedProvider()
{
return [
diff --git a/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Widget/Grid/Column/Renderer/NameTest.php b/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Widget/Grid/Column/Renderer/NameTest.php
index 91f56279a89e5..30f1dc1d90bdc 100644
--- a/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Widget/Grid/Column/Renderer/NameTest.php
+++ b/app/code/Magento/Integration/Test/Unit/Block/Adminhtml/Widget/Grid/Column/Renderer/NameTest.php
@@ -87,6 +87,9 @@ public function testRender($endpoint, $name, $expectedResult)
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function endpointDataProvider()
{
return [
diff --git a/app/code/Magento/Integration/Test/Unit/Helper/DataTest.php b/app/code/Magento/Integration/Test/Unit/Helper/DataTest.php
index ca79393efb113..0cb550913ba60 100644
--- a/app/code/Magento/Integration/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Integration/Test/Unit/Helper/DataTest.php
@@ -33,6 +33,9 @@ public function testIsConfigType($integrationsData, $expectedResult)
$this->assertEquals($expectedResult, $this->dataHelper->isConfigType($integrationsData));
}
+ /**
+ * @return array
+ */
public function integrationDataProvider()
{
return [
diff --git a/app/code/Magento/Integration/Test/Unit/Helper/Oauth/ConsumerTest.php b/app/code/Magento/Integration/Test/Unit/Helper/Oauth/ConsumerTest.php
index ebdac167d257c..19734c535a101 100644
--- a/app/code/Magento/Integration/Test/Unit/Helper/Oauth/ConsumerTest.php
+++ b/app/code/Magento/Integration/Test/Unit/Helper/Oauth/ConsumerTest.php
@@ -197,6 +197,11 @@ public function testPostToConsumer()
$this->assertEquals($oauthVerifier, $verifier, 'Checking Oauth Verifier');
}
+ /**
+ * @param $length
+ *
+ * @return bool|string
+ */
private function _generateRandomString($length)
{
return substr(
diff --git a/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php b/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php
index 529703500d4f0..76ce7d211691d 100644
--- a/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php
+++ b/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php
@@ -156,6 +156,11 @@ public function tearDown()
unset($this->_oauth);
}
+ /**
+ * @param array $amendments
+ *
+ * @return array
+ */
protected function _getRequestTokenParams($amendments = [])
{
$requiredParams = [
@@ -233,6 +238,9 @@ public function testGetRequestTokenOutdatedConsumerKey()
$this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL);
}
+ /**
+ * @param bool $isLoadable
+ */
protected function _setupConsumer($isLoadable = true)
{
$this->_consumerMock->expects($this->any())->method('loadByKey')->will($this->returnSelf());
@@ -293,6 +301,9 @@ public function testGetRequestTokenOauthTimestampRefused($timestamp)
);
}
+ /**
+ * @return array
+ */
public function dataProviderForGetRequestTokenNonceTimestampRefusedTest()
{
return [
@@ -302,6 +313,10 @@ public function dataProviderForGetRequestTokenNonceTimestampRefusedTest()
];
}
+ /**
+ * @param bool $isUsed
+ * @param int $timestamp
+ */
protected function _setupNonce($isUsed = false, $timestamp = 0)
{
$nonceMock = $this->getMockBuilder(
@@ -361,6 +376,13 @@ public function testGetRequestTokenNoConsumer()
$this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL);
}
+ /**
+ * @param bool $doesExist
+ * @param string $type
+ * @param int $consumerId
+ * @param null $verifier
+ * @param bool $isRevoked
+ */
protected function _setupToken(
$doesExist = true,
$type = \Magento\Integration\Model\Oauth\Token::TYPE_VERIFIER,
@@ -604,6 +626,9 @@ public function testGetAccessTokenVerifierInvalid($verifier, $verifierFromToken)
);
}
+ /**
+ * @return array
+ */
public function dataProviderForGetAccessTokenVerifierInvalidTest()
{
// Verifier is not a string
@@ -789,6 +814,9 @@ public function testMissingParamForBuildAuthorizationHeader($expectedMessage, $r
$this->_oauth->buildAuthorizationHeader($request, $requestUrl);
}
+ /**
+ * @return array
+ */
public function dataProviderMissingParamForBuildAuthorizationHeaderTest()
{
return [
@@ -838,6 +866,11 @@ public function dataProviderMissingParamForBuildAuthorizationHeaderTest()
];
}
+ /**
+ * @param array $amendments
+ *
+ * @return array
+ */
protected function _getAccessTokenRequiredParams($amendments = [])
{
$requiredParams = [
@@ -855,6 +888,11 @@ protected function _getAccessTokenRequiredParams($amendments = [])
return array_merge($requiredParams, $amendments);
}
+ /**
+ * @param $length
+ *
+ * @return bool|string
+ */
private function _generateRandomString($length)
{
return substr(
diff --git a/app/code/Magento/LayeredNavigation/Test/Unit/Block/NavigationTest.php b/app/code/Magento/LayeredNavigation/Test/Unit/Block/NavigationTest.php
index 52a711fad2b60..74e42e38ee6b4 100644
--- a/app/code/Magento/LayeredNavigation/Test/Unit/Block/NavigationTest.php
+++ b/app/code/Magento/LayeredNavigation/Test/Unit/Block/NavigationTest.php
@@ -138,6 +138,9 @@ public function testCanShowBlockWithDifferentDisplayModes(string $mode, bool $re
$this->assertEquals($result, $this->model->canShowBlock());
}
+ /**
+ * @return array
+ */
public function canShowBlockDataProvider()
{
return [
diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php
index 46becd82343e9..48c7c0eda03d6 100644
--- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php
+++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php
@@ -229,6 +229,9 @@ public function testCatchException($isDeveloper, $setBodyCalls)
$this->model->catchException($bootstrap, $exception);
}
+ /**
+ * @return array
+ */
public function catchExceptionDataProvider()
{
return [
diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php
index 0c50b6e130484..88f368fbbe077 100644
--- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php
+++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php
@@ -87,6 +87,9 @@ public function testCollectFileInfo($path, $expectedDir, $expectedFile)
$this->assertEquals($expected, $this->helper->collectFileInfo($mediaDirectory, $path));
}
+ /**
+ * @return array
+ */
public function pathDataProvider()
{
return [
diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php
index 6ff2397f543fa..56f57a9d32c1f 100644
--- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php
+++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php
@@ -75,6 +75,9 @@ public function testCheckDbUsage($storage, $expected)
$this->assertEquals($expected, $this->helper->checkDbUsage());
}
+ /**
+ * @return array
+ */
public function checkDbUsageDataProvider()
{
return [
@@ -144,6 +147,9 @@ public function testSaveFile($storage, $callNum)
$this->helper->saveFile('media-dir/filename');
}
+ /**
+ * @return array
+ */
public function updateFileDataProvider()
{
return [
@@ -226,6 +232,9 @@ public function testFileExists($storage, $callNum, $expected)
$this->assertEquals($expected, $this->helper->fileExists('media-dir/file'));
}
+ /**
+ * @return array
+ */
public function fileExistsDataProvider()
{
return [
@@ -264,6 +273,9 @@ public function testGetUniqueFilename($storage, $callNum, $expected)
$this->assertSame($expected, $this->helper->getUniqueFilename('media-dir/directory/', 'filename.ext'));
}
+ /**
+ * @return array
+ */
public function getUniqueFilenameDataProvider()
{
return [
@@ -308,6 +320,9 @@ public function testSaveFileToFileSystem($expected, $storage, $callNum, $id = 0,
$this->assertEquals($expected, $this->helper->saveFileToFilesystem('media-dir/filename'));
}
+ /**
+ * @return array
+ */
public function saveFileToFileSystemDataProvider()
{
return [
@@ -430,6 +445,9 @@ public function testSaveUploadedFile($result, $expected, $expectedFullPath, $sto
$this->assertEquals($expected, $this->helper->saveUploadedFile($result));
}
+ /**
+ * @return array
+ */
public function saveUploadedFileDataProvider()
{
return [
diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php
index 8725bf1f0f02f..d1ae631a351c3 100644
--- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php
+++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php
@@ -77,6 +77,9 @@ public function testIsInternalStorage($storage, $callNum, $expected)
$this->assertEquals($expected, $this->helper->isInternalStorage($storage));
}
+ /**
+ * @return array
+ */
public function isInternalStorageDataProvider()
{
return [
@@ -146,6 +149,9 @@ public function testProcessStorageFile($expected, $storage, $callNum, $callSaveF
$this->assertEquals($expected, $this->helper->processStorageFile($filename));
}
+ /**
+ * @return array
+ */
public function processStorageFileDataProvider()
{
return [
diff --git a/app/code/Magento/Multishipping/Test/Unit/Block/Checkout/Address/SelectTest.php b/app/code/Magento/Multishipping/Test/Unit/Block/Checkout/Address/SelectTest.php
index c2bfe2137c72e..080c26dea4834 100644
--- a/app/code/Magento/Multishipping/Test/Unit/Block/Checkout/Address/SelectTest.php
+++ b/app/code/Magento/Multishipping/Test/Unit/Block/Checkout/Address/SelectTest.php
@@ -115,6 +115,9 @@ public function testIsAddressDefaultShipping($id, $expectedValue)
$this->assertEquals($expectedValue, $this->block->isAddressDefaultShipping($this->addressMock));
}
+ /**
+ * @return array
+ */
public function isDefaultAddressDataProvider()
{
return [
diff --git a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/NewShippingTest.php b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/NewShippingTest.php
index 7628fcf6270c7..6a5cd7ab6e21c 100644
--- a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/NewShippingTest.php
+++ b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/NewShippingTest.php
@@ -164,6 +164,9 @@ public function testExecute($backUrl, $shippingAddress, $url)
$this->controller->execute();
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/NewRelicReporting/Plugin/StatePlugin.php b/app/code/Magento/NewRelicReporting/Plugin/StatePlugin.php
index 0be7c72689e7f..d84f278bb1c68 100644
--- a/app/code/Magento/NewRelicReporting/Plugin/StatePlugin.php
+++ b/app/code/Magento/NewRelicReporting/Plugin/StatePlugin.php
@@ -65,6 +65,12 @@ public function afterSetAreaCode(State $state, $result)
}
}
+ /**
+ * @param State $state
+ *
+ * @return string
+ * @throws LocalizedException
+ */
private function appName(State $state)
{
$code = $state->getAreaCode();
@@ -73,6 +79,9 @@ private function appName(State $state)
return $current . ';' . $current . '_' . $code;
}
+ /**
+ * @return bool
+ */
private function shouldSetAppName()
{
if (!$this->config->isNewRelicEnabled()) {
diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php
index eb665773d5f4b..1193ac088633f 100644
--- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php
+++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php
@@ -252,6 +252,9 @@ public function testSetDeploymentRequestFail()
);
}
+ /**
+ * @return array
+ */
private function getDataVariables()
{
$description = 'Event description';
diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
index a9dbacdfb0405..71f818407f9e1 100644
--- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
+++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
@@ -346,6 +346,9 @@ public function testGetModuleDataRefreshOrStatement($data)
);
}
+ /**
+ * @return array
+ */
public function itemDataProvider()
{
return [
diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php
index 20791511324bf..ba5f13d247fe0 100644
--- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php
+++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php
@@ -140,6 +140,9 @@ public function testReportProductUpdatedToNewRelic($isNewObject)
$this->model->execute($eventObserver);
}
+ /**
+ * @return array
+ */
public function actionDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php b/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php
index c5f4dc68d4dd2..61a17d7ad5e51 100644
--- a/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php
+++ b/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php
@@ -19,7 +19,7 @@ class Problem extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'problem/list.phtml';
+ protected $_template = 'Magento_Newsletter::problem/list.phtml';
/**
* @var \Magento\Newsletter\Model\ResourceModel\Problem\Collection
diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php
index f085b0f6c9c8b..ca90b5d84a10f 100644
--- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php
+++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php
@@ -19,7 +19,7 @@ class Edit extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'queue/edit.phtml';
+ protected $_template = 'Magento_Newsletter::queue/edit.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php
index 86e7e7ee4756d..4d5165db68736 100644
--- a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php
+++ b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php
@@ -29,7 +29,7 @@ class Subscriber extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'subscriber/list.phtml';
+ protected $_template = 'Magento_Newsletter::subscriber/list.phtml';
/**
* @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory
diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template.php
index 02b60e049f254..92ae6e6c3db04 100644
--- a/app/code/Magento/Newsletter/Block/Adminhtml/Template.php
+++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template.php
@@ -16,7 +16,7 @@ class Template extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'template/list.phtml';
+ protected $_template = 'Magento_Newsletter::template/list.phtml';
/**
* @return $this
diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Problem/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Problem/Collection.php
index 6854b90a8888c..ce0e1446d216c 100644
--- a/app/code/Magento/Newsletter/Model/ResourceModel/Problem/Collection.php
+++ b/app/code/Magento/Newsletter/Model/ResourceModel/Problem/Collection.php
@@ -165,8 +165,8 @@ protected function _addCustomersData()
$customerName = $this->_customerView->getCustomerName($customer);
foreach ($problems as $problem) {
$problem->setCustomerName($customerName)
- ->setCustomerFirstName($customer->getFirstName())
- ->setCustomerLastName($customer->getLastName());
+ ->setCustomerFirstName($customer->getFirstname())
+ ->setCustomerLastName($customer->getLastname());
}
} catch (NoSuchEntityException $e) {
// do nothing if customer is not found by id
diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php
index 3e221047ec40a..0f0a97fd9e983 100644
--- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php
+++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php
@@ -221,7 +221,7 @@ public function addOnlyForSendingFilter()
[\Magento\Newsletter\Model\Queue::STATUS_SENDING, \Magento\Newsletter\Model\Queue::STATUS_NEVER]
)->where(
'main_table.queue_start_at < ?',
- $this->_date->gmtdate()
+ $this->_date->gmtDate()
)->where(
'main_table.queue_start_at IS NOT NULL'
);
diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php
index 8e1e1a44d68b7..86f564cb7d2df 100644
--- a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php
+++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php
@@ -424,6 +424,9 @@ public function testReceived()
$this->assertEquals($this->subscriber, $this->subscriber->received($queue));
}
+ /**
+ * @return $this
+ */
protected function sendEmailCheck()
{
$storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class)
diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php
index 5773c77c5f7f9..52bb803dd377f 100644
--- a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php
+++ b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php
@@ -401,6 +401,9 @@ public function testIsValidForSend($senderName, $senderEmail, $templateSubject,
$this->assertEquals($expectedValue, $model->isValidForSend());
}
+ /**
+ * @return array
+ */
public function isValidForSendDataProvider()
{
return [
diff --git a/app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php b/app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php
index c4fe10c386645..d60348d9dc1c7 100644
--- a/app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php
+++ b/app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php
@@ -15,5 +15,5 @@ class Banktransfer extends \Magento\OfflinePayments\Block\Form\AbstractInstructi
*
* @var string
*/
- protected $_template = 'form/banktransfer.phtml';
+ protected $_template = 'Magento_OfflinePayments::form/banktransfer.phtml';
}
diff --git a/app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php b/app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php
index 4e0f7d48ce09b..de0f7a57bae62 100644
--- a/app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php
+++ b/app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php
@@ -15,5 +15,5 @@ class Cashondelivery extends \Magento\OfflinePayments\Block\Form\AbstractInstruc
*
* @var string
*/
- protected $_template = 'form/cashondelivery.phtml';
+ protected $_template = 'Magento_OfflinePayments::form/cashondelivery.phtml';
}
diff --git a/app/code/Magento/OfflinePayments/Test/Unit/Model/CheckmoConfigProviderTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Model/CheckmoConfigProviderTest.php
index 7509ff03c3780..8d65146ec102b 100644
--- a/app/code/Magento/OfflinePayments/Test/Unit/Model/CheckmoConfigProviderTest.php
+++ b/app/code/Magento/OfflinePayments/Test/Unit/Model/CheckmoConfigProviderTest.php
@@ -63,6 +63,9 @@ public function testGetConfig($isAvailable, $mailingAddress, $payableTo, $result
$this->assertEquals($result, $this->model->getConfig());
}
+ /**
+ * @return array
+ */
public function dataProviderGetConfig()
{
$checkmoCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
diff --git a/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php
index 120a7eb6ed88f..97a64d8ab59b9 100644
--- a/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php
+++ b/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php
@@ -82,6 +82,9 @@ public function testGetConfig($isOneAvailable, $instructionsOne, $isTwoAvailable
$this->assertEquals($result, $this->model->getConfig());
}
+ /**
+ * @return array
+ */
public function dataProviderGetConfig()
{
$oneCode = Banktransfer::PAYMENT_METHOD_BANKTRANSFER_CODE;
diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/Plugin/Checkout/Block/Cart/ShippingTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/Plugin/Checkout/Block/Cart/ShippingTest.php
index 185f393ad4d0b..5f0894874ca3c 100644
--- a/app/code/Magento/OfflineShipping/Test/Unit/Model/Plugin/Checkout/Block/Cart/ShippingTest.php
+++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/Plugin/Checkout/Block/Cart/ShippingTest.php
@@ -52,6 +52,9 @@ public function testAfterGetStateActive($scopeConfigMockReturnValue, $result, $a
$this->assertEquals($assertResult, $this->model->afterIsStateActive($subjectMock, $result));
}
+ /**
+ * @return array
+ */
public function afterGetStateActiveDataProvider()
{
return [
diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/CSV/RowParserTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/CSV/RowParserTest.php
index 2f6c5ca600bd3..661120c7b7c5f 100644
--- a/app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/CSV/RowParserTest.php
+++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/CSV/RowParserTest.php
@@ -128,6 +128,9 @@ public function testParseWithException(array $rowData, $conditionFullName, array
throw $exception;
}
+ /**
+ * @return array
+ */
public function parseWithExceptionDataProvider()
{
$rowData = ['a', 'b', 'c', 'd', 'e'];
diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php
index b13a46a8fcdf0..2a886f20c42a7 100644
--- a/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php
+++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php
@@ -20,6 +20,9 @@ protected function setUp()
);
}
+ /**
+ * @return bool
+ */
public function testProcessFreeShipping()
{
$addressMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Address::class)
diff --git a/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php b/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php
index a1c66c67b5524..42a9086daa442 100644
--- a/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php
@@ -130,6 +130,9 @@ public function testGetScriptOptions($isSecure, $url, $expectedResult)
$this->assertRegExp($expectedResult, $this->blockJavascript->getScriptOptions());
}
+ /**
+ * @return array
+ */
public function getScriptOptionsDataProvider()
{
return [
@@ -193,6 +196,9 @@ public function testGetScriptOptionsPrivateContent($url, $route, $controller, $a
$this->assertRegExp($expectedResult, $this->blockJavascript->getScriptOptions());
}
+ /**
+ * @return array
+ */
public function getScriptOptionsPrivateContentDataProvider()
{
// @codingStandardsIgnoreStart
diff --git a/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php b/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php
index 4a7628c7ad839..9c7d55eb8550f 100644
--- a/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php
@@ -130,6 +130,9 @@ public function testExecute($blockClass, $shouldSetHeaders)
$this->action->execute();
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
index 2811cb5316dc6..db0edfa6bd779 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php
@@ -226,6 +226,9 @@ public function testAroundDispatchDisabled($state)
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php
index 033eb2501865b..2e69fdaf47910 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php
@@ -57,6 +57,9 @@ public function testAfterSaveDecompression($data, $initResult)
$this->assertSame($data, $this->plugin->afterLoad($this->subjectMock, $initResult));
}
+ /**
+ * @return array
+ */
public function afterSaveDataProvider()
{
return [
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php
index c9231f118fc75..59591c8ee957f 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/App/Response/HttpPluginTest.php
@@ -26,6 +26,9 @@ public function testBeforeSendResponse($responseInstanceClass, $sendVaryCalled)
$plugin->beforeSendResponse($responseMock);
}
+ /**
+ * @return array
+ */
public function beforeSendResponseDataProvider()
{
return [
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php
index 2321a951aafe8..a57effe1f31ad 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php
@@ -90,6 +90,9 @@ public function testGetUris(
$this->assertEquals($uris, $this->model->getUris());
}
+ /**
+ * @return array
+ */
public function getUrisDataProvider()
{
return [
diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php
index 8c04db7cb8390..6c39fe1e7979c 100644
--- a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php
@@ -70,6 +70,9 @@ public function testAfterGenerateXml($cacheState, $layoutIsCacheable)
$this->assertSame($result, $output);
}
+ /**
+ * @return array
+ */
public function afterGenerateXmlDataProvider()
{
return [
@@ -112,6 +115,9 @@ public function testAfterGetOutput($cacheState, $layoutIsCacheable, $expectedTag
$this->assertSame($output, $html);
}
+ /**
+ * @return array
+ */
public function afterGetOutputDataProvider()
{
$tags = 'identity1,identity2';
diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php
index af5d0d0f95e8f..2cbd005183f7b 100644
--- a/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php
+++ b/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php
@@ -83,6 +83,9 @@ public function testExecute($cacheState)
$this->assertNull($result);
}
+ /**
+ * @return array
+ */
public function flushCacheByTagsDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Block/Info/Instructions.php b/app/code/Magento/Payment/Block/Info/Instructions.php
index e3c74e020f8f6..687c6b54a2f4f 100644
--- a/app/code/Magento/Payment/Block/Info/Instructions.php
+++ b/app/code/Magento/Payment/Block/Info/Instructions.php
@@ -23,7 +23,7 @@ class Instructions extends \Magento\Payment\Block\Info
/**
* @var string
*/
- protected $_template = 'info/instructions.phtml';
+ protected $_template = 'Magento_Payment::info/instructions.phtml';
/**
* Get instructions text from order payment
diff --git a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php
index 729da9eb8196d..268d4f39ba634 100644
--- a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php
@@ -136,7 +136,7 @@ public function testBeforeToHtml()
$infoMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($methodMock));
$this->block->setInfo($infoMock);
- $fakeBlock = new \StdClass();
+ $fakeBlock = new \stdClass();
$this->layout->expects(
$this->any()
)->method(
diff --git a/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php b/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php
index 469d7971e21a9..5f9238ca4360a 100644
--- a/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php
@@ -83,6 +83,9 @@ public function testGetIsSecureMode($isSecureMode, $methodInstance, $store, $sto
$this->assertEquals($result, $expectedResult);
}
+ /**
+ * @return array
+ */
public function getIsSecureModeDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php
index 1cf19ff9292e9..faf4818965386 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Order/AddressAdapterTest.php
@@ -54,6 +54,9 @@ public function testStreetLine1($street, $expected)
$this->assertEquals($expected, $this->model->getStreetLine1());
}
+ /**
+ * @return array
+ */
public function streetLine1DataProvider()
{
return [
@@ -73,6 +76,9 @@ public function testStreetLine2($street, $expected)
$this->assertEquals($expected, $this->model->getStreetLine2());
}
+ /**
+ * @return array
+ */
public function streetLine2DataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php
index 751d8c51b4410..1f5b1c2d87053 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Data/Quote/AddressAdapterTest.php
@@ -54,6 +54,9 @@ public function testStreetLine1($street, $expected)
$this->assertEquals($expected, $this->model->getStreetLine1());
}
+ /**
+ * @return array
+ */
public function streetLine1DataProvider()
{
return [
@@ -73,6 +76,9 @@ public function testStreetLine2($street, $expected)
$this->assertEquals($expected, $this->model->getStreetLine2());
}
+ /**
+ * @return array
+ */
public function streetLine2DataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php
index 546dadfb1bf62..af26ea428a235 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php
@@ -64,7 +64,7 @@ public function testPlaceRequest()
$expectedResult = [
'result' => []
];
- $soapResult = new \StdClass();
+ $soapResult = new \stdClass();
$this->logger->expects(static::at(0))
->method('debug')
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/CountryValidatorTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/CountryValidatorTest.php
index 0c808cb7c1faa..44d6144200504 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/CountryValidatorTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/CountryValidatorTest.php
@@ -68,6 +68,9 @@ public function testValidateAllowspecificTrue($storeId, $country, $allowspecific
$this->assertSame($this->resultMock, $this->model->validate($validationSubject));
}
+ /**
+ * @return array
+ */
public function validateAllowspecificTrueDataProvider()
{
return [
@@ -96,6 +99,9 @@ public function testValidateAllowspecificFalse($storeId, $allowspecific, $isVali
$this->assertSame($this->resultMock, $this->model->validate($validationSubject));
}
+ /**
+ * @return array
+ */
public function validateAllowspecificFalseDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ResultTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ResultTest.php
index fb81137dea42b..562835e3199f1 100644
--- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ResultTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ResultTest.php
@@ -29,6 +29,9 @@ public function testResult($isValid, $failsDescription, $expectedIsValid, $expec
$this->assertEquals($expectedFailsDescription, $this->model->getFailsDescription());
}
+ /**
+ * @return array
+ */
public function resultDataProvider()
{
$phraseMock = $this->getMockBuilder(\Magento\Framework\Phrase::class)->disableOriginalConstructor()->getMock();
diff --git a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php
index 931c2b5fd93d5..3752e82fd1e5b 100644
--- a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php
@@ -253,6 +253,9 @@ public function testGetInfoBlockHtml()
$this->assertEquals($blockHtml, $this->helper->getInfoBlockHtml($infoMock, $storeId));
}
+ /**
+ * @return array
+ */
public function getSortMethodsDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/FactoryTest.php b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/FactoryTest.php
index c49f3da315908..64069ff4a1941 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/FactoryTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/FactoryTest.php
@@ -40,6 +40,9 @@ public function testCreate($salesModelClass, $expectedType)
$this->assertEquals('some value', $this->_model->create($salesModel));
}
+ /**
+ * @return array
+ */
public function createDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/OrderTest.php b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/OrderTest.php
index 7594d9ce501ac..3e3c4226d4fbe 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/OrderTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/OrderTest.php
@@ -19,6 +19,9 @@ protected function setUp()
$this->_model = new \Magento\Payment\Model\Cart\SalesModel\Order($this->_orderMock);
}
+ /**
+ * @return array
+ */
public function gettersDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/QuoteTest.php b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/QuoteTest.php
index 95271569e994e..bdcc89840ac19 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/QuoteTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/Cart/SalesModel/QuoteTest.php
@@ -84,6 +84,9 @@ public function testGetAllItems($pItem, $name, $qty, $price)
$this->assertEquals($expected, $this->_model->getAllItems());
}
+ /**
+ * @return array
+ */
public function getAllItemsDataProvider()
{
return [
@@ -135,6 +138,9 @@ public function testGetter($isVirtual, $getterMethod)
$this->assertEquals($getterMethod, $model->{$getterMethod}());
}
+ /**
+ * @return array
+ */
public function getterDataProvider()
{
return [
diff --git a/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php
index cd215e870462c..0e57777368fb7 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php
@@ -144,6 +144,9 @@ public function testGetActiveMethods($isActive)
static::assertEquals($isActive ? ['active_method' => $adapter] : [], $this->config->getActiveMethods());
}
+ /**
+ * @return array
+ */
public function getActiveMethodsDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Payment/Test/Unit/Model/InfoTest.php b/app/code/Magento/Payment/Test/Unit/Model/InfoTest.php
index 3203f1498b9a3..93279f308eefa 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/InfoTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/InfoTest.php
@@ -176,7 +176,7 @@ public function testDecrypt()
*/
public function testSetAdditionalInformationException()
{
- $this->info->setAdditionalInformation('object', new \StdClass());
+ $this->info->setAdditionalInformation('object', new \stdClass());
}
/**
diff --git a/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml b/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml
index ff1234cfecc2b..163aaf979ec2e 100644
--- a/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml
+++ b/app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml
@@ -65,9 +65,10 @@ $params = $block->getParams();
'jquery',
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/action/place-order',
- 'Magento_Checkout/js/action/redirect-on-success'
+ 'Magento_Checkout/js/action/redirect-on-success',
+ 'Magento_Checkout/js/model/full-screen-loader'
],
- function($, quote, placeOrderAction, redirectOnSuccessAction) {
+ function($, quote, placeOrderAction, redirectOnSuccessAction, fullScreenLoader) {
var parent = window.top;
$(parent).trigger('clearTimeout');
@@ -77,6 +78,12 @@ $params = $block->getParams();
function () {
redirectOnSuccessAction.execute();
}
+ ).fail(
+ function () {
+ var parent = window.top;
+ $(parent).trigger('clearTimeout');
+ fullScreenLoader.stopLoader();
+ }
);
}
);
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php
index 31b3e0c1d6b6f..396c66d4e748e 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Form.php
@@ -13,5 +13,5 @@ class Form extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'billing/agreement/view/form.phtml';
+ protected $_template = 'Magento_Paypal::billing/agreement/view/form.phtml';
}
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php
index d133d19f9c202..39373017fa09a 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php
@@ -15,7 +15,7 @@ class Info extends \Magento\Backend\Block\Template implements \Magento\Backend\B
/**
* @var string
*/
- protected $_template = 'billing/agreement/view/tab/info.phtml';
+ protected $_template = 'Magento_Paypal::billing/agreement/view/tab/info.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php
index a1cfabd48440f..afa80892487a5 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/ApiWizard.php
@@ -13,7 +13,7 @@ class ApiWizard extends \Magento\Config\Block\System\Config\Form\Field
/**
* Path to block template
*/
- const WIZARD_TEMPLATE = 'system/config/api_wizard.phtml';
+ const WIZARD_TEMPLATE = 'Magento_Paypal::system/config/api_wizard.phtml';
/**
* Set template to itself
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php
index bdca98e089e7b..c481871e1fb0f 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/BmlApiWizard.php
@@ -11,7 +11,7 @@ class BmlApiWizard extends ApiWizard
/**
* Path to block template
*/
- const WIZARD_TEMPLATE = 'system/config/bml_api_wizard.phtml';
+ const WIZARD_TEMPLATE = 'Magento_Paypal::system/config/bml_api_wizard.phtml';
/**
* Get the button and scripts contents
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php
index fe4f6ee1f6757..793fad152bc7e 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php
@@ -16,5 +16,5 @@ class Advanced extends \Magento\Paypal\Block\Adminhtml\System\Config\Payflowlink
*
* @var string
*/
- protected $_template = 'system/config/payflowlink/advanced.phtml';
+ protected $_template = 'Magento_Paypal::system/config/payflowlink/advanced.phtml';
}
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php
index 30119063f5b5b..405de1ec03185 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php
@@ -16,7 +16,7 @@ class Info extends \Magento\Config\Block\System\Config\Form\Field
*
* @var string
*/
- protected $_template = 'system/config/payflowlink/info.phtml';
+ protected $_template = 'Magento_Paypal::system/config/payflowlink/info.phtml';
/**
* Render fieldset html
diff --git a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php b/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php
index 92281d3058eef..70eff8f83ba99 100644
--- a/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php
+++ b/app/code/Magento/Paypal/Block/Hosted/Pro/Form.php
@@ -15,5 +15,5 @@ class Form extends \Magento\Payment\Block\Form
/**
* @var string
*/
- protected $_template = 'hss/info.phtml';
+ protected $_template = 'Magento_Paypal::hss/info.phtml';
}
diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php
index d6edb1ed25231..98fc05d0d2f60 100644
--- a/app/code/Magento/Paypal/Block/Iframe.php
+++ b/app/code/Magento/Paypal/Block/Iframe.php
@@ -44,7 +44,7 @@ class Iframe extends \Magento\Payment\Block\Form
/**
* @var string
*/
- protected $_template = 'hss/js.phtml';
+ protected $_template = 'Magento_Paypal::hss/js.phtml';
/**
* @var \Magento\Sales\Model\OrderFactory
diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php
index d777279ad47a8..159abd4e2f1bb 100644
--- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php
+++ b/app/code/Magento/Paypal/Block/Payflow/Advanced/Form.php
@@ -15,7 +15,7 @@ class Form extends \Magento\Paypal\Block\Payflow\Link\Form
/**
* @var string
*/
- protected $_template = 'payflowadvanced/info.phtml';
+ protected $_template = 'Magento_Paypal::payflowadvanced/info.phtml';
/**
* Get frame action URL
diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Form.php b/app/code/Magento/Paypal/Block/Payflow/Link/Form.php
index f414a63d69046..fc880f494c859 100644
--- a/app/code/Magento/Paypal/Block/Payflow/Link/Form.php
+++ b/app/code/Magento/Paypal/Block/Payflow/Link/Form.php
@@ -15,7 +15,7 @@ class Form extends \Magento\Payment\Block\Form
/**
* @var string
*/
- protected $_template = 'payflowlink/info.phtml';
+ protected $_template = 'Magento_Paypal::payflowlink/info.phtml';
/**
* Get frame action URL
diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Field/CountryTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Field/CountryTest.php
index 39fc0c2dae5eb..d8487e63c6eca 100644
--- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Field/CountryTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Field/CountryTest.php
@@ -114,6 +114,9 @@ public function testRender($requestCountry, $requestDefaultCountry, $canUseDefau
$this->_model->render($this->_element);
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/GroupTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/GroupTest.php
index baf944dc44041..527aa4b9439ce 100644
--- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/GroupTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/GroupTest.php
@@ -93,6 +93,9 @@ public function testIsCollapseState($expanded, $expected)
);
}
+ /**
+ * @return array
+ */
public function isCollapseStateDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php
index d9ddd277a7df1..df9638ef47135 100644
--- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/PaymentTest.php
@@ -85,6 +85,9 @@ public function testIsPaymentEnabled($groupConfig, $expected)
$this->assertContains($expected, $html);
}
+ /**
+ * @return array
+ */
public function isPaymentEnabledDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php
index 9a7a87b366fcf..27ed799a4adb7 100644
--- a/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php
@@ -84,6 +84,9 @@ public function testGetViewFileUrl($isSecure)
$this->assertEquals('result url', $this->model->getViewFileUrl('some file'));
}
+ /**
+ * @return array
+ */
public function getViewFileUrlDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Express/PlaceOrderTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Express/PlaceOrderTest.php
index 54d5acfce9f5f..f915dca23735d 100644
--- a/app/code/Magento/Paypal/Test/Unit/Controller/Express/PlaceOrderTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Controller/Express/PlaceOrderTest.php
@@ -36,6 +36,9 @@ protected function _expectRedirect($path = '*/*/review')
->with($this->anything(), $path, []);
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
@@ -79,6 +82,9 @@ public function testExecuteProcessableException($code, $paymentAction = null)
$this->model->execute();
}
+ /**
+ * @return array
+ */
public function executeProcessableExceptionDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Express/ReturnActionTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Express/ReturnActionTest.php
index fd0182bb88c06..65250ccce08bd 100644
--- a/app/code/Magento/Paypal/Test/Unit/Controller/Express/ReturnActionTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Controller/Express/ReturnActionTest.php
@@ -34,6 +34,9 @@ public function testExecuteAuthorizationRetrial()
$this->model->execute();
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Express/StartTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Express/StartTest.php
index 5ca7156b6f01f..36a9ae3bd5cf9 100644
--- a/app/code/Magento/Paypal/Test/Unit/Controller/Express/StartTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Controller/Express/StartTest.php
@@ -37,6 +37,9 @@ public function testStartAction($buttonParam)
$this->model->execute();
}
+ /**
+ * @return array
+ */
public function startActionDataProvider()
{
return [['1'], [null]];
diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php
index fd8a8a3c41f11..ffa1bf027ab57 100644
--- a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php
@@ -92,6 +92,9 @@ public function testGetConfigurationCountryCodeFromConfig($request)
$this->configurationCountryCodeAssertResult('GB');
}
+ /**
+ * @return array
+ */
public function getConfigurationCountryCodeFromConfigDataProvider()
{
return [
@@ -116,6 +119,9 @@ public function testGetConfigurationCountryCodeFromDefault($request, $config, $d
$this->configurationCountryCodeAssertResult($default);
}
+ /**
+ * @return array
+ */
public function getConfigurationCountryCodeFromDefaultDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php
index bb25bea63a8bc..9ec9318212614 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php
@@ -273,6 +273,9 @@ public function testIsMethodAvailable($methodCode, $expectedFlag)
$this->config->isMethodAvailable($methodCode);
}
+ /**
+ * @return array
+ */
public function isMethodAvailableDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php
index c0b2bb4fc1dca..56fe0cc9e5824 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php
@@ -138,6 +138,9 @@ public function testCall($response, $processableErrors, $exception, $exceptionMe
$this->model->call('some method', ['data' => 'some data']);
}
+ /**
+ * @return array
+ */
public function callDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/CartTest.php b/app/code/Magento/Paypal/Test/Unit/Model/CartTest.php
index f9bb74dba5b53..0f787f0f513a1 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/CartTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/CartTest.php
@@ -85,6 +85,9 @@ public function testInvalidGetAllItems($items)
$this->assertEquals(0.3, $this->_model->getDiscount());
}
+ /**
+ * @return array
+ */
public function invalidGetAllItemsDataProvider()
{
return [
@@ -150,6 +153,9 @@ public function testInvalidTotalsGetAllItems($values, $transferDiscount)
$this->assertEquals($transferDiscount ? 0.0 : $values['base_discount_amount'], $this->_model->getDiscount());
}
+ /**
+ * @return array
+ */
public function invalidTotalsGetAllItemsDataProvider()
{
return [
@@ -222,6 +228,9 @@ public function testInvalidGetAmounts($values, $transferDiscount, $transferShipp
$this->assertEquals([Cart::AMOUNT_SUBTOTAL => $expectedSubtotal], $result);
}
+ /**
+ * @return array
+ */
public function invalidGetAmountsDataProvider()
{
$data = [];
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/PaymentSectionModifierTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/PaymentSectionModifierTest.php
index 6a5b2676014cb..57534345f2541 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/PaymentSectionModifierTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/PaymentSectionModifierTest.php
@@ -175,6 +175,9 @@ private function fetchAllAvailableGroups($structure)
return $availableGroups;
}
+ /**
+ * @return mixed
+ */
public function caseProvider()
{
return include __DIR__ . '/_files/payment_section_structure_variations.php';
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php
index 2a3ac1adbc07a..ed834ae2b9c01 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php
@@ -371,6 +371,9 @@ public function amountWithoutTaxDataProvider()
];
}
+ /**
+ * @return array
+ */
public function amountWithoutTaxZeroSubtotalDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php
index c9689c8601a02..3e8af6b2ee766 100644
--- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php
@@ -179,6 +179,9 @@ public function testSetTransStatus($response, $paymentExpected)
$this->assertEquals($paymentExpected->getData(), $payment->getData());
}
+ /**
+ * @return array
+ */
public function setTransStatusDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php b/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php
index c1947c522b118..8e18b680ce9cd 100644
--- a/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php
@@ -166,6 +166,9 @@ public function testAddBillingAgreementToSession($isValid)
$this->_model->execute($this->_observer);
}
+ /**
+ * @return array
+ */
public function addBillingAgreementToSessionDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Paypal/Test/Unit/Observer/RestrictAdminBillingAgreementUsageObserverTest.php b/app/code/Magento/Paypal/Test/Unit/Observer/RestrictAdminBillingAgreementUsageObserverTest.php
index abad48e49f261..381a8d971052c 100644
--- a/app/code/Magento/Paypal/Test/Unit/Observer/RestrictAdminBillingAgreementUsageObserverTest.php
+++ b/app/code/Magento/Paypal/Test/Unit/Observer/RestrictAdminBillingAgreementUsageObserverTest.php
@@ -48,6 +48,9 @@ protected function setUp()
$this->_model = new \Magento\Paypal\Observer\RestrictAdminBillingAgreementUsageObserver($this->_authorization);
}
+ /**
+ * @return array
+ */
public function restrictAdminBillingAgreementUsageDataProvider()
{
return [
diff --git a/app/code/Magento/Paypal/i18n/en_US.csv b/app/code/Magento/Paypal/i18n/en_US.csv
index 797edbf8bfa1e..2a1a6bbb48ef2 100644
--- a/app/code/Magento/Paypal/i18n/en_US.csv
+++ b/app/code/Magento/Paypal/i18n/en_US.csv
@@ -2,7 +2,7 @@
Why Advertise Financing?
Give your sales a boost when you advertise financing. PayPal helps turn browsers into buyers with financing
from PayPal Credit®. Your customers have more time to pay, while you get paid up front – at no additional cost to you.
- Use PayPal’ s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
+ Use PayPal’s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
or more. See Details .
","
diff --git a/app/code/Magento/Paypal/view/frontend/web/order-review.js b/app/code/Magento/Paypal/view/frontend/web/order-review.js
index 566c9c8da06dc..2155b52f4081b 100644
--- a/app/code/Magento/Paypal/view/frontend/web/order-review.js
+++ b/app/code/Magento/Paypal/view/frontend/web/order-review.js
@@ -108,7 +108,7 @@ define([
},
/**
- * trigger change for the update of shippping methods from server
+ * trigger change for the update of shipping methods from server
*/
_updateOrderHandler: function () {
$(this.options.shippingSelector).trigger('change');
@@ -297,7 +297,7 @@ define([
this._updateOrderSubmit(true);
this._toggleButton(this.options.updateOrderSelector, true);
- // form data and callBack updated based on the shippping Form element
+ // form data and callBack updated based on the shipping Form element
if (this.isShippingSubmitForm) {
formData = $(this.options.shippingSubmitFormSelector).serialize() + '&isAjax=true';
diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php
index 7749377bbfcd0..669728804af1a 100644
--- a/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php
+++ b/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php
@@ -122,7 +122,7 @@ public function testPreventExpressCheckoutEmpty()
$this->_event->setControllerAction(null);
$this->_model->execute($this->_observer);
- $this->_event->setControllerAction(new \StdClass());
+ $this->_event->setControllerAction(new \stdClass());
$this->_model->execute($this->_observer);
$expectedActionName = 'realAction';
diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/RefreshCustomerDataTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/RefreshCustomerDataTest.php
index da60f8a3162ac..ca415a8fab5b3 100644
--- a/app/code/Magento/Persistent/Test/Unit/Observer/RefreshCustomerDataTest.php
+++ b/app/code/Magento/Persistent/Test/Unit/Observer/RefreshCustomerDataTest.php
@@ -80,6 +80,9 @@ public function testBeforeStart($result, $callCount)
$this->observer->execute($observerMock);
}
+ /**
+ * @return array
+ */
public function beforeStartDataProvider()
{
return [
diff --git a/app/code/Magento/ProductAlert/Block/Email/Price.php b/app/code/Magento/ProductAlert/Block/Email/Price.php
index 982b0f7f63375..0430a21dc8bfd 100644
--- a/app/code/Magento/ProductAlert/Block/Email/Price.php
+++ b/app/code/Magento/ProductAlert/Block/Email/Price.php
@@ -15,7 +15,7 @@ class Price extends \Magento\ProductAlert\Block\Email\AbstractEmail
/**
* @var string
*/
- protected $_template = 'email/price.phtml';
+ protected $_template = 'Magento_ProductAlert::email/price.phtml';
/**
* Retrieve unsubscribe url for product
diff --git a/app/code/Magento/ProductAlert/Block/Email/Stock.php b/app/code/Magento/ProductAlert/Block/Email/Stock.php
index f424e7d7125c4..d01960b8eb855 100644
--- a/app/code/Magento/ProductAlert/Block/Email/Stock.php
+++ b/app/code/Magento/ProductAlert/Block/Email/Stock.php
@@ -15,7 +15,7 @@ class Stock extends \Magento\ProductAlert\Block\Email\AbstractEmail
/**
* @var string
*/
- protected $_template = 'email/stock.phtml';
+ protected $_template = 'Magento_ProductAlert::email/stock.phtml';
/**
* Retrieve unsubscribe url for product
diff --git a/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php b/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php
index 13bcc2273d93b..815c4f941e683 100644
--- a/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php
+++ b/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php
@@ -55,6 +55,9 @@ public function testGetFilteredContent($contentToFilter, $contentFiltered)
$this->assertEquals($contentFiltered, $this->_block->getFilteredContent($contentToFilter));
}
+ /**
+ * @return array
+ */
public function getFilteredContentDataProvider()
{
return [
diff --git a/app/code/Magento/ProductAlert/Test/Unit/Block/Product/View/StockTest.php b/app/code/Magento/ProductAlert/Test/Unit/Block/Product/View/StockTest.php
index 886ed6eb3fe27..b9f28bde15d07 100644
--- a/app/code/Magento/ProductAlert/Test/Unit/Block/Product/View/StockTest.php
+++ b/app/code/Magento/ProductAlert/Test/Unit/Block/Product/View/StockTest.php
@@ -126,6 +126,9 @@ public function testSetTemplateStockUrlNotAllowed($stockAlertAllowed, $productAv
$this->assertNull($this->_block->getSignupUrl());
}
+ /**
+ * @return array
+ */
public function setTemplateStockUrlNotAllowedDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php
index 287d2b3c8d4f0..d6338eb428657 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php
@@ -92,6 +92,9 @@ public function testCollectTotalsNoShipping($shippingCarrierCode, $shippingMetho
);
}
+ /**
+ * @return array
+ */
public function collectTotalsShippingData()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php
index b1cec90e61e01..1e999cb5e523e 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php
@@ -163,6 +163,9 @@ public function testGet($isVirtual, $getAddressType)
$this->assertEquals($totalsMock, $this->model->get($cartId));
}
+ /**
+ * @return array
+ */
public function getDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartManagementTest.php
index ee0ffd3bcc666..73ed2e65b41a9 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartManagementTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartManagementTest.php
@@ -94,7 +94,7 @@ public function testCreateEmptyCart()
$cartId = 1;
$this->quoteIdMaskMock->expects($this->once())->method('setQuoteId')->with($cartId)->willReturnSelf();
$this->quoteIdMaskMock->expects($this->once())->method('save')->willReturnSelf();
- $this->quoteIdMaskMock->expects($this->once())->method('getMaskedId')->willreturn($maskedCartId);
+ $this->quoteIdMaskMock->expects($this->once())->method('getMaskedId')->willReturn($maskedCartId);
$this->quoteIdMaskFactoryMock->expects($this->once())->method('create')->willReturn($this->quoteIdMaskMock);
$this->quoteManagementMock->expects($this->once())->method('createEmptyCart')->willReturn($cartId);
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Product/Plugin/UpdateQuoteItemsTest.php b/app/code/Magento/Quote/Test/Unit/Model/Product/Plugin/UpdateQuoteItemsTest.php
index 38f303dd23582..cd7a54455a994 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Product/Plugin/UpdateQuoteItemsTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Product/Plugin/UpdateQuoteItemsTest.php
@@ -49,6 +49,9 @@ public function testAfterUpdate($originalPrice, $newPrice, $callMethod, $tierPri
$this->assertEquals($result, $productResourceMock);
}
+ /**
+ * @return array
+ */
public function aroundUpdateDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/SubtotalTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/SubtotalTest.php
index 78a87b59d9f62..c4a8081fbb8fa 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/SubtotalTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/SubtotalTest.php
@@ -49,6 +49,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function collectDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/TotalTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/TotalTest.php
index f884981424d65..e1971fa9833a3 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/TotalTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/TotalTest.php
@@ -49,6 +49,9 @@ public function testSetTotalAmount($code, $amount, $storedCode)
$this->assertSame($this->model, $result);
}
+ /**
+ * @return array
+ */
public function setTotalAmountDataProvider()
{
return [
@@ -80,6 +83,9 @@ public function testSetBaseTotalAmount($code, $amount, $storedCode)
$this->assertSame($this->model, $result);
}
+ /**
+ * @return array
+ */
public function setBaseTotalAmountDataProvider()
{
return [
@@ -111,6 +117,9 @@ public function testAddTotalAmount($initialAmount, $delta, $updatedAmount)
$this->assertEquals($updatedAmount, $this->model->getTotalAmount($code));
}
+ /**
+ * @return array
+ */
public function addTotalAmountDataProvider()
{
return [
@@ -142,6 +151,9 @@ public function testAddBaseTotalAmount($initialAmount, $delta, $updatedAmount)
$this->assertEquals($updatedAmount, $this->model->getBaseTotalAmount($code));
}
+ /**
+ * @return array
+ */
public function addBaseTotalAmountDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RelatedProductsTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RelatedProductsTest.php
index a73a241922a9c..8be4479598907 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RelatedProductsTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/RelatedProductsTest.php
@@ -61,6 +61,9 @@ public function testGetRelatedProductIds($optionValue, $productId, $expectedResu
*
* @return array
*/
+ /**
+ * @return array
+ */
public function getRelatedProductIdsDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
index 03c3e32c20cb9..af47f6276705b 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
@@ -130,6 +130,9 @@ public function testUpdateNotQtyDecimal($qty, $expectedQty)
$this->assertEquals($result, $this->object);
}
+ /**
+ * @return array
+ */
public function qtyProvider()
{
return [
@@ -142,6 +145,9 @@ public function qtyProvider()
];
}
+ /**
+ * @return array
+ */
public function qtyProviderDecimal()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php
index 1da659f6b59b7..abc56d194456d 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php
@@ -846,6 +846,12 @@ public function testSetOptionsWithNull()
$this->assertEquals($this->model, $this->model->setOptions(null));
}
+ /**
+ * @param $optionCode
+ * @param array $optionData
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function createOptionMock($optionCode, $optionData = [])
{
$optionMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Item\Option::class)
diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php
index c0056e2c8338f..6f5e5937a32c8 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php
@@ -615,6 +615,9 @@ public function testGetAddressById($addressId, $expected)
$this->assertEquals((bool)$expected, (bool)$result);
}
+ /**
+ * @return array
+ */
public static function dataProviderGetAddress()
{
return [
@@ -656,6 +659,9 @@ public function testGetAddressByCustomerAddressId($isDeleted, $customerAddressId
$this->assertEquals((bool)$expected, (bool)$result);
}
+ /**
+ * @return array
+ */
public static function dataProviderGetAddressByCustomer()
{
return [
@@ -702,6 +708,9 @@ public function testGetShippingAddressByCustomerAddressId($isDeleted, $addressTy
$this->assertEquals($expected, (bool)$result);
}
+ /**
+ * @return array
+ */
public static function dataProviderShippingAddress()
{
return [
@@ -1204,6 +1213,9 @@ public function testReserveOrderId($isReservedOrderIdExist, $reservedOrderId)
$this->assertEquals($reservedOrderId, $this->quote->getReservedOrderId());
}
+ /**
+ * @return array
+ */
public function reservedOrderIdDataProvider()
{
return [
diff --git a/app/code/Magento/Quote/Test/Unit/Observer/Backend/CustomerQuoteObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/Backend/CustomerQuoteObserverTest.php
index d10e1531d4ec3..7bbf24c2b6ef3 100644
--- a/app/code/Magento/Quote/Test/Unit/Observer/Backend/CustomerQuoteObserverTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Observer/Backend/CustomerQuoteObserverTest.php
@@ -160,6 +160,9 @@ public function testDispatch($isWebsiteScope, $websites)
$this->customerQuote->execute($this->observerMock);
}
+ /**
+ * @return array
+ */
public function dispatchDataProvider()
{
return [
diff --git a/app/code/Magento/ReleaseNotification/Controller/Adminhtml/Notification/MarkUserNotified.php b/app/code/Magento/ReleaseNotification/Controller/Adminhtml/Notification/MarkUserNotified.php
index 572fb7695b20f..56f836fff9522 100644
--- a/app/code/Magento/ReleaseNotification/Controller/Adminhtml/Notification/MarkUserNotified.php
+++ b/app/code/Magento/ReleaseNotification/Controller/Adminhtml/Notification/MarkUserNotified.php
@@ -85,6 +85,9 @@ public function execute()
return $resultJson->setData($responseContent);
}
+ /**
+ * @return bool
+ */
protected function _isAllowed()
{
return parent::_isAllowed();
diff --git a/app/code/Magento/ReleaseNotification/Test/Unit/Model/Condition/CanViewNotificationTest.php b/app/code/Magento/ReleaseNotification/Test/Unit/Model/Condition/CanViewNotificationTest.php
index 3ec00697507c1..813c5f28bf4d9 100644
--- a/app/code/Magento/ReleaseNotification/Test/Unit/Model/Condition/CanViewNotificationTest.php
+++ b/app/code/Magento/ReleaseNotification/Test/Unit/Model/Condition/CanViewNotificationTest.php
@@ -113,6 +113,9 @@ public function testIsVisible($expected, $version, $lastViewVersion)
$this->assertEquals($expected, $this->canViewNotification->isVisible([]));
}
+ /**
+ * @return array
+ */
public function isVisibleProvider()
{
return [
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Product/Viewed.php b/app/code/Magento/Reports/Block/Adminhtml/Product/Viewed.php
index fc4cffbdca408..f901b32d8b12f 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Product/Viewed.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Product/Viewed.php
@@ -17,7 +17,7 @@ class Viewed extends \Magento\Backend\Block\Widget\Grid\Container
/**
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* @return void
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Bestsellers.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Bestsellers.php
index d70930d2395ae..b773184408a7f 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Bestsellers.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Bestsellers.php
@@ -19,7 +19,7 @@ class Bestsellers extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Coupons.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Coupons.php
index b8f71158877bb..fe85af58b34f6 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Coupons.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Coupons.php
@@ -19,7 +19,7 @@ class Coupons extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Invoiced.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Invoiced.php
index c96483e33ebe5..57594a11bd997 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Invoiced.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Invoiced.php
@@ -19,7 +19,7 @@ class Invoiced extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Refunded.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Refunded.php
index 7ff80f62f6bee..994b29e6eb0dd 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Refunded.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Refunded.php
@@ -19,7 +19,7 @@ class Refunded extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales.php
index 5abea45e657d7..64375ace3e94d 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales.php
@@ -19,7 +19,7 @@ class Sales extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Shipping.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Shipping.php
index 44dd4521c7bbe..e4dbdc2737745 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Shipping.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Shipping.php
@@ -19,7 +19,7 @@ class Shipping extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax.php
index 38de08314d257..fa9e63745a87d 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax.php
@@ -19,7 +19,7 @@ class Tax extends \Magento\Backend\Block\Widget\Grid\Container
*
* @var string
*/
- protected $_template = 'report/grid/container.phtml';
+ protected $_template = 'Magento_Reports::report/grid/container.phtml';
/**
* {@inheritdoc}
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php b/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php
index 28f2011de3365..1ca76cb1cf95f 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php
@@ -18,7 +18,7 @@ class Wishlist extends \Magento\Backend\Block\Template
*
* @var string
*/
- protected $_template = 'report/wishlist.phtml';
+ protected $_template = 'Magento_Reports::report/wishlist.phtml';
/**
* Reports wishlist collection factory
diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php
index 0841388252905..dbf0a79bc42ff 100644
--- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php
+++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php
@@ -17,7 +17,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
/**
* @var string
*/
- protected $_template = 'rating/form.phtml';
+ protected $_template = 'Magento_Review::rating/form.phtml';
/**
* Session
diff --git a/app/code/Magento/Review/Block/Adminhtml/Rss/Grid/Link.php b/app/code/Magento/Review/Block/Adminhtml/Rss/Grid/Link.php
index 5d2ec9fc186ca..def0e896fc95f 100644
--- a/app/code/Magento/Review/Block/Adminhtml/Rss/Grid/Link.php
+++ b/app/code/Magento/Review/Block/Adminhtml/Rss/Grid/Link.php
@@ -16,7 +16,7 @@ class Link extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'rss/grid/link.phtml';
+ protected $_template = 'Magento_Review::rss/grid/link.phtml';
/**
* @var \Magento\Framework\App\Rss\UrlBuilderInterface
diff --git a/app/code/Magento/Review/Block/Customer/Recent.php b/app/code/Magento/Review/Block/Customer/Recent.php
index 8f593f5695812..5c7f1ec2c0dad 100644
--- a/app/code/Magento/Review/Block/Customer/Recent.php
+++ b/app/code/Magento/Review/Block/Customer/Recent.php
@@ -20,7 +20,7 @@ class Recent extends \Magento\Framework\View\Element\Template
*
* @var string
*/
- protected $_template = 'customer/list.phtml';
+ protected $_template = 'Magento_Review::customer/list.phtml';
/**
* Product reviews collection
diff --git a/app/code/Magento/Review/Block/Customer/View.php b/app/code/Magento/Review/Block/Customer/View.php
index b7dfd4b969a9d..237b972f16573 100644
--- a/app/code/Magento/Review/Block/Customer/View.php
+++ b/app/code/Magento/Review/Block/Customer/View.php
@@ -23,7 +23,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct
*
* @var string
*/
- protected $_template = 'customer/view.phtml';
+ protected $_template = 'Magento_Review::customer/view.phtml';
/**
* Catalog product model
diff --git a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php
index de871d9061428..0ce4f436ae704 100644
--- a/app/code/Magento/Review/Block/Rating/Entity/Detailed.php
+++ b/app/code/Magento/Review/Block/Rating/Entity/Detailed.php
@@ -15,7 +15,7 @@ class Detailed extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'detailed.phtml';
+ protected $_template = 'Magento_Review::detailed.phtml';
/**
* @var \Magento\Review\Model\RatingFactory
diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php
index e2d0355671688..95b7176b48c44 100644
--- a/app/code/Magento/Review/Block/View.php
+++ b/app/code/Magento/Review/Block/View.php
@@ -19,7 +19,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct
*
* @var string
*/
- protected $_template = 'view.phtml';
+ protected $_template = 'Magento_Review::view.phtml';
/**
* Rating option model
diff --git a/app/code/Magento/Review/Test/Unit/Block/FormTest.php b/app/code/Magento/Review/Test/Unit/Block/FormTest.php
index 2184385035c8d..1fd38551702ab 100644
--- a/app/code/Magento/Review/Test/Unit/Block/FormTest.php
+++ b/app/code/Magento/Review/Test/Unit/Block/FormTest.php
@@ -136,6 +136,9 @@ public function testGetAction($isSecure, $actionUrl, $productId)
$this->assertEquals($actionUrl . '/id/' . $productId, $this->object->getAction());
}
+ /**
+ * @return array
+ */
public function getActionDataProvider()
{
return [
diff --git a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php
index 243b4e8389923..01868242d0e0c 100644
--- a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php
+++ b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php
@@ -204,6 +204,9 @@ public function testGetProductReviewUrl($isSecure, $actionUrl, $productId)
$this->assertEquals($actionUrl . '/id/' . $productId, $this->block->getProductReviewUrl());
}
+ /**
+ * @return array
+ */
public function getProductReviewUrlDataProvider()
{
return [
diff --git a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php
index b3d2cec648dc6..36cbe455fa890 100644
--- a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php
+++ b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php
@@ -147,6 +147,9 @@ public function testAddEntityFilter(
$this->model->addEntityFilter($entity, $pkValue);
}
+ /**
+ * @return array
+ */
public function addEntityFilterDataProvider()
{
return [
diff --git a/app/code/Magento/Rss/Block/Feeds.php b/app/code/Magento/Rss/Block/Feeds.php
index 2e88d25c02891..86998f87f5c17 100644
--- a/app/code/Magento/Rss/Block/Feeds.php
+++ b/app/code/Magento/Rss/Block/Feeds.php
@@ -16,7 +16,7 @@ class Feeds extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'feeds.phtml';
+ protected $_template = 'Magento_Rss::feeds.phtml';
/**
* @var \Magento\Framework\App\Rss\RssManagerInterface
diff --git a/app/code/Magento/Rule/Model/Condition/Sql/Builder.php b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php
index 31592bf121d0f..a9ee75bb393f9 100644
--- a/app/code/Magento/Rule/Model/Condition/Sql/Builder.php
+++ b/app/code/Magento/Rule/Model/Condition/Sql/Builder.php
@@ -127,9 +127,10 @@ protected function _joinTablesToCollection(
*
* @param AbstractCondition $condition
* @param string $value
- * @param bool $isDefaultStoreUsed
+ * @param bool $isDefaultStoreUsed no longer used because caused an issue about not existing table alias
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getMappedSqlCondition(AbstractCondition $condition, $value = '', $isDefaultStoreUsed = true)
{
@@ -147,12 +148,6 @@ protected function _getMappedSqlCondition(AbstractCondition $condition, $value =
}
$defaultValue = 0;
- // Check if attribute has a table with default value and add it to the query
- if ($this->canAttributeHaveDefaultValue($condition->getAttribute(), $isDefaultStoreUsed)) {
- $defaultField = 'at_' . $condition->getAttribute() . '_default.value';
- $defaultValue = $this->_connection->quoteIdentifier($defaultField);
- }
-
$sql = str_replace(
':field',
$this->_connection->getIfNullSql($this->_connection->quoteIdentifier($argument), $defaultValue),
@@ -204,45 +199,10 @@ public function attachConditionToCollection(
) {
$this->_connection = $collection->getResource()->getConnection();
$this->_joinTablesToCollection($collection, $combine);
- $isDefaultStoreUsed = $this->checkIsDefaultStoreUsed($collection);
- $whereExpression = (string)$this->_getMappedSqlCombination($combine, '', $isDefaultStoreUsed);
+ $whereExpression = (string)$this->_getMappedSqlCombination($combine);
if (!empty($whereExpression)) {
// Select ::where method adds braces even on empty expression
$collection->getSelect()->where($whereExpression);
}
}
-
- /**
- * Check is default store used
- *
- * @param AbstractCollection $collection
- * @return bool
- */
- private function checkIsDefaultStoreUsed(AbstractCollection $collection): bool
- {
- return (int)$collection->getStoreId() === (int)$collection->getDefaultStoreId();
- }
-
- /**
- * Check if attribute can have default value
- *
- * @param string $attributeCode
- * @param bool $isDefaultStoreUsed
- * @return bool
- */
- private function canAttributeHaveDefaultValue(string $attributeCode, bool $isDefaultStoreUsed): bool
- {
- if ($isDefaultStoreUsed) {
- return false;
- }
-
- try {
- $attribute = $this->attributeRepository->get(Product::ENTITY, $attributeCode);
- } catch (NoSuchEntityException $e) {
- // It's not exceptional case as we want to check if we have such attribute or not
- return false;
- }
-
- return !$attribute->isScopeGlobal();
- }
}
diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php
index 1201ba92464d9..52653197e3981 100644
--- a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php
+++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php
@@ -40,6 +40,9 @@ public function testGetMappedSqlField()
$this->assertEquals('category_ids', $this->_condition->getMappedSqlField());
}
+ /**
+ * @return array
+ */
public function validateAttributeDataProvider()
{
return [
@@ -146,6 +149,9 @@ public function testValidate($existingValue, $operator, $valueForValidate, $expe
);
}
+ /**
+ * @return array
+ */
public function validateAttributeArrayInputTypeDataProvider()
{
return [
diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php
index daf7b1462c722..0a2767a94668a 100644
--- a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php
+++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php
@@ -61,12 +61,6 @@ public function testAttachConditionToCollection()
$collection->expects($this->any())
->method('getSelect')
->will($this->returnValue($select));
- $collection->expects($this->once())
- ->method('getStoreId')
- ->willReturn(1);
- $collection->expects($this->once())
- ->method('getDefaultStoreId')
- ->willReturn(1);
$resource->expects($this->once())
->method('getConnection')
diff --git a/app/code/Magento/Rule/Test/Unit/Model/ResourceModel/Rule/Collection/AbstractCollectionTest.php b/app/code/Magento/Rule/Test/Unit/Model/ResourceModel/Rule/Collection/AbstractCollectionTest.php
index 644d10ad75fe6..c4e7a591212c5 100644
--- a/app/code/Magento/Rule/Test/Unit/Model/ResourceModel/Rule/Collection/AbstractCollectionTest.php
+++ b/app/code/Magento/Rule/Test/Unit/Model/ResourceModel/Rule/Collection/AbstractCollectionTest.php
@@ -91,6 +91,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function addWebsitesToResultDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php
index 2d23bca110ae2..5594811a30feb 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php
@@ -19,7 +19,7 @@ class Form extends \Magento\Sales\Block\Adminhtml\Order\Create\Form\Address
*
* @var string
*/
- protected $_template = 'order/address/form.phtml';
+ protected $_template = 'Magento_Sales::order/address/form.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php
index 5a29d058bf32f..c9c4ced479983 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php
@@ -189,6 +189,7 @@ public function getOrderDataJson()
$data['shipping_method_reseted'] = !(bool)$this->getQuote()->getShippingAddress()->getShippingMethod();
$data['payment_method'] = $this->getQuote()->getPayment()->getMethod();
}
+ $data['quote_id'] = $this->_sessionQuote->getQuoteId();
return $this->_jsonEncoder->encode($data);
}
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php
index eb437915ad668..cf9f8a44dee27 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php
@@ -20,7 +20,7 @@ class Grandtotal extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defa
*
* @var string
*/
- protected $_template = 'order/create/totals/grandtotal.phtml';
+ protected $_template = 'Magento_Sales::order/create/totals/grandtotal.phtml';
/**
* Tax config
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php
index 9225d8c2e5f68..34a9ed8070e26 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php
@@ -20,7 +20,7 @@ class Shipping extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defaul
*
* @var string
*/
- protected $_template = 'order/create/totals/shipping.phtml';
+ protected $_template = 'Magento_Sales::order/create/totals/shipping.phtml';
/**
* Tax config
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php
index 1807c587c6893..e4463cd612a2c 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php
@@ -20,7 +20,7 @@ class Subtotal extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defaul
*
* @var string
*/
- protected $_template = 'order/create/totals/subtotal.phtml';
+ protected $_template = 'Magento_Sales::order/create/totals/subtotal.phtml';
/**
* Tax config
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Tax.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Tax.php
index d3da37c3f1bf8..207a4eca60213 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Tax.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Tax.php
@@ -18,5 +18,5 @@ class Tax extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\DefaultTota
*
* @var string
*/
- protected $_template = 'order/create/totals/tax.phtml';
+ protected $_template = 'Magento_Sales::order/create/totals/tax.phtml';
}
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Details.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Details.php
index 5c3a7fce805cc..261f4b0cfd12a 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Details.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Details.php
@@ -14,5 +14,5 @@ class Details extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/details.phtml';
+ protected $_template = 'Magento_Sales::order/details.phtml';
}
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Form.php
index 82c3effcab62d..6c06e9d624c81 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Form.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Form.php
@@ -17,5 +17,5 @@ class Form extends \Magento\Backend\Block\Template
*
* @var string
*/
- protected $_template = 'order/view/form.phtml';
+ protected $_template = 'Magento_Sales::order/view/form.phtml';
}
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php
index 5489a0b2e513f..64b53d10d4af6 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php
@@ -18,7 +18,7 @@ class History extends \Magento\Backend\Block\Template implements \Magento\Backen
*
* @var string
*/
- protected $_template = 'order/view/tab/history.phtml';
+ protected $_template = 'Magento_Sales::order/view/tab/history.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Rss/Order/Grid/Link.php b/app/code/Magento/Sales/Block/Adminhtml/Rss/Order/Grid/Link.php
index fbb78970a4de0..512539824da20 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Rss/Order/Grid/Link.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Rss/Order/Grid/Link.php
@@ -14,7 +14,7 @@ class Link extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'rss/order/grid/link.phtml';
+ protected $_template = 'Magento_Sales::rss/order/grid/link.phtml';
/**
* @var \Magento\Framework\App\Rss\UrlBuilderInterface
diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo.php b/app/code/Magento/Sales/Block/Order/Creditmemo.php
index ae9a9a722291a..a32b2dbc74bde 100644
--- a/app/code/Magento/Sales/Block/Order/Creditmemo.php
+++ b/app/code/Magento/Sales/Block/Order/Creditmemo.php
@@ -19,7 +19,7 @@ class Creditmemo extends \Magento\Sales\Block\Order\Creditmemo\Items
/**
* @var string
*/
- protected $_template = 'order/creditmemo.phtml';
+ protected $_template = 'Magento_Sales::order/creditmemo.phtml';
/**
* @var \Magento\Framework\App\Http\Context
diff --git a/app/code/Magento/Sales/Block/Order/History.php b/app/code/Magento/Sales/Block/Order/History.php
index 034df4edb5b49..80925f66fc83d 100644
--- a/app/code/Magento/Sales/Block/Order/History.php
+++ b/app/code/Magento/Sales/Block/Order/History.php
@@ -19,7 +19,7 @@ class History extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/history.phtml';
+ protected $_template = 'Magento_Sales::order/history.phtml';
/**
* @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactory
diff --git a/app/code/Magento/Sales/Block/Order/Info/Buttons.php b/app/code/Magento/Sales/Block/Order/Info/Buttons.php
index a27b55cd8543f..18e79f6a76ecf 100644
--- a/app/code/Magento/Sales/Block/Order/Info/Buttons.php
+++ b/app/code/Magento/Sales/Block/Order/Info/Buttons.php
@@ -20,7 +20,7 @@ class Buttons extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/info/buttons.phtml';
+ protected $_template = 'Magento_Sales::order/info/buttons.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Sales/Block/Order/Info/Buttons/Rss.php b/app/code/Magento/Sales/Block/Order/Info/Buttons/Rss.php
index 77e20eaa8d07b..2b84b8f1444b6 100644
--- a/app/code/Magento/Sales/Block/Order/Info/Buttons/Rss.php
+++ b/app/code/Magento/Sales/Block/Order/Info/Buttons/Rss.php
@@ -16,7 +16,7 @@ class Rss extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/info/buttons/rss.phtml';
+ protected $_template = 'Magento_Sales::order/info/buttons/rss.phtml';
/**
* @var \Magento\Sales\Model\OrderFactory
diff --git a/app/code/Magento/Sales/Block/Order/Invoice.php b/app/code/Magento/Sales/Block/Order/Invoice.php
index 2d8448ea5bc98..24ddf4bac7696 100644
--- a/app/code/Magento/Sales/Block/Order/Invoice.php
+++ b/app/code/Magento/Sales/Block/Order/Invoice.php
@@ -18,7 +18,7 @@ class Invoice extends \Magento\Sales\Block\Order\Invoice\Items
/**
* @var string
*/
- protected $_template = 'order/invoice.phtml';
+ protected $_template = 'Magento_Sales::order/invoice.phtml';
/**
* @var \Magento\Framework\App\Http\Context
diff --git a/app/code/Magento/Sales/Block/Order/View.php b/app/code/Magento/Sales/Block/Order/View.php
index 870e2e15ab7b3..03d1340e0f690 100644
--- a/app/code/Magento/Sales/Block/Order/View.php
+++ b/app/code/Magento/Sales/Block/Order/View.php
@@ -18,7 +18,7 @@ class View extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/view.phtml';
+ protected $_template = 'Magento_Sales::order/view.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Unhold.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Unhold.php
index 752ab088689c8..fa9676856a442 100644
--- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Unhold.php
+++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Unhold.php
@@ -32,7 +32,7 @@ public function execute()
if (!$order->canUnhold()) {
throw new \Magento\Framework\Exception\LocalizedException(__('Can\'t unhold order.'));
}
- $this->orderManagement->unhold($order->getEntityId());
+ $this->orderManagement->unHold($order->getEntityId());
$this->messageManager->addSuccess(__('You released the order from holding status.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
diff --git a/app/code/Magento/Sales/Model/EmailSenderHandler.php b/app/code/Magento/Sales/Model/EmailSenderHandler.php
index 73d4eacdd1fc8..5355f180d2d90 100644
--- a/app/code/Magento/Sales/Model/EmailSenderHandler.php
+++ b/app/code/Magento/Sales/Model/EmailSenderHandler.php
@@ -5,6 +5,8 @@
*/
namespace Magento\Sales\Model;
+use Magento\Sales\Model\Order\Email\Container\IdentityInterface;
+
/**
* Sales emails sending
*
@@ -41,22 +43,41 @@ class EmailSenderHandler
*/
protected $globalConfig;
+ /**
+ * @var IdentityInterface
+ */
+ private $identityContainer;
+
+ /**
+ * @var \Magento\Store\Model\StoreManagerInterface
+ */
+ private $storeManager;
+
/**
* @param \Magento\Sales\Model\Order\Email\Sender $emailSender
* @param \Magento\Sales\Model\ResourceModel\EntityAbstract $entityResource
* @param \Magento\Sales\Model\ResourceModel\Collection\AbstractCollection $entityCollection
* @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
+ * @param IdentityInterface|null $identityContainer
+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
*/
public function __construct(
\Magento\Sales\Model\Order\Email\Sender $emailSender,
\Magento\Sales\Model\ResourceModel\EntityAbstract $entityResource,
\Magento\Sales\Model\ResourceModel\Collection\AbstractCollection $entityCollection,
- \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
+ \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig,
+ IdentityInterface $identityContainer = null,
+ \Magento\Store\Model\StoreManagerInterface $storeManager = null
) {
$this->emailSender = $emailSender;
$this->entityResource = $entityResource;
$this->entityCollection = $entityCollection;
$this->globalConfig = $globalConfig;
+
+ $this->identityContainer = $identityContainer ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Sales\Model\Order\Email\Container\NullIdentity::class);
+ $this->storeManager = $storeManager ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Store\Model\StoreManagerInterface::class);
}
/**
@@ -69,14 +90,50 @@ public function sendEmails()
$this->entityCollection->addFieldToFilter('send_email', ['eq' => 1]);
$this->entityCollection->addFieldToFilter('email_sent', ['null' => true]);
- /** @var \Magento\Sales\Model\AbstractModel $item */
- foreach ($this->entityCollection->getItems() as $item) {
- if ($this->emailSender->send($item, true)) {
- $this->entityResource->save(
- $item->setEmailSent(true)
- );
+ /** @var \Magento\Store\Api\Data\StoreInterface[] $stores */
+ $stores = $this->getStores(clone $this->entityCollection);
+
+ /** @var \Magento\Store\Model\Store $store */
+ foreach ($stores as $store) {
+ $this->identityContainer->setStore($store);
+ if (!$this->identityContainer->isEnabled()) {
+ continue;
+ }
+ $entityCollection = clone $this->entityCollection;
+ $entityCollection->addFieldToFilter('store_id', $store->getId());
+
+ /** @var \Magento\Sales\Model\AbstractModel $item */
+ foreach ($entityCollection->getItems() as $item) {
+ if ($this->emailSender->send($item, true)) {
+ $this->entityResource->save(
+ $item->setEmailSent(true)
+ );
+ }
}
}
}
}
+
+ /**
+ * Get stores for given entities.
+ *
+ * @param ResourceModel\Collection\AbstractCollection $entityCollection
+ * @return \Magento\Store\Api\Data\StoreInterface[]
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getStores(
+ \Magento\Sales\Model\ResourceModel\Collection\AbstractCollection $entityCollection
+ ): array {
+ $stores = [];
+
+ $entityCollection->addAttributeToSelect('store_id')->getSelect()->group('store_id');
+ /** @var \Magento\Sales\Model\EntityInterface $item */
+ foreach ($entityCollection->getItems() as $item) {
+ /** @var \Magento\Store\Model\StoreManagerInterface $store */
+ $store = $this->storeManager->getStore($item->getStoreId());
+ $stores[$item->getStoreId()] = $store;
+ }
+
+ return $stores;
+ }
}
diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php
index 85443ee7f4f11..6de0fe4459fa6 100644
--- a/app/code/Magento/Sales/Model/Order.php
+++ b/app/code/Magento/Sales/Model/Order.php
@@ -1008,8 +1008,24 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified =
* @param string $comment
* @param bool|string $status
* @return OrderStatusHistoryInterface
+ * @deprecated
+ * @see addCommentToStatusHistory
*/
public function addStatusHistoryComment($comment, $status = false)
+ {
+ return $this->addCommentToStatusHistory($comment, $status, false);
+ }
+
+ /**
+ * Add a comment to order status history
+ * Different or default status may be specified
+ *
+ * @param string $comment
+ * @param bool|string $status
+ * @param bool $isVisibleOnFront
+ * @return OrderStatusHistoryInterface
+ */
+ public function addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false)
{
if (false === $status) {
$status = $this->getStatus();
@@ -1024,6 +1040,8 @@ public function addStatusHistoryComment($comment, $status = false)
$comment
)->setEntityName(
$this->entityType
+ )->setIsVisibleOnFront(
+ $isVisibleOnFront
);
$this->addStatusHistory($history);
return $history;
diff --git a/app/code/Magento/Sales/Model/Order/Email/Container/IdentityInterface.php b/app/code/Magento/Sales/Model/Order/Email/Container/IdentityInterface.php
index 55ce24e23e1ec..1d481a8acee65 100644
--- a/app/code/Magento/Sales/Model/Order/Email/Container/IdentityInterface.php
+++ b/app/code/Magento/Sales/Model/Order/Email/Container/IdentityInterface.php
@@ -3,7 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-namespace Magento\Sales\Model\Order\Email\Container;
+
+namespace Magento\Sales\Model\Order\Email\Container;
use Magento\Store\Model\Store;
diff --git a/app/code/Magento/Sales/Model/Order/Email/Container/NullIdentity.php b/app/code/Magento/Sales/Model/Order/Email/Container/NullIdentity.php
new file mode 100644
index 0000000000000..22348aa9ee2f6
--- /dev/null
+++ b/app/code/Magento/Sales/Model/Order/Email/Container/NullIdentity.php
@@ -0,0 +1,59 @@
+getBillingAddress(),
[]
);
- $addresses = $order->getAddresses();
- foreach ($addresses as $address) {
- $addressData = $this->objectCopyService->copyFieldsetToTarget(
- 'order_address',
- 'to_customer_address',
- $address,
- []
- );
- /** @var AddressInterface $customerAddress */
- $customerAddress = $this->addressFactory->create(['data' => $addressData]);
- switch ($address->getAddressType()) {
- case QuoteAddress::ADDRESS_TYPE_BILLING:
- $customerAddress->setIsDefaultBilling(true);
- break;
- case QuoteAddress::ADDRESS_TYPE_SHIPPING:
- $customerAddress->setIsDefaultShipping(true);
- break;
+
+ $processedAddressData = [];
+ $customerAddresses = [];
+ foreach ($order->getAddresses() as $orderAddress) {
+ $addressData = $this->objectCopyService
+ ->copyFieldsetToTarget('order_address', 'to_customer_address', $orderAddress, []);
+
+ $index = array_search($addressData, $processedAddressData);
+ if ($index === false) {
+ // create new customer address only if it is unique
+ $customerAddress = $this->addressFactory->create(['data' => $addressData]);
+ $customerAddress->setIsDefaultBilling(false);
+ $customerAddress->setIsDefaultBilling(false);
+ if (is_string($orderAddress->getRegion())) {
+ /** @var RegionInterface $region */
+ $region = $this->regionFactory->create();
+ $region->setRegion($orderAddress->getRegion());
+ $region->setRegionCode($orderAddress->getRegionCode());
+ $region->setRegionId($orderAddress->getRegionId());
+ $customerAddress->setRegion($region);
+ }
+
+ $processedAddressData[] = $addressData;
+ $customerAddresses[] = $customerAddress;
+ $index = count($processedAddressData) - 1;
}
- if (is_string($address->getRegion())) {
- /** @var RegionInterface $region */
- $region = $this->regionFactory->create();
- $region->setRegion($address->getRegion());
- $region->setRegionCode($address->getRegionCode());
- $region->setRegionId($address->getRegionId());
- $customerAddress->setRegion($region);
+ $customerAddress = $customerAddresses[$index];
+ // make sure that address type flags from equal addresses are stored in one resulted address
+ if ($orderAddress->getAddressType() == OrderAddress::TYPE_BILLING) {
+ $customerAddress->setIsDefaultBilling(true);
+ }
+ if ($orderAddress->getAddressType() == OrderAddress::TYPE_SHIPPING) {
+ $customerAddress->setIsDefaultShipping(true);
}
- $customerData['addresses'][] = $customerAddress;
}
+ $customerData['addresses'] = $customerAddresses;
+
return $this->customerFactory->create(['data' => $customerData]);
}
}
diff --git a/app/code/Magento/Sales/Model/ResourceModel/Grid.php b/app/code/Magento/Sales/Model/ResourceModel/Grid.php
index b3425baf1e727..42e5d92fb00cc 100644
--- a/app/code/Magento/Sales/Model/ResourceModel/Grid.php
+++ b/app/code/Magento/Sales/Model/ResourceModel/Grid.php
@@ -45,6 +45,11 @@ class Grid extends AbstractGrid
*/
private $notSyncedDataProvider;
+ /**
+ * Order grid rows batch size
+ */
+ const BATCH_SIZE = 100;
+
/**
* @param Context $context
* @param string $mainTableName
@@ -104,25 +109,20 @@ public function refresh($value, $field = null)
*
* Only orders created/updated since the last method call will be added.
*
- * @return \Zend_Db_Statement_Interface
+ * @return void
*/
public function refreshBySchedule()
{
- $select = $this->getGridOriginSelect()
- ->where(
- $this->mainTableName . '.entity_id IN (?)',
- $this->notSyncedDataProvider->getIds($this->mainTableName, $this->gridTableName)
+ $notSyncedIds = $this->notSyncedDataProvider->getIds($this->mainTableName, $this->gridTableName);
+ foreach (array_chunk($notSyncedIds, self::BATCH_SIZE) as $bunch) {
+ $select = $this->getGridOriginSelect()->where($this->mainTableName . '.entity_id IN (?)', $bunch);
+ $fetchResult = $this->getConnection()->fetchAll($select);
+ $this->getConnection()->insertOnDuplicate(
+ $this->getTable($this->gridTableName),
+ $fetchResult,
+ array_keys($this->columns)
);
-
- return $this->getConnection()->query(
- $this->getConnection()
- ->insertFromSelect(
- $select,
- $this->getTable($this->gridTableName),
- array_keys($this->columns),
- AdapterInterface::INSERT_ON_DUPLICATE
- )
- );
+ }
}
/**
diff --git a/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php b/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php
index 9b0e53347e21a..6c7d983f066e5 100644
--- a/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php
+++ b/app/code/Magento/Sales/Model/ResourceModel/GridInterface.php
@@ -29,7 +29,7 @@ public function refresh($value, $field = null);
*
* Only rows created/updated since the last method call should be added.
*
- * @return \Zend_Db_Statement_Interface
+ * @return void
*/
public function refreshBySchedule();
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php
new file mode 100644
index 0000000000000..4cbd30b1392fa
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php
@@ -0,0 +1,197 @@
+getMockBuilder(Context::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->quoteSession = $this->getMockBuilder(QuoteSession::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getCustomerId', 'getQuoteId', 'getStoreId', 'getStore', 'getQuote'])
+ ->getMock();
+ /** @var Create|MockObject $create */
+ $create = $this->getMockBuilder(Create::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ /** @var PriceCurrencyInterface|MockObject $priceCurrency */
+ $priceCurrency = $this->getMockForAbstractClass(PriceCurrencyInterface::class);
+ /** @var EncoderInterface|MockObject $encoder */
+ $encoder = $this->getMockForAbstractClass(EncoderInterface::class);
+ $encoder->method('encode')
+ ->willReturnCallback(function ($param) {
+ return json_encode($param);
+ });
+ /** @var FormFactory|MockObject $formFactory */
+ $formFactory = $this->getMockBuilder(FormFactory::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->customerRepository = $this->getMockForAbstractClass(CustomerRepositoryInterface::class);
+
+ $this->localeCurrency = $this->getMockForAbstractClass(CurrencyInterface::class);
+ /** @var Mapper|MockObject $addressMapper */
+ $addressMapper = $this->getMockBuilder(Mapper::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->block = new Form(
+ $context,
+ $this->quoteSession,
+ $create,
+ $priceCurrency,
+ $encoder,
+ $formFactory,
+ $this->customerRepository,
+ $this->localeCurrency,
+ $addressMapper
+ );
+ }
+
+ /**
+ * Checks if order contains all needed data.
+ */
+ public function testGetOrderDataJson()
+ {
+ $customerId = 1;
+ $storeId = 1;
+ $quoteId = 2;
+ $expected = [
+ 'customer_id' => $customerId,
+ 'addresses' => [],
+ 'store_id' => $storeId,
+ 'currency_symbol' => '$',
+ 'shipping_method_reseted' => false,
+ 'payment_method' => 'free',
+ 'quote_id' => $quoteId
+ ];
+
+ $this->quoteSession->method('getCustomerId')
+ ->willReturn($customerId);
+ $this->quoteSession->method('getStoreId')
+ ->willReturn($storeId);
+ $this->quoteSession->method('getQuoteId')
+ ->willReturn($quoteId);
+
+ $customer = $this->getMockBuilder(CustomerInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $customer->method('getAddresses')
+ ->willReturn([]);
+ $this->customerRepository->method('getById')
+ ->with($customerId)
+ ->willReturn($customer);
+
+ $this->withCurrencySymbol('$');
+
+ $this->withQuote();
+
+ self::assertEquals($expected, json_decode($this->block->getOrderDataJson(), true));
+ }
+
+ /**
+ * Configures mock object for currency.
+ *
+ * @param string $symbol
+ */
+ private function withCurrencySymbol(string $symbol)
+ {
+ $store = $this->getMockBuilder(Store::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $store->method('getCurrentCurrencyCode')
+ ->willReturn('USD');
+ $this->quoteSession->method('getStore')
+ ->willReturn($store);
+
+ $currency = $this->getMockBuilder(Currency::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $currency->method('getSymbol')
+ ->willReturn($symbol);
+ $this->localeCurrency->method('getCurrency')
+ ->with('USD')
+ ->willReturn($currency);
+ }
+
+ /**
+ * Configures shipping and payment mock objects.
+ */
+ private function withQuote()
+ {
+ $quote = $this->getMockBuilder(Quote::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->quoteSession->method('getQuote')
+ ->willReturn($quote);
+
+ $address = $this->getMockBuilder(Address::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $address->method('getShippingMethod')
+ ->willReturn('free');
+ $quote->method('getShippingAddress')
+ ->willReturn($address);
+
+ $payment = $this->getMockBuilder(Payment::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $payment->method('getMethod')
+ ->willReturn('free');
+ $quote->method('getPayment')
+ ->willReturn($payment);
+ }
+}
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Items/GridTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Items/GridTest.php
index e07fecf4cb116..805cdb045584c 100644
--- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Items/GridTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Items/GridTest.php
@@ -258,6 +258,9 @@ public function testGetItems()
$this->assertEquals(true, $this->block->getQuote()->getIsSuperMode());
}
+ /**
+ * @return \Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid
+ */
protected function getGrid()
{
/** @var \Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid $grid */
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebarTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebarTest.php
index a52d8e1b7f9f9..7b94e769eff9a 100644
--- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebarTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebarTest.php
@@ -39,6 +39,9 @@ public function testGetItemQty($itemQty, $qty, $expectedValue)
$this->assertEquals($expectedValue, $this->abstractSidebar->getItemQty($this->itemMock));
}
+ /**
+ * @return array
+ */
public function getItemQtyDataProvider()
{
return ['whenQtyIsset' => [2, 10, 10], 'whenQtyNotIsset' => [1, false, 1]];
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Invoice/ViewTest.php
index 773694897291c..8f94ea8982ddf 100644
--- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Invoice/ViewTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Invoice/ViewTest.php
@@ -54,6 +54,9 @@ public function testIsPaymentReview($canReviewPayment, $canFetchUpdate, $expecte
$this->assertEquals($expectedResult, $testMethod->invoke($block));
}
+ /**
+ * @return array
+ */
public function isPaymentReviewDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Order/Create/TotalsTest.php b/app/code/Magento/Sales/Test/Unit/Block/Order/Create/TotalsTest.php
index 2a839dd018dba..492cfee5f5d83 100644
--- a/app/code/Magento/Sales/Test/Unit/Block/Order/Create/TotalsTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Block/Order/Create/TotalsTest.php
@@ -70,10 +70,10 @@ protected function setUp()
$this->quoteMock->expects($this->any())
->method('getBillingAddress')
- ->willreturn($this->billingAddressMock);
+ ->willReturn($this->billingAddressMock);
$this->quoteMock->expects($this->any())
->method('getShippingAddress')
- ->willreturn($this->shippingAddressMock);
+ ->willReturn($this->shippingAddressMock);
$this->sessionQuoteMock->expects($this->any())->method('getQuote')->willReturn($this->quoteMock);
$this->totals = $this->helperManager->getObject(
\Magento\Sales\Block\Adminhtml\Order\Create\Totals::class,
@@ -88,7 +88,7 @@ public function testGetTotals($isVirtual)
{
$expected = 'expected';
$this->quoteMock->expects($this->at(1))->method('collectTotals');
- $this->quoteMock->expects($this->once())->method('isVirtual')->willreturn($isVirtual);
+ $this->quoteMock->expects($this->once())->method('isVirtual')->willReturn($isVirtual);
if ($isVirtual) {
$this->billingAddressMock->expects($this->once())->method('getTotals')->willReturn($expected);
} else {
diff --git a/app/code/Magento/Sales/Test/Unit/Block/Order/TotalsTest.php b/app/code/Magento/Sales/Test/Unit/Block/Order/TotalsTest.php
index 7ad21f26a8bea..be0ae41347ba8 100644
--- a/app/code/Magento/Sales/Test/Unit/Block/Order/TotalsTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Block/Order/TotalsTest.php
@@ -51,6 +51,10 @@ public function testApplySortOrder()
);
}
+ /**
+ * @param array $expected
+ * @param array $actual
+ */
private function assertEqualsSorted(array $expected, array $actual)
{
$this->assertEquals($expected, $actual, 'Array contents should be equal.');
diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ProcessDataTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ProcessDataTest.php
index 2b6436395a0cf..ab4bf5fbbe491 100644
--- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ProcessDataTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ProcessDataTest.php
@@ -235,6 +235,9 @@ public function testExecute($noDiscount, $couponCode, $errorMessage, $actualCoup
$this->assertInstanceOf(\Magento\Backend\Model\View\Result\Forward::class, $this->processData->execute());
}
+ /**
+ * @return array
+ */
public function isApplyDiscountDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php
index 19cbec9d1a06b..d0d7e7efa97f7 100644
--- a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php
@@ -216,6 +216,9 @@ public function testExecute($itemOptionValues, $productOptionValues, $noRouteOcc
$this->objectMock->execute();
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php b/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php
index fd20e0cb7d94a..e424cae85f223 100644
--- a/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php
@@ -70,6 +70,9 @@ public function testExecute($lifetimes, $additionalFilterFields)
$this->observer->execute();
}
+ /**
+ * @return array
+ */
public function cleanExpiredQuotesDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/CustomerData/LastOrderedItemsTest.php b/app/code/Magento/Sales/Test/Unit/CustomerData/LastOrderedItemsTest.php
index 4304bf00981e1..e14da1ac1b5ab 100644
--- a/app/code/Magento/Sales/Test/Unit/CustomerData/LastOrderedItemsTest.php
+++ b/app/code/Magento/Sales/Test/Unit/CustomerData/LastOrderedItemsTest.php
@@ -176,6 +176,9 @@ public function testGetSectionData()
$this->assertEquals(['items' => [$expectedItem1, $expectedItem2]], $this->section->getSectionData());
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getLastOrderMock()
{
$customerId = 1;
diff --git a/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php b/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php
index 180cfca0bc3cb..389064b7274a7 100644
--- a/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php
@@ -198,6 +198,9 @@ public function testDisplayPriceAttribute(
);
}
+ /**
+ * @return array
+ */
public function displayPricesDataProvider()
{
return [
@@ -310,6 +313,9 @@ public function testApplySalableProductTypesFilter($itemKey, $type, $calledTimes
$this->adminHelper->applySalableProductTypesFilter($collectionMock);
}
+ /**
+ * @return array
+ */
public function applySalableProductTypesFilterDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php b/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php
index 8d3aaa4dae616..56ec763a31cfe 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/EmailSenderHandlerTest.php
@@ -47,6 +47,16 @@ class EmailSenderHandlerTest extends \PHPUnit\Framework\TestCase
*/
protected $globalConfig;
+ /**
+ * @var \Magento\Sales\Model\Order\Email\Container\IdentityInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $identityContainerMock;
+
+ /**
+ * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $storeManagerMock;
+
protected function setUp()
{
$objectManager = new ObjectManager($this);
@@ -70,18 +80,28 @@ protected function setUp()
false,
false,
true,
- ['addFieldToFilter', 'getItems']
+ ['addFieldToFilter', 'getItems', 'addAttributeToSelect', 'getSelect']
);
$this->globalConfig = $this->createMock(\Magento\Framework\App\Config::class);
+ $this->identityContainerMock = $this->createMock(
+ \Magento\Sales\Model\Order\Email\Container\IdentityInterface::class
+ );
+
+ $this->storeManagerMock = $this->createMock(
+ \Magento\Store\Model\StoreManagerInterface::class
+ );
+
$this->object = $objectManager->getObject(
\Magento\Sales\Model\EmailSenderHandler::class,
[
- 'emailSender' => $this->emailSender,
- 'entityResource' => $this->entityResource,
- 'entityCollection' => $this->entityCollection,
- 'globalConfig' => $this->globalConfig
+ 'emailSender' => $this->emailSender,
+ 'entityResource' => $this->entityResource,
+ 'entityCollection' => $this->entityCollection,
+ 'globalConfig' => $this->globalConfig,
+ 'identityContainer' => $this->identityContainerMock,
+ 'storeManager' => $this->storeManagerMock,
]
);
}
@@ -114,12 +134,32 @@ public function testExecute($configValue, $collectionItems, $emailSendingResult)
->method('addFieldToFilter')
->with('email_sent', ['null' => true]);
+ $this->entityCollection
+ ->expects($this->any())
+ ->method('addAttributeToSelect')
+ ->with('store_id')
+ ->willReturnSelf();
+
+ $selectMock = $this->createMock(\Magento\Framework\DB\Select::class);
+
+ $selectMock
+ ->expects($this->atLeastOnce())
+ ->method('group')
+ ->with('store_id')
+ ->willReturnSelf();
+
+ $this->entityCollection
+ ->expects($this->any())
+ ->method('getSelect')
+ ->willReturn($selectMock);
+
$this->entityCollection
->expects($this->any())
->method('getItems')
->willReturn($collectionItems);
if ($collectionItems) {
+
/** @var \Magento\Sales\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject $collectionItem */
$collectionItem = $collectionItems[0];
@@ -129,6 +169,23 @@ public function testExecute($configValue, $collectionItems, $emailSendingResult)
->with($collectionItem, true)
->willReturn($emailSendingResult);
+ $storeMock = $this->createMock(\Magento\Store\Model\Store::class);
+
+ $this->storeManagerMock
+ ->expects($this->any())
+ ->method('getStore')
+ ->willReturn($storeMock);
+
+ $this->identityContainerMock
+ ->expects($this->any())
+ ->method('setStore')
+ ->with($storeMock);
+
+ $this->identityContainerMock
+ ->expects($this->any())
+ ->method('isEnabled')
+ ->willReturn(true);
+
if ($emailSendingResult) {
$collectionItem
->expects($this->once())
@@ -159,14 +216,30 @@ public function executeDataProvider()
false,
false,
true,
- ['setEmailSent']
+ ['setEmailSent', 'getOrder']
);
return [
- [1, [$entityModel], true],
- [1, [$entityModel], false],
- [1, [], null],
- [0, null, null]
+ [
+ 'configValue' => 1,
+ 'collectionItems' => [clone $entityModel],
+ 'emailSendingResult' => true,
+ ],
+ [
+ 'configValue' => 1,
+ 'collectionItems' => [clone $entityModel],
+ 'emailSendingResult' => false,
+ ],
+ [
+ 'configValue' => 1,
+ 'collectionItems' => [],
+ 'emailSendingResult' => null,
+ ],
+ [
+ 'configValue' => 0,
+ 'collectionItems' => null,
+ 'emailSendingResult' => null,
+ ]
];
}
}
diff --git a/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php
index 014e0e28b49ee..02f855929d9d6 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php
@@ -428,6 +428,9 @@ public function testCouldNotInvoiceException()
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php
index 73838379490fd..93eb56a07955c 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php
@@ -78,6 +78,9 @@ public function testGetRegionCodeRegionIsSet()
$this->assertEquals('region', $this->address->getRegionCode());
}
+ /**
+ * @return array
+ */
public function regionProvider()
{
return [ [1, null], [null, 1]];
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Item/Validation/CreateQuantityValidatorTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Item/Validation/CreateQuantityValidatorTest.php
index c911af3044e5d..24a64c37a5e13 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Item/Validation/CreateQuantityValidatorTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Item/Validation/CreateQuantityValidatorTest.php
@@ -97,6 +97,9 @@ public function testValidateCreditMemoProductItems($orderItemId, $expectedResult
$this->assertEquals($expectedResult, $this->createQuantityValidator->validate($this->entity));
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/RefundOperationTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/RefundOperationTest.php
index f917d69e69f79..9172a6f45bbcd 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/RefundOperationTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/RefundOperationTest.php
@@ -364,6 +364,9 @@ public function baseAmountsDataProvider()
];
}
+ /**
+ * @param $amounts
+ */
private function setBaseAmounts($amounts)
{
foreach ($amounts as $amountName => $summands) {
@@ -403,6 +406,9 @@ private function registerItems()
->willReturn([$item1, $item2, $item3]);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getCreditmemoItemMock()
{
return $this->getMockBuilder(\Magento\Sales\Api\Data\CreditmemoItemInterface::class)
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/AbstractSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/AbstractSenderTest.php
index 97dc973e63437..afb76c982d7c2 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/AbstractSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/AbstractSenderTest.php
@@ -120,6 +120,10 @@ public function stepMockSetup()
$this->loggerMock = $this->createMock(\Psr\Log\LoggerInterface::class);
}
+ /**
+ * @param $billingAddress
+ * @param bool $isVirtual
+ */
public function stepAddressFormat($billingAddress, $isVirtual = false)
{
$this->orderMock->expects($this->any())
@@ -145,6 +149,9 @@ public function stepSendWithCallSendCopyTo()
$this->stepSend($this->never(), $this->once());
}
+ /**
+ * @param $identityMockClassName
+ */
public function stepIdentityContainerInit($identityMockClassName)
{
$this->identityContainerMock = $this->createPartialMock(
@@ -156,6 +163,10 @@ public function stepIdentityContainerInit($identityMockClassName)
->will($this->returnValue($this->storeMock));
}
+ /**
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendExpects
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendCopyToExpects
+ */
protected function stepSend(
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendExpects,
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $sendCopyToExpects
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceQuantityValidatorTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceQuantityValidatorTest.php
index 5d3e9ae22e78b..5a0478dd2e36f 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceQuantityValidatorTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceQuantityValidatorTest.php
@@ -156,6 +156,12 @@ public function testValidateNoInvoiceItems()
);
}
+ /**
+ * @param $orderItemId
+ * @param $qty
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getInvoiceItemMock($orderItemId, $qty)
{
$invoiceItemMock = $this->getMockBuilder(\Magento\Sales\Api\Data\InvoiceItemInterface::class)
@@ -167,6 +173,13 @@ private function getInvoiceItemMock($orderItemId, $qty)
return $invoiceItemMock;
}
+ /**
+ * @param $id
+ * @param $qtyToInvoice
+ * @param $isDummy
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getOrderItemMock($id, $qtyToInvoice, $isDummy)
{
$orderItemMock = $this->getMockBuilder(\Magento\Sales\Api\Data\OrderItemInterface::class)
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php
index 0517da8b85cf0..8c972801c5520 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php
@@ -138,6 +138,9 @@ public function testDefaultCanVoid($canVoid)
$this->assertEquals($canVoid, $this->model->canVoid());
}
+ /**
+ * @return array
+ */
public function canVoidDataProvider()
{
return [[true], [false]];
@@ -382,6 +385,9 @@ public function testPay(
self::assertEquals($expectedTotal, $this->order->getTotalPaid());
}
+ /**
+ * @return array
+ */
public function payDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php
index 03a388410f335..aea234959cea0 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php
@@ -140,6 +140,9 @@ public function testGetStatusId(
$this->assertEquals($expectedStatus, $this->model->getStatusId());
}
+ /**
+ * @return array
+ */
public function getStatusIdDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/RepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/RepositoryTest.php
index 66ac821006266..8a40fbd20ef48 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/RepositoryTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/RepositoryTest.php
@@ -149,6 +149,11 @@ public function testGetList()
$this->assertSame($this->collection, $this->repository->getList($this->searchCriteria));
}
+ /**
+ * @param bool $id
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function mockPayment($id = false)
{
$payment = $this->createMock(\Magento\Sales\Model\Order\Payment::class);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/BuilderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/BuilderTest.php
index 1ea3aeedea51c..ea11604c53c45 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/BuilderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/BuilderTest.php
@@ -257,6 +257,9 @@ protected function expectsIsPaymentTransactionClosed($isPaymentTransactionClosed
->willReturn($isPaymentTransactionClosed);
}
+ /**
+ * @return array
+ */
public function createDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/ManagerTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/ManagerTest.php
index 34b874c073a5a..13f6b9c607586 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/ManagerTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/Transaction/ManagerTest.php
@@ -155,6 +155,9 @@ public function generateTransactionIdDataProvider()
];
}
+ /**
+ * @return array
+ */
public function isTransactionExistsDataProvider()
{
return [
@@ -165,6 +168,9 @@ public function isTransactionExistsDataProvider()
];
}
+ /**
+ * @return array
+ */
public function getAuthorizationDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php
index ee7e07873da51..52762b0dbf315 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php
@@ -600,6 +600,9 @@ public function testAcceptApprovePaymentTrue()
self::assertEquals($baseGrandTotal, $this->payment->getBaseAmountPaidOnline());
}
+ /**
+ * @return array
+ */
public function acceptPaymentFalseProvider()
{
return [
@@ -1532,6 +1535,9 @@ public function testRefund()
static::assertEquals($amount, $this->payment->getData('base_amount_refunded'));
}
+ /**
+ * @return array
+ */
public function boolProvider()
{
return [
@@ -1570,6 +1576,9 @@ public function testGetShouldCloseParentTransaction()
static::assertFalse($this->payment->getShouldCloseParentTransaction());
}
+ /**
+ * @return object
+ */
protected function initPayment()
{
return (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject(
@@ -1589,6 +1598,12 @@ protected function initPayment()
);
}
+ /**
+ * @param $state
+ * @param null $status
+ * @param null $message
+ * @param null $isCustomerNotified
+ */
protected function assertOrderUpdated(
$state,
$status = null,
@@ -1617,6 +1632,11 @@ protected function assertOrderUpdated(
->willReturn($statusHistory);
}
+ /**
+ * @param $state
+ * @param $status
+ * @param array $allStatuses
+ */
protected function mockGetDefaultStatus($state, $status, $allStatuses = [])
{
/** @var \Magento\Sales\Model\Order\Config | \PHPUnit_Framework_MockObject_MockObject $orderConfigMock */
@@ -1642,6 +1662,11 @@ protected function mockGetDefaultStatus($state, $status, $allStatuses = [])
->will($this->returnValue($orderConfigMock));
}
+ /**
+ * @param $transactionId
+ *
+ * @return MockObject
+ */
protected function getTransactionMock($transactionId)
{
$transaction = $this->createPartialMock(\Magento\Sales\Model\Order\Payment\Transaction::class, [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php
index 28c29cd7a3bdf..57a4d5f40aa36 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php
@@ -27,6 +27,9 @@ public function testGetOrderStatusByState($order, $expectedReturn)
self::assertEquals($expectedReturn, $actualReturn);
}
+ /**
+ * @return array
+ */
public function statesDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
index fb1970638753f..7f6363346872c 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
@@ -845,6 +845,9 @@ protected function prepareItemMock($qtyInvoiced)
->will($this->returnValue($itemCollectionMock));
}
+ /**
+ * @return array
+ */
public function canVoidPaymentDataProvider()
{
$data = [];
@@ -856,6 +859,9 @@ public function canVoidPaymentDataProvider()
return $data;
}
+ /**
+ * @return array
+ */
public function dataProviderActionFlag()
{
return [
@@ -1076,6 +1082,9 @@ public function testGetCreatedAtFormattedUsesCorrectLocale()
$this->order->getCreatedAtFormatted(\IntlDateFormatter::SHORT);
}
+ /**
+ * @return array
+ */
public function notInvoicingStatesProvider()
{
return [
@@ -1085,6 +1094,9 @@ public function notInvoicingStatesProvider()
];
}
+ /**
+ * @return array
+ */
public function canNotCreditMemoStatesProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/RefundInvoiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/RefundInvoiceTest.php
index 5a8c1032cd4fc..5148752e9831a 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/RefundInvoiceTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/RefundInvoiceTest.php
@@ -463,6 +463,9 @@ public function testCouldNotCreditmemoException()
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
$creditmemoItemCreationMock = $this->getMockBuilder(CreditmemoItemCreationInterface::class)
diff --git a/app/code/Magento/Sales/Test/Unit/Model/RefundOrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/RefundOrderTest.php
index 8bc3288af04cf..c95b56d81d6f4 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/RefundOrderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/RefundOrderTest.php
@@ -407,6 +407,9 @@ public function testCouldNotCreditmemoException()
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php
new file mode 100644
index 0000000000000..50cbdcb974c5b
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridTest.php
@@ -0,0 +1,107 @@
+ 'column_1_value',
+ 'column_2_key' => 'column_2_value'
+ ];
+
+ /**
+ * @inheritdoc
+ */
+ protected function setUp()
+ {
+ $objectManager = new ObjectManager($this);
+ $this->notSyncedDataProvider = $this->getMockBuilder(NotSyncedDataProviderInterface::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getIds'])
+ ->getMockForAbstractClass();
+ $this->connection = $this->getMockBuilder(ConnectionAdapterInterface::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['select', 'fetchAll', 'insertOnDuplicate'])
+ ->getMockForAbstractClass();
+
+ $this->grid = $objectManager->getObject(
+ \Magento\Sales\Model\ResourceModel\Grid::class,
+ [
+ 'notSyncedDataProvider' => $this->notSyncedDataProvider,
+ 'mainTableName' => $this->mainTable,
+ 'gridTableName' => $this->gridTable,
+ 'connection' => $this->connection,
+ '_tables' => ['sales_order' => $this->mainTable, 'sales_order_grid' => $this->gridTable],
+ 'columns' => $this->columns
+ ]
+ );
+ }
+
+ /**
+ * Test for refreshBySchedule() method
+ */
+ public function testRefreshBySchedule()
+ {
+ $notSyncedIds = ['1', '2', '3'];
+ $fetchResult = ['column_1' => '1', 'column_2' => '2'];
+
+ $this->notSyncedDataProvider->expects($this->atLeastOnce())->method('getIds')->willReturn($notSyncedIds);
+ $select = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['from', 'columns', 'where'])
+ ->getMock();
+ $select->expects($this->atLeastOnce())->method('from')->with(['sales_order' => $this->mainTable], [])
+ ->willReturnSelf();
+ $select->expects($this->atLeastOnce())->method('columns')->willReturnSelf();
+ $select->expects($this->atLeastOnce())->method('where')
+ ->with($this->mainTable . '.entity_id IN (?)', $notSyncedIds)
+ ->willReturnSelf();
+
+ $this->connection->expects($this->atLeastOnce())->method('select')->willReturn($select);
+ $this->connection->expects($this->atLeastOnce())->method('fetchAll')->with($select)->willReturn($fetchResult);
+ $this->connection->expects($this->atLeastOnce())->method('insertOnDuplicate')
+ ->with($this->gridTable, $fetchResult, array_keys($this->columns))
+ ->willReturn(array_count_values($notSyncedIds));
+
+ $this->grid->refreshBySchedule();
+ }
+}
diff --git a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php
index 395b653b0be8d..45cbea7307f4d 100644
--- a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php
@@ -84,6 +84,9 @@ public function testAddVatRequestParamsOrderComment(
$this->assertNull($this->observer->execute($observer));
}
+ /**
+ * @return array
+ */
public function addVatRequestParamsOrderCommentDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php
index f0738fbcf3129..f0845c67f1a4a 100644
--- a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php
@@ -72,6 +72,9 @@ public function testExecute($configAddressType)
$this->quote->execute($observer);
}
+ /**
+ * @return array
+ */
public function restoreCustomerGroupIdDataProvider()
{
return [
diff --git a/app/code/Magento/Sales/etc/di.xml b/app/code/Magento/Sales/etc/di.xml
index 88f91091f81d5..7aa97361ac843 100644
--- a/app/code/Magento/Sales/etc/di.xml
+++ b/app/code/Magento/Sales/etc/di.xml
@@ -120,6 +120,7 @@
- Magento\Sales\Model\ResourceModel\Provider\UpdatedIdListProvider
+ - Magento\Sales\Model\ResourceModel\Provider\UpdatedAtListProvider
@@ -323,6 +324,7 @@
Magento\Sales\Model\Order\Email\Sender\OrderSender
Magento\Sales\Model\ResourceModel\Order
Magento\Sales\Model\ResourceModel\Order\Collection
+ Magento\Sales\Model\Order\Email\Container\OrderIdentity
@@ -330,6 +332,7 @@
Magento\Sales\Model\Order\Email\Sender\InvoiceSender
Magento\Sales\Model\ResourceModel\Order\Invoice
Magento\Sales\Model\ResourceModel\Order\Invoice\Collection
+ Magento\Sales\Model\Order\Email\Container\InvoiceIdentity
@@ -337,6 +340,7 @@
Magento\Sales\Model\Order\Email\Sender\ShipmentSender
Magento\Sales\Model\ResourceModel\Order\Shipment
Magento\Sales\Model\ResourceModel\Order\Shipment\Collection
+ Magento\Sales\Model\Order\Email\Container\ShipmentIdentity
@@ -344,6 +348,7 @@
Magento\Sales\Model\Order\Email\Sender\CreditmemoSender
Magento\Sales\Model\ResourceModel\Order\Creditmemo
Magento\Sales\Model\ResourceModel\Order\Creditmemo\Collection
+ Magento\Sales\Model\Order\Email\Container\CreditmemoIdentity
diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js
index 8990ea8d3f75b..ace9656f5f806 100644
--- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js
+++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js
@@ -21,6 +21,7 @@ define([
this.loadBaseUrl = false;
this.customerId = data.customer_id ? data.customer_id : false;
this.storeId = data.store_id ? data.store_id : false;
+ this.quoteId = data['quote_id'] ? data['quote_id'] : false;
this.currencyId = false;
this.currencySymbol = data.currency_symbol ? data.currency_symbol : '';
this.addresses = data.addresses ? data.addresses : $H({});
diff --git a/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php b/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php
index 3d811363156d7..32eb810c7a16a 100644
--- a/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php
+++ b/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php
@@ -121,6 +121,9 @@ public function testValidationWithWrongOrderItems()
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/SalesInventory/Test/Unit/Model/Plugin/Order/Validation/InvoiceRefundCreationArgumentsTest.php b/app/code/Magento/SalesInventory/Test/Unit/Model/Plugin/Order/Validation/InvoiceRefundCreationArgumentsTest.php
index 2ee8f81a2aa88..0fea8f4210f8a 100644
--- a/app/code/Magento/SalesInventory/Test/Unit/Model/Plugin/Order/Validation/InvoiceRefundCreationArgumentsTest.php
+++ b/app/code/Magento/SalesInventory/Test/Unit/Model/Plugin/Order/Validation/InvoiceRefundCreationArgumentsTest.php
@@ -140,6 +140,9 @@ public function testAfterValidation($erroMessage)
);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/app/code/Magento/SalesInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php b/app/code/Magento/SalesInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php
index c2e2d4710f96c..759320106ea1b 100644
--- a/app/code/Magento/SalesInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php
+++ b/app/code/Magento/SalesInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php
@@ -173,6 +173,11 @@ public function testRefundOrderInventory()
$this->observer->execute($this->eventObserver);
}
+ /**
+ * @param $productId
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getCreditMemoItem($productId)
{
$backToStock = true;
diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
index 794fc94d6a2a8..3a5ed16fdd2fd 100644
--- a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
+++ b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
@@ -239,7 +239,7 @@ public function saveStoreLabels($ruleId, $labels)
$connection->delete($table, ['rule_id=?' => $ruleId, 'store_id IN (?)' => $deleteByStoreIds]);
}
} catch (\Exception $e) {
- $connection->rollback();
+ $connection->rollBack();
throw $e;
}
$connection->commit();
diff --git a/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php b/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php
index 88108154b5e71..f62e2e0be4d0c 100644
--- a/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php
+++ b/app/code/Magento/SalesRule/Plugin/CouponUsagesDecrement.php
@@ -16,6 +16,11 @@ class CouponUsagesDecrement
*/
private $updateCouponUsages;
+ /**
+ * CouponUsagesDecrement constructor.
+ *
+ * @param UpdateCouponUsages $updateCouponUsages
+ */
public function __construct(
UpdateCouponUsages $updateCouponUsages
) {
diff --git a/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php b/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php
index 54ebef2bdf248..8810b4630f51a 100644
--- a/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php
+++ b/app/code/Magento/SalesRule/Plugin/CouponUsagesIncrement.php
@@ -16,6 +16,11 @@ class CouponUsagesIncrement
*/
private $updateCouponUsages;
+ /**
+ * CouponUsagesIncrement constructor.
+ *
+ * @param UpdateCouponUsages $updateCouponUsages
+ */
public function __construct(
UpdateCouponUsages $updateCouponUsages
) {
diff --git a/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php b/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php
index cd00562bc4f7a..bd14773ea4923 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php
@@ -195,6 +195,9 @@ public function testIsAllowed($isAllowed)
$this->assertEquals($isAllowed, $this->block->isAllowed());
}
+ /**
+ * @return array
+ */
public function isAllowedDataProvider()
{
return [
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToDataModelTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToDataModelTest.php
index 82868b3723c75..1016d14066afc 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToDataModelTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToDataModelTest.php
@@ -115,6 +115,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
private function getArrayData()
{
return [
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php
index 98e1d7cddee57..5dd67424418b7 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php
@@ -273,6 +273,9 @@ public function testFormattingDate($data)
$this->model->toModel($dataModel);
}
+ /**
+ * @return array
+ */
public function expectedDatesProvider()
{
return [
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php
index 31536e1be3d2e..e516f817a59d1 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php
@@ -155,6 +155,9 @@ public function testSaveWithExceptions($exceptionObject, $exceptionName, $except
$this->model->save($coupon);
}
+ /**
+ * @return array
+ */
public function saveExceptionsDataProvider()
{
$msg = 'kiwis';
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php
index 671f20a27a460..090dbd7fe5d6d 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php
@@ -225,6 +225,9 @@ public function testCollectItemHasChildren($childItemData, $parentData, $expecte
}
}
+ /**
+ * @return array
+ */
public function collectItemHasChildrenDataProvider()
{
$data = [
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php
index 89f4e93901c1b..be9e25eb20302 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php
@@ -113,6 +113,9 @@ public function testBeforeSaveResetConditionToNull()
$this->model->getActions();
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupProdConditionMock()
{
$prodConditionMock = $this->getMockBuilder(\Magento\SalesRule\Model\Rule\Condition\Product\Combine::class)
@@ -133,6 +136,9 @@ protected function setupProdConditionMock()
return $prodConditionMock;
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupConditionMock()
{
$conditionMock = $this->getMockBuilder(\Magento\SalesRule\Model\Rule\Condition\Combine::class)
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php
index 21df8e587667e..ec4e775f1f6b3 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php
@@ -140,6 +140,9 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed($isChildren,
$this->assertEquals($appliedRuleIds, $result);
}
+ /**
+ * @return array
+ */
public function dataProviderChildren()
{
return [
@@ -179,6 +182,10 @@ protected function getPreparedItem()
return $item;
}
+ /**
+ * @param $item
+ * @param $rule
+ */
protected function applyRule($item, $rule)
{
$qty = 2;
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php
index 5e48f3110a395..4ce0f2a0564f3 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php
@@ -362,6 +362,9 @@ public function testMergeIds($a1, $a2, $isSting, $expected)
$this->assertEquals($expected, $this->utility->mergeIds($a1, $a2, $isSting));
}
+ /**
+ * @return array
+ */
public function mergeIdsDataProvider()
{
return [
diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php
index 2e6a3c3c38af0..42448565791c5 100644
--- a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php
+++ b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php
@@ -495,6 +495,9 @@ public function testProcessShippingAmountActions($action)
);
}
+ /**
+ * @return array
+ */
public static function dataProviderActions()
{
return [
diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js
index 6df769a90894e..f2924fe48e01b 100644
--- a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js
+++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js
@@ -57,7 +57,7 @@ define([
}
discountSegments = this.totals()['total_segments'].filter(function (segment) {
- return segment.code === 'discount';
+ return segment.code.indexOf('discount') !== -1;
});
return discountSegments.length ? discountSegments[0].title : null;
diff --git a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php
index 291362734feff..1f9aad8d4316d 100644
--- a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php
@@ -127,6 +127,9 @@ public function testGetEscapedQueryText($queryText, $maxQueryLength, $expected)
$this->assertEquals($expected, $this->model->getEscapedQueryText());
}
+ /**
+ * @return array
+ */
public function queryTextDataProvider()
{
return [
diff --git a/app/code/Magento/Security/Test/Unit/Model/ResourceModel/PasswordResetRequestEvent/CollectionFactoryTest.php b/app/code/Magento/Security/Test/Unit/Model/ResourceModel/PasswordResetRequestEvent/CollectionFactoryTest.php
index 525693631e86f..89bc5c2b85d50 100644
--- a/app/code/Magento/Security/Test/Unit/Model/ResourceModel/PasswordResetRequestEvent/CollectionFactoryTest.php
+++ b/app/code/Magento/Security/Test/Unit/Model/ResourceModel/PasswordResetRequestEvent/CollectionFactoryTest.php
@@ -86,6 +86,9 @@ public function testCreate(
$this->model->create($securityEventType, $accountReference, $longIp);
}
+ /**
+ * @return array
+ */
public function createDataProvider()
{
return [
diff --git a/app/code/Magento/SendFriend/Test/Unit/Block/Plugin/Catalog/Product/ViewTest.php b/app/code/Magento/SendFriend/Test/Unit/Block/Plugin/Catalog/Product/ViewTest.php
index 6dbab3a5573a8..2718e1fa44f6e 100644
--- a/app/code/Magento/SendFriend/Test/Unit/Block/Plugin/Catalog/Product/ViewTest.php
+++ b/app/code/Magento/SendFriend/Test/Unit/Block/Plugin/Catalog/Product/ViewTest.php
@@ -52,6 +52,9 @@ public function testAfterCanEmailToFriend($result, $callSendfriend)
$this->assertTrue($this->view->afterCanEmailToFriend($this->productView, $result));
}
+ /**
+ * @return array
+ */
public function afterCanEmailToFriendDataSet()
{
return [
diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php
index 9e340cc31ff17..1d3f6ad1ee5a3 100644
--- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php
+++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging/Grid.php
@@ -10,7 +10,7 @@ class Grid extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'order/packaging/grid.phtml';
+ protected $_template = 'Magento_Shipping::order/packaging/grid.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Shipping/Block/Order/Shipment.php b/app/code/Magento/Shipping/Block/Order/Shipment.php
index 653fb357f0b1d..21e960985d6b6 100644
--- a/app/code/Magento/Shipping/Block/Order/Shipment.php
+++ b/app/code/Magento/Shipping/Block/Order/Shipment.php
@@ -18,7 +18,7 @@ class Shipment extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'order/shipment.phtml';
+ protected $_template = 'Magento_Shipping::order/shipment.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Shipping/Model/Shipping/Labels.php b/app/code/Magento/Shipping/Model/Shipping/Labels.php
index b1709b0a16998..15f0c88a7944a 100644
--- a/app/code/Magento/Shipping/Model/Shipping/Labels.php
+++ b/app/code/Magento/Shipping/Model/Shipping/Labels.php
@@ -117,8 +117,8 @@ public function requestToShipment(Shipment $orderShipment)
)
);
- if (!$admin->getFirstname()
- || !$admin->getLastname()
+ if (!$admin->getFirstName()
+ || !$admin->getLastName()
|| !$storeInfo->getName()
|| !$storeInfo->getPhone()
|| !$originStreet1
@@ -187,8 +187,8 @@ protected function setShipperDetails(
);
$request->setShipperContactPersonName($storeAdmin->getName());
- $request->setShipperContactPersonFirstName($storeAdmin->getFirstname());
- $request->setShipperContactPersonLastName($storeAdmin->getLastname());
+ $request->setShipperContactPersonFirstName($storeAdmin->getFirstName());
+ $request->setShipperContactPersonLastName($storeAdmin->getLastName());
$request->setShipperContactCompanyName($store->getName());
$request->setShipperContactPhoneNumber($store->getPhone());
$request->setShipperEmail($storeAdmin->getEmail());
diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php
index 65460d1a13eea..2db8eabffae61 100644
--- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php
+++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php
@@ -204,6 +204,14 @@ public function testExecuteNoShipment()
$this->assertEquals($this->resultForwardMock, $this->controller->execute());
}
+ /**
+ * @param $orderId
+ * @param $shipmentId
+ * @param $shipment
+ * @param $tracking
+ * @param $comeFrom
+ * @param $returnShipment
+ */
protected function loadShipment($orderId, $shipmentId, $shipment, $tracking, $comeFrom, $returnShipment)
{
$valueMap = [
diff --git a/app/code/Magento/Signifyd/Block/Fingerprint.php b/app/code/Magento/Signifyd/Block/Fingerprint.php
index db76fc6c94468..f43bffce1fc1a 100644
--- a/app/code/Magento/Signifyd/Block/Fingerprint.php
+++ b/app/code/Magento/Signifyd/Block/Fingerprint.php
@@ -42,7 +42,7 @@ class Fingerprint extends Template
* @var string
* @since 100.2.0
*/
- protected $_template = 'fingerprint.phtml';
+ protected $_template = 'Magento_Signifyd::fingerprint.phtml';
/**
* @param Context $context
diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php
index 7ba3ab3eef4f6..6b7a6112a932e 100644
--- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php
+++ b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php
@@ -198,6 +198,9 @@ public function testIsAvailableWithCanceledOrder($state)
$this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId));
}
+ /**
+ * @return array
+ */
public function isAvailableWithCanceledOrderDataProvider()
{
return [
diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php
index a22bfe12222a6..f80a9a83e7117 100644
--- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php
+++ b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php
@@ -203,6 +203,12 @@ public function testCreateForOrderWithCaseUpdate()
);
}
+ /**
+ * @param $orderId
+ * @param array $caseData
+ *
+ * @return MockObject
+ */
private function withCaseEntityExistsForOrderId($orderId, array $caseData = [])
{
$this->createGuaranteeAbility->expects(self::once())
@@ -226,6 +232,9 @@ private function withCaseEntityExistsForOrderId($orderId, array $caseData = [])
return $dummyCaseEntity;
}
+ /**
+ * @param $failureMessage
+ */
private function withGatewayFailure($failureMessage)
{
$this->gateway
@@ -233,6 +242,9 @@ private function withGatewayFailure($failureMessage)
->willThrowException(new GatewayException($failureMessage));
}
+ /**
+ * @param $gatewayResult
+ */
private function withGatewaySuccess($gatewayResult)
{
$this->gateway
diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php
index bf0c6ee238d5f..1ee55d7ad150c 100644
--- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php
+++ b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php
@@ -92,6 +92,9 @@ public function testHandleFailureMessage($code, $message)
}
}
+ /**
+ * @return array
+ */
public function errorsProvider()
{
return [
diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php
index 0039b271a4b0b..ce97a7baaeace 100644
--- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php
+++ b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php
@@ -393,6 +393,9 @@ public function testCancelGuaranteeWithUnexpectedDisposition()
$this->assertEquals(Gateway::GUARANTEE_CANCELED, $result);
}
+ /**
+ * @return array
+ */
public function supportedGuaranteeDispositionsProvider()
{
return [
diff --git a/app/code/Magento/Store/Model/Config/Importer/Processor/Create.php b/app/code/Magento/Store/Model/Config/Importer/Processor/Create.php
index 768482aa44636..0a3f5eb5f31a3 100644
--- a/app/code/Magento/Store/Model/Config/Importer/Processor/Create.php
+++ b/app/code/Magento/Store/Model/Config/Importer/Processor/Create.php
@@ -52,6 +52,10 @@ class Create implements ProcessorInterface
/**
* The event manager.
*
+ * @deprecated logic moved inside of "afterSave" method
+ * \Magento\Store\Model\Website::afterSave
+ * \Magento\Store\Model\Group::afterSave
+ * \Magento\Store\Model\Store::afterSave
* @var ManagerInterface
*/
private $eventManager;
@@ -181,8 +185,6 @@ private function createGroups(array $items, array $data)
$group->setDefaultStoreId($store->getStoreId());
$group->setWebsite($website);
$group->getResource()->save($group);
-
- $this->eventManager->dispatch('store_group_save', ['group' => $group]);
});
}
}
diff --git a/app/code/Magento/Store/Model/Config/Importer/Processor/Delete.php b/app/code/Magento/Store/Model/Config/Importer/Processor/Delete.php
index 8660a0ba7152d..475c15122773e 100644
--- a/app/code/Magento/Store/Model/Config/Importer/Processor/Delete.php
+++ b/app/code/Magento/Store/Model/Config/Importer/Processor/Delete.php
@@ -168,10 +168,7 @@ private function deleteStores(array $items)
foreach ($items as $storeCode) {
$store = $this->storeRepository->get($storeCode);
- $store->getResource()->delete($store);
- $store->getResource()->addCommitCallback(function () use ($store) {
- $this->eventManager->dispatch('store_delete', ['store' => $store]);
- });
+ $store->delete();
}
}
diff --git a/app/code/Magento/Store/Model/Config/Importer/Processor/Update.php b/app/code/Magento/Store/Model/Config/Importer/Processor/Update.php
index 35f3957b168d7..155506291e59d 100644
--- a/app/code/Magento/Store/Model/Config/Importer/Processor/Update.php
+++ b/app/code/Magento/Store/Model/Config/Importer/Processor/Update.php
@@ -176,10 +176,7 @@ private function updateStores(array $items, array $data)
$store->setGroup($group);
}
- $store->getResource()->save($store);
- $store->getResource()->addCommitCallback(function () use ($store) {
- $this->eventManager->dispatch('store_edit', ['store' => $store]);
- });
+ $store->save();
}
}
@@ -214,11 +211,7 @@ private function updateGroups(array $items, array $data)
if ($website && $website->getId() != $group->getWebsiteId()) {
$group->setWebsite($website);
}
-
- $group->getResource()->save($group);
- $group->getResource()->addCommitCallback(function () use ($group) {
- $this->eventManager->dispatch('store_group_save', ['group' => $group]);
- });
+ $group->save();
}
}
diff --git a/app/code/Magento/Store/Model/Group.php b/app/code/Magento/Store/Model/Group.php
index 01f56fb9e0566..ccc3c65491422 100644
--- a/app/code/Magento/Store/Model/Group.php
+++ b/app/code/Magento/Store/Model/Group.php
@@ -95,6 +95,11 @@ class Group extends \Magento\Framework\Model\AbstractExtensibleModel implements
*/
protected $_storeManager;
+ /**
+ * @var \Magento\Framework\Event\ManagerInterface
+ */
+ private $eventManager;
+
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
@@ -106,6 +111,7 @@ class Group extends \Magento\Framework\Model\AbstractExtensibleModel implements
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
+ * @param \Magento\Framework\Event\ManagerInterface|null $eventManager
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -118,11 +124,14 @@ public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
- array $data = []
+ array $data = [],
+ \Magento\Framework\Event\ManagerInterface $eventManager = null
) {
$this->_configDataResource = $configDataResource;
$this->_storeListFactory = $storeListFactory;
$this->_storeManager = $storeManager;
+ $this->eventManager = $eventManager ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\Event\ManagerInterface::class);
parent::__construct(
$context,
$registry,
@@ -405,6 +414,11 @@ public function beforeDelete()
*/
public function afterDelete()
{
+ $group = $this;
+ $this->getResource()->addCommitCallback(function () use ($group) {
+ $this->_storeManager->reinitStores();
+ $this->eventManager->dispatch($this->_eventPrefix . '_delete', ['group' => $group]);
+ });
$result = parent::afterDelete();
if ($this->getId() === $this->getWebsite()->getDefaultGroupId()) {
@@ -421,6 +435,19 @@ public function afterDelete()
return $result;
}
+ /**
+ * @inheritdoc
+ */
+ public function afterSave()
+ {
+ $group = $this;
+ $this->getResource()->addCommitCallback(function () use ($group) {
+ $this->_storeManager->reinitStores();
+ $this->eventManager->dispatch($this->_eventPrefix . '_save', ['group' => $group]);
+ });
+ return parent::afterSave();
+ }
+
/**
* Get/Set isReadOnly flag
*
diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php
index 70869b55c8e61..9875e700d0afd 100644
--- a/app/code/Magento/Store/Model/Store.php
+++ b/app/code/Magento/Store/Model/Store.php
@@ -319,6 +319,11 @@ class Store extends AbstractExtensibleModel implements
*/
private $urlModifier;
+ /**
+ * @var \Magento\Framework\Event\ManagerInterface
+ */
+ private $eventManager;
+
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
@@ -344,6 +349,7 @@ class Store extends AbstractExtensibleModel implements
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param bool $isCustomEntryPoint
* @param array $data optional generic object data
+ * @param \Magento\Framework\Event\ManagerInterface|null $eventManager
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
@@ -371,7 +377,8 @@ public function __construct(
\Magento\Store\Api\WebsiteRepositoryInterface $websiteRepository,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
$isCustomEntryPoint = false,
- array $data = []
+ array $data = [],
+ \Magento\Framework\Event\ManagerInterface $eventManager = null
) {
$this->_coreFileStorageDatabase = $coreFileStorageDatabase;
$this->_config = $config;
@@ -390,6 +397,8 @@ public function __construct(
$this->_currencyInstalled = $currencyInstalled;
$this->groupRepository = $groupRepository;
$this->websiteRepository = $websiteRepository;
+ $this->eventManager = $eventManager ?: \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\Event\ManagerInterface::class);
parent::__construct(
$context,
$registry,
@@ -1048,6 +1057,15 @@ public function getWebsiteId()
public function afterSave()
{
$this->_storeManager->reinitStores();
+ if ($this->isObjectNew()) {
+ $event = $this->_eventPrefix . '_add';
+ } else {
+ $event = $this->_eventPrefix . '_edit';
+ }
+ $store = $this;
+ $this->getResource()->addCommitCallback(function () use ($event, $store) {
+ $this->eventManager->dispatch($event, ['store' => $store]);
+ });
return parent::afterSave();
}
@@ -1228,6 +1246,11 @@ public function beforeDelete()
*/
public function afterDelete()
{
+ $store = $this;
+ $this->getResource()->addCommitCallback(function () use ($store) {
+ $this->_storeManager->reinitStores();
+ $this->eventManager->dispatch($this->_eventPrefix . '_delete', ['store' => $store]);
+ });
parent::afterDelete();
$this->_configCacheType->clean();
@@ -1242,6 +1265,7 @@ public function afterDelete()
$this->getGroup()->setDefaultStoreId($defaultId);
$this->getGroup()->save();
}
+
return $this;
}
diff --git a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/CreateTest.php b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/CreateTest.php
index 9c7cc648cf8af..2c2b0b00aec43 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/CreateTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/CreateTest.php
@@ -325,10 +325,6 @@ public function testRunGroup()
return $function();
});
- $this->eventManagerMock->expects($this->once())
- ->method('dispatch')
- ->with('store_group_save', ['group' => $this->groupMock]);
-
$this->processor->run($this->data);
}
@@ -382,10 +378,6 @@ public function testRunStore()
return $function();
});
- $this->eventManagerMock->expects($this->once())
- ->method('dispatch')
- ->with('store_add', ['store' => $this->storeMock]);
-
$this->processor->run($this->data);
}
diff --git a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/DeleteTest.php b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/DeleteTest.php
index d16a4a70b00aa..c373643fa03ac 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/DeleteTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/DeleteTest.php
@@ -244,8 +244,6 @@ public function testRun()
->method('get')
->with('test')
->willReturn($this->storeMock);
- $this->storeResourceMock->expects($this->once())
- ->method('addCommitCallback');
$this->registryMock->expects($this->once())
->method('unregister')
diff --git a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/UpdateTest.php b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/UpdateTest.php
index 3b0b932e31d46..e98ad08d46a68 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/UpdateTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Config/Importer/Processor/UpdateTest.php
@@ -175,7 +175,7 @@ public function testRun()
$updateData[ScopeInterface::SCOPE_STORES],
],
]);
- $this->websiteMock->expects($this->exactly(4))
+ $this->websiteMock->expects($this->atLeastOnce())
->method('getResource')
->willReturn($this->websiteResourceMock);
$this->websiteMock->expects($this->once())
@@ -203,7 +203,7 @@ public function testRun()
$this->groupFactoryMock->expects($this->exactly(3))
->method('create')
->willReturn($this->groupMock);
- $this->groupMock->expects($this->exactly(5))
+ $this->groupMock->expects($this->atLeastOnce())
->method('getResource')
->willReturn($this->groupResourceMock);
$this->groupMock->expects($this->once())
@@ -227,7 +227,7 @@ public function testRun()
$this->storeFactoryMock->expects($this->exactly(2))
->method('create')
->willReturn($this->storeMock);
- $this->storeMock->expects($this->exactly(4))
+ $this->storeMock->expects($this->atLeastOnce())
->method('getResource')
->willReturn($this->storeResourceMock);
$this->storeMock->expects($this->once())
@@ -244,15 +244,16 @@ public function testRun()
$this->storeMock->expects($this->once())
->method('setData')
->with($updateData[ScopeInterface::SCOPE_STORES]['test']);
- $this->storeResourceMock->expects($this->once())
+ $this->storeMock->expects($this->once())
->method('save')
- ->with($this->storeMock);
- $this->storeResourceMock->expects($this->once())
- ->method('addCommitCallback');
+ ->willReturnSelf();
$this->model->run($data);
}
+ /**
+ * @return array
+ */
private function getData()
{
return [
diff --git a/app/code/Magento/Store/Test/Unit/Model/Resolver/GroupTest.php b/app/code/Magento/Store/Test/Unit/Model/Resolver/GroupTest.php
index 9817bd532c18a..6fade2de934e4 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Resolver/GroupTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Resolver/GroupTest.php
@@ -53,7 +53,7 @@ public function testGetScope()
*/
public function testGetScopeWithInvalidScope()
{
- $scopeMock = new \StdClass();
+ $scopeMock = new \stdClass();
$this->storeManagerMock
->expects($this->once())
->method('getGroup')
diff --git a/app/code/Magento/Store/Test/Unit/Model/Resolver/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/Resolver/StoreTest.php
index 958cfdea37bab..50a043f45bc16 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Resolver/StoreTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Resolver/StoreTest.php
@@ -52,7 +52,7 @@ public function testGetScope()
*/
public function testGetScopeWithInvalidScope()
{
- $scopeMock = new \StdClass();
+ $scopeMock = new \stdClass();
$this->_storeManagerMock
->expects($this->once())
->method('getStore')
diff --git a/app/code/Magento/Store/Test/Unit/Model/Resolver/WebsiteTest.php b/app/code/Magento/Store/Test/Unit/Model/Resolver/WebsiteTest.php
index c5b3dbaff99be..5c33090f28eeb 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Resolver/WebsiteTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Resolver/WebsiteTest.php
@@ -52,7 +52,7 @@ public function testGetScope()
*/
public function testGetScopeWithInvalidScope()
{
- $scopeMock = new \StdClass();
+ $scopeMock = new \stdClass();
$this->_storeManagerMock
->expects($this->once())
->method('getWebsite')
diff --git a/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php b/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php
index 702f4eee8db99..72ee0c196b090 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php
@@ -55,6 +55,11 @@ protected function setUp()
);
}
+ /**
+ * @param array $storeConfig
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getStoreMock(array $storeConfig)
{
$storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
@@ -88,6 +93,9 @@ protected function getStoreMock(array $storeConfig)
return $storeMock;
}
+ /**
+ * @return \Magento\Store\Model\Data\StoreConfig
+ */
protected function createStoreConfigDataObject()
{
/** @var \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactoryMock */
diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php
index ad3b927258717..a48804f02adc0 100644
--- a/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php
@@ -97,6 +97,9 @@ public function testGetStores($storesList, $withDefault, $codeKey, $expectedStor
$this->assertEquals($expectedStores, $this->model->getStores($withDefault, $codeKey));
}
+ /**
+ * @return array
+ */
public function getStoresDataProvider()
{
$defaultStoreMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
index bb3610a01d2ec..955f781a3d1ef 100644
--- a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
@@ -93,6 +93,9 @@ public function testLoad($key, $field)
$model->load($key);
}
+ /**
+ * @return array
+ */
public function loadDataProvider()
{
return [
@@ -264,6 +267,9 @@ function ($path, $scope, $scopeCode) use ($secure, $expectedPath) {
$this->assertEquals($expectedBaseUrl, $model->getBaseUrl($type, $secure));
}
+ /**
+ * @return array
+ */
public function getBaseUrlDataProvider()
{
return [
@@ -602,6 +608,9 @@ public function testIsCurrentlySecure(
}
}
+ /**
+ * @return array
+ */
public function isCurrentlySecureDataProvider()
{
return [
diff --git a/app/code/Magento/Store/Test/Unit/Model/System/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/System/StoreTest.php
index d70da2ee1ddc6..9cc4bb6ac8e5b 100644
--- a/app/code/Magento/Store/Test/Unit/Model/System/StoreTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/System/StoreTest.php
@@ -104,6 +104,9 @@ public function testGetStoresStructure(
);
}
+ /**
+ * @return array
+ */
public function getStoresStructureDataProvider()
{
$websiteName = 'website';
@@ -207,6 +210,9 @@ public function testGetStoreValuesForForm(
);
}
+ /**
+ * @return array
+ */
public function getStoreValuesForFormDataProvider()
{
$websiteName = 'website';
diff --git a/app/code/Magento/Store/Test/Unit/Setup/UpgradeDataTest.php b/app/code/Magento/Store/Test/Unit/Setup/UpgradeDataTest.php
index 0dc7de4224c43..210e187b78b47 100644
--- a/app/code/Magento/Store/Test/Unit/Setup/UpgradeDataTest.php
+++ b/app/code/Magento/Store/Test/Unit/Setup/UpgradeDataTest.php
@@ -102,6 +102,9 @@ public function testUpgradeToVersion210(array $groupList, array $expectedCodes)
$this->model->upgrade($this->setupMock, $this->contextMock);
}
+ /**
+ * @return array
+ */
public function upgradeDataProvider()
{
return [
diff --git a/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php b/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
index ed9ac7ebe438a..51e3a9dc32e13 100644
--- a/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
+++ b/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
@@ -22,6 +22,11 @@ class RouteParamsResolverTest extends \PHPUnit\Framework\TestCase
*/
protected $queryParamsResolverMock;
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Store
+ */
+ protected $storeMock;
+
/**
* @var \Magento\Store\Url\Plugin\RouteParamsResolver
*/
@@ -30,7 +35,19 @@ class RouteParamsResolverTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
$this->scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
+
+ $this->storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
+ ->setMethods(['getCode'])
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->storeMock->expects($this->any())->method('getCode')->willReturn('custom_store');
+
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
+ $this->storeManagerMock
+ ->expects($this->once())
+ ->method('getStore')
+ ->willReturn($this->storeMock);
+
$this->queryParamsResolverMock = $this->createMock(\Magento\Framework\Url\QueryParamsResolverInterface::class);
$this->model = new \Magento\Store\Url\Plugin\RouteParamsResolver(
$this->scopeConfigMock,
@@ -42,6 +59,8 @@ protected function setUp()
public function testBeforeSetRouteParamsScopeInParams()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -52,7 +71,7 @@ public function testBeforeSetRouteParamsScopeInParams()
)
->will($this->returnValue(false));
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -61,7 +80,8 @@ public function testBeforeSetRouteParamsScopeInParams()
$routeParamsResolverMock->expects($this->once())->method('setScope')->with($storeCode);
$routeParamsResolverMock->expects($this->once())->method('getScope')->willReturn($storeCode);
- $this->queryParamsResolverMock->expects($this->once())->method('setQueryParam')->with('___store', $storeCode);
+ $this->queryParamsResolverMock->expects($this->never())->method('setQueryParam');
+
$this->model->beforeSetRouteParams(
$routeParamsResolverMock,
@@ -72,6 +92,8 @@ public function testBeforeSetRouteParamsScopeInParams()
public function testBeforeSetRouteParamsScopeUseStoreInUrl()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -81,8 +103,9 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
$storeCode
)
->will($this->returnValue(true));
+
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -91,7 +114,7 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
$routeParamsResolverMock->expects($this->once())->method('setScope')->with($storeCode);
$routeParamsResolverMock->expects($this->once())->method('getScope')->willReturn($storeCode);
- $this->queryParamsResolverMock->expects($this->never())->method('setQueryParam');
+ $this->queryParamsResolverMock->expects($this->once())->method('setQueryParam')->with('___store', $storeCode);
$this->model->beforeSetRouteParams(
$routeParamsResolverMock,
@@ -102,6 +125,8 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
public function testBeforeSetRouteParamsSingleStore()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -112,7 +137,7 @@ public function testBeforeSetRouteParamsSingleStore()
)
->will($this->returnValue(false));
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(true);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -132,6 +157,8 @@ public function testBeforeSetRouteParamsSingleStore()
public function testBeforeSetRouteParamsNoScopeInParams()
{
$storeCode = 'custom_store';
+ $data = ['_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -140,17 +167,10 @@ public function testBeforeSetRouteParamsNoScopeInParams()
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeCode
)
- ->will($this->returnValue(false));
+ ->will($this->returnValue(true));
+
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- /** @var \PHPUnit_Framework_MockObject_MockObject| $routeParamsResolverMock */
- $storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
- ->setMethods(['getCode'])
- ->disableOriginalConstructor()
- ->getMock();
- $storeMock->expects($this->any())->method('getCode')->willReturn($storeCode);
- $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock);
- $data = ['_scope_to_url' => true];
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
diff --git a/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php b/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
index c4f8a31430963..325e621c8a113 100644
--- a/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
+++ b/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
@@ -51,6 +51,8 @@ public function __construct(
* @param \Magento\Framework\Url\RouteParamsResolver $subject
* @param array $data
* @param bool $unsetOldParams
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ *
* @return array
*/
public function beforeSetRouteParams(
@@ -63,13 +65,19 @@ public function beforeSetRouteParams(
unset($data['_scope']);
}
if (isset($data['_scope_to_url']) && (bool)$data['_scope_to_url'] === true) {
- $storeCode = $subject->getScope() ?: $this->storeManager->getStore()->getCode();
+ /** @var Store $currentScope */
+ $currentScope = $subject->getScope();
+ $storeCode = $currentScope && $currentScope instanceof Store ?
+ $currentScope->getCode() :
+ $this->storeManager->getStore()->getCode();
+
$useStoreInUrl = $this->scopeConfig->getValue(
Store::XML_PATH_STORE_IN_URL,
StoreScopeInterface::SCOPE_STORE,
$storeCode
);
- if (!$useStoreInUrl && !$this->storeManager->hasSingleStore()) {
+
+ if ($useStoreInUrl && !$this->storeManager->hasSingleStore()) {
$this->queryParamsResolver->setQueryParam('___store', $storeCode);
}
}
diff --git a/app/code/Magento/Swagger/Api/Data/SchemaTypeInterface.php b/app/code/Magento/Swagger/Api/Data/SchemaTypeInterface.php
new file mode 100644
index 0000000000000..f1bc6fcc105dc
--- /dev/null
+++ b/app/code/Magento/Swagger/Api/Data/SchemaTypeInterface.php
@@ -0,0 +1,34 @@
+hasSchemaTypes()) {
+ return null;
+ }
+
+ $schemaTypeCode = $this->getRequest()->getParam(
+ 'type',
+ $this->getDefaultSchemaTypeCode()
+ );
+
+ if (!array_key_exists($schemaTypeCode, $this->getSchemaTypes())) {
+ throw new \UnexpectedValueException(
+ new Phrase('Unknown schema type supplied')
+ );
+ }
+
+ return $this->getSchemaTypes()[$schemaTypeCode];
+ }
+
+ /**
+ * @return string|null
*/
public function getSchemaUrl()
{
- return rtrim($this->getBaseUrl(), '/') . '/rest/' . $this->getParamStore() . '/schema?services=all';
+ if ($this->getSchemaType() === null) {
+ return null;
+ }
+
+ return rtrim($this->getBaseUrl(), '/') .
+ $this->getSchemaType()->getSchemaUrlPath($this->getParamStore());
}
}
diff --git a/app/code/Magento/Swagger/Controller/Index/Index.php b/app/code/Magento/Swagger/Controller/Index/Index.php
index e10a9235c4181..162367aaf81f9 100644
--- a/app/code/Magento/Swagger/Controller/Index/Index.php
+++ b/app/code/Magento/Swagger/Controller/Index/Index.php
@@ -7,6 +7,7 @@
/**
* Class Index
+ *
* @package Magento\Swagger\Controller\Index
*/
class Index extends \Magento\Framework\App\Action\Action
diff --git a/app/code/Magento/Swagger/Test/Unit/Block/IndexTest.php b/app/code/Magento/Swagger/Test/Unit/Block/IndexTest.php
new file mode 100644
index 0000000000000..df35e0807a6ab
--- /dev/null
+++ b/app/code/Magento/Swagger/Test/Unit/Block/IndexTest.php
@@ -0,0 +1,100 @@
+requestMock = $this->getMockBuilder(RequestInterface::class)->getMock();
+ $this->schemaTypeMock = $this->getMockBuilder(SchemaTypeInterface::class)->getMock();
+
+ $this->index = (new ObjectManager($this))->getObject(
+ Index::class,
+ [
+ 'context' => (new ObjectManager($this))->getObject(
+ Context::class,
+ [
+ 'request' => $this->requestMock,
+ ]
+ ),
+ 'data' => [
+ 'schema_types' => [
+ 'test' => $this->schemaTypeMock
+ ]
+ ]
+ ]
+ );
+ }
+
+ /**
+ * Test that the passed URL parameter is used when it is a valid schema type.
+ *
+ * @covers \Magento\Swagger\Block\Index::getSchemaUrl()
+ */
+ public function testGetSchemaUrlValidType()
+ {
+ $this->requestMock->expects($this->atLeastOnce())
+ ->method('getParam')
+ ->willReturn('test');
+
+ $this->schemaTypeMock->expects($this->any())
+ ->method('getCode')->willReturn('test');
+
+ $this->schemaTypeMock->expects($this->once())
+ ->method('getSchemaUrlPath')
+ ->willReturn('/test');
+
+ $this->assertEquals('/test', $this->index->getSchemaUrl());
+ }
+
+ /**
+ * Test that Swagger UI throws an exception if an invalid schema type is supplied.
+ *
+ * @covers \Magento\Swagger\Block\Index::getSchemaUrl()
+ */
+ public function testGetSchemaUrlInvalidType()
+ {
+ $this->requestMock->expects($this->atLeastOnce())
+ ->method('getParam')
+ ->willReturn('invalid');
+
+ $this->schemaTypeMock->expects($this->any())
+ ->method('getCode')->willReturn('test');
+
+ $this->expectException(\UnexpectedValueException::class);
+
+ $this->index->getSchemaUrl();
+ }
+}
diff --git a/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php
index 6931979b52f98..c409cd6ca7504 100644
--- a/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php
+++ b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php
@@ -4,6 +4,8 @@
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Swagger\Test\Unit\Controller\Index;
class IndexTest extends \PHPUnit\Framework\TestCase
diff --git a/app/code/Magento/Swagger/etc/module.xml b/app/code/Magento/Swagger/etc/module.xml
index 8f1086057b57e..b825e359db6dd 100644
--- a/app/code/Magento/Swagger/etc/module.xml
+++ b/app/code/Magento/Swagger/etc/module.xml
@@ -6,5 +6,9 @@
*/
-->
-
+
+
+
+
+
diff --git a/app/code/Magento/SwaggerWebapi/LICENSE.txt b/app/code/Magento/SwaggerWebapi/LICENSE.txt
new file mode 100644
index 0000000000000..49525fd99da9c
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/LICENSE.txt
@@ -0,0 +1,48 @@
+
+Open Software License ("OSL") v. 3.0
+
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Open Software License version 3.0
+
+ 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+ 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+ 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+ 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
+
+ 4. to perform the Original Work publicly; and
+
+ 5. to display the Original Work publicly.
+
+ 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+ 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+ 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+ 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+ 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+ 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+ 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+ 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+ 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+ 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+ 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+ 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+ 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+ 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+ 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
\ No newline at end of file
diff --git a/app/code/Magento/SwaggerWebapi/LICENSE_AFL.txt b/app/code/Magento/SwaggerWebapi/LICENSE_AFL.txt
new file mode 100644
index 0000000000000..f39d641b18a19
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/LICENSE_AFL.txt
@@ -0,0 +1,48 @@
+
+Academic Free License ("AFL") v. 3.0
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Academic Free License version 3.0
+
+ 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+ 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+ 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+ 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
+
+ 4. to perform the Original Work publicly; and
+
+ 5. to display the Original Work publicly.
+
+ 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+ 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+ 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+ 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+ 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+ 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+ 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+ 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+ 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+ 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+ 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+ 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+ 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+ 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+ 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
diff --git a/app/code/Magento/SwaggerWebapi/Model/SchemaType/Rest.php b/app/code/Magento/SwaggerWebapi/Model/SchemaType/Rest.php
new file mode 100644
index 0000000000000..d5a8206a324e7
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/Model/SchemaType/Rest.php
@@ -0,0 +1,51 @@
+code = $code;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCode()
+ {
+ return $this->code;
+ }
+
+ /**
+ * @param string|null $store
+ * @return string
+ */
+ public function getSchemaUrlPath($store = null)
+ {
+ $store = $store ?? 'all';
+
+ return '/' . $this->code . '/' . $store . '/schema?services=all';
+ }
+}
diff --git a/app/code/Magento/SwaggerWebapi/README.md b/app/code/Magento/SwaggerWebapi/README.md
new file mode 100644
index 0000000000000..3529848949d77
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/README.md
@@ -0,0 +1 @@
+The Magento_SwaggerWebapi module provides the implementation of the REST Webapi module with Magento_Swagger.
\ No newline at end of file
diff --git a/app/code/Magento/SwaggerWebapi/Test/Unit/Model/SchemaType/RestTest.php b/app/code/Magento/SwaggerWebapi/Test/Unit/Model/SchemaType/RestTest.php
new file mode 100644
index 0000000000000..776dd29b6832d
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/Test/Unit/Model/SchemaType/RestTest.php
@@ -0,0 +1,66 @@
+rest = new Rest('rest');
+ }
+
+ /**
+ * @covers \Magento\SwaggerWebapi\Model\SchemaType\Rest::getSchemaUrlPath
+ *
+ * @param $expected
+ * @param null|string $store
+ *
+ * @dataProvider getSchemaUrlPathProvider
+ */
+ public function testGetSchemaUrlPath($expected, $store = null)
+ {
+ $this->assertEquals($expected, $this->rest->getSchemaUrlPath($store));
+ }
+
+ /**
+ * @covers \Magento\SwaggerWebapi\Model\SchemaType\Rest::getCode()
+ */
+ public function testGetCode()
+ {
+ $this->assertEquals('rest', $this->rest->getCode());
+ }
+
+ /**
+ * @return array
+ */
+ public function getSchemaUrlPathProvider()
+ {
+ return [
+ [
+ '/rest/all/schema?services=all',
+ null
+ ],
+ [
+ '/rest/test/schema?services=all',
+ 'test'
+ ]
+ ];
+ }
+}
diff --git a/app/code/Magento/SwaggerWebapi/composer.json b/app/code/Magento/SwaggerWebapi/composer.json
new file mode 100644
index 0000000000000..7f9b2f258d6f8
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "magento/module-swagger-webapi",
+ "description": "N/A",
+ "require": {
+ "php": "~7.0.13|~7.1.0",
+ "magento/framework": "101.0.*",
+ "magento/module-swagger": "*"
+ },
+ "type": "magento2-module",
+ "version": "100.0.0",
+ "license": [
+ "OSL-3.0",
+ "AFL-3.0"
+ ],
+ "autoload": {
+ "files": [
+ "registration.php"
+ ],
+ "psr-4": {
+ "Magento\\SwaggerWebapi\\": ""
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/code/Magento/SwaggerWebapi/etc/frontend/di.xml b/app/code/Magento/SwaggerWebapi/etc/frontend/di.xml
new file mode 100644
index 0000000000000..5b54eee0faa79
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/etc/frontend/di.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ rest
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/SwaggerWebapi/etc/module.xml b/app/code/Magento/SwaggerWebapi/etc/module.xml
new file mode 100644
index 0000000000000..d4e319eedd296
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/etc/module.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/SwaggerWebapi/registration.php b/app/code/Magento/SwaggerWebapi/registration.php
new file mode 100644
index 0000000000000..595497df7cfeb
--- /dev/null
+++ b/app/code/Magento/SwaggerWebapi/registration.php
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+ - Magento\SwaggerWebapi\Model\SchemaType\Rest
+
+ rest
+
+
+
+
diff --git a/app/code/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Plugin/Save.php b/app/code/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Plugin/Save.php
index dfda76372df1f..383c97a166d34 100644
--- a/app/code/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Plugin/Save.php
+++ b/app/code/Magento/Swatches/Controller/Adminhtml/Product/Attribute/Plugin/Save.php
@@ -11,7 +11,7 @@
use Magento\Swatches\Model\Swatch;
/**
- * Class Save
+ * Plugin for product attribute save controller.
*/
class Save
{
@@ -24,7 +24,17 @@ class Save
public function beforeDispatch(Attribute\Save $subject, RequestInterface $request)
{
$data = $request->getPostValue();
+
if (isset($data['frontend_input'])) {
+ //Data is serialized to overcome issues caused by max_input_vars value if it's modification is unavailable.
+ //See subject controller code and comments for more info.
+ if (isset($data['serialized_swatch_values'])
+ && in_array($data['frontend_input'], ['swatch_visual', 'swatch_text'])
+ ) {
+ $data['serialized_options'] = $data['serialized_swatch_values'];
+ unset($data['serialized_swatch_values']);
+ }
+
switch ($data['frontend_input']) {
case 'swatch_visual':
$data[Swatch::SWATCH_INPUT_TYPE_KEY] = Swatch::SWATCH_INPUT_TYPE_VISUAL;
diff --git a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php
index d3904f058dc2d..76bf5782d3922 100644
--- a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php
+++ b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php
@@ -10,6 +10,7 @@
use Magento\Framework\Exception\InputException;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Swatches\Model\Swatch;
+use Magento\Swatches\Model\ResourceModel\Swatch as SwatchResource;
/**
* Plugin model for Catalog Resource Attribute
@@ -18,6 +19,11 @@ class EavAttribute
{
const DEFAULT_STORE_ID = 0;
+ /**
+ * @var SwatchResource
+ */
+ private $swatchResource;
+
/**
* Base option title used for string operations to detect is option already exists or new
*/
@@ -64,17 +70,20 @@ class EavAttribute
* @param \Magento\Swatches\Model\SwatchFactory $swatchFactory
* @param \Magento\Swatches\Helper\Data $swatchHelper
* @param Json|null $serializer
+ * @param SwatchResource|null $swatchResource
*/
public function __construct(
\Magento\Swatches\Model\ResourceModel\Swatch\CollectionFactory $collectionFactory,
\Magento\Swatches\Model\SwatchFactory $swatchFactory,
\Magento\Swatches\Helper\Data $swatchHelper,
- Json $serializer = null
+ Json $serializer = null,
+ SwatchResource $swatchResource = null
) {
$this->swatchCollectionFactory = $collectionFactory;
$this->swatchFactory = $swatchFactory;
$this->swatchHelper = $swatchHelper;
$this->serializer = $serializer ?: ObjectManager::getInstance()->create(Json::class);
+ $this->swatchResource = $swatchResource ?: ObjectManager::getInstance()->create(SwatchResource::class);
}
/**
@@ -148,6 +157,7 @@ protected function setProperOptionsArray(Attribute $attribute)
* Prepare attribute for conversion from any swatch type to dropdown
*
* @param Attribute $attribute
+ * @throws \Magento\Framework\Exception\LocalizedException
* @return void
*/
protected function convertSwatchToDropdown(Attribute $attribute)
@@ -157,6 +167,7 @@ protected function convertSwatchToDropdown(Attribute $attribute)
if (!empty($additionalData)) {
$additionalData = $this->serializer->unserialize($additionalData);
if (is_array($additionalData) && isset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY])) {
+ $this->cleanEavAttributeOptionSwatchValues($attribute->getOption());
unset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY]);
$attribute->setData('additional_data', $this->serializer->serialize($additionalData));
}
@@ -235,6 +246,7 @@ protected function saveSwatchParams(Attribute $attribute)
{
if ($this->swatchHelper->isVisualSwatch($attribute)) {
$this->processVisualSwatch($attribute);
+ $this->cleanTextSwatchValuesAfterSwitch($attribute->getOptiontext());
} elseif ($this->swatchHelper->isTextSwatch($attribute)) {
$this->processTextualSwatch($attribute);
}
@@ -267,6 +279,33 @@ protected function processVisualSwatch(Attribute $attribute)
}
}
+ /**
+ * Clean swatch option values after switching to the dropdown type.
+ *
+ * @param array $attributeOptions
+ * @param null $swatchType
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ private function cleanEavAttributeOptionSwatchValues($attributeOptions, $swatchType = null)
+ {
+ if (count($attributeOptions) && isset($attributeOptions['value'])) {
+ $optionsIDs = array_keys($attributeOptions['value']);
+
+ $this->swatchResource->clearSwatchOptionByOptionIdAndType($optionsIDs, $swatchType);
+ }
+ }
+
+ /**
+ * Cleaning the text type of swatch option values after switching.
+ *
+ * @param array $attributeOptions
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ private function cleanTextSwatchValuesAfterSwitch($attributeOptions)
+ {
+ $this->cleanEavAttributeOptionSwatchValues($attributeOptions, Swatch::SWATCH_TYPE_TEXTUAL);
+ }
+
/**
* @param string $value
* @return int
diff --git a/app/code/Magento/Swatches/Model/ResourceModel/Swatch.php b/app/code/Magento/Swatches/Model/ResourceModel/Swatch.php
index 22eb1d4c7eef9..8ca694725511d 100644
--- a/app/code/Magento/Swatches/Model/ResourceModel/Swatch.php
+++ b/app/code/Magento/Swatches/Model/ResourceModel/Swatch.php
@@ -37,4 +37,24 @@ public function saveDefaultSwatchOption($id, $defaultValue)
$this->getConnection()->update($this->getTable('eav_attribute'), $bind, $where);
}
}
+
+ /**
+ * Cleaned swatch option values when switching to dropdown input type
+ *
+ * @param $optionIDs
+ * @param $type
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ public function clearSwatchOptionByOptionIdAndType($optionIDs, $type = null)
+ {
+ if (count($optionIDs)) {
+ foreach ($optionIDs as $optionId) {
+ $where = ['option_id' => $optionId];
+ if ($type !== null) {
+ $where['type = ?'] = $type;
+ }
+ $this->getConnection()->delete($this->getMainTable(), $where);
+ }
+ }
+ }
}
diff --git a/app/code/Magento/Swatches/Model/SwatchAttributesProvider.php b/app/code/Magento/Swatches/Model/SwatchAttributesProvider.php
index 820d8bf107d5d..2dc00fcf9a428 100644
--- a/app/code/Magento/Swatches/Model/SwatchAttributesProvider.php
+++ b/app/code/Magento/Swatches/Model/SwatchAttributesProvider.php
@@ -39,6 +39,8 @@ class SwatchAttributesProvider
private $swatchTypeChecker;
/**
+ * SwatchAttributesProvider constructor.
+ *
* @param Configurable $typeConfigurable
* @param SwatchAttributeCodes $swatchAttributeCodes
* @param SwatchAttributeType|null $swatchTypeChecker
diff --git a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php
index a86c745c7c810..0d0444ddda38b 100644
--- a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php
@@ -160,6 +160,9 @@ public function testGetStoreOptionValues($values)
$this->assertEquals($result, $values);
}
+ /**
+ * @return array
+ */
public function dataForGetStoreOptionValues()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/FormTest.php b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/FormTest.php
index aad8741735813..168a682961bc6 100644
--- a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/FormTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/FormTest.php
@@ -21,6 +21,9 @@ public function testAddValues($values)
$this->assertEquals($block, $result);
}
+ /**
+ * @return array
+ */
public function dataForAddValues()
{
$additionalData = [
diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php
index 19a05dad151c4..a28f3db8fb392 100644
--- a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php
@@ -130,6 +130,9 @@ public function testExecute($fileResult, $expectedResult)
$this->controller->execute();
}
+ /**
+ * @return array
+ */
public function dataForExecute()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Product/Attribute/Plugin/SaveTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Product/Attribute/Plugin/SaveTest.php
index 66f0d484c9e83..c9c826b3a7831 100644
--- a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Product/Attribute/Plugin/SaveTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Product/Attribute/Plugin/SaveTest.php
@@ -39,6 +39,9 @@ public function testBeforeDispatch($dataRequest, $runTimes)
$controller->beforeDispatch($subject, $request);
}
+ /**
+ * @return array
+ */
public function dataRequest()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php
index 751375813a83a..5732018f7615f 100644
--- a/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php
@@ -141,6 +141,9 @@ protected function setUp()
);
}
+ /**
+ * @return array
+ */
public function dataForAdditionalData()
{
$additionalData = [
@@ -192,6 +195,9 @@ public function testAssembleAdditionalDataEavAttribute($dataFromDb, $attributeDa
$this->swatchHelperObject->assembleAdditionalDataEavAttribute($this->attributeMock);
}
+ /**
+ * @return array
+ */
public function dataForAssembleEavAttribute()
{
$additionalData = [
@@ -236,6 +242,9 @@ public function testLoadFirstVariationWithSwatchImage($imageTypes, $expected, $r
}
}
+ /**
+ * @return array
+ */
public function dataForVariationWithSwatchImage()
{
return [
@@ -299,6 +308,9 @@ public function testLoadFirstVariationWithImage($imageTypes, $expected, $require
}
}
+ /**
+ * @return array
+ */
public function dataForVariationWithImage()
{
return [
@@ -405,6 +417,9 @@ public function testGetProductMediaGallery($mediaGallery, $image)
}
}
+ /**
+ * @return array
+ */
public function dataForMediaGallery()
{
return [
@@ -442,6 +457,10 @@ protected function getSwatchAttributes()
->willReturn($returnFromProvideMethod);
}
+ /**
+ * @param array $attributes
+ * @param array $imageTypes
+ */
protected function getUsedProducts(array $attributes, array $imageTypes)
{
$this->productMock
@@ -535,6 +554,9 @@ protected function addfilterByParent()
$zendDbSelectMock->method('where')->willReturn($zendDbSelectMock);
}
+ /**
+ * @return array
+ */
public function dataForCreateSwatchProduct()
{
$productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
@@ -571,6 +593,9 @@ public function dataForCreateSwatchProduct()
];
}
+ /**
+ * @return array
+ */
public function dataForCreateSwatchProductByFallback()
{
$productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
@@ -612,6 +637,9 @@ public function testGetSwatchAttributesAsArray($optionsArray, $attributeData, $e
$this->assertEquals($result, $expected);
}
+ /**
+ * @return array
+ */
public function dataForGettingSwatchAsArray()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php
index ca267278291e3..aed9c1da41289 100644
--- a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php
@@ -114,6 +114,9 @@ public function testGetSwatchAttributeImage($swatchType, $expectedResult)
$this->assertEquals($result, $expectedResult);
}
+ /**
+ * @return array
+ */
public function dataForFullPath()
{
return [
@@ -202,6 +205,9 @@ public function testGetFolderNameSize($swatchType, $imageConfig, $expectedResult
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public function dataForFolderName()
{
return [
@@ -293,6 +299,9 @@ public function testGetSwatchCachePath($swatchType, $expectedResult)
$this->assertEquals($expectedResult, $this->mediaHelperObject->getSwatchCachePath($swatchType));
}
+ /**
+ * @return array
+ */
public function getSwatchTypes()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php
index 31a45ddb2847c..317ea77107222 100644
--- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php
@@ -310,6 +310,9 @@ public function testBeforeSaveNotSwatch()
$this->eavAttribute->beforeBeforeSave($this->attribute);
}
+ /**
+ * @return array
+ */
public function visualSwatchProvider()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php
index abec4569c81dc..3f98519ac1806 100644
--- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php
@@ -98,6 +98,9 @@ public function testBeforeGetImage($expected)
$this->assertEquals([$this->productMock, $expected['page_handle'], []], $result);
}
+ /**
+ * @param $expected
+ */
protected function canReplaceImageWithSwatch($expected)
{
$this->swatchesHelperMock
diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductTest.php
index 791ba83b374c6..d7422786aec67 100644
--- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductTest.php
@@ -39,6 +39,9 @@ public function testAfterGetMediaAttributes($productType, $hasKey)
}
}
+ /**
+ * @return array
+ */
public function dataRoles()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributesProviderTest.php b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributesProviderTest.php
index 1f69c6d5f2fa3..ec52d759ebafa 100644
--- a/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributesProviderTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributesProviderTest.php
@@ -44,7 +44,7 @@ protected function setUp()
{
$this->typeConfigurable = $this->createPartialMock(
Configurable::class,
- ['getConfigurableAttributes', 'getCodes']
+ ['getConfigurableAttributes', 'getCodes', 'getProductAttribute']
);
$this->swatchAttributeCodes = $this->createMock(SwatchAttributeCodes::class);
@@ -65,8 +65,9 @@ public function testProvide()
$this->productMock->method('getTypeId')
->willReturn(Configurable::TYPE_CODE);
- $productAttributeMock = $this->getMockBuilder(Attribute::class)
+ $attributeMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
->disableOriginalConstructor()
+ ->setMethods(['setStoreId', 'getData', 'setData', 'getSource', 'hasData'])
->getMock();
$configAttributeMock = $this->createPartialMock(
@@ -79,7 +80,7 @@ public function testProvide()
$configAttributeMock
->method('getProductAttribute')
- ->willReturn($productAttributeMock);
+ ->willReturn($attributeMock);
$this->typeConfigurable
->method('getConfigurableAttributes')
@@ -92,8 +93,9 @@ public function testProvide()
->willReturn($swatchAttributes);
$this->swatchTypeChecker->expects($this->once())->method('isSwatchAttribute')->willReturn(true);
+
$result = $this->swatchAttributeProvider->provide($this->productMock);
- $this->assertEquals([1 => $productAttributeMock], $result);
+ $this->assertEquals([1 => $attributeMock], $result);
}
}
diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php
index 8292e0c2ed1bb..45c680366264b 100644
--- a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php
@@ -73,6 +73,9 @@ public function testAddFields($expected)
$this->observerMock->execute($this->eventObserverMock);
}
+ /**
+ * @return array
+ */
public function dataAddFields()
{
return [
diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php
index c24dd820e0144..f78797d93cb0d 100644
--- a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php
+++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php
@@ -66,6 +66,9 @@ public function testAddSwatchAttributeType($exp)
$this->observerMock->execute($this->eventObserverMock);
}
+ /**
+ * @return array
+ */
public function dataAddSwatch()
{
return [
diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js
index ec24c11ef854d..1a58e4b6f2e7a 100644
--- a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js
+++ b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js
@@ -413,6 +413,8 @@ define([
};
$(function () {
+ var editForm = $('#edit_form');
+
$('#frontend_input').bind('change', function () {
swatchProductAttributes.bindAttributeInputType();
});
@@ -426,6 +428,32 @@ define([
$('.attribute-popup .collapse, [data-role="advanced_fieldset-content"]')
.collapsable()
.collapse('hide');
+
+ editForm.on('submit', function () {
+ var activePanel,
+ swatchValues = [],
+ swatchVisualPanel = $('#swatch-visual-options-panel'),
+ swatchTextPanel = $('#swatch-text-options-panel');
+
+ activePanel = swatchTextPanel.is(':visible') ? swatchTextPanel : swatchVisualPanel;
+
+ activePanel.find('table input')
+ .each(function () {
+ swatchValues.push(this.name + '=' + $(this).val());
+ });
+
+ $(' ').attr({
+ type: 'hidden',
+ name: 'serialized_swatch_values'
+ })
+ .val(JSON.stringify(swatchValues))
+ .prependTo(editForm);
+
+ [swatchVisualPanel, swatchTextPanel].forEach(function (el) {
+ $(el).find('table')
+ .replaceWith($('').text($.mage.__('Sending swatch values as package.')));
+ });
+ });
});
window.saveAttributeInNewSet = swatchProductAttributes.saveAttributeInNewSet;
diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php
index bfc0a99de37a1..c4c4f28e8a7d1 100644
--- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php
+++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php
@@ -33,7 +33,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
/**
* @var string
*/
- protected $_template = 'rate/form.phtml';
+ protected $_template = 'Magento_Tax::rate/form.phtml';
/**
* Tax data
diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php
index e1e866c06571b..9612b57f8d5d8 100644
--- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php
+++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php
@@ -23,7 +23,7 @@ class Title extends \Magento\Framework\View\Element\Template
/**
* @var string
*/
- protected $_template = 'rate/title.phtml';
+ protected $_template = 'Magento_Tax::rate/title.phtml';
/**
* @var \Magento\Store\Model\StoreFactory
diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Add.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Add.php
index 9cf96bc21e962..16d828542c5b9 100644
--- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Add.php
+++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Add.php
@@ -20,7 +20,7 @@ class Add extends \Magento\Backend\Block\Template implements \Magento\Backend\Bl
/**
* @var string
*/
- protected $_template = 'toolbar/rate/add.phtml';
+ protected $_template = 'Magento_Tax::toolbar/rate/add.phtml';
/**
* @var \Magento\Backend\Block\Widget\Button\ButtonList
diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Save.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Save.php
index 19c5fab72ac4b..4eaaa3be8a8f2 100644
--- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Save.php
+++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Toolbar/Save.php
@@ -16,7 +16,7 @@ class Save extends \Magento\Backend\Block\Template implements \Magento\Backend\B
/**
* @var string
*/
- protected $_template = 'toolbar/rate/save.phtml';
+ protected $_template = 'Magento_Tax::toolbar/rate/save.phtml';
/**
* @var \Magento\Backend\Block\Widget\Button\ButtonList
diff --git a/app/code/Magento/Tax/Block/Checkout/Grandtotal.php b/app/code/Magento/Tax/Block/Checkout/Grandtotal.php
index 68de4cb24a487..77af1ad99ea2c 100644
--- a/app/code/Magento/Tax/Block/Checkout/Grandtotal.php
+++ b/app/code/Magento/Tax/Block/Checkout/Grandtotal.php
@@ -15,7 +15,7 @@ class Grandtotal extends \Magento\Checkout\Block\Total\DefaultTotal
*
* @var string
*/
- protected $_template = 'checkout/grandtotal.phtml';
+ protected $_template = 'Magento_Tax::checkout/grandtotal.phtml';
/**
* @var \Magento\Tax\Model\Config
diff --git a/app/code/Magento/Tax/Block/Checkout/Shipping.php b/app/code/Magento/Tax/Block/Checkout/Shipping.php
index e9098035053be..299c586fd224c 100644
--- a/app/code/Magento/Tax/Block/Checkout/Shipping.php
+++ b/app/code/Magento/Tax/Block/Checkout/Shipping.php
@@ -15,7 +15,7 @@ class Shipping extends \Magento\Checkout\Block\Total\DefaultTotal
*
* @var string
*/
- protected $_template = 'checkout/shipping.phtml';
+ protected $_template = 'Magento_Tax::checkout/shipping.phtml';
/**
* @var \Magento\Tax\Model\Config
diff --git a/app/code/Magento/Tax/Block/Checkout/Subtotal.php b/app/code/Magento/Tax/Block/Checkout/Subtotal.php
index 7a9059df08bab..22da07954159d 100644
--- a/app/code/Magento/Tax/Block/Checkout/Subtotal.php
+++ b/app/code/Magento/Tax/Block/Checkout/Subtotal.php
@@ -15,7 +15,7 @@ class Subtotal extends \Magento\Checkout\Block\Total\DefaultTotal
*
* @var string
*/
- protected $_template = 'checkout/subtotal.phtml';
+ protected $_template = 'Magento_Tax::checkout/subtotal.phtml';
/**
* @var \Magento\Tax\Model\Config
diff --git a/app/code/Magento/Tax/Block/Checkout/Tax.php b/app/code/Magento/Tax/Block/Checkout/Tax.php
index f741e64019de1..0a86c0312ab1c 100644
--- a/app/code/Magento/Tax/Block/Checkout/Tax.php
+++ b/app/code/Magento/Tax/Block/Checkout/Tax.php
@@ -14,5 +14,5 @@ class Tax extends \Magento\Checkout\Block\Total\DefaultTotal
/**
* @var string
*/
- protected $_template = 'checkout/tax.phtml';
+ protected $_template = 'Magento_Tax::checkout/tax.phtml';
}
diff --git a/app/code/Magento/Tax/Test/Unit/Block/Checkout/ShippingTest.php b/app/code/Magento/Tax/Test/Unit/Block/Checkout/ShippingTest.php
index c1aa2b0c9900d..e7a11ec45ad3f 100644
--- a/app/code/Magento/Tax/Test/Unit/Block/Checkout/ShippingTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Block/Checkout/ShippingTest.php
@@ -44,6 +44,9 @@ public function testDisplayShipping($shippingMethod, $expectedResult)
$this->assertEquals($expectedResult, $this->model->displayShipping());
}
+ /**
+ * @return array
+ */
public function displayShippingDataProvider()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Block/Item/Price/RendererTest.php b/app/code/Magento/Tax/Test/Unit/Block/Item/Price/RendererTest.php
index 1a16e69724479..90f0f09215889 100644
--- a/app/code/Magento/Tax/Test/Unit/Block/Item/Price/RendererTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Block/Item/Price/RendererTest.php
@@ -96,6 +96,9 @@ public function testDisplayPriceInclTax($zone, $methodName)
$this->assertEquals($flag, $this->renderer->displayPriceInclTax());
}
+ /**
+ * @return array
+ */
public function displayPriceInclTaxDataProvider()
{
$data = [
@@ -143,6 +146,9 @@ public function testDisplayPriceExclTax($zone, $methodName)
$this->assertEquals($flag, $this->renderer->displayPriceExclTax());
}
+ /**
+ * @return array
+ */
public function displayPriceExclTaxDataProvider()
{
$data = [
@@ -190,6 +196,9 @@ public function testDisplayBothPrices($zone, $methodName)
$this->assertEquals($flag, $this->renderer->displayBothPrices());
}
+ /**
+ * @return array
+ */
public function displayBothPricesDataProvider()
{
$data = [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
index e6a29177301dd..47ec0d8732d81 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
@@ -312,6 +312,9 @@ public function testSaveThrowsExceptionIfCannotSaveTitles($expectedException, $e
$this->model->save($rateMock);
}
+ /**
+ * @return array
+ */
public function saveThrowsExceptionIfCannotSaveTitlesDataProvider()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php
index 912f42af0d3cd..82a473b42a82e 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php
@@ -63,6 +63,9 @@ protected function setUp()
);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupOrderMock()
{
$orderMock = $this->getMockBuilder(\Magento\Sales\Model\Order::class)
@@ -80,6 +83,9 @@ protected function setupOrderMock()
return $orderMock;
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupExtensionAttributeMock()
{
$orderExtensionAttributeMock = $this->getMockBuilder(\Magento\Sales\Api\Data\OrderExtensionInterface::class)
@@ -95,6 +101,9 @@ protected function setupExtensionAttributeMock()
return $orderExtensionAttributeMock;
}
+ /**
+ * @param $expectedTaxes
+ */
protected function verifyOrderTaxes($expectedTaxes)
{
$index = 0;
@@ -125,6 +134,9 @@ protected function verifyOrderTaxes($expectedTaxes)
}
}
+ /**
+ * @param $expectedItemTaxes
+ */
public function verifyItemTaxes($expectedItemTaxes)
{
$index = 0;
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php
index e5bd728e180f6..5e806bf36fc53 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php
@@ -108,6 +108,11 @@ function ($value) {
);
}
+ /**
+ * @param array $data
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupTaxTotal(array $data)
{
$taxTotalMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Address\Total::class)
@@ -121,6 +126,11 @@ protected function setupTaxTotal(array $data)
return $taxTotalMock;
}
+ /**
+ * @param array $taxRate
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupTaxRateFactoryMock(array $taxRate)
{
$taxRateMock = $this->getMockBuilder(\Magento\Tax\Api\Data\GrandTotalRatesInterface::class)
@@ -142,6 +152,11 @@ protected function setupTaxRateFactoryMock(array $taxRate)
return $taxRateMock;
}
+ /**
+ * @param array $taxDetails
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupTaxDetails(array $taxDetails)
{
$taxDetailsMock = $this->getMockBuilder(\Magento\Tax\Api\Data\GrandTotalDetailsInterface::class)
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php
index 23ce032764a8f..09f82b32137b3 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php
@@ -64,6 +64,9 @@ protected function setUp()
);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function setupOrderExtensionAttributeMock()
{
$orderExtensionAttributeMock = $this->getMockBuilder(\Magento\Sales\Api\Data\OrderExtensionInterface::class)
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
index 6440751961796..9b963434e321d 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
@@ -183,6 +183,9 @@ public function testGetShippingDataObject(
}
}
+ /**
+ * @return array
+ */
public function getShippingDataObjectDataProvider()
{
$data = [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php
index feee41c342069..3523d2828948c 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php
@@ -552,6 +552,9 @@ public function testMapQuoteExtraTaxables($itemData, $addressData)
/*
* @return array
*/
+ /**
+ * @return array
+ */
public function dataProviderMapQuoteExtraTaxablesArray()
{
$data = [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/System/Message/Notification/ApplyDiscountOnPricesTest.php b/app/code/Magento/Tax/Test/Unit/Model/System/Message/Notification/ApplyDiscountOnPricesTest.php
index f8cd3fce693a6..6902a59a2dab4 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/System/Message/Notification/ApplyDiscountOnPricesTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/System/Message/Notification/ApplyDiscountOnPricesTest.php
@@ -95,6 +95,9 @@ public function testIsDisplayed(
$this->assertEquals($expectedResult, $this->applyDiscountOnPricesNotification->isDisplayed());
}
+ /**
+ * @return array
+ */
public function dataProviderIsDisplayed()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/System/Message/NotificationsTest.php b/app/code/Magento/Tax/Test/Unit/Model/System/Message/NotificationsTest.php
index 3cf1421ebcf37..3fda67669fe86 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/System/Message/NotificationsTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/System/Message/NotificationsTest.php
@@ -73,6 +73,9 @@ public function testIsDisplayed(
$this->assertEquals($expectedResult, $this->notifications->isDisplayed());
}
+ /**
+ * @return array
+ */
public function dataProviderIsDisplayed()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxAddressManagerTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxAddressManagerTest.php
index ec640b74f8985..493eebf9e1123 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/TaxAddressManagerTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/TaxAddressManagerTest.php
@@ -109,6 +109,9 @@ public function testSetDefaultAddressAfterSave(
$this->manager->setDefaultAddressAfterSave($address);
}
+ /**
+ * @return array
+ */
public function setAddressCustomerSessionAddressSaveDataProvider()
{
return [
@@ -151,6 +154,9 @@ public function testSetDefaultAddressAfterLogIn(
$this->manager->setDefaultAddressAfterLogIn([$address]);
}
+ /**
+ * @return array
+ */
public function setAddressCustomerSessionLogInDataProvider()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php
index eb107c248880b..d46c9996c390c 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php
@@ -39,6 +39,9 @@ public function testCreate($classType, $className, $classTypeMock)
$this->assertEquals($classTypeMock, $taxClassFactory->create($classMock));
}
+ /**
+ * @return array
+ */
public function createDataProvider()
{
$customerClassMock = $this->createMock(\Magento\Tax\Model\TaxClass\Type\Customer::class);
diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Type/CustomerTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Type/CustomerTest.php
index fc27e68c8e55b..707b999c5e467 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Type/CustomerTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Type/CustomerTest.php
@@ -26,9 +26,9 @@ public function testIsAssignedToObjects()
$filterBuilder->expects($this->once())->method('setField')->with(
\Magento\Customer\Api\Data\GroupInterface::TAX_CLASS_ID
- )->willReturnself();
- $filterBuilder->expects($this->once())->method('setValue')->willReturnself();
- $filterBuilder->expects($this->once())->method('create')->willReturnself();
+ )->willReturnSelf();
+ $filterBuilder->expects($this->once())->method('setValue')->willReturnSelf();
+ $filterBuilder->expects($this->once())->method('create')->willReturnSelf();
$filterGroupBuilder = $this->createMock(\Magento\Framework\Api\Search\FilterGroupBuilder::class);
$searchCriteriaBuilder = $this->getMockBuilder(\Magento\Framework\Api\SearchCriteriaBuilder::class)
diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php
index f4151cd18ba66..3fddd5da47611 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php
@@ -168,6 +168,9 @@ public function testSaveWithExceptions($exceptionObject, $exceptionName, $except
$this->model->save($rule);
}
+ /**
+ * @return array
+ */
public function saveExceptionsDataProvider()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php
index 14d678d02366b..96b4b81ae2817 100644
--- a/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php
@@ -138,6 +138,9 @@ public function testExecute(
$this->session->execute($this->observerMock);
}
+ /**
+ * @return array
+ */
public function getExecuteDataProvider()
{
return [
diff --git a/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php b/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php
index a92aa6a0d05eb..e7557e2164ca0 100644
--- a/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php
@@ -56,6 +56,9 @@ public function testIsIncludedInBasePrice($expectedResult)
$this->assertEquals($expectedResult, $this->adjustment->isIncludedInBasePrice());
}
+ /**
+ * @return array
+ */
public function isIncludedInBasePriceDataProvider()
{
return [[true], [false]];
@@ -113,6 +116,9 @@ public function testExtractAdjustment($isPriceIncludesTax, $amount, $price, $exp
$this->assertEquals($expectedResult, $this->adjustment->extractAdjustment($amount, $object));
}
+ /**
+ * @return array
+ */
public function extractAdjustmentDataProvider()
{
return [
@@ -164,6 +170,9 @@ public function testIsExcludedWith($adjustmentCode, $expectedResult)
$this->assertEquals($expectedResult, $this->adjustment->isExcludedWith($adjustmentCode));
}
+ /**
+ * @return array
+ */
public function isExcludedWithDataProvider()
{
return [
diff --git a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExport.php b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExport.php
index a42877b3ecf8a..ab64567f4fe28 100644
--- a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExport.php
+++ b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExport.php
@@ -14,7 +14,7 @@ class ImportExport extends \Magento\Backend\Block\Widget
/**
* @var string
*/
- protected $_template = 'importExport.phtml';
+ protected $_template = 'Magento_TaxImportExport::importExport.phtml';
/**
* @param \Magento\Backend\Block\Template\Context $context
diff --git a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExportHeader.php b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExportHeader.php
index 8897e9b2083e9..e223adc3adb1a 100644
--- a/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExportHeader.php
+++ b/app/code/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExportHeader.php
@@ -16,5 +16,5 @@ class ImportExportHeader extends \Magento\Backend\Block\Widget
*
* @var string
*/
- protected $_template = 'importExportHeader.phtml';
+ protected $_template = 'Magento_TaxImportExport::importExportHeader.phtml';
}
diff --git a/app/code/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/Content/Uploader.php b/app/code/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/Content/Uploader.php
index 8e7f4c9cc680c..e99500dbd0694 100644
--- a/app/code/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/Content/Uploader.php
+++ b/app/code/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/Content/Uploader.php
@@ -19,7 +19,7 @@ class Uploader extends \Magento\Backend\Block\Media\Uploader
*
* @var string
*/
- protected $_template = 'browser/content/uploader.phtml';
+ protected $_template = 'Magento_Theme::browser/content/uploader.phtml';
/**
* @var \Magento\Theme\Helper\Storage
diff --git a/app/code/Magento/Theme/Block/Html/Breadcrumbs.php b/app/code/Magento/Theme/Block/Html/Breadcrumbs.php
index c1f8ea620ef41..cff87fc8726bd 100644
--- a/app/code/Magento/Theme/Block/Html/Breadcrumbs.php
+++ b/app/code/Magento/Theme/Block/Html/Breadcrumbs.php
@@ -21,7 +21,7 @@ class Breadcrumbs extends \Magento\Framework\View\Element\Template
*
* @var string
*/
- protected $_template = 'html/breadcrumbs.phtml';
+ protected $_template = 'Magento_Theme::html/breadcrumbs.phtml';
/**
* List of available breadcrumb properties
diff --git a/app/code/Magento/Theme/Block/Html/Header.php b/app/code/Magento/Theme/Block/Html/Header.php
index f597b4034da92..2663a4da15011 100644
--- a/app/code/Magento/Theme/Block/Html/Header.php
+++ b/app/code/Magento/Theme/Block/Html/Header.php
@@ -19,7 +19,7 @@ class Header extends \Magento\Framework\View\Element\Template
*
* @var string
*/
- protected $_template = 'html/header.phtml';
+ protected $_template = 'Magento_Theme::html/header.phtml';
/**
* Retrieve welcome text
diff --git a/app/code/Magento/Theme/Block/Html/Header/Logo.php b/app/code/Magento/Theme/Block/Html/Header/Logo.php
index 5b0c2eaf04c45..0a0e71f44ba32 100644
--- a/app/code/Magento/Theme/Block/Html/Header/Logo.php
+++ b/app/code/Magento/Theme/Block/Html/Header/Logo.php
@@ -19,7 +19,7 @@ class Logo extends \Magento\Framework\View\Element\Template
*
* @var string
*/
- protected $_template = 'html/header/logo.phtml';
+ protected $_template = 'Magento_Theme::html/header/logo.phtml';
/**
* @var \Magento\MediaStorage\Helper\File\Storage\Database
diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php
index 49066e79cb798..91c3ce47fc8b8 100644
--- a/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php
@@ -109,6 +109,9 @@ protected function setUp()
);
}
+ /**
+ * @return Topmenu
+ */
protected function getTopmenu()
{
return new Topmenu($this->context, $this->nodeFactory, $this->treeFactory);
diff --git a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php
index 2ae889e69bb12..36daf7d4aff48 100644
--- a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php
@@ -8,7 +8,7 @@
use Magento\Framework\App\Console\MaintenanceModeEnabler;
use Magento\Theme\Console\Command\ThemeUninstallCommand;
-use Magento\Theme\Model\Theme\themePackageInfo;
+use Magento\Theme\Model\Theme\ThemePackageInfo;
use Magento\Theme\Model\Theme\ThemeUninstaller;
use Magento\Theme\Model\Theme\ThemeDependencyChecker;
use Symfony\Component\Console\Tester\CommandTester;
diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php
index d5919db5edcba..bbcaa87acb9c3 100644
--- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php
@@ -63,22 +63,22 @@ public function testExecuteWithoutTheme()
->expects($this->at(0))
->method('get')
->with(\Magento\Theme\Model\Uploader\Service::class)
- ->WillReturn($this->serviceModel);
+ ->willReturn($this->serviceModel);
$this->_objectManagerMock
->expects($this->at(1))
->method('get')
->with(\Magento\Framework\View\Design\Theme\FlyweightFactory::class)
- ->WillReturn($this->themeFactory);
+ ->willReturn($this->themeFactory);
$this->_objectManagerMock
->expects($this->at(2))
->method('get')
->with(\Magento\Framework\View\Design\Theme\Customization\File\Js::class)
- ->WillReturn($this->customizationJs);
+ ->willReturn($this->customizationJs);
$this->_objectManagerMock
->expects($this->at(3))
->method('get')
->with(\Magento\Framework\Json\Helper\Data::class)
- ->WillReturn($this->jsonHelper);
+ ->willReturn($this->jsonHelper);
$this->themeFactory->expects($this->once())
->method('create')
@@ -107,21 +107,21 @@ public function testExecuteWithException()
$this->_objectManagerMock->expects($this->at(0))
->method('get')
->with(\Magento\Theme\Model\Uploader\Service::class)
- ->WillReturn($this->serviceModel);
+ ->willReturn($this->serviceModel);
$this->_objectManagerMock->expects($this->at(1))
->method('get')
->with(\Magento\Framework\View\Design\Theme\FlyweightFactory::class)
- ->WillReturn($this->themeFactory);
+ ->willReturn($this->themeFactory);
$this->_objectManagerMock
->expects($this->at(2))
->method('get')
->with(\Magento\Framework\View\Design\Theme\Customization\File\Js::class)
- ->WillReturn($this->customizationJs);
+ ->willReturn($this->customizationJs);
$this->_objectManagerMock
->expects($this->at(4))
->method('get')
->with(\Magento\Framework\Json\Helper\Data::class)
- ->WillReturn($this->jsonHelper);
+ ->willReturn($this->jsonHelper);
$this->themeFactory->expects($this->once())
->method('create')
@@ -172,19 +172,19 @@ public function testExecute()
$this->_objectManagerMock->expects($this->at(0))
->method('get')
->with(\Magento\Theme\Model\Uploader\Service::class)
- ->WillReturn($this->serviceModel);
+ ->willReturn($this->serviceModel);
$this->_objectManagerMock->expects($this->at(1))
->method('get')
->with(\Magento\Framework\View\Design\Theme\FlyweightFactory::class)
- ->WillReturn($this->themeFactory);
+ ->willReturn($this->themeFactory);
$this->_objectManagerMock->expects($this->at(2))
->method('get')
->with(\Magento\Framework\View\Design\Theme\Customization\File\Js::class)
- ->WillReturn($this->customizationJs);
+ ->willReturn($this->customizationJs);
$this->_objectManagerMock->expects($this->at(4))
->method('get')
->with(\Magento\Framework\Json\Helper\Data::class)
- ->WillReturn($this->jsonHelper);
+ ->willReturn($this->jsonHelper);
$this->themeFactory->expects($this->once())
->method('create')
diff --git a/app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ThemeTest.php b/app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ThemeTest.php
index d959b95dcb0ca..1725fe158c16c 100644
--- a/app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ThemeTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ThemeTest.php
@@ -123,6 +123,9 @@ public function testGetValue($value, $expectedResult)
$this->assertEquals($expectedResult, $this->model->getValue());
}
+ /**
+ * @return array
+ */
public function getValueDataProvider()
{
return [
@@ -131,6 +134,9 @@ public function getValueDataProvider()
];
}
+ /**
+ * @return array
+ */
public function afterSaveDataProvider()
{
return [
diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/ValidationTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/ValidationTest.php
index 5d1c9f8cf7c3c..e302762c1c783 100644
--- a/app/code/Magento/Theme/Test/Unit/Model/Theme/ValidationTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/ValidationTest.php
@@ -31,6 +31,9 @@ public function testValidate(array $data, $result, array $messages)
$this->assertEquals($messages, $validator->getErrorMessages());
}
+ /**
+ * @return array
+ */
public function dataProviderValidate()
{
return [
diff --git a/app/code/Magento/Theme/Test/Unit/Model/ThemeTest.php b/app/code/Magento/Theme/Test/Unit/Model/ThemeTest.php
index 4ff64e6f694e8..b191a64ac2c21 100644
--- a/app/code/Magento/Theme/Test/Unit/Model/ThemeTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Model/ThemeTest.php
@@ -481,6 +481,9 @@ public function testToArray(array $themeData, array $expected)
$this->assertEquals($expected, $this->_model->toArray());
}
+ /**
+ * @return array
+ */
public function toArrayDataProvider()
{
$parentTheme = $this->getMockBuilder(\Magento\Theme\Model\Theme::class)
@@ -555,6 +558,9 @@ public function testPopulateFromArray(array $value, array $expected, $expectedCa
$this->assertEquals($expected, $this->_model->getData());
}
+ /**
+ * @return array
+ */
public function populateFromArrayDataProvider()
{
return [
diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php
index 62b644042b68d..913561590607a 100644
--- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php
@@ -172,6 +172,9 @@ public function testUploadInvalidFile()
$this->_storageModel->uploadFile($this->_storageRoot);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function _prepareUploader()
{
$uploader = $this->createMock(\Magento\MediaStorage\Model\File\Uploader::class);
@@ -538,6 +541,9 @@ public function testDeleteRootDirectory()
$this->_storageModel->deleteDirectory($directoryPath);
}
+ /**
+ * @return array
+ */
public function booleanCasesDataProvider()
{
return [[true], [false]];
diff --git a/app/code/Magento/Theme/Test/Unit/Ui/Component/Listing/Column/EditActionTest.php b/app/code/Magento/Theme/Test/Unit/Ui/Component/Listing/Column/EditActionTest.php
index 068738f17c967..2ac959d0a9881 100644
--- a/app/code/Magento/Theme/Test/Unit/Ui/Component/Listing/Column/EditActionTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Ui/Component/Listing/Column/EditActionTest.php
@@ -82,6 +82,9 @@ public function testPrepareDataSource($dataSourceItem, $scope, $scopeId)
$this->assertEquals($expectedDataSource, $dataSource);
}
+ /**
+ * @return array
+ */
public function getPrepareDataSourceDataProvider()
{
return [
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/AbstractElementTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/AbstractElementTest.php
index 54bf0c9e8b37e..d9afe8f16a1a7 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/AbstractElementTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/AbstractElementTest.php
@@ -46,6 +46,9 @@ protected function setUp()
*/
abstract protected function getModelName();
+ /**
+ * @return mixed
+ */
abstract public function testGetComponentName();
/**
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/ActionDeleteTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/ActionDeleteTest.php
index 6f45c192d6c4c..890737965d559 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/ActionDeleteTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/ActionDeleteTest.php
@@ -20,6 +20,9 @@ protected function getModelName()
return ActionDelete::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->assertSame(ActionDelete::NAME, $this->getModel()->getComponentName());
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/CheckboxSetTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/CheckboxSetTest.php
index 025f4a1582458..968155b92a3b9 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/CheckboxSetTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/CheckboxSetTest.php
@@ -22,6 +22,9 @@ protected function getModelName()
return CheckboxSet::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->assertSame(CheckboxSet::NAME, $this->getModel()->getComponentName());
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/MultiSelectTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/MultiSelectTest.php
index cb91fbb945bb5..723d6402fe865 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/MultiSelectTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/MultiSelectTest.php
@@ -22,6 +22,9 @@ protected function getModelName()
return MultiSelect::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->contextMock->expects($this->never())->method('getProcessor');
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/RadioSetTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/RadioSetTest.php
index 0e0fef60df60b..ea4f0f9f94a00 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/RadioSetTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/RadioSetTest.php
@@ -22,6 +22,9 @@ protected function getModelName()
return RadioSet::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->assertSame(RadioSet::NAME, $this->getModel()->getComponentName());
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/SelectTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/SelectTest.php
index c695262681063..6432f8404eaff 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/SelectTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/SelectTest.php
@@ -22,6 +22,9 @@ protected function getModelName()
return Select::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->assertSame(Select::NAME, $this->getModel()->getComponentName());
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/WysiwygTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/WysiwygTest.php
index d0e0542a19480..2304883666b74 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/WysiwygTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/WysiwygTest.php
@@ -62,6 +62,9 @@ protected function setUp()
->method('getElementHtml');
}
+ /**
+ * @return \Magento\Ui\Component\Form\Element\AbstractElement|object
+ */
protected function getModel()
{
return $this->objectManager->getObject(Wysiwyg::class, [
@@ -82,6 +85,9 @@ protected function getModelName()
return Wysiwyg::class;
}
+ /**
+ * @return mixed|void
+ */
public function testGetComponentName()
{
$this->assertSame(Wysiwyg::NAME, $this->getModel()->getComponentName());
diff --git a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php
index 123b4cacf71a7..b2f494351597f 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php
@@ -93,6 +93,9 @@ public function testPrepare($componentName, $componentData)
$this->assertEquals(['actions' => [$action->getConfiguration()]], $massAction->getConfiguration());
}
+ /**
+ * @return array
+ */
public function getPrepareDataProvider()
{
return [
diff --git a/app/code/Magento/Ui/Test/Unit/Config/Converter/ActionsTest.php b/app/code/Magento/Ui/Test/Unit/Config/Converter/ActionsTest.php
index 8228026dff3d1..d146a18a710c6 100644
--- a/app/code/Magento/Ui/Test/Unit/Config/Converter/ActionsTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Config/Converter/ActionsTest.php
@@ -61,6 +61,9 @@ public function testConvert(array $expectedResult, $xpath)
$this->assertEquals($expectedResult, $this->converter->convert($actions));
}
+ /**
+ * @return array
+ */
public function convertDataProvider()
{
return [
diff --git a/app/code/Magento/Ui/Test/Unit/Config/Converter/OptionsTest.php b/app/code/Magento/Ui/Test/Unit/Config/Converter/OptionsTest.php
index 058e3651bde5c..8f5ab55f7a914 100644
--- a/app/code/Magento/Ui/Test/Unit/Config/Converter/OptionsTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Config/Converter/OptionsTest.php
@@ -41,6 +41,9 @@ public function testConvert(array $expectedResult, $xpath)
$this->assertEquals($expectedResult, $res);
}
+ /**
+ * @return array
+ */
public function convertDataProvider()
{
return [
diff --git a/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php
index 96468b63314b4..fde743390816d 100644
--- a/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php
@@ -193,6 +193,9 @@ public function testPrepareGetData($componentName, $componentData, $isCached, $r
);
}
+ /**
+ * @return array
+ */
public function getComponentData()
{
$cachedData = new \ArrayObject(
@@ -293,6 +296,9 @@ public function testCreateRawComponentData($componentName, $configData, $compone
$this->assertEquals($componentData, $this->manager->createRawComponentData($componentName, $needEvaluate));
}
+ /**
+ * @return array
+ */
public function getComponentDataProvider()
{
return [
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
index 854af5494b385..3b1026e1d7fd4 100755
--- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
@@ -450,6 +450,10 @@ define([
*/
toggleUseDefault: function (state) {
this.disabled(state);
+
+ if (this.source && this.hasService()) {
+ this.source.set('data.use_default.' + this.index, Number(state));
+ }
},
/**
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js
index b20b2c31ee1fb..3ee7ddd1e738f 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/single-checkbox-use-config.js
@@ -36,6 +36,10 @@ define([
*/
toggleElement: function () {
this.disabled(this.isUseDefault() || this.isUseConfig());
+
+ if (this.source) {
+ this.source.set('data.use_default.' + this.index, Number(this.isUseDefault()));
+ }
}
});
});
diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
index 46f0a2df52441..195104b36721e 100644
--- a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
+++ b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
@@ -10,7 +10,6 @@
attr="
id: $data.uid + '_default',
name: 'use_default[' + $data.index + ']',
- 'data-form-part': $data.ns
"
ko-checked="isUseDefault"
ko-disabled="$data.serviceDisabled">
diff --git a/app/code/Magento/UrlRewrite/Block/Catalog/Category/Tree.php b/app/code/Magento/UrlRewrite/Block/Catalog/Category/Tree.php
index ce9c6e6510f53..220f2376e15a5 100644
--- a/app/code/Magento/UrlRewrite/Block/Catalog/Category/Tree.php
+++ b/app/code/Magento/UrlRewrite/Block/Catalog/Category/Tree.php
@@ -34,7 +34,7 @@ class Tree extends AbstractCategory
/**
* @var string
*/
- protected $_template = 'categories.phtml';
+ protected $_template = 'Magento_UrlRewrite::categories.phtml';
/**
* Adminhtml data
diff --git a/app/code/Magento/UrlRewrite/Block/Selector.php b/app/code/Magento/UrlRewrite/Block/Selector.php
index 0a28ba215de5a..75266fd2f977c 100644
--- a/app/code/Magento/UrlRewrite/Block/Selector.php
+++ b/app/code/Magento/UrlRewrite/Block/Selector.php
@@ -18,7 +18,7 @@ class Selector extends \Magento\Backend\Block\Template
/**
* @var string
*/
- protected $_template = 'selector.phtml';
+ protected $_template = 'Magento_UrlRewrite::selector.phtml';
/**
* Set block template and get available modes
diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php
index e41a06cb0c9f0..b99c5c48c3de0 100644
--- a/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php
+++ b/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php
@@ -55,6 +55,9 @@ public function testValidateSuffixException($suffix)
$this->_helper->validateSuffix($suffix);
}
+ /**
+ * @return array
+ */
public function requestPathDataProvider()
{
return [
@@ -63,6 +66,9 @@ public function requestPathDataProvider()
];
}
+ /**
+ * @return array
+ */
public function requestPathExceptionDataProvider()
{
return [
diff --git a/app/code/Magento/User/Block/Role/Tab/Edit.php b/app/code/Magento/User/Block/Role/Tab/Edit.php
index 0d5db4f527738..dbc5ac19a77c7 100644
--- a/app/code/Magento/User/Block/Role/Tab/Edit.php
+++ b/app/code/Magento/User/Block/Role/Tab/Edit.php
@@ -19,7 +19,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form implements \Magento\Backen
/**
* @var string
*/
- protected $_template = 'role/edit.phtml';
+ protected $_template = 'Magento_User::role/edit.phtml';
/**
* Root ACL Resource
diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php
index 27604c9aed29a..d93e7ad63e354 100644
--- a/app/code/Magento/User/Block/Role/Tab/Users.php
+++ b/app/code/Magento/User/Block/Role/Tab/Users.php
@@ -45,7 +45,9 @@ protected function _construct()
$roleId = $this->getRequest()->getParam('rid', false);
/** @var \Magento\User\Model\ResourceModel\User\Collection $users */
$users = $this->_userCollectionFactory->create()->load();
- $this->setTemplate('role/users.phtml')->assign('users', $users->getItems())->assign('roleId', $roleId);
+ $this->setTemplate('role/users.phtml')
+ ->assign('users', $users->getItems())
+ ->assign('roleId', $roleId);
}
/**
diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php
index 2a7d43008f2ad..d711220441aaf 100644
--- a/app/code/Magento/User/Model/User.php
+++ b/app/code/Magento/User/Model/User.php
@@ -47,6 +47,8 @@ class User extends AbstractModel implements StorageInterface, UserInterface
/** @deprecated */
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'admin/emails/reset_password_template';
+ const MESSAGE_ID_PASSWORD_EXPIRED = 'magento_user_password_expired';
+
/**
* Model event prefix
*
diff --git a/app/code/Magento/User/Observer/Backend/AuthObserver.php b/app/code/Magento/User/Observer/Backend/AuthObserver.php
index bc5d6af615f13..c7a1a69f7ce84 100644
--- a/app/code/Magento/User/Observer/Backend/AuthObserver.php
+++ b/app/code/Magento/User/Observer/Backend/AuthObserver.php
@@ -149,7 +149,7 @@ public function execute(EventObserver $observer)
/**
* Update locking information for the user
*
- * @param \Magento\User\Model\User $user
+ * @param User $user
* @return void
*/
private function _updateLockingInformation($user)
@@ -195,10 +195,16 @@ private function _checkExpiredPassword($latestPassword)
$myAccountUrl = $this->url->getUrl('adminhtml/system_account/');
$message = __('It\'s time to
change your password .', $myAccountUrl);
}
+
+ $messages = $this->messageManager->getMessages();
+
+ // Remove existing messages with same ID to avoid duplication
+ $messages->deleteMessageByIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED);
+
$this->messageManager->addNoticeMessage($message);
- $message = $this->messageManager->getMessages()->getLastAddedMessage();
+ $message = $messages->getLastAddedMessage();
if ($message) {
- $message->setIdentifier('magento_user_password_expired')->setIsSticky(true);
+ $message->setIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED)->setIsSticky(true);
$this->authSession->setPciAdminUserIsPasswordExpired(true);
}
}
diff --git a/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php b/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php
index 09605372df181..059879ab9613f 100644
--- a/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php
+++ b/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php
@@ -8,6 +8,7 @@
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;
+use Magento\User\Model\User;
/**
* User backend observer model for passwords
@@ -74,7 +75,7 @@ public function execute(EventObserver $observer)
$passwordHash = $user->getPassword();
if ($passwordHash && !$user->getForceNewPassword()) {
$this->userResource->trackPassword($user, $passwordHash);
- $this->messageManager->getMessages()->deleteMessageByIdentifier('magento_user_password_expired');
+ $this->messageManager->getMessages()->deleteMessageByIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED);
$this->authSession->unsPciAdminUserIsPasswordExpired();
}
}
diff --git a/app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php b/app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php
index ff0873c369075..28bfe34a05733 100644
--- a/app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php
+++ b/app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php
@@ -330,7 +330,7 @@ public function testDeleteFromRole()
$roleId = 44;
$methodUserMock->expects($this->once())->method('getUserId')->willReturn($uid);
$this->resourceMock->expects($this->atLeastOnce())->method('getConnection')->willReturn($this->dbAdapterMock);
- $methodUserMock->expects($this->atleastOnce())->method('getRoleId')->willReturn($roleId);
+ $methodUserMock->expects($this->atLeastOnce())->method('getRoleId')->willReturn($roleId);
$this->dbAdapterMock->expects($this->once())->method('delete');
$this->assertInstanceOf(
diff --git a/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php b/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php
index 54ceffff665ea..0f70753e01fbf 100644
--- a/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php
+++ b/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php
@@ -111,6 +111,9 @@ public function testValidate($variableArray, $objectId, $expectedResult)
$this->assertEquals($expectedResult, $this->model->validate($variableArray));
}
+ /**
+ * @return array
+ */
public function validateDataProvider()
{
$variable = [
@@ -123,6 +126,9 @@ public function validateDataProvider()
];
}
+ /**
+ * @return array
+ */
public function validateMissingInfoDataProvider()
{
return [
diff --git a/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php b/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php
index efbe2e9745ef1..09c17d1e58d98 100644
--- a/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php
+++ b/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php
@@ -160,6 +160,9 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me
static::assertEquals($createdAt, $paymentToken->getCreatedAt());
}
+ /**
+ * @return array
+ */
public function positiveCaseDataProvider()
{
return [
diff --git a/app/code/Magento/Webapi/Controller/Rest.php b/app/code/Magento/Webapi/Controller/Rest.php
index dc061aeea99e7..f0bad69979529 100644
--- a/app/code/Magento/Webapi/Controller/Rest.php
+++ b/app/code/Magento/Webapi/Controller/Rest.php
@@ -22,6 +22,7 @@
use Magento\Webapi\Controller\Rest\Router;
use Magento\Webapi\Controller\Rest\Router\Route;
use Magento\Webapi\Model\Rest\Swagger\Generator;
+use Magento\Webapi\Controller\Rest\RequestProcessorPool;
/**
* Front controller for WebAPI REST area.
@@ -119,6 +120,11 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
*/
protected $swaggerGenerator;
+ /**
+ * @var RequestProcessorPool
+ */
+ protected $requestProcessorPool;
+
/**
* @var StoreManagerInterface
* @deprecated 100.1.0
@@ -189,6 +195,7 @@ public function __construct(
$this->serviceOutputProcessor = $serviceOutputProcessor;
$this->swaggerGenerator = $swaggerGenerator;
$this->storeManager = $storeManager;
+ $this->requestProcessorPool = $this->_objectManager->get(RequestProcessorPool::class);
}
/**
@@ -233,15 +240,13 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
$this->areaList->getArea($this->_appState->getAreaCode())
->load(\Magento\Framework\App\Area::PART_TRANSLATE);
try {
- if ($this->isSchemaRequest()) {
- $this->processSchemaRequest();
- } else {
- $this->processApiRequest();
- }
+ $processor = $this->requestProcessorPool->getProcessor($this->_request);
+ $processor->process($this->_request);
} catch (\Exception $e) {
$maskedException = $this->_errorProcessor->maskException($e);
$this->_response->setException($maskedException);
}
+
return $this->_response;
}
diff --git a/app/code/Magento/Webapi/Controller/Rest/RequestProcessorInterface.php b/app/code/Magento/Webapi/Controller/Rest/RequestProcessorInterface.php
new file mode 100644
index 0000000000000..f4340c18e2134
--- /dev/null
+++ b/app/code/Magento/Webapi/Controller/Rest/RequestProcessorInterface.php
@@ -0,0 +1,35 @@
+requestProcessors = $requestProcessors;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @throws \Magento\Framework\Webapi\Exception
+ * return RequestProcessorInterface
+ */
+ public function getProcessor(\Magento\Framework\Webapi\Rest\Request $request)
+ {
+ foreach ($this->requestProcessors as $processor) {
+ if ($processor->canProcess($request)) {
+ return $processor;
+ }
+ }
+
+ throw new \Magento\Framework\Webapi\Exception(
+ __('Specified request cannot be processed.'),
+ 0,
+ \Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST
+ );
+ }
+}
diff --git a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php
index 6e2fda94237d7..ca5dfe2e2b822 100644
--- a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php
+++ b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php
@@ -241,4 +241,14 @@ public function getParameters()
{
return $this->parameters;
}
+
+ /**
+ * Get route path.
+ *
+ * @return string
+ */
+ public function getRoutePath()
+ {
+ return $this->route;
+ }
}
diff --git a/app/code/Magento/Webapi/Controller/Rest/SchemaRequestProcessor.php b/app/code/Magento/Webapi/Controller/Rest/SchemaRequestProcessor.php
new file mode 100644
index 0000000000000..0f1587c342fa7
--- /dev/null
+++ b/app/code/Magento/Webapi/Controller/Rest/SchemaRequestProcessor.php
@@ -0,0 +1,74 @@
+swaggerGenerator = $swaggerGenerator;
+ $this->response = $response;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process(\Magento\Framework\Webapi\Rest\Request $request)
+ {
+ $requestedServices = $request->getRequestedServices('all');
+ $requestedServices = $requestedServices == Request::ALL_SERVICES
+ ? $this->swaggerGenerator->getListOfServices()
+ : $requestedServices;
+ $responseBody = $this->swaggerGenerator->generate(
+ $requestedServices,
+ $request->getScheme(),
+ $request->getHttpHost(false),
+ $request->getRequestUri()
+ );
+ $this->response->setBody($responseBody)->setHeader('Content-Type', 'application/json');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function canProcess(\Magento\Framework\Webapi\Rest\Request $request)
+ {
+ if (strpos(ltrim($request->getPathInfo(), '/'), self::PROCESSOR_PATH) === 0) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/app/code/Magento/Webapi/Controller/Rest/SynchronousRequestProcessor.php b/app/code/Magento/Webapi/Controller/Rest/SynchronousRequestProcessor.php
new file mode 100644
index 0000000000000..f5aa6bd88c399
--- /dev/null
+++ b/app/code/Magento/Webapi/Controller/Rest/SynchronousRequestProcessor.php
@@ -0,0 +1,121 @@
+response = $response;
+ $this->inputParamsResolver = $inputParamsResolver;
+ $this->serviceOutputProcessor = $serviceOutputProcessor;
+ $this->fieldsFilter = $fieldsFilter;
+ $this->deploymentConfig = $deploymentConfig;
+ $this->objectManager = $objectManager;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process(\Magento\Framework\Webapi\Rest\Request $request)
+ {
+ $inputParams = $this->inputParamsResolver->resolve();
+
+ $route = $this->inputParamsResolver->getRoute();
+ $serviceMethodName = $route->getServiceMethod();
+ $serviceClassName = $route->getServiceClass();
+ $service = $this->objectManager->get($serviceClassName);
+
+ /**
+ * @var \Magento\Framework\Api\AbstractExtensibleObject $outputData
+ */
+ $outputData = call_user_func_array([$service, $serviceMethodName], $inputParams);
+ $outputData = $this->serviceOutputProcessor->process(
+ $outputData,
+ $serviceClassName,
+ $serviceMethodName
+ );
+ if ($request->getParam(FieldsFilter::FILTER_PARAMETER) && is_array($outputData)) {
+ $outputData = $this->fieldsFilter->filter($outputData);
+ }
+ $header = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_X_FRAME_OPT);
+ if ($header) {
+ $this->response->setHeader('X-Frame-Options', $header);
+ }
+ $this->response->prepareResponse($outputData);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function canProcess(\Magento\Framework\Webapi\Rest\Request $request)
+ {
+ if (preg_match(self::PROCESSOR_PATH, $request->getPathInfo()) === 1) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/app/code/Magento/Webapi/Model/Config.php b/app/code/Magento/Webapi/Model/Config.php
index cf268828c8091..b957279edd2c0 100644
--- a/app/code/Magento/Webapi/Model/Config.php
+++ b/app/code/Magento/Webapi/Model/Config.php
@@ -17,7 +17,7 @@
* @api
* @since 100.0.2
*/
-class Config
+class Config implements ConfigInterface
{
const CACHE_ID = 'webapi_config';
@@ -66,9 +66,7 @@ public function __construct(
}
/**
- * Return services loaded from cache if enabled or from files merged previously
- *
- * @return array
+ * {@inheritdoc}
*/
public function getServices()
{
diff --git a/app/code/Magento/Webapi/Model/ConfigInterface.php b/app/code/Magento/Webapi/Model/ConfigInterface.php
new file mode 100644
index 0000000000000..338c18795595f
--- /dev/null
+++ b/app/code/Magento/Webapi/Model/ConfigInterface.php
@@ -0,0 +1,24 @@
+/etc/webapi.xml files.
+ *
+ * @api
+ */
+interface ConfigInterface
+{
+ /**
+ * Return services loaded from cache if enabled or from files merged previously
+ *
+ * @return array
+ */
+ public function getServices();
+}
diff --git a/app/code/Magento/Webapi/Model/Rest/Config.php b/app/code/Magento/Webapi/Model/Rest/Config.php
index 2e1148b8a6469..3fd8c640fb3b7 100644
--- a/app/code/Magento/Webapi/Model/Rest/Config.php
+++ b/app/code/Magento/Webapi/Model/Rest/Config.php
@@ -6,7 +6,7 @@
namespace Magento\Webapi\Model\Rest;
use Magento\Webapi\Controller\Rest\Router\Route;
-use Magento\Webapi\Model\Config as ModelConfig;
+use Magento\Webapi\Model\ConfigInterface as ModelConfigInterface;
use Magento\Webapi\Model\Config\Converter;
/**
@@ -43,11 +43,13 @@ class Config
protected $_routeFactory;
/**
- * @param ModelConfig $config
+ * @param ModelConfigInterface $config
* @param \Magento\Framework\Controller\Router\Route\Factory $routeFactory
*/
- public function __construct(ModelConfig $config, \Magento\Framework\Controller\Router\Route\Factory $routeFactory)
- {
+ public function __construct(
+ ModelConfigInterface $config,
+ \Magento\Framework\Controller\Router\Route\Factory $routeFactory
+ ) {
$this->_config = $config;
$this->_routeFactory = $routeFactory;
}
diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php
index 1e3a9c64e927e..1308f519c4954 100644
--- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php
+++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php
@@ -407,7 +407,7 @@ protected function getObjectSchema($typeName, $description = '')
if ($simpleType = $this->getSimpleType($trimedTypeName)) {
$result['items'] = ['type' => $simpleType];
} else {
- if (strpos($typeName, '[]')) {
+ if (strpos($typeName, '[]') !== false) {
$result['items'] = ['$ref' => $this->getDefinitionReference($trimedTypeName)];
} else {
$result = ['$ref' => $this->getDefinitionReference($trimedTypeName)];
@@ -863,9 +863,17 @@ private function generateMethodSuccessResponse($parameters, $responses)
if (isset($parameters['result']['type'])) {
$schema = $this->getObjectSchema($parameters['result']['type'], $description);
}
- $responses['200']['description'] = '200 Success.';
+
+ // Some methods may have a non-standard HTTP success code.
+ $specificResponseData = $parameters['result']['response_codes']['success'] ?? [];
+ // Default HTTP success code to 200 if nothing has been supplied.
+ $responseCode = $specificResponseData['code'] ?? '200';
+ // Default HTTP response status to 200 Success if nothing has been supplied.
+ $responseDescription = $specificResponseData['description'] ?? '200 Success.';
+
+ $responses[$responseCode]['description'] = $responseDescription;
if (!empty($schema)) {
- $responses['200']['schema'] = $schema;
+ $responses[$responseCode]['schema'] = $schema;
}
}
return $responses;
diff --git a/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php b/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php
index 7f3fe558a98eb..c213c72b5185a 100644
--- a/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php
+++ b/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php
@@ -51,6 +51,9 @@ public function testAllStoreCode($storeCodeInPath, $storeCodeSet, $setCurrentSto
$this->assertSame($this->endpointPath, $result);
}
+ /**
+ * @return array
+ */
public function processPathDataProvider()
{
return [
diff --git a/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php b/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php
index c747ada367aa2..582d387054ee6 100644
--- a/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php
+++ b/app/code/Magento/Webapi/Test/Unit/Controller/RestTest.php
@@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/
-// @codingStandardsIgnoreFile
-
namespace Magento\Webapi\Test\Unit\Controller;
use Magento\Authorization\Model\UserContextInterface;
@@ -64,16 +62,30 @@ class RestTest extends \PHPUnit\Framework\TestCase
*/
protected $swaggerGeneratorMock;
- /** @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject */
+ /**
+ * @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
+ */
private $storeManagerMock;
- /** @var \Magento\Store\Api\Data\StoreInterface | \PHPUnit_Framework_MockObject_MockObject */
+ /**
+ * @var \Magento\Store\Api\Data\StoreInterface | \PHPUnit_Framework_MockObject_MockObject
+ */
private $storeMock;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\Webapi\Controller\Rest\SchemaRequestProcessor | \PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $schemaRequestProcessor;
+
+ /**
+ * @var \Magento\Webapi\Controller\Rest\SynchronousRequestProcessor | \PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $synchronousRequestProcessor;
+
+ /**
+ * @var \Magento\Webapi\Controller\Rest\RequestProcessorPool | \PHPUnit_Framework_MockObject_MockObject
*/
- private $deploymentConfigMock;
+ protected $requestProcessorPool;
const SERVICE_METHOD = 'testMethod';
@@ -81,94 +93,87 @@ class RestTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
- $this->deploymentConfigMock = $this->createMock(\Magento\Framework\App\DeploymentConfig::class);
- $this->_requestMock = $this->getMockBuilder(\Magento\Framework\Webapi\Rest\Request::class)
- ->setMethods(
- [
- 'isSecure',
- 'getRequestData',
- 'getParams',
- 'getParam',
- 'getRequestedServices',
- 'getPathInfo',
- 'getHttpHost',
- 'getMethod',
- ]
- )->disableOriginalConstructor()->getMock();
+ $objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class);
+ $this->_requestMock = $this->getRequestMock();
$this->_requestMock->expects($this->any())->method('getHttpHost')->willReturn('testHostName.com');
- $this->_responseMock = $this->getMockBuilder(\Magento\Framework\Webapi\Rest\Response::class)
- ->setMethods(['sendResponse', 'prepareResponse', 'setHeader'])->disableOriginalConstructor()->getMock();
+ $this->_responseMock = $this->getResponseMock();
$routerMock = $this->getMockBuilder(\Magento\Webapi\Controller\Rest\Router::class)->setMethods(['match'])
->disableOriginalConstructor()->getMock();
- $this->_routeMock = $this->getMockBuilder(\Magento\Webapi\Controller\Rest\Router\Route::class)
- ->setMethods(['isSecure', 'getServiceMethod', 'getServiceClass', 'getAclResources', 'getParameters'])
- ->disableOriginalConstructor()->getMock();
- $objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class);
+
+ $this->_routeMock = $this->getRouteMock();
$this->_serviceMock = $this->getMockBuilder(self::SERVICE_ID)->setMethods([self::SERVICE_METHOD])
->disableOriginalConstructor()->getMock();
+
$this->_oauthServiceMock = $this->getMockBuilder(\Magento\Framework\Oauth\OauthInterface::class)
->setMethods(['validateAccessTokenRequest'])->getMockForAbstractClass();
$this->_authorizationMock = $this->getMockBuilder(\Magento\Framework\Webapi\Authorization::class)
->disableOriginalConstructor()->getMock();
+
$paramsOverriderMock = $this->getMockBuilder(\Magento\Webapi\Controller\Rest\ParamsOverrider::class)
->setMethods(['overrideParams'])
->disableOriginalConstructor()->getMock();
+
$dataObjectProcessorMock = $this->getMockBuilder(\Magento\Framework\Reflection\DataObjectProcessor::class)
- ->disableOriginalConstructor()->setMethods(['getMethodReturnType'])->getMockForAbstractClass();
- $this->swaggerGeneratorMock = $this->getMockBuilder(\Magento\Webapi\Model\Rest\Swagger\Generator::class)
->disableOriginalConstructor()
- ->setMethods(['generate', 'getListOfServices'])
+ ->setMethods(['getMethodReturnType'])
->getMockForAbstractClass();
$layoutMock = $this->getMockBuilder(\Magento\Framework\View\LayoutInterface::class)
->disableOriginalConstructor()->getMock();
+
$errorProcessorMock = $this->createMock(\Magento\Framework\Webapi\ErrorProcessor::class);
$errorProcessorMock->expects($this->any())->method('maskException')->will($this->returnArgument(0));
+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+
$this->serviceInputProcessorMock = $this->getMockBuilder(\Magento\Framework\Webapi\ServiceInputProcessor::class)
->disableOriginalConstructor()->setMethods(['process'])->getMock();
+
$areaListMock = $this->createMock(\Magento\Framework\App\AreaList::class);
$areaMock = $this->createMock(\Magento\Framework\App\AreaInterface::class);
$areaListMock->expects($this->any())->method('getArea')->will($this->returnValue($areaMock));
$this->storeMock = $this->createMock(\Magento\Store\Api\Data\StoreInterface::class);
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
$this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock);
+ $this->requestProcessorPool = $this->getRequestProccessotPoolMock();
- /** Init SUT. */
$this->_restController =
$objectManager->getObject(
\Magento\Webapi\Controller\Rest::class,
[
- 'request' => $this->_requestMock,
- 'response' => $this->_responseMock,
- 'router' => $routerMock,
- 'objectManager' => $objectManagerMock,
- 'layout' => $layoutMock,
- 'oauthService' => $this->_oauthServiceMock,
- 'authorization' => $this->_authorizationMock,
+ 'request' => $this->_requestMock,
+ 'response' => $this->_responseMock,
+ 'router' => $routerMock,
+ 'objectManager' => $objectManagerMock,
+ 'layout' => $layoutMock,
+ 'oauthService' => $this->_oauthServiceMock,
+ 'authorization' => $this->_authorizationMock,
'serviceInputProcessor' => $this->serviceInputProcessorMock,
- 'errorProcessor' => $errorProcessorMock,
- 'areaList' => $areaListMock,
- 'paramsOverrider' => $paramsOverriderMock,
- 'dataObjectProcessor' => $dataObjectProcessorMock,
- 'swaggerGenerator' => $this->swaggerGeneratorMock,
- 'storeManager' => $this->storeManagerMock
+ 'errorProcessor' => $errorProcessorMock,
+ 'areaList' => $areaListMock,
+ 'paramsOverrider' => $paramsOverriderMock,
+ 'dataObjectProcessor' => $dataObjectProcessorMock,
+ 'storeManager' => $this->storeManagerMock,
+ 'requestProcessorPool' => $this->requestProcessorPool,
]
);
- $this->_restController->setDeploymentConfig($this->deploymentConfigMock);
- // Set default expectations used by all tests
$this->_routeMock->expects($this->any())->method('getServiceClass')->will($this->returnValue(self::SERVICE_ID));
$this->_routeMock->expects($this->any())->method('getServiceMethod')
->will($this->returnValue(self::SERVICE_METHOD));
+
$routerMock->expects($this->any())->method('match')->will($this->returnValue($this->_routeMock));
+
$objectManagerMock->expects($this->any())->method('get')->will($this->returnValue($this->_serviceMock));
$this->_responseMock->expects($this->any())->method('prepareResponse')->will($this->returnValue([]));
$this->_serviceMock->expects($this->any())->method(self::SERVICE_METHOD)->will($this->returnValue(null));
+
$dataObjectProcessorMock->expects($this->any())->method('getMethodReturnType')
->with(self::SERVICE_ID, self::SERVICE_METHOD)
->will($this->returnValue('null'));
+
$paramsOverriderMock->expects($this->any())->method('overrideParams')->will($this->returnValue([]));
+
parent::setUp();
}
@@ -179,16 +184,17 @@ public function testDispatchSchemaRequest()
];
$this->_requestMock->expects($this->any())
->method('getPathInfo')
- ->willReturn(\Magento\Webapi\Controller\Rest::SCHEMA_PATH);
+ ->willReturn(\Magento\Webapi\Controller\Rest\SchemaRequestProcessor::PROCESSOR_PATH);
+
$this->_requestMock->expects($this->any())
->method('getParams')
->will($this->returnValue($params));
+
$schema = 'Some REST schema content';
$this->swaggerGeneratorMock->expects($this->any())->method('generate')->willReturn($schema);
+ $this->requestProcessorPool->getProcessor($this->_requestMock)->process($this->_requestMock);
- /** @var \Magento\Framework\App\ResponseInterface $response */
- $response = $this->_restController->dispatch($this->_requestMock);
- $this->assertEquals($schema, $response->getBody());
+ $this->assertEquals($schema, $this->_responseMock->getBody());
}
public function testDispatchAllSchemaRequest()
@@ -198,15 +204,17 @@ public function testDispatchAllSchemaRequest()
];
$this->_requestMock->expects($this->any())
->method('getPathInfo')
- ->willReturn(\Magento\Webapi\Controller\Rest::SCHEMA_PATH);
+ ->willReturn(\Magento\Webapi\Controller\Rest\SchemaRequestProcessor::PROCESSOR_PATH);
$this->_requestMock->expects($this->any())
->method('getParam')
->will(
- $this->returnValueMap(
+ $this->returnValueMap([
[
- [\Magento\Framework\Webapi\Request::REQUEST_PARAM_SERVICES, null, 'all']
- ]
- )
+ \Magento\Framework\Webapi\Request::REQUEST_PARAM_SERVICES,
+ null,
+ 'all',
+ ],
+ ])
);
$this->_requestMock->expects($this->any())
->method('getParams')
@@ -214,11 +222,95 @@ public function testDispatchAllSchemaRequest()
$this->_requestMock->expects($this->any())
->method('getRequestedServices')
->will($this->returnValue('all'));
+
$schema = 'Some REST schema content';
$this->swaggerGeneratorMock->expects($this->any())->method('generate')->willReturn($schema);
- $this->swaggerGeneratorMock->expects($this->once())->method('getListOfServices')
- ->willReturn(['listOfServices']);
- $this->_restController->dispatch($this->_requestMock);
+ $this->requestProcessorPool->getProcessor($this->_requestMock)->process($this->_requestMock);
+
$this->assertEquals($schema, $this->_responseMock->getBody());
}
+
+ /**
+ * @return object|\Magento\Webapi\Controller\Rest\RequestProcessorPool
+ */
+ private function getRequestProccessotPoolMock()
+ {
+ $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+
+ $this->swaggerGeneratorMock = $this->getMockBuilder(\Magento\Webapi\Model\Rest\Swagger\Generator::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['generate', 'getListOfServices'])
+ ->getMockForAbstractClass();
+
+ $this->schemaRequestProcessor = $objectManager->getObject(
+ \Magento\Webapi\Controller\Rest\SchemaRequestProcessor::class,
+ [
+ 'swaggerGenerator' => $this->swaggerGeneratorMock,
+ 'response' => $this->_responseMock,
+ ]
+ );
+
+ $this->synchronousRequestProcessor =
+ $this->getMockBuilder(\Magento\Webapi\Controller\Rest\SynchronousRequestProcessor::class)
+ ->setMethods(['process'])
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ return $objectManager->getObject(
+ \Magento\Webapi\Controller\Rest\RequestProcessorPool::class,
+ [
+ 'requestProcessors' => [
+ 'syncSchema' => $this->schemaRequestProcessor,
+ 'sync' => $this->synchronousRequestProcessor,
+ ],
+ ]
+ );
+ }
+
+ /**
+ * @return \Magento\Webapi\Controller\Rest\Router\Route | \PHPUnit_Framework_MockObject_MockObject
+ */
+ private function getRouteMock()
+ {
+ return $this->getMockBuilder(\Magento\Webapi\Controller\Rest\Router\Route::class)
+ ->setMethods([
+ 'isSecure',
+ 'getServiceMethod',
+ 'getServiceClass',
+ 'getAclResources',
+ 'getParameters',
+ ])
+ ->disableOriginalConstructor()->getMock();
+ }
+
+ /**
+ * @return \Magento\Framework\Webapi\Rest\Request|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private function getRequestMock()
+ {
+ return $this->getMockBuilder(\Magento\Framework\Webapi\Rest\Request::class)
+ ->setMethods(
+ [
+ 'isSecure',
+ 'getRequestData',
+ 'getParams',
+ 'getParam',
+ 'getRequestedServices',
+ 'getPathInfo',
+ 'getHttpHost',
+ 'getMethod',
+ ]
+ )->disableOriginalConstructor()->getMock();
+ }
+
+ /**
+ * @return \Magento\Framework\Webapi\Rest\Response|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private function getResponseMock()
+ {
+ return $this->getMockBuilder(\Magento\Framework\Webapi\Rest\Response::class)
+ ->setMethods(['sendResponse', 'prepareResponse', 'setHeader'])
+ ->disableOriginalConstructor()
+ ->getMock();
+ }
}
diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php
index c7272e3e5a2b2..86ef45e95618a 100644
--- a/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php
+++ b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php
@@ -297,6 +297,9 @@ public function testValidToken($userType, $userId, $expectedUserType, $expectedU
$this->assertEquals($expectedUserId, $this->tokenUserContext->getUserId());
}
+ /**
+ * @return array
+ */
public function getValidTokenData()
{
return [
diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Rest/Swagger/GeneratorTest.php b/app/code/Magento/Webapi/Test/Unit/Model/Rest/Swagger/GeneratorTest.php
index 611517df51657..8976ea6845dad 100644
--- a/app/code/Magento/Webapi/Test/Unit/Model/Rest/Swagger/GeneratorTest.php
+++ b/app/code/Magento/Webapi/Test/Unit/Model/Rest/Swagger/GeneratorTest.php
@@ -295,6 +295,9 @@ public function testGetObjectSchema($typeName, $description, $result)
$this->assertSame(json_encode($result), json_encode($actual));
}
+ /**
+ * @return array
+ */
public function getObjectSchemaDataProvider()
{
return [
@@ -354,6 +357,9 @@ public function testGenerateDefinition($typeData, $expected)
$this->assertSame(json_encode($expected), json_encode($actual));
}
+ /**
+ * @return array
+ */
public function generateDefinitionDataProvider()
{
return [
diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml
index 9bb35a756a3cb..62ba22a658aaa 100644
--- a/app/code/Magento/Webapi/etc/di.xml
+++ b/app/code/Magento/Webapi/etc/di.xml
@@ -6,6 +6,7 @@
*/
-->
+
diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml
index fa8252aca9095..f958d0d821a4b 100644
--- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml
+++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml
@@ -69,4 +69,15 @@
+
+
+
+
+
+
+ - Magento\Webapi\Controller\Rest\SchemaRequestProcessor
+ - Magento\Webapi\Controller\Rest\SynchronousRequestProcessor
+
+
+
diff --git a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php
index b079b034fd772..d262c8c5fb896 100644
--- a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php
+++ b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php
@@ -33,7 +33,7 @@ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Framework\Da
/**
* @var string
*/
- protected $_template = 'renderer/tax.phtml';
+ protected $_template = 'Magento_Weee::renderer/tax.phtml';
/**
* Core registry
diff --git a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php
index dfa40a166ba99..83ecad639fc5b 100644
--- a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php
+++ b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php
@@ -183,4 +183,12 @@ public function getTable()
{
return $this->_attributeTax->getTable('weee_tax');
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getEntityIdField()
+ {
+ return $this->_attributeTax->getIdFieldName();
+ }
}
diff --git a/app/code/Magento/Weee/Test/Unit/Block/Item/Price/RendererTest.php b/app/code/Magento/Weee/Test/Unit/Block/Item/Price/RendererTest.php
index b49150fc6fac0..8b770ea763cdd 100644
--- a/app/code/Magento/Weee/Test/Unit/Block/Item/Price/RendererTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Block/Item/Price/RendererTest.php
@@ -122,6 +122,9 @@ public function testDisplayPriceWithWeeeDetails(
$this->assertEquals($expectedValue, $this->renderer->displayPriceWithWeeeDetails());
}
+ /**
+ * @return array
+ */
public function displayPriceWithWeeeDetailsDataProvider()
{
$data = [
@@ -472,6 +475,9 @@ public function testGetBaseRowDisplayPriceInclTax(
$this->assertEquals($expectedValue, $this->renderer->getBaseRowDisplayPriceInclTax());
}
+ /**
+ * @return array
+ */
public function getDisplayPriceDataProvider()
{
$data = [
@@ -739,6 +745,9 @@ public function testGetBaseFinalRowDisplayPriceInclTax(
$this->assertEquals($expectedValue, $this->renderer->getBaseFinalRowDisplayPriceInclTax());
}
+ /**
+ * @return array
+ */
public function getFinalDisplayPriceDataProvider()
{
$data = [
diff --git a/app/code/Magento/Weee/Test/Unit/Model/Attribute/Backend/Weee/TaxTest.php b/app/code/Magento/Weee/Test/Unit/Model/Attribute/Backend/Weee/TaxTest.php
index 8ba8afaa1a8ab..05f7d3ccdff84 100644
--- a/app/code/Magento/Weee/Test/Unit/Model/Attribute/Backend/Weee/TaxTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Model/Attribute/Backend/Weee/TaxTest.php
@@ -270,4 +270,31 @@ public function testGetTable()
$model->getTable();
}
+
+ /**
+ * Test method GetEntityIdField.
+ *
+ * @return void
+ */
+ public function testGetEntityIdField()
+ {
+ $attributeTaxMock = $this->getMockBuilder(\Magento\Weee\Model\ResourceModel\Attribute\Backend\Weee\Tax::class)
+ ->setMethods(['getEntityIdField', 'getIdFieldName'])
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $attributeTaxMock
+ ->expects($this->once())
+ ->method('getIdFieldName')
+ ->willReturn(null);
+
+ $model = $this->objectManager->getObject(
+ \Magento\Weee\Model\Attribute\Backend\Weee\Tax::class,
+ [
+ 'attributeTax' => $attributeTaxMock,
+ ]
+ );
+
+ $model->getEntityIdField();
+ }
}
diff --git a/app/code/Magento/Weee/Test/Unit/Model/Total/Invoice/WeeeTest.php b/app/code/Magento/Weee/Test/Unit/Model/Total/Invoice/WeeeTest.php
index 975580945bb3a..22d673e0c8b26 100644
--- a/app/code/Magento/Weee/Test/Unit/Model/Total/Invoice/WeeeTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Model/Total/Invoice/WeeeTest.php
@@ -78,6 +78,9 @@ protected function setUp()
$this->invoice->expects($this->atLeastOnce())->method('getOrder')->will($this->returnValue($this->order));
}
+ /**
+ * @param $orderData
+ */
private function setupOrder($orderData)
{
//Set up order mock
diff --git a/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php b/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php
index 19f55550bac65..6d363847bf9e6 100644
--- a/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php
@@ -130,6 +130,9 @@ public function testExecute(
$this->session->execute($this->observerMock);
}
+ /**
+ * @return array
+ */
public function getExecuteDataProvider()
{
return [
diff --git a/app/code/Magento/Weee/Test/Unit/Pricing/AdjustmentTest.php b/app/code/Magento/Weee/Test/Unit/Pricing/AdjustmentTest.php
index e0eba358bc892..4c65011c1f69a 100644
--- a/app/code/Magento/Weee/Test/Unit/Pricing/AdjustmentTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Pricing/AdjustmentTest.php
@@ -134,6 +134,9 @@ public function testIsExcludedWith($adjustmentCode, $expectedResult)
$this->assertEquals($expectedResult, $this->adjustment->isExcludedWith($adjustmentCode));
}
+ /**
+ * @return array
+ */
public function isExcludedWithDataProvider()
{
return [
@@ -157,6 +160,9 @@ public function testGetSortOrder($isTaxable, $expectedResult)
$this->assertEquals($expectedResult, $this->adjustment->getSortOrder());
}
+ /**
+ * @return array
+ */
public function getSortOrderProvider()
{
return [
diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php
index 49345f29afd53..c48bf9e7e4c7a 100644
--- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php
+++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php
@@ -27,7 +27,7 @@ class Layout extends Template implements RendererInterface
/**
* @var string
*/
- protected $_template = 'instance/edit/layout.phtml';
+ protected $_template = 'Magento_Widget::instance/edit/layout.phtml';
/**
* @var \Magento\Catalog\Model\Product\Type
diff --git a/app/code/Magento/Wishlist/Block/Rss/EmailLink.php b/app/code/Magento/Wishlist/Block/Rss/EmailLink.php
index 4a5f116cd8293..907dfd90e752e 100644
--- a/app/code/Magento/Wishlist/Block/Rss/EmailLink.php
+++ b/app/code/Magento/Wishlist/Block/Rss/EmailLink.php
@@ -21,7 +21,7 @@ class EmailLink extends Link
/**
* @var string
*/
- protected $_template = 'rss/email.phtml';
+ protected $_template = 'Magento_Wishlist::rss/email.phtml';
/**
* @return array
diff --git a/app/code/Magento/Wishlist/Block/Share/Email/Items.php b/app/code/Magento/Wishlist/Block/Share/Email/Items.php
index bc84f6a43df3c..d4e6587fd6519 100644
--- a/app/code/Magento/Wishlist/Block/Share/Email/Items.php
+++ b/app/code/Magento/Wishlist/Block/Share/Email/Items.php
@@ -20,7 +20,7 @@ class Items extends \Magento\Wishlist\Block\AbstractBlock
/**
* @var string
*/
- protected $_template = 'email/items.phtml';
+ protected $_template = 'Magento_Wishlist::email/items.phtml';
/**
* Retrieve Product View URL
diff --git a/app/code/Magento/Wishlist/Test/Unit/Block/Customer/Wishlist/Item/OptionsTest.php b/app/code/Magento/Wishlist/Test/Unit/Block/Customer/Wishlist/Item/OptionsTest.php
index 4b3ff8b8dd23e..36c51547c5a42 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Block/Customer/Wishlist/Item/OptionsTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Block/Customer/Wishlist/Item/OptionsTest.php
@@ -114,6 +114,9 @@ public function testGetConfiguredOptions($options, $callNum, $expected)
$this->assertEquals($expected, $this->block->getConfiguredOptions());
}
+ /**
+ * @return array
+ */
public function getConfiguredOptionsDataProvider()
{
return [
diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php
index d7195086850e4..2df44a912a09c 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php
@@ -136,6 +136,9 @@ protected function prepareContext()
->willReturn($this->resultFactoryMock);
}
+ /**
+ * @return \Magento\Wishlist\Controller\Index\Allcart
+ */
public function getController()
{
$this->prepareContext();
diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php
index 136d0f7f36c3e..7c6ba740aa18d 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php
@@ -123,6 +123,9 @@ protected function prepareContext()
->willReturn($this->resultFactoryMock);
}
+ /**
+ * @return \Magento\Wishlist\Controller\Index\Index
+ */
public function getController()
{
$this->prepareContext();
diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/PluginTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/PluginTest.php
index 82a58df1e579e..79186d29e666d 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/PluginTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/PluginTest.php
@@ -67,6 +67,9 @@ protected function tearDown()
);
}
+ /**
+ * @return \Magento\Wishlist\Controller\Index\Plugin
+ */
protected function getPlugin()
{
return new \Magento\Wishlist\Controller\Index\Plugin(
diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/RemoveTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/RemoveTest.php
index 2a36d3beb8558..6260a1292bee9 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/RemoveTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/RemoveTest.php
@@ -139,6 +139,9 @@ protected function prepareContext()
->willReturn($this->resultFactoryMock);
}
+ /**
+ * @return \Magento\Wishlist\Controller\Index\Remove
+ */
public function getController()
{
$this->prepareContext();
diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php
index 0b1057683de86..9876b3f6bb75e 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php
@@ -172,6 +172,9 @@ public function testRemoveOptionByCode($code, $option)
$this->assertTrue($actualOption->isDeleted());
}
+ /**
+ * @return array
+ */
public function getOptionsDataProvider()
{
$optionMock = $this->getMockBuilder(\Magento\Wishlist\Model\Item\Option::class)
diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php
index 145d282554634..6cac17aa8c3da 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php
@@ -60,6 +60,9 @@ public function testProcess($qtyResult, $expectedResult)
$this->assertEquals($expectedResult, $this->processor->process($qty));
}
+ /**
+ * @return array
+ */
public function processDataProvider()
{
return [
diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less
index 6f7da202c16e6..228c6947c938b 100644
--- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less
@@ -336,6 +336,11 @@
.lib-css(margin-top, @indent__xs);
}
}
+ .field {
+ .note.mage-error {
+ color: @error__color;
+ }
+ }
}
.product-options-bottom .price-box,
@@ -789,7 +794,7 @@
clear: both;
max-width: 100%;
overflow-x: auto;
- position: relative; // Needed for Safari(iOS) to properly render "overflow-x" rule.
+ position: relative; // Needed for Safari(iOS) to properly render 'overflow-x' rule.
.table-comparison > tbody > tr {
> th,
diff --git a/app/etc/di.xml b/app/etc/di.xml
index fcc1ae5521df3..ad77ae3adc566 100755
--- a/app/etc/di.xml
+++ b/app/etc/di.xml
@@ -234,6 +234,11 @@
Magento\Backend\App\Request\PathInfoProcessor\Proxy
+
+
+ Magento\Framework\Session\Config\ConfigInterface\Proxy
+
+
diff --git a/composer.json b/composer.json
index 03cf41c30b5fa..63151a463b2c8 100644
--- a/composer.json
+++ b/composer.json
@@ -176,6 +176,7 @@
"magento/module-signifyd": "100.2.1",
"magento/module-sitemap": "100.2.3",
"magento/module-store": "100.2.3",
+ "magento/module-swagger-webapi": "100.0.0",
"magento/module-swagger": "100.2.2",
"magento/module-swatches": "100.2.2",
"magento/module-swatches-layered-navigation": "100.2.0",
@@ -263,4 +264,4 @@
}
},
"minimum-stability": "stable"
-}
+}
\ No newline at end of file
diff --git a/composer.lock b/composer.lock
index c38bb48a301c3..0720d7a47792c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "ec6d7cf871a134a22f3e438b939c75be",
+ "hash": "7951fd69d258de36e80b71bc04d1712a",
+ "content-hash": "c1d845429d4f5bca4975609421182049",
"packages": [
{
"name": "braintree/braintree_php",
@@ -51,7 +52,7 @@
}
],
"description": "Braintree PHP Client Library",
- "time": "2018-02-08T23:03:34+00:00"
+ "time": "2018-02-08 23:03:34"
},
{
"name": "colinmollenhour/cache-backend-file",
@@ -87,7 +88,7 @@
],
"description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.",
"homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File",
- "time": "2016-05-02T16:24:47+00:00"
+ "time": "2016-05-02 16:24:47"
},
{
"name": "colinmollenhour/cache-backend-redis",
@@ -123,7 +124,7 @@
],
"description": "Zend_Cache backend using Redis with full support for tags.",
"homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis",
- "time": "2017-10-05T20:50:44+00:00"
+ "time": "2017-10-05 20:50:44"
},
{
"name": "colinmollenhour/credis",
@@ -163,7 +164,7 @@
],
"description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.",
"homepage": "https://github.com/colinmollenhour/credis",
- "time": "2017-07-05T15:32:38+00:00"
+ "time": "2017-07-05 15:32:38"
},
{
"name": "colinmollenhour/php-redis-session-abstract",
@@ -200,7 +201,7 @@
],
"description": "A Redis-based session handler with optimistic locking",
"homepage": "https://github.com/colinmollenhour/php-redis-session-abstract",
- "time": "2017-03-22T16:13:03+00:00"
+ "time": "2017-03-22 16:13:03"
},
{
"name": "composer/ca-bundle",
@@ -256,7 +257,7 @@
"ssl",
"tls"
],
- "time": "2018-03-29T19:57:20+00:00"
+ "time": "2018-03-29 19:57:20"
},
{
"name": "composer/composer",
@@ -333,7 +334,7 @@
"dependency",
"package"
],
- "time": "2017-03-10T08:29:45+00:00"
+ "time": "2017-03-10 08:29:45"
},
{
"name": "composer/semver",
@@ -395,20 +396,20 @@
"validation",
"versioning"
],
- "time": "2016-08-30T16:08:34+00:00"
+ "time": "2016-08-30 16:08:34"
},
{
"name": "composer/spdx-licenses",
- "version": "1.3.0",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/spdx-licenses.git",
- "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30"
+ "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7e111c50db92fa2ced140f5ba23b4e261bc77a30",
- "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30",
+ "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b",
+ "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b",
"shasum": ""
},
"require": {
@@ -456,7 +457,7 @@
"spdx",
"validator"
],
- "time": "2018-01-31T13:17:27+00:00"
+ "time": "2018-04-30 10:33:04"
},
{
"name": "container-interop/container-interop",
@@ -487,7 +488,7 @@
],
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
"homepage": "https://github.com/container-interop/container-interop",
- "time": "2017-02-14T19:40:03+00:00"
+ "time": "2017-02-14 19:40:03"
},
{
"name": "justinrainbow/json-schema",
@@ -553,7 +554,7 @@
"json",
"schema"
],
- "time": "2018-02-14T22:26:30+00:00"
+ "time": "2018-02-14 22:26:30"
},
{
"name": "magento/composer",
@@ -589,7 +590,7 @@
"AFL-3.0"
],
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
- "time": "2017-04-24T09:57:02+00:00"
+ "time": "2017-04-24 09:57:02"
},
{
"name": "magento/magento-composer-installer",
@@ -668,7 +669,7 @@
"composer-installer",
"magento"
],
- "time": "2017-12-29T16:45:24+00:00"
+ "time": "2017-12-29 16:45:24"
},
{
"name": "magento/zendframework1",
@@ -715,7 +716,7 @@
"ZF1",
"framework"
],
- "time": "2017-06-21T14:56:23+00:00"
+ "time": "2017-06-21 14:56:23"
},
{
"name": "monolog/monolog",
@@ -793,7 +794,7 @@
"logging",
"psr-3"
],
- "time": "2017-06-19T01:22:40+00:00"
+ "time": "2017-06-19 01:22:40"
},
{
"name": "oyejorge/less.php",
@@ -855,7 +856,7 @@
"php",
"stylesheet"
],
- "time": "2017-03-28T22:19:25+00:00"
+ "time": "2017-03-28 22:19:25"
},
{
"name": "paragonie/random_compat",
@@ -903,7 +904,7 @@
"pseudorandom",
"random"
],
- "time": "2018-04-04T21:24:14+00:00"
+ "time": "2018-04-04 21:24:14"
},
{
"name": "pelago/emogrifier",
@@ -972,7 +973,7 @@
"email",
"pre-processing"
],
- "time": "2018-01-05T23:30:21+00:00"
+ "time": "2018-01-05 23:30:21"
},
{
"name": "phpseclib/phpseclib",
@@ -1064,7 +1065,7 @@
"x.509",
"x509"
],
- "time": "2018-04-15T16:55:05+00:00"
+ "time": "2018-04-15 16:55:05"
},
{
"name": "psr/container",
@@ -1113,7 +1114,7 @@
"container-interop",
"psr"
],
- "time": "2017-02-14T16:28:37+00:00"
+ "time": "2017-02-14 16:28:37"
},
{
"name": "psr/http-message",
@@ -1163,7 +1164,7 @@
"request",
"response"
],
- "time": "2016-08-06T14:39:51+00:00"
+ "time": "2016-08-06 14:39:51"
},
{
"name": "psr/log",
@@ -1210,7 +1211,7 @@
"psr",
"psr-3"
],
- "time": "2016-10-10T12:19:37+00:00"
+ "time": "2016-10-10 12:19:37"
},
{
"name": "ramsey/uuid",
@@ -1290,7 +1291,7 @@
"identifier",
"uuid"
],
- "time": "2018-01-20T00:28:24+00:00"
+ "time": "2018-01-20 00:28:24"
},
{
"name": "seld/cli-prompt",
@@ -1338,7 +1339,7 @@
"input",
"prompt"
],
- "time": "2017-03-18T11:32:45+00:00"
+ "time": "2017-03-18 11:32:45"
},
{
"name": "seld/jsonlint",
@@ -1387,7 +1388,7 @@
"parser",
"validator"
],
- "time": "2018-01-24T12:46:19+00:00"
+ "time": "2018-01-24 12:46:19"
},
{
"name": "seld/phar-utils",
@@ -1431,7 +1432,7 @@
"keywords": [
"phra"
],
- "time": "2015-10-13T18:44:15+00:00"
+ "time": "2015-10-13 18:44:15"
},
{
"name": "symfony/console",
@@ -1492,7 +1493,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-04-30T01:21:07+00:00"
+ "time": "2018-04-30 01:21:07"
},
{
"name": "symfony/debug",
@@ -1549,7 +1550,7 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2016-07-30T07:22:48+00:00"
+ "time": "2016-07-30 07:22:48"
},
{
"name": "symfony/event-dispatcher",
@@ -1609,11 +1610,11 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2018-04-06T07:35:03+00:00"
+ "time": "2018-04-06 07:35:03"
},
{
"name": "symfony/filesystem",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
@@ -1658,11 +1659,11 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2018-02-22T10:48:49+00:00"
+ "time": "2018-02-22 10:48:49"
},
{
"name": "symfony/finder",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@@ -1707,20 +1708,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2018-04-04T05:07:11+00:00"
+ "time": "2018-04-04 05:07:11"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": ""
},
"require": {
@@ -1732,7 +1733,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -1766,7 +1767,7 @@
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26 10:06:28"
},
{
"name": "symfony/process",
@@ -1815,7 +1816,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2018-04-03T05:20:27+00:00"
+ "time": "2018-04-03 05:20:27"
},
{
"name": "tedivm/jshrink",
@@ -1861,7 +1862,7 @@
"javascript",
"minifier"
],
- "time": "2017-12-08T00:59:56+00:00"
+ "time": "2017-12-08 00:59:56"
},
{
"name": "tubalmartin/cssmin",
@@ -1914,7 +1915,7 @@
"minify",
"yui"
],
- "time": "2018-01-15T15:26:51+00:00"
+ "time": "2018-01-15 15:26:51"
},
{
"name": "zendframework/zend-captcha",
@@ -1972,7 +1973,7 @@
"captcha",
"zf"
],
- "time": "2018-04-24T17:24:10+00:00"
+ "time": "2018-04-24 17:24:10"
},
{
"name": "zendframework/zend-code",
@@ -2025,7 +2026,7 @@
"code",
"zf2"
],
- "time": "2016-10-24T13:23:32+00:00"
+ "time": "2016-10-24 13:23:32"
},
{
"name": "zendframework/zend-config",
@@ -2081,7 +2082,7 @@
"config",
"zf2"
],
- "time": "2016-02-04T23:01:10+00:00"
+ "time": "2016-02-04 23:01:10"
},
{
"name": "zendframework/zend-console",
@@ -2134,7 +2135,7 @@
"console",
"zf"
],
- "time": "2018-01-25T19:08:04+00:00"
+ "time": "2018-01-25 19:08:04"
},
{
"name": "zendframework/zend-crypt",
@@ -2184,7 +2185,7 @@
"crypt",
"zf2"
],
- "time": "2016-02-03T23:46:30+00:00"
+ "time": "2016-02-03 23:46:30"
},
{
"name": "zendframework/zend-db",
@@ -2242,7 +2243,7 @@
"db",
"zf"
],
- "time": "2018-04-09T13:21:36+00:00"
+ "time": "2018-04-09 13:21:36"
},
{
"name": "zendframework/zend-di",
@@ -2289,7 +2290,7 @@
"di",
"zf2"
],
- "time": "2016-04-25T20:58:11+00:00"
+ "time": "2016-04-25 20:58:11"
},
{
"name": "zendframework/zend-diactoros",
@@ -2341,7 +2342,7 @@
"psr",
"psr-7"
],
- "time": "2018-02-26T15:44:50+00:00"
+ "time": "2018-02-26 15:44:50"
},
{
"name": "zendframework/zend-escaper",
@@ -2386,7 +2387,7 @@
"escaper",
"zf"
],
- "time": "2018-04-25T15:48:53+00:00"
+ "time": "2018-04-25 15:48:53"
},
{
"name": "zendframework/zend-eventmanager",
@@ -2433,7 +2434,7 @@
"eventmanager",
"zf2"
],
- "time": "2017-12-12T17:48:56+00:00"
+ "time": "2017-12-12 17:48:56"
},
{
"name": "zendframework/zend-filter",
@@ -2496,7 +2497,7 @@
"filter",
"zf"
],
- "time": "2018-04-11T16:20:04+00:00"
+ "time": "2018-04-11 16:20:04"
},
{
"name": "zendframework/zend-form",
@@ -2574,7 +2575,7 @@
"form",
"zf"
],
- "time": "2017-12-06T21:09:08+00:00"
+ "time": "2017-12-06 21:09:08"
},
{
"name": "zendframework/zend-http",
@@ -2629,7 +2630,7 @@
"zend",
"zf"
],
- "time": "2018-04-26T21:04:50+00:00"
+ "time": "2018-04-26 21:04:50"
},
{
"name": "zendframework/zend-hydrator",
@@ -2687,7 +2688,7 @@
"hydrator",
"zf2"
],
- "time": "2016-02-18T22:38:26+00:00"
+ "time": "2016-02-18 22:38:26"
},
{
"name": "zendframework/zend-i18n",
@@ -2755,7 +2756,7 @@
"i18n",
"zf"
],
- "time": "2018-04-25T19:32:43+00:00"
+ "time": "2018-04-25 19:32:43"
},
{
"name": "zendframework/zend-inputfilter",
@@ -2808,7 +2809,7 @@
"inputfilter",
"zf"
],
- "time": "2018-01-22T19:41:18+00:00"
+ "time": "2018-01-22 19:41:18"
},
{
"name": "zendframework/zend-json",
@@ -2863,7 +2864,7 @@
"json",
"zf2"
],
- "time": "2016-02-04T21:20:26+00:00"
+ "time": "2016-02-04 21:20:26"
},
{
"name": "zendframework/zend-loader",
@@ -2908,7 +2909,7 @@
"loader",
"zf"
],
- "time": "2018-04-30T15:20:54+00:00"
+ "time": "2018-04-30 15:20:54"
},
{
"name": "zendframework/zend-log",
@@ -2979,7 +2980,7 @@
"logging",
"zf2"
],
- "time": "2018-04-09T21:59:51+00:00"
+ "time": "2018-04-09 21:59:51"
},
{
"name": "zendframework/zend-math",
@@ -3029,7 +3030,7 @@
"math",
"zf2"
],
- "time": "2016-04-07T16:29:53+00:00"
+ "time": "2016-04-07 16:29:53"
},
{
"name": "zendframework/zend-modulemanager",
@@ -3089,30 +3090,31 @@
"modulemanager",
"zf"
],
- "time": "2017-12-02T06:11:18+00:00"
+ "time": "2017-12-02 06:11:18"
},
{
"name": "zendframework/zend-mvc",
- "version": "2.7.13",
+ "version": "2.7.15",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-mvc.git",
- "reference": "9dcaaad145254d023d3cd3559bf29e430f2884b2"
+ "reference": "a8d45689d37a9e4ff4b75ea0b7478fa3d4f9c089"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-mvc/zipball/9dcaaad145254d023d3cd3559bf29e430f2884b2",
- "reference": "9dcaaad145254d023d3cd3559bf29e430f2884b2",
+ "url": "https://api.github.com/repos/zendframework/zend-mvc/zipball/a8d45689d37a9e4ff4b75ea0b7478fa3d4f9c089",
+ "reference": "a8d45689d37a9e4ff4b75ea0b7478fa3d4f9c089",
"shasum": ""
},
"require": {
"container-interop/container-interop": "^1.1",
"php": "^5.5 || ^7.0",
- "zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
- "zendframework/zend-form": "^2.8.2",
- "zendframework/zend-hydrator": "^1.1 || ^2.1",
+ "zendframework/zend-console": "^2.7",
+ "zendframework/zend-eventmanager": "^2.6.4 || ^3.0",
+ "zendframework/zend-form": "^2.11",
+ "zendframework/zend-hydrator": "^1.1 || ^2.4",
"zendframework/zend-psr7bridge": "^0.2",
- "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
+ "zendframework/zend-servicemanager": "^2.7.10 || ^3.0.3",
"zendframework/zend-stdlib": "^2.7.5 || ^3.0"
},
"replace": {
@@ -3120,30 +3122,29 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "1.7.*",
- "phpunit/phpunit": "^4.5",
+ "phpunit/phpunit": "^4.8.36",
+ "sebastian/comparator": "^1.2.4",
"sebastian/version": "^1.0.4",
- "zendframework/zend-authentication": "^2.5.3",
- "zendframework/zend-cache": "^2.6.1",
- "zendframework/zend-console": "^2.6",
+ "zendframework/zend-authentication": "^2.6",
+ "zendframework/zend-cache": "^2.8",
"zendframework/zend-di": "^2.6",
- "zendframework/zend-filter": "^2.6.1",
- "zendframework/zend-http": "^2.5.4",
- "zendframework/zend-i18n": "^2.6",
- "zendframework/zend-inputfilter": "^2.6",
+ "zendframework/zend-filter": "^2.8",
+ "zendframework/zend-http": "^2.8",
+ "zendframework/zend-i18n": "^2.8",
+ "zendframework/zend-inputfilter": "^2.8",
"zendframework/zend-json": "^2.6.1",
- "zendframework/zend-log": "^2.7.1",
- "zendframework/zend-modulemanager": "^2.7.1",
- "zendframework/zend-serializer": "^2.6.1",
- "zendframework/zend-session": "^2.6.2",
- "zendframework/zend-text": "^2.6",
- "zendframework/zend-uri": "^2.5",
- "zendframework/zend-validator": "^2.6",
- "zendframework/zend-view": "^2.6.3"
+ "zendframework/zend-log": "^2.9.3",
+ "zendframework/zend-modulemanager": "^2.8",
+ "zendframework/zend-serializer": "^2.8",
+ "zendframework/zend-session": "^2.8.1",
+ "zendframework/zend-text": "^2.7",
+ "zendframework/zend-uri": "^2.6",
+ "zendframework/zend-validator": "^2.10",
+ "zendframework/zend-view": "^2.9"
},
"suggest": {
"zendframework/zend-authentication": "Zend\\Authentication component for Identity plugin",
"zendframework/zend-config": "Zend\\Config component",
- "zendframework/zend-console": "Zend\\Console component",
"zendframework/zend-di": "Zend\\Di component",
"zendframework/zend-filter": "Zend\\Filter component",
"zendframework/zend-http": "Zend\\Http component",
@@ -3168,6 +3169,9 @@
}
},
"autoload": {
+ "files": [
+ "src/autoload.php"
+ ],
"psr-4": {
"Zend\\Mvc\\": "src/"
}
@@ -3181,7 +3185,7 @@
"mvc",
"zf2"
],
- "time": "2017-12-14T22:44:10+00:00"
+ "time": "2018-05-03 13:13:41"
},
{
"name": "zendframework/zend-psr7bridge",
@@ -3230,7 +3234,7 @@
"psr",
"psr-7"
],
- "time": "2016-05-10T21:44:39+00:00"
+ "time": "2016-05-10 21:44:39"
},
{
"name": "zendframework/zend-serializer",
@@ -3288,20 +3292,20 @@
"serializer",
"zf2"
],
- "time": "2017-11-20T22:21:04+00:00"
+ "time": "2017-11-20 22:21:04"
},
{
"name": "zendframework/zend-server",
- "version": "2.7.0",
+ "version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-server.git",
- "reference": "7cb617ca3e9b24579f544a244ee79ae61f480914"
+ "reference": "23a2e9a5599c83c05da831cb7c649e8a7809595e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-server/zipball/7cb617ca3e9b24579f544a244ee79ae61f480914",
- "reference": "7cb617ca3e9b24579f544a244ee79ae61f480914",
+ "url": "https://api.github.com/repos/zendframework/zend-server/zipball/23a2e9a5599c83c05da831cb7c649e8a7809595e",
+ "reference": "23a2e9a5599c83c05da831cb7c649e8a7809595e",
"shasum": ""
},
"require": {
@@ -3310,14 +3314,14 @@
"zendframework/zend-stdlib": "^2.5 || ^3.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8",
- "squizlabs/php_codesniffer": "^2.3.1"
+ "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4",
+ "zendframework/zend-coding-standard": "~1.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev",
- "dev-develop": "2.8-dev"
+ "dev-master": "2.8.x-dev",
+ "dev-develop": "2.9.x-dev"
}
},
"autoload": {
@@ -3329,12 +3333,13 @@
"license": [
"BSD-3-Clause"
],
- "homepage": "https://github.com/zendframework/zend-server",
+ "description": "Create Reflection-based RPC servers",
"keywords": [
+ "ZendFramework",
"server",
- "zf2"
+ "zf"
],
- "time": "2016-06-20T22:27:55+00:00"
+ "time": "2018-04-30 22:21:28"
},
{
"name": "zendframework/zend-servicemanager",
@@ -3386,7 +3391,7 @@
"servicemanager",
"zf2"
],
- "time": "2017-12-05T16:27:36+00:00"
+ "time": "2017-12-05 16:27:36"
},
{
"name": "zendframework/zend-session",
@@ -3453,7 +3458,7 @@
"session",
"zf"
],
- "time": "2018-02-22T16:33:54+00:00"
+ "time": "2018-02-22 16:33:54"
},
{
"name": "zendframework/zend-soap",
@@ -3506,7 +3511,7 @@
"soap",
"zf2"
],
- "time": "2018-01-29T17:51:26+00:00"
+ "time": "2018-01-29 17:51:26"
},
{
"name": "zendframework/zend-stdlib",
@@ -3565,7 +3570,7 @@
"stdlib",
"zf2"
],
- "time": "2016-04-12T21:17:31+00:00"
+ "time": "2016-04-12 21:17:31"
},
{
"name": "zendframework/zend-text",
@@ -3613,7 +3618,7 @@
"text",
"zf"
],
- "time": "2018-04-30T14:55:10+00:00"
+ "time": "2018-04-30 14:55:10"
},
{
"name": "zendframework/zend-uri",
@@ -3660,7 +3665,7 @@
"uri",
"zf"
],
- "time": "2018-04-30T13:40:08+00:00"
+ "time": "2018-04-30 13:40:08"
},
{
"name": "zendframework/zend-validator",
@@ -3731,7 +3736,7 @@
"validator",
"zf2"
],
- "time": "2018-02-01T17:05:33+00:00"
+ "time": "2018-02-01 17:05:33"
},
{
"name": "zendframework/zend-view",
@@ -3818,7 +3823,7 @@
"view",
"zf2"
],
- "time": "2018-01-17T22:21:50+00:00"
+ "time": "2018-01-17 22:21:50"
}
],
"packages-dev": [
@@ -3888,7 +3893,7 @@
"docblock",
"parser"
],
- "time": "2017-02-24T16:22:25+00:00"
+ "time": "2017-02-24 16:22:25"
},
{
"name": "doctrine/instantiator",
@@ -3942,7 +3947,7 @@
"constructor",
"instantiate"
],
- "time": "2015-06-14T21:17:01+00:00"
+ "time": "2015-06-14 21:17:01"
},
{
"name": "doctrine/lexer",
@@ -3996,7 +4001,62 @@
"lexer",
"parser"
],
- "time": "2014-09-09T13:34:57+00:00"
+ "time": "2014-09-09 13:34:57"
+ },
+ {
+ "name": "elasticsearch/elasticsearch",
+ "version": "v5.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/elastic/elasticsearch-php.git",
+ "reference": "4b29a4121e790bbfe690d5ee77da348b62d48eb8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/4b29a4121e790bbfe690d5ee77da348b62d48eb8",
+ "reference": "4b29a4121e790bbfe690d5ee77da348b62d48eb8",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/ringphp": "~1.0",
+ "php": "^5.6|^7.0",
+ "psr/log": "~1.0"
+ },
+ "require-dev": {
+ "cpliakas/git-wrapper": "~1.0",
+ "doctrine/inflector": "^1.1",
+ "mockery/mockery": "0.9.4",
+ "phpunit/phpunit": "^4.7|^5.4",
+ "sami/sami": "~3.2",
+ "symfony/finder": "^2.8",
+ "symfony/yaml": "^2.8"
+ },
+ "suggest": {
+ "ext-curl": "*",
+ "monolog/monolog": "Allows for client-level logging and tracing"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Elasticsearch\\": "src/Elasticsearch/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Zachary Tong"
+ }
+ ],
+ "description": "PHP Client for Elasticsearch",
+ "keywords": [
+ "client",
+ "elasticsearch",
+ "search"
+ ],
+ "time": "2017-11-08 17:04:47"
},
{
"name": "friendsofphp/php-cs-fixer",
@@ -4082,7 +4142,108 @@
}
],
"description": "A tool to automatically fix PHP code style",
- "time": "2018-03-20T18:04:00+00:00"
+ "time": "2018-03-20 18:04:00"
+ },
+ {
+ "name": "guzzlehttp/ringphp",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/RingPHP.git",
+ "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/streams": "~3.0",
+ "php": ">=5.4.0",
+ "react/promise": "~2.0"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "~4.0"
+ },
+ "suggest": {
+ "ext-curl": "Guzzle will use specific adapters if cURL is present"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Ring\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
+ "time": "2015-05-20 03:37:09"
+ },
+ {
+ "name": "guzzlehttp/streams",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/streams.git",
+ "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
+ "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Stream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Provides a simple abstraction over streams of data",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "Guzzle",
+ "stream"
+ ],
+ "time": "2014-10-12 19:18:40"
},
{
"name": "ircmaxell/password-compat",
@@ -4124,7 +4285,56 @@
"hashing",
"password"
],
- "time": "2014-11-20T16:49:30+00:00"
+ "time": "2014-11-20 16:49:30"
+ },
+ {
+ "name": "league/climate",
+ "version": "2.6.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/climate.git",
+ "reference": "28851c909017424f61cc6a62089316313c645d1c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/climate/zipball/28851c909017424f61cc6a62089316313c645d1c",
+ "reference": "28851c909017424f61cc6a62089316313c645d1c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "dev-master",
+ "phpunit/phpunit": "4.1.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "League\\CLImate\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Joe Tannenbaum",
+ "email": "hey@joe.codes",
+ "homepage": "http://joe.codes/",
+ "role": "Developer"
+ }
+ ],
+ "description": "PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.",
+ "keywords": [
+ "cli",
+ "colors",
+ "command",
+ "php",
+ "terminal"
+ ],
+ "time": "2015-01-18 14:31:58"
},
{
"name": "lusitanian/oauth",
@@ -4191,7 +4401,7 @@
"oauth",
"security"
],
- "time": "2018-02-14T22:37:14+00:00"
+ "time": "2018-02-14 22:37:14"
},
{
"name": "myclabs/deep-copy",
@@ -4236,7 +4446,7 @@
"object",
"object graph"
],
- "time": "2017-10-19T19:58:43+00:00"
+ "time": "2017-10-19 19:58:43"
},
{
"name": "pdepend/pdepend",
@@ -4276,7 +4486,7 @@
"BSD-3-Clause"
],
"description": "Official version of pdepend to be handled with Composer",
- "time": "2017-12-13T13:21:38+00:00"
+ "time": "2017-12-13 13:21:38"
},
{
"name": "phar-io/manifest",
@@ -4331,7 +4541,7 @@
}
],
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
- "time": "2017-03-05T18:14:27+00:00"
+ "time": "2017-03-05 18:14:27"
},
{
"name": "phar-io/version",
@@ -4378,7 +4588,61 @@
}
],
"description": "Library for handling version information and constraints",
- "time": "2017-03-05T17:38:23+00:00"
+ "time": "2017-03-05 17:38:23"
+ },
+ {
+ "name": "php-amqplib/php-amqplib",
+ "version": "v2.5.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-amqplib/php-amqplib.git",
+ "reference": "eb8f94d97c8e79900accf77343dbd7eca7f58506"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/eb8f94d97c8e79900accf77343dbd7eca7f58506",
+ "reference": "eb8f94d97c8e79900accf77343dbd7eca7f58506",
+ "shasum": ""
+ },
+ "require": {
+ "ext-bcmath": "*",
+ "ext-mbstring": "*",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*"
+ },
+ "suggest": {
+ "ext-sockets": "Use AMQPSocketConnection"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpAmqpLib\\": "PhpAmqpLib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1"
+ ],
+ "authors": [
+ {
+ "name": "Alvaro Videla"
+ }
+ ],
+ "description": "This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.",
+ "homepage": "https://github.com/videlalvaro/php-amqplib/",
+ "keywords": [
+ "message",
+ "queue",
+ "rabbitmq"
+ ],
+ "time": "2015-08-11 12:30:09"
},
{
"name": "phpdocumentor/reflection-common",
@@ -4432,7 +4696,7 @@
"reflection",
"static analysis"
],
- "time": "2017-09-11T18:02:19+00:00"
+ "time": "2017-09-11 18:02:19"
},
{
"name": "phpdocumentor/reflection-docblock",
@@ -4483,7 +4747,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2017-11-30T07:14:17+00:00"
+ "time": "2017-11-30 07:14:17"
},
{
"name": "phpdocumentor/type-resolver",
@@ -4530,7 +4794,7 @@
"email": "me@mikevanriel.com"
}
],
- "time": "2017-07-14T14:27:02+00:00"
+ "time": "2017-07-14 14:27:02"
},
{
"name": "phpmd/phpmd",
@@ -4596,7 +4860,7 @@
"phpmd",
"pmd"
],
- "time": "2017-01-20T14:41:10+00:00"
+ "time": "2017-01-20 14:41:10"
},
{
"name": "phpspec/prophecy",
@@ -4659,7 +4923,7 @@
"spy",
"stub"
],
- "time": "2018-04-18T13:57:24+00:00"
+ "time": "2018-04-18 13:57:24"
},
{
"name": "phpunit/php-code-coverage",
@@ -4722,7 +4986,7 @@
"testing",
"xunit"
],
- "time": "2018-04-06T15:36:58+00:00"
+ "time": "2018-04-06 15:36:58"
},
{
"name": "phpunit/php-file-iterator",
@@ -4769,7 +5033,7 @@
"filesystem",
"iterator"
],
- "time": "2017-11-27T13:52:08+00:00"
+ "time": "2017-11-27 13:52:08"
},
{
"name": "phpunit/php-text-template",
@@ -4810,7 +5074,7 @@
"keywords": [
"template"
],
- "time": "2015-06-21T13:50:34+00:00"
+ "time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
@@ -4859,7 +5123,7 @@
"keywords": [
"timer"
],
- "time": "2017-02-26T11:10:40+00:00"
+ "time": "2017-02-26 11:10:40"
},
{
"name": "phpunit/php-token-stream",
@@ -4908,7 +5172,7 @@
"keywords": [
"tokenizer"
],
- "time": "2017-11-27T05:48:46+00:00"
+ "time": "2017-11-27 05:48:46"
},
{
"name": "phpunit/phpunit",
@@ -4992,7 +5256,7 @@
"testing",
"xunit"
],
- "time": "2017-08-03T13:59:28+00:00"
+ "time": "2017-08-03 13:59:28"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -5051,7 +5315,53 @@
"mock",
"xunit"
],
- "time": "2017-08-03T14:08:16+00:00"
+ "time": "2017-08-03 14:08:16"
+ },
+ {
+ "name": "react/promise",
+ "version": "v2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "62785ae604c8d69725d693eb370e1d67e94c4053"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053",
+ "reference": "62785ae604c8d69725d693eb370e1d67e94c4053",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "React\\Promise\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com"
+ }
+ ],
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
+ "keywords": [
+ "promise",
+ "promises"
+ ],
+ "time": "2017-03-25 12:08:31"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -5096,7 +5406,7 @@
],
"description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
- "time": "2017-03-04T06:30:41+00:00"
+ "time": "2017-03-04 06:30:41"
},
{
"name": "sebastian/comparator",
@@ -5160,7 +5470,7 @@
"compare",
"equality"
],
- "time": "2017-03-03T06:26:08+00:00"
+ "time": "2017-03-03 06:26:08"
},
{
"name": "sebastian/diff",
@@ -5212,7 +5522,7 @@
"keywords": [
"diff"
],
- "time": "2017-05-22T07:24:03+00:00"
+ "time": "2017-05-22 07:24:03"
},
{
"name": "sebastian/environment",
@@ -5262,7 +5572,7 @@
"environment",
"hhvm"
],
- "time": "2017-07-01T08:51:00+00:00"
+ "time": "2017-07-01 08:51:00"
},
{
"name": "sebastian/exporter",
@@ -5329,7 +5639,7 @@
"export",
"exporter"
],
- "time": "2017-04-03T13:19:02+00:00"
+ "time": "2017-04-03 13:19:02"
},
{
"name": "sebastian/finder-facade",
@@ -5368,7 +5678,7 @@
],
"description": "FinderFacade is a convenience wrapper for Symfony's Finder component.",
"homepage": "https://github.com/sebastianbergmann/finder-facade",
- "time": "2017-11-18T17:31:49+00:00"
+ "time": "2017-11-18 17:31:49"
},
{
"name": "sebastian/global-state",
@@ -5419,7 +5729,7 @@
"keywords": [
"global state"
],
- "time": "2017-04-27T15:39:26+00:00"
+ "time": "2017-04-27 15:39:26"
},
{
"name": "sebastian/object-enumerator",
@@ -5466,7 +5776,7 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
- "time": "2017-08-03T12:35:26+00:00"
+ "time": "2017-08-03 12:35:26"
},
{
"name": "sebastian/object-reflector",
@@ -5511,7 +5821,7 @@
],
"description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
- "time": "2017-03-29T09:07:27+00:00"
+ "time": "2017-03-29 09:07:27"
},
{
"name": "sebastian/phpcpd",
@@ -5562,7 +5872,7 @@
],
"description": "Copy/Paste Detector (CPD) for PHP code.",
"homepage": "https://github.com/sebastianbergmann/phpcpd",
- "time": "2016-04-17T19:32:49+00:00"
+ "time": "2016-04-17 19:32:49"
},
{
"name": "sebastian/recursion-context",
@@ -5615,7 +5925,7 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2017-03-03T06:23:57+00:00"
+ "time": "2017-03-03 06:23:57"
},
{
"name": "sebastian/resource-operations",
@@ -5657,7 +5967,7 @@
],
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "time": "2015-07-28T20:34:47+00:00"
+ "time": "2015-07-28 20:34:47"
},
{
"name": "sebastian/version",
@@ -5700,7 +6010,119 @@
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
- "time": "2016-10-03T07:35:21+00:00"
+ "time": "2016-10-03 07:35:21"
+ },
+ {
+ "name": "sjparkinson/static-review",
+ "version": "4.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sjparkinson/static-review.git",
+ "reference": "493c3410cf146a12fca84209bad126c494e125f0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sjparkinson/static-review/zipball/493c3410cf146a12fca84209bad126c494e125f0",
+ "reference": "493c3410cf146a12fca84209bad126c494e125f0",
+ "shasum": ""
+ },
+ "require": {
+ "league/climate": "~2.0",
+ "php": ">=5.4.0",
+ "symfony/console": "~2.0",
+ "symfony/process": "~2.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "~0.9",
+ "phpunit/phpunit": "~4.0",
+ "sensiolabs/security-checker": "~2.0",
+ "squizlabs/php_codesniffer": "~1.0"
+ },
+ "suggest": {
+ "sensiolabs/security-checker": "Required for ComposerSecurityReview.",
+ "squizlabs/php_codesniffer": "Required for PhpCodeSnifferReview."
+ },
+ "bin": [
+ "bin/static-review.php"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "StaticReview\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Samuel Parkinson",
+ "email": "sam.james.parkinson@gmail.com",
+ "homepage": "http://samp.im"
+ }
+ ],
+ "description": "An extendable framework for version control hooks.",
+ "abandoned": "phpro/grumphp",
+ "time": "2014-09-22 08:40:36"
+ },
+ {
+ "name": "solarium/solarium",
+ "version": "3.8.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/solariumphp/solarium.git",
+ "reference": "c353babec89fdbe8c64054bfec8e77bcb5da6705"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/solariumphp/solarium/zipball/c353babec89fdbe8c64054bfec8e77bcb5da6705",
+ "reference": "c353babec89fdbe8c64054bfec8e77bcb5da6705",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2",
+ "symfony/event-dispatcher": "~2.3|~3.0"
+ },
+ "require-dev": {
+ "guzzlehttp/guzzle": "^3.8 || ^6.2",
+ "phpunit/phpunit": "~3.7",
+ "satooshi/php-coveralls": "~1.0",
+ "squizlabs/php_codesniffer": "~1.4",
+ "zendframework/zendframework1": "~1.12"
+ },
+ "suggest": {
+ "minimalcode/search": "Query builder compatible with Solarium, allows simplified solr-query handling"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-develop": "3.3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Solarium\\": "library/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "See GitHub contributors",
+ "homepage": "https://github.com/basdenooijer/solarium/contributors"
+ }
+ ],
+ "description": "PHP Solr client",
+ "homepage": "http://www.solarium-project.org",
+ "keywords": [
+ "php",
+ "search",
+ "solr"
+ ],
+ "time": "2017-02-02 13:32:22"
},
{
"name": "squizlabs/php_codesniffer",
@@ -5751,11 +6173,11 @@
"phpcs",
"standards"
],
- "time": "2017-12-19T21:44:46+00:00"
+ "time": "2017-12-19 21:44:46"
},
{
"name": "symfony/config",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
@@ -5814,20 +6236,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2018-03-19T22:32:39+00:00"
+ "time": "2018-03-19 22:32:39"
},
{
"name": "symfony/dependency-injection",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "24a68710c6ddc1e3d159a110cef94cedfcf3c611"
+ "reference": "54ff9d78b56429f9a1ac12e60bfb6d169c0468e3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/24a68710c6ddc1e3d159a110cef94cedfcf3c611",
- "reference": "24a68710c6ddc1e3d159a110cef94cedfcf3c611",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/54ff9d78b56429f9a1ac12e60bfb6d169c0468e3",
+ "reference": "54ff9d78b56429f9a1ac12e60bfb6d169c0468e3",
"shasum": ""
},
"require": {
@@ -5885,11 +6307,11 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2018-03-29T11:25:31+00:00"
+ "time": "2018-04-29 14:04:08"
},
{
"name": "symfony/options-resolver",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
@@ -5939,20 +6361,20 @@
"configuration",
"options"
],
- "time": "2018-01-11T07:56:07+00:00"
+ "time": "2018-01-11 07:56:07"
},
{
"name": "symfony/polyfill-php54",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php54.git",
- "reference": "84e2b616c197ef400c6d0556a0606cee7c9e21d5"
+ "reference": "6c3a2b84c6025e4ea3f6a19feac35408c64b22e1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/84e2b616c197ef400c6d0556a0606cee7c9e21d5",
- "reference": "84e2b616c197ef400c6d0556a0606cee7c9e21d5",
+ "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/6c3a2b84c6025e4ea3f6a19feac35408c64b22e1",
+ "reference": "6c3a2b84c6025e4ea3f6a19feac35408c64b22e1",
"shasum": ""
},
"require": {
@@ -5961,7 +6383,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -5997,20 +6419,20 @@
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26 10:06:28"
},
{
"name": "symfony/polyfill-php55",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php55.git",
- "reference": "168371cb3dfb10e0afde96e7c2688be02470d143"
+ "reference": "a39456128377a85f2c5707fcae458678560cba46"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/168371cb3dfb10e0afde96e7c2688be02470d143",
- "reference": "168371cb3dfb10e0afde96e7c2688be02470d143",
+ "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/a39456128377a85f2c5707fcae458678560cba46",
+ "reference": "a39456128377a85f2c5707fcae458678560cba46",
"shasum": ""
},
"require": {
@@ -6020,7 +6442,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -6053,20 +6475,20 @@
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26 10:06:28"
},
{
"name": "symfony/polyfill-php70",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
- "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f"
+ "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f",
- "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6",
+ "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6",
"shasum": ""
},
"require": {
@@ -6076,7 +6498,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -6112,20 +6534,20 @@
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26 10:06:28"
},
{
"name": "symfony/polyfill-php72",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "8eca20c8a369e069d4f4c2ac9895144112867422"
+ "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/8eca20c8a369e069d4f4c2ac9895144112867422",
- "reference": "8eca20c8a369e069d4f4c2ac9895144112867422",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46",
+ "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46",
"shasum": ""
},
"require": {
@@ -6134,7 +6556,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -6167,11 +6589,11 @@
"portable",
"shim"
],
- "time": "2018-01-31T17:43:24+00:00"
+ "time": "2018-04-26 10:06:28"
},
{
"name": "symfony/stopwatch",
- "version": "v3.4.8",
+ "version": "v3.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
@@ -6216,7 +6638,7 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
- "time": "2018-02-17T14:55:25+00:00"
+ "time": "2018-02-17 14:55:25"
},
{
"name": "theseer/fdomdocument",
@@ -6256,7 +6678,7 @@
],
"description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.",
"homepage": "https://github.com/theseer/fDOMDocument",
- "time": "2017-06-30T11:53:12+00:00"
+ "time": "2017-06-30 11:53:12"
},
{
"name": "theseer/tokenizer",
@@ -6296,7 +6718,7 @@
}
],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
- "time": "2017-04-07T12:08:54+00:00"
+ "time": "2017-04-07 12:08:54"
},
{
"name": "webmozart/assert",
@@ -6346,7 +6768,7 @@
"check",
"validate"
],
- "time": "2018-01-29T19:49:41+00:00"
+ "time": "2018-01-29 19:49:41"
}
],
"aliases": [],
diff --git a/dev/tests/acceptance/tests/_data/magento-logo.png b/dev/tests/acceptance/tests/_data/magento-logo.png
new file mode 100644
index 0000000000000..cf143212303aa
Binary files /dev/null and b/dev/tests/acceptance/tests/_data/magento-logo.png differ
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Backend/Page/AdminConfigurationStoresPage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Backend/Page/AdminConfigurationStoresPage.xml
new file mode 100644
index 0000000000000..9d977546a382d
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Backend/Page/AdminConfigurationStoresPage.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/VerifyEntitiesInMagentoAdminActionGroup.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/VerifyEntitiesInMagentoAdminActionGroup.xml
index 8f8f9a026033e..0a0c55c0a2166 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/VerifyEntitiesInMagentoAdminActionGroup.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/VerifyEntitiesInMagentoAdminActionGroup.xml
@@ -14,6 +14,8 @@
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ImageContentData.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ImageContentData.xml
new file mode 100644
index 0000000000000..89d46f4919921
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ImageContentData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAAP8AAAEsCAYAAAAM1WX/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACY7SURBVHhe7Z0LlBxXnd6HXWyWhx9g8HS3pJFGPVU1klmC2RB28frBIbY00y2NpBnN9GMkG4JJcOJsgCVrszZg56wJuxj2BTjLY8FsADsb20kwmEc4WYgNxPYuiwX2yg9ZxrKsefS7R5IlufP/qm+N76hbo5qa7p6qru875zs6M5quvvd/76/q3lt1/9VDhU/7Ll79ikrauL66y8pVUsZ1ezf1nan+i6KoblV+bP22uUlrT+1dG2vlycEa/pWfH5kej4+oP6Eoqpt0aGx9vJqxvnF892Dt2JUbavmMNW/8fEx+X81aXy9MxNerj1AUFWQ9eGHPy4sp4wOHJ60ZXOWLWauW08CH8TN+r0YBM8W0+f47B3vOUIegKCpoyo/HL6tkzAcA9eFdgw3Qn2z8/5z8Hf6+krEeyE/EL1WHoigqCHo+2X9+MW18dm5y8MSLV25sCvrpfEI+V520TuA4h4b6etWhKYryqwTWXTJ3fxpXbyzone5qfyrjc+WsjALeLSeBrPl0MWNOqq+gKMpPmh3rf2Mpbdxbu2pj7ejuDZ6hP9k4Do6HEUQpY34zl+r/TfWVFEWtpH52ee+rZF7/kbmsVQb4hZPgbZVxXBx/btIqldLmjQeSkVeqIlAU1Wnl0gNJAf/nGOJXlzHEd2scH99jLwhmzX8sTgwkVFEoiuqEcjvW9pWzxleO7hqsHT/pnn2njO/F95cz5pefk/KoolEU1S5VM+Y1law1hatvqck9+04Z34vvr48CrEMolyoiRVGtVG5n/0Vylf07zLvd3LPvlFEOlAflkqnA/5kdX/92VWSKopajZ8Zir53LGrdWJ61jL161oW0Lest1fUFwQ60i5ZxLG7fuT/Sdq6pAUdRSVU4ZqXLGenK59+w7ZZTP2SxUzlpPlNPGhKoKRVFuND22zpQh9N+euHJD7YXdK7Ogt1yj3Ch/JWv97fSOPktVjaKoZsK++krGuK6cNUu4emKzTTOwgmJns5CcyIqVtPkH9zJvAEU1amZi3eXVjPkQYMHmGr8P8d0a9XA2C1Wz5oOFsXX/UlWZosKt6a1rotWs9XmsmGOY3AygbjHqd3hysFbNWH+1X+qtQkBR4VMpZbynOmkewFWxlO2eq/2pjPqhnvboJms+i/qrUFBUOFRI9f+WdP7v4tbYkRZuwgmKUV/UG/WXqcB3Cjvjb1Ghoaju1L6RtedUM8YtMsw/2s5NOEGxs1moOmkdKWeMjyM+KlQU1T3KTxjb57LWL+3V7wDcs++UEQfEoz4VsH6RT63fpkJGUcFWPXGm+V+PyzD35MSZ9EI7iUQrGetriJsKIUUFS0icmU8ZH0BCTFzVmiXOpBca8XGeDTictaaLqYH/gDiqkFKU/1VKxy+Zy1h24sxuumffKSNe9mYhiV81a92fG4tfokJLUf7UoZ19vcWM8ZnqMhJn0guNONqJRFPGXyIxqQo1RflHFSTOnLT24WoVhE04QTHiaG8Werf9bMBTchLYrUJOUSurfCr+5lLG+taLV25oaeJMeqER13oi0Q21Ytr4Vn7nwD9TTUBRndWeS899dTltfFSu9hXes++cnWcD5iTuiP/By3tfpZqEotqvysRAopOJM+mFRrz1RKKVlDGsmoai2qN64kzzS0d3r1ziTHqh0Q5HdtmJRP86t7N/jWoqimqdyinj31Wz1iFcbVYycSa90GgHJ5GotM/zTCRKtUzFifjvyBDfTpyJKwyh96fRLmgftBMSiRbT639bNSFFLU3PXBF7bSVdT5yJ3WfNOhztPzuJRKXdXqhkjE8ykSi1JBVSRqqStR7nPftgGu3lPBuAdkR7qqalqOY6OBrfKJ3l7iAnzqQXGu2IRUEZBdw1s3XNBtXUFFXXnrHBM2SIf305Y5ZxtecmnO4x2lFLJFpCO+8ZHDxDNT0VZs2MDlxezVh24sxqiBb0AASemMO/zf6/24x2RfvW7woMPjjDRKLh1dT2NZG5tHkbEkqeCNEmHEAA6Oek3vm0+Rh2z4XtsWS0t51INGv+F2zGUl2CCoNKE8bV1UkrNIkzYdSxrJJnYgNSLjWQrSUjr5wZj++qZq2n8Xv8f1hi8VIiUetXTCQaAk3vjL9FzvahTJyJ9/xVZIg/lzH//Int/W9QIbF1UH6uZI2/kJOA/XfNPt+NRvs7iUQlLt/Jj8cvVCGhukUzm/vPKmaMj8sV70iYNuGgc9svzJA6y0nv/unR+KUqJE01PR6/rDpp3m9fEUO0/uFsFqpI/yimjFv2Sn9RIaGCrPzEeiTO/AU6dFgSZ6KO8yvcGTNXThkfuGN7z6+pkCyqj17c8+tyovygjBJy+HxY7nygjkwk2iWa2rbOqGSsO5AQMmyJM+uJMDfgzTjfOLTFWyLMqR39A3LiuBPHCWf87ESi30AcVEgovwsJH4sTxgfDljhTv3LJVfuX+fTADhWSZamUGhiVk8Cj9nFDOHJCP5KpwAd+ICMiFRLKj8qND1wcxsSZzpy1nDXx8otbprec8xoVkpZoZvPZZ1UzxsflpBLONZN32W8Wuh/9S4WE8ouwWl1MG39RnbSOvyids1lDdqPROZ3VagHzu+1+7RVeM1bJGN8L590S3CIdPI5+hv6mQkKtpJDQ8XDIEmeijs596nLGPFDp8H1qGQVcXZXvxfeH6jkJNa2qZq19chLYpcJBdVpI4FhKG6FMnGm/6lqGo5W0eRte8a1C0lHNjK2OyRTjr7CHvttfLa4b/cxJJCr9716ZCrxJhYRqtw4kI68sp4yPze2y7E04YZp/Os+mlzLmQ4Xx+BUqJCuqQmr9JinPw/YVMSQjL9hZZ5nLWmUkEkW/VCGh2qFieiCJhI2h62hq5bmaNYtytf+DvZt6zlQh8YX2buo7s5IxrkP57BOylLdZPbrN9glZTQWQ0LWYGUiokFCtUn5i7dpqxrr9qFz5wpQ4E50L+9ExrC6nzXtmR+MbVUh8qdlUfGM5Y/4PJx9CWE7OMPol+mc5bX0lP7J2rQoJtRzJvPLasCXORB21xaXHZVg5ocIRCMm0DJmQnkAmnXAtwjojNOsQEr6qcFBLVXE8/rZKxrITZ2JxKyxXEWcuiRx0hbRxq8wlz1MhCZRQ7lLa+BTqgfo0q2s3Gv3Ufsmo1BmJRGfHmEjUtZBwsZoxPilXjtB1Gjv7rP1AidU1nWYW2Y8n5SQu9QrfSdx+/uKFatb8k30ja89RIaGaqTAxkLaHizJ0CuNw8fCkdbCcMq+pqXh0i27o6XlZQYbBc1nr+bBO36RfM5FoM81MGIMSnLvCmDgTC0Uv7FZvnMms7VMh6Uqphdsvo75hWriFnYXbSsb879M7DEuFJLy6F7eI0sb1SKyIs2OYNuE4t4jkavgPsyF711xR6iv1/hnqH5Zbtqijs1mojESiGeM69H8VknBpdjx+hcyFHrQBCNtc0O70VjXMb5nFW47lJHBTNWvNIR5helirvlkIdwXMB5FAVoWk+4XEmdWM+QUs/oT1sVC56n0zlzJ+U4Uk1Do0PvAmice9oX1MW0Y+1bT1eXChQtKdKqSN91YnQ7ghRG3Ckavc0/kJ40oVDkpTfnzgKonPfsQpnIlEzWcLE8bVKhzdI2zCkcp9J6yJM6VT42r/508m+89XIaGa6HmJTyVj/aVMicKbSHTSvC8/Gn+zCklw9eTYurPLKeMW6fyHcc8+TPM650EPmdfdPzUWv0SFhHKh6Yn4pQJBaJOyVLODh8tp84/AjwpJsITEmQL9L9GAoUycmbVmkTiT6Z+8CXGrMJFosBKJHhpbH0fiyOOhTpxpfu35HX39KiTUMnRoIr5eLiJfC3MiUan/1wsSBxUS/8lOnClXusMhT5xZmjC2q5BQLRQSkoY+kWjafD84UyHxh/Lj8cukYew5Whg34eBlD9WMccujLU6cSS3U9BbzNSqR6NGwrSFpzwbcn59Y/OUrHRFWZ4tp47Nzk4MnXgzZyy6d1VkZkn13Zqz/rSokVAdUSPe/VaaW9USiu0J290g4q05aJ8op4zPgT4Wks0ICQ+n49Rc8hmgYNp84M2s9V8p04X3ZAKmUNt4ro4CDaI/QJRJ9tz0KeLqYMSdVONqv2bH+NyJxIYZdYU2cicSV0ylzRRJnUgs1M2bEymnj8+F9YtTO6fjNXKq/fU+M/uzy3lfJvP4jc1mrHNb5VhmJMydC9Cx2gFRIx6+Q9rETiYbx2YC5SatUSps3tjyRaA6JMzPmzxHYMCXOdFZaZY5VkCH+dX5LnEkt1A8uXv0KGZVeLyAU0G5ov2bt2m0Gj/OJRLPmPxYnWpBINLdjbV85a3wlbIkz4fnEmRnjLuQbUCGhAiC0l0wF7kb7hTE/hJ1INGN++TnhV4VkaapmzGsqWWsKZ5PQJs6cMMdVOKgAqpA2JtCOaM8wZoYSfg+BYxWO0yu3s/8iOWuEMnFm/X1s1jEZOt5aGIu9VoWECrCeHYm+TqZsn0a7on3DtFbl7C+xE4mOr3+7CkmjnpHOPpc1bq0HaUP4gvQupFiy/m7RIFGBVS5tXlS1s0GHNJGocD0nFzUkyFUhqQt54csZ68nwDY/qQ/w5GR4VJox/i0STKiRUF+qOnp5fU4lE7fdAhOkRdGc6W85aT8y/ByI3MXDHcRkahHJhROosQ/yvYGHTDgYVCiGRqEwFbg9lIlGpL3gH9z3Ht6+pFXbG6/8pV8KT/7ibjDOgljjzZ8VxY0j1ByqEQuJU9AP0h1DcwlZ8g3dw3zM7FKnZ3rq6lhuXkwD+oAtPAvbcB42ctSphTpxJLdSesXNfXcZbnyetStc+vKaYBt/g3GG+Z3Y4WrPtnAS29dXyKUN9oMmBAmaczecTZ05a/2t2vP8C1e4UNS88ti6jgO5KJAp+wbHwDK7nGVfMvwS/Y/Wfue1ra/m0Wf9wswP73PoiR3XS2ldMx3epdqaoU6qYMnZ3xYY1cCv8gmOda92N8DvGHyditdxo/0sHO/kLfOwT9tbHwVolY3zmudH1r1dtS1GnFfpLJWt9Zk76T+A2CylOwS34bQa941PDD+OD8JZVtRwWBXFgH58EcJaef7AhYz4wvSN+mWpPilqypsf63yH96MeBeOBNsQlOwes8u824Vl4cfsfqQLmta2r58QHfnQTQKM4mHDlj54oZ44NMnEm1QrchPV3a+H3pV3n0L989G+CwKFyCTzfQO3YHv2N10Ny2tbWcsyjYrEAd9nzizKz5tUPbfJzokAqs7MS0WevreC7AN4lEhT9wCB51Pt16afA7xpdgPWDHuhVbFMTZ10mcKY3CxJlUR2QnEp1c4USi4A2LecLf6eb1i9kb/I7xpUk5CYytf6lQJxe0Da4/r2xDf1iu9n/ExJlUJ7V389lnlTPGx/FyjY4+G6D4Am/gziv0jpcHP4wCwFva/5AQzrK4B2tvVMia353eGX+Lag+K6rimR/t/q+IkEm3nswGKKfshHZeLeW68fPgd2wWSf0fW1PITrV0URFDnE2dmzAOllPEeFf/QSaY3g7WxwTPUj77Q3k19Z6Jc6sfQqZoxrm7LC2gdhoQncGXz1QLoHbcOfseqcDn7ScHWrAfgXuuRXYO1ctr6/MzY6piKeah0aGdfbylrfTmXMp6ckWGn+rUvlHvnWWdLuZ4qZ80voZzq16HSzLboKrkwfQH9tCXPBoAbezGvbwFXrXTr4XeMwi5jURBnTydxZiljPlwYj1+h4hw6VVLWu8oZ61e1q9+IWD7+zGjsN9R/+UJIGjmbMp9C+UpSzkp64Cr1X6FTJR2/opQ2/x791lMiUXDSgsU8N24f/I5R+OSqJS0KOvfs5yatfCVtXI/EjCq2odLUePzCatb8NuaUWOuA82njsZZnaF2msEkqlzL3Yt7rrMlUs9a9U93wqmkP2if9Vfrth5eUSFRxUV/MU/P6Zjy10O2HH0ZFxDkXi4J64sywziORJr2aMf9T5aRXmwcBfpTTuRtTxt2YtHmz38rbKc2OxjeeNpGoYgFcgA+HlaYctdidgd+xU7GRNbXchLNzsD400l52+bjMnUKbOLM0Ed9azVh77FicdB85KPDDepvKKOCRXCq+Rf156FRIGSmJweN4y878ZiGn7wsH9cW8zkHvuLPwO1aVxI4j6TS1Oek0MkQ6WkoZn0TCRRWzUCk/tmadDPH/BleIUz1BFiT4daM+yJojo5mv5kfWrlUfC5Wkzc5DYlj0c/R39PvFdtx1wisDv2OpdHnLqlppbN3B2XEjlIkzsQehOGG+v5I1T/tq86DCj/q8tPfCnC6nzN9DPj318VAJiUQr0t/R71cKescrC7/4ha2x2vRQ5CcqNqGSDPl+V672/xdQuNk1FlT4HaN+zq5LGQb/KLfTvEgdIlSaHer9Kfp9Mx466RWH/6gEYWY48pCKSyj0mAwBKxnzzypZ6wTSpDcDpZmDDr9u5NAvS/0rafNPwzTVq4lnhyMPo98346GTJvwdVmFiIF2dtJ7A1X6pmWK6CX7U28m0JPPgx2dTRkodrqtF+DWHBX7kDpzLmPcgRxwW9ZYCveNugt8x4uDc3pXR0D2zqfhGddiuFOHX3O3wA9RCeuBGmeOWcZUruHng4xTuRvgdIy6IT3XSLEm8bnjIZ3VslQi/5m6Gf3Zi/WYZ0tqPerYiL3w3ww8jPtp7FR6eHVu/SX1F14jwa+5G+PFq5HLG/GKrX23e7fDrRtywSaYkcczt7F+jvirwIvyauw3+UnrgfXLVeg5Xr5Zu7xSHCX7Ebf5dipPWgVJq4F+rrwu0CL/mboFfhqi/Xc2a/9tO7LCrPYkdwgS/Y8QR8bQ3C2Ws7xfH429TXxtIEX7NQYd/38jac0pp84/l6nSk3Smdwgi/4/nUbRLnUsr8xJNj685WXx8oEX7NQYa/PGGNVTuYzDHM8MOIr7ZZ6JcyFRhVRQiMCL/mIMI/vcOwyhnzv9lpnNvc4XWHHX7d2CyE+JfT5p3TY5apiuJ7EX7NQYL/wQt7Xl7JmB+Sq878Cxyadcx2mfAvtLNZSNojV0kbv4/2UUXyrQi/5qDAXxg33ilX+/9nrz57Sc/UAhP+RqMdnHRv5Yz103LKfIcqli9F+DX7Hf79W9dEK1nzs/ZLG5ewCacdJvyLG5ukqpPWCbyc9entayKqeL4S4dfsZ/grafNflbPms7iqtPqevRcT/sWN9nGeDShlzGdlivZuVUTfiPBr9iP8eBmInjhzpaF3TPjdGe2FWKlnA76FRKiqqCsuwq/ZT/Dnd7/pHJnXNyTO9IsJ/9LsPBsg7TlXTps3o31VkVdMhF+zn+DP7ej/cO09F9SqbXpCb7km/Es32hHtiXadGe2/XhV5xUT4NfsJ/unNvTfXRvtquZ2dffGoWxP+JVq1H3Lh10bX1KR9b1JFXjERfs1+gn92KPrR2og0ylCkltu6ppYbb+07B5drwu/Sqs3Qfrmt9Vz4aFfpZx9RRV4xEX7NvoN/26p62VRmVbwrLZdy3jHQpKN10IT/NEb7APoJo5YbWfiOO7Qr4V9owq9pAfyOnZPAdm/vHGylCf8iRrvgHXfSTnq7OSb8jSb8mprC7xidCS8eHe1/qbOd3AHbbMLfxKod0C6LvdiS8Dea8GtaFH4YHQvesqq+KKiGmQ0dsk0m/JoRd4k/2gHtMd82zdpNTPgbTfg1nRZ+x05H27pa5pedWxQk/GIVa8Qd8T8d9I4Jf6MJvybX8DtWnQ6LgnlnUbBZh22RQw8/4itxRrz1+Lsx4W804de0ZPgdOyeBHe1dFAwt/IgnFvMkvnq8l2LC32jCr8kz/I7RKZOxWm6sPYuCoYNfxQ/xRFy9QO+Y8Dea8GtaNvwwOii8ZXUttzNe78AtOgmEBn4VM8QPcZyPabN4uzThbzTh19QS+B2rDpsbWWM/dNKKk0DXw+9APzFgx60V0Dsm/I0m/JpaCr9j1Xlz29Yue1Gwq+FHXOzFvLUL4tYqE/5GE35NbYHfsXMSsBcFVWdvBsEi7kr4EQeJx3IW89yY8Dea8GtqK/yO0bmTq+ydZvOd/2QgTuGugl/VG3FAPNoFvWPC32jCr6kj8MPo6DAWBcfdLwp2Bfyqrqh3qxbz3JjwN5rwa+oY/I5Vx8fiVn5+UbAJMMqBht95FNrecdfaxTw3JvyNJvyaOg6/YwVBbjsWBU/9kFBg4Ud9pF6on17fTprwN5rwa1ox+B0DikV2DgYOflX+3Oi6RXfcdcKEv9GEX9OKww8PwQIJFgXxkJAGUWDgd6DHQzrOYh7q1ay+HTLhbzTh1+QL+B3bwIixc1AtCh69cqO/4Uf5pJz2Yt4Sdtx1woS/0YRfk6/gd+wAtK2vdnQSw2nznwCbKrIvdOjSc1+dy1iPH8ladjn9BL1jwt9owq/Jl/A7FpiObJWpwLa+R2pjg2eoIvtCezf1nZnbtmbPYSmf36B3TPgbTfg1+Rp+sR2rod4HVXF9pdmh3of80KFPZcLfaMKvKRDw+yRWuvzUoU9lwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt/onmNbV9UKiagEpvkftNuE370Jv3cT/rrBOXgH9z0zQ9HPVZKx2gsrVBjC796E37sJf93gHLyDe7tAUphNpUT04drIqloZ/9HkQ+0y4Xdvwu/dYYYfPINr8F1KxB4C7/XSKO27ePUrSsnYHxYT0fKL8kd59aFmB2ulCb97E37vDiP84DcvQ3zwLBf3Umk48uEfCOf1kjTRbKL3AjlL3I3hwZEt7S8g4Xdvwu/dYYQf/ILjciJ218Et52+sl8CFColoRkYB+xA0+dc+izT7guWa8Ls34ffusMAPTsGr4vap2WQ0Xf/mJepAMnKeTAU+XU5GXzjepsISfvcm/N4dBvhz4uMjsVpJeBVuP/WY8Fv/1mUol4xcVEzEfoS5Q7XFC4KE370Jv3d3M/zgsSpDfPBZTER+ODsUeXv921qkG3p6XiYjgGtl/jCFQGIhoRUnAcLv3oTfu7sRfvAHDlE34fJQcTh6LTitf1MbdHBL77ricOyrWExoRQUIv3sTfu/uRvidRflSInp7ftMb1ta/oQMqJqJbxHvss84ypgKE370Jv3d3C/zgzL5nL/UR/h4pJqPJ+pE7rL2bzz6rOBS9uZKIVU7IfAMLDs0KvJgJv3sTfu/uBvjBF+b1MsSvCPgf23Ppua+uH3UFld8ce3N+OHLfiZFY7bAMQ5YyCiD87k34vTvo8IMrrOTLHP9bU8Jb/Wg+Un4odlUlGd2vhiSuTgKE370Jv3cHEX7wA45Q9nIiuj+XiO2uH8Wnmtq0JiKjgNuweQA7h5pVSjfhd2/C791BhB/8gKPcUPRzh4bO660fIQDKD/W+o5yM/gRBt3cRNakcTPjdm/B7d1DgByfgxd5kl4j+OD98/mX1TwZMezf1nSlzlA9JJXIIfrNnAwi/exN+7w4C/M49e5k6z+aHYx/cMzZ4Rv1TAdb0pqgpo4A7m20WIvzuTfi92+/wH1XPzQgnd0wNRY36X3eR8oneUTmrPYaGKCXrowDC796E37v9CD/6f0nds5fR8aP5ZGRH/a+6VPsTfeeWEtE/LiaiR/FsAEYDhN+dCb93+w1+9Hv0f2HhSCER/cTPhYv6X4RAM1esfmslEf1+bXR1TaD7hfr1iorwexPhX5okVo+i30v//9705t5/rn4dLqHTlJOR908PR+6rXX3hy+u/XTkRfm8i/O5VGxs8Q2J1nwzzf0/9Ktya3nLOa2oX9/y6+nHFRPi9ifC7F/o5+rv6kfKLCL83EX4q8CL83kT4qcCL8HsT4acCL8LvTYSfCrwIvzcRfirwIvzeRPipwIvwexPhpwIvwu9NhJ8KvAi/NxF+KvAi/N5E+KnAi/B7E+GnAi/C702Enwq8CL83EX4q8CL83kT4qcDL7/Aj+8v0cPQnqri+kpTvpyjfyWX2iwk/taj8Dj/e0VZIRA9ODUcuVkX2hXKbey8pSrlQvmbl9oMJP7Wo/A6/k9O9lIgeKyVif3rgksh5qugrouc29b5eyvFnUp7ji72bwQ8m/NSi8jv8MABzXuEk0D1ZHI5kVfE7qmIyMinf/xTK4fbVbCtpwk8tqunN0Zv8Dr9uvAPhmMyzy8noPQcv771AVaOten7oDW8sJ6L/89hI4zsY/Gy7XYd6P6aqQVELJVf+j9XGVmNe7fsrmWPntc1yFS6XEpEb9l28+hWqOi3VA2+L/UZpOHKjjDQq+D4vr2NfCaMd0Z5oV175qVNqZnh1TK6iX6jKFc3PK9cnGx0ci232VCAZ/fupzb1Dqkot0dRw77Ac9x9wfHxPUE6MMNqxIu1ZGI58YXrrmqiqEkU11+xwZFM5EXsoqJ29KmWWofkXf7U5ukpVyZOevSK6Wo7zpSCfDNGOU0ORzapKFHV64SWjpUTshqIMpwM5zMUoIBE9WBiOvU9VaUnKDcWukc8/j+MEaRqUF6O90G6lZOQP0Y6qShS1NB1M9F5QTMTuxsLa4QAtcAHWOSmvWg/4/kxi9VtVlRbVzPCqf1FJRr+PV0nh80Ea9WABEiMUmaLcM7vp/I2qShS1POGWmlxNAnNryzFGLOqdcEcLw9E/2XNF7LWqSgv0jPy+JP+Pv8PfB2mkg/ZQ7fJkLhHNqCpRVOt0IBk5T4aSn5J58LHjI8EaBeCtyACkkog+NpvoHVNVslUY7t0pV/t/sqcK6u3JzY7jN+MEhXYoJ6MvlJKxTz/7zujrVJUoqj2Sq8vvlhORH9bkConFtSAOjWeGIt+Y2Ry5fHYoegd+DtI9e8QbcX9RwC9KO+SSkYtU01BU+1W7oedlxWT02nIiNhXERTEAjxVx/Iufg1B2lNFZzETci0PRf3+DtINqEorqrA5tfv364nDsq1gM9POW1mbOC0jNfu9X40SFOMsJ4PbnE2/oV01AUSsrmQpsKSVij9TnzcGaCvjZiKNzz76SjP08NxzZqkJOUf4RXr0sV9Oby4loNUgr5n414odblTLEr8jU5KZHf4evtqZ8rvzm2JuLyci3j0vHxTCVo4ClGfFC3BC/4nDk24inCi1FBUP5odhVMgrYjyFrkJ4NWCkjPs49e7naP50f7r1ShZKigqepTa+L5Iain0Oyi2NyJWvW6em6ER+Z35/IS7yelripEFJUsJXfsuod5WT0x3g2wO9ZbzppxAHxQFxklPRAfvj8y1TIKKp7hE0m+eHof5ROnsNCVtButbXaqL+9oJeMzs4moh/aMzZ4hgoVRXWnnt0UNYvJ6J32k3UBezagVcYzEbDM8e+YGooaKjQUFQ4VEr1jlWT00fqzAd2/IIj6OXsM5Gr/aH5z76gKBUWFT/sTfeeWEtFPBG033VKNejm7C4vJ2H9GvVUIKCrcOhjgffSLGfVAfVCvaiL6Pbd5BSgqdJpN9P4bGRo/h6FxkDYLnWyU29mEI/U5UBqOvFdVkaKoUwm592R4/EVcMbEo2AwuvxvlRvmREPWZ4dUxVTWKotxodiiyWU4CD9v3wAPwbADK52zCKSViDyERqqoKRVFLFfLwF4ajNxZ9nEgU0DuJM+VkVSokIjf8oE3vD6Co0Gk20XuBXFXvxiOwfsu6g/LYj+YmYncd3MLEmRTVFqlEovswtF7JzUL4XmcTjvz7VIGJMymq/aonEo19WubVx4+vwIIgph524sxE7JiU41OPSXlU0SiK6oRyw5GLi4nYjzDX7kQiURy/njgTV/vID0tMnElRK6cbenpeVtYSiWKzTKtPAjgejovj43uKw9Fr8b2qCBRFraScRKJYfGt1IlF7A5Ict5SI3l5g4kyK8qeKiegW8R77Kr2MqQA+59yzl+M9UkxGk+orKIryq/ZuPvus4lD05koiVvGyWcjZhCND/IoM8W96dAsTZ1JUoITEl/nhyH0nRur57t2MAuqJM/Eij8i3p5g4k6KCLSQSrSRPnUgUP+P39QW96P5iIrZbfZSiqKBratOaiFzNb7MTiW5dmEgUP+P3SDR6aOi8XvURiqK6SfmhXiQS/Qnu1QN4/CtX+x8zcSZFhUC4R19I9l5THYk9kRuOvE/9mgqVenr+P+OvTjWo+kMRAAAAAElFTkSuQmCC
+ image/png
+ magento-logo.png
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductAttributeMediaGalleryEntryData.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductAttributeMediaGalleryEntryData.xml
new file mode 100644
index 0000000000000..ffebd28292839
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductAttributeMediaGalleryEntryData.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+ image
+ Magento Logo
+ 1
+
+ - image
+ - small_image
+ - thumbnail
+
+ false
+ MagentoLogoImageContent
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml
index a67e5620dd735..07aebe37872c5 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml
@@ -75,12 +75,13 @@
EavStockItem
CustomAttributeProductAttribute
-
+
Image1
1.00
Upload File
Yes
magento-logo.png
+ magento-logo
testProductWithDescriptionSku
@@ -147,4 +148,19 @@
EavStockItem
ApiProductNewsFromDate
+
+ SimpleProduct
+ simple
+ 4
+ SimpleProduct
+ 125.00
+ 4
+ 1
+ 1000
+ simple-product-with-image
+ 1
+ EavStockItem
+ ProductAttributeMediaGalleryEntryMagentoLogo
+ CustomAttributeCategoryIds
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product-meta.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product-meta.xml
index edbf1133d4fae..74dc7adbe2132 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product-meta.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product-meta.xml
@@ -31,6 +31,9 @@
product_option
+
+ media_gallery_entries
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product_attribute_media_gallery_entry-meta.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product_attribute_media_gallery_entry-meta.xml
new file mode 100644
index 0000000000000..cb0000d3598f5
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/product_attribute_media_gallery_entry-meta.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+ integer
+ string
+ string
+ integer
+ boolean
+
+ string
+
+ string
+ image_content
+ empty_extension_attribute
+
+
+ string
+ string
+ string
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductAttributeFormPage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductAttributeFormPage.xml
index 4339f2615e780..67952cb98b8cf 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductAttributeFormPage.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductAttributeFormPage.xml
@@ -7,7 +7,8 @@
-->
-
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductCreatePage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductCreatePage.xml
new file mode 100644
index 0000000000000..b5a5bddc92b2d
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductCreatePage.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductEditPage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductEditPage.xml
index e1ba11c46e973..e9c286dbbcd1f 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductEditPage.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductEditPage.xml
@@ -8,10 +8,7 @@
-
-
-
-
-
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeGridSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeGridSection.xml
index 7401692455ef4..59887eac03cad 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeGridSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeGridSection.xml
@@ -7,11 +7,13 @@
-->
+ xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml
index 909f69fc49c63..3ffc3c61c0118 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml
@@ -11,14 +11,22 @@
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridActionSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridActionSection.xml
index be0bdbd707046..7e2c7d70e3653 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridActionSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridActionSection.xml
@@ -13,6 +13,7 @@
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridFilterSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridFilterSection.xml
index efd92315f2476..8ce6ec5ff4650 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridFilterSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridFilterSection.xml
@@ -16,5 +16,6 @@
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml
index 6d4dbacabaec1..3c691f47a180d 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml
@@ -13,6 +13,11 @@
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductImagesSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductImagesSection.xml
new file mode 100644
index 0000000000000..de3911ed42512
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductImagesSection.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AttributePropertiesSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AttributePropertiesSection.xml
new file mode 100644
index 0000000000000..39a3505b3588e
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AttributePropertiesSection.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryProductSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryProductSection.xml
index e736378ca8ca0..e8df8650e8dd8 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryProductSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryProductSection.xml
@@ -19,5 +19,6 @@
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml
index e6731172911ea..6ddfce2ce49cb 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml
@@ -9,11 +9,13 @@
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductGridFilteringByDateAttributeTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductGridFilteringByDateAttributeTest.xml
index f8f21ea3a2893..3b996fa716f12 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductGridFilteringByDateAttributeTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductGridFilteringByDateAttributeTest.xml
@@ -26,10 +26,10 @@
-
-
-
-
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml
new file mode 100644
index 0000000000000..b15825b49a90e
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml
new file mode 100644
index 0000000000000..efd42b7f7a427
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/StorefrontProductNameWithDoubleQuoteTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/StorefrontProductNameWithDoubleQuoteTest.xml
new file mode 100644
index 0000000000000..095ed585a4190
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/StorefrontProductNameWithDoubleQuoteTest.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Double Quote"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/ActionGroup/ConfigWebUrlOptionsActionGroup.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/ActionGroup/ConfigWebUrlOptionsActionGroup.xml
new file mode 100644
index 0000000000000..a1414da6f08c3
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/ActionGroup/ConfigWebUrlOptionsActionGroup.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/Section/GeneralSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/Section/GeneralSection.xml
new file mode 100644
index 0000000000000..7da40964768cf
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/Section/GeneralSection.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Page/AdminProductCreatePage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Page/AdminProductCreatePage.xml
new file mode 100644
index 0000000000000..0236f1495a4d1
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Page/AdminProductCreatePage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Section/AdminNewAttributePanelSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Section/AdminNewAttributePanelSection.xml
new file mode 100644
index 0000000000000..94b53762c928f
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Section/AdminNewAttributePanelSection.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml
new file mode 100644
index 0000000000000..a4fa6cea19b26
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateWebsiteActionGroup.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateWebsiteActionGroup.xml
new file mode 100644
index 0000000000000..c5946f3f22bf5
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminCreateWebsiteActionGroup.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminDeleteWebsiteActionGroup.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminDeleteWebsiteActionGroup.xml
new file mode 100644
index 0000000000000..ff44598c5b465
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/ActionGroup/AdminDeleteWebsiteActionGroup.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreGroupPage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreGroupPage.xml
new file mode 100644
index 0000000000000..02fdc6122b37e
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreGroupPage.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreWebsitePage.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreWebsitePage.xml
new file mode 100644
index 0000000000000..61c564cb90027
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Page/AdminSystemStoreWebsitePage.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewStoreGroupSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewStoreGroupSection.xml
index fd2563586b303..be22aa7f8c120 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewStoreGroupSection.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewStoreGroupSection.xml
@@ -7,8 +7,9 @@
-->
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteActionsSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteActionsSection.xml
new file mode 100644
index 0000000000000..def89001ca055
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteActionsSection.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteSection.xml
new file mode 100644
index 0000000000000..1195d1c76b0cd
--- /dev/null
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Section/AdminNewWebsiteSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/dev/tests/api-functional/framework/bootstrap.php b/dev/tests/api-functional/framework/bootstrap.php
index 942582392e89e..c467b0aed90fe 100644
--- a/dev/tests/api-functional/framework/bootstrap.php
+++ b/dev/tests/api-functional/framework/bootstrap.php
@@ -14,6 +14,13 @@
$integrationTestsDir = realpath("{$testsBaseDir}/../integration");
$fixtureBaseDir = $integrationTestsDir . '/testsuite';
+if (!defined('TESTS_TEMP_DIR')) {
+ define('TESTS_TEMP_DIR', $testsBaseDir . '/tmp');
+}
+if (!defined('INTEGRATION_TESTS_DIR')) {
+ define('INTEGRATION_TESTS_DIR', $integrationTestsDir);
+}
+
try {
setCustomErrorHandler();
@@ -36,7 +43,7 @@
}
$testFrameworkDir = __DIR__;
- require_once __DIR__ . '/../../integration/framework/deployTestModules.php';
+ require_once INTEGRATION_TESTS_DIR . '/framework/deployTestModules.php';
$installConfigFile = $settings->getAsConfigFile('TESTS_INSTALL_CONFIG_FILE');
if (!file_exists($installConfigFile)) {
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
index 9a3fac9e8739f..c0c9c3729a82a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
@@ -80,7 +80,7 @@ public function testSingleServiceRetrieval()
/**
* @expectedException \Exception
- * @expectedExceptionMessage Request does not match any route.
+ * @expectedExceptionMessage Specified request cannot be processed.
*/
public function testInvalidRestUrlNoServices()
{
diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json
index 0c9f329f234a8..93de6b3363900 100644
--- a/dev/tests/functional/composer.json
+++ b/dev/tests/functional/composer.json
@@ -4,7 +4,7 @@
},
"require": {
"php": "7.0.2|~7.0.6|~7.1.0",
- "magento/mtf": "1.0.0-rc59",
+ "magento/mtf": "2.2.x-dev",
"allure-framework/allure-phpunit": "~1.2.0",
"doctrine/annotations": "1.4.*",
"phpunit/phpunit": "~4.8.0|~5.5.0",
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php
index 5e9e5526eb685..9f05a4ade8a37 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php
@@ -58,7 +58,7 @@ class CustomOptions extends Form
*
* @var string
*/
- protected $maxCharacters = './/div[@class="control"]/p[@class="note"]/strong';
+ protected $maxCharacters = './/div[@class="control"]/p[contains(@class, "note")]';
/**
* Selector for label of option value element
@@ -72,7 +72,7 @@ class CustomOptions extends Form
*
* @var string
*/
- protected $noteByNumber = './/*[@class="note"][%d]/strong';
+ protected $noteByNumber = './/*[contains(@class, "note")][%d]/strong';
/**
* Selector for select element of option
@@ -220,13 +220,19 @@ public function isJsMessageVisible($customOptionTitle)
protected function getFieldData(SimpleElement $option)
{
$price = $this->getOptionPriceNotice($option);
- $maxCharacters = $option->find($this->maxCharacters, Locator::SELECTOR_XPATH);
+ $maxCharactersElement = $option->find($this->maxCharacters, Locator::SELECTOR_XPATH);
+
+ $maxCharacters = null;
+ if ($maxCharactersElement->isVisible()) {
+ preg_match('/\s([0-9]+)\s/', $maxCharactersElement->getText(), $match);
+ $maxCharacters = isset($match[1]) ? $match[1] : $maxCharactersElement->getText();
+ }
return [
'options' => [
[
'price' => floatval($price),
- 'max_characters' => $maxCharacters->isVisible() ? $maxCharacters->getText() : null,
+ 'max_characters' => $maxCharacters,
],
]
];
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AuthenticationPopup.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AuthenticationPopup.php
index e25a5c1f719d0..1ef9267e73785 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AuthenticationPopup.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AuthenticationPopup.php
@@ -69,6 +69,7 @@ public function createAccount()
*/
public function loginCustomer(Customer $customer)
{
+ sleep(10);
$this->fill($customer);
$this->_rootElement->find($this->login)->click();
$this->waitForElementNotVisible($this->loadingMask);
diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php
index 4e14c8113a708..1cae393dc01c3 100644
--- a/dev/tests/integration/framework/bootstrap.php
+++ b/dev/tests/integration/framework/bootstrap.php
@@ -15,6 +15,10 @@
define('TESTS_TEMP_DIR', $testsBaseDir . '/tmp');
}
+if (!defined('INTEGRATION_TESTS_DIR')) {
+ define('INTEGRATION_TESTS_DIR', $testsBaseDir);
+}
+
$testFrameworkDir = __DIR__;
require_once 'deployTestModules.php';
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php
new file mode 100644
index 0000000000000..c0a720229a00d
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php
@@ -0,0 +1,60 @@
+objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+ }
+
+ /**
+ * @magentoDataFixture Magento/Captcha/_files/failed_logins_backend.php
+ */
+ public function testLoginAttemptsRemovedAfterSuccessfulLogin()
+ {
+ $login = 'mageadmin';
+ $userFactory = $this->objectManager->get(UserFactory::class);
+ $captchaLogFactory = $this->objectManager->get(LogFactory::class);
+ $eventManager = $this->objectManager->get(ManagerInterface::class);
+
+ /** @var User $user */
+ $user = $userFactory->create();
+ $user->setUserName($login);
+
+ $eventManager->dispatch(
+ 'backend_auth_user_login_success',
+ ['user' => $user]
+ );
+
+ /**
+ * @var CaptchaLog $captchaLog
+ */
+ $captchaLog = $captchaLogFactory->create();
+
+ self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($login));
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php
new file mode 100644
index 0000000000000..c09211b020b30
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php
@@ -0,0 +1,53 @@
+objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+ }
+
+ /**
+ * @magentoDataFixture Magento/Captcha/_files/failed_logins_frontend.php
+ */
+ public function testAccountEditRemovesFailedAttempts()
+ {
+ $customerEmail = 'mageuser@dummy.com';
+ $captchaLogFactory = $this->objectManager->get(LogFactory::class);
+ $eventManager = $this->objectManager->get(ManagerInterface::class);
+
+ $eventManager->dispatch(
+ 'customer_account_edited',
+ ['email' => $customerEmail]
+ );
+
+ /**
+ * @var CaptchaLog $captchaLog
+ */
+ $captchaLog = $captchaLogFactory->create();
+
+ self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail));
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php
new file mode 100644
index 0000000000000..f8dd80595f936
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php
@@ -0,0 +1,60 @@
+objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+ }
+
+ /**
+ * @magentoDataFixture Magento/Captcha/_files/failed_logins_frontend.php
+ */
+ public function testSuccesfulLoginRemovesFailedAttempts()
+ {
+ $customerEmail = 'mageuser@dummy.com';
+ $customerFactory = $this->objectManager->get(CustomerFactory::class);
+ $captchaLogFactory = $this->objectManager->get(LogFactory::class);
+ $eventManager = $this->objectManager->get(ManagerInterface::class);
+
+ /** @var Customer $customer */
+ $customer = $customerFactory->create();
+ $customer->setEmail($customerEmail);
+
+ $eventManager->dispatch(
+ 'customer_customer_authenticated',
+ ['model' => $customer, 'password' => 'some_password']
+ );
+
+ /**
+ * @var CaptchaLog $captchaLog
+ */
+ $captchaLog = $captchaLogFactory->create();
+
+ self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail));
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend.php b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend.php
new file mode 100644
index 0000000000000..7130cdfca57d7
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend.php
@@ -0,0 +1,17 @@
+get(LogFactory::class);
+
+/** @var Log $captchaLog */
+$captchaLog = $logFactory->create();
+$captchaLog->logAttempt('mageadmin');
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend_rollback.php b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend_rollback.php
new file mode 100644
index 0000000000000..12a16027e1e5c
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend_rollback.php
@@ -0,0 +1,17 @@
+get(LogFactory::class);
+
+/** @var Log $captchaLog */
+$captchaLog = $logFactory->create();
+$captchaLog->deleteUserAttempts('mageadmin');
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend.php b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend.php
new file mode 100644
index 0000000000000..4e0db30fa82c1
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend.php
@@ -0,0 +1,17 @@
+get(LogFactory::class);
+
+/** @var Log $captchaLog */
+$captchaLog = $logFactory->create();
+$captchaLog->logAttempt('mageuser@dummy.com');
diff --git a/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend_rollback.php b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend_rollback.php
new file mode 100644
index 0000000000000..a01edb6d0a219
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend_rollback.php
@@ -0,0 +1,17 @@
+get(LogFactory::class);
+
+/** @var Log $captchaLog */
+$captchaLog = $logFactory->create();
+$captchaLog->deleteUserAttempts('mageuser@dummy.com');
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php
index 88b59570457d3..4b6a2a40aa129 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php
@@ -107,8 +107,6 @@ private function prepareAdditionalStore()
->setGroupId($storeGroup->getId())
->save();
- /* Refresh stores memory cache */
- $this->objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->reinitStores();
return $store;
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php
index 6e93f61c1eb3a..098b18d6f38c9 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php
@@ -5,6 +5,8 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;
+use Magento\Framework\Exception\LocalizedException;
+
/**
* @magentoAppArea adminhtml
* @magentoDbIsolation enabled
@@ -221,6 +223,110 @@ public function testSaveActionCleanAttributeLabelCache()
$this->assertEquals('new string translation', $this->_translate('string to translate'));
}
+ /**
+ * Get attribute data preset.
+ *
+ * @return array
+ */
+ private function getLargeOptionsSetAttributeData(): array
+ {
+ return [
+ 'frontend_label' => [
+ 0 => 'testdrop1',
+ 1 => '',
+ 2 => '',
+ ],
+ 'frontend_input' => 'select',
+ 'is_required' => '0',
+ 'update_product_preview_image' => '0',
+ 'use_product_image_for_swatch' => '0',
+ 'visual_swatch_validation' => '',
+ 'visual_swatch_validation_unique' => '',
+ 'text_swatch_validation' => '',
+ 'text_swatch_validation_unique' => '',
+ 'attribute_code' => 'test_many_options',
+ 'is_global' => '0',
+ 'default_value_text' => '',
+ 'default_value_yesno' => '0',
+ 'default_value_date' => '',
+ 'default_value_textarea' => '',
+ 'is_unique' => '0',
+ 'is_used_in_grid' => '1',
+ 'is_visible_in_grid' => '1',
+ 'is_filterable_in_grid' => '1',
+ 'is_searchable' => '0',
+ 'is_comparable' => '0',
+ 'is_filterable' => '0',
+ 'is_filterable_in_search' => '0',
+ 'is_used_for_promo_rules' => '0',
+ 'is_html_allowed_on_front' => '1',
+ 'is_visible_on_front' => '0',
+ 'used_in_product_listing' => '0',
+ 'used_for_sort_by' => '0',
+ 'swatch_input_type' => 'dropdown',
+ ];
+ }
+
+ /**
+ * Test attribute saving with large amount of options exceeding maximum allowed by max_input_vars limit.
+ *
+ * @return void
+ */
+ public function testLargeOptionsDataSet()
+ {
+ $maxInputVars = ini_get('max_input_vars');
+ // Each option is at least 4 variables array (order, admin value, first store view value, delete flag).
+ // Set options count to exceed max_input_vars by 100 options (400 variables).
+ $optionsCount = floor($maxInputVars / 4) + 100;
+ $attributeData = $this->getLargeOptionsSetAttributeData();
+ $optionsData = [];
+ $expectedOptionsLabels = [];
+ for ($i = 0; $i < $optionsCount; $i++) {
+ $order = $i + 1;
+ $expectedOptionLabelOnStoreView = "value_{$i}_store_1";
+ $expectedOptionsLabels[$i+1] = $expectedOptionLabelOnStoreView;
+ $optionsData []= "option[order][option_{$i}]={$order}";
+ $optionsData []= "option[value][option_{$i}][0]=value_{$i}_admin";
+ $optionsData []= "option[value][option_{$i}][1]={$expectedOptionLabelOnStoreView}";
+ $optionsData []= "option[delete][option_{$i}=";
+ }
+ $attributeData['serialized_options'] = json_encode($optionsData);
+ $this->getRequest()->setPostValue($attributeData);
+ $this->dispatch('backend/catalog/product_attribute/save');
+ $entityTypeId = $this->_objectManager->create(
+ \Magento\Eav\Model\Entity::class
+ )->setType(
+ \Magento\Catalog\Model\Product::ENTITY
+ )->getTypeId();
+
+ /** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
+ $attribute = $this->_objectManager->create(
+ \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
+ )->setEntityTypeId(
+ $entityTypeId
+ );
+ try {
+ $attribute->loadByCode($entityTypeId, 'test_many_options');
+ $options = $attribute->getOptions();
+ // assert that all options are saved without truncation
+ $this->assertEquals(
+ $optionsCount + 1,
+ count($options),
+ 'Expected options count does not match (regarding first empty option for non-required attribute)'
+ );
+
+ foreach ($expectedOptionsLabels as $optionOrderNum => $label) {
+ $this->assertEquals(
+ $label,
+ $options[$optionOrderNum]->getLabel(),
+ "Label for option #{$optionOrderNum} does not match expected."
+ );
+ }
+ } catch (LocalizedException $e) {
+ $this->fail('Test failed with exception on attribute model load: ' . $e);
+ }
+ }
+
/**
* Return translation for a string literal belonging to backend area
*
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
index 6efd2638c0d52..849287517c838 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
@@ -27,6 +27,11 @@ class ProductTest extends \PHPUnit\Framework\TestCase
*/
protected $productResource;
+ /**
+ * @var \Magento\Catalog\Api\CategoryRepositoryInterface
+ */
+ private $categoryRepository;
+
protected function setUp()
{
/** @var \Magento\Framework\Indexer\IndexerInterface indexer */
@@ -39,6 +44,10 @@ protected function setUp()
$this->productResource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Model\ResourceModel\Product::class
);
+
+ $this->categoryRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Catalog\Api\CategoryRepositoryInterface::class
+ );
}
/**
@@ -200,6 +209,27 @@ public function testCategoryCreate()
}
}
+ /**
+ * @magentoAppArea adminhtml
+ * @depends testReindexAll
+ *
+ * @return void
+ */
+ public function testCatalogCategoryProductIndexInvalidateAfterDelete()
+ {
+ $indexerShouldBeValid = (bool)$this->indexer->isInvalid();
+
+ $categories = $this->getCategories(1);
+ $this->categoryRepository->delete(array_pop($categories));
+
+ $state = $this->indexer->getState();
+ $state->loadByIndexer($this->indexer->getId());
+ $status = $state->getStatus();
+
+ $this->assertFalse($indexerShouldBeValid);
+ $this->assertEquals(\Magento\Framework\Indexer\StateInterface::STATUS_INVALID, $status);
+ }
+
/**
* @param int $count
* @return Category[]
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
index 90bf630000e72..ecd041678861d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
@@ -42,11 +42,6 @@
$store->save();
}
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
-
/** @var \Magento\Catalog\Model\Category $newCategory */
$newCategory = $factory->create();
$newCategory
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute.php
new file mode 100644
index 0000000000000..aaa3b9ec7503a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute.php
@@ -0,0 +1,67 @@
+create(
+ \Magento\Catalog\Setup\CategorySetup::class
+);
+
+/** @var $options \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection */
+$options = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class
+);
+$options->setAttributeFilter($attribute->getId());
+$optionIds = $options->getAllIds();
+
+/** @var $product \Magento\Catalog\Model\Product */
+$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setId($optionIds[0] * 10)
+ ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
+ ->setWebsiteIds([1])
+ ->setName('With Option 1')
+ ->setSku('simple_op_1')
+ ->setPrice(10)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setDropdownAttribute($optionIds[0])
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
+ ->save();
+
+$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setId($optionIds[1] * 10)
+ ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
+ ->setWebsiteIds([1])
+ ->setName('With Option 2')
+ ->setSku('simple_op_2')
+ ->setPrice(10)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setDropdownAttribute($optionIds[1])
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
+ ->save();
+
+$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setId($optionIds[2] * 10)
+ ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
+ ->setWebsiteIds([1])
+ ->setName('With Option 3')
+ ->setSku('simple_op_3')
+ ->setPrice(10)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setDropdownAttribute($optionIds[2])
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
+ ->save();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute_rollback.php
new file mode 100644
index 0000000000000..2fff69b40a61e
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_dropdown_attribute_rollback.php
@@ -0,0 +1,24 @@
+get('Magento\Framework\Registry');
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var $productCollection \Magento\Catalog\Model\ResourceModel\Product */
+$productCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create('Magento\Catalog\Model\Product')
+ ->getCollection();
+
+foreach ($productCollection as $product) {
+ $product->delete();
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php
index b3a9b9d9515fa..d1ff426c0168d 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php
@@ -46,8 +46,3 @@
$objectManager->create(\Magento\Eav\Model\AttributeSetManagement::class)
->create($entityTypeCode, $attributeSet, $defaultSetId);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()
- ->get(\Magento\Store\Model\StoreManagerInterface::class)
- ->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php
new file mode 100644
index 0000000000000..49667993377f7
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php
@@ -0,0 +1,76 @@
+indexerProcessor = Bootstrap::getObjectManager()->create(Processor::class);
+ $this->categoryRepository = Bootstrap::getObjectManager()->create(CategoryRepositoryInterface::class);
+ }
+
+ /**
+ * @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
+ * @magentoAppArea adminhtml
+ *
+ * @return void
+ */
+ public function testIndexerInvalidatedAfterCategoryDelete()
+ {
+ $this->indexerProcessor->reindexAll();
+ $isIndexerValid = (bool)$this->indexerProcessor->getIndexer()->isValid();
+
+ $category = $this->getCategories(1);
+ $this->categoryRepository->delete(array_pop($category));
+
+ $state = $this->indexerProcessor->getIndexer()->getState();
+ $state->loadByIndexer($this->indexerProcessor->getIndexerId());
+ $status = $state->getStatus();
+
+ $this->assertTrue($isIndexerValid);
+ $this->assertEquals(StateInterface::STATUS_INVALID, $status);
+ }
+
+ /**
+ * @param int $count
+ * @return Category[]
+ */
+ private function getCategories(int $count): array
+ {
+ /** @var Category $category */
+ $category = Bootstrap::getObjectManager()->create(Category::class);
+
+ $result = $category->getCollection()->addAttributeToSelect('name')->getItems();
+ $result = array_slice($result, 2);
+
+ return array_slice($result, 0, $count);
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
index 151c21d9c2e21..3828d2b29e8e7 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
@@ -88,6 +88,38 @@ public function testCreateCollectionWithMultipleSkuCondition()
$this->performAssertions(2);
}
+ /**
+ * Test product list widget can process condition with dropdown type of attribute which has Store Scope
+ *
+ * @magentoDbIsolation disabled
+ * @magentoDataFixture Magento/Catalog/_files/products_with_dropdown_attribute.php
+ */
+ public function testCreateCollectionWithDropdownAttributeStoreScope()
+ {
+ /** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
+ $attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
+ );
+ $attribute->load('dropdown_attribute', 'attribute_code');
+ $dropdownAttributeOptionIds = [];
+ foreach ($attribute->getOptions() as $option) {
+ if ($option->getValue()) {
+ $dropdownAttributeOptionIds[] = $option->getValue();
+ }
+ }
+ $encodedConditions = '^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,' .
+ '`aggregator`:`any`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule|' .
+ '|Condition||Product`,`attribute`:`dropdown_attribute`,`operator`:`==`,`value`:`'
+ . $dropdownAttributeOptionIds[0] . '`^],`1--2`:^[`type`:`Magento||CatalogWidget||Model||Rule|' .
+ '|Condition||Product`,`attribute`:`dropdown_attribute`,`operator`:`==`,`value`:`'
+ . $dropdownAttributeOptionIds[1] . '`^]^]';
+ $this->block->setData('conditions_encoded', $encodedConditions);
+ $this->performAssertions(2);
+ $attribute->setUsedInProductListing(0);
+ $attribute->save();
+ $this->performAssertions(2);
+ }
+
/**
* Check product collection includes correct amount of products.
*
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php
new file mode 100644
index 0000000000000..c740609773b90
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php
@@ -0,0 +1,66 @@
+getRequest()
+ ->getHeaders()
+ ->addHeaderLine('Accept', 'application/json');
+ $this->dispatch($url);
+ $response = $this->getResponse();
+ $data = json_decode($response->getBody(), true);
+ self::assertEquals($expectedRows, $data['totalRecords']);
+
+ $titleList = array_column($data['items'], 'title');
+ self::assertEquals($expectedTitles, $titleList);
+ }
+
+ /**
+ * Gets list of variations with different search queries.
+ *
+ * @return array
+ */
+ public function queryDataProvider(): array
+ {
+ return [
+ [
+ 'query' => 'simple',
+ 'expectedRows' => 3,
+ 'expectedTitles' => ['simplePage', 'simplePage01', '01simplePage']
+ ],
+ [
+ 'query' => 'page01',
+ 'expectedRows' => 1,
+ 'expectedTitles' => ['simplePage01']
+ ],
+ [
+ 'query' => '01simple',
+ 'expectedRows' => 1,
+ 'expectedTitles' => ['01simplePage']
+ ],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php
new file mode 100644
index 0000000000000..ae431f5c4cf1a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php
@@ -0,0 +1,34 @@
+ 'simplePage',
+ 'is_active' => 1
+ ],
+ [
+ 'title' => 'simplePage01',
+ 'is_active' => 1
+ ],
+ [
+ 'title' => '01simplePage',
+ 'is_active' => 1
+ ],
+];
+
+/** @var PageRepositoryInterface $pageRepository */
+$pageRepository = $objectManager->get(PageRepositoryInterface::class);
+foreach ($data as $item) {
+ $page = $objectManager->create(PageInterface::class, ['data' => $item]);
+ $pageRepository->save($page);
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php
new file mode 100644
index 0000000000000..261cdba589653
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php
@@ -0,0 +1,25 @@
+get(PageRepositoryInterface::class);
+
+/** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class);
+$searchCriteria = $searchCriteriaBuilder->addFilter('title', ['simplePage', 'simplePage01', '01simplePage'], 'in')
+ ->create();
+$result = $pageRepository->getList($searchCriteria);
+
+foreach ($result->getItems() as $item) {
+ $pageRepository->delete($item);
+}
diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php
index ce2f3ebae5538..9d0634645a4c3 100644
--- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php
@@ -130,7 +130,7 @@ public function getPostcodesDataProvider()
['countryId' => 'IS', 'postcode' => '123'],
['countryId' => 'IN', 'postcode' => '123456'],
['countryId' => 'ID', 'postcode' => '12345'],
- ['countryId' => 'IL', 'postcode' => '12345'],
+ ['countryId' => 'IL', 'postcode' => '1234567'],
['countryId' => 'IT', 'postcode' => '12345'],
['countryId' => 'JP', 'postcode' => '123-4567'],
['countryId' => 'JP', 'postcode' => '1234567'],
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php b/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php
index 3e74a96cee940..d3e6e4aad2015 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php
@@ -155,6 +155,60 @@ public function testDelegateNew()
'12345abcD'
);
+ //Testing that addresses from order and the order itself are assigned
+ //to customer.
+ $order = $this->orderRepository->get($orderId);
+ $this->assertCount(1, $createdCustomer->getAddresses());
+ $this->assertNotNull($createdCustomer->getDefaultBilling());
+ $this->assertNotNull($createdCustomer->getDefaultShipping());
+ foreach ($createdCustomer->getAddresses() as $address) {
+ $this->assertTrue(
+ $address->isDefaultBilling() || $address->isDefaultShipping()
+ );
+ if ($address->isDefaultBilling()) {
+ $this->compareAddresses($order->getBillingAddress(), $address);
+ } elseif ($address->isDefaultShipping()) {
+ $this->compareAddresses($order->getShippingAddress(), $address);
+ }
+ }
+ $this->assertEquals($order->getCustomerId(), $createdCustomer->getId());
+ }
+
+ /**
+ * @magentoDbIsolation enabled
+ * @magentoAppIsolation enabled
+ * @magentoDataFixture Magento/Sales/_files/order_different_addresses.php
+ */
+ public function testDelegateNewDifferentAddresses()
+ {
+ $orderAutoincrementId = '100000001';
+ /** @var Order $orderModel */
+ $orderModel = $this->orderFactory->create();
+ $orderModel->loadByIncrementId($orderAutoincrementId);
+ $orderId = $orderModel->getId();
+ unset($orderModel);
+
+ $this->delegate->delegateNew($orderId);
+
+ //Saving new customer with prepared data from order.
+ /** @var CustomerInterface $customer */
+ $customer = $this->customerFactory->create();
+ $customer->setWebsiteId(1)
+ ->setEmail('customer_order_delegate@example.com')
+ ->setGroupId(1)
+ ->setStoreId(1)
+ ->setPrefix('Mr.')
+ ->setFirstname('John')
+ ->setMiddlename('A')
+ ->setLastname('Smith')
+ ->setSuffix('Esq.')
+ ->setTaxvat('12')
+ ->setGender(0);
+ $createdCustomer = $this->accountManagement->createAccount(
+ $customer,
+ '12345abcD'
+ );
+
//Testing that addresses from order and the order itself are assigned
//to customer.
$order = $this->orderRepository->get($orderId);
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
index b6df7eb05c03d..abdbab2c24d16 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
@@ -1,151 +1,201 @@
_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
-
- $sessionMock = $this->getMockBuilder(
- \Magento\Backend\Model\Session\Quote::class
- )->disableOriginalConstructor()->setMethods(
- ['getCustomerId', 'getQuote', 'getStoreId', 'getStore']
- )->getMock();
- $sessionMock->expects($this->any())->method('getCustomerId')->will($this->returnValue(1));
-
- $quote = $this->_objectManager->create(\Magento\Quote\Model\Quote::class)->load(1);
- $sessionMock->expects($this->any())->method('getQuote')->will($this->returnValue($quote));
-
- $sessionMock->expects($this->any())->method('getStoreId')->will($this->returnValue(1));
-
- $storeMock = $this->getMockBuilder(
- \Magento\Store\Model\Store::class
- )->disableOriginalConstructor()->setMethods(
- ['getCurrentCurrencyCode']
- )->getMock();
- $storeMock->expects($this->any())->method('getCurrentCurrencyCode')->will($this->returnValue('USD'));
- $sessionMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
-
- /** @var \Magento\Framework\View\LayoutInterface $layout */
- $layout = $this->_objectManager->get(\Magento\Framework\View\LayoutInterface::class);
- $this->_orderCreateBlock = $layout->createBlock(
- \Magento\Sales\Block\Adminhtml\Order\Create\Form::class,
- 'order_create_block' . rand(),
- ['sessionQuote' => $sessionMock]
+ $this->objectManager = Bootstrap::getObjectManager();
+
+ $this->session = $this->getMockBuilder(QuoteSession::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getCustomerId', 'getQuote', 'getStoreId', 'getStore', 'getQuoteId'])
+ ->getMock();
+ $this->session->method('getCustomerId')
+ ->willReturn(1);
+
+ $this->session->method('getStoreId')
+ ->willReturn(1);
+
+ $store = $this->getMockBuilder(Store::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getCurrentCurrencyCode'])
+ ->getMock();
+ $store->method('getCurrentCurrencyCode')
+ ->willReturn('USD');
+ $this->session->method('getStore')
+ ->willReturn($store);
+
+ /** @var LayoutInterface $layout */
+ $layout = $this->objectManager->get(LayoutInterface::class);
+ $this->block = $layout->createBlock(
+ Form::class,
+ 'order_create_block' . mt_rand(),
+ ['sessionQuote' => $this->session]
);
parent::setUp();
}
/**
+ * Checks if all needed order's data is correctly returned to the form.
+ *
* @magentoDataFixture Magento/Customer/_files/customer.php
+ * @magentoDataFixture Magento/Sales/_files/quote.php
*/
public function testOrderDataJson()
{
- /** @var array $addressIds */
- $addressIds = $this->setUpMockAddress();
- $orderDataJson = $this->_orderCreateBlock->getOrderDataJson();
- $expectedOrderDataJson = <<assertEquals(json_decode($expectedOrderDataJson), json_decode($orderDataJson));
+ $customerId = 1;
+ $quote = $this->getQuote('test01');
+ $this->session->method('getQuote')
+ ->willReturn($quote);
+ $this->session->method('getQuoteId')
+ ->willReturn($quote->getId());
+ $addressData = $this->getAddressData();
+ $addressIds = $this->setUpMockAddress($customerId, $addressData);
+ $expected = [
+ 'customer_id' => $customerId,
+ 'addresses' => [
+ $addressIds[0] => $addressData[0],
+ $addressIds[1] => $addressData[1]
+ ],
+ 'store_id' => 1,
+ 'currency_symbol' => '$',
+ 'shipping_method_reseted' => true,
+ 'payment_method' => 'checkmo',
+ 'quote_id' => $quote->getId()
+ ];
+
+ self::assertEquals($expected, json_decode($this->block->getOrderDataJson(), true));
}
- private function setUpMockAddress()
+ /**
+ * Saves customer's addresses.
+ *
+ * @param int $customerId
+ * @param array $addressData
+ * @return array
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ private function setUpMockAddress(int $customerId, array $addressData)
{
- /** @var \Magento\Customer\Api\Data\RegionInterfaceFactory $regionFactory */
- $regionFactory = $this->_objectManager->create(\Magento\Customer\Api\Data\RegionInterfaceFactory::class);
-
- /** @var \Magento\Customer\Api\Data\AddressInterfaceFactory $addressFactory */
- $addressFactory = $this->_objectManager->create(\Magento\Customer\Api\Data\AddressInterfaceFactory::class);
- /** @var \Magento\Customer\Api\AddressRepositoryInterface $addressRepository */
- $addressRepository = $this->_objectManager->create(\Magento\Customer\Api\AddressRepositoryInterface::class);
-
- $addressData1 = $addressFactory->create()->setCountryId(
- 'US'
- )->setCustomerId(
- 1
- )->setIsDefaultBilling(
- true
- )->setIsDefaultShipping(
- true
- )->setPostcode(
- '75477'
- )->setRegion(
- $regionFactory->create()->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)
- )->setStreet(
- ['Green str, 67']
- )->setTelephone(
- '3468676'
- )->setCity(
- 'CityM'
- )->setFirstname(
- 'John'
- )->setLastname(
- 'Smith'
- );
-
- $addressData2 = $addressFactory->create()->setCountryId(
- 'US'
- )->setCustomerId(
- 1
- )->setIsDefaultBilling(
- false
- )->setIsDefaultShipping(
- false
- )->setPostcode(
- '47676'
- )->setRegion(
- $regionFactory->create()->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)
- )->setStreet(
- ['Black str, 48']
- )->setCity(
- 'CityX'
- )->setTelephone(
- '3234676'
- )->setFirstname(
- 'John'
- )->setLastname(
- 'Smith'
- );
+ /** @var RegionInterfaceFactory $regionFactory */
+ $regionFactory = $this->objectManager->create(RegionInterfaceFactory::class);
+ /** @var AddressInterfaceFactory $addressFactory */
+ $addressFactory = $this->objectManager->create(AddressInterfaceFactory::class);
+ /** @var AddressRepositoryInterface $addressRepository */
+ $addressRepository = $this->objectManager->create(AddressRepositoryInterface::class);
+ $region = $regionFactory->create()
+ ->setRegionCode('AL')
+ ->setRegion('Alabama')
+ ->setRegionId(1);
+
+ $ids = [];
+ foreach ($addressData as $data) {
+ $address = $addressFactory->create(['data' => $data]);
+ $address->setRegion($region)
+ ->setCustomerId($customerId)
+ ->setIsDefaultBilling(true)
+ ->setIsDefaultShipping(true);
+ $address = $addressRepository->save($address);
+ $ids[] = $address->getId();
+ }
+
+ return $ids;
+ }
- $savedAddress1 = $addressRepository->save($addressData1);
- $savedAddress2 = $addressRepository->save($addressData2);
+ /**
+ * Gets test address data.
+ *
+ * @return array
+ */
+ private function getAddressData(): array
+ {
+ return [
+ [
+ 'firstname' => 'John',
+ 'lastname' => 'Smith',
+ 'company' => false,
+ 'street' => 'Green str, 67',
+ 'city' => 'CityM',
+ 'country_id' => 'US',
+ 'region' => 'Alabama',
+ 'region_id' => 1,
+ 'postcode' => '75477',
+ 'telephone' => '3468676',
+ 'vat_id' => false
+ ],
+ [
+ 'firstname' => 'John',
+ 'lastname' => 'Smith',
+ 'company' => false,
+ 'street' => 'Black str, 48',
+ 'city' => 'CityX',
+ 'country_id' => 'US',
+ 'region' => 'Alabama',
+ 'region_id' => 1,
+ 'postcode' => '47676',
+ 'telephone' => '3234676',
+ 'vat_id' => false,
+ ]
+ ];
+ }
- return [$savedAddress1->getId(), $savedAddress2->getId()];
+ /**
+ * Gets quote by ID.
+ *
+ * @param string $reservedOrderId
+ * @return Quote
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getQuote(string $reservedOrderId): Quote
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+ /** @var CartRepositoryInterface $repository */
+ $repository = $this->objectManager->get(CartRepositoryInterface::class);
+ $items = $repository->getList($searchCriteria)
+ ->getItems();
+
+ return array_pop($items);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/InvoiceEmailSenderHandlerTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/InvoiceEmailSenderHandlerTest.php
new file mode 100644
index 0000000000000..332092946c4d6
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Model/InvoiceEmailSenderHandlerTest.php
@@ -0,0 +1,103 @@
+create(
+ \Magento\Sales\Model\Order\Email\Container\InvoiceIdentity::class
+ );
+ /** @var \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender */
+ $invoiceSender = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(
+ \Magento\Sales\Model\Order\Email\Sender\InvoiceSender::class,
+ [
+ 'identityContainer' => $invoiceIdentity,
+ ]
+ );
+ $entityResource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Sales\Model\ResourceModel\Order\Invoice::class);
+ $this->entityCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Sales\Model\ResourceModel\Order\Invoice\Collection::class
+ );
+ $this->emailSender = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Sales\Model\EmailSenderHandler::class,
+ [
+ 'emailSender' => $invoiceSender,
+ 'entityResource' => $entityResource,
+ 'entityCollection' => $this->entityCollection,
+ 'identityContainer' => $invoiceIdentity,
+ ]
+ );
+ }
+
+ /**
+ * @magentoAppIsolation enabled
+ * @magentoDbIsolation disabled
+ * @magentoDataFixture Magento/Sales/_files/invoice_list_different_stores.php
+ */
+ public function testInvoiceEmailSenderExecute()
+ {
+ $expectedResult = 1;
+
+ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+
+ /** @var Config $defConfig */
+ $defConfig = $objectManager->create(Config::class);
+ $defConfig->setScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT);
+ $defConfig->setDataByPath('sales_email/general/async_sending', 1);
+ $defConfig->save();
+
+ /** @var Config $storeConfig */
+ $storeConfig = $objectManager->create(Config::class);
+ $storeConfig->setScope(ScopeInterface::SCOPE_STORES);
+ $storeConfig->setStore('fixture_second_store');
+ $storeConfig->setDataByPath('sales_email/invoice/enabled', 0);
+ $storeConfig->save();
+
+ $sendCollection = clone $this->entityCollection;
+ $sendCollection->addFieldToFilter('send_email', ['eq' => 1]);
+ $sendCollection->addFieldToFilter('email_sent', ['null' => true]);
+
+ $this->emailSender->sendEmails();
+
+ $this->assertCount($expectedResult, $sendCollection->getItems());
+ }
+
+ /**
+ * @inheritdoc
+ * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws \Exception
+ */
+ protected function tearDown()
+ {
+ /** @var \Magento\Config\Model\Config $defConfig */
+ $defConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Config\Model\Config::class);
+ $defConfig->setScope(\Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT);
+ $defConfig->setDataByPath('sales_email/general/async_sending', 0);
+ $defConfig->save();
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores.php b/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores.php
new file mode 100644
index 0000000000000..e6a1947b72edd
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores.php
@@ -0,0 +1,132 @@
+create(\Magento\Store\Model\Store::class);
+$secondStoreId = $store->load('fixture_second_store')->getId();
+
+$orders = [
+ [
+ 'increment_id' => '100000002',
+ 'state' => \Magento\Sales\Model\Order::STATE_NEW,
+ 'status' => 'processing',
+ 'grand_total' => 120.00,
+ 'subtotal' => 120.00,
+ 'base_grand_total' => 120.00,
+ 'store_id' => 0,
+ 'website_id' => 1,
+ ],
+ [
+ 'increment_id' => '100000003',
+ 'state' => \Magento\Sales\Model\Order::STATE_PROCESSING,
+ 'status' => 'processing',
+ 'grand_total' => 140.00,
+ 'base_grand_total' => 140.00,
+ 'subtotal' => 140.00,
+ 'store_id' => 1,
+ 'website_id' => 0,
+ ],
+ [
+ 'increment_id' => '100000004',
+ 'state' => \Magento\Sales\Model\Order::STATE_PROCESSING,
+ 'status' => 'closed',
+ 'grand_total' => 140.00,
+ 'base_grand_total' => 140.00,
+ 'subtotal' => 140.00,
+ 'store_id' => $secondStoreId,
+ 'website_id' => 1,
+ ],
+];
+
+/** @var \Magento\Sales\Model\Order\Address $billingAddress */
+$billingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]);
+$billingAddress->setAddressType('billing');
+
+/** @var \Magento\Sales\Model\Order\Address $shippingAddress */
+$shippingAddress = clone $billingAddress;
+$shippingAddress->setId(null)->setAddressType('shipping');
+
+/** @var \Magento\Sales\Model\Order\Payment $payment */
+$payment = $objectManager->create(\Magento\Sales\Model\Order\Payment::class);
+$payment->setMethod('checkmo');
+$payment->setAdditionalInformation('last_trans_id', '11122');
+$payment->setAdditionalInformation('metadata', [
+ 'type' => 'free',
+ 'fraudulent' => false,
+]);
+
+/** @var \Magento\Sales\Model\Order\Item $orderItem */
+$orderItem = $objectManager->create(\Magento\Sales\Model\Order\Item::class);
+$orderItem->setProductId($product->getId())->setQtyOrdered(2);
+$orderItem->setBasePrice($product->getPrice());
+$orderItem->setPrice($product->getPrice());
+$orderItem->setRowTotal($product->getPrice());
+$orderItem->setProductType('simple');
+
+/** @var \Magento\Sales\Api\InvoiceManagementInterface $orderService */
+$orderService = \Magento\TestFramework\ObjectManager::getInstance()->create(
+ \Magento\Sales\Api\InvoiceManagementInterface::class
+);
+
+/** @var \Magento\Sales\Api\OrderRepositoryInterface $orderRepository */
+$orderRepository = $objectManager->create(\Magento\Sales\Api\OrderRepositoryInterface::class);
+
+foreach ($orders as $orderFixture) {
+ /** @var \Magento\Sales\Model\Order $order */
+ $order = $objectManager->create(\Magento\Sales\Model\Order::class);
+ $order->setData($orderFixture);
+ $order->setIncrementId(
+ $orderFixture['increment_id']
+ )->setStoreId(
+ $orderFixture['store_id']
+ )->setState(
+ $orderFixture['state']
+ )->setStatus(
+ $orderFixture['status']
+ )->setSubtotal(
+ $orderFixture['subtotal']
+ )->setGrandTotal(
+ $orderFixture['grand_total']
+ )->setBaseSubtotal(
+ $orderFixture['subtotal']
+ )->setBaseGrandTotal(
+ $orderFixture['base_grand_total']
+ )->setCustomerIsGuest(
+ true
+ )->setCustomerEmail(
+ 'customer@null.com'
+ )->setBillingAddress(
+ clone $billingAddress
+ )->setShippingAddress(
+ clone $shippingAddress
+ )->addItem(
+ clone $orderItem
+ )->setPayment(
+ clone $payment
+ );
+
+ $orderRepository->save($order);
+
+ /** @var \Magento\Sales\Model\Order\Invoice $invoice */
+ $invoice = $orderService->prepareInvoice($order, $order->getItems());
+ $invoice->register();
+ $invoice->setSendEmail(1);
+ $invoice->setStoreId($orderFixture['store_id']);
+ $order = $invoice->getOrder();
+ $order->setIsInProcess(true);
+ $transactionSave = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Framework\DB\Transaction::class);
+ $transactionSave->addObject($invoice)->addObject($order)->save();
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores_rollback.php
new file mode 100644
index 0000000000000..803a69cabf77b
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_list_different_stores_rollback.php
@@ -0,0 +1,9 @@
+create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]);
+$billingAddress->setAddressType('billing');
+
+/** @var \Magento\Sales\Model\Order\Address $shippingAddress */
+$shippingAddress = clone $billingAddress;
+$shippingAddress
+ ->setId(null)
+ ->setAddressType('shipping')
+ ->setCity('San Francisco');
+
+/** @var \Magento\Sales\Model\Order\Payment $payment */
+$payment = $objectManager->create(\Magento\Sales\Model\Order\Payment::class);
+$payment->setMethod('checkmo');
+$payment->setAdditionalInformation('last_trans_id', '11122');
+$payment->setAdditionalInformation('metadata', [
+ 'type' => 'free',
+ 'fraudulent' => false,
+]);
+
+/** @var \Magento\Sales\Model\Order\Item $orderItem */
+$orderItem = $objectManager->create(\Magento\Sales\Model\Order\Item::class);
+$orderItem->setProductId($product->getId())->setQtyOrdered(2);
+$orderItem->setBasePrice($product->getPrice());
+$orderItem->setPrice($product->getPrice());
+$orderItem->setRowTotal($product->getPrice());
+$orderItem->setProductType('simple');
+
+/** @var \Magento\Sales\Model\Order $order */
+$order = $objectManager->create(\Magento\Sales\Model\Order::class);
+$order->setIncrementId('100000001')
+ ->setState(\Magento\Sales\Model\Order::STATE_PROCESSING)
+ ->setStatus($order->getConfig()->getStateDefaultStatus(\Magento\Sales\Model\Order::STATE_PROCESSING))
+ ->setSubtotal(100)
+ ->setGrandTotal(100)
+ ->setBaseSubtotal(100)
+ ->setBaseGrandTotal(100)
+ ->setCustomerIsGuest(true)
+ ->setCustomerEmail('customer@null.com')
+ ->setBillingAddress($billingAddress)
+ ->setShippingAddress($shippingAddress)
+ ->setStoreId($objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->getStore()->getId())
+ ->addItem($orderItem)
+ ->setPayment($payment);
+
+$order->save();
diff --git a/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php b/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php
index dfd979f03c576..bc8ca2ba07a80 100644
--- a/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php
@@ -48,8 +48,5 @@ protected function changeStoreCode($from, $to)
$store->load($from, 'code');
$store->setCode($to);
$store->save();
- /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
- $storeManager = $this->_objectManager->get(\Magento\Store\Model\StoreManagerInterface::class);
- $storeManager->reinitStores();
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore.php b/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore.php
index e3971ad912a78..a4a640a24de50 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore.php
@@ -21,9 +21,6 @@
->setSortOrder(10)
->setIsActive(1);
$store->save();
-
- /* Refresh stores memory cache */
- Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class)->reinitStores();
}
//if test using this fixture relies on full text functionality it is required to explicitly perform re-indexation
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore_rollback.php
index d6b9e1d9abc70..95d13111e6193 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/core_fixturestore_rollback.php
@@ -23,6 +23,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-$objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore.php b/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore.php
index 139f36ca3c9d6..3cb429822eb9a 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore.php
@@ -27,8 +27,3 @@
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
$store->setCode('thirdstore')->setName('Third Store')->setSortOrder(10)->setIsActive(1);
$store->save();
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore_rollback.php
index 1334875b7a17b..0eaa7d32f9402 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/core_second_third_fixturestore_rollback.php
@@ -34,8 +34,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index.php b/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index.php
index 064dfbcdbe2be..d5fd725e7df4d 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index.php
@@ -21,11 +21,4 @@
->setSortOrder(10)
->setIsActive(1);
$store->save();
-
- Bootstrap::getObjectManager()
- ->get(\Magento\Framework\Event\ManagerInterface::class)
- ->dispatch('store_add', ['store' => $store]);
-
- /* Refresh stores memory cache */
- Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class)->reinitStores();
}
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index_rollback.php
index 8a69f83882ade..251635dcff09f 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/fixture_store_with_catalogsearch_index_rollback.php
@@ -20,8 +20,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/second_store.php b/dev/tests/integration/testsuite/Magento/Store/_files/second_store.php
index c154cdfb80f8e..6fbe316f52a05 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/second_store.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/second_store.php
@@ -6,6 +6,7 @@
* See COPYING.txt for license details.
*/
+/** @var \Magento\Store\Model\Store $store */
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
if (!$store->load('fixture_second_store', 'code')->getId()) {
$websiteId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
@@ -29,8 +30,3 @@
);
$store->save();
}
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/second_store_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/second_store_rollback.php
index 4fc5d3b65b270..56ba31fad4ed2 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/second_store_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/second_store_rollback.php
@@ -20,8 +20,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores.php b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores.php
index 078b590132f06..016acca1e8e04 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores.php
@@ -51,10 +51,6 @@
);
$store->save();
}
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
/* Refresh CatalogSearch index */
/** @var \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry */
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores_rollback.php
index b97dc4dd40bd9..eef8cf960944c 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_two_stores_rollback.php
@@ -27,8 +27,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/store.php b/dev/tests/integration/testsuite/Magento/Store/_files/store.php
index e49d16e2ede68..94ea5a9364b87 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/store.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/store.php
@@ -37,6 +37,3 @@
$store->save();
}
}
-$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
-/* Refresh stores memory cache */
-$objectManager->get('Magento\Store\Model\StoreManagerInterface')->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/store_rollback.php b/dev/tests/integration/testsuite/Magento/Store/_files/store_rollback.php
index 3b437f08c8c33..8289244d6581a 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/store_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/store_rollback.php
@@ -31,8 +31,3 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-
-/* Refresh stores memory cache */
-\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
- \Magento\Store\Model\StoreManagerInterface::class
-)->reinitStores();
diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/websites_different_countries.php b/dev/tests/integration/testsuite/Magento/Store/_files/websites_different_countries.php
index b6282e51132e8..018f793020df3 100644
--- a/dev/tests/integration/testsuite/Magento/Store/_files/websites_different_countries.php
+++ b/dev/tests/integration/testsuite/Magento/Store/_files/websites_different_countries.php
@@ -44,9 +44,6 @@
$store->save();
}
-/* Refresh stores memory cache */
-$objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->reinitStores();
-
//Setting up allowed countries
$configResource = $objectManager->get(\Magento\Config\Model\ResourceModel\Config::class);
//Allowed countries for default website.
diff --git a/dev/tests/integration/testsuite/Magento/SwaggerWebapi/Block/Swagger/IndexTest.php b/dev/tests/integration/testsuite/Magento/SwaggerWebapi/Block/Swagger/IndexTest.php
new file mode 100644
index 0000000000000..cf1c87e2b2225
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/SwaggerWebapi/Block/Swagger/IndexTest.php
@@ -0,0 +1,60 @@
+get(\Magento\Framework\App\State::class)
+ ->setAreaCode('frontend');
+
+ $this->block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
+ \Magento\Framework\View\LayoutInterface::class
+ )->createBlock(
+ \Magento\Swagger\Block\Index::class,
+ '',
+ [
+ 'data' => [
+ 'schema_types' => [
+ 'rest' => \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
+ \Magento\SwaggerWebapi\Model\SchemaType\Rest::class
+ )
+ ],
+ 'default_schema_type_code' => 'rest'
+ ]
+ ]
+ );
+ }
+
+ /**
+ * Test that the Swagger UI outputs rest as the default when there is no type parameter supplied via URL.
+ */
+ public function testDefaultSchemaUrlOutput()
+ {
+ $this->assertStringEndsWith('/rest/all/schema?services=all', $this->block->getSchemaUrl());
+ }
+
+ /**
+ * Test that Swagger UI outputs the supplied store code when it is specified.
+ */
+ public function testSchemaUrlOutputWithStore()
+ {
+ $this->block->getRequest()->setParams([
+ 'store' => 'custom',
+ ]);
+
+ $this->assertStringEndsWith('/rest/custom/schema?services=all', $this->block->getSchemaUrl());
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/AttributeTest.php
new file mode 100644
index 0000000000000..be9fd96d75892
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/AttributeTest.php
@@ -0,0 +1,214 @@
+getRandomColor()}";
+ $optionsData []= "optionvisual[value][option_{$i}][0]=value_{$i}_admin";
+ $optionsData []= "optionvisual[value][option_{$i}][1]={$expectedOptionLabelOnStoreView}";
+ $optionsData []= "optionvisual[delete][option_{$i}]=";
+ }
+ $optionsData []= "visual_swatch_validation=";
+ $optionsData []= "visual_swatch_validation_unique=";
+ return [
+ 'attribute_data' => array_merge_recursive(
+ [
+ 'serialized_swatch_values' => json_encode($optionsData),
+ ],
+ $this->getAttributePreset(),
+ [
+ 'frontend_input' => 'swatch_visual',
+ ]
+ ),
+ 'expected_options_count' => $optionsCount + 1,
+ 'expected_store_labels' => $expectedOptionsLabels,
+ ];
+ }
+
+ /**
+ * Get text swatches data set.
+ *
+ * @param int $optionsCount
+ * @return array
+ */
+ private function getSwatchTextDataSet(int $optionsCount): array
+ {
+ $optionsData = [];
+ $expectedOptionsLabels = [];
+ for ($i = 0; $i < $optionsCount; $i++) {
+ $order = $i + 1;
+ $expectedOptionLabelOnStoreView = "value_{$i}_store_1";
+ $expectedOptionsLabels[$i+1] = $expectedOptionLabelOnStoreView;
+ $optionsData []= "optiontext[order][option_{$i}]={$order}";
+ $optionsData []= "defaulttext[]=option_{$i}";
+ $optionsData []= "swatchtext[value][option_{$i}]=x{$i}";
+ $optionsData []= "optiontext[value][option_{$i}][0]=value_{$i}_admin";
+ $optionsData []= "optiontext[value][option_{$i}][1]={$expectedOptionLabelOnStoreView}";
+ $optionsData []= "optiontext[delete][option_{$i}]=";
+ }
+ $optionsData []= "text_swatch_validation=";
+ $optionsData []= "text_swatch_validation_unique=";
+ return [
+ 'attribute_data' => array_merge_recursive(
+ [
+ 'serialized_swatch_values' => json_encode($optionsData),
+ ],
+ $this->getAttributePreset(),
+ [
+ 'frontend_input' => 'swatch_text',
+ ]
+ ),
+ 'expected_options_count' => $optionsCount + 1,
+ 'expected_store_labels' => $expectedOptionsLabels,
+ ];
+ }
+
+ /**
+ * Get data preset for new attribute.
+ *
+ * @return array
+ */
+ private function getAttributePreset(): array
+ {
+ return [
+ 'serialized_options' => '[]',
+ 'form_key' => 'XxtpPYjm2YPYUlAt',
+ 'frontend_label' => [
+ 0 => 'asdasd',
+ 1 => '',
+ 2 => '',
+ ],
+ 'is_required' => '0',
+ 'update_product_preview_image' => '0',
+ 'use_product_image_for_swatch' => '0',
+ 'is_global' => '0',
+ 'default_value_text' => '512',
+ 'default_value_yesno' => '1',
+ 'default_value_date' => '1/1/70',
+ 'default_value_textarea' => '512',
+ 'is_unique' => '0',
+ 'is_used_in_grid' => '1',
+ 'is_visible_in_grid' => '1',
+ 'is_filterable_in_grid' => '1',
+ 'is_searchable' => '0',
+ 'is_comparable' => '0',
+ 'is_filterable' => '0',
+ 'is_filterable_in_search' => '0',
+ 'position' => '0',
+ 'is_used_for_promo_rules' => '0',
+ 'is_html_allowed_on_front' => '1',
+ 'is_visible_on_front' => '0',
+ 'used_in_product_listing' => '0',
+ 'used_for_sort_by' => '0',
+ 'attribute_code' => 'test_many_swatches',
+ ];
+ }
+
+ /**
+ * Data provider for large swatches amount test.
+ *
+ * @return array
+ */
+ public function getLargeSwatchesAmountAttributeData(): array
+ {
+ $maxInputVars = ini_get('max_input_vars');
+ // Each option is at least 7 variables array for a visual swatch.
+ // Set options count to exceed max_input_vars by 20 options (140 variables).
+ $swatchVisualOptionsCount = (int)floor($maxInputVars / 7) + 20;
+ $swatchTextOptionsCount = (int)floor($maxInputVars / 4) + 80;
+ return [
+ 'visual swatches' => $this->getSwatchVisualDataSet($swatchVisualOptionsCount),
+ 'text swatches' => $this->getSwatchTextDataSet($swatchTextOptionsCount),
+ ];
+ }
+
+ /**
+ * Test attribute saving with large amount of options exceeding maximum allowed by max_input_vars limit.
+ *
+ * @dataProvider getLargeSwatchesAmountAttributeData()
+ * @param array $attributeData
+ * @param int $expectedOptionsCount
+ * @param array $expectedLabels
+ * @return void
+ */
+ public function testLargeOptionsDataSet(
+ array $attributeData,
+ int $expectedOptionsCount,
+ array $expectedLabels
+ ) {
+ $this->getRequest()->setPostValue($attributeData);
+ $this->dispatch('backend/catalog/product_attribute/save');
+ $entityTypeId = $this->_objectManager->create(
+ \Magento\Eav\Model\Entity::class
+ )->setType(
+ \Magento\Catalog\Model\Product::ENTITY
+ )->getTypeId();
+
+ /** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
+ $attribute = $this->_objectManager->create(
+ \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
+ )->setEntityTypeId(
+ $entityTypeId
+ );
+ try {
+ $attribute->loadByCode($entityTypeId, 'test_many_swatches');
+ $options = $attribute->getOptions();
+ // assert that all options are saved without truncation
+ $this->assertEquals(
+ $expectedOptionsCount,
+ count($options),
+ 'Expected options count does not match (regarding first empty option for non-required attribute)'
+ );
+
+ foreach ($expectedLabels as $optionOrderNum => $label) {
+ $this->assertEquals(
+ $label,
+ $options[$optionOrderNum]->getLabel(),
+ "Label for option #{$optionOrderNum} does not match expected."
+ );
+ }
+ } catch (LocalizedException $e) {
+ $this->fail('Test failed with exception on attribute model load: ' . $e);
+ }
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Controller/Rest/SchemaRequestProcessorTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Controller/Rest/SchemaRequestProcessorTest.php
new file mode 100644
index 0000000000000..70437bcffbbc1
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Webapi/Controller/Rest/SchemaRequestProcessorTest.php
@@ -0,0 +1,56 @@
+dispatch($path);
+ ob_end_clean();
+ $schema = $this->getResponse()->getBody();
+
+ // Check that an HTTP 200 response status is visible in the schema.
+ $this->assertRegExp('/200 Success/', $schema);
+ }
+
+ /**
+ * Response getter
+ *
+ * @return \Magento\Framework\App\ResponseInterface
+ */
+ public function getResponse()
+ {
+ if (!$this->_response) {
+ $this->_response = $this->_objectManager->get(\Magento\Framework\Webapi\Rest\Response::class);
+ }
+ return $this->_response;
+ }
+
+ /**
+ * @return array
+ */
+ public function schemaRequestProvider()
+ {
+ return [
+ ['rest/schema'],
+ ['rest/schema?services=all'],
+ ['rest/all/schema?services=all'],
+ ['rest/default/schema?services=all'],
+ ['rest/schema?services=all'],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Weee/Model/ResourceModel/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Weee/Model/ResourceModel/AttributeTest.php
new file mode 100644
index 0000000000000..857261a01e857
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Weee/Model/ResourceModel/AttributeTest.php
@@ -0,0 +1,115 @@
+objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+ $this->model = $this->objectManager->get(
+ \Magento\Catalog\Model\ResourceModel\Attribute::class
+ );
+ $this->productResource = $this->objectManager->get(
+ \Magento\Catalog\Model\ResourceModel\Product::class
+ );
+ $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
+ $this->metadataPool = $this->objectManager->get(MetadataPool::class);
+ }
+
+ /**
+ * Retrieve eav attribute row.
+ *
+ * @param int $entityTypeId
+ * @param int $attributeSetId
+ * @param int $attributeId
+ * @return array|false
+ */
+ private function getEavEntityAttributeRow($entityTypeId, $attributeSetId, $attributeId)
+ {
+ $connection = $this->productResource->getConnection();
+ $select = $connection->select()
+ ->from($this->productResource->getTable('eav_entity_attribute'))
+ ->where('attribute_set_id=?', $attributeSetId)
+ ->where('attribute_id=?', $attributeId)
+ ->where('entity_type_id=?', $entityTypeId);
+
+ return $connection->fetchRow($select);
+ }
+
+ /**
+ * Test to delete entity attribute with type "Fixed Product Tax".
+ *
+ * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php
+ * @return void
+ */
+ public function testDeleteEntityFixedTax()
+ {
+ /* @var EavAttribute $attribute */
+ $attribute = $this->objectManager->get(EavAttribute::class);
+ $attribute->loadByCode(\Magento\Catalog\Model\Product::ENTITY, 'fixed_product_attribute');
+
+ $entityEavAttributeRow = $this->getEavEntityAttributeRow(
+ $attribute->getEntityTypeId(),
+ 4,
+ $attribute->getId()
+ );
+ $this->assertNotEmpty(
+ $entityEavAttributeRow['entity_attribute_id'],
+ 'The record is absent in table `eav_entity_attribute` for `fixed_product_attribute`'
+ );
+
+ $attribute->setData('entity_attribute_id', $entityEavAttributeRow['entity_attribute_id']);
+ $this->model->deleteEntity($attribute);
+
+ $entityEavAttributeRow = $this->getEavEntityAttributeRow(
+ $attribute->getEntityTypeId(),
+ 4,
+ $attribute->getId()
+ );
+ $this->assertEmpty(
+ $entityEavAttributeRow,
+ 'The record is not remove from table `eav_entity_attribute` for `fixed_product_attribute`'
+ );
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php
new file mode 100644
index 0000000000000..644405537db9f
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php
@@ -0,0 +1,34 @@
+create(\Magento\Eav\Model\Entity\Attribute\Set::class);
+
+$entityType = $objectManager->create(\Magento\Eav\Model\Entity\Type::class)->loadByCode('catalog_product');
+$defaultSetId = $objectManager->create(\Magento\Catalog\Model\Product::class)->getDefaultAttributeSetid();
+
+$attributeGroupId = $attributeSet->getDefaultGroupId($entityType->getDefaultAttributeSetId());
+
+$attributeData = [
+ 'entity_type_id' => $entityType->getId(),
+ 'attribute_code' => 'fixed_product_attribute',
+ 'backend_model' => 'Magento\Weee\Model\Attribute\Backend\Weee\Tax',
+ 'is_required' => 0,
+ 'is_user_defined' => 1,
+ 'is_static' => 1,
+ 'attribute_set_id' => $defaultSetId,
+ 'attribute_group_id' => $attributeGroupId,
+];
+
+/** @var \Magento\Catalog\Model\Entity\Attribute $attribute */
+// $attribute = $objectManager->create(\Magento\Catalog\Model\Entity\Attribute::class);
+$attribute = $objectManager->create(\Magento\Eav\Model\Entity\Attribute::class);
+$attribute->setData($attributeData);
+$attribute->save();
diff --git a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute_rollback.php
new file mode 100644
index 0000000000000..1d6e15b2e9a97
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute_rollback.php
@@ -0,0 +1,14 @@
+get(\Magento\Eav\Model\Entity\Attribute::class);
+$attribute->loadByCode(\Magento\Catalog\Model\Product::ENTITY, 'fixed_product_attribute');
+$attribute->delete();
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/remaining-characters.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/remaining-characters.test.js
new file mode 100644
index 0000000000000..3b64385a8894b
--- /dev/null
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/remaining-characters.test.js
@@ -0,0 +1,84 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+/* eslint-disable max-nested-callbacks */
+define([
+ 'Magento_Catalog/js/product/remaining-characters',
+ 'jquery'
+], function (remainingCharacters, $) {
+ 'use strict';
+
+ describe('Magento_Catalog/js/product/remaining-characters', function () {
+ var widget,
+ note;
+
+ beforeEach(function () {
+ widget = $(' ');
+ note = $('
');
+ $('body').append(widget).append(note);
+
+ widget.remainingCharacters({
+ maxLength: '10',
+ noteSelector: '.note_1',
+ counterSelector: '.note_1 .character-counter'
+ });
+ });
+
+ afterEach(function () {
+ widget.remove();
+ note.remove();
+ });
+
+ describe('Note text is updated on input change', function () {
+ it('check empty input', function () {
+ var testData = {
+ input: '',
+ action: 'change',
+ expectedText: '(10 remaining)'
+ };
+
+ widget.val(testData.input);
+ widget.trigger(testData.action);
+ expect(note.find('.character-counter').text()).toBe(testData.expectedText);
+ });
+
+ it('check input length less than character limit', function () {
+ var testData = {
+ input: 'abc',
+ action: 'change',
+ expectedText: '(7 remaining)'
+ };
+
+ widget.val(testData.input);
+ widget.trigger(testData.action);
+ expect(note.find('.character-counter').text()).toBe(testData.expectedText);
+ });
+
+ it('check input length equals character limit', function () {
+ var testData = {
+ input: 'abcdefghij',
+ action: 'paste',
+ expectedText: '(0 remaining)'
+ };
+
+ widget.val(testData.input);
+ widget.trigger(testData.action);
+ expect(note.find('.character-counter').text()).toBe(testData.expectedText);
+ });
+
+ it('check input length greater than character limit', function () {
+ var testData = {
+ input: 'abcdefghijkl',
+ action: 'change',
+ expectedText: '(2 too many)'
+ };
+
+ widget.val(testData.input);
+ widget.trigger(testData.action);
+ expect(note.find('.character-counter').text()).toBe(testData.expectedText);
+ });
+ });
+ });
+});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
index 5530666c7ed70..ecb150bc15431 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
@@ -12,22 +12,11 @@ define([
var injector = new Squire(),
mocks = {
- 'Magento_Catalog/js/product/storage/ids-storage': {
- name: 'IdsStorage',
- initialize: jasmine.createSpy().and.returnValue({})
- },
'Magento_Catalog/js/product/storage/data-storage': {},
'Magento_Catalog/js/product/storage/ids-storage-compare': {}
},
- obj;
-
- beforeEach(function (done) {
- injector.mock(mocks);
- injector.require(['Magento_Catalog/js/product/storage/storage-service'], function (insance) {
- obj = insance;
- done();
- });
- });
+ obj,
+ utils;
describe('Magento_Catalog/js/product/storage/storage-service', function () {
var config = {
@@ -36,6 +25,19 @@ define([
},
storage;
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Catalog/js/product/storage/ids-storage',
+ 'Magento_Catalog/js/product/storage/storage-service',
+ 'mageUtils'
+ ], function (IdsStorage, instance, mageUtils) {
+ obj = instance;
+ utils = mageUtils;
+ done();
+ });
+ });
+
describe('"createStorage" method', function () {
it('create new storage', function () {
obj.processSubscribers = jasmine.createSpy();
@@ -66,5 +68,54 @@ define([
expect(typeof obj.getStorage(config.namespace)).toBe('object');
});
});
+ describe('"add" method', function () {
+ var storageValue;
+
+ beforeEach(function () {
+ storage = new obj.createStorage(config);
+ storageValue = {
+ 'property1': 1
+ };
+
+ storage.set(storageValue);
+ });
+
+ it('method exists', function () {
+ expect(storage.add).toBeDefined();
+ expect(typeof storage.add).toEqual('function');
+ });
+
+ it('update value', function () {
+ spyOn(utils, 'copy').and.callThrough();
+ expect(storage.get()).toEqual(storageValue);
+
+ storageValue = {
+ 'property2': 2
+ };
+
+ storage.add(storageValue);
+
+ expect(utils.copy).toHaveBeenCalled();
+ expect(storage.get()).toEqual(
+ {
+ 'property1': 1,
+ 'property2': 2
+ }
+ );
+ });
+
+ it('add empty value', function () {
+ spyOn(utils, 'copy').and.callThrough();
+
+ storage.add({});
+
+ expect(utils.copy).not.toHaveBeenCalled();
+ expect(storage.get()).toEqual(
+ {
+ 'property1': 1
+ }
+ );
+ });
+ });
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
index 390c5aa89fcc7..e1d853e0b1b55 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
@@ -5,19 +5,50 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'Magento_Ui/js/form/element/abstract'
-], function (Abstract) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/abstract', function () {
- var params, model;
-
- beforeEach(function () {
+ var injector = new Squire(),
+ providerMock = {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ },
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return providerMock;
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ dataScope = 'abstract',
params = {
- dataScope: 'abstract'
- };
- model = new Abstract(params);
- model.source = jasmine.createSpyObj('model.source', ['set']);
+ provider: 'provName',
+ name: '',
+ index: 'testIndex',
+ dataScope: dataScope,
+ service: {
+ template: 'ui/form/element/helper/service'
+ }
+ },
+ model;
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/abstract',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ model = new Constr(params);
+
+ done();
+ });
});
describe('initialize method', function () {
@@ -50,8 +81,10 @@ define([
var expectedValue = 1;
spyOn(model, 'getInitialValue').and.returnValue(expectedValue);
+ model.service = true;
expect(model.setInitialValue()).toEqual(model);
expect(model.getInitialValue).toHaveBeenCalled();
+ expect(model.source.set).toHaveBeenCalledWith('data.use_default.' + model.index, 0);
expect(model.value()).toEqual(expectedValue);
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/boolean.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/boolean.test.js
index 4f64d1f53aa21..282badea0889f 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/boolean.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/boolean.test.js
@@ -6,18 +6,45 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'Magento_Ui/js/form/element/boolean'
-], function (BooleanElement) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/boolean', function () {
- var params, model;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model,
+ dataScope = 'dataScope';
- beforeEach(function () {
- params = {
- dataScope: 'abstract'
- };
- model = new BooleanElement(params);
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/boolean',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ });
+
+ done();
+ });
});
describe('getInitialValue method', function () {
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date-time.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date-time.test.js
index bd314bcc85736..01208a083a696 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date-time.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date-time.test.js
@@ -6,23 +6,52 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'Magento_Ui/js/form/element/date',
- 'mageUtils',
- 'moment'
-], function (DateElement, utils, moment) {
+ 'squire'
+], function (Squire) {
'use strict';
- describe('Magento_Ui/js/form/element/date', function () {
- var params, model;
-
- beforeEach(function () {
- params = {
- dataScope: 'abstract',
- options: {
- showsTime: true
- }
- };
- model = new DateElement(params);
+ describe('Magento_Ui/js/form/element/date-time', function () {
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model, utils, moment,
+ dataScope = 'abstract';
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/date',
+ 'mageUtils',
+ 'moment',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr, mageUtils, m) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope,
+ options: {
+ showsTime: true
+ }
+ });
+ utils = mageUtils;
+ moment = m;
+
+ done();
+ });
});
it('Check prepareDateTimeFormats function', function () {
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js
index 0b2290ba7a831..f9d379407fcbd 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/date.test.js
@@ -4,19 +4,50 @@
*/
define([
- 'Magento_Ui/js/form/element/date',
- 'mageUtils'
-], function (DateElement, utils) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/date', function () {
- var params, model;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model, utils,
+ dataScope = 'abstract';
- beforeEach(function () {
- params = {
- dataScope: 'abstract'
- };
- model = new DateElement(params);
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/date',
+ 'mageUtils',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr, mageUtils) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope,
+ options: {
+ showsTime: true
+ }
+ });
+ utils = mageUtils;
+
+ done();
+ });
});
it('Check prepareDateTimeFormats function', function () {
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/file-uploader.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/file-uploader.test.js
index 03ee43835f961..9ae83d6c36c63 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/file-uploader.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/file-uploader.test.js
@@ -7,28 +7,65 @@
define([
'jquery',
- 'Magento_Ui/js/form/element/file-uploader'
-], function ($, FileUploader) {
+ 'squire'
+], function ($, Squire) {
'use strict';
describe('Magento_Ui/js/form/element/file-uploader', function () {
- var component;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/core/events': {
+ on: jasmine.createSpy()
+ },
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ component,
+ dataScope = 'dataScope',
+ originalJQuery = jQuery.fn;
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/file-uploader',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ component = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ });
- beforeEach(function () {
- component = new FileUploader({
- dataScope: 'abstract'
+ done();
});
});
+ afterEach(function () {
+ jQuery.fn = originalJQuery;
+ });
+
describe('initUploader method', function () {
it('creates instance of file uploader', function () {
var elem = document.createElement('input');
- spyOn($.fn, 'fileupload');
+ spyOn(jQuery.fn, 'fileupload');
component.initUploader(elem);
- expect($.fn.fileupload).toHaveBeenCalled();
+ expect(jQuery.fn.fileupload).toHaveBeenCalled();
+
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js
index 9bddfcd35642a..96bca1bbd8c6b 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js
@@ -5,19 +5,45 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'uiRegistry',
- 'Magento_Ui/js/form/element/post-code'
-], function (registry, PostCodeElement) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/post-code', function () {
- var params, model;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model,
+ dataScope = 'post-code';
- beforeEach(function () {
- params = {
- dataScope: 'post-code'
- };
- model = new PostCodeElement(params);
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/post-code',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ });
+
+ done();
+ });
});
describe('update method', function () {
@@ -31,9 +57,9 @@ define([
}
};
- spyOn(registry, 'get').and.returnValue(country);
+ spyOn(mocks['Magento_Ui/js/lib/registry/registry'], 'get').and.returnValue(country);
model.update(value);
- expect(registry.get).toHaveBeenCalled();
+ expect(mocks['Magento_Ui/js/lib/registry/registry'].get).toHaveBeenCalled();
expect(model.error()).toEqual(false);
expect(model.required()).toEqual(false);
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js
index 8e76d8e90729d..a36d3b0b7fefa 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js
@@ -5,19 +5,46 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'uiRegistry',
- 'Magento_Ui/js/form/element/region'
-], function (registry, RegionElement) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/region', function () {
- var params, model;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model,
+ dataScope = 'dataScope';
- beforeEach(function () {
- params = {
- dataScope: 'region'
- };
- model = new RegionElement(params);
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/region',
+ 'knockoutjs/knockout-es5',
+ 'Magento_Ui/js/lib/knockout/extender/observable_array'
+ ], function (Constr) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ });
+
+ done();
+ });
});
describe('update method', function () {
@@ -31,9 +58,9 @@ define([
}
};
- spyOn(registry, 'get').and.returnValue(country);
+ spyOn(mocks['Magento_Ui/js/lib/registry/registry'], 'get').and.returnValue(country);
model.update(value);
- expect(registry.get).toHaveBeenCalled();
+ expect(mocks['Magento_Ui/js/lib/registry/registry'].get).toHaveBeenCalled();
expect(model.error()).toEqual(false);
expect(model.required()).toEqual(false);
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/select.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/select.test.js
index 6eac936974595..fffb045e8ce41 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/select.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/select.test.js
@@ -5,18 +5,49 @@
/*eslint max-nested-callbacks: 0*/
define([
- 'Magento_Ui/js/form/element/select'
-], function (SelectElement) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/select', function () {
- var params, model;
-
- beforeEach(function () {
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ options: jasmine.createSpy(),
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy(),
+ 'Magento_Ui/js/core/renderer/layout': jasmine.createSpy()
+ },
+ dataScope = 'select',
params = {
- dataScope: 'select'
- };
- model = new SelectElement(params);
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ },
+ model;
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/select',
+ 'knockoutjs/knockout-es5',
+ 'Magento_Ui/js/lib/knockout/extender/observable_array'
+ ], function (Constr) {
+ model = new Constr(params);
+
+ done();
+ });
});
describe('initialize method', function () {
@@ -24,26 +55,20 @@ define([
expect(model).toBeDefined();
});
it('check for chainable', function () {
- spyOn(model, 'initInput');
spyOn(model, 'initFilter');
expect(model.initialize(params)).toEqual(model);
- expect(model.initInput).not.toHaveBeenCalled();
expect(model.initFilter).not.toHaveBeenCalled();
});
it('check for call initInput', function () {
- spyOn(model, 'initInput');
spyOn(model, 'initFilter');
model.customEntry = true;
expect(model.initialize(params)).toEqual(model);
- expect(model.initInput).toHaveBeenCalled();
expect(model.initFilter).not.toHaveBeenCalled();
});
it('check for call initFilter', function () {
- spyOn(model, 'initInput');
spyOn(model, 'initFilter');
model.filterBy = true;
expect(model.initialize(params)).toEqual(model);
- expect(model.initInput).not.toHaveBeenCalled();
expect(model.initFilter).toHaveBeenCalled();
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/single-checkbox-use-config.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/single-checkbox-use-config.test.js
new file mode 100644
index 0000000000000..f63e0adda1e17
--- /dev/null
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/single-checkbox-use-config.test.js
@@ -0,0 +1,78 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+/*eslint max-nested-callbacks: 0*/
+
+define([
+ 'squire'
+], function (Squire) {
+ 'use strict';
+
+ describe('Magento_Ui/js/form/element/single-checkbox-use-config', function () {
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ dataScope = 'dataScope',
+ params = {
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ },
+ model;
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/single-checkbox-use-config',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ model = new Constr(params);
+ done();
+ });
+ });
+
+ describe('initObservable method', function () {
+ it('check for chainable', function () {
+ expect(model.initObservable({})).toEqual(model);
+ });
+ it('check for validation', function () {
+ spyOn(model, 'observe').and.returnValue(model);
+ expect(model.initObservable()).toEqual(model);
+ expect(model.validation).toEqual({});
+ });
+ });
+
+ describe('toggleElement method', function () {
+ it('check with isUseDefault false', function () {
+ spyOn(model, 'isUseDefault').and.returnValue(false);
+ spyOn(model, 'isUseConfig').and.returnValue(false);
+ expect(model.toggleElement()).toEqual(undefined);
+ expect(model.disabled()).toEqual(false);
+ expect(model.source.set).toHaveBeenCalledWith('data.use_default.' + model.index, 0);
+ });
+ it('check with isUseDefault true', function () {
+ spyOn(model, 'isUseDefault').and.returnValue(true);
+ spyOn(model, 'isUseConfig').and.returnValue(false);
+ expect(model.toggleElement()).toEqual(undefined);
+ expect(model.disabled()).toEqual(true);
+ expect(model.source.set).toHaveBeenCalledWith('data.use_default.' + model.index, 1);
+ });
+ });
+ });
+});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/textarea.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/textarea.test.js
index 03b00f0c3a842..60beff8d9b628 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/textarea.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/textarea.test.js
@@ -4,18 +4,46 @@
*/
define([
- 'Magento_Ui/js/form/element/textarea'
-], function (TextareaElement) {
+ 'squire'
+], function (Squire) {
'use strict';
describe('Magento_Ui/js/form/element/textarea', function () {
- var params, model;
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ options: jasmine.createSpy(),
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ model,
+ dataScope = 'dataScope';
- beforeEach(function () {
- params = {
- dataScope: 'textarea'
- };
- model = new TextareaElement(params);
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/textarea',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ model = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope
+ });
+
+ done();
+ });
});
it('check if component defined', function () {
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/ui-select.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/ui-select.test.js
index eec50f0e6bd78..a04687e5b3562 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/ui-select.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/ui-select.test.js
@@ -7,21 +7,53 @@
define([
'underscore',
'uiRegistry',
- 'Magento_Ui/js/form/element/ui-select',
+ 'squire',
'ko'
-], function (_, registry, Constr, ko) {
+], function (_, registry, Squire, ko) {
'use strict';
describe('Magento_Ui/js/form/element/ui-select', function () {
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Ui/js/lib/registry/registry': {
+ /** Method stub. */
+ get: function () {
+ return {
+ get: jasmine.createSpy(),
+ set: jasmine.createSpy()
+ };
+ },
+ create: jasmine.createSpy(),
+ set: jasmine.createSpy(),
+ async: jasmine.createSpy()
+ },
+ '/mage/utils/wrapper': jasmine.createSpy()
+ },
+ obj,
+ dataScope = 'abstract';
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Ui/js/form/element/ui-select',
+ 'knockoutjs/knockout-es5'
+ ], function (Constr) {
+ obj = new Constr({
+ provider: 'provName',
+ name: '',
+ index: '',
+ dataScope: dataScope,
+ options: {
+ showsTime: true
+ }
+ });
- var obj = new Constr({
- name: 'uiSelect',
- dataScope: '',
- provider: 'provider'
- });
+ obj.value = ko.observableArray([]);
+ obj.cacheOptions.plain = [];
- obj.value = ko.observableArray([]);
- obj.cacheOptions.plain = [];
+ done();
+ });
+ });
describe('"initialize" method', function () {
it('Check for defined ', function () {
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
index 0f50cc2b6b9b1..c8ed472769e80 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
@@ -38,14 +38,17 @@ define([
/** Stub */
turnOffInlineTranslation = function () {
manageInlineTranslation(false);
- };
+ },
+ storedConfig;
beforeEach(function () {
+ storedConfig = context.config.config;
$(document.body).append(elWithStaticText);
$(document.body).append(elWithVariable);
});
afterEach(function () {
+ context.config.config = storedConfig;
elWithStaticText.remove();
elWithVariable.remove();
});
diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
index e33b771b3c645..dc4145ec2002c 100644
--- a/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
@@ -47,6 +47,24 @@ class HhvmCompatibilityTest extends \PHPUnit\Framework\TestCase
'serialize_precision',
];
+ /**
+ * Whitelist of variables allowed in files.
+ *
+ * @var array
+ */
+ private $whitelistVarsInFiles = [
+ 'max_input_vars' => [
+ 'integration/testsuite/Magento/Swatches/Controller/Adminhtml/Product/AttributeTest.php',
+ 'integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php',
+ ],
+ ];
+
+ /**
+ * Test allowed directives.
+ *
+ * @SuppressWarnings(PHPMD.NPathComplexity)
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ */
public function testAllowedIniGetSetDirectives()
{
$deniedDirectives = [];
@@ -55,7 +73,19 @@ public function testAllowedIniGetSetDirectives()
if ($fileDirectives) {
$fileDeniedDirectives = array_diff($fileDirectives, $this->allowedDirectives);
if ($fileDeniedDirectives) {
- $deniedDirectives[$file] = array_unique($fileDeniedDirectives);
+ $deniedDirectivesInFile = array_unique($fileDeniedDirectives);
+ foreach ($deniedDirectivesInFile as $key => $deniedDirective) {
+ if (isset($this->whitelistVarsInFiles[$deniedDirective])) {
+ foreach ($this->whitelistVarsInFiles[$deniedDirective] as $whitelistFile) {
+ if (strpos($file, $whitelistFile) !== false) {
+ unset($deniedDirectivesInFile[$key]);
+ }
+ }
+ }
+ }
+ if ($deniedDirectivesInFile) {
+ $deniedDirectives[$file] = $deniedDirectivesInFile;
+ }
}
}
}
diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/Role/RegistryTest.php b/lib/internal/Magento/Framework/Acl/Test/Unit/Role/RegistryTest.php
index 9f7269455555c..d15624637b597 100644
--- a/lib/internal/Magento/Framework/Acl/Test/Unit/Role/RegistryTest.php
+++ b/lib/internal/Magento/Framework/Acl/Test/Unit/Role/RegistryTest.php
@@ -20,6 +20,13 @@ protected function setUp()
$this->model = new Registry();
}
+ /**
+ * @param $roleId
+ * @param $parentRoleId
+ *
+ * @return array
+ * @throws \Zend_Acl_Role_Registry_Exception
+ */
protected function initRoles($roleId, $parentRoleId)
{
$parentRole = $this->createMock(\Zend_Acl_Role_Interface::class);
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
index 47f520d4ee28a..c1ab91e3ccaa6 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
@@ -31,12 +31,24 @@ abstract class EntityChildTestAbstract extends \PHPUnit\Framework\TestCase
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Code\Generator\DefinedClasses */
protected $definedClassesMock;
+ /**
+ * @return mixed
+ */
abstract protected function getSourceClassName();
+ /**
+ * @return mixed
+ */
abstract protected function getResultClassName();
+ /**
+ * @return mixed
+ */
abstract protected function getGeneratorClassName();
+ /**
+ * @return mixed
+ */
abstract protected function getOutputFileName();
protected function setUp()
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php
index 4946f083004ba..f4855a6f69066 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php
@@ -367,6 +367,9 @@ public function testMergeDataObjects($data1, $data2)
$this->assertSame($firstAddressDataObject->getRegion(), $secondAddressDataObject->getRegion());
}
+ /**
+ * @return array
+ */
public function dataProviderForTestMergeDataObjects()
{
return [
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/SortOrderTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/SortOrderTest.php
index 05ecc0bdbcc61..c2ecf51e8afc4 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/SortOrderTest.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/SortOrderTest.php
@@ -37,6 +37,9 @@ public function testItReturnsTheCorrectValuesIfSortOrderIsSet($sortOrder)
$this->assertSame($sortOrder, $this->sortOrder->getDirection());
}
+ /**
+ * @return array
+ */
public function sortOrderDirectionProvider()
{
return [[SortOrder::SORT_ASC], [SortOrder::SORT_DESC]];
@@ -52,6 +55,9 @@ public function testItThrowsAnExceptionIfAnInvalidSortOrderIsSet($invalidDirecti
$this->sortOrder->setDirection($invalidDirection);
}
+ /**
+ * @return array
+ */
public function invalidSortDirectionProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/Stub/ActionStub.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/Stub/ActionStub.php
index ee45842013f64..c157f818242ef 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Action/Stub/ActionStub.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/Stub/ActionStub.php
@@ -8,6 +8,9 @@
class ActionStub extends \Magento\Framework\App\Action\Action
{
+ /**
+ * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
+ */
public function execute()
{
// Empty method stub for test
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php b/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php
index 678bb7a85272f..1813ff147190c 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php
@@ -276,6 +276,9 @@ public function testDetectDesignByRequest($value, $callNum, $callNum2)
$this->object->detectDesign($requestMock);
}
+ /**
+ * @return array
+ */
public function detectDesignByRequestDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php
index 1e2947084ee6b..32e495ed00a82 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php
@@ -135,7 +135,7 @@ public function testCreateFilesystemDriverPool()
);
/** @var \Magento\Framework\Filesystem\DriverPool $result */
$this->assertInstanceOf(\Magento\Framework\Filesystem\DriverPool::class, $result);
- $this->assertInstanceof($driverClass, $result->getDriver('custom'));
+ $this->assertInstanceOf($driverClass, $result->getDriver('custom'));
}
public function testGetParams()
@@ -189,6 +189,9 @@ public function testIsDeveloperMode($modeFromEnvironment, $modeFromDeployment, $
$this->assertEquals($isDeveloper, $bootstrap->isDeveloperMode());
}
+ /**
+ * @return array
+ */
public function testIsDeveloperModeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/PoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/PoolTest.php
index fdb962d7d295e..bfa37311884ba 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/PoolTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/PoolTest.php
@@ -105,6 +105,9 @@ public function testInitializationParams(
$model->current();
}
+ /**
+ * @return array
+ */
public function initializationParamsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/ConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/ConfigTest.php
index 74a92d54f1934..380c45e383128 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/ConfigTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/ConfigTest.php
@@ -157,6 +157,9 @@ public function testCleanModeMatchingAnyTag($fixtureResultOne, $fixtureResultTwo
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function cleanModeMatchingAnyTagDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/FrontendPoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/FrontendPoolTest.php
index e8c0217b40b2c..bcae099815c98 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/FrontendPoolTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Type/FrontendPoolTest.php
@@ -89,6 +89,9 @@ public function testGet($fixtureConfigData, $inputCacheType, $expectedFrontendId
$this->assertSame($accessProxy, $this->_model->get($inputCacheType));
}
+ /**
+ * @return array
+ */
public function getDataProvider()
{
$configData1 = [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php b/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php
index 236a65611422d..bb5748e0759a0 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php
@@ -147,6 +147,9 @@ public function testSave($inputData, $inputId, $inputTags, $expectedData, $expec
$this->_model->save($inputData, $inputId, $inputTags);
}
+ /**
+ * @return array
+ */
public function saveDataProvider()
{
$configTag = \Magento\Framework\App\Config::CACHE_TAG;
@@ -190,6 +193,9 @@ public function testRemove($result)
$this->assertEquals($result, $this->_model->remove('test_id'));
}
+ /**
+ * @return array
+ */
public function successFailureDataProvider()
{
return ['success' => [true], 'failure' => [false]];
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ConfigPathResolverTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ConfigPathResolverTest.php
index 3cf552ae115a5..3adc4bada0665 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ConfigPathResolverTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ConfigPathResolverTest.php
@@ -55,6 +55,9 @@ public function testResolve($path, $scope, $scopeCode, $type, $expected)
$this->assertSame($expected, $this->model->resolve($path, $scope, $scopeCode, $type));
}
+ /**
+ * @return array
+ */
public function resolveDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php
index f106ba6e151fd..6f137ede742ff 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php
@@ -35,6 +35,9 @@ public function testSetValue($path, $value)
$this->assertEquals($value, $this->_model->getValue($path));
}
+ /**
+ * @return array
+ */
public function setValueDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php
index 3d1cdf0023cc9..29ccd33d73d3b 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php
@@ -65,6 +65,9 @@ public function testGetData($scope, $expected)
$this->assertEquals($expected, $this->config->getData($scope));
}
+ /**
+ * @return array
+ */
public function getDataDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php
index ef2b342936cd9..6159e5cac45e8 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php
@@ -184,6 +184,9 @@ public function testAfterSave($callNumber, $oldValue)
$this->assertInstanceOf(get_class($this->model), $this->model->afterSave());
}
+ /**
+ * @return array
+ */
public function afterSaveDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php
index f94c30b4fa3c8..da9826bfe8c95 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php
@@ -73,6 +73,9 @@ public function testGetValue($scope, $scopeCode = null)
$this->assertTrue($this->appConfig->getValue($path, $scope, $scopeCode ?: $this->scope));
}
+ /**
+ * @return array
+ */
public function getValueDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Console/MaintenanceModeEnablerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Console/MaintenanceModeEnablerTest.php
index ebd47c0dc8936..784cb8136c3ab 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Console/MaintenanceModeEnablerTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Console/MaintenanceModeEnablerTest.php
@@ -88,6 +88,9 @@ public function testFailedTaskWithRestoredModeOnFailure(bool $maintenanceModeEna
}
}
+ /**
+ * @return array
+ */
public function initialAppStateProvider()
{
return [
@@ -96,6 +99,11 @@ public function initialAppStateProvider()
];
}
+ /**
+ * @param bool $isOn
+ *
+ * @return MaintenanceMode
+ */
private function createMaintenanceMode(bool $isOn): MaintenanceMode
{
$maintenanceMode = $this->getMockBuilder(MaintenanceMode::class)
@@ -113,6 +121,9 @@ private function createMaintenanceMode(bool $isOn): MaintenanceMode
return $maintenanceMode;
}
+ /**
+ * @return OutputInterface
+ */
private function createOutput(): OutputInterface
{
$output = $this->getMockBuilder(OutputInterface::class)
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php
index ec678d21a581b..18de140af8428 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php
@@ -34,6 +34,9 @@ public function testSetCode($code, $expectedCode)
$this->assertEquals($expectedCode, $result);
}
+ /**
+ * @return array
+ */
public static function setCodeProvider()
{
$largeCode = 256;
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/CronTest.php b/lib/internal/Magento/Framework/App/Test/Unit/CronTest.php
index e2c77864d8e82..ce1f1661ad827 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/CronTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/CronTest.php
@@ -56,6 +56,9 @@ protected function setUp()
);
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function prepareAreaListMock()
{
$areaMock = $this->createMock(\Magento\Framework\App\Area::class);
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php
index fa41d717cc521..80ab2302dc91c 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php
@@ -127,6 +127,9 @@ public function testKeyCollision(array $data)
$object->get();
}
+ /**
+ * @return array
+ */
public function keyCollisionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
index 7fda8de6d3216..23afbbc73d2b9 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
@@ -29,6 +29,9 @@ public function testIsPub($path, $isExist, $result)
$this->assertSame($result, $model->isPub());
}
+ /**
+ * @return array
+ */
public function isPubDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ErrorHandlerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ErrorHandlerTest.php
index daf3a4bdfab0c..4b904cc2b55bd 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/ErrorHandlerTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/ErrorHandlerTest.php
@@ -32,6 +32,9 @@ public function testHandler($errorNo, $errorStr, $errorFile, $expectedResult)
$this->assertEquals($expectedResult, $this->object->handler($errorNo, $errorStr, $errorFile, 11));
}
+ /**
+ * @return array
+ */
public function handlerProvider()
{
return [
@@ -60,6 +63,9 @@ public function testHandlerException($errorNo, $errorPhrase)
$this->object->handler($errorNo, $errorStr, $errorFile, $errorLine);
}
+ /**
+ * @return array
+ */
public function handlerProviderException()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php
index 15f6bed1ac0d3..23906486634ec 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php
@@ -144,6 +144,9 @@ public function testVaryStringSource($cookieExists)
$this->model->getValue();
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php
index 20ea5d1a3e86f..db200f962f5b5 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php
@@ -241,6 +241,9 @@ function ($value) {
$this->kernel->process($this->responseMock);
}
+ /**
+ * @return array
+ */
public function testProcessSaveCacheDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php
index 74e673c8bfc26..8e1acc89437e2 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php
@@ -45,6 +45,9 @@ public function testGetVersion($packageList, $expectedVersion)
$this->assertEquals($expectedVersion, $productVersion);
}
+ /**
+ * @return array
+ */
public function testGetVersionGitInstallationDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php
index 66eee671e17d3..62445d4244fb7 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php
@@ -259,6 +259,9 @@ public function testGetDistroBaseUrlPath($scriptName, $expected)
$this->assertEquals($expected, Http::getDistroBaseUrlPath(['SCRIPT_NAME' => $scriptName]));
}
+ /**
+ * @return array
+ */
public function getDistroBaseUrlPathDataProvider()
{
return [
@@ -273,6 +276,9 @@ public function getDistroBaseUrlPathDataProvider()
];
}
+ /**
+ * @return array
+ */
public function serverVariablesProvider()
{
$returnValue = [];
@@ -378,6 +384,9 @@ public function testIsSafeMethodFalse($httpMethod)
$this->assertEquals(false, $this->_model->isSafeMethod());
}
+ /**
+ * @return array
+ */
public function httpSafeMethodProvider()
{
return [
@@ -388,6 +397,9 @@ public function httpSafeMethodProvider()
];
}
+ /**
+ * @return array
+ */
public function httpNotSafeMethodProvider()
{
return [
@@ -400,6 +412,9 @@ public function httpNotSafeMethodProvider()
];
}
+ /**
+ * @return array
+ */
public function isSecureDataProvider()
{
/**
@@ -442,6 +457,9 @@ public function testSetPathInfo($requestUri, $basePath, $expected)
$this->assertEquals($expected, $this->_model->getPathInfo());
}
+ /**
+ * @return array
+ */
public function setPathInfoDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php
index 0bdbcccc40b35..e1a2171d2111a 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php
@@ -93,6 +93,9 @@ public function testGet($module, $area, $namespace, $action, $data, $expected)
$this->assertEquals($expected, $this->actionList->get($module, $area, $namespace, $action));
}
+ /**
+ * @return array
+ */
public function getDataProvider()
{
$mockClassName = 'Mock_Action_Class';
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php
index 7a54cf17a87e4..0b7e0e00a2df8 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php
@@ -49,6 +49,9 @@ public function testGetException($scope)
$scopeResolver->get($scope);
}
+ /**
+ * @return array
+ */
public function testGetExceptionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php b/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php
index 3db75f7ec7fb2..ae8a76f7bbc1f 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php
@@ -29,6 +29,9 @@ public function testConstructorExceptions($server, $expectedError)
new SetupInfo($server);
}
+ /**
+ * @return array
+ */
public function constructorExceptionsDataProvider()
{
$docRootErr = 'DOCUMENT_ROOT variable is unavailable.';
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php
index 46eec1e692424..a87322b6e90d9 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php
@@ -87,6 +87,10 @@ public function testEmulateAreaCode()
$this->assertEquals($this->model->getAreaCode(), $areaCode);
}
+ /**
+ * @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
public function emulateAreaCodeCallback()
{
return $this->model->getAreaCode();
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php
index 3074a951159b8..618b67663304a 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php
@@ -271,7 +271,7 @@ public function testLaunchPathAbove()
{
$this->stateMock->expects($this->once())
->method('getMode')
- ->willreturn(State::MODE_DEVELOPER);
+ ->willReturn(State::MODE_DEVELOPER);
$this->requestMock->expects($this->once())
->method('get')
->with('resource')
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/CompressionTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/CompressionTest.php
index 172d0e486dc64..cbb7ed9e5ba6a 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/CompressionTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/CompressionTest.php
@@ -129,12 +129,23 @@ public function testSaveLoad()
$this->assertEquals($this->_testString, $loadedValue);
}
+ /**
+ * @param $data
+ * @param $cacheId
+ *
+ * @return bool
+ */
public static function mockSave($data, $cacheId)
{
self::$_cacheStorage[$cacheId] = $data;
return true;
}
+ /**
+ * @param $cacheId
+ *
+ * @return bool|mixed
+ */
public static function mockLoad($cacheId)
{
return array_key_exists($cacheId, self::$_cacheStorage) ? self::$_cacheStorage[$cacheId] : false;
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php
index 7a3aec7b66488..ba75b7eed52ca 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php
@@ -63,6 +63,9 @@ public function testConstructorException($options)
$this->getMockForAbstractClass(\Magento\Framework\Cache\Backend\Decorator\AbstractDecorator::class, [$options]);
}
+ /**
+ * @return array
+ */
public function constructorExceptionDataProvider()
{
return [
@@ -86,6 +89,9 @@ public function testAllMethods($methodName)
call_user_func([$decorator, $methodName], null, null);
}
+ /**
+ * @return array
+ */
public function allMethodsDataProvider()
{
$return = [];
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php
index daa3081a07c35..435fc6535c1a2 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php
@@ -45,6 +45,9 @@ public function testGetIds(array $ids, array $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function getIdsDataProvider()
{
return [
@@ -64,6 +67,9 @@ public function testGetTags(array $tags)
$this->assertEquals($tags, $actual);
}
+ /**
+ * @return array
+ */
public function getTagsDataProvider()
{
return ['no tags' => [[]], 'multiple tags' => [['tag1', 'tag2']]];
@@ -92,6 +98,9 @@ public function testGetIdsMatchingTags($method, $tags, $expectedInput)
$this->assertEquals($expectedIds, $actualIds);
}
+ /**
+ * @return array
+ */
public function getIdsMatchingTagsDataProvider()
{
return [
@@ -170,6 +179,9 @@ public function testGetMetadatas($cacheId, $expectedInput, $mongoOutput, $expect
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function getMetadatasDataProvider()
{
$time = time();
@@ -237,6 +249,9 @@ public function testLoad($doNotTestValidity)
$this->assertSame($expected, $actual);
}
+ /**
+ * @return array
+ */
public function loadDataProvider()
{
return ['test validity' => [false], 'do not test validity' => [true]];
@@ -322,6 +337,9 @@ public function testClean($mode, $tags, $expectedQuery)
$this->_model->clean($mode, $tags);
}
+ /**
+ * @return array
+ */
public function cleanDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php
index 616c55f600e9e..4b634ae18c7af 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php
@@ -61,6 +61,9 @@ public function testSetBackendException($decorators)
$core->setBackend($this->_mockBackend);
}
+ /**
+ * @return array
+ */
public function setBackendExceptionProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Adapter/ZendTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Adapter/ZendTest.php
index cf16c93cd499a..fb646c7f87622 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Adapter/ZendTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Adapter/ZendTest.php
@@ -93,6 +93,9 @@ public function testCleanException($cleaningMode, $expectedErrorMessage)
$object->clean($cleaningMode);
}
+ /**
+ * @return array
+ */
public function cleanExceptionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Decorator/TagScopeTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Decorator/TagScopeTest.php
index 12774f182d6cd..33105ab52150c 100644
--- a/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Decorator/TagScopeTest.php
+++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Frontend/Decorator/TagScopeTest.php
@@ -128,6 +128,9 @@ public function testCleanModeMatchingAnyTag($fixtureResultOne, $fixtureResultTwo
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function cleanModeMatchingAnyTagDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php
index 658b42e4b972d..eeecc6805ee28 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php
@@ -8,6 +8,11 @@
namespace Magento\Framework\Code\Generator {
use Magento\Framework\Code\Test\Unit\Generator\DefinedClassesTest;
+ /**
+ * @param $className
+ *
+ * @return bool
+ */
function class_exists($className)
{
return DefinedClassesTest::$definedClassesTestActive
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php
index 0f3daa46e1ec3..6462b3806647a 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php
@@ -114,6 +114,9 @@ public function testGeneratePredefinedContentNotSet()
$this->assertEquals($expectedContent, $generatedContent, "Generated content is invalid.");
}
+ /**
+ * @return array
+ */
public function generateDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
index 9c63de1258d15..bc2ba24a2f9fe 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
@@ -111,6 +111,9 @@ public function testWriteResultFileAlreadyExists($resultFileName, $fileExists, $
$this->assertSame($success, $this->_object->writeResultFile($resultFileName, self::FILE_CONTENT));
}
+ /**
+ * @return array
+ */
public function testWriteResultFileAlreadyExistsDataProvider()
{
return [
@@ -202,6 +205,9 @@ public function testFileExists($fileName, $exists)
$this->assertSame($exists, $this->_object->fileExists($fileName));
}
+ /**
+ * @return array
+ */
public function fileExistsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
index 3052f682d82cb..c175c0fe9be85 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
@@ -129,6 +129,9 @@ public function testGenerateClassWithExistName($fileExists)
);
}
+ /**
+ * @return array
+ */
public function trueFalseDataProvider()
{
return [[true], [false]];
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/NameBuilderTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/NameBuilderTest.php
index 588cdfa1d4f7f..b8d49f64569f9 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/NameBuilderTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/NameBuilderTest.php
@@ -29,6 +29,9 @@ public function testBuildClassName($parts, $expected)
$this->assertEquals($expected, $this->nameBuilder->buildClassName($parts));
}
+ /**
+ * @return array
+ */
public function buildClassNameDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php
index 64bcb8970612e..e465e01916690 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php
@@ -263,6 +263,9 @@ public function testIsCompatibleType($requiredType, $actualType, $expectedResult
$this->assertEquals($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function testIsCompatibleTypeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/TypeDuplicationTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/TypeDuplicationTest.php
index a82c88e3e18b1..b17b10106f8a9 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/TypeDuplicationTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/TypeDuplicationTest.php
@@ -34,6 +34,9 @@ public function testValidClasses($className)
$this->assertTrue($this->_validator->validate($className));
}
+ /**
+ * @return array
+ */
public function validClassesDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php
index 98de5aefba7ef..947ff0b435418 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php
@@ -40,6 +40,16 @@ class ParentClass
protected $parentOptionalScalar;
+ /**
+ * ParentClass constructor.
+ *
+ * @param ContextObject $contextObject
+ * @param ParentRequiredObject $parentRequiredObject
+ * @param array $parentRequiredScalar
+ * @param ParentOptionalObject|null $parentOptionalObject
+ * @param array $data
+ * @param array $parentOptionalScalar
+ */
public function __construct(
ContextObject $contextObject,
ParentRequiredObject $parentRequiredObject,
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php
index 3912a3e1cc5dd..6773d599f7fc7 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php
@@ -57,6 +57,15 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface
*/
protected $_implOfBInterface;
+ /**
+ * Context constructor.
+ *
+ * @param ClassA $exA
+ * @param ClassB $exB
+ * @param ClassC $exC
+ * @param FirstInterface $interfaceA
+ * @param ImplementationOfSecondInterface $implOfBInterface
+ */
public function __construct(
\ClassA $exA,
\ClassB $exB,
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php
index 8a9d9866126bf..0aa100fda0caf 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php
@@ -14,6 +14,11 @@ class Test extends \Magento\SomeModule\Model\Three\Test
*/
protected $_proxy;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ */
public function __construct(\Magento\SomeModule\Model\Proxy $proxy)
{
parent::__construct($proxy);
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php
index 4701e76f08c59..85133aa4ad851 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php
@@ -15,6 +15,12 @@ class Test extends \Magento\SomeModule\Model\One\Test
*/
protected $_factory;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ * @param \Magento\SomeModule\Model\ElementFactory $factory
+ */
public function __construct(
\Magento\SomeModule\Model\Proxy $proxy,
\Magento\SomeModule\Model\ElementFactory $factory
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/One/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/One/Test.php
index 90f5d40ab726d..eeeb557a99a12 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/One/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/One/Test.php
@@ -13,6 +13,11 @@ class Test
*/
protected $_proxy;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ */
public function __construct(\Magento\SomeModule\Model\Proxy $proxy)
{
$this->_proxy = $proxy;
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php
index 0c736710f5c4e..a58d9a0d628bc 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php
@@ -15,6 +15,12 @@ class Test extends \Magento\SomeModule\Model\One\Test
*/
protected $_factory;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ * @param \Magento\SomeModule\Model\ElementFactory $factory
+ */
public function __construct(
\Magento\SomeModule\Model\Proxy $proxy,
\Magento\SomeModule\Model\ElementFactory $factory
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Three/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Three/Test.php
index d080034ef978e..5c0013508d00a 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Three/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Three/Test.php
@@ -20,6 +20,12 @@ class Test extends \Magento\SomeModule\Model\Two\Test
*/
protected $_proxy;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ * @param \Magento\SomeModule\Model\ElementFactory $factory
+ */
public function __construct(
\Magento\SomeModule\Model\Proxy $proxy,
\Magento\SomeModule\Model\ElementFactory $factory
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Two/Test.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Two/Test.php
index dee0b216b7641..9cec10a1cd36f 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Two/Test.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Two/Test.php
@@ -14,6 +14,12 @@ class Test extends \Magento\SomeModule\Model\One\Test
*/
protected $_proxy;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Model\Proxy $proxy
+ * @param array $data
+ */
public function __construct(\Magento\SomeModule\Model\Proxy $proxy, $data = [])
{
$this->_proxy = $proxy;
diff --git a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
index 4ca43591c96ff..74f8c1dcdb875 100644
--- a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
+++ b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
@@ -92,6 +92,9 @@ public function testIsMagentoRoot($packageName, $expected)
$this->assertEquals($expected, $this->composerInformation->isMagentoRoot());
}
+ /**
+ * @return array
+ */
public function isMagentoRootDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php b/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php
index 801d99373bc50..15ceb0c6c2755 100644
--- a/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php
+++ b/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php
@@ -69,7 +69,7 @@ function ($input, $buffer) {
$buffer->writeln($output);
}
);
- $composerApp->Expects($this->at(6))->method('run')->willReturnCallback(
+ $composerApp->expects($this->at(6))->method('run')->willReturnCallback(
function ($input, $buffer) {
$output = 'magento/package-d requires magento/package-c (1.0)' . PHP_EOL .
'magento/project-community-edition requires magento/package-a (1.0)' . PHP_EOL;
diff --git a/lib/internal/Magento/Framework/Config/Composer/Package.php b/lib/internal/Magento/Framework/Config/Composer/Package.php
index a8ff6ac724c3f..5e75f0be4b104 100644
--- a/lib/internal/Magento/Framework/Config/Composer/Package.php
+++ b/lib/internal/Magento/Framework/Config/Composer/Package.php
@@ -83,7 +83,7 @@ public function get($propertyPath, $filter = null)
* @param int $index
* @return mixed
*/
- private function traverseGet(\StdClass $json, array $chain, $index = 0)
+ private function traverseGet(\stdClass $json, array $chain, $index = 0)
{
$property = $chain[$index];
if (!property_exists($json, $property)) {
diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Converter/DomTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Converter/DomTest.php
index 09366c91a73a3..2ef915dc836df 100644
--- a/lib/internal/Magento/Framework/Config/Test/Unit/Converter/DomTest.php
+++ b/lib/internal/Magento/Framework/Config/Test/Unit/Converter/DomTest.php
@@ -24,6 +24,9 @@ public function testConvert($sourceFile, $resultFile)
$this->assertEquals($resultFile, $converterDom->convert($dom));
}
+ /**
+ * @return array
+ */
public function convertDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php
index 619135f9c7038..747560b29dfc1 100644
--- a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php
+++ b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php
@@ -47,6 +47,9 @@ public function testSetWrongKey($key, $expectedException)
$configData->set($key, 'value');
}
+ /**
+ * @return array
+ */
public function setWrongKeyDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php
index 380d095d85e64..f8c518d35add7 100644
--- a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php
+++ b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php
@@ -81,6 +81,9 @@ public function testGetConfigByPath($path, $expectedValue, $default)
$this->assertEquals($expectedValue, $this->_model->get($path, $default));
}
+ /**
+ * @return array
+ */
public function getConfigByPathDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Dom/NodePathMatcherTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/NodePathMatcherTest.php
index 94197fe737918..a2fbdce771f94 100644
--- a/lib/internal/Magento/Framework/Config/Test/Unit/Dom/NodePathMatcherTest.php
+++ b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/NodePathMatcherTest.php
@@ -32,6 +32,9 @@ public function testMatch($pathPattern, $xpathSubject, $expectedResult)
$this->assertSame($expectedResult, $actualResult);
}
+ /**
+ * @return array
+ */
public function getNodeInfoDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php
index 77a7f869fb941..27290e1f67e6d 100644
--- a/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php
+++ b/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php
@@ -30,6 +30,14 @@ class GenericSchemaLocatorTest extends \PHPUnit\Framework\TestCase
*/
private $moduleReaderMock;
+ /**
+ * @param ModuleDirReader $reader
+ * @param $moduleName
+ * @param $mergeSchema
+ * @param $perFileSchema
+ *
+ * @return GenericSchemaLocator
+ */
private function createNewSchemaLocatorInstance(ModuleDirReader $reader, $moduleName, $mergeSchema, $perFileSchema)
{
return new GenericSchemaLocator($reader, $moduleName, $mergeSchema, $perFileSchema);
diff --git a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectTest.php b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectTest.php
index 65e7ee489e84c..881166b3e2218 100644
--- a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectTest.php
+++ b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectTest.php
@@ -75,6 +75,9 @@ public function testSetPath()
);
}
+ /**
+ * @return array
+ */
public function httpRedirectResponseStatusCodes()
{
return [
diff --git a/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php b/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php
index 87adadbd34e3b..2b53541022505 100644
--- a/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php
+++ b/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php
@@ -69,7 +69,7 @@ public function testCreateRouteNegative()
{
$this->objectManager->expects($this->once())
->method('create')
- ->will($this->returnValue(new \StdClass()));
+ ->will($this->returnValue(new \stdClass()));
$object = new Factory($this->objectManager);
$object->createRoute(
diff --git a/lib/internal/Magento/Framework/Convert/Test/Unit/XmlTest.php b/lib/internal/Magento/Framework/Convert/Test/Unit/XmlTest.php
index 5af254fcdd4dc..4102ece70a1ce 100644
--- a/lib/internal/Magento/Framework/Convert/Test/Unit/XmlTest.php
+++ b/lib/internal/Magento/Framework/Convert/Test/Unit/XmlTest.php
@@ -31,6 +31,9 @@ public function testXmlToAssoc()
);
}
+ /**
+ * @return string
+ */
protected function getXml()
{
return <<assertEquals($select, $result);
}
+ /**
+ * @return array
+ */
public function matchProvider()
{
return [[true], [false]];
diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Select/ColumnsRendererTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Select/ColumnsRendererTest.php
index 143ee42ebfa51..889ca58f9229d 100644
--- a/lib/internal/Magento/Framework/DB/Test/Unit/Select/ColumnsRendererTest.php
+++ b/lib/internal/Magento/Framework/DB/Test/Unit/Select/ColumnsRendererTest.php
@@ -77,6 +77,9 @@ public function testRender($columns, $sql, $expectedResult)
$this->assertEquals($expectedResult, $this->model->render($this->selectMock, $sql));
}
+ /**
+ * @return array
+ */
public function renderDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Data/Form/FormKey/Validator.php b/lib/internal/Magento/Framework/Data/Form/FormKey/Validator.php
index 0dbc9c879462e..225ff1fd140a9 100644
--- a/lib/internal/Magento/Framework/Data/Form/FormKey/Validator.php
+++ b/lib/internal/Magento/Framework/Data/Form/FormKey/Validator.php
@@ -5,6 +5,8 @@
*/
namespace Magento\Framework\Data\Form\FormKey;
+use Magento\Framework\Encryption\Helper\Security;
+
/**
* @api
*/
@@ -32,9 +34,7 @@ public function __construct(\Magento\Framework\Data\Form\FormKey $formKey)
public function validate(\Magento\Framework\App\RequestInterface $request)
{
$formKey = $request->getParam('form_key', null);
- if (!$formKey || $formKey !== $this->_formKey->getFormKey()) {
- return false;
- }
- return true;
+
+ return $formKey && Security::compareStrings($formKey, $this->_formKey->getFormKey());
}
}
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/ArrayTypeTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/ArrayTypeTest.php
index 20a0b384bad7e..9387ffbfed7a6 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/ArrayTypeTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/ArrayTypeTest.php
@@ -38,6 +38,9 @@ public function testEvaluateException($inputData)
$this->_model->evaluate($inputData);
}
+ /**
+ * @return array
+ */
public function evaluateExceptionDataProvider()
{
return [
@@ -62,6 +65,9 @@ public function testEvaluate(array $input, array $expected)
$this->assertSame($expected, $actual);
}
+ /**
+ * @return array
+ */
public function evaluateDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/CompositeTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/CompositeTest.php
index bca8bb0d9347f..37d840b40ca47 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/CompositeTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/CompositeTest.php
@@ -60,6 +60,9 @@ public function testEvaluateWrongDiscriminator($input, $expectedExceptionMessage
$this->_model->evaluate($input);
}
+ /**
+ * @return array
+ */
public function evaluateWrongDiscriminatorDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/NumberTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/NumberTest.php
index bec2a37545e65..8981f5adb2e1a 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/NumberTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/NumberTest.php
@@ -30,6 +30,9 @@ public function testEvaluateException($input)
$this->_model->evaluate($input);
}
+ /**
+ * @return array
+ */
public function evaluateExceptionDataProvider()
{
return ['no value' => [[]], 'non-numeric value' => [['value' => 'non-numeric']]];
@@ -47,6 +50,9 @@ public function testEvaluate($input, $expected)
$this->assertSame($expected, $actual);
}
+ /**
+ * @return array
+ */
public function evaluateDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php
index 5eea3f8790711..63eccb098bf0d 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php
@@ -296,6 +296,9 @@ public function testPrintLogQueryPrinting($printQuery, $printFlag, $query, $expe
$this->collection->printLogQuery($printQuery, false, $query);
}
+ /**
+ * @return array
+ */
public function printLogQueryPrintingDataProvider()
{
return [
@@ -319,6 +322,9 @@ public function testPrintLogQueryLogging($logQuery, $logFlag, $expectedCalls)
$this->collection->printLogQuery(false, $logQuery, 'some_query');
}
+ /**
+ * @return array
+ */
public function printLogQueryLoggingDataProvider()
{
return [
@@ -527,6 +533,9 @@ public function testDistinct($flag, $expectedFlag)
$this->collection->distinct($flag);
}
+ /**
+ * @return array
+ */
public function distinctDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/DateTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/DateTest.php
index a34fdf21f7ab4..793161dfc5cbb 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/DateTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/DateTest.php
@@ -80,6 +80,9 @@ public function testGetElementHtmlDateFormat($fieldName)
$this->model->getElementHtml();
}
+ /**
+ * @return array
+ */
public function providerGetElementHtmlDateFormat()
{
return [
@@ -88,6 +91,11 @@ public function providerGetElementHtmlDateFormat()
];
}
+ /**
+ * @param $exactly
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getFormMock($exactly)
{
$functions = ['getFieldNameSuffix', 'getHtmlIdPrefix', 'getHtmlIdSuffix'];
diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKey/ValidatorTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKey/ValidatorTest.php
index 9e23610b97668..8b9de2c63953f 100644
--- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKey/ValidatorTest.php
+++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKey/ValidatorTest.php
@@ -50,6 +50,9 @@ public function testValidate($formKey, $expected)
$this->assertEquals($expected, $this->_model->validate($this->_requestMock));
}
+ /**
+ * @return array
+ */
public function validateDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php
index 6dc0d4a1d4628..6a65124b15f4c 100644
--- a/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php
+++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php
@@ -30,6 +30,11 @@ protected function setUp()
$this->_key = substr(__CLASS__, -32, 32);
}
+ /**
+ * @param $length
+ *
+ * @return bool|string
+ */
protected function _getRandomString($length)
{
$result = '';
@@ -64,18 +69,33 @@ protected function _requireCipherInfo()
}
}
+ /**
+ * @param $cipherName
+ * @param $modeName
+ *
+ * @return mixed
+ */
protected function _getKeySize($cipherName, $modeName)
{
$this->_requireCipherInfo();
return self::$_cipherInfo[$cipherName][$modeName]['key_size'];
}
+ /**
+ * @param $cipherName
+ * @param $modeName
+ *
+ * @return mixed
+ */
protected function _getInitVectorSize($cipherName, $modeName)
{
$this->_requireCipherInfo();
return self::$_cipherInfo[$cipherName][$modeName]['iv_size'];
}
+ /**
+ * @return array
+ */
public function getCipherModeCombinations()
{
$result = [];
@@ -102,6 +122,9 @@ public function testConstructor($cipher, $mode)
$this->assertEquals($initVector, $crypt->getInitVector());
}
+ /**
+ * @return array
+ */
public function getConstructorExceptionData()
{
$result = [];
@@ -137,6 +160,9 @@ public function testConstructorDefaults()
$this->assertEquals($cryptExpected->getInitVector(), $cryptActual->getInitVector());
}
+ /**
+ * @return mixed
+ */
public function getCryptData()
{
$fixturesFilename = __DIR__ . '/Crypt/_files/_crypt_fixtures.php';
diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
index 52a7a98eac312..f4381a42775d7 100644
--- a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
+++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
@@ -86,6 +86,9 @@ public function testValidateHash($password, $hash, $expected)
$this->assertEquals($expected, $actual);
}
+ /**
+ * @return array
+ */
public function validateHashDataProvider()
{
return [
@@ -112,6 +115,9 @@ public function testEncryptWithEmptyKey($key)
$this->assertEquals($value, $model->encrypt($value));
}
+ /**
+ * @return array
+ */
public function encryptWithEmptyKeyDataProvider()
{
return [[null], [0], [''], ['0']];
@@ -134,6 +140,9 @@ public function testDecryptWithEmptyKey($key)
$this->assertEquals('', $model->decrypt($value));
}
+ /**
+ * @return array
+ */
public function decryptWithEmptyKeyDataProvider()
{
return [[null], [0], [''], ['0']];
@@ -208,6 +217,9 @@ public function testValidateKey()
$this->assertEquals($crypt->decrypt($expectedEncryptedData), $actual->decrypt($actualEncryptedData));
}
+ /**
+ * @return array
+ */
public function testUseSpecifiedHashingAlgoDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/Helper/SecurityTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/Helper/SecurityTest.php
index a0406cd0ec84b..fc241834c7ecf 100644
--- a/lib/internal/Magento/Framework/Encryption/Test/Unit/Helper/SecurityTest.php
+++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/Helper/SecurityTest.php
@@ -31,6 +31,9 @@ public function testCompareStrings($expected, $actual, $result)
$this->assertEquals($result, Security::compareStrings($expected, $actual));
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CollectionTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CollectionTest.php
index 91c8afaef5d07..136dd8cc80eef 100644
--- a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CollectionTest.php
+++ b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CollectionTest.php
@@ -81,6 +81,9 @@ public function testGetObserverByName($name)
$this->assertEquals($observer, $this->observerCollection->getObserverByName($name));
}
+ /**
+ * @return array
+ */
public function observerNameProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CronTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CronTest.php
index 511d547ebed44..1380cc0decf39 100644
--- a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CronTest.php
+++ b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/CronTest.php
@@ -37,6 +37,9 @@ public function testGetNumeric($value, $expectedResult)
$this->assertEquals($expectedResult, $this->cron->getNumeric($value));
}
+ /**
+ * @return array
+ */
public function numericValueProvider()
{
return [
@@ -78,6 +81,9 @@ public function testMatchCronExpression($expression, $number, $expectedResult)
$this->assertEquals($expectedResult, $this->cron->matchCronExpression($expression, $number));
}
+ /**
+ * @return array
+ */
public function matchCronExpressionProvider()
{
return [
@@ -107,6 +113,9 @@ public function testIsValidFor($time, $expression, $expectedResult)
$this->assertEquals($expectedResult, $this->cron->isValidFor($eventMock));
}
+ /**
+ * @return array
+ */
public function isValidForProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/RegexTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/RegexTest.php
index cfd3602fb030d..80d828930d118 100644
--- a/lib/internal/Magento/Framework/Event/Test/Unit/Observer/RegexTest.php
+++ b/lib/internal/Magento/Framework/Event/Test/Unit/Observer/RegexTest.php
@@ -44,6 +44,9 @@ public function testIsValidFor($pattern, $name, $expectedResult)
$this->assertEquals($expectedResult, $this->regex->isValidFor($eventMock));
}
+ /**
+ * @return array
+ */
public function isValidForProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Exception/AbstractAggregateException.php b/lib/internal/Magento/Framework/Exception/AbstractAggregateException.php
index 56c3bd285bc1e..6720b43b4ed9f 100644
--- a/lib/internal/Magento/Framework/Exception/AbstractAggregateException.php
+++ b/lib/internal/Magento/Framework/Exception/AbstractAggregateException.php
@@ -78,6 +78,13 @@ public function addError(Phrase $phrase)
return $this;
}
+ public function addException(LocalizedException $exception)
+ {
+ $this->addErrorCalls++;
+ $this->errors[] = $exception;
+ return $this;
+ }
+
/**
* Should return true if someone has added different errors to this exception after construction
*
diff --git a/lib/internal/Magento/Framework/File/Size.php b/lib/internal/Magento/Framework/File/Size.php
index 6f48024f71c16..c259069637293 100644
--- a/lib/internal/Magento/Framework/File/Size.php
+++ b/lib/internal/Magento/Framework/File/Size.php
@@ -36,7 +36,7 @@ class Size
*/
public function getPostMaxSize()
{
- return $this->_iniget('post_max_size');
+ return $this->_iniGet('post_max_size');
}
/**
@@ -46,7 +46,7 @@ public function getPostMaxSize()
*/
public function getUploadMaxSize()
{
- return $this->_iniget('upload_max_filesize');
+ return $this->_iniGet('upload_max_filesize');
}
/**
diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php
index 97a3b8f498491..5d1f9664bde61 100644
--- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php
+++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php
@@ -31,6 +31,9 @@ public function testGetAbsolutePath($basePath, $path, $expected)
$this->assertEquals($expected, $file->getAbsolutePath($basePath, $path));
}
+ /**
+ * @return array
+ */
public function dataProviderForTestGetAbsolutePath()
{
return [
@@ -50,6 +53,9 @@ public function testGetRelativePath($basePath, $path, $expected)
$this->assertEquals($expected, $file->getRelativePath($basePath, $path));
}
+ /**
+ * @return array
+ */
public function dataProviderForTestGetRelativePath()
{
return [
diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php
index 51a994dc73ff5..dabbae8974905 100644
--- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php
+++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php
@@ -40,6 +40,9 @@ public function testIsExists($status, $result)
$this->assertEquals($result, (new Http())->isExists(''));
}
+ /**
+ * @return array
+ */
public function dataProviderForTestIsExists()
{
return [['200 OK', true], ['404 Not Found', false]];
@@ -54,6 +57,9 @@ public function testStat($headers, $result)
$this->assertEquals($result, (new Http())->stat(''));
}
+ /**
+ * @return array
+ */
public function dataProviderForTestStat()
{
$headers1 = [
diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/DriverPoolTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/DriverPoolTest.php
index 8e550ff0597d7..1aaedbc475446 100644
--- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/DriverPoolTest.php
+++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/DriverPoolTest.php
@@ -38,6 +38,6 @@ public function testCustomDriver()
*/
public function testCustomDriverException()
{
- new DriverPool(['custom' => new \StdClass()]);
+ new DriverPool(['custom' => new \stdClass()]);
}
}
diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php
index 07524f9c3595f..8dcb4befa6cac 100644
--- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php
+++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php
@@ -39,6 +39,9 @@ public function testExclusion()
$this->assertTrue(!in_array(BP . '/var/session/', $result), 'Filtered path should not be in array');
}
+ /**
+ * @return \Generator
+ */
private function getFilesIterator()
{
$files = [
diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/Input/MaliciousCodeTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/Input/MaliciousCodeTest.php
index a8cf48eef433f..7c1ae92b10fc2 100644
--- a/lib/internal/Magento/Framework/Filter/Test/Unit/Input/MaliciousCodeTest.php
+++ b/lib/internal/Magento/Framework/Filter/Test/Unit/Input/MaliciousCodeTest.php
@@ -33,6 +33,9 @@ public function testFilter($input, $expectedOutput)
);
}
+ /**
+ * @return array
+ */
public function filterDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/ParameterTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/ParameterTest.php
index 126d3f9f2f691..fdce369ba2946 100644
--- a/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/ParameterTest.php
+++ b/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/ParameterTest.php
@@ -41,6 +41,9 @@ public function testGetValue($string, $expectedValue)
$this->assertEquals($expectedValue, $this->_filter->getValue());
}
+ /**
+ * @return array
+ */
public function sampleTokenizeStringProvider()
{
return [
@@ -51,6 +54,9 @@ public function sampleTokenizeStringProvider()
];
}
+ /**
+ * @return array
+ */
public function sampleGetValueStringProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/VariableTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/VariableTest.php
index 793637203bb0d..4dad75a6bcb5b 100644
--- a/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/VariableTest.php
+++ b/lib/internal/Magento/Framework/Filter/Test/Unit/Template/Tokenizer/VariableTest.php
@@ -30,6 +30,9 @@ public function testTokenize($string, $expectedValue)
$this->assertEquals($expectedValue, $this->_filter->tokenize());
}
+ /**
+ * @return array
+ */
public function sampleTokenizeStringProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/TemplateTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/TemplateTest.php
index 14d84707fb0b4..e7376d9b7d264 100644
--- a/lib/internal/Magento/Framework/Filter/Test/Unit/TemplateTest.php
+++ b/lib/internal/Magento/Framework/Filter/Test/Unit/TemplateTest.php
@@ -138,6 +138,9 @@ public function testVarDirective($construction, $variables, $expectedResult)
$this->assertEquals($expectedResult, $this->templateFilter->filter($construction));
}
+ /**
+ * @return array
+ */
public function varDirectiveDataProvider()
{
/* @var $dataObjectVariable \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject */
diff --git a/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php b/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php
index 8fd28e8513d0b..852badb16d219 100644
--- a/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php
+++ b/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php
@@ -38,6 +38,9 @@ public function testRead($response)
$this->assertEquals(file_get_contents(__DIR__ . '/_files/curl_response_expected.txt'), $this->model->read());
}
+ /**
+ * @return array
+ */
public function readDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php
index a746b61ad0038..88cc505fbea8e 100644
--- a/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php
+++ b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php
@@ -50,6 +50,11 @@ public function tearDown()
$_SERVER = $this->serverArray;
}
+ /**
+ * @param null $uri
+ *
+ * @return Request
+ */
private function getModel($uri = null)
{
return new Request($this->cookieReader, $this->converter, $uri);
diff --git a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php
index a36e41a526466..33d73768b3b07 100644
--- a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php
+++ b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php
@@ -106,7 +106,7 @@ protected function _getImageNeedMemorySize($file)
}
return round(
- ($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $imageInfo['channels'] / 8 + Pow(2, 16)) * 1.65
+ ($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $imageInfo['channels'] / 8 + pow(2, 16)) * 1.65
);
}
@@ -426,7 +426,7 @@ public function watermark($imagePath, $positionX = 0, $positionY = 0, $opacity =
imagecolortransparent($newWatermark, $col);
imagefilledrectangle($newWatermark, 0, 0, $this->getWatermarkWidth(), $this->getWatermarkHeight(), $col);
imagealphablending($newWatermark, true);
- imageSaveAlpha($newWatermark, true);
+ imagesavealpha($newWatermark, true);
imagecopyresampled(
$newWatermark,
$watermark,
@@ -451,7 +451,7 @@ public function watermark($imagePath, $positionX = 0, $positionY = 0, $opacity =
imagecolortransparent($newWatermark, $col);
imagefilledrectangle($newWatermark, 0, 0, $this->_imageSrcWidth, $this->_imageSrcHeight, $col);
imagealphablending($newWatermark, true);
- imageSaveAlpha($newWatermark, true);
+ imagesavealpha($newWatermark, true);
imagecopyresampled(
$newWatermark,
$watermark,
@@ -669,7 +669,7 @@ private function imageDestroy()
private function _saveAlpha($imageHandler)
{
$background = imagecolorallocate($imageHandler, 0, 0, 0);
- ImageColorTransparent($imageHandler, $background);
+ imagecolortransparent($imageHandler, $background);
imagealphablending($imageHandler, false);
imagesavealpha($imageHandler, true);
}
diff --git a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php
index d8e48f278f782..838d85c5fbf20 100644
--- a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php
+++ b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php
@@ -109,6 +109,9 @@ public function testPrepareDestination($destination, $newName, $expectedResult)
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public function prepareDestinationDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php
index fe0847f7f69b4..41281c96e1bb4 100644
--- a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php
+++ b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php
@@ -73,6 +73,9 @@ public function testOpen($fileData, $exception, $limit)
$this->adapter->open('file');
}
+ /**
+ * @return array
+ */
public function filesProvider()
{
$smallFile = [
diff --git a/lib/internal/Magento/Framework/Indexer/Action/Base.php b/lib/internal/Magento/Framework/Indexer/Action/Base.php
index 11cf1cec62636..636335192cbc5 100644
--- a/lib/internal/Magento/Framework/Indexer/Action/Base.php
+++ b/lib/internal/Magento/Framework/Indexer/Action/Base.php
@@ -221,7 +221,7 @@ protected function prepareDataSource(array $ids = [])
{
return !count($ids)
? $this->createResultCollection()
- : $this->createResultCollection()->addFieldToFilter($this->getPrimaryResource()->getIdFieldname(), $ids);
+ : $this->createResultCollection()->addFieldToFilter($this->getPrimaryResource()->getIdFieldName(), $ids);
}
/**
diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
index c68af718473a4..984b09f9a27ab 100644
--- a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
+++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
@@ -186,6 +186,13 @@ private function createDimensionMock($name, $value)
return $dimension;
}
+ /**
+ * @param $callNumber
+ * @param $tableName
+ * @param $isTableExist
+ *
+ * @return mixed
+ */
private function mockDropTable($callNumber, $tableName, $isTableExist)
{
$this->connectionInterface->expects($this->at($callNumber++))
@@ -201,6 +208,12 @@ private function mockDropTable($callNumber, $tableName, $isTableExist)
return $callNumber;
}
+ /**
+ * @param $callNumber
+ * @param $tableName
+ *
+ * @return mixed
+ */
private function mockFlatTable($callNumber, $tableName)
{
$table = $this->getMockBuilder(\Magento\Framework\DB\Ddl\Table::class)
@@ -223,6 +236,12 @@ private function mockFlatTable($callNumber, $tableName)
return $callNumber;
}
+ /**
+ * @param $callNumber
+ * @param $tableName
+ *
+ * @return mixed
+ */
private function mockFulltextTable($callNumber, $tableName)
{
$table = $this->getMockBuilder(\Magento\Framework\DB\Ddl\Table::class)
diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/Sample.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/Sample.php
index 46d9bee5844a7..107f83ad6f378 100644
--- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/Sample.php
+++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/Sample.php
@@ -14,6 +14,9 @@ public function getValue()
return $this->attribute;
}
+ /**
+ * @param $value
+ */
public function setValue($value)
{
$this->attribute = $value;
diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/TSample.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/TSample.php
index f751424e59103..5827c1a1b9e13 100644
--- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/TSample.php
+++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/TSample.php
@@ -9,11 +9,17 @@ class TSample
{
private $value;
+ /**
+ * @return string
+ */
public function getValue() : string
{
return $this->value;
}
+ /**
+ * @param string $value
+ */
public function setValue(string $value)
{
$this->value = $value;
diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php
index 54dfa8a03b28c..fe8d29bd0d51d 100644
--- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php
+++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php
@@ -209,6 +209,9 @@ public function testHasPluginsWhenDataIsCached($expectedResult, $type)
$this->assertEquals($expectedResult, $model->hasPlugins($type));
}
+ /**
+ * @return array
+ */
public function hasPluginsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Lock/Backend/Database.php b/lib/internal/Magento/Framework/Lock/Backend/Database.php
index 6d1bf07b5b331..61857685a7bb4 100644
--- a/lib/internal/Magento/Framework/Lock/Backend/Database.php
+++ b/lib/internal/Magento/Framework/Lock/Backend/Database.php
@@ -28,6 +28,13 @@ class Database implements \Magento\Framework\Lock\LockManagerInterface
/** @var string|false Holds current lock name if set, otherwise false */
private $currentLock = false;
+ /**
+ * Database constructor.
+ *
+ * @param ResourceConnection $resource
+ * @param DeploymentConfig $deploymentConfig
+ * @param string|null $prefix
+ */
public function __construct(
ResourceConnection $resource,
DeploymentConfig $deploymentConfig,
diff --git a/lib/internal/Magento/Framework/Mail/Template/TransportBuilderByStore.php b/lib/internal/Magento/Framework/Mail/Template/TransportBuilderByStore.php
index 785c93824a57d..95f17fed1123c 100644
--- a/lib/internal/Magento/Framework/Mail/Template/TransportBuilderByStore.php
+++ b/lib/internal/Magento/Framework/Mail/Template/TransportBuilderByStore.php
@@ -47,6 +47,7 @@ public function __construct(
public function setFromByStore($from, $store)
{
$result = $this->senderResolver->resolve($from, $store);
+ $this->message->clearFrom();
$this->message->setFrom($result['email'], $result['name']);
return $this;
diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderByStoreTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderByStoreTest.php
index 80df2887a3a93..58c9b045eed8c 100644
--- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderByStoreTest.php
+++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderByStoreTest.php
@@ -58,6 +58,9 @@ public function testSetFromByStore()
->method('setFrom')
->with('from@example.com', 'name')
->willReturnSelf();
+ $this->messageMock->expects($this->once())
+ ->method('clearFrom')
+ ->willReturnSelf();
$this->model->setFromByStore($sender, $store);
}
diff --git a/lib/internal/Magento/Framework/Math/Test/Unit/RandomTest.php b/lib/internal/Magento/Framework/Math/Test/Unit/RandomTest.php
index cd7f52f95a850..1dcdb0e9ae65d 100644
--- a/lib/internal/Magento/Framework/Math/Test/Unit/RandomTest.php
+++ b/lib/internal/Magento/Framework/Math/Test/Unit/RandomTest.php
@@ -26,6 +26,9 @@ public function testGetRandomString($length, $chars = null)
}
}
+ /**
+ * @return array
+ */
public function getRandomStringDataProvider()
{
return [
@@ -77,6 +80,9 @@ public function testGetRandomNumber($min, $max)
$this->assertGreaterThanOrEqual($min, $number);
}
+ /**
+ * @return array
+ */
public function testGetRandomNumberProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php
index f2b496b157c54..ea86985f057bf 100644
--- a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php
+++ b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php
@@ -308,6 +308,9 @@ public function testAddMessage($type, $methodName)
$this->assertTrue($this->model->hasMessages());
}
+ /**
+ * @return array
+ */
public function addMessageDataProvider()
{
return [
@@ -338,6 +341,9 @@ public function testAddUniqueMessagesWhenMessagesImplementMessageInterface($mess
$this->model->addUniqueMessages([$messages]);
}
+ /**
+ * @return array
+ */
public function addUniqueMessagesWhenMessagesImplementMessageInterfaceDataProvider()
{
return [
@@ -371,6 +377,9 @@ public function testAddUniqueMessages($messages)
$this->model->addUniqueMessages($messages);
}
+ /**
+ * @return array
+ */
public function addUniqueMessagesDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php
index 966c8f9590cd7..8cd2646815551 100644
--- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php
+++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php
@@ -163,6 +163,9 @@ public function testGetMainTable($tableName, $expectedResult)
$this->assertEquals($expectedResult, $this->_model->getMainTable());
}
+ /**
+ * @return array
+ */
public function getTableDataProvider()
{
return [
@@ -217,6 +220,9 @@ public function testGetChecksum($checksum, $expected)
$this->assertEquals($expected, $this->_model->getChecksum($checksum));
}
+ /**
+ * @return array
+ */
public function getChecksumProvider()
{
return [
@@ -399,6 +405,9 @@ public function testGetDataChanged($getOriginData, $expected)
$this->assertEquals($expected, $this->_model->hasDataChanged($abstractModelMock));
}
+ /**
+ * @return array
+ */
public function hasDataChangedDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php
index bfd9b5a63d21b..147cac47d3829 100644
--- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php
+++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php
@@ -95,6 +95,9 @@ protected function tearDown()
\Magento\Framework\App\ObjectManager::setInstance($objectManagerMock);
}
+ /**
+ * @return object
+ */
protected function getUut()
{
return $this->objectManagerHelper->getObject(
@@ -220,6 +223,9 @@ public function testGetSelect($idFieldNameRet, $getPartRet, $expected)
$this->assertTrue($this->uut->getSelect() instanceof Select);
}
+ /**
+ * @return array
+ */
public function getSelectDataProvider()
{
$columnMock = $this->createPartialMock(\Zend_Db_Expr::class, ['__toString']);
@@ -246,6 +252,9 @@ public function testAddFieldToSelect($field, $alias, $expectedFieldsToSelect)
$this->assertTrue($this->uut->wereFieldsToSelectChanged());
}
+ /**
+ * @return array
+ */
public function addFieldToSelectDataProvider()
{
return [
@@ -265,6 +274,9 @@ public function testAddExpressionFieldToSelect($alias, $expression, $fields, $ex
$this->assertTrue($this->uut->addExpressionFieldToSelect($alias, $expression, $fields) instanceof Uut);
}
+ /**
+ * @return array
+ */
public function addExpressionFieldToSelectDataProvider()
{
return [
@@ -289,6 +301,9 @@ public function testRemoveFieldFromSelect(
$this->assertEquals($expectedWereFieldsToSelectChanged, $this->uut->wereFieldsToSelectChanged());
}
+ /**
+ * @return array
+ */
public function removeFieldFromSelectDataProvider()
{
return [
@@ -376,6 +391,9 @@ public function testJoin($table, $cond, $cols, $expected)
$this->assertEquals($expected, $this->uut->getJoinedTables());
}
+ /**
+ * @return array
+ */
public function joinDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php
index e55dbb3c9c3da..b224dccc83d03 100644
--- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php
+++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php
@@ -13,26 +13,41 @@
*/
class Uut extends AbstractCollection
{
+ /**
+ * @return bool
+ */
public function wereFieldsToSelectChanged()
{
return $this->_fieldsToSelectChanged;
}
+ /**
+ * @return array|null
+ */
public function getFieldsToSelect()
{
return $this->_fieldsToSelect;
}
+ /**
+ * @param array $fields
+ */
public function setFieldsToSelect(array $fields)
{
$this->_fieldsToSelect = $fields;
}
+ /**
+ * @param $resource
+ */
public function setResource($resource)
{
$this->_resource = $resource;
}
+ /**
+ * @return array
+ */
public function getJoinedTables()
{
return $this->_joinedTables;
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/DomTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/DomTest.php
index ec9b41ff1b957..930b1a21cfd26 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/DomTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/Declaration/Converter/DomTest.php
@@ -42,6 +42,9 @@ public function testConvertWithInvalidDom($xmlString)
}
}
+ /**
+ * @return array
+ */
public function convertWithInvalidDomDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReverseResolverTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReverseResolverTest.php
index f7a20252826ae..eb849fc457ddb 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReverseResolverTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReverseResolverTest.php
@@ -54,6 +54,9 @@ public function testGetModuleName($path, $expectedResult)
$this->assertSame($expectedResult, $this->_model->getModuleName($path));
}
+ /**
+ * @return array
+ */
public function getModuleNameDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
index 44185b52b19a4..12ddfea8c83d1 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
@@ -83,6 +83,9 @@ public function testIsOutputEnabledGenericConfigPath($configValue, $expectedResu
$this->assertEquals($expectedResult, $this->_model->isOutputEnabled('Module_One'));
}
+ /**
+ * @return array
+ */
public function isOutputEnabledGenericConfigPathDataProvider()
{
return ['output disabled' => [true, false], 'output enabled' => [false, true]];
@@ -103,6 +106,9 @@ public function testIsOutputEnabledCustomConfigPath($configValue, $expectedResul
$this->assertEquals($expectedResult, $this->_model->isOutputEnabled('Module_Two'));
}
+ /**
+ * @return array
+ */
public function isOutputEnabledCustomConfigPathDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php
index c91b56560eb75..a7742700acc83 100644
--- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php
+++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php
@@ -259,6 +259,10 @@ protected function mockGetTableName()
$this->resourceMock->expects($this->once())->method('getTableName')->will($this->returnArgument(0));
}
+ /**
+ * @param $changelogTableName
+ * @param $result
+ */
protected function mockIsTableExists($changelogTableName, $result)
{
$this->connectionMock->expects(
diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php
index 3fd8ea93c9bbe..3f806b319ef48 100644
--- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php
+++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php
@@ -464,6 +464,9 @@ public function testResumeNotSuspended($status)
$this->model->resume();
}
+ /**
+ * @return array
+ */
public function dataProviderResumeNotSuspended()
{
return [
@@ -520,6 +523,9 @@ public function testIsEnabled($mode, $result)
$this->assertEquals($result, $this->model->isEnabled());
}
+ /**
+ * @return array
+ */
public function dataProviderIsEnabled()
{
return [
@@ -541,6 +547,9 @@ public function testIsIdle($status, $result)
$this->assertEquals($result, $this->model->isIdle());
}
+ /**
+ * @return array
+ */
public function dataProviderIsIdle()
{
return [
@@ -563,6 +572,9 @@ public function testIsWorking($status, $result)
$this->assertEquals($result, $this->model->isWorking());
}
+ /**
+ * @return array
+ */
public function dataProviderIsWorking()
{
return [
@@ -585,6 +597,9 @@ public function testIsSuspended($status, $result)
$this->assertEquals($result, $this->model->isSuspended());
}
+ /**
+ * @return array
+ */
public function dataProviderIsSuspended()
{
return [
@@ -617,6 +632,9 @@ protected function loadView()
$this->model->load($viewId);
}
+ /**
+ * @return array
+ */
protected function getViewData()
{
return [
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/RepositoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/RepositoryTest.php
index 1bba19cb16a5a..27ecdff1dcb82 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/RepositoryTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/RepositoryTest.php
@@ -13,21 +13,33 @@
*/
class RepositoryTest extends EntityChildTestAbstract
{
+ /**
+ * @return mixed|string
+ */
protected function getSourceClassName()
{
return '\\' . \Magento\Framework\ObjectManager\Code\Generator\Sample::class;
}
+ /**
+ * @return mixed|string
+ */
protected function getResultClassName()
{
return '\\' . \Magento\Framework\ObjectManager\Code\Generator\Sample\Repository::class;
}
+ /**
+ * @return mixed|string
+ */
protected function getGeneratorClassName()
{
return '\\' . \Magento\Framework\ObjectManager\Code\Generator\Repository::class;
}
+ /**
+ * @return mixed|string
+ */
protected function getOutputFileName()
{
return 'SampleConverter.php';
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepositoryInterface.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepositoryInterface.php
index 0bc899f580071..58e334f0022a7 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepositoryInterface.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepositoryInterface.php
@@ -7,11 +7,31 @@
interface SampleRepositoryInterface
{
+ /**
+ * @param SampleInterface $entity
+ *
+ * @return mixed
+ */
public function save(\Magento\Framework\ObjectManager\Code\Generator\SampleInterface $entity);
+ /**
+ * @param $id
+ *
+ * @return mixed
+ */
public function get($id);
+ /**
+ * @param $id
+ *
+ * @return mixed
+ */
public function deleteById($id);
+ /**
+ * @param SampleInterface $entity
+ *
+ * @return mixed
+ */
public function delete(\Magento\Framework\ObjectManager\Code\Generator\SampleInterface $entity);
}
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepositoryInterface.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepositoryInterface.php
index 99ab4ecadcd41..b916ab18e2e70 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepositoryInterface.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepositoryInterface.php
@@ -7,10 +7,25 @@
interface TSampleRepositoryInterface
{
+ /**
+ * @param int $id
+ *
+ * @return TSampleInterface
+ */
public function get(int $id) : \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface;
+ /**
+ * @param TSampleInterface $entity
+ *
+ * @return bool
+ */
public function delete(\Magento\Framework\ObjectManager\Code\Generator\TSampleInterface $entity) : bool;
+ /**
+ * @param TSampleInterface $entity
+ *
+ * @return TSampleInterface
+ */
public function save(\Magento\Framework\ObjectManager\Code\Generator\TSampleInterface $entity)
: \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface;
}
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php
index 6be8d7ffde874..e885c07b7c298 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php
@@ -32,6 +32,9 @@ public function validate($schemaFile, $errors)
return true;
}
+ /**
+ * @return string
+ */
public function getDom()
{
return 'reader dom result';
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/FactoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/FactoryTest.php
index 8deb2750653e7..25a49074c1ad3 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/FactoryTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/FactoryTest.php
@@ -37,7 +37,7 @@ protected function setUp()
public function testCreateNoArgs()
{
- $this->assertInstanceOf('StdClass', $this->factory->create(\StdClass::class));
+ $this->assertInstanceOf('StdClass', $this->factory->create(\stdClass::class));
}
/**
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php
index 1c88ab65021c4..0beeeb5e69738 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php
@@ -30,6 +30,9 @@ public function testGetParents($type, $parents)
$this->assertEquals($parents, $this->model->getParents($type));
}
+ /**
+ * @return array
+ */
public function getParentsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/AggregateParent.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/AggregateParent.php
index 3c494b6abbb94..bee2a7eb6ad98 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/AggregateParent.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/AggregateParent.php
@@ -17,6 +17,15 @@ class AggregateParent implements \Magento\Test\Di\Aggregate\AggregateInterface
public $optionalScalar;
+ /**
+ * AggregateParent constructor.
+ *
+ * @param \Magento\Test\Di\DiInterface $interface
+ * @param \Magento\Test\Di\DiParent $parent
+ * @param \Magento\Test\Di\Child $child
+ * @param $scalar
+ * @param int $optionalScalar
+ */
public function __construct(
\Magento\Test\Di\DiInterface $interface,
\Magento\Test\Di\DiParent $parent,
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/Child.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/Child.php
index b84375e3b5436..3577141ef0284 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/Child.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/Child.php
@@ -11,6 +11,17 @@ class Child extends \Magento\Test\Di\Aggregate\AggregateParent
public $secondOptionalScalar;
+ /**
+ * Child constructor.
+ *
+ * @param \Magento\Test\Di\DiInterface $interface
+ * @param \Magento\Test\Di\DiParent $parent
+ * @param \Magento\Test\Di\Child $child
+ * @param $scalar
+ * @param $secondScalar
+ * @param int $optionalScalar
+ * @param string $secondOptionalScalar
+ */
public function __construct(
\Magento\Test\Di\DiInterface $interface,
\Magento\Test\Di\DiParent $parent,
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/WithOptional.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/WithOptional.php
index 1c5ac56e2735c..a68eb2c0fc64f 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/WithOptional.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/_files/Aggregate/WithOptional.php
@@ -11,6 +11,12 @@ class WithOptional
public $child;
+ /**
+ * WithOptional constructor.
+ *
+ * @param \Magento\Test\Di\DiParent|null $parent
+ * @param \Magento\Test\Di\Child|null $child
+ */
public function __construct(\Magento\Test\Di\DiParent $parent = null, \Magento\Test\Di\Child $child = null)
{
$this->parent = $parent;
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php
index 9c23b38182f91..edcc4a7e56717 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php
@@ -79,6 +79,9 @@ public function testGetItems($adjustments, $expectedResult)
$this->assertEmpty(array_diff($expectedResult, array_keys($result)));
}
+ /**
+ * @return array
+ */
public function getItemsDataProvider()
{
return [
@@ -104,6 +107,9 @@ public function testGetItemByCode($adjustments, $code, $expectedResult)
$this->assertEquals($expectedResult, $item->getAdjustmentCode());
}
+ /**
+ * @return array
+ */
public function getItemByCodeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php
index 6fca39b2082fb..adf9ffae16390 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php
@@ -65,6 +65,9 @@ public function testGetAdjustmentByCode($code, $expectedResult)
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public function getAdjustmentByCodeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php
index 2abf26601fbea..42af3268e559b 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php
@@ -50,6 +50,9 @@ public function testCurrency($amount, $format, $includeContainer, $result)
$this->assertEquals($result, $helper->currency($amount, $format, $includeContainer));
}
+ /**
+ * @return array
+ */
public function currencyDataProvider()
{
return [
@@ -84,6 +87,9 @@ public function testCurrencyByStore($amount, $store, $format, $includeContainer,
$this->assertEquals($result, $helper->currencyByStore($amount, $store, $format, $includeContainer));
}
+ /**
+ * @return array
+ */
public function currencyByStoreDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php
index 5d1ab67e09587..ebe2fb453ca83 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php
@@ -80,6 +80,9 @@ protected function setUp()
$this->factory = new Factory($this->types, $this->objectManagerMock);
}
+ /**
+ * @return array
+ */
public function createPriceInfoDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php
index 009fb8236c4dc..70eef212c6878 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php
@@ -277,6 +277,13 @@ public function testAdjustmentsHtml()
$this->assertEquals($adjustmentHtml1 . $adjustmentHtml2, $this->model->getAdjustmentsHtml());
}
+ /**
+ * @param array $data
+ * @param string $html
+ * @param string $code
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function getAdjustmentRenderMock($data = [], $html = '', $code = 'adjustment_code')
{
$adjustmentRender = $this->getMockForAbstractClass(
diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php
index 905569936d036..f4588f7d25672 100644
--- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php
+++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php
@@ -122,6 +122,9 @@ public function testToHtml($data, $priceCode, $cssClasses)
$this->assertEquals($cssClasses, $priceBox->getData('css_classes'));
}
+ /**
+ * @return array
+ */
public function toHtmlDataProvider()
{
return [
@@ -225,6 +228,9 @@ public function testGetPriceId($prefix, $suffix, $defaultPrefix, $defaultSuffix)
$this->assertEquals($expectedPriceId, $this->model->getPriceId($defaultPrefix, $defaultSuffix));
}
+ /**
+ * @return array
+ */
public function getPriceIdProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/DataObjectProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/DataObjectProcessorTest.php
index ed26efb5bff64..1977ed3f46456 100644
--- a/lib/internal/Magento/Framework/Reflection/Test/Unit/DataObjectProcessorTest.php
+++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/DataObjectProcessorTest.php
@@ -86,6 +86,9 @@ public function testBuildOutputDataArray($extensionAttributes, $expectedOutputDa
$this->assertEquals($expectedOutputDataArray, $outputData);
}
+ /**
+ * @return array
+ */
public function buildOutputDataArrayDataProvider()
{
$expectedOutputDataArray = [
diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/ExtensionAttributesProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/ExtensionAttributesProcessorTest.php
index 130c285bd3b08..6aebd99deabb0 100644
--- a/lib/internal/Magento/Framework/Reflection/Test/Unit/ExtensionAttributesProcessorTest.php
+++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/ExtensionAttributesProcessorTest.php
@@ -154,6 +154,9 @@ public function testBuildOutputDataArrayWithPermission($isPermissionAllowed, $ex
);
}
+ /**
+ * @return array
+ */
public function buildOutputDataArrayWithPermissionProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TestDataObject.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TestDataObject.php
index 4e40fe6860586..8cc173d6dee2d 100644
--- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TestDataObject.php
+++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TestDataObject.php
@@ -9,31 +9,51 @@ class TestDataObject implements TestDataInterface
{
private $extensionAttributes;
+ /**
+ * TestDataObject constructor.
+ *
+ * @param null $extensionAttributes
+ */
public function __construct($extensionAttributes = null)
{
$this->extensionAttributes = $extensionAttributes;
}
+ /**
+ * @return string
+ */
public function getId()
{
return '1';
}
+ /**
+ * @return string
+ */
public function getAddress()
{
return 'someAddress';
}
+ /**
+ * @return string
+ */
public function isDefaultShipping()
{
return 'true';
}
+ /**
+ * @return string
+ */
public function isRequiredBilling()
{
return 'false';
}
+ /**
+ * @return \Magento\Framework\Api\ExtensionAttributesInterface|null
+ */
public function getExtensionAttributes()
{
return $this->extensionAttributes;
diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php
index 75a31ddcad6fe..999bca8ad3fc4 100644
--- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php
+++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php
@@ -220,6 +220,9 @@ public function testProcessSimpleTypeException($value, $type)
$this->typeProcessor->processSimpleAndAnyType($value, $type);
}
+ /**
+ * @return array
+ */
public static function processSimpleTypeExceptionProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/RequireJs/Config.php b/lib/internal/Magento/Framework/RequireJs/Config.php
index 08131b2cccea3..ae45e29f38911 100644
--- a/lib/internal/Magento/Framework/RequireJs/Config.php
+++ b/lib/internal/Magento/Framework/RequireJs/Config.php
@@ -157,7 +157,7 @@ public function getConfig()
$customConfigFiles = $this->fileSource->getFiles($this->design->getDesignTheme(), self::CONFIG_FILE_NAME);
foreach ($customConfigFiles as $file) {
/** @var $fileReader \Magento\Framework\Filesystem\File\Read */
- $fileReader = $this->readFactory->create($file->getFileName(), DriverPool::FILE);
+ $fileReader = $this->readFactory->create($file->getFilename(), DriverPool::FILE);
$config = $fileReader->readAll($file->getName());
$distributedConfig .= str_replace(
['%config%', '%context%'],
diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php
index c5e18423eab07..2a3e46b8887a6 100644
--- a/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php
+++ b/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php
@@ -852,6 +852,9 @@ public function testGetFilterException()
$this->assertEquals($this->queryBool, $mapper->getRootQuery());
}
+ /**
+ * @return array
+ */
public function getQueryMatchProvider()
{
return [
@@ -879,6 +882,9 @@ public function getQueryMatchProvider()
];
}
+ /**
+ * @return array
+ */
public function getQueryFilterQueryReferenceProvider()
{
return [
@@ -926,6 +932,9 @@ public function getQueryFilterQueryReferenceProvider()
];
}
+ /**
+ * @return array
+ */
public function getQueryBoolProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/Base64JsonTest.php b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/Base64JsonTest.php
index 8cad058f88466..e93164537f927 100644
--- a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/Base64JsonTest.php
+++ b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/Base64JsonTest.php
@@ -30,6 +30,9 @@ public function testSerialize($value, $expected)
$this->assertEquals($expected, $this->base64json->serialize($value));
}
+ /**
+ * @return array
+ */
public function serializeDataProvider()
{
$dataObject = new \Magento\Framework\DataObject(['something']);
@@ -55,6 +58,9 @@ public function testUnserialize($value, $expected)
$this->assertEquals($expected, $this->base64json->unserialize($value));
}
+ /**
+ * @return array
+ */
public function unserializeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/JsonTest.php b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/JsonTest.php
index d1fddbbdf2778..235567103edf7 100644
--- a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/JsonTest.php
+++ b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/JsonTest.php
@@ -34,6 +34,9 @@ public function testSerialize($value, $expected)
);
}
+ /**
+ * @return array
+ */
public function serializeDataProvider()
{
$dataObject = new DataObject(['something']);
@@ -62,6 +65,9 @@ public function testUnserialize($value, $expected)
);
}
+ /**
+ * @return array
+ */
public function unserializeDataProvider()
{
return [
@@ -95,6 +101,9 @@ public function testUnserializeException($value)
$this->json->unserialize($value);
}
+ /**
+ * @return array
+ */
public function unserializeExceptionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
index e74de735c1c1e..1f8e7cf9d0bc3 100644
--- a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
+++ b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
@@ -33,6 +33,9 @@ public function testSerialize($value, $serializedValue)
$this->assertEquals($serializedValue, $this->serialize->serialize($value));
}
+ /**
+ * @return array
+ */
public function serializeDataProvider()
{
return [
@@ -56,6 +59,9 @@ public function testUnserialize($serializedValue, $value)
$this->assertEquals($value, $this->serialize->unserialize($serializedValue));
}
+ /**
+ * @return array
+ */
public function unserializeDataProvider()
{
return [
@@ -88,6 +94,9 @@ public function testUnserializeException($value)
$this->serialize->unserialize($value);
}
+ /**
+ * @return array
+ */
public function unserializeExceptionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php
index 12e28cdb3970d..3df8f182fe37e 100644
--- a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php
+++ b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php
@@ -82,6 +82,9 @@ public function testSetOptions($option, $getter, $value)
$this->assertSame($value, $this->config->{$getter}());
}
+ /**
+ * @return array
+ */
public function optionsProvider()
{
return [
@@ -343,6 +346,9 @@ public function testConstructor($isValidSame, $isValid, $expected)
$this->assertEquals($expected, $this->config->getOptions());
}
+ /**
+ * @return array
+ */
public function constructorDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php
index 18050da435c32..4594a471e008d 100644
--- a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php
+++ b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandler/Redis/LoggerTest.php
@@ -70,6 +70,9 @@ public function testLog($logLevel, $method)
$this->logger->log($message, $logLevel);
}
+ /**
+ * @return array
+ */
public function logDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererTest.php b/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererTest.php
index 213e2afa2c655..01964bdced655 100644
--- a/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererTest.php
+++ b/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererTest.php
@@ -24,6 +24,9 @@ public function testRender($expectedCommand, $actualCommand, $testArguments)
);
}
+ /**
+ * @return array
+ */
public function commandsDataProvider()
{
$testArgument = 'argument';
diff --git a/lib/internal/Magento/Framework/Simplexml/Test/Unit/ElementTest.php b/lib/internal/Magento/Framework/Simplexml/Test/Unit/ElementTest.php
index 2455b8f3cb500..ea2149e6f9e34 100644
--- a/lib/internal/Magento/Framework/Simplexml/Test/Unit/ElementTest.php
+++ b/lib/internal/Magento/Framework/Simplexml/Test/Unit/ElementTest.php
@@ -108,6 +108,9 @@ public function testSetAttribute($name, $value)
$this->assertEquals($xml->getAttribute($name), $value);
}
+ /**
+ * @return array
+ */
public function setAttributeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/BooleanUtilsTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/BooleanUtilsTest.php
index 26dcbc81262a2..64eb1e9c4bf39 100644
--- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/BooleanUtilsTest.php
+++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/BooleanUtilsTest.php
@@ -38,6 +38,9 @@ public function testToBoolean($input, $expected)
$this->assertSame($expected, $actual);
}
+ /**
+ * @return array
+ */
public function toBooleanDataProvider()
{
return [
@@ -64,6 +67,9 @@ public function testToBooleanException($input)
$this->object->toBoolean($input);
}
+ /**
+ * @return array
+ */
public function toBooleanExceptionDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php
index f6f6a19c170c8..29e54157ebb22 100644
--- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php
+++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php
@@ -274,6 +274,9 @@ public function testSetSensitiveCookieNoMetadata($cookieName, $secure)
$this->assertTrue(self::$isSetCookieInvoked);
}
+ /**
+ * @return array
+ */
public function isCurrentlySecureDataProvider()
{
return [
@@ -898,6 +901,11 @@ private static function assertZeroDuration(
self::assertEquals('', $path);
}
+ /**
+ * @param $get
+ * @param $default
+ * @param $return
+ */
protected function stubGetCookie($get, $default, $return)
{
$this->readerMock->expects($this->atLeastOnce())
diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php
index 9015968cee85c..d409a89c2cc91 100644
--- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php
+++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php
@@ -59,6 +59,9 @@ public function testConstructorAndGetHttpOnly($metadata, $httpOnly)
$this->assertEquals('path', $object->getPath());
}
+ /**
+ * @return array
+ */
public function constructorAndGetHttpOnlyTestDataProvider()
{
return [
@@ -104,6 +107,9 @@ public function testGetSecure($isSecure, $metadata, $expected, $callNum = 1)
$this->assertEquals($expected, $object->getSecure());
}
+ /**
+ * @return array
+ */
public function getSecureDataProvider()
{
return [
@@ -160,6 +166,9 @@ public function testToArray($isSecure, $metadata, $expected, $callNum = 1)
$this->assertEquals($expected, $object->__toArray());
}
+ /**
+ * @return array
+ */
public function toArrayDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php
index 5012c6a47f1c5..f90b1b2c3fd15 100644
--- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php
+++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php
@@ -133,6 +133,6 @@ public function testFormatObjectIfPassedWrongFormat()
$reflectionProperty = $reflection->getProperty('localeResolver');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($dateTimeFormatter, $this->localeResolverMock);
- $dateTimeFormatter->formatObject(new \DateTime('2013-06-06 17:05:06 Europe/Dublin'), new \StdClass());
+ $dateTimeFormatter->formatObject(new \DateTime('2013-06-06 17:05:06 Europe/Dublin'), new \stdClass());
}
}
diff --git a/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php b/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php
index 68be50810d44f..d4a19428c61a0 100644
--- a/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php
@@ -64,6 +64,9 @@ public function testIsArchive($file, $isArchive)
$this->assertEquals($isArchive, $this->archive->isArchive($file));
}
+ /**
+ * @return array
+ */
public function isArchiveProvider()
{
return [
@@ -98,6 +101,9 @@ public function testIsTar($file, $isArchive)
$this->assertEquals($isArchive, $this->archive->isTar($file));
}
+ /**
+ * @return array
+ */
public function isTarProvider()
{
return [
@@ -143,6 +149,9 @@ public function testPackUnpackGzBz($destinationFile, $extensionRequired)
$this->assertStringStartsWith($this->destinationDir, $this->unpacked);
}
+ /**
+ * @return array
+ */
public function destinationProvider()
{
return [
@@ -200,6 +209,9 @@ public function testExtract($destinationFile, $extensionRequired)
$this->assertStringStartsWith($this->destinationDir, $this->unpacked);
}
+ /**
+ * @return array
+ */
public function tarProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.php b/lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.php
index 0fc537fbe832a..b57cb7ac8f0b2 100644
--- a/lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.php
@@ -45,6 +45,9 @@ public function testGetElementHtml($value)
}
}
+ /**
+ * @return array
+ */
public function getElementHtmlDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Test/Unit/DataObjectTest.php b/lib/internal/Magento/Framework/Test/Unit/DataObjectTest.php
index d937dc10e4d4c..67a689b714e24 100644
--- a/lib/internal/Magento/Framework/Test/Unit/DataObjectTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/DataObjectTest.php
@@ -380,6 +380,9 @@ public function testUnderscore($input, $expectedOutput)
$this->assertEquals($expectedOutput, $output);
}
+ /**
+ * @return array
+ */
public function underscoreDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php
index c728fdecfeaab..ec05478b90db9 100644
--- a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php
@@ -103,6 +103,9 @@ public function testEscapeJs($data, $expected)
$this->assertEquals($expected, $this->escaper->escapeJs($data));
}
+ /**
+ * @return array
+ */
public function escapeJsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Test/Unit/FlagManagerTest.php b/lib/internal/Magento/Framework/Test/Unit/FlagManagerTest.php
index 955f16d4241c2..ea6ddf56414ff 100644
--- a/lib/internal/Magento/Framework/Test/Unit/FlagManagerTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/FlagManagerTest.php
@@ -112,6 +112,9 @@ public function testDeleteFlag($isFlagExist)
);
}
+ /**
+ * @param $flagCode
+ */
private function setupFlagObject($flagCode)
{
$this->flagFactoryMock->expects($this->once())
diff --git a/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php b/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php
index d5243cacb1616..805bd8fe4510a 100644
--- a/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php
@@ -33,6 +33,9 @@ public function testCreate($mainMessage, $subMessages, $separator, $expectedResu
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public function dataProvider()
{
$subMessage1 = new Error('go jogging');
diff --git a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php
index 1516f65479771..c41918e051452 100644
--- a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php
@@ -119,6 +119,9 @@ public function testBeforeDispatchOutOfDateWithErrors(array $errors, string $exp
$this->plugin->beforeDispatch($this->frontControllerMock, $this->requestMock);
}
+ /**
+ * @return array
+ */
public static function beforeDispatchOutOfDateWithErrorsDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php
index 913fd883eaad2..9f223f916b97a 100644
--- a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php
@@ -83,6 +83,9 @@ public function testExecuteLog($command, $commandArgs, $expectedResult, $expecte
);
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
// backtick symbol (`) has to be replaced with environment-dependent quote character
diff --git a/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php b/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php
index cca8d564d3199..5c634a1bca078 100644
--- a/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php
@@ -139,6 +139,9 @@ public function testLoadDataCachedTranslation($area, $forceReload, $cachedData)
$this->assertEquals($cachedData, $this->translate->getData());
}
+ /**
+ * @return array
+ */
public function dataProviderLoadDataCachedTranslation()
{
$cachedData = ['cached 1' => 'translated 1', 'cached 2' => 'translated 2'];
@@ -236,6 +239,9 @@ public function testLoadData($area, $forceReload)
$this->assertEquals($expected, $this->translate->getData());
}
+ /**
+ * @return array
+ */
public function dataProviderForTestLoadData()
{
return [
@@ -263,6 +269,9 @@ public function testGetData($data, $result)
$this->assertEquals($result, $this->translate->getData());
}
+ /**
+ * @return array
+ */
public function dataProviderForTestGetData()
{
$data = ['original 1' => 'translated 1', 'original 2' => 'translated 2'];
diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php
index 5c5df5b462b70..3713978d0f74e 100644
--- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php
@@ -163,6 +163,9 @@ public function testGetCurrentUrl($httpHost, $url)
$this->assertEquals($url, $model->getCurrentUrl());
}
+ /**
+ * @return array
+ */
public function getCurrentUrlProvider()
{
return [
@@ -337,6 +340,9 @@ public function testGetUrlRouteUseRewrite()
$this->assertEquals('/catalog/product/view/', $model->getUrl('catalog', ['_use_rewrite' => 1]));
}
+ /**
+ * @return array
+ */
public function getUrlDataProvider()
{
return [
@@ -497,6 +503,9 @@ public function testGetRedirectUrlWithSessionId()
$this->assertEquals('http://example.com/?foo=bar', $model->getRedirectUrl('http://example.com/'));
}
+ /**
+ * @return array
+ */
public function getRebuiltUrlDataProvider()
{
return [
@@ -558,6 +567,9 @@ public function testIsOwnOriginUrl($result, $referrer)
$this->assertEquals($result, $model->isOwnOriginUrl());
}
+ /**
+ * @return array
+ */
public function isOwnOriginUrlDataProvider()
{
return [
@@ -607,6 +619,9 @@ public function testGetConfigData($urlType, $configPath, $isSecure, $isSecureCal
$this->assertEquals('http://localhost/', $model->getConfigData($key));
}
+ /**
+ * @return array
+ */
public function getConfigDataDataProvider()
{
return [
@@ -712,6 +727,9 @@ public function testSessionUrlVarWithoutMatchedHostsAndBaseUrl()
);
}
+ /**
+ * @return array
+ */
public function sessionUrlVarWithMatchedHostsAndBaseUrlDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Matcher/MethodInvokedAtIndexTest.php b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Matcher/MethodInvokedAtIndexTest.php
index 9721cdb8f9331..52dd39cb7a558 100644
--- a/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Matcher/MethodInvokedAtIndexTest.php
+++ b/lib/internal/Magento/Framework/TestFramework/Test/Unit/Unit/Matcher/MethodInvokedAtIndexTest.php
@@ -16,7 +16,7 @@ public function testMatches()
'ValidMethodName',
[],
'void',
- new \StdClass()
+ new \stdClass()
);
$matcher = new \Magento\Framework\TestFramework\Unit\Matcher\MethodInvokedAtIndex(0);
$this->assertTrue($matcher->matches($invocationObject));
diff --git a/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php b/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php
index 6e222ba90da8e..b1ef51f010c5b 100644
--- a/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php
+++ b/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php
@@ -74,6 +74,9 @@ public function testIsAllowed($isEnabled, $isActive, $isDevAllowed, $result)
$this->assertEquals($result, $model->isAllowed());
}
+ /**
+ * @return array
+ */
public function isAllowedDataProvider()
{
return [
@@ -126,6 +129,9 @@ public function testProcessResponseBodyStripInline($body, $expected)
$this->assertEquals($body, $expected);
}
+ /**
+ * @return array
+ */
public function processResponseBodyStripInlineDataProvider()
{
return [
@@ -192,6 +198,9 @@ public function testProcessResponseBody($scope, $body, $expected)
$this->assertEquals($body, $expected);
}
+ /**
+ * @return array
+ */
public function processResponseBodyDataProvider()
{
return [
@@ -254,6 +263,9 @@ public function testProcessResponseBodyGetInlineScript($scope, $body, $expected)
$this->assertEquals($body, $expected);
}
+ /**
+ * @return array
+ */
public function processResponseBodyGetInlineScriptDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php
index 4888077104728..f053a9afff74d 100644
--- a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php
+++ b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php
@@ -55,6 +55,9 @@ public function testUnserializeObject($serialized)
$this->assertFalse($this->unserialize->unserialize($serialized));
}
+ /**
+ * @return array
+ */
public function unserializeObjectDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php b/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php
index 5bb4f54b84a5c..016208d0920aa 100644
--- a/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php
+++ b/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php
@@ -79,6 +79,9 @@ public function testGetEncodedUrl($url, $callNum)
$this->assertEquals($encodedUrl, $helper->getEncodedUrl($url));
}
+ /**
+ * @return array
+ */
public function getEncodedUrlDataProvider()
{
return [
@@ -98,6 +101,9 @@ public function testAddRequestParam($param, $expected)
$this->assertEquals($expected, $helper->addRequestParam('http://example.com', $param));
}
+ /**
+ * @return array
+ */
public function addRequestParamDataProvider()
{
return [
@@ -145,6 +151,9 @@ public function testRemoveRequestParam($paramKey, $expected)
$this->assertEquals($expected, $helper->removeRequestParam($url, $paramKey));
}
+ /**
+ * @return array
+ */
public function removeRequestParamDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Url/Test/Unit/SecurityInfoTest.php b/lib/internal/Magento/Framework/Url/Test/Unit/SecurityInfoTest.php
index fbda5e36c9934..3fc332aa1af52 100644
--- a/lib/internal/Magento/Framework/Url/Test/Unit/SecurityInfoTest.php
+++ b/lib/internal/Magento/Framework/Url/Test/Unit/SecurityInfoTest.php
@@ -32,6 +32,9 @@ public function testIsSecureChecksIfUrlIsInSecureList($url, $expected)
$this->assertEquals($expected, $this->_model->isSecure($url));
}
+ /**
+ * @return array
+ */
public function secureUrlDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/ObjectTest.php b/lib/internal/Magento/Framework/Validator/Test/Unit/ObjectTest.php
index a06297a382f57..0fd70b5bc5f1d 100644
--- a/lib/internal/Magento/Framework/Validator/Test/Unit/ObjectTest.php
+++ b/lib/internal/Magento/Framework/Validator/Test/Unit/ObjectTest.php
@@ -92,6 +92,9 @@ public function testIsValid(array $inputEntityData, array $expectedErrors)
}
}
+ /**
+ * @return array
+ */
public function validateDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/FileCollector/AggregatedFileCollector.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/FileCollector/AggregatedFileCollector.php
index 17a320164dad3..9ba7833a355d7 100644
--- a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/FileCollector/AggregatedFileCollector.php
+++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/FileCollector/AggregatedFileCollector.php
@@ -75,7 +75,7 @@ public function collectFiles($searchPattern = null)
}
$files = $this->collectorAggregated->getFiles($this->design->getDesignTheme(), $searchPattern);
foreach ($files as $file) {
- $fullFileName = $file->getFileName();
+ $fullFileName = $file->getFilename();
$fileDir = dirname($fullFileName);
$fileName = basename($fullFileName);
$dirRead = $this->readFactory->create($fileDir);
diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php
index 06b00afe42ad9..5be878720620b 100644
--- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php
+++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php
@@ -663,7 +663,7 @@ public function getFileLayoutUpdatesXml()
$result = $this->_loadXmlString($result);
} else {
$result = $this->_loadFileLayoutUpdatesXml();
- $this->_saveCache($result->asXml(), $cacheId);
+ $this->_saveCache($result->asXML(), $cacheId);
}
$this->layoutUpdatesCache = $result;
return $result;
diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php
index e3ea9a58661f2..058cad00320cd 100644
--- a/lib/internal/Magento/Framework/View/Page/Config.php
+++ b/lib/internal/Magento/Framework/View/Page/Config.php
@@ -7,6 +7,7 @@
namespace Magento\Framework\View\Page;
use Magento\Framework\App;
+use Magento\Framework\App\Area;
use Magento\Framework\View;
/**
@@ -34,6 +35,15 @@ class Config
const ELEMENT_TYPE_HEAD = 'head';
/**#@-*/
+ const META_DESCRIPTION = 'description';
+ const META_CONTENT_TYPE = 'content_type';
+ const META_MEDIA_TYPE = 'media_type';
+ const META_CHARSET = 'charset';
+ const META_TITLE = 'title';
+ const META_KEYWORDS = 'keywords';
+ const META_ROBOTS = 'robots';
+ const META_X_UI_COMPATIBLE = 'x_ua_compatible';
+
/**
* Constant body attribute class
*/
@@ -117,6 +127,7 @@ class Config
'description' => null,
'keywords' => null,
'robots' => null,
+ 'title' => null,
];
/**
@@ -244,7 +255,7 @@ public function getMetadata()
*/
public function setContentType($contentType)
{
- $this->setMetadata('content_type', $contentType);
+ $this->setMetadata(self::META_CONTENT_TYPE, $contentType);
}
/**
@@ -255,10 +266,10 @@ public function setContentType($contentType)
public function getContentType()
{
$this->build();
- if (strtolower($this->metadata['content_type']) === 'auto') {
- $this->metadata['content_type'] = $this->getMediaType() . '; charset=' . $this->getCharset();
+ if (strtolower($this->metadata[self::META_CONTENT_TYPE]) === 'auto') {
+ $this->metadata[self::META_CONTENT_TYPE] = $this->getMediaType() . '; charset=' . $this->getCharset();
}
- return $this->metadata['content_type'];
+ return $this->metadata[self::META_CONTENT_TYPE];
}
/**
@@ -267,7 +278,7 @@ public function getContentType()
*/
public function setMediaType($mediaType)
{
- $this->setMetadata('media_type', $mediaType);
+ $this->setMetadata(self::META_MEDIA_TYPE, $mediaType);
}
/**
@@ -278,13 +289,13 @@ public function setMediaType($mediaType)
public function getMediaType()
{
$this->build();
- if (empty($this->metadata['media_type'])) {
- $this->metadata['media_type'] = $this->scopeConfig->getValue(
+ if (empty($this->metadata[self::META_MEDIA_TYPE])) {
+ $this->metadata[self::META_MEDIA_TYPE] = $this->scopeConfig->getValue(
'design/head/default_media_type',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
- return $this->metadata['media_type'];
+ return $this->metadata[self::META_MEDIA_TYPE];
}
/**
@@ -293,7 +304,7 @@ public function getMediaType()
*/
public function setCharset($charset)
{
- $this->setMetadata('charset', $charset);
+ $this->setMetadata(self::META_CHARSET, $charset);
}
/**
@@ -304,13 +315,13 @@ public function setCharset($charset)
public function getCharset()
{
$this->build();
- if (empty($this->metadata['charset'])) {
- $this->metadata['charset'] = $this->scopeConfig->getValue(
+ if (empty($this->metadata[self::META_CHARSET])) {
+ $this->metadata[self::META_CHARSET] = $this->scopeConfig->getValue(
'design/head/default_charset',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
- return $this->metadata['charset'];
+ return $this->metadata[self::META_CHARSET];
}
/**
@@ -319,7 +330,7 @@ public function getCharset()
*/
public function setDescription($description)
{
- $this->setMetadata('description', $description);
+ $this->setMetadata(self::META_DESCRIPTION, $description);
}
/**
@@ -330,13 +341,36 @@ public function setDescription($description)
public function getDescription()
{
$this->build();
- if (empty($this->metadata['description'])) {
- $this->metadata['description'] = $this->scopeConfig->getValue(
+ if (empty($this->metadata[self::META_DESCRIPTION])) {
+ $this->metadata[self::META_DESCRIPTION] = $this->scopeConfig->getValue(
'design/head/default_description',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
- return $this->metadata['description'];
+ return $this->metadata[self::META_DESCRIPTION];
+ }
+
+ /**
+ * @param string $title
+ */
+ public function setMetaTitle($title)
+ {
+ $this->setMetadata(self::META_TITLE, $title);
+ }
+
+ /**
+ * Retrieve meta title
+ *
+ * @return string
+ */
+ public function getMetaTitle()
+ {
+ $this->build();
+ if (empty($this->metadata[self::META_TITLE])) {
+ return '';
+ }
+
+ return $this->metadata[self::META_TITLE];
}
/**
@@ -345,7 +379,7 @@ public function getDescription()
*/
public function setKeywords($keywords)
{
- $this->setMetadata('keywords', $keywords);
+ $this->setMetadata(self::META_KEYWORDS, $keywords);
}
/**
@@ -356,13 +390,13 @@ public function setKeywords($keywords)
public function getKeywords()
{
$this->build();
- if (empty($this->metadata['keywords'])) {
- $this->metadata['keywords'] = $this->scopeConfig->getValue(
+ if (empty($this->metadata[self::META_KEYWORDS])) {
+ $this->metadata[self::META_KEYWORDS] = $this->scopeConfig->getValue(
'design/head/default_keywords',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
- return $this->metadata['keywords'];
+ return $this->metadata[self::META_KEYWORDS];
}
/**
@@ -371,27 +405,28 @@ public function getKeywords()
*/
public function setRobots($robots)
{
- $this->setMetadata('robots', $robots);
+ $this->setMetadata(self::META_ROBOTS, $robots);
}
/**
* Retrieve URL to robots file
*
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
public function getRobots()
{
- if ($this->getAreaResolver()->getAreaCode() !== 'frontend') {
+ if ($this->getAreaResolver()->getAreaCode() !== Area::AREA_FRONTEND) {
return 'NOINDEX,NOFOLLOW';
}
$this->build();
- if (empty($this->metadata['robots'])) {
- $this->metadata['robots'] = $this->scopeConfig->getValue(
+ if (empty($this->metadata[self::META_ROBOTS])) {
+ $this->metadata[self::META_ROBOTS] = $this->scopeConfig->getValue(
'design/search_engine_robots/default_robots',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
- return $this->metadata['robots'];
+ return $this->metadata[self::META_ROBOTS];
}
/**
diff --git a/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php b/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php
index a596b85decff9..510da2b1b1ca9 100644
--- a/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php
+++ b/lib/internal/Magento/Framework/View/Page/Config/Reader/Head.php
@@ -147,6 +147,6 @@ private function setMetadata($pageConfigStructure, $node)
$metadataName = $node->getAttribute('name');
}
- $pageConfigStructure->setMetaData($metadataName, $node->getAttribute('content'));
+ $pageConfigStructure->setMetadata($metadataName, $node->getAttribute('content'));
}
}
diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php
index 9563cbfbcc532..183f8d34ee41f 100644
--- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php
+++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php
@@ -3,8 +3,10 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Framework\View\Page\Config;
+use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Asset\GroupedCollection;
use Magento\Framework\View\Page\Config;
@@ -21,7 +23,7 @@ class Renderer implements RendererInterface
protected $assetTypeOrder = ['css', 'ico', 'js'];
/**
- * @var \Magento\Framework\View\Page\Config
+ * @var Config
*/
protected $pageConfig;
@@ -51,7 +53,7 @@ class Renderer implements RendererInterface
protected $urlBuilder;
/**
- * @param \Magento\Framework\View\Page\Config $pageConfig
+ * @param Config $pageConfig
* @param \Magento\Framework\View\Asset\MergeService $assetMergeService
* @param \Magento\Framework\UrlInterface $urlBuilder
* @param \Magento\Framework\Escaper $escaper
@@ -131,15 +133,35 @@ public function renderMetadata()
/**
* @param string $name
* @param string $content
- * @return mixed
+ * @return string
*/
protected function processMetadataContent($name, $content)
{
- $method = 'get' . $this->string->upperCaseWords($name, '_', '');
- if (method_exists($this->pageConfig, $method)) {
- $content = $this->pageConfig->$method();
+ switch ($name) {
+ case Config::META_DESCRIPTION:
+ return $this->pageConfig->getDescription();
+
+ case Config::META_CONTENT_TYPE:
+ return $this->pageConfig->getContentType();
+
+ case Config::META_MEDIA_TYPE:
+ return $this->pageConfig->getMediaType();
+
+ case Config::META_CHARSET:
+ return $this->pageConfig->getCharset();
+
+ case Config::META_KEYWORDS:
+ return $this->pageConfig->getKeywords();
+
+ case Config::META_ROBOTS:
+ return $this->pageConfig->getRobots();
+
+ case Config::META_TITLE:
+ return $this->pageConfig->getMetaTitle();
+
+ default:
+ return $content;
}
- return $content;
}
/**
@@ -153,19 +175,19 @@ protected function getMetadataTemplate($name)
}
switch ($name) {
- case 'charset':
+ case Config::META_CHARSET:
$metadataTemplate = ' ' . "\n";
break;
- case 'content_type':
+ case Config::META_CONTENT_TYPE:
$metadataTemplate = ' ' . "\n";
break;
- case 'x_ua_compatible':
+ case Config::META_X_UI_COMPATIBLE:
$metadataTemplate = ' ' . "\n";
break;
- case 'media_type':
+ case Config::META_MEDIA_TYPE:
$metadataTemplate = false;
break;
@@ -352,7 +374,7 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $
);
$result .= sprintf($template, $asset->getUrl());
}
- } catch (\Magento\Framework\Exception\LocalizedException $e) {
+ } catch (LocalizedException $e) {
$this->logger->critical($e);
$result .= sprintf($template, $this->urlBuilder->getUrl('', ['_direct' => 'core/index/notFound']));
}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/File/FallbackContextTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/File/FallbackContextTest.php
index 68b5f4bf3a20d..2d6ea2efe4958 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/File/FallbackContextTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/File/FallbackContextTest.php
@@ -53,6 +53,9 @@ public function testGetConfigPath(
$this->assertEquals($expectedResult, $this->fallbackContext->getConfigPath());
}
+ /**
+ * @return array
+ */
public function getConfigPathDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php
index b2953bc24e131..64d0419e070d0 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php
@@ -134,6 +134,9 @@ public function testGetContent($content)
$this->assertEquals($content, $this->object->getContent()); // no in-memory caching for content
}
+ /**
+ * @return array
+ */
public function getContentDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php
index c4b7cefcfa7c2..4c17a2c0b35f4 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php
@@ -118,6 +118,9 @@ public function testGetMergedAssets(array $assets, $contentType, $appMode, $merg
$this->assertSame($mergedAsset, $this->object->getMergedAssets($assets, $contentType));
}
+ /**
+ * @return array
+ */
public static function getMergedAssetsDataProvider()
{
$jsAssets = [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php b/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php
index 923ec2ff322b5..7e672d58d18e0 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php
@@ -234,6 +234,9 @@ public function testGetAcceptType($headerAccept, $acceptType)
$this->assertEquals($acceptType, $this->context->getAcceptType());
}
+ /**
+ * @return array
+ */
public function getAcceptTypeDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php
index 52e055f11b8a2..fbb521d2c21b8 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php
@@ -47,6 +47,11 @@ public function testAddWithException()
$this->dataSourcePool->add('DataSourcePoolTestBlock', 'NotExistingBlockClass');
}
+ /**
+ * @param $blockClass
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
protected function createBlock($blockClass)
{
$block = $this->createMock(\Magento\Framework\View\Element\BlockInterface::class);
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php
index 4515a29c65e4f..909748722a081 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php
@@ -57,7 +57,7 @@ public function testIsCurrentIfIsset()
/** @var \Magento\Framework\View\Element\Html\Link\Current $link */
$link = $this->_objectManager->getObject(\Magento\Framework\View\Element\Html\Link\Current::class);
$link->setCurrent(true);
- $this->assertTrue($link->IsCurrent());
+ $this->assertTrue($link->isCurrent());
}
public function testIsCurrent()
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/LinkTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/LinkTest.php
index 692dcb54d1447..b911a38dbb488 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/LinkTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/LinkTest.php
@@ -35,6 +35,9 @@ public function testGetLinkAttributes($link, $expected)
$this->assertEquals($expected, $link->getLinkAttributes());
}
+ /**
+ * @return array
+ */
public function getLinkAttributesDataProvider()
{
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php
index 10e21763ba802..fefbdf0ed5111 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php
@@ -83,6 +83,9 @@ public function testGetDomain($domain, $isIp, $expectedResult)
$this->assertEquals($expectedResult, $result);
}
+ /**
+ * @return array
+ */
public static function domainDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php
index 1330f0563fc71..406036ed808b9 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php
@@ -54,7 +54,7 @@ public function wrongRenderersDataProvider()
return [
[['message_identifier' => []]],
[['message_identifier' => ['renderer' => 5]]],
- [['message_identifier' => ['renderer' => new \StdClass]]],
+ [['message_identifier' => ['renderer' => new \stdClass]]],
];
}
@@ -87,7 +87,7 @@ public function wrongDataDataProvider()
[
[
'message_identifier' =>
- ['renderer' => 'RendererCode', 'data' => new \StdClass]
+ ['renderer' => 'RendererCode', 'data' => new \stdClass]
]
],
];
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/ItemTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/ItemTest.php
index b2b1db44d6a0b..6ac8355fe7371 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/ItemTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/ItemTest.php
@@ -51,6 +51,9 @@ public function testToHtml($liParams, $innerText, $expectedHtml)
$this->assertEquals($expectedHtml, $this->item->toHtml());
}
+ /**
+ * @return array
+ */
public function toHtmlDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/LinkTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/LinkTest.php
index 785c41c1d6e2f..a16b1ca80c49e 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/LinkTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/LinkTest.php
@@ -54,6 +54,9 @@ public function testToHtml($liParams, $aParams, $innerText, $afterText, $expecte
$this->assertEquals($expectedHtml, $this->link->toHtml());
}
+ /**
+ * @return array
+ */
public function toHtmlDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php
index ffe3d3a173e47..a76dca703fedb 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php
@@ -54,6 +54,9 @@ public function testGetFiles(array $fixtureFiles, array $expectedFiles, $message
$this->assertSame($expectedFiles, $this->_model->getFiles($theme, '*.xml'), $message);
}
+ /**
+ * @return array
+ */
public function getFilesDataProvider()
{
$fileOne = new \Magento\Framework\View\File('b.xml', 'Fixture_ModuleB');
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/HelperMethodTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/HelperMethodTest.php
index 458b23a4b15eb..3d9166fc87f00 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/HelperMethodTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/HelperMethodTest.php
@@ -53,6 +53,11 @@ public function testEvaluate()
$this->assertSame($expected, $actual);
}
+ /**
+ * @param $input
+ *
+ * @return string
+ */
public function help($input)
{
$this->assertSame('some text (evaluated)', $input);
@@ -73,6 +78,9 @@ public function testEvaluateException($helperMethod, $expectedExceptionMessage)
$this->_model->evaluate($input);
}
+ /**
+ * @return array
+ */
public function evaluateExceptionDataProvider()
{
$nonExistingHelper = __CLASS__ . '::non_existing';
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/NamedParamsTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/NamedParamsTest.php
index 5ae0b0332f28a..c4fff297b4ec1 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/NamedParamsTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/NamedParamsTest.php
@@ -67,6 +67,9 @@ public function testEvaluateWrongParam($input, $expectedExceptionMessage)
$this->_model->evaluate($input);
}
+ /**
+ * @return array
+ */
public function evaluateWrongParamDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/OptionsTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/OptionsTest.php
index d3e91cb7c2b7e..24fd9f98d7112 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/OptionsTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/OptionsTest.php
@@ -72,6 +72,9 @@ public function testEvaluateWrongModel($input, $expectedException, $expectedExce
$this->_model->evaluate($input);
}
+ /**
+ * @return array
+ */
public function evaluateWrongModelDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/BuilderFactoryTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/BuilderFactoryTest.php
index 45754d0618d05..427e15d901d6d 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/BuilderFactoryTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/BuilderFactoryTest.php
@@ -65,6 +65,9 @@ public function testCreate($type, $arguments, $layoutBuilderClass)
$this->buildFactory->create($type, $arguments);
}
+ /**
+ * @return array
+ */
public function createDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ElementTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ElementTest.php
index ab5c908cb16af..a663b65561345 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ElementTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ElementTest.php
@@ -20,6 +20,9 @@ public function testGetElementName($xml, $name)
$this->assertEquals($name, $model->getElementName());
}
+ /**
+ * @return array
+ */
public function elementNameDataProvider()
{
return [
@@ -31,6 +34,9 @@ public function elementNameDataProvider()
];
}
+ /**
+ * @return array
+ */
public function cacheableDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php
index 1568c381226e2..158718587ad60 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php
@@ -158,6 +158,9 @@ public function testInterpret($element)
$this->model->interpret($this->context, $element);
}
+ /**
+ * @return array
+ */
public function interpretDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/LayoutTest.php b/lib/internal/Magento/Framework/View/Test/Unit/LayoutTest.php
index c0300164e26fe..f8a8939bbfe36 100755
--- a/lib/internal/Magento/Framework/View/Test/Unit/LayoutTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/LayoutTest.php
@@ -273,7 +273,7 @@ public function testGenerateXml()
->with($this->equalTo([]))
->will($this->returnSelf());
$this->assertSame($this->model, $this->model->generateXml());
- $this->assertSame('123 ', $this->model->getNode('some_update')->asXml());
+ $this->assertSame('123 ', $this->model->getNode('some_update')->asXML());
}
public function testGetChildBlock()
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php
index 4b000f09663b8..30dead438951a 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/Generator/HeadTest.php
@@ -140,6 +140,9 @@ public function testProcess($assets)
$this->assertEquals($this->headGenerator, $result);
}
+ /**
+ * @return array
+ */
public function testProcessAssetDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php
index 1f110a9ec19b5..adb7c4f4ddd86 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php
@@ -157,15 +157,14 @@ public function testRenderMetadata()
. ' ' . "\n"
. ' ' . "\n";
- $this->stringMock->expects($this->at(0))
- ->method('upperCaseWords')
- ->with('charset', '_', '')
- ->willReturn('Charset');
-
$this->pageConfigMock->expects($this->once())
->method('getCharset')
->willReturn($metadataValueCharset);
+ $this->pageConfigMock->expects($this->once())
+ ->method('getContentType')
+ ->willReturn('content_type_value');
+
$this->pageConfigMock
->expects($this->once())
->method('getMetadata')
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php
index 400e9cf3d1ed7..5bada08bbd00f 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php
@@ -141,8 +141,10 @@ public function testMetadata()
'robots' => null,
'name' => 'test_value',
'html_encoded' => '<title><span class="test">Test</span></title>',
+ 'title' => 'metatitle'
];
$this->model->setMetadata('name', 'test_value');
+ $this->model->setMetadata('title', 'metatitle');
$this->model->setMetadata('html_encoded', 'Test ');
$this->assertEquals($expectedMetadata, $this->model->getMetadata());
}
@@ -287,6 +289,9 @@ public function testAddPageAsset($file, $properties, $name, $expectedName)
);
}
+ /**
+ * @return array
+ */
public function pageAssetDataProvider()
{
return [
@@ -326,6 +331,9 @@ public function testAddRemotePageAsset($url, $contentType, $properties, $name, $
);
}
+ /**
+ * @return array
+ */
public function remotePageAssetDataProvider()
{
return [
@@ -382,6 +390,9 @@ public function testElementAttribute($elementType, $attribute, $value)
$this->assertEquals($value, $this->model->getElementAttribute($elementType, $attribute));
}
+ /**
+ * @return array
+ */
public function elementAttributeDataProvider()
{
return [
@@ -419,6 +430,9 @@ public function testElementAttributeException($elementType, $attribute, $value)
$this->model->setElementAttribute($elementType, $attribute, $value);
}
+ /**
+ * @return array
+ */
public function elementAttributeExceptionDataProvider()
{
return [
@@ -454,6 +468,9 @@ public function testElementAttributes($elementType, $attributes)
$this->assertEquals($attributes, $this->model->getElementAttributes($elementType));
}
+ /**
+ * @return array
+ */
public function elementAttributesDataProvider()
{
return [
@@ -478,6 +495,9 @@ public function testPageLayout($handle)
$this->assertEquals($handle, $this->model->getPageLayout());
}
+ /**
+ * @return array
+ */
public function pageLayoutDataProvider()
{
return [
@@ -538,6 +558,9 @@ public function testGetIncludes($isAvailable, $result)
$this->assertEquals($result, $model->getIncludes());
}
+ /**
+ * @return array
+ */
public function getIncludesDataProvider()
{
return [
diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php
index d30df5d76b75b..1fc6e92f87aa8 100644
--- a/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php
+++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php
@@ -38,6 +38,9 @@ public function testGetRequestedServicesSuccess($requestParamServices, $expected
$this->assertEquals($expectedResult, $this->request->getRequestedServices());
}
+ /**
+ * @return array
+ */
public function providerTestGetRequestedServicesSuccess()
{
$testModuleA = 'testModule1AllSoapAndRestV1';
diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php
index fe85e59221847..fd470f9d0c9c8 100644
--- a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php
+++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php
@@ -533,6 +533,9 @@ public function testCustomAttributesExceptions($inputData)
);
}
+ /**
+ * @return array
+ */
public function invalidCustomAttributesDataProvider()
{
return [
diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js
index 51ee9b3a8891a..ac154b333801d 100644
--- a/lib/web/mage/calendar.js
+++ b/lib/web/mage/calendar.js
@@ -236,12 +236,14 @@
firstDay = parseInt(this._get(inst, 'firstDay'), 10);
firstDay = isNaN(firstDay) ? 0 : firstDay;
- for (row; row < numMonths[0]; row++) {
+ for (row = 0; row < numMonths[0]; row++) {
this.maxRows = 4;
- for (col; col < numMonths[1]; col++) {
+ for (col = 0; col < numMonths[1]; col++) {
selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
+ calender = '';
+
if (isMultiMonth) {
calender += '' + this._get(inst, 'weekHeader') + '' : '';
- for (dow; dow < 7; dow++) { // days of the week
+ for (dow = 0; dow < 7; dow++) { // days of the week
day = (dow + firstDay) % 7;
thead += '
= 5 ?
' class="ui-datepicker-week-end"' : '') + '>' +
@@ -289,7 +291,7 @@
this.maxRows = numRows;
printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
- for (dRow; dRow < numRows; dRow++) { // create date picker rows
+ for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += ' ';
tbody = !showWeek ? '' : '' +
this._get(inst, 'calculateWeek')(printDate) + ' ';
diff --git a/lib/web/modernizr/modernizr.js b/lib/web/modernizr/modernizr.js
index 1bbdd114f343b..8c826fa18c582 100644
--- a/lib/web/modernizr/modernizr.js
+++ b/lib/web/modernizr/modernizr.js
@@ -910,7 +910,7 @@ window.Modernizr = (function( window, document, undefined ) {
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
} else {
- // If the upgraded input compontent rejects the :) text, we got a winner
+ // If the upgraded input component rejects the :) text, we got a winner
bool = inputElem.value != smile;
}
}
diff --git a/lib/web/tiny_mce/classes/ControlManager.js b/lib/web/tiny_mce/classes/ControlManager.js
index 51fa311525862..784042988c0ef 100644
--- a/lib/web/tiny_mce/classes/ControlManager.js
+++ b/lib/web/tiny_mce/classes/ControlManager.js
@@ -45,7 +45,7 @@
},
/**
- * Returns a control by id or undefined it it wasn't found.
+ * Returns a control by id or undefined it wasn't found.
*
* @method get
* @param {String} id Control instance name.
diff --git a/lib/web/tiny_mce/classes/Formatter.js b/lib/web/tiny_mce/classes/Formatter.js
index 0cbca75ec504b..5f05d3f3015ad 100644
--- a/lib/web/tiny_mce/classes/Formatter.js
+++ b/lib/web/tiny_mce/classes/Formatter.js
@@ -445,7 +445,7 @@
childCount = getChildCount(node);
// Remove empty nodes but only if there is multiple wrappers and they are not block
- // elements so never remove single since that would remove the currrent empty block element where the caret is at
+ // elements so never remove single since that would remove the current empty block element where the caret is at
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
dom.remove(node, 1);
return;
diff --git a/lib/web/tiny_mce/classes/dom/DOMUtils.js b/lib/web/tiny_mce/classes/dom/DOMUtils.js
index 783dbea1cacb9..eb8b4b7ab5d78 100644
--- a/lib/web/tiny_mce/classes/dom/DOMUtils.js
+++ b/lib/web/tiny_mce/classes/dom/DOMUtils.js
@@ -1106,7 +1106,7 @@
/**
* Returns a unique id. This can be useful when generating elements on the fly.
- * This method will not check if the element allready exists.
+ * This method will not check if the element already exists.
*
* @method uniqueId
* @param {String} p Optional prefix to add infront of all ids defaults to "mce_".
diff --git a/lib/web/tiny_mce/classes/html/Styles.js b/lib/web/tiny_mce/classes/html/Styles.js
index edf1e13a4e3bc..60c5565d72a99 100644
--- a/lib/web/tiny_mce/classes/html/Styles.js
+++ b/lib/web/tiny_mce/classes/html/Styles.js
@@ -79,7 +79,7 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
- // Get values and check it it needs compressing
+ // Get values and check it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
return;
diff --git a/lib/web/tiny_mce/plugins/autosave/editor_plugin_src.js b/lib/web/tiny_mce/plugins/autosave/editor_plugin_src.js
index e215f078c4b02..c147e4d8f87d5 100644
--- a/lib/web/tiny_mce/plugins/autosave/editor_plugin_src.js
+++ b/lib/web/tiny_mce/plugins/autosave/editor_plugin_src.js
@@ -20,14 +20,14 @@
* 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain
* on the client computer. Data stored in the localStorage area has no expiration date, so we must
* manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed
- * to be working in Firefox 3 and Safari 3.2, but in reality is flaky in those browsers. As
+ * to be working in Firefox 3 and Safari 3.2, but in reality it is flaky in those browsers. As
* HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,
* localStorage is stored in the following folder:
* C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]
*
* 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,
* except it is designed to expire after a certain amount of time. Because the specification
- * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and
+ * around expiration date/time is very loosely-described, it is preferable to use locaStorage and
* manage the expiration ourselves. sessionStorage has similar storage characteristics to
* localStorage, although it seems to have better support by Firefox 3 at the moment. (That will
* certainly change as Firefox continues getting better at HTML 5 adoption.)
diff --git a/lib/web/tiny_mce/tiny_mce_jquery_src.js b/lib/web/tiny_mce/tiny_mce_jquery_src.js
index b16d0e3ffdbb4..b3d77f6ce3139 100644
--- a/lib/web/tiny_mce/tiny_mce_jquery_src.js
+++ b/lib/web/tiny_mce/tiny_mce_jquery_src.js
@@ -1731,7 +1731,7 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
- // Get values and check it it needs compressing
+ // Get values and check it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
return;
@@ -14451,7 +14451,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
childCount = getChildCount(node);
// Remove empty nodes but only if there is multiple wrappers and they are not block
- // elements so never remove single since that would remove the currrent empty block element where the caret is at
+ // elements so never remove single since that would remove the current empty block element where the caret is at
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
dom.remove(node, 1);
return;
diff --git a/lib/web/tiny_mce/tiny_mce_prototype_src.js b/lib/web/tiny_mce/tiny_mce_prototype_src.js
index 1c7b76cf75c8b..daf2ad4e71bac 100644
--- a/lib/web/tiny_mce/tiny_mce_prototype_src.js
+++ b/lib/web/tiny_mce/tiny_mce_prototype_src.js
@@ -1483,7 +1483,7 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
- // Get values and check it it needs compressing
+ // Get values and check it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
return;
@@ -15301,7 +15301,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
childCount = getChildCount(node);
// Remove empty nodes but only if there is multiple wrappers and they are not block
- // elements so never remove single since that would remove the currrent empty block element where the caret is at
+ // elements so never remove single since that would remove the current empty block element where the caret is at
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
dom.remove(node, 1);
return;
diff --git a/lib/web/tiny_mce/tiny_mce_src.js b/lib/web/tiny_mce/tiny_mce_src.js
index a1ce5c5d8c32f..2634633d8eee5 100644
--- a/lib/web/tiny_mce/tiny_mce_src.js
+++ b/lib/web/tiny_mce/tiny_mce_src.js
@@ -1456,7 +1456,7 @@ tinymce.html.Styles = function(settings, schema) {
function compress(prefix, suffix) {
var top, right, bottom, left;
- // Get values and check it it needs compressing
+ // Get values and check it needs compressing
top = styles[prefix + '-top' + suffix];
if (!top)
return;
@@ -15275,7 +15275,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
childCount = getChildCount(node);
// Remove empty nodes but only if there is multiple wrappers and they are not block
- // elements so never remove single since that would remove the currrent empty block element where the caret is at
+ // elements so never remove single since that would remove the current empty block element where the caret is at
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
dom.remove(node, 1);
return;
diff --git a/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php b/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php
index e084cd8ff6cad..03b74f637a7da 100644
--- a/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php
@@ -157,6 +157,10 @@ private function clearChangelog()
}
}
+ /**
+ * @param \Magento\Setup\Fixtures\Fixture $fixture
+ * @param OutputInterface $output
+ */
private function executeFixture(\Magento\Setup\Fixtures\Fixture $fixture, OutputInterface $output)
{
$output->write('' . $fixture->getActionTitle() . '... ');
diff --git a/setup/src/Magento/Setup/Console/Style/MagentoStyle.php b/setup/src/Magento/Setup/Console/Style/MagentoStyle.php
index 4dec01f9497e1..614014a233657 100755
--- a/setup/src/Magento/Setup/Console/Style/MagentoStyle.php
+++ b/setup/src/Magento/Setup/Console/Style/MagentoStyle.php
@@ -518,6 +518,11 @@ private function autoPrependText()
}
}
+ /**
+ * @param $messages
+ *
+ * @return array
+ */
private function reduceBuffer($messages)
{
// We need to know if the two last chars are PHP_EOL
diff --git a/setup/src/Magento/Setup/Fixtures/StoresFixture.php b/setup/src/Magento/Setup/Fixtures/StoresFixture.php
index fb8679b5c879a..17b83e627ab9c 100644
--- a/setup/src/Magento/Setup/Fixtures/StoresFixture.php
+++ b/setup/src/Magento/Setup/Fixtures/StoresFixture.php
@@ -211,9 +211,6 @@ public function execute()
$this->generateWebsites();
$this->generateStoreGroups();
$this->generateStoreViews();
-
- //clean cache
- $this->storeManager->reinitStores();
}
/**
@@ -305,7 +302,6 @@ private function generateStoreViews()
'code' => $storeCode
]
)->save();
- $this->eventManager->dispatch('store_add', ['store' => $store]);
$this->saveStoreLocale($store->getId(), $localesList[$existedStoreViewsCount % $localesListCount]);
}
diff --git a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
index c2bdafa8df82e..2c4967c4c2ffd 100644
--- a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
+++ b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
@@ -286,7 +286,7 @@ private function checkPopulateRawPostSetting()
$data = [];
$error = false;
- $iniSetting = intVal(ini_get('always_populate_raw_post_data'));
+ $iniSetting = intval(ini_get('always_populate_raw_post_data'));
$checkVersionConstraint = $this->versionParser->parseConstraints('~5.6.0');
$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION);
@@ -302,7 +302,7 @@ private function checkPopulateRawPostSetting()
Please open your php.ini file and set always_populate_raw_post_data to -1.
If you need more help please call your hosting provider.',
PHP_VERSION,
- intVal(ini_get('always_populate_raw_post_data'))
+ intval(ini_get('always_populate_raw_post_data'))
);
$data['always_populate_raw_post_data'] = [
diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php
index 9c28c2be04262..2824b043a2743 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php
@@ -85,6 +85,9 @@ public function testExecute(array $outdatedInfo, $expectedMessage, $expectedCode
$this->assertSame($expectedCode, $tester->getStatusCode());
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DeployStaticContentCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DeployStaticContentCommandTest.php
index a5dc0d24feb7c..c3f79d92ec560 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DeployStaticContentCommandTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DeployStaticContentCommandTest.php
@@ -111,6 +111,9 @@ public function testExecute($input)
$tester->execute($input);
}
+ /**
+ * @return array
+ */
public function executeDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php
index 8bcee84d049b3..1ef3830636657 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php
@@ -51,6 +51,9 @@ public function testExecuteInteractionNo()
$this->checkInteraction(false);
}
+ /**
+ * @param $answer
+ */
public function checkInteraction($answer)
{
$question = $this->createMock(\Symfony\Component\Console\Helper\QuestionHelper::class);
diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Style/TestOutput.php b/setup/src/Magento/Setup/Test/Unit/Console/Style/TestOutput.php
index 1407e5ed183e4..183f659c42f23 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Style/TestOutput.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Style/TestOutput.php
@@ -20,6 +20,10 @@ public function clear()
$this->output = '';
}
+ /**
+ * @param string $message
+ * @param bool $newline
+ */
protected function doWrite($message, $newline)
{
$this->output .= $message . ($newline ? "\n" : '');
diff --git a/setup/src/Magento/Setup/Test/Unit/Fixtures/StoresFixtureTest.php b/setup/src/Magento/Setup/Test/Unit/Fixtures/StoresFixtureTest.php
index 1bedfd4b6b975..9fc74066e618c 100644
--- a/setup/src/Magento/Setup/Test/Unit/Fixtures/StoresFixtureTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Fixtures/StoresFixtureTest.php
@@ -75,7 +75,6 @@ public function testExecute()
'getDefaultStoreView',
'getStore',
'getStores',
- 'reinitStores'
]
)->getMock();
@@ -250,10 +249,6 @@ public function testExecute()
)
->willReturn($storeGroupMock);
- $this->storeManagerMock->expects($this->once())
- ->method('reinitStores')
- ->willReturn('void');
-
$this->storeManagerMock->expects($this->once())
->method('getGroups')
->willReturn([$storeGroupMock]);
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/SessionTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/SessionTest.php
index d37c07e715482..3893181d0c7f7 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/SessionTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/SessionTest.php
@@ -262,6 +262,9 @@ public function testValidationWithInvalidOptions($option, $invalidInput, $errorM
$this->assertSame($errorMessage, $errors[0]);
}
+ /**
+ * @return array
+ */
public function redisOptionProvider()
{
return [
@@ -286,6 +289,9 @@ public function redisOptionProvider()
];
}
+ /**
+ * @return array
+ */
public function invalidOptionsProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php
index 1bb60517d5e67..f342a11493498 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php
@@ -178,6 +178,9 @@ public function testValidateCacheHosts($hosts, $expectedError)
}
}
+ /**
+ * @return array
+ */
public function validateCacheHostsDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php
index b3e88272d13e8..59210df4f7bcf 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php
@@ -264,6 +264,9 @@ public function testExecuteWrongFormat(array $params)
$this->job->execute();
}
+ /**
+ * @return array
+ */
public function executeWrongFormatDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobFactoryTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobFactoryTest.php
index f96882c30136a..1f8a3fea16da2 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobFactoryTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobFactoryTest.php
@@ -206,16 +206,25 @@ public function testMaintenanceModeDisable()
// functions to override native php functions
namespace Magento\Setup\Model\Cron;
+/**
+ * @return string
+ */
function fopen()
{
return 'filestream';
}
+/**
+ * @return bool
+ */
function is_resource()
{
return true;
}
+/**
+ * @return string
+ */
function get_resource_type()
{
return 'stream';
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php
index f8f1d8542c38c..4a4ff2cb81e8d 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php
@@ -201,6 +201,9 @@ public function testRunReadinessCheckLastTimestamp()
namespace Magento\Setup\Model\Cron;
+/**
+ * @return int
+ */
function time()
{
return 100;
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/BrakeMixinTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/BrakeMixinTest.php
index e6c7b420b661d..dfa001f44bc66 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/BrakeMixinTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/BrakeMixinTest.php
@@ -25,6 +25,9 @@ public function testApply($subject, $expectedResult)
$this->assertEquals($expectedResult, $this->mixin->apply($subject));
}
+ /**
+ * @return array
+ */
public function getTestData()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/HeaderMixinTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/HeaderMixinTest.php
index 48280e9c6f543..bf915fecf4701 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/HeaderMixinTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/HeaderMixinTest.php
@@ -25,6 +25,9 @@ public function testApply($subject, $expectedResult)
$this->assertEquals($expectedResult, $this->mixin->apply($subject));
}
+ /**
+ * @return array
+ */
public function getTestData()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/RandomWordSelectorTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/RandomWordSelectorTest.php
index b21c687a30960..c24fa49fcac24 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/RandomWordSelectorTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/RandomWordSelectorTest.php
@@ -34,6 +34,9 @@ public function testRandomSelector($fixtureSource, $fixtureCount)
}
}
+ /**
+ * @return array
+ */
public function getTestData()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/WordWrapperTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/WordWrapperTest.php
index 58e07df7391fc..7d3cbcdd00c71 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/WordWrapperTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/Helper/WordWrapperTest.php
@@ -30,6 +30,9 @@ public function testWrapping($inputData, $expectedResult)
);
}
+ /**
+ * @return array
+ */
public function getTestData()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/ParagraphMixinTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/ParagraphMixinTest.php
index a522963d212ef..4fdb3090992bb 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/ParagraphMixinTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Description/Mixin/ParagraphMixinTest.php
@@ -25,6 +25,9 @@ public function testApply($subject, $expectedResult)
$this->assertEquals($expectedResult, $this->mixin->apply($subject));
}
+ /**
+ * @return array
+ */
public function getTestData()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php
index 90c26b5632d21..11dca34763a05 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php
@@ -39,6 +39,9 @@ public function testMap($packageType, $expected)
);
}
+ /**
+ * @return array
+ */
public function mapDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ObjectManagerProviderTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ObjectManagerProviderTest.php
index 9f59479ef0f0d..9d40b053e394e 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/ObjectManagerProviderTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/ObjectManagerProviderTest.php
@@ -83,6 +83,9 @@ public function testGet()
$this->assertInstanceOf(ObjectManagerInterface::class, $this->model->get());
}
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
private function getCommandListMock()
{
$commandMock = $this->getMockBuilder(Command::class)->disableOriginalConstructor()->getMock();
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PayloadValidatorTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PayloadValidatorTest.php
index 192717e1d319b..2d7685c2021cc 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/PayloadValidatorTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/PayloadValidatorTest.php
@@ -38,6 +38,9 @@ public function testValidatePayLoad($type, $has, $moduleExists)
$this->assertEquals('', $this->model->validatePayload($type));
}
+ /**
+ * @return array
+ */
public function validatePayLoadDataProvider()
{
return [
@@ -61,6 +64,9 @@ public function testValidatePayLoadNegativeCases($type, $has, $moduleExists, $er
$this->assertStringStartsWith($errorMessage, $this->model->validatePayload($type));
}
+ /**
+ * @return array
+ */
public function validatePayLoadNegativeCasesDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
index f543e77787f9d..13f5b6940d846 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php
@@ -411,6 +411,11 @@ protected function isPhp7OrHhvm()
namespace Magento\Setup\Model;
+/**
+ * @param $param
+ *
+ * @return int|string
+ */
function ini_get($param)
{
if ($param === 'xdebug.max_nesting_level') {
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/WebLoggerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/WebLoggerTest.php
index b3ac6ad286e44..a55c50eeaa736 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/WebLoggerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/WebLoggerTest.php
@@ -184,6 +184,9 @@ public function testClearNotExist()
$this->webLogger->clear();
}
+ /**
+ * @return string
+ */
public static function readLog()
{
return self::$log;
@@ -202,6 +205,9 @@ public static function deleteLog()
self::$log = '';
}
+ /**
+ * @return bool
+ */
public static function isExist()
{
return self::$log != '';
diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/ClassReaderDecoratorTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/ClassReaderDecoratorTest.php
index 7d8ce3ac564b3..ebb6560f9337d 100644
--- a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/ClassReaderDecoratorTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/ClassReaderDecoratorTest.php
@@ -46,6 +46,9 @@ public function testGetConstructor($expectation, $className, $willReturn)
);
}
+ /**
+ * @return array
+ */
public function getConstructorDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php
index 68d76980e1057..dcb9a287f787b 100644
--- a/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php
+++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/_files/app/code/Magento/SomeModule/Helper/Test.php
@@ -25,6 +25,13 @@ class Test
*/
protected $_newElementFactory;
+ /**
+ * Test constructor.
+ *
+ * @param \Magento\SomeModule\Module\Factory $factory
+ * @param \Magento\SomeModule\Element\Factory $elementFactory
+ * @param \Magento\SomeModule\ElementFactory $rightElementFactory
+ */
public function __construct(
\Magento\SomeModule\Module\Factory $factory,
\Magento\SomeModule\Element\Factory $elementFactory,
diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/AbstractParserTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/AbstractParserTest.php
index 3c744bb44d32a..c698d4c344df8 100644
--- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/AbstractParserTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/AbstractParserTest.php
@@ -39,6 +39,9 @@ public function testValidateOptions($options, $message)
$this->_parserMock->parse($options);
}
+ /**
+ * @return array
+ */
public function dataProviderForValidateOptions()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Setup/SetupCacheTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Setup/SetupCacheTest.php
index 15a55bd23b164..573c8b132ca41 100644
--- a/setup/src/Magento/Setup/Test/Unit/Module/Setup/SetupCacheTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Module/Setup/SetupCacheTest.php
@@ -88,6 +88,9 @@ public function testHas($table, $parentId, $rowId, $field, $expected)
$this->assertSame($expected, $this->object->has($table, $parentId, $rowId, $field));
}
+ /**
+ * @return array
+ */
public function hasDataProvider()
{
return [
diff --git a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php
index a35007189a9ca..f0a9d5316b3a6 100644
--- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php
@@ -144,6 +144,9 @@ public function testCreateService($zfAppConfig, $env, $cliParam, $expectedArray)
$this->assertEquals($expectedArray, $listener->createService($serviceLocator));
}
+ /**
+ * @return array
+ */
public function createServiceDataProvider()
{
return [