diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8186b776232..e4b7a0c1ea743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,60 @@ +2.1.14 +============= +* GitHub issues: + * [#7723](https://github.com/magento/magento2/issues/7723) -- Catalog rule contains-condition not saving multiple selection in 2.1.2 (fixed in [magento/magento2#13546](https://github.com/magento/magento2/pull/13546)) + * [#13214](https://github.com/magento/magento2/issues/13214) -- Not a correct displaying for Robots.txt (fixed in [magento/magento2#13550](https://github.com/magento/magento2/pull/13550)) + * [#13315](https://github.com/magento/magento2/issues/13315) -- Mobile "Payment Methods" step looks bad on mobile (fixed in [magento/magento2#13980](https://github.com/magento/magento2/pull/13980)) + * [#13474](https://github.com/magento/magento2/issues/13474) -- [2.1.10] Swagger not working for multistore installs? (fixed in [magento/magento2#13486](https://github.com/magento/magento2/pull/13486)) + * [#4173](https://github.com/magento/magento2/issues/4173) -- Cron schedule bug (fixed in [magento/magento2#14096](https://github.com/magento/magento2/pull/14096)) + * [#5808](https://github.com/magento/magento2/issues/5808) -- [2.1.0] Problem on mobile when catalog gallery allowfullscreen is false (fixed in [magento/magento2#14098](https://github.com/magento/magento2/pull/14098)) + * [#6694](https://github.com/magento/magento2/issues/6694) -- Override zip_codes.xml (fixed in [magento/magento2#14117](https://github.com/magento/magento2/pull/14117)) + * [#10559](https://github.com/magento/magento2/issues/10559) -- Extending swatch functionality using javascript mixins does not work in Safari and MS Edge (fixed in [magento/magento2#12928](https://github.com/magento/magento2/pull/12928)) + * [#3489](https://github.com/magento/magento2/issues/3489) -- CURL Json POST (fixed in [magento/magento2#14151](https://github.com/magento/magento2/pull/14151)) + * [#5463](https://github.com/magento/magento2/issues/5463) -- The ability to store passwords using different hashing algorithms is limited (fixed in [magento/magento2#13886](https://github.com/magento/magento2/pull/13886)) + * [#3882](https://github.com/magento/magento2/issues/3882) -- An XML comment node as parameter in widget.xml fails with fatal error (fixed in [magento/magento2#14219](https://github.com/magento/magento2/pull/14219)) + * [#1931](https://github.com/magento/magento2/issues/1931) -- Can't cancel removal of a block or container in layout by setting remove attribute value to false (fixed in [magento/magento2#14198](https://github.com/magento/magento2/pull/14198)) + * [#7403](https://github.com/magento/magento2/issues/7403) -- JS Translation Regex leads to unexpected results and untranslatable strings (fixed in [magento/magento2#14349](https://github.com/magento/magento2/pull/14349)) + * [#7816](https://github.com/magento/magento2/issues/7816) -- Customer_account.xml file abused (fixed in [magento/magento2#14323](https://github.com/magento/magento2/pull/14323)) + * [#10700](https://github.com/magento/magento2/issues/10700) -- Magento 2 Admin panel show loading on each page (fixed in [magento/magento2#14417](https://github.com/magento/magento2/pull/14417)) + * [#11930](https://github.com/magento/magento2/issues/11930) -- setup:di:compile's generated cache files inaccessible by the web-server user (fixed in [magento/magento2#14417](https://github.com/magento/magento2/pull/14417)) + * [#14572](https://github.com/magento/magento2/issues/14572) -- Specify the table when adding field to filter for the collection Eav/Model/ResourceModel/Entity/Attribute/Option/Collection.php (fixed in [magento/magento2#14596](https://github.com/magento/magento2/pull/14596)) +* GitHub pull requests: + * [magento/magento2#13949](https://github.com/magento/magento2/pull/13949) -- Fix misnamed namespace (by @Ethan3600) + * [magento/magento2#13545](https://github.com/magento/magento2/pull/13545) -- Backport of PR-5028 for Magento 2.1: Load jquery using requirejs to p… (by @hostep) + * [magento/magento2#13546](https://github.com/magento/magento2/pull/13546) -- Backport of PR-8246 for Magento 2.1: Fixes #7723 - saving multi selec… (by @hostep) + * [magento/magento2#13550](https://github.com/magento/magento2/pull/13550) -- Backport of MAGETWO-84006 for Magento 2.1: Fix robots.txt content typ… (by @hostep) + * [magento/magento2#13896](https://github.com/magento/magento2/pull/13896) -- MAGETWO-59112 Backport 2.1.x (by @Ctucker9233) + * [magento/magento2#13812](https://github.com/magento/magento2/pull/13812) -- [Backport 2.1] Add RewriteBase directive template in .htaccess file into pub/static folder (by @ccasciotti) + * [magento/magento2#13658](https://github.com/magento/magento2/pull/13658) -- [Backport 2.1-develop] Show redirect_to_base config in store scope (by @JeroenVanLeusden) + * [magento/magento2#13980](https://github.com/magento/magento2/pull/13980) -- Backport of PR-13777. Mobile 'Payments methods' step looks bad on mobile (by @Frodigo) + * [magento/magento2#13987](https://github.com/magento/magento2/pull/13987) -- Backport of PR-13750 for Magento 2.1: Less clean up (by @Karlasa) + * [magento/magento2#14022](https://github.com/magento/magento2/pull/14022) -- fix catalog_rule_promo_catalog_edit.xml layout (by @Karlasa) + * [magento/magento2#13806](https://github.com/magento/magento2/pull/13806) -- [Backport 2.1] Add quoting for base path in DI compile command (by @simpleadm) + * [magento/magento2#13486](https://github.com/magento/magento2/pull/13486) -- [Backport 2.1-develop] Change the store code in Swagger based on a param (by @JeroenVanLeusden) + * [magento/magento2#14096](https://github.com/magento/magento2/pull/14096) -- [Backport 2.1] Schedule generation was broken (by @simpleadm) + * [magento/magento2#14098](https://github.com/magento/magento2/pull/14098) -- [Backport 2.1] MAGETWO-64250 Problem on mobile when catalog gallery allowfullscreen is false (by @simpleadm) + * [magento/magento2#14115](https://github.com/magento/magento2/pull/14115) -- [Backport 2.1] MAGETWO-71697: Fix possible bug when saving address with empty street line (by @simpleadm) + * [magento/magento2#14117](https://github.com/magento/magento2/pull/14117) -- [Backport 2.1] MAGETWO-59258: Override module-directory/etc/zip_codes.xml only the last code of a country gets include (by @simpleadm) + * [magento/magento2#12928](https://github.com/magento/magento2/pull/12928) -- Issues #10559 - Extend swatch using mixins (M2.1) (by @srenon) + * [magento/magento2#14151](https://github.com/magento/magento2/pull/14151) -- [Backport 2.1] 8373: Fix CURL Json POST (by @simpleadm) + * [magento/magento2#13886](https://github.com/magento/magento2/pull/13886) -- #5463 - Use specified hashing algo in \Magento\Framework\Encryption\Encryptor::getHash (by @k4emic) + * [magento/magento2#14168](https://github.com/magento/magento2/pull/14168) -- [Backport 2.1] Added mage/translate component to customers's ajax login (by @ccasciotti) + * [magento/magento2#13654](https://github.com/magento/magento2/pull/13654) -- [Backport 2.1-develop] Update Store getConfig() to respect valid false return value (by @JeroenVanLeusden) + * [magento/magento2#14219](https://github.com/magento/magento2/pull/14219) -- Backport of PR-8772 for Magento 2.1: magento/magento2#3882 (by @hostep) + * [magento/magento2#14198](https://github.com/magento/magento2/pull/14198) -- [Backport] Can't cancel removal of a block or container in layout by setting remove attribute value to false (by @quisse) + * [magento/magento2#14349](https://github.com/magento/magento2/pull/14349) -- Backport of PR-10445 for Magento 2.1: Fix JS translation search (by @hostep) + * [magento/magento2#14332](https://github.com/magento/magento2/pull/14332) -- Backport: Fix for broken navigation menu on IE11 #14230 (by @sergiy-v) + * [magento/magento2#14323](https://github.com/magento/magento2/pull/14323) -- #7816: Customer_account.xml file abused (2.1) (by @mikewhitby) + * [magento/magento2#14417](https://github.com/magento/magento2/pull/14417) -- [BACKPORT 2.1] Removed cache backend option which explicitly set file permissions (by @xtremeperf) + * [magento/magento2#14436](https://github.com/magento/magento2/pull/14436) -- Fix HTML tags in meta description (by @vseager) + * [magento/magento2#14480](https://github.com/magento/magento2/pull/14480) -- [Backport 2.1] Return status in console commands (by @simpleadm) + * [magento/magento2#14497](https://github.com/magento/magento2/pull/14497) -- [backport] fix for button color in email template (by @Karlasa) + * [magento/magento2#14348](https://github.com/magento/magento2/pull/14348) -- [Backport 2.1] Add json and xml support to the post method in socket client (by @simpleadm) + * [magento/magento2#14479](https://github.com/magento/magento2/pull/14479) -- [Backport 2.1] Configurable product price options by store (by @simpleadm) + * [magento/magento2#14505](https://github.com/magento/magento2/pull/14505) -- [Backport] Check if store id is not null instead of empty (by @quisse) + * [magento/magento2#14524](https://github.com/magento/magento2/pull/14524) -- [backport] fix translation issue with rating stars (by @Karlasa) + * [magento/magento2#14596](https://github.com/magento/magento2/pull/14596) -- Specify the table when adding field to filter (by @PierreLeMaguer) + 2.1.13 ============= * GitHub issues: 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 5d16f6b3cfbed..7ffc6a5f35370 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->getMock('stdClass', ['getCacheType']); @@ -95,6 +98,9 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes) $this->assertEquals($expected, $this->_messageModel->isDisplayed()); } + /** + * @return array + */ public function isDisplayedDataProvider() { $cacheTypesMock = $this->getMock('stdClass', ['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 bf7ac5e80da35..f37e32cc81e5d 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 @@ -69,6 +69,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 eedc10bd94f46..959eb3b9e417d 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 @@ -79,6 +79,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/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php index 657ed7629f8e6..341fc57df6661 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 @@ -198,6 +198,9 @@ public function testIsValidAddMessagesCall($value, $hasEmptyColumns, $customerGr $this->tierPrice->isValid($value); } + /** + * @return array + */ public function isValidResultFalseDataProvider() { return [ @@ -303,6 +306,9 @@ public function isValidResultFalseDataProvider() ]; } + /** + * @return array + */ public function isValidAddMessagesCallDataProvider() { return [ 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 3fa87961edc00..f3d19429ef3cf 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 @@ -127,6 +127,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 8c19aa20da0a6..b440ffd8dc4fa 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 @@ -76,6 +76,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 f2deae44de939..45b035e58153d 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php @@ -751,6 +751,9 @@ public function testSaveProductPrices($priceData, $oldSkus, $priceIn, $callNum) $this->invokeMethod($this->advancedPricing, 'saveProductPrices', [$priceData, 'table']); } + /** + * @return array + */ public function saveProductPricesDataProvider() { return [ @@ -822,6 +825,9 @@ public function testDeleteProductTierPrices( ); } + /** + * @return array + */ public function deleteProductTierPricesDataProvider() { return [ @@ -904,6 +910,9 @@ public function testProcessCountExistingPrices( $this->invokeMethod($this->advancedPricing, 'processCountExistingPrices', [$prices, 'table']); } + /** + * @return array + */ public function processCountExistingPricesDataProvider() { return [ 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 9ad1001b4ed6d..13879e3e8a014 100644 --- a/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php +++ b/app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php @@ -75,6 +75,9 @@ public function testGetAllowedResourcesByUser() ); } + /** + * @return AclRetriever + */ protected function createAclRetriever() { $this->roleMock = $this->getMock( 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 ba982238b4f72..9122ee6351e41 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,13 @@ 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/Model/Config/SessionLifetime/BackendModel.php b/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php index 2d0be0f358af8..becd09900fd8a 100644 --- a/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php +++ b/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php @@ -19,6 +19,10 @@ class BackendModel extends Value /** Minimum admin session lifetime */ const MIN_LIFETIME = 60; + /** + * @return Value + * @throws LocalizedException + */ public function beforeSave() { $value = (int) $this->getValue(); diff --git a/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php b/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php index a807b3f7ecce7..c6d6d7ff3dc92 100644 --- a/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php +++ b/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php @@ -13,6 +13,14 @@ */ class Block extends Layout\Reader\Block { + /** + * Block constructor. + * @param Layout\ScheduledStructure\Helper $helper + * @param Layout\Argument\Parser $argumentParser + * @param Layout\ReaderPool $readerPool + * @param InterpreterInterface $argumentInterpreter + * @param null $scopeType + */ public function __construct( Layout\ScheduledStructure\Helper $helper, Layout\Argument\Parser $argumentParser, 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 38fb170999ee3..fedd5be0ba8df 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 @@ -149,6 +149,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 bea68dccf5c2e..26ce40281b395 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 @@ -75,6 +75,9 @@ public function testAroundDispatchWhenMassactionPrepareKeyRequestExists($postDat ); } + /** + * @return array + */ public function aroundDispatchDataProvider() { 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 0fe23b283a5ab..11a91c8e53a00 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 3a2f793c2f298..5903d41f79c3c 100644 --- a/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php +++ b/app/code/Magento/Backend/Test/Unit/App/ConfigTest.php @@ -79,6 +79,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/Cache/AdditionalTest.php b/app/code/Magento/Backend/Test/Unit/Block/Cache/AdditionalTest.php index caf3247606d7f..2856da805e2b0 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/Widget/ButtonTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php index a40c13b81409f..8536ff3dd77ec 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 addc1af81ebfc..d68e951b5ced6 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 @@ -60,6 +60,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 a7c9e8ac082d9..55ea0ba9bd39c 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 @@ -69,6 +69,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 e5d8273ca02f3..37e60c1ad14b9 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 @@ -91,6 +91,9 @@ public function testGetSortable($value) $this->assertFalse($this->_block->getSortable()); } + /** + * @return array + */ public function getSortableDataProvider() { return ['zero' => ['0'], 'false' => [false], 'null' => [null]]; @@ -379,6 +382,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 7c1d32fa18820..39672d68015cf 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 @@ -155,6 +155,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 23584ee41736a..57b587670d2c7 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 @@ -154,6 +154,9 @@ public function testItemsProcessing($itemId, $item, $expectedItem) $this->assertNull($this->_block->getItem($itemId)); } + /** + * @return array + */ public function itemsDataProvider() { return [ @@ -204,6 +207,9 @@ public function testSelected($param, $expectedJson, $expected) $this->assertEquals($expected, $this->_block->getSelected()); } + /** + * @return array + */ public function selectedDataProvider() { return [ @@ -259,6 +265,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/TabTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/TabTest.php index 7f6d1fddaa983..d82dde284f822 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 b28d900a4ce84..67c15ccfd54d7 100644 --- a/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Backend/Test/Unit/Helper/DataTest.php @@ -66,6 +66,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 f8f8e07e8dc80..3cfef01d588e1 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php @@ -130,6 +130,9 @@ public function testRefreshAcl($isUserPassedViaParams) $this->assertSame($aclMock, $this->session->getAcl()); } + /** + * @return array + */ public function refreshAclDataProvider() { return [ @@ -235,6 +238,9 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect $this->assertEquals($expectedResult, $this->session->isAllowed('resource')); } + /** + * @return array + */ public function isAllowedDataProvider() { return [ @@ -255,6 +261,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 522eef3b25383..f6ae5b2ed5d1d 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 @@ -24,6 +24,9 @@ public function testBeforeSave($value, $errorMessage = null) $model->beforeSave(); } + /** + * @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 8a7d3ba9f74d6..cb34363f36f4a 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/ConfigTest.php @@ -194,6 +194,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 0b163718bfdfb..aae73eb27546d 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 6067ccd0d1081..f965dbeab36a6 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 8d04457687298..6cb457733e2ae 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php @@ -141,6 +141,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 a7617c2314707..271ddc91ca605 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/Backend/composer.json b/app/code/Magento/Backend/composer.json index ffbe1007d3a35..a1f57203b2191 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -22,7 +22,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.8", + "version": "100.1.9", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php b/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php index b8b9a693a24e4..c8369825322f8 100644 --- a/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php +++ b/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php @@ -21,6 +21,12 @@ class VaultTokenRenderer extends AbstractTokenRenderer */ private $config; + /** + * VaultTokenRenderer constructor. + * @param Template\Context $context + * @param Config $config + * @param array $data + */ public function __construct( Template\Context $context, Config $config, diff --git a/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php index 1ebec5226e629..6387297148c6b 100644 --- a/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php +++ b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php @@ -35,6 +35,13 @@ class Config extends \Magento\Payment\Gateway\Config\Config */ private $icon = []; + /** + * Config constructor. + * @param ScopeConfigInterface $scopeConfig + * @param CcConfig $ccConfig + * @param null $methodCode + * @param string $pathPattern + */ public function __construct( ScopeConfigInterface $scopeConfig, CcConfig $ccConfig, diff --git a/app/code/Magento/Braintree/Model/Report/FilterMapper.php b/app/code/Magento/Braintree/Model/Report/FilterMapper.php index dcfa721bc6c0a..a63a85ab3d47d 100644 --- a/app/code/Magento/Braintree/Model/Report/FilterMapper.php +++ b/app/code/Magento/Braintree/Model/Report/FilterMapper.php @@ -24,6 +24,11 @@ class FilterMapper /** @var BraintreeSearchAdapter */ private $braintreeSearchAdapter; + /** + * FilterMapper constructor. + * @param AppliersPool $appliersPool + * @param BraintreeSearchAdapter $braintreeSearchAdapter + */ public function __construct( AppliersPool $appliersPool, BraintreeSearchAdapter $braintreeSearchAdapter diff --git a/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php index 94388d259604a..2e70d031b559a 100644 --- a/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php +++ b/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php @@ -28,12 +28,20 @@ class ConfigProvider implements ConfigProviderInterface */ private $resolver; + /** + * ConfigProvider constructor. + * @param Config $config + * @param ResolverInterface $resolver + */ public function __construct(Config $config, ResolverInterface $resolver) { $this->config = $config; $this->resolver = $resolver; } + /** + * @return array + */ public function getConfig() { return [ diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index affabcb7be4f3..ec6e0df0c43e4 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -497,12 +497,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option, foreach ($selections as $selection) { if ($selection->getProductId() == $optionProduct->getId()) { - foreach ($options as &$option) { - if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) { + foreach ($options as $quoteItemOption) { + if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) { if ($optionUpdateFlag) { - $option->setValue(intval($option->getValue())); + $quoteItemOption->setValue(intval($quoteItemOption->getValue())); } else { - $option->setValue($value); + $quoteItemOption->setValue($value); } } } 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 0e47d32ea93ed..a340999c186cb 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 @@ -43,6 +43,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass) $this->assertSame(null, $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenEmptyItemsDataProvider() { return [ @@ -82,6 +85,9 @@ public function testGetChildren($parentItem) $this->assertSame([2 => $this->orderItem], $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenDataProvider() { return [ @@ -101,6 +107,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isShipmentSeparately()); } + /** + * @return array + */ public function isShipmentSeparatelyWithoutItemDataProvider() { return [ @@ -129,6 +138,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem)); } + /** + * @return array + */ public function isShipmentSeparatelyWithItemDataProvider() { return [ @@ -150,6 +162,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isChildCalculated()); } + /** + * @return array + */ public function isChildCalculatedWithoutItemDataProvider() { return [ @@ -178,6 +193,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI $this->assertSame($result, $this->model->isChildCalculated($this->orderItem)); } + /** + * @return array + */ public function isChildCalculatedWithItemDataProvider() { return [ @@ -197,6 +215,9 @@ public function testGetSelectionAttributes($productOptions, $result) $this->assertSame($result, $this->model->getSelectionAttributes($this->orderItem)); } + /** + * @return array + */ public function getSelectionAttributesDataProvider() { return [ @@ -236,6 +257,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 57f01e23e6cf6..557712c84bb32 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 @@ -38,6 +38,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isShipmentSeparately()); } + /** + * @return array + */ public function isShipmentSeparatelyWithoutItemDataProvider() { return [ @@ -66,6 +69,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem)); } + /** + * @return array + */ public function isShipmentSeparatelyWithItemDataProvider() { return [ @@ -87,6 +93,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isChildCalculated()); } + /** + * @return array + */ public function isChildCalculatedWithoutItemDataProvider() { return [ @@ -115,6 +124,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI $this->assertSame($result, $this->model->isChildCalculated($this->orderItem)); } + /** + * @return array + */ public function isChildCalculatedWithItemDataProvider() { return [ @@ -134,6 +146,9 @@ public function testGetSelectionAttributes($productOptions, $result) $this->assertSame($result, $this->model->getSelectionAttributes($this->orderItem)); } + /** + * @return array + */ public function getSelectionAttributesDataProvider() { return [ @@ -167,6 +182,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 187c552b89347..8ae03aa840cc2 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 @@ -315,6 +315,10 @@ private function setupBundleBlock($options, $priceInfo, $priceType) return $bundleBlock; } + /** + * @param $price + * @return \PHPUnit_Framework_MockObject_MockObject + */ private function getPriceInfoMock($price) { $priceInfoMock = $this->getMockBuilder('\Magento\Framework\Pricing\PriceInfo\Base') @@ -339,6 +343,10 @@ 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 10aa69acb8dc8..b3fc0ee0ffb00 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 @@ -43,6 +43,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass) $this->assertSame(null, $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenEmptyItemsDataProvider() { return [ @@ -82,6 +85,9 @@ public function testGetChildren($parentItem) $this->assertSame([2 => $this->orderItem], $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenDataProvider() { return [ @@ -101,6 +107,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isShipmentSeparately()); } + /** + * @return array + */ public function isShipmentSeparatelyWithoutItemDataProvider() { return [ @@ -129,6 +138,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem)); } + /** + * @return array + */ public function isShipmentSeparatelyWithItemDataProvider() { return [ @@ -150,6 +162,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isChildCalculated()); } + /** + * @return array + */ public function isChildCalculatedWithoutItemDataProvider() { return [ @@ -178,6 +193,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI $this->assertSame($result, $this->model->isChildCalculated($this->orderItem)); } + /** + * @return array + */ public function isChildCalculatedWithItemDataProvider() { return [ @@ -197,6 +215,9 @@ public function testGetSelectionAttributes($productOptions, $result) $this->assertSame($result, $this->model->getSelectionAttributes($this->orderItem)); } + /** + * @return array + */ public function getSelectionAttributesDataProvider() { return [ @@ -218,6 +239,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 2768455d91134..20329e737cdb6 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 @@ -43,6 +43,9 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass) $this->assertSame(null, $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenEmptyItemsDataProvider() { return [ @@ -82,6 +85,9 @@ public function testGetChildren($parentItem) $this->assertSame([2 => $this->orderItem], $this->model->getChildren($item)); } + /** + * @return array + */ public function getChildrenDataProvider() { return [ @@ -101,6 +107,9 @@ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isShipmentSeparately()); } + /** + * @return array + */ public function isShipmentSeparatelyWithoutItemDataProvider() { return [ @@ -129,6 +138,9 @@ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $pare $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem)); } + /** + * @return array + */ public function isShipmentSeparatelyWithItemDataProvider() { return [ @@ -150,6 +162,9 @@ public function testIsChildCalculatedWithoutItem($productOptions, $result) $this->assertSame($result, $this->model->isChildCalculated()); } + /** + * @return array + */ public function isChildCalculatedWithoutItemDataProvider() { return [ @@ -178,6 +193,9 @@ public function testIsChildCalculatedWithItem($productOptions, $result, $parentI $this->assertSame($result, $this->model->isChildCalculated($this->orderItem)); } + /** + * @return array + */ public function isChildCalculatedWithItemDataProvider() { return [ @@ -198,6 +216,9 @@ public function testGetBundleOptions($productOptions, $result) $this->assertSame($result, $this->model->getBundleOptions()); } + /** + * @return array + */ public function getBundleOptionsDataProvider() { return [ @@ -215,6 +236,9 @@ public function testGetSelectionAttributes($productOptions, $result) $this->assertSame($result, $this->model->getSelectionAttributes($this->orderItem)); } + /** + * @return array + */ public function getSelectionAttributesDataProvider() { return [ @@ -254,6 +278,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 f929c4c71e376..e00a327448fb5 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php @@ -608,6 +608,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/BundleOptionPriceTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionPriceTest.php index 9f7fc6c3cf09f..5ace13d17dbac 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionPriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionPriceTest.php @@ -159,6 +159,9 @@ protected 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 b2fcca66e3465..6643a25fdf429 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php @@ -132,6 +132,10 @@ protected function setUp() $this->setupSelectionPrice(); } + /** + * @param bool $useRegularPrice + * @param int $qty + */ protected function setupSelectionPrice($useRegularPrice = false, $qty = 1) { $this->selectionPrice = new \Magento\Bundle\Pricing\Price\BundleSelectionPrice( @@ -306,6 +310,9 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) $this->assertEquals($expectedPrice, $this->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 d7a5c8c9a4b73..e82ccee347f42 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 a51a7838b0631..8a50880b5191e 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php @@ -82,6 +82,9 @@ public function testSendPurgeRequest($hosts) $this->assertTrue($this->model->sendPurgeRequest('tags')); } + /** + * @return array + */ public function sendPurgeRequestDataProvider() { return [ diff --git a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php index 0d4b56bf0ac89..2db847bcb6a51 100644 --- a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php +++ b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php @@ -15,7 +15,7 @@ class DefaultCaptcha extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'default.phtml'; + protected $_template = 'Magento_Captcha::default.phtml'; /** * @var string diff --git a/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php b/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php index 150d8614edf59..30c36029c92df 100644 --- a/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php @@ -364,6 +364,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/Adminhtml/Category/AssignProducts.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AssignProducts.php index 00f1ca6ee0d9b..2c4216c7ccbe2 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AssignProducts.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AssignProducts.php @@ -13,7 +13,7 @@ class AssignProducts extends \Magento\Backend\Block\Template * * @var string */ - protected $_template = 'catalog/category/edit/assign_products.phtml'; + protected $_template = 'Magento_Catalog::catalog/category/edit/assign_products.phtml'; /** * @var \Magento\Catalog\Block\Adminhtml\Category\Tab\Product @@ -87,6 +87,7 @@ public function getProductsJson() } return '{}'; } + /** * Retrieve current category instance * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index e3bfee0b862e0..9db485a16529e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -27,7 +27,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @var string */ - protected $_template = 'catalog/category/tree.phtml'; + protected $_template = 'Magento_Catalog::catalog/category/tree.phtml'; /** * @var \Magento\Backend\Model\Auth\Session diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php index 5decc60d72c5a..f7fa5a0a215b1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php @@ -24,7 +24,7 @@ class Chooser extends \Magento\Catalog\Block\Adminhtml\Category\Tree * * @var string */ - protected $_template = 'catalog/category/widget/tree.phtml'; + protected $_template = 'Magento_Catalog::catalog/category/widget/tree.phtml'; /** * @return void diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php index 460184fa944e9..ff6d8459732bd 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -18,7 +18,7 @@ class Main extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'catalog/product/attribute/set/main.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/attribute/set/main.phtml'; /** * Core registry diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Tree/Group.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Tree/Group.php index cf8de44c3d9df..93c2dcc76263c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Tree/Group.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Tree/Group.php @@ -14,5 +14,5 @@ class Group extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'catalog/product/attribute/set/main/tree/group.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/attribute/set/main/tree/group.phtml'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php index b898cc12e6733..356350f0147ed 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php @@ -18,7 +18,7 @@ class Add extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'catalog/product/attribute/set/toolbar/add.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/attribute/set/toolbar/add.phtml'; /** * @return AbstractBlock diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php index 8902e18967b49..24d8f2fa41652 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php @@ -16,7 +16,7 @@ class Main extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'catalog/product/attribute/set/toolbar/main.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/attribute/set/toolbar/main.phtml'; /** * @return $this diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php index f7b36612d9688..f0167b36fca54 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php @@ -21,7 +21,7 @@ class Configure extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'catalog/product/composite/configure.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/composite/configure.phtml'; /** * Core registry diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php index d11c584a264c3..41be037d6f0e0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php @@ -17,7 +17,7 @@ class Edit extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'catalog/product/edit.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit.phtml'; /** * Core registry diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php index 33aaf0ae1aa66..ce5264a267584 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php @@ -18,7 +18,7 @@ class Alerts extends \Magento\Backend\Block\Widget\Tab /** * @var string */ - protected $_template = 'catalog/product/tab/alert.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/tab/alert.phtml'; /** * @return $this diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php index e52c1d3aa4985..20e12889cae0d 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php @@ -15,7 +15,7 @@ class Inventory extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'catalog/product/tab/inventory.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/tab/inventory.phtml'; /** * @var \Magento\Framework\Module\Manager diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options.php index 3f63c54513ad8..cf194c27bdd9c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options.php @@ -18,7 +18,7 @@ class Options extends Widget /** * @var string */ - protected $_template = 'catalog/product/edit/options.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options.phtml'; /** * @return Widget diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php index 9fb6896726dfd..cdf0df0b84305 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php @@ -34,7 +34,7 @@ class Option extends Widget /** * @var string */ - protected $_template = 'catalog/product/edit/options/option.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options/option.phtml'; /** * Core registry diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Date.php index babfc1b072bd2..a0bbc4ad033de 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Date.php @@ -16,5 +16,5 @@ class Date extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Typ /** * @var string */ - protected $_template = 'catalog/product/edit/options/type/date.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options/type/date.phtml'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/File.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/File.php index 322aa02f97731..d3d5f08fa9eae 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/File.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/File.php @@ -16,5 +16,5 @@ class File extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Typ /** * @var string */ - protected $_template = 'catalog/product/edit/options/type/file.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options/type/file.phtml'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Select.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Select.php index 3d90339516339..70b57c2a44878 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Select.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Select.php @@ -16,7 +16,7 @@ class Select extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\T /** * @var string */ - protected $_template = 'catalog/product/edit/options/type/select.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options/type/select.phtml'; /** * Class constructor diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Text.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Text.php index 7241128fac3b4..e6f78dc3ed169 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Text.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/Text.php @@ -16,5 +16,5 @@ class Text extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Typ /** * @var string */ - protected $_template = 'catalog/product/edit/options/type/text.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/options/type/text.phtml'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Tier.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Tier.php index acbd3ece936ae..de80d761cf372 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Tier.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Tier.php @@ -13,7 +13,7 @@ class Tier extends Group\AbstractGroup /** * @var string */ - protected $_template = 'catalog/product/edit/price/tier.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/price/tier.phtml'; /** * Retrieve list of initial customer groups diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php index 6a3347b44512f..6189a97dbe761 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php @@ -21,7 +21,7 @@ class Websites extends \Magento\Backend\Block\Store\Switcher /** * @var string */ - protected $_template = 'catalog/product/edit/websites.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/edit/websites.phtml'; /** * Core registry diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php index a6181b23d5e11..fc8eea9602a75 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php @@ -23,7 +23,7 @@ class Content extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'catalog/product/helper/gallery.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/helper/gallery.phtml'; /** * @var \Magento\Catalog\Model\Product\Media\Config diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser/Container.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser/Container.php index 19c1574d6e9a5..b8967f1f30e55 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser/Container.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser/Container.php @@ -18,5 +18,5 @@ class Container extends Template /** * @var string */ - protected $_template = 'catalog/product/widget/chooser/container.phtml'; + protected $_template = 'Magento_Catalog::catalog/product/widget/chooser/container.phtml'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php b/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php index 9d13d89d54b80..a9ec80c5f0232 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php @@ -13,7 +13,7 @@ class Link extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'rss/grid/link.phtml'; + protected $_template = 'Magento_Catalog::rss/grid/link.phtml'; /** * @var \Magento\Framework\App\Rss\UrlBuilderInterface diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index 9b5fc0ae12109..25daf8b3a108c 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -81,7 +81,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'product/list/toolbar.phtml'; + protected $_template = 'Magento_Catalog::product/list/toolbar.phtml'; /** * Catalog config diff --git a/app/code/Magento/Catalog/Block/Product/View/Additional.php b/app/code/Magento/Catalog/Block/Product/View/Additional.php index 1a02ce1710477..fe6e69d2868e1 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Additional.php +++ b/app/code/Magento/Catalog/Block/Product/View/Additional.php @@ -21,7 +21,7 @@ class Additional extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'product/view/additional.phtml'; + protected $_template = 'Magento_Catalog::product/view/additional.phtml'; /** * @return array diff --git a/app/code/Magento/Catalog/Model/ImageUploader.php b/app/code/Magento/Catalog/Model/ImageUploader.php index 6aa76ca8c1e43..be0a8580bf500 100644 --- a/app/code/Magento/Catalog/Model/ImageUploader.php +++ b/app/code/Magento/Catalog/Model/ImageUploader.php @@ -64,6 +64,18 @@ class ImageUploader */ protected $allowedExtensions; + /** + * List of allowed image mime types. + * + * @var array + */ + private $allowedMimeTypes = [ + 'image/jpg', + 'image/jpeg', + 'image/gif', + 'image/png', + ]; + /** * ImageUploader constructor * @@ -218,6 +230,7 @@ public function moveFileFromTmp($imageName) * @return string[] * * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Exception */ public function saveFileToTmpDir($fileId) { @@ -228,6 +241,10 @@ public function saveFileToTmpDir($fileId) $uploader->setAllowedExtensions($this->getAllowedExtensions()); $uploader->setAllowRenameFiles(true); + if (!$uploader->checkMimeType($this->allowedMimeTypes)) { + throw new \Magento\Framework\Exception\LocalizedException(__('File validation failed.')); + } + $result = $uploader->save($this->mediaDirectory->getAbsolutePath($baseTmpPath)); unset($result['path']); diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php index ee53db35abb3c..3bbe3b9171d06 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php @@ -28,6 +28,9 @@ protected function processDeletedImages($product, array &$images) foreach ($images as &$image) { if (!empty($image['removed'])) { if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) { + if (preg_match('/\.\.(\\\|\/)/', $image['file'])) { + continue; + } $recordsToDelete[] = $image['value_id']; $catalogPath = $this->mediaConfig->getBaseMediaPath(); $isFile = $this->mediaDirectory->isFile($catalogPath . $image['file']); 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 d54cf96af138b..87f14b239cc34 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 9fa8dfa215f2b..bfa9805f7ad9d 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 a38dfad117aab..a560ba81a9416 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 656a4a391b261..e29b495e4bd17 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 @@ -75,6 +75,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 1fd8f92c987b2..b7e9048b5f27a 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 @@ -32,6 +32,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\App\Config\ScopeConfigInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfig; + /** * @var \Magento\Catalog\Model\Config | \PHPUnit_Framework_MockObject_MockObject */ @@ -239,6 +240,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/Widget/NewWidgetTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php index 91046cbc25c41..ca0202ea3ad07 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php @@ -154,6 +154,9 @@ public function testGetCurrentPage($pageNumber, $expectedResult) $this->assertEquals($expectedResult, $this->block->getCurrentPage()); } + /** + * @return array + */ public function getCurrentPageDataProvider() { return [ @@ -315,6 +318,9 @@ public function testGetProductAllCollection($pagerEnable, $productsCount, $produ ); } + /** + * @return array + */ public function getProductCollectionDataProvider() { return [ 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 9fea854768b4c..1e8205672c184 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 @@ -90,6 +90,9 @@ protected function setUp() ); } + /** + * @return array + */ public function isAllowedDataProvider() { return [ @@ -97,6 +100,7 @@ public function isAllowedDataProvider() [0, false] ]; } + /** * @dataProvider isAllowedDataProvider */ @@ -106,6 +110,9 @@ public function testIsAllowed($configValue, $expectedResult) $this->assertEquals($expectedResult, $this->block->isAllowed()); } + /** + * @return mixed + */ 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 5c1cc44a76b1c..58b301aa58705 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') 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 d0a88c4a112cc..e4e70e055087e 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/Model/Attribute/Config/XsdTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/XsdTest.php index 9aabc62397b67..d36db7d8882d4 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/SortbyTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php index e364d3a2f4d85..8a3f4f1544fc5 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 @@ -76,6 +76,9 @@ public function testBeforeSave($attributeCode, $data, $expected) $this->assertSame($expected, $object->getData($attributeCode)); } + /** + * @return array + */ public function beforeSaveDataProvider() { return [ @@ -122,6 +125,9 @@ public function testAfterLoad($attributeCode, $data, $expected) $this->assertSame($expected, $object->getData($attributeCode)); } + /** + * @return array + */ public function afterLoadDataProvider() { return [ @@ -164,6 +170,9 @@ public function testValidate($attributeData, $data, $expected) $this->assertSame($expected, $this->_model->validate($object)); } + /** + * @return array + */ public function validateDataProvider() { return [ @@ -256,6 +265,9 @@ public function testValidateDefaultSort($attributeCode, $data) $this->assertTrue($this->_model->validate($object)); } + /** + * @return array + */ public function validateDefaultSortDataProvider() { return [ @@ -299,6 +311,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 afa319f37510b..d2fba1294c2ea 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php @@ -292,6 +292,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/ImageUploaderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ImageUploaderTest.php new file mode 100644 index 0000000000000..2a6754f7c092a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/ImageUploaderTest.php @@ -0,0 +1,166 @@ +coreFileStorageDatabaseMock = $this->getMockBuilder( + \Magento\MediaStorage\Helper\File\Storage\Database::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->mediaDirectoryMock = $this->getMockBuilder( + \Magento\Framework\Filesystem::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->mediaWriteDirectoryMock = $this->getMockBuilder( + \Magento\Framework\Filesystem\Directory\WriteInterface::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->mediaDirectoryMock->expects($this->any())->method('getDirectoryWrite')->willReturn( + $this->mediaWriteDirectoryMock + ); + $this->uploaderFactoryMock = $this->getMockBuilder( + \Magento\MediaStorage\Model\File\UploaderFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->storeManagerMock = $this->getMockBuilder( + \Magento\Store\Model\StoreManagerInterface::class + ) + ->disableOriginalConstructor() + ->getMock(); + $this->loggerMock = $this->getMockBuilder(\Psr\Log\LoggerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->baseTmpPath = 'base/tmp/'; + $this->basePath = 'base/real/'; + $this->allowedExtensions = ['.jpg']; + + $this->imageUploader = + new \Magento\Catalog\Model\ImageUploader( + $this->coreFileStorageDatabaseMock, + $this->mediaDirectoryMock, + $this->uploaderFactoryMock, + $this->storeManagerMock, + $this->loggerMock, + $this->baseTmpPath, + $this->basePath, + $this->allowedExtensions + ); + } + + public function testSaveFileToTmpDir() + { + $fileId = 'file.jpg'; + $allowedMimeTypes = [ + 'image/jpg', + 'image/jpeg', + 'image/gif', + 'image/png', + ]; + /** @var \Magento\MediaStorage\Model\File\Uploader|\PHPUnit_Framework_MockObject_MockObject $uploader */ + $uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class) + ->disableOriginalConstructor() + ->getMock(); + $this->uploaderFactoryMock->expects($this->once())->method('create')->willReturn($uploader); + $uploader->expects($this->once())->method('setAllowedExtensions')->with($this->allowedExtensions); + $uploader->expects($this->once())->method('setAllowRenameFiles')->with(true); + $this->mediaWriteDirectoryMock->expects($this->once())->method('getAbsolutePath')->with($this->baseTmpPath) + ->willReturn($this->basePath); + $uploader->expects($this->once())->method('save')->with($this->basePath) + ->willReturn(['tmp_name' => $this->baseTmpPath, 'file' => $fileId, 'path' => $this->basePath]); + $uploader->expects($this->atLeastOnce())->method('checkMimeType')->with($allowedMimeTypes)->willReturn(true); + $storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class) + ->disableOriginalConstructor() + ->setMethods(['getBaseUrl']) + ->getMock(); + + $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock); + $storeMock->expects($this->once())->method('getBaseUrl'); + $this->coreFileStorageDatabaseMock->expects($this->once())->method('saveFile'); + + $result = $this->imageUploader->saveFileToTmpDir($fileId); + + $this->assertArrayNotHasKey('path', $result); + } +} 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 aaff0473a6dca..fead0d5f36288 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 @@ -54,6 +54,9 @@ public function testAroundGet($isFlat, $path, $default, $inputData, $outputData) $this->assertEquals($outputData, $this->model->aroundGet($this->subjectMock, $closureMock, $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 988205b95405f..b2708dc5dbb90 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 @@ -103,6 +103,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 a245bd678f6da..e8b8acf5c8d21 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 db44fa4b316e5..e814e2b4c9171 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 @@ -98,6 +98,9 @@ public function testAroundSaveNotNew($valueMap) $this->assertFalse($this->model->aroundSave($this->subject, $proceed, $groupMock)); } + /** + * @return array + */ public function changedDataProvider() { return [ @@ -139,6 +142,10 @@ protected function mockIndexerMethods() ->will($this->returnValue($this->indexerMock)); } + /** + * @param bool $returnValue + * @return \Closure + */ protected function mockPluginProceed($returnValue = false) { return function () use ($returnValue) { diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreViewTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreViewTest.php index 62f17b064d655..3566a9a6c197a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreViewTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/StoreViewTest.php @@ -144,6 +144,10 @@ protected function mockIndexerMethods() ->will($this->returnValue($this->indexerMock)); } + /** + * @param bool $returnValue + * @return \Closure + */ protected function mockPluginProceed($returnValue = false) { return function () use ($returnValue) { diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php index 6200f715d8d52..c22523bd6f251 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php @@ -54,6 +54,9 @@ public function testAroundGet($isFlat, $path, $default, $inputData, $outputData) $this->assertEquals($outputData, $this->model->aroundGet($this->subjectMock, $closureMock, $path, $default)); } + /** + * @return array + */ public function aroundGetDataProvider() { $flatIndexerData = [ 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 f14bb487824ad..b2869c41a32b0 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 @@ -138,6 +138,9 @@ public function testReindexRow( $this->_model->reindexRow(1, $forceReindex); } + /** + * @return array + */ public function dataProviderReindexRow() { return [ @@ -207,6 +210,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 1e0ea7b0d08fb..27594d49657f6 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 @@ -56,6 +56,9 @@ protected function setUp() ); } + /** + * @return array + */ public function dataProviderProcessValueEqual() { return [['0', '0'], ['', '0'], ['0', ''], ['1', '1']]; @@ -90,6 +93,9 @@ public function testProcessValueEqual($oldValue, $value) $this->model->processValue(); } + /** + * @return array + */ public function dataProviderProcessValueOn() { return [['0', '1'], ['', '1']]; @@ -140,6 +146,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 9502fd5894211..2cffbcbdc124d 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 659c94d25b774..c9886791cf097 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 f2452508f19ae..d8d7fd9e987c0 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php @@ -188,6 +188,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 0b4b70428be85..bd46cb8477c03 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 908df829aed0f..0a70fa720d943 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 @@ -190,6 +190,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 9e8138abec6eb..122088563a353 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php @@ -123,6 +123,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/ProductList/ToolbarTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php index faa6734b069ce..838af501932a5 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 6904426668014..037deeb5536d8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ReservedAttributeListTest.php @@ -39,6 +39,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 d368a77a10eb1..109119f575c91 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php @@ -166,6 +166,9 @@ public function testGetList($configValue, $customerGroupId, $groupData, $expecte } } + /** + * @return array + */ public function getListDataProvider() { return [ @@ -400,6 +403,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 205573e165644..dce29e1f957eb 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 8f714f170b257..30467b3f33f67 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 c5199f70adc0a..8be1a70e5d393 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php @@ -1112,6 +1112,9 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $ $this->assertEquals($this->initializedProductMock, $results); } + /** + * @return mixed + */ public function saveWithLinksDataProvider() { // Scenario 1 diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index 5fda5f029e60f..61bba739bc3da 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -500,6 +500,9 @@ public function testGetCategoryCollectionCollectionNull($initCategoryCollection, $this->assertEquals($initCategoryCollection, $result); } + /** + * @return array + */ public function getCategoryCollectionCollectionNullDataProvider() { return [ @@ -610,6 +613,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 584d034d03719..6b2cacedd8418 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/ConfigTest.php @@ -47,6 +47,9 @@ public function testGetType($value, $expected) $this->assertEquals($expected, $this->model->getType('global')); } + /** + * @return array + */ public function getTypeDataProvider() { return [ diff --git a/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php b/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php index 65eb3f5655b82..38b435df7e5b3 100644 --- a/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php @@ -122,6 +122,9 @@ protected function _getCleanMock($className) return $this->getMock($className, [], [], '', false); } + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function _preparationData() { $this->_childrenCategory = $this->getMock( 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 4a37cc218f3d5..18d63d0ab0b5b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php @@ -107,6 +107,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 477a956c149a8..7e01a4e50da73 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/CustomOptionPriceTest.php @@ -97,6 +97,10 @@ protected function setUp() ); } + /** + * @param array $optionsData + * @return array + */ protected function setupOptions(array $optionsData) { $options = []; @@ -125,6 +129,10 @@ 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 8b3140785453b..30be6fe110689 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/Render/FinalPriceBoxTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php index 7e1bc14755cf9..c00dc7fae31c8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php @@ -403,6 +403,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 71b4d2ee033f9..558246467e569 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 83d901e172f67..2f922708c23c6 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/composer.json b/app/code/Magento/Catalog/composer.json index 5f0f089030160..de85f7a556419 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -33,7 +33,7 @@ "magento/module-catalog-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.13", + "version": "101.0.14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php b/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php index 3e4d324ef533b..daf00f225fb9b 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Uploader.php @@ -7,10 +7,12 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\App\ObjectManager; /** * Import entity product model * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @author Magento Core Team */ class Uploader extends \Magento\MediaStorage\Model\File\Uploader @@ -85,6 +87,11 @@ class Uploader extends \Magento\MediaStorage\Model\File\Uploader */ protected $_coreFileStorage; + /** + * @var \Magento\Framework\App\Filesystem\DirectoryResolver + */ + private $directoryResolver; + /** * @param \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\MediaStorage\Helper\File\Storage $coreFileStorage @@ -93,6 +100,7 @@ class Uploader extends \Magento\MediaStorage\Model\File\Uploader * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Filesystem\File\ReadFactory $readFactory * @param null $filePath + * @param \Magento\Framework\App\Filesystem\DirectoryResolver|null $directoryResolver * @throws \Magento\Framework\Exception\LocalizedException */ public function __construct( @@ -102,7 +110,8 @@ public function __construct( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Filesystem\File\ReadFactory $readFactory, - $filePath = null + $filePath = null, + \Magento\Framework\App\Filesystem\DirectoryResolver $directoryResolver = null ) { if ($filePath !== null) { $this->_setUploadFile($filePath); @@ -113,6 +122,8 @@ public function __construct( $this->_validator = $validator; $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); $this->_readFactory = $readFactory; + $this->directoryResolver = $directoryResolver + ?: ObjectManager::getInstance()->get(\Magento\Framework\App\Filesystem\DirectoryResolver::class); } /** @@ -217,6 +228,7 @@ protected function _validateFile() $fileExtension = pathinfo($filePath, PATHINFO_EXTENSION); if (!$this->checkAllowedExtension($fileExtension)) { + $this->_directory->delete($filePath); throw new \Exception('Disallowed file type.'); } //run validate callbacks @@ -262,7 +274,10 @@ public function getTmpDir() */ public function setTmpDir($path) { - if (is_string($path) && $this->_directory->isReadable($path)) { + if (is_string($path) + && $this->_directory->isReadable($path) + && $this->directoryResolver->validatePath($this->_directory->getAbsolutePath($path), DirectoryList::ROOT) + ) { $this->_tmpDir = $path; return true; } 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 d69ec9752a6f0..db871e1cc4acf 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 @@ -129,6 +129,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 77741e2966b89..89e0b43ece64a 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 @@ -126,7 +126,6 @@ protected function setUp() $attribute->expects($this->any())->method('getDefaultValue')->willReturn('default_value'); $attribute->expects($this->any())->method('usesSource')->willReturn(true); - $entityAttributes = [ [ 'attribute_id' => 'attribute_id', @@ -319,6 +318,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 b271b5823420f..76d16b39c1c69 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 @@ -56,6 +56,10 @@ protected function setUp() ); } + /** + * @param $groupId + * @return \Magento\CatalogImportExport\Model\Import\Product\Validator\TierPrice + */ protected function processInit($groupId) { $searchResult = $this->getMock('Magento\Customer\Api\Data\GroupSearchResultsInterface', [], [], '', false); 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 5abc2ce971a59..24ec6e33f88db 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php @@ -831,6 +831,9 @@ public function testGetCategoryProcessor() $this->assertEquals($expectedResult, $actualResult); } + /** + * @return array + */ public function getStoreIdByCodeDataProvider() { return [ @@ -1317,7 +1320,10 @@ public function getImagesFromRowDataProvider() ], ]; } - + + /** + * @return array + */ public function validateRowValidateNewProductTypeAddRowErrorCallDataProvider() { return [ @@ -1352,6 +1358,9 @@ public function validateRowValidateNewProductTypeAddRowErrorCallDataProvider() ]; } + /** + * @return array + */ public function validateRowCheckSpecifiedSkuDataProvider() { return [ @@ -1370,6 +1379,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 ab298dbaa1a52..50c40956e0864 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php @@ -39,10 +39,15 @@ class UploaderTest extends \PHPUnit_Framework_TestCase protected $readFactory; /** - * @var \Magento\Framework\Filesystem\Directory\Writer| \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Filesystem\Directory\Writer|\PHPUnit_Framework_MockObject_MockObject */ protected $directoryMock; + /** + * @var \Magento\Framework\App\Filesystem\DirectoryResolver|\PHPUnit_Framework_MockObject_MockObject + */ + private $directoryResolver; + /** * @var \Magento\CatalogImportExport\Model\Import\Uploader|\PHPUnit_Framework_MockObject_MockObject */ @@ -72,7 +77,7 @@ protected function setUp() ->getMock(); $this->directoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\Writer::class) - ->setMethods(['writeFile', 'getRelativePath', 'isWritable', 'getAbsolutePath']) + ->setMethods(['writeFile', 'getRelativePath', 'isWritable', 'isReadable', 'getAbsolutePath']) ->disableOriginalConstructor() ->getMock(); @@ -84,6 +89,11 @@ protected function setUp() ->method('getDirectoryWrite') ->will($this->returnValue($this->directoryMock)); + $this->directoryResolver = $this->getMockBuilder(\Magento\Framework\App\Filesystem\DirectoryResolver::class) + ->disableOriginalConstructor() + ->setMethods(['validatePath']) + ->getMock(); + $this->uploader = $this->getMockBuilder(\Magento\CatalogImportExport\Model\Import\Uploader::class) ->setConstructorArgs([ $this->coreFileStorageDb, @@ -92,6 +102,8 @@ protected function setUp() $this->validator, $this->filesystem, $this->readFactory, + null, + $this->directoryResolver, ]) ->setMethods(['_setUploadFile', 'save', 'getTmpDir']) ->getMock(); @@ -154,6 +166,9 @@ public function testMoveFileName() $this->assertEquals(['name' => $fileName], $this->uploader->move($fileName)); } + /** + * @return array + */ public function moveFileUrlDataProvider() { return [ @@ -169,4 +184,46 @@ public function moveFileUrlDataProvider() ], ]; } + + /** + * @dataProvider validatePathDataProvider + * + * @param bool $pathIsValid + * @return void + */ + public function testSetTmpDir($pathIsValid) + { + $path = 'path'; + $absolutePath = 'absolute_path'; + $this->directoryMock + ->expects($this->atLeastOnce()) + ->method('isReadable') + ->with($path) + ->willReturn(true); + $this->directoryMock + ->expects($this->atLeastOnce()) + ->method('getAbsolutePath') + ->with($path) + ->willReturn($absolutePath); + $this->directoryResolver + ->expects($this->atLeastOnce()) + ->method('validatePath') + ->with($absolutePath, 'base') + ->willReturn($pathIsValid); + + $this->assertEquals($pathIsValid, $this->uploader->setTmpDir($path)); + } + + /** + * Data provider for the testSetTmpDir() + * + * @return array + */ + public function validatePathDataProvider() + { + return [ + [true], + [false], + ]; + } } diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 920bf0941cd47..a166650c7d8b4 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -16,7 +16,7 @@ "ext-ctype": "*" }, "type": "magento2-module", - "version": "100.1.9", + "version": "100.1.10", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php index 4b39fdf40920f..008fe1209c189 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Helper/StockTest.php @@ -164,6 +164,9 @@ public function testAddInStockFilterToCollection($configMock) $this->assertNull($this->stock->addInStockFilterToCollection($collectionMock)); } + /** + * @return array + */ public function filterProvider() { $configMock = $this->getMockBuilder('Magento\Framework\App\Config') 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 be13c92203f54..b9cab5d455135 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php @@ -60,6 +60,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/Spi/StockStateProviderTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php index 64baecf62e162..b7b3f9f7eed40 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php @@ -252,41 +252,66 @@ 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 = []; @@ -327,6 +352,9 @@ protected function prepareDataForMethod($methodName) return $variations; } + /** + * @return array + */ protected function getVariations() { $stockQty = 100; @@ -439,6 +467,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/Observer/RefundOrderInventoryObserverTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php index a7316029d8739..cde97a0795b83 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Observer/RefundOrderInventoryObserverTest.php @@ -152,6 +152,10 @@ public function testRefundOrderInventory() $this->observer->execute($this->eventObserver); } + /** + * @param $productId + * @return mixed + */ private function getCreditMemoItem($productId) { $parentItemId = false; diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php index df588e79f7117..4d221534c22c4 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php @@ -32,7 +32,7 @@ public function __construct(Context $context, Registry $coreRegistry) /** * Initialize category object in registry * - * @return Category + * @return Category|bool */ protected function _initCategory() { 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 a88f979079f4d..3e04d7a616699 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Product/PriceModifierTest.php @@ -62,6 +62,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/composer.json b/app/code/Magento/CatalogRule/composer.json index 8c33932e08cdb..241e5601653c4 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -17,7 +17,7 @@ "magento/module-catalog-rule-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.6", + "version": "100.1.7", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Engine.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Engine.php index 16c7888eb4821..e68bb5eeec59a 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Engine.php @@ -102,7 +102,7 @@ public function processAttributeValue($attribute, $value) * * @param array $index * @param string $separator - * @return string + * @return array */ public function prepareEntityIndex($index, $separator = ' ') { diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/AliasResolverTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/AliasResolverTest.php index 52ac2049e14d5..92efc70eed918 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/AliasResolverTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/AliasResolverTest.php @@ -1,6 +1,6 @@ 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 89b60c3c31914..acf901e141479 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/AdvancedTest.php @@ -15,30 +15,37 @@ class AdvancedTest extends \PHPUnit_Framework_TestCase * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\CatalogSearch\Model\ResourceModel\Advanced\Collection */ protected $collection; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\CatalogSearch\Model\ResourceModel\Advanced */ protected $resource; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\CatalogSearch\Model\ResourceModel\ResourceProvider */ protected $resourceProvider; + /** * @var \PHPUnit_Framework_MockObject_MockObject[]|\Magento\Catalog\Model\ResourceModel\Eav\Attribute[] */ protected $attributes; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Data\Collection */ protected $dataCollection; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Directory\Model\Currency */ private $currency; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\StoreManagerInterface */ private $storeManager; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Store */ @@ -104,6 +111,9 @@ protected function setUp() ->willReturn($this->store); } + /** + * @return array + */ public function addFiltersDataProvider() { return array_merge( @@ -277,6 +287,10 @@ 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') @@ -289,6 +303,9 @@ private function createSource($optionText = 'optionText') return $source; } + /** + * @return array + */ private function addFiltersPriceDataProvider() { return [ @@ -370,7 +387,6 @@ private function addFiltersPriceDataProvider() ]; } - /** * @param $backend * @param null $source 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 bd1a9912c92b8..42f5ce3026666 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/Search/IndexBuilderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php index 6b350e83ee385..f65b45e365efa 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/IndexBuilderTest.php @@ -243,6 +243,11 @@ public function testBuildWithoutOutOfStock() $this->assertSame($this->select, $result); } + /** + * @param $index + * @param $tableSuffix + * @param bool $hasFilters + */ protected function mockBuild($index, $tableSuffix, $hasFilters = false) { $this->request->expects($this->atLeastOnce()) 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 ec5c1e131bb36..8d521ddc477b5 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 @@ -19,10 +19,12 @@ class IndexStructureTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver|\PHPUnit_Framework_MockObject_MockObject */ private $indexScopeResolver; + /** * @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject */ private $resource; + /** * @var AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -123,6 +125,12 @@ 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++)) @@ -138,6 +146,11 @@ 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') 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/Block/Product/Widget/Conditions.php b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php index 344afd317f174..d02bacb8ad48e 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php +++ b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php @@ -51,7 +51,7 @@ class Conditions extends Template implements RendererInterface /** * @var string */ - protected $_template = 'product/widget/conditions.phtml'; + protected $_template = 'Magento_CatalogWidget::product/widget/conditions.phtml'; /** * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory 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 7d9e876db2856..649c248aad8d5 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -287,6 +287,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/Block/Checkout/AttributeMerger.php b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php index 5f125ac018516..5ce0544097a26 100644 --- a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php +++ b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php @@ -377,9 +377,9 @@ protected function orderCountryOptions(array $countryOptions) ]]; foreach ($countryOptions as $countryOption) { if (empty($countryOption['value']) || in_array($countryOption['value'], $this->topCountryCodes)) { - array_push($headOptions, $countryOption); + $headOptions[] = $countryOption; } else { - array_push($tailOptions, $countryOption); + $tailOptions[] = $countryOption; } } diff --git a/app/code/Magento/Checkout/Block/Checkout/DirectoryDataProcessor.php b/app/code/Magento/Checkout/Block/Checkout/DirectoryDataProcessor.php index 1866f255d4018..0c1626f94e2b4 100644 --- a/app/code/Magento/Checkout/Block/Checkout/DirectoryDataProcessor.php +++ b/app/code/Magento/Checkout/Block/Checkout/DirectoryDataProcessor.php @@ -136,9 +136,9 @@ private function orderCountryOptions(array $countryOptions) ]]; foreach ($countryOptions as $countryOption) { if (empty($countryOption['value']) || in_array($countryOption['value'], $topCountryCodes)) { - array_push($headOptions, $countryOption); + $headOptions[] = $countryOption; } else { - array_push($tailOptions, $countryOption); + $tailOptions[] = $countryOption; } } return array_merge($headOptions, $tailOptions); 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 0e4abff882552..9151dc52baca7 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/AbstractCartTest.php @@ -136,6 +136,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 b25d693e51bb7..9b41366679613 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 e6c83042914c1..a2b8eb21e7cd9 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 693643cefa185..2eee123d5c958 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Onepage/SuccessTest.php @@ -103,6 +103,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 12bec6f88c4f5..6a99e93e438a8 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/CartTest.php @@ -85,7 +85,9 @@ protected function setUp() $this->quoteMock = $this->getMock(\Magento\Quote\Model\Quote::class, [], [], '', false); $this->eventManagerMock = $this->getMock(\Magento\Framework\Event\ManagerInterface::class); $this->storeManagerMock = $this->getMockForAbstractClass(\Magento\Store\Model\StoreManagerInterface::class); - $this->productRepository = $this->getMockForAbstractClass(\Magento\Catalog\Api\ProductRepositoryInterface::class); + $this->productRepository = $this->getMockForAbstractClass( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); $this->stockRegistry = $this->getMockBuilder(\Magento\CatalogInventory\Model\StockRegistry::class) ->disableOriginalConstructor() ->setMethods(['getStockItem', '__wakeup']) @@ -293,6 +295,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 a734a465d13e2..67b361db85e40 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Session/SuccessValidatorTest.php @@ -90,10 +90,15 @@ 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( - 'Magento\Checkout\Model\Session\SuccessValidator', ['checkoutSession' => $checkoutSession] + 'Magento\Checkout\Model\Session\SuccessValidator', + ['checkoutSession' => $checkoutSession] ); } } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php b/app/code/Magento/Checkout/Test/Unit/Model/SidebarTest.php index bb86367765676..650e5e893d5f4 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 39e79ec0d6820..eed68dba5de29 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Type/OnepageTest.php @@ -300,6 +300,9 @@ public function testInitCheckout($stepData, $isLoggedIn, $isSetStepDataCalled) $this->onepage->initCheckout(); } + /** + * @return array + */ public function initCheckoutDataProvider() { return [ @@ -332,6 +335,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/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index eed561a3cc5c6..faf0f8fbce45e 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -466,12 +466,13 @@ public function deleteFile($target) } /** - * Upload and resize new file + * Upload and resize new file. * * @param string $targetPath Target directory * @param string $type Type of storage, e.g. image, media etc. * @return array File info Array * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Exception */ public function uploadFile($targetPath, $type = null) { @@ -483,6 +484,9 @@ public function uploadFile($targetPath, $type = null) } $uploader->setAllowRenameFiles(true); $uploader->setFilesDispersion(false); + if (!$uploader->checkMimeType($this->getAllowedMimeTypes($type))) { + throw new \Magento\Framework\Exception\LocalizedException(__('File validation failed.')); + } $result = $uploader->save($targetPath); if (!$result) { @@ -632,18 +636,14 @@ public function getSession() } /** - * Prepare allowed_extensions config settings + * Prepare allowed_extensions config settings. * * @param string $type Type of storage, e.g. image, media etc. * @return array Array of allowed file extensions */ public function getAllowedExtensions($type = null) { - if (is_string($type) && array_key_exists("{$type}_allowed", $this->_extensions)) { - $allowed = $this->_extensions["{$type}_allowed"]; - } else { - $allowed = $this->_extensions['allowed']; - } + $allowed = $this->getExtensionsList($type); return array_keys(array_filter($allowed)); } @@ -749,4 +749,34 @@ protected function _getRelativePathToRoot($path) strlen($this->_sanitizePath($this->_cmsWysiwygImages->getStorageRoot())) ); } + + /** + * Prepare mime types config settings. + * + * @param string|null $type Type of storage, e.g. image, media etc. + * @return array Array of allowed file extensions + */ + private function getAllowedMimeTypes($type = null) + { + $allowed = $this->getExtensionsList($type); + + return array_values(array_filter($allowed)); + } + + /** + * Get list of allowed file extensions with mime type in values. + * + * @param string|null $type + * @return array + */ + private function getExtensionsList($type = null) + { + if (is_string($type) && array_key_exists("{$type}_allowed", $this->_extensions)) { + $allowed = $this->_extensions["{$type}_allowed"]; + } else { + $allowed = $this->_extensions['allowed']; + } + + return $allowed; + } } diff --git a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Widget/ChooserTest.php b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Widget/ChooserTest.php index 1b9c9ee384a03..f6cd49c3dd443 100644 --- a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Widget/ChooserTest.php +++ b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Widget/ChooserTest.php @@ -233,6 +233,9 @@ public function testPrepareElementHtml($elementValue, $modelBlockId) $this->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 bdb18c88dfe9f..0dab50e12ccee 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 71c51690f7249..625dfe5a34d54 100644 --- a/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Helper/PageTest.php @@ -366,6 +366,9 @@ public function testPrepareResultPage( ); } + /** + * @return array + */ public function renderPageExtendedDataProvider() { return [ @@ -466,6 +469,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 bf7ba8932f5c6..33da362bef088 100644 --- a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php +++ b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php @@ -387,6 +387,9 @@ public function testGetCurrentPathThrowException() $this->fail('An expected exception has not been raised.'); } + /** + * @return array + */ public function providerGetCurrentPath() { return [ @@ -434,6 +437,9 @@ public function testGetImageHtmlDeclarationRenderingAsTag($baseUrl, $fileName, $ $this->assertEquals($expectedHtml, $this->imagesHelper->getImageHtmlDeclaration($fileName, true)); } + /** + * @return array + */ public function providerGetImageHtmlDeclarationRenderingAsTag() { return [ @@ -468,6 +474,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 82ed191f7aa83..04136cbcb680d 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 @@ -117,6 +117,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 863cc3ea46154..92949c78fece2 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 @@ -117,6 +117,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 02f1a79b99137..900decd9060a8 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/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 6efd13716925e..ff3c221c8ac56 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -107,6 +107,16 @@ class StorageTest extends \PHPUnit_Framework_TestCase */ protected $objectManagerHelper; + /** + * @var array + */ + private $allowedImageExtensions = [ + 'jpg' => 'image/jpg', + 'jpeg' => 'image/jpeg', + 'png' => 'image/png', + 'gif' => 'image/png', + ]; + /** * @return void * @SuppressWarnings(PHPMD.ExcessiveMethodLength) @@ -127,7 +137,7 @@ protected function setUp() $this->directoryMock = $this->getMock( \Magento\Framework\Filesystem\Directory\Write::class, - ['delete', 'getDriver', 'create'], + ['delete', 'getDriver', 'create', 'getRelativePath', 'isExist', 'isFile'], [], '', false @@ -216,6 +226,11 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); + $allowedExtensions = [ + 'allowed' => $this->allowedImageExtensions, + 'image_allowed' => $this->allowedImageExtensions, + ]; + $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->imagesStorage = $this->objectManagerHelper->getObject( @@ -238,6 +253,7 @@ protected function setUp() 'exclude' => [], 'include' => [], ], + 'extensions' => $allowedExtensions, ] ); } @@ -442,4 +458,97 @@ protected function generalTestGetDirsCollection($path, array $collectionArray = $this->imagesStorage->getDirsCollection($path); } + + /** + * @return void + */ + public function testUploadFile() + { + $targetPath = '/target/path'; + $fileName = 'image.gif'; + $realPath = $targetPath . '/' . $fileName; + $thumbnailTargetPath = self::STORAGE_ROOT_DIR . '/.thumbs'; + $thumbnailDestination = $thumbnailTargetPath . '/' . $fileName; + $type = 'image'; + $result = [ + 'result', + 'cookie' => [ + 'name' => 'session_name', + 'value' => '1', + 'lifetime' => '50', + 'path' => 'cookie/path', + 'domain' => 'cookie_domain', + ], + ]; + $uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'setAllowedExtensions', + 'setAllowRenameFiles', + 'setFilesDispersion', + 'checkMimeType', + 'save', + 'getUploadedFileName', + ] + ) + ->getMock(); + $this->uploaderFactoryMock->expects($this->atLeastOnce())->method('create')->with(['fileId' => 'image']) + ->willReturn($uploader); + $uploader->expects($this->atLeastOnce())->method('setAllowedExtensions') + ->with(array_keys($this->allowedImageExtensions))->willReturnSelf(); + $uploader->expects($this->atLeastOnce())->method('setAllowRenameFiles')->with(true)->willReturnSelf(); + $uploader->expects($this->atLeastOnce())->method('setFilesDispersion')->with(false) + ->willReturnSelf(); + $uploader->expects($this->atLeastOnce())->method('checkMimeType') + ->with(array_values($this->allowedImageExtensions))->willReturnSelf(); + $uploader->expects($this->atLeastOnce())->method('save')->with($targetPath)->willReturn($result); + $uploader->expects($this->atLeastOnce())->method('getUploadedFileName')->willReturn($fileName); + + $this->directoryMock->expects($this->atLeastOnce())->method('getRelativePath')->willReturnMap( + [ + [$realPath, $realPath], + [$thumbnailTargetPath, $thumbnailTargetPath], + [$thumbnailDestination, $thumbnailDestination], + ] + ); + $this->directoryMock->expects($this->atLeastOnce())->method('isFile') + ->willReturnMap( + [ + [$realPath, true], + [$thumbnailDestination, true], + ] + ); + $this->directoryMock->expects($this->atLeastOnce())->method('isExist') + ->willReturnMap( + [ + [$realPath, true], + [$thumbnailTargetPath, true], + ] + ); + + $image = $this->getMockBuilder(\Magento\Catalog\Model\Product\Image::class) + ->disableOriginalConstructor() + ->setMethods(['open', 'keepAspectRatio', 'resize', 'save']) + ->getMock(); + $image->expects($this->atLeastOnce())->method('open')->with($realPath); + $image->expects($this->atLeastOnce())->method('keepAspectRatio')->with(true); + $image->expects($this->atLeastOnce())->method('resize')->with(100, 50); + $image->expects($this->atLeastOnce())->method('save')->with($thumbnailDestination); + + $this->adapterFactoryMock->expects($this->atLeastOnce())->method('create')->willReturn($image); + + $this->sessionMock->expects($this->atLeastOnce())->method('getName') + ->willReturn($result['cookie']['name']); + $this->sessionMock->expects($this->atLeastOnce())->method('getSessionId') + ->willReturn($result['cookie']['value']); + $this->sessionMock->expects($this->atLeastOnce())->method('getCookieLifetime') + ->willReturn($result['cookie']['lifetime']); + $this->sessionMock->expects($this->atLeastOnce())->method('getCookiePath') + ->willReturn($result['cookie']['path']); + $this->sessionMock->expects($this->atLeastOnce())->method('getCookieDomain') + ->willReturn($result['cookie']['domain']); + + $this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type)); + } } diff --git a/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php b/app/code/Magento/Cms/Test/Unit/Observer/NoCookiesObserverTest.php index d87cf9503ad79..597e4830b16b8 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/composer.json b/app/code/Magento/Cms/composer.json index c9f2365548fbd..6a6504f870fff 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -18,7 +18,7 @@ "magento/module-cms-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.11", + "version": "101.0.12", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/etc/di.xml b/app/code/Magento/Cms/etc/di.xml index b543c54536438..12946d72bbc79 100644 --- a/app/code/Magento/Cms/etc/di.xml +++ b/app/code/Magento/Cms/etc/di.xml @@ -30,24 +30,24 @@ - 1 - 1 - 1 - 1 + image/jpg + image/jpeg + image/png + image/gif - 1 - 1 - 1 - 1 + image/jpg + image/jpeg + image/png + image/gif - 1 - 1 - 1 - 1 - 1 - 1 + video/x-flv + application/x-shockwave-flash + video/x-msvideo + video/x-sgi-movie + application/vnd.rn-realmedia + video/x-ms-wmv diff --git a/app/code/Magento/CmsUrlRewrite/Model/CmsPageUrlPathGenerator.php b/app/code/Magento/CmsUrlRewrite/Model/CmsPageUrlPathGenerator.php index 5cf621781664d..22b5f68c0d809 100644 --- a/app/code/Magento/CmsUrlRewrite/Model/CmsPageUrlPathGenerator.php +++ b/app/code/Magento/CmsUrlRewrite/Model/CmsPageUrlPathGenerator.php @@ -12,6 +12,10 @@ class CmsPageUrlPathGenerator /** @var \Magento\Framework\Filter\FilterManager */ protected $filterManager; + /** + * CmsPageUrlPathGenerator constructor. + * @param \Magento\Framework\Filter\FilterManager $filterManager + */ public function __construct( \Magento\Framework\Filter\FilterManager $filterManager ) { 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 0b1ffd3ece225..646f2aeb46bcb 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 888137feca6de..7f29d5be6553e 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 @@ -94,6 +94,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 4ebb676c47715..8aec3497163ac 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 @@ -219,6 +219,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 dda9e4aa2b873..0adb8aeb4a4fd 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 @@ -269,6 +269,9 @@ public function testInitForm($sectionIsVisible) $this->assertEquals($this->_formMock, $object->getForm()); } + /** + * @return array + */ public function initFormDataProvider() { return [ @@ -414,6 +417,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/Structure/AbstractElementTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php index 1af995b159fda..17d193c268f91 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 @@ -127,6 +127,9 @@ public function testIsVisibleReturnsTrueForProperScopes($settings, $scope) $this->assertTrue($this->_model->isVisible()); } + /** + * @return array + */ public function isVisibleReturnsTrueForProperScopesDataProvider() { return [ @@ -156,6 +159,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 25982c3713337..b99e77fce7a7f 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 eb648b172fd37..423903b66a214 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 @@ -149,6 +149,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 28f033a32158f..375d3eb5504b1 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 @@ -80,6 +80,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 bb4840ce044c3..2fb255ec21c65 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 testMapDataProvider() { return [ @@ -55,6 +58,9 @@ public function testMapDataProvider() ]; } + /** + * @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 143bdabd2685f..e844f5de5addd 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 @@ -50,11 +50,17 @@ public function testConvert($nodePath, $relativePath, $result) $this->assertEquals($result, $this->_sut->convert($nodePath, $relativePath)); } + /** + * @return array + */ public function testConvertWithInvalidArgumentsDataProvider() { return [['', ''], ['some/node', ''], ['', 'some/node']]; } + /** + * @return array + */ public function testConvertDataProvider() { 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 031cbc24a2624..a6d092dfe0a99 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php @@ -205,6 +205,9 @@ public function testGetElementReturnsEmptyElementIfNotExistingElementIsRequested $this->assertEquals($elementMock, $this->_model->getElement($path)); } + /** + * @return array + */ public function emptyElementDataProvider() { return [ @@ -347,6 +350,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 a78a3afa9595e..3ccc75e25e88b 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 c16a15a279554..bdb17a481cc45 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 @@ -448,6 +448,9 @@ protected function _getBunch() ]; } + /** + * @return array + */ protected function _getSuperAttributes() { return [ diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php index ca849732fcec4..d841953dea19c 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php @@ -16,7 +16,7 @@ class Created extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'catalog/product/attribute/new/created.phtml'; + protected $_template = 'Magento_ConfigurableProduct::catalog/product/attribute/new/created.phtml'; /** * Core registry diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config.php index c02a922c71b5c..1c5d01da574cf 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config.php @@ -18,7 +18,7 @@ class Config extends Widget implements TabInterface /** * @var string */ - protected $_template = 'catalog/product/edit/super/config.phtml'; + protected $_template = 'Magento_ConfigurableProduct::catalog/product/edit/super/config.phtml'; /** * Core registry 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 bd0306e8c9437..31b5bfe99cb1d 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,10 @@ 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 8436bc91f0ccb..071b619715f61 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php @@ -384,6 +384,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 9ea49c4143c6c..86de8173502d5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Observer/HideUnsupportedAttributeTypesTest.php @@ -59,6 +59,11 @@ private function createTarget(MockObject $request, array $supportedTypes = []) ); } + /** + * @param $popup + * @param string $productTab + * @return MockObject + */ private function createRequestMock($popup, $productTab = 'variations') { $request = $this->getMockBuilder(RequestInterface::class) @@ -107,6 +112,9 @@ public function testExecuteWithDefaultTypes(array $supportedTypes, array $origin $this->assertEquals(null, $target->execute($event)); } + /** + * @return array + */ public function executeDataProvider() { return [ @@ -143,11 +151,21 @@ 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/ConfigurableProduct/Test/Unit/Pricing/Render/FinalPriceBoxTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Render/FinalPriceBoxTest.php index 0a4754d6613aa..0cac3a653aa8e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Render/FinalPriceBoxTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Render/FinalPriceBoxTest.php @@ -391,6 +391,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/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 1e771034969d3..fc1364c3138c8 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -23,7 +23,7 @@ "magento/module-product-links-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.13", + "version": "100.1.14", "license": [ "OSL-3.0", "AFL-3.0" 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 9d6c456bc9b43..9d097b98acbb8 100644 --- a/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php +++ b/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php @@ -178,6 +178,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 89228b0e6e724..130534f2395b4 100644 --- a/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php +++ b/app/code/Magento/Cookie/Test/Unit/Helper/CookieTest.php @@ -87,6 +87,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/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 08c7a80c7639d..3a0ece662b802 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -170,7 +170,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) ) == 1 )) { $this->_shell->execute( - $phpPath . ' %s cron:run --group=' . $groupId . ' --' . CLI::INPUT_KEY_BOOTSTRAP . '=' + $phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '=' . self::STANDALONE_PROCESS_STARTED . '=1', [ BP . '/bin/magento' diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 72ea22c1abf56..12ca72ed8c933 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -10,7 +10,7 @@ "magento/module-config": "100.1.*" }, "type": "magento2-module", - "version": "100.1.5", + "version": "100.1.6", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php index 620ca13014bfa..ac346957be942 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php @@ -16,7 +16,7 @@ class Currency extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'system/currency/rates.phtml'; + protected $_template = 'Magento_CurrencySymbol::system/currency/rates.phtml'; /** * Prepare layout diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php index 80415c9486898..e20054a5a8084 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php @@ -16,7 +16,7 @@ class Matrix extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'system/currency/rate/matrix.phtml'; + protected $_template = 'Magento_CurrencySymbol::system/currency/rate/matrix.phtml'; /** * @var \Magento\Directory\Model\CurrencyFactory diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php index fd0ce3bb5a394..0232ae871e166 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php @@ -16,7 +16,7 @@ class Services extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'system/currency/rate/services.phtml'; + protected $_template = 'Magento_CurrencySymbol::system/currency/rate/services.phtml'; /** * @var \Magento\Directory\Model\Currency\Import\Source\ServiceFactory diff --git a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php index dfd12d7fa21c7..0a518ad14eb28 100644 --- a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php @@ -6,9 +6,13 @@ namespace Magento\CurrencySymbol\Model\System; use Magento\Framework\Locale\Bundle\CurrencyBundle; +use Magento\Framework\Unserialize\SecureUnserializer; +use Magento\Framework\App\ObjectManager; +use Psr\Log\LoggerInterface; /** * Custom currency symbol model + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Currencysymbol { @@ -106,6 +110,16 @@ class Currencysymbol */ protected $_scopeConfig; + /** + * @var SecureUnserializer + */ + private $unserializer; + + /** + * @var LoggerInterface + */ + private $logger; + /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\App\Config\ReinitableConfigInterface $coreConfig @@ -115,6 +129,10 @@ class Currencysymbol * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Store\Model\System\Store $systemStore * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param SecureUnserializer|null $unserializer + * @param LoggerInterface|null $logger + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, @@ -124,7 +142,9 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Store\Model\System\Store $systemStore, - \Magento\Framework\Event\ManagerInterface $eventManager + \Magento\Framework\Event\ManagerInterface $eventManager, + SecureUnserializer $unserializer = null, + LoggerInterface $logger = null ) { $this->_coreConfig = $coreConfig; $this->_configFactory = $configFactory; @@ -134,6 +154,8 @@ public function __construct( $this->_systemStore = $systemStore; $this->_eventManager = $eventManager; $this->_scopeConfig = $scopeConfig; + $this->unserializer = $unserializer ?: ObjectManager::getInstance()->get(SecureUnserializer::class); + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -262,7 +284,11 @@ protected function _unserializeStoreConfig($configPath, $storeId = null) $storeId ); if ($configData) { - $result = unserialize($configData); + try { + $result = $this->unserializer->unserialize($configData); + } catch (\InvalidArgumentException $e) { + $this->logger->critical($e); + } } return is_array($result) ? $result : []; 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 4cab467c4713c..790a4611a6131 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Model/System/CurrencysymbolTest.php @@ -7,9 +7,12 @@ use Magento\CurrencySymbol\Model\System\Currencysymbol; use Magento\Store\Model\ScopeInterface; +use Magento\Framework\Unserialize\SecureUnserializer; +use Psr\Log\LoggerInterface; /** - * Class CurrencysymbolTest + * Test for Magento\CurrencySymbol\Model\System\Currencysymbol + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CurrencysymbolTest extends \PHPUnit_Framework_TestCase { @@ -65,19 +68,29 @@ class CurrencysymbolTest extends \PHPUnit_Framework_TestCase */ protected $model; + /** + * @var SecureUnserializer|\PHPUnit_Framework_MockObject_MockObject + */ + private $unserializerMock; + + /** + * @var LoggerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $loggerMock; + protected function setUp() { $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->scopeConfigMock = $this->getMock( - 'Magento\Framework\App\Config\ScopeConfigInterface', + \Magento\Framework\App\Config\ScopeConfigInterface::class, ['getValue', 'isSetFlag'], [], '', false ); $this->localeResolverMock = $this->getMock( - 'Magento\Framework\Locale\ResolverInterface', + \Magento\Framework\Locale\ResolverInterface::class, [ 'getLocale', 'getDefaultLocalePath', @@ -85,57 +98,63 @@ protected function setUp() 'getDefaultLocale', 'setLocale', 'emulate', - 'revert' + 'revert', ], [], '', false ); $this->systemStoreMock = $this->getMock( - 'Magento\Store\Model\System\Store', + \Magento\Store\Model\System\Store::class, ['getWebsiteCollection', 'getGroupCollection', 'getStoreCollection'], [], '', false ); $this->configFactoryMock = $this->getMock( - 'Magento\Config\Model\Config\Factory', + \Magento\Config\Model\Config\Factory::class, ['create'], [], '', false ); $this->eventManagerMock = $this->getMock( - 'Magento\Framework\Event\ManagerInterface', + \Magento\Framework\Event\ManagerInterface::class, ['dispatch'], [], '', false ); $this->coreConfigMock = $this->getMock( - 'Magento\Framework\App\Config\ReinitableConfigInterface', + \Magento\Framework\App\Config\ReinitableConfigInterface::class, ['reinit', 'setValue', 'getValue', 'isSetFlag'], [], '', false ); $this->storeManagerMock = $this->getMock( - 'Magento\Store\Model\StoreManagerInterface', + \Magento\Store\Model\StoreManagerInterface::class, [], [], '', false ); $this->cacheTypeListMock = $this->getMock( - 'Magento\Framework\App\Cache\TypeListInterface', + \Magento\Framework\App\Cache\TypeListInterface::class, [], [], '', false ); - + $this->unserializerMock = $this->getMockBuilder(SecureUnserializer::class) + ->disableOriginalConstructor() + ->getMock(); + $this->loggerMock = $this->getMockBuilder(LoggerInterface::class) + ->disableOriginalConstructor() + ->setMethods(['critical']) + ->getMockForAbstractClass(); $this->model = $this->objectManagerHelper->getObject( - 'Magento\CurrencySymbol\Model\System\Currencysymbol', + \Magento\CurrencySymbol\Model\System\Currencysymbol::class, [ 'scopeConfig' => $this->scopeConfigMock, 'localeResolver' => $this->localeResolverMock, @@ -145,6 +164,8 @@ protected function setUp() 'coreConfig' => $this->coreConfigMock, 'storeManager' => $this->storeManagerMock, 'cacheTypeList' => $this->cacheTypeListMock, + 'unserializer' => $this->unserializerMock, + 'logger' => $this->loggerMock, ] ); } @@ -161,14 +182,14 @@ public function testGetCurrencySymbolData() 'parentSymbol' => '€', 'displayName' => 'Euro', 'displaySymbol' => '€', - 'inherited' => true + 'inherited' => true, ], 'USD' => [ 'parentSymbol' => '$', 'displayName' => 'US Dollar', 'displaySymbol' => '$', - 'inherited' => true - ] + 'inherited' => true, + ], ]; $websiteId = 1; $groupId = 2; @@ -192,7 +213,7 @@ public function testSetCurrencySymbolData() * @var \Magento\Config\Model\Config|\PHPUnit_Framework_MockObject_MockObject */ $configMock = $this->getMock( - 'Magento\Config\Model\Config', + \Magento\Config\Model\Config::class, ['setSection', 'setWebsite', 'setStore', 'setGroups', 'save'], [], '', @@ -219,13 +240,18 @@ public function testSetCurrencySymbolData() ); $this->assertInstanceOf( - 'Magento\CurrencySymbol\Model\System\Currencysymbol', + \Magento\CurrencySymbol\Model\System\Currencysymbol::class, $this->model->setCurrencySymbolsData($symbols) ); } /** * @dataProvider getCurrencySymbolDataProvider + * @param string $code + * @param string $expectedSymbol + * @param string $serializedCustomSymbols + * + * @return void */ public function testGetCurrencySymbol($code, $expectedSymbol, $serializedCustomSymbols) { @@ -234,33 +260,72 @@ public function testGetCurrencySymbol($code, $expectedSymbol, $serializedCustomS ->willReturnMap( [ [ - CurrencySymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL, + Currencysymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL, ScopeInterface::SCOPE_STORE, null, - $serializedCustomSymbols + $serializedCustomSymbols, ], ] ); + $this->unserializerMock->expects($this->any()) + ->method('unserialize') + ->willReturn([$code => $expectedSymbol]); + $currencySymbol = $this->model->getCurrencySymbol($code); $this->assertEquals($expectedSymbol, $currencySymbol); } + /** + * @return array + */ public function getCurrencySymbolDataProvider() { return [ 'existentCustomSymbol' => [ 'code' => 'USD', 'expectedSymbol' => '$', - 'serializedCustomSymbols' => 'a:1:{s:3:"USD";s:1:"$";}' + 'serializedCustomSymbols' => 'a:1:{s:3:"USD";s:1:"$";}', ], 'nonExistentCustomSymbol' => [ 'code' => 'UAH', 'expectedSymbol' => false, - 'serializedCustomSymbols' => 'a:1:{s:3:"USD";s:1:"$";}' - ] + 'serializedCustomSymbols' => 'a:1:{s:3:"USD";s:1:"$";}', + ], ]; } + /** + * @return void + */ + public function testGetBadCurrencySymbol() + { + $serializedBadCustomSymbols = 'a:1:{i:0;O:8:"stdClass":0:{}}'; + $exceptionMessage = 'Data contains serialized object and cannot be unserialized'; + $exception = new \InvalidArgumentException($exceptionMessage); + + $this->scopeConfigMock->expects($this->any()) + ->method('getValue') + ->willReturnMap( + [ + [ + Currencysymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL, + ScopeInterface::SCOPE_STORE, + null, + $serializedBadCustomSymbols, + ], + ] + ); + $this->unserializerMock->expects($this->once()) + ->method('unserialize') + ->with($serializedBadCustomSymbols) + ->willThrowException($exception); + $this->loggerMock->expects($this->once()) + ->method('critical') + ->with($exception); + + $this->assertEquals(false, $this->model->getCurrencySymbol('')); + } + /** * Prepare mocks for getCurrencySymbolsData * @@ -273,17 +338,17 @@ protected function prepareMocksForGetCurrencySymbolsData($websiteId, $groupId, $ /** * @var \Magento\Store\Model\Website|\PHPUnit_Framework_MockObject_MockObject */ - $websiteMock = $this->getMock('Magento\Store\Model\Website', ['getId', 'getConfig'], [], '', false); + $websiteMock = $this->getMock(\Magento\Store\Model\Website::class, ['getId', 'getConfig'], [], '', false); /** * @var \Magento\Store\Model\Group|\PHPUnit_Framework_MockObject_MockObject */ - $groupMock = $this->getMock('Magento\Store\Model\Group', ['getId', 'getWebsiteId'], [], '', false); + $groupMock = $this->getMock(\Magento\Store\Model\Group::class, ['getId', 'getWebsiteId'], [], '', false); /** * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject */ - $storeMock = $this->getMock('Magento\Store\Model\Store', ['getGroupId'], [], '', false); + $storeMock = $this->getMock(\Magento\Store\Model\Store::class, ['getGroupId'], [], '', false); $this->systemStoreMock->expects($this->once()) ->method('getWebsiteCollection') @@ -299,26 +364,26 @@ protected function prepareMocksForGetCurrencySymbolsData($websiteId, $groupId, $ ->method('getValue') ->willReturnMap( [ - [CurrencySymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL, ScopeInterface::SCOPE_STORE, null, ''], + [Currencysymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL, ScopeInterface::SCOPE_STORE, null, ''], [ - CurrencySymbol::XML_PATH_ALLOWED_CURRENCIES, + Currencysymbol::XML_PATH_ALLOWED_CURRENCIES, ScopeInterface::SCOPE_STORE, $storeMock, - $currencies + $currencies, ], - [CurrencySymbol::XML_PATH_ALLOWED_CURRENCIES, ScopeInterface::SCOPE_STORE, null, $currencies], + [Currencysymbol::XML_PATH_ALLOWED_CURRENCIES, ScopeInterface::SCOPE_STORE, null, $currencies], [ - CurrencySymbol::XML_PATH_ALLOWED_CURRENCIES, + Currencysymbol::XML_PATH_ALLOWED_CURRENCIES, ScopeInterface::SCOPE_STORE, $storeMock, - $currencies - ] + $currencies, + ], ] ); $websiteMock->expects($this->any()) ->method('getConfig') - ->with(CurrencySymbol::XML_PATH_ALLOWED_CURRENCIES) + ->with(Currencysymbol::XML_PATH_ALLOWED_CURRENCIES) ->willReturn($currencies); $this->localeResolverMock->expects($this->any())->method('getLocale')->willReturn('en'); } diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 29d3ce3a25392..f014cbd2623d4 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.4", + "version": "100.1.5", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index b1027843aa579..11b4c91836d0f 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -17,7 +17,7 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T /** * @var string */ - protected $_template = 'tab/newsletter.phtml'; + protected $_template = 'Magento_Customer::tab/newsletter.phtml'; /** * @var \Magento\Newsletter\Model\SubscriberFactory diff --git a/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php index 2afd927324921..1afe3decb38db 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php @@ -24,7 +24,7 @@ class Vat extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element /** * @var string */ - protected $_template = 'sales/order/create/address/form/renderer/vat.phtml'; + protected $_template = 'Magento_Customer::sales/order/create/address/form/renderer/vat.phtml'; /** * @var \Magento\Framework\Json\EncoderInterface diff --git a/app/code/Magento/Customer/Block/Newsletter.php b/app/code/Magento/Customer/Block/Newsletter.php index c701669e64a71..91d460b441249 100644 --- a/app/code/Magento/Customer/Block/Newsletter.php +++ b/app/code/Magento/Customer/Block/Newsletter.php @@ -18,7 +18,7 @@ class Newsletter extends \Magento\Customer\Block\Account\Dashboard /** * @var string */ - protected $_template = 'form/newsletter.phtml'; + protected $_template = 'Magento_Customer::form/newsletter.phtml'; /** * @return bool 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 aaee7b0f0ead4..fade544aaddac 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', ['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 4c164e4643372..42c780c039875 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 @@ -215,6 +215,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 f7b8cb34ccf86..8c088892c0e1d 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 = []; @@ -109,6 +113,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 1b039360ce88a..013d0d2a71f99 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php @@ -157,6 +157,9 @@ public function testMethodWithNoSuchEntityException($method) $this->assertFalse($this->_block->{$method}()); } + /** + * @return array + */ public function methodDataProvider() { return [ 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 252b449fec82d..aaffc9d9dd861 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php @@ -542,6 +542,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 4bd5f582a157f..82e25c8aeb0b7 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php @@ -577,6 +577,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 fdff8e47b284d..c288725ccdf76 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 @@ -169,6 +169,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/Plugin/AccountTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Plugin/AccountTest.php index 2a4ea8a0237b7..afc3c3108735c 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Plugin/AccountTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Plugin/AccountTest.php @@ -132,6 +132,9 @@ public function testAroundDispatch( ); } + /** + * @return array + */ public function dataProviderAroundDispatch() { 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 30d79be4b6d0d..750ad569735c8 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 testBeforeStartDataProvider() { return [ diff --git a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php index 739c58f90548a..d2cfb13e201d7 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/AddressTest.php @@ -75,6 +75,9 @@ public function testGetStreetLines($numLines, $expectedNumLines) $this->assertEquals($expectedNumLines, $this->helper->getStreetLines()); } + /** + * @return array + */ public function providerGetStreetLines() { return [ @@ -174,6 +177,9 @@ public function testGetAttributeValidationClass($attrCode, $attrClass, $customAt $this->assertEquals($result, $this->helper->getAttributeValidationClass($attrCode)); } + /** + * @return array + */ public function getAttributeValidationClassDataProvider() { return [ @@ -193,6 +199,9 @@ public function testConvertStreetLines($origStreets, $toCount, $result) $this->assertEquals($result, $this->helper->convertStreetLines($origStreets, $toCount)); } + /** + * @return array + */ public function getConvertStreetLinesDataProvider() { return [ @@ -331,6 +340,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') @@ -365,6 +377,9 @@ public function testGetFormat($code, $result) $this->assertEquals($result, $this->helper->getFormat($code)); } + /** + * @return array + */ public function getFormatDataProvider() { return [ 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 4f9cf8ab2921b..75a1981efdb69 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/AuthenticationTest.php b/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php index 0aedf288a6b7c..ee1a3f6d7713a 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AuthenticationTest.php @@ -207,6 +207,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 06d12afae9095..f0725efcd44ef 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/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index 6598658f1142e..8492c3258efa0 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -71,6 +71,11 @@ 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 c7f338a298134..d5787c7d12490 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 @@ -91,6 +91,9 @@ public function testSetRequestScopeOnly($bool) $this->assertSame($bool, $this->_model->isRequestScopeOnly()); } + /** + * @return array + */ public function trueFalseDataProvider() { return [[true], [false]]; @@ -119,6 +122,9 @@ public function testApplyInputFilter($input, $output, $filter) $this->assertEquals($output, $this->_model->applyInputFilter($input)); } + /** + * @return array + */ public function applyInputFilterProvider() { return [ @@ -157,6 +163,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]]; @@ -228,6 +237,9 @@ public function testValidateInputRule($value, $label, $inputValidation, $expecte $this->assertEquals($expectedOutput, $this->_model->validateInputRule($value)); } + /** + * @return array + */ public function validateInputRuleDataProvider() { return [ @@ -316,6 +328,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 96e5b3bb20354..cbe78b6696ca9 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 @@ -113,6 +113,9 @@ public function testValidateValue($value, $validation, $required, $expected) $this->assertEquals($expected, $actual); } + /** + * @return array + */ public function validateValueDataProvider() { return [ @@ -164,6 +167,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 e009aaf0be049..57b6c366d94d8 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 @@ -101,6 +101,9 @@ public function testExtractValueNoRequestScope($expected, $attributeCode = '', $ } } + /** + * @return array + */ public function extractValueNoRequestScopeDataProvider() { return [ @@ -161,6 +164,9 @@ public function testExtractValueWithRequestScope($expected, $requestScope, $main } } + /** + * @return array + */ public function extractValueWithRequestScopeDataProvider() { return [ @@ -211,6 +217,9 @@ public function testValidateValueNotToUpload($expected, $value, $isAjax = false, $this->assertEquals($expected, $model->validateValue($value)); } + /** + * @return array + */ public function validateValueNotToUploadDataProvider() { return [ @@ -268,6 +277,9 @@ public function testValidateValueToUpload($expected, $value, $parameters = []) $this->assertEquals($expected, $model->validateValue($value)); } + /** + * @return array + */ public function validateValueToUploadDataProvider() { return [ @@ -408,6 +420,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 995b3cabaf9da..bfd95ac6a80cb 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 61c0c02f2b42d..0d2c47b7f6119 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 ce0622e0cb9e7..4f8e8923ec236 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 57e3f977b12c6..4c963d66f1f76 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Renderer/RegionTest.php @@ -110,6 +110,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 751bc0b43bb9b..960f579c706f5 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php @@ -269,6 +269,9 @@ protected function prepareValidatorFactory() return $validatorFactory; } + /** + * @return \Magento\Customer\Model\CustomerFactory|\PHPUnit_Framework_MockObject_MockObject + */ protected function prepareCustomerFactory() { $this->customerFactory = $this->getMock('Magento\Customer\Model\CustomerFactory', ['create'], [], '', false); @@ -290,16 +293,26 @@ 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 4e9ecd07aee77..063c69e6464bf 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 8489a5d8c972e..371de2b7e644b 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -389,6 +389,9 @@ public function testAfterAddressSaveDefaultGroup( $this->model->execute($observer); } + /** + * @return array + */ public function dataProviderAfterAddressSaveDefaultGroup() { return [ @@ -578,6 +581,9 @@ public function testAfterAddressSaveNewGroup( $this->model->execute($observer); } + /** + * @return array + */ public function dataProviderAfterAddressSaveNewGroup() { return [ diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 53c8c633bcdbb..1360c4e8f690d 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -29,7 +29,7 @@ "magento/module-customer-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.12", + "version": "100.1.13", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php index 8f263401e5764..7eed491d0c19b 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 fa5c3044bd09d..edb6651520d8d 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->assertSelectEquals('div > div[title="TestBlock"]', 'TestBlock', (int)$showBlockHints, $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 c70e7ed3a1159..93e8a13e11276 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 @@ -33,6 +33,9 @@ public function testConstructorException(array $configData, $expectedException) new \Magento\Directory\Model\Currency\Import\Config($configData); } + /** + * @return array + */ public function constructorExceptionDataProvider() { return [ @@ -78,6 +81,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]]; @@ -93,6 +99,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 930426c3b1b42..9a199a9fda33a 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php @@ -180,6 +180,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') @@ -189,6 +192,10 @@ protected function getCurrentCurrencyMock() return $currency; } + /** + * @param $baseCurrency + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function getStoreMock($baseCurrency) { $store = $this->getMockBuilder('Magento\Store\Model\Store') @@ -202,6 +209,12 @@ 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') diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 10c2b48d747dd..dad955db5049f 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.6", + "version": "100.1.7", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php index 4019def9e0cd0..e2694b3b93bb9 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php @@ -33,7 +33,7 @@ class Downloadable extends Widget implements TabInterface /** * @var string */ - protected $_template = 'product/edit/downloadable.phtml'; + protected $_template = 'Magento_Downloadable::product/edit/downloadable.phtml'; /** * Accordion block id diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index a8f0d9c95a873..6e57997188455 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -30,7 +30,7 @@ class Links extends \Magento\Backend\Block\Template /** * @var string */ - protected $_template = 'product/edit/downloadable/links.phtml'; + protected $_template = 'Magento_Downloadable::product/edit/downloadable/links.phtml'; /** * Downloadable file diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index 0daace6a5c9eb..daf078ee525ea 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -22,7 +22,7 @@ class Samples extends \Magento\Backend\Block\Widget /** * @var string */ - protected $_template = 'product/edit/downloadable/samples.phtml'; + protected $_template = 'Magento_Downloadable::product/edit/downloadable/samples.phtml'; /** * Downloadable file 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 f5b8fba57783b..f29a46d14111a 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 @@ -154,6 +154,11 @@ public function testGetJsonConfig() $this->assertEquals(json_encode($config), $encodedJsonConfig); } + /** + * @param $linkPrice + * @param $linkId + * @return mixed + */ protected function getLinkMock($linkPrice, $linkId) { $linkMock = $this->getMock('Magento\Downloadable\Model\Link', ['getPrice', 'getId', '__wakeup'], [], '', false); 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 72056e7f99ae9..f1f0fbfadf525 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 @@ -123,6 +123,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 382bb26111d19..c75c3abeb8df6 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php @@ -162,6 +162,9 @@ public function testGetContentTypeThroughHelper($functionExistsResult, $mimeCont $this->assertEquals(self::MIME_TYPE, $this->_helper->getContentType()); } + /** + * @return array + */ public function dataProviderForTestGetContentTypeThroughHelper() { return [[false, ''], [true, false]]; @@ -194,6 +197,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])); @@ -206,6 +214,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 bf50b98c37bd4..a97acd2344666 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Model/LinkRepositoryTest.php @@ -576,6 +576,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 6f89b4a9718f2..5528cf6c41926 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php @@ -101,6 +101,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/Block/Adminhtml/Attribute/Edit/Js.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Js.php index 3ddfe494c7fbc..2633b78c67c78 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Js.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Js.php @@ -17,5 +17,5 @@ class Js extends \Magento\Backend\Block\Template * * @var string */ - protected $_template = 'attribute/edit/js.phtml'; + protected $_template = 'Magento_Eav::attribute/edit/js.phtml'; } diff --git a/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php b/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php index 83a28ed28c96b..2be119dd4f86b 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/AttributeFactoryTest.php @@ -50,6 +50,11 @@ 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/Entity/AbstractEntityTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php index 075e7fcfcdd91..9870b57a0fa8a 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php @@ -53,6 +53,9 @@ public function testCompareAttributes($attribute1Sort, $attribute2Sort, $expecte $this->assertEquals($expected, $this->_model->attributesCompare($attribute1, $attribute2)); } + /** + * @return array + */ public static function compareAttributesDataProvider() { return [ @@ -328,6 +331,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 79d8cc5e727df..cfb5321ffdc8b 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 @@ -43,6 +43,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 19a097baa3c55..e807aed85f455 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 @@ -223,6 +223,9 @@ public function testGetSpecificOptions($optionIds, $withEmpty) $this->assertEquals($options, $this->model->getSpecificOptions($optionIds, $withEmpty)); } + /** + * @return array + */ public function specificOptionsProvider() { return [ @@ -282,6 +285,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 7afeb5d01219d..76237f9d7634b 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 8ae610332ba72..1f6bd004ca350 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 @@ -208,6 +208,9 @@ public function testRemoveItemByKey($values, $count) $this->assertNull($this->model->getItemById($testId)); } + /** + * @return array + */ public function getItemsDataProvider() { return [ @@ -217,6 +220,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 d304db9590aee..162d34a68b50e 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 @@ -72,6 +72,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 6786288e76367..79802aae43733 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 e4ca529f17635..407757ca9f740 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 9473dca435529..a485badc4dc27 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 @@ -195,6 +195,9 @@ public function testInitSelect($column, $value) $this->model->getSelectCountSql()->assemble(); } + /** + * @return array + */ public function initSelectDataProvider() { return [ diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 1b6b54ea7d921..f74bac34fc069 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.10", + "version": "100.1.11", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/Block/Adminhtml/Template.php b/app/code/Magento/Email/Block/Adminhtml/Template.php index fafd1d223f514..4a957917a30cb 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template.php @@ -18,7 +18,7 @@ class Template extends \Magento\Backend\Block\Template implements \Magento\Backe * * @var string */ - protected $_template = 'template/list.phtml'; + protected $_template = 'Magento_Email::template/list.phtml'; /** * @var \Magento\Backend\Block\Widget\Button\ButtonList diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php index 70420656db895..b10ee11156832 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php @@ -41,7 +41,7 @@ class Edit extends Widget implements ContainerInterface * * @var string */ - protected $_template = 'template/edit.phtml'; + protected $_template = 'Magento_Email::template/edit.phtml'; /** * @var \Magento\Framework\Json\EncoderInterface diff --git a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php index d5d049613835b..05d5162065bb8 100644 --- a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php @@ -322,6 +322,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 df292239dc4db..42ca963620646 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 b471f04aeb58e..d7484e006224b 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php @@ -211,6 +211,9 @@ public function testParseTemplateIdParts($input, $expectedOutput) $this->assertEquals($this->model->parseTemplateIdParts($input), $expectedOutput); } + /** + * @return array + */ public function parseTemplateCodePartsDataProvider() { return [ @@ -309,6 +312,9 @@ public function testGetterMethodUnknownTemplate($getterMethod, $argument = null) } } + /** + * @return array + */ public function getterMethodUnknownTemplateDataProvider() { return [ @@ -355,6 +361,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 9955bdb6bb4d4..ee8734b04932a 100644 --- a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php @@ -290,6 +290,9 @@ public function testLoadDefault( $this->assertEquals($expectedTemplateStyles, $model->getTemplateStyles()); } + /** + * @return array + */ public function loadDefaultDataProvider() { return [ @@ -446,6 +449,9 @@ public function testIsValidForSend($senderName, $senderEmail, $templateSubject, $this->assertEquals($expectedValue, $model->isValidForSend()); } + /** + * @return array + */ public function isValidForSendDataProvider() { return [ @@ -536,6 +542,9 @@ public function testGetVariablesOptionArray($withGroup, $templateVariables, $exp $this->assertEquals($expectedResult, $model->getVariablesOptionArray($withGroup)); } + /** + * @return array + */ public function getVariablesOptionArrayDataProvider() { return [ @@ -636,6 +645,9 @@ public function testProcessTemplate($templateId, $expectedResult) $this->assertTrue($model->getUseAbsoluteLinks()); } + /** + * @return array + */ public function processTemplateVariable() { return [ @@ -732,6 +744,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/Block/Message/Inline.php b/app/code/Magento/GiftMessage/Block/Message/Inline.php index 9e2747cf97fc1..9f68199106cc7 100644 --- a/app/code/Magento/GiftMessage/Block/Message/Inline.php +++ b/app/code/Magento/GiftMessage/Block/Message/Inline.php @@ -33,7 +33,7 @@ class Inline extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'inline.phtml'; + protected $_template = 'Magento_GiftMessage::inline.phtml'; /** * Gift message message 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 5860670e14d69..0d05c59c71305 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 5403b76d859d0..5aac82645d451 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 e6648b3a29f39..1734cc049e1a2 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 d800ae6fdc1cc..67a0e5956a24f 100644 --- a/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php +++ b/app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php @@ -62,6 +62,9 @@ protected function setUp() ); } + /** + * @return array + */ public function dataProviderForDisabled() { return [[false, false], [false, true], [true, false]]; @@ -94,6 +97,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 fd7c465bf431b..d482e51f0cc5d 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->getMock('Magento\Framework\DB\Select', [], [], '', false); @@ -162,6 +171,9 @@ public function testGetAttributes($dbAttributes, $returnedAttributes) $this->assertEquals($returnedAttributes, $actualAttributes); } + /** + * @param $behavior + */ protected function processBehaviorGetter($behavior) { $dataSource = $this->getMock('Magento\ImportExport\Model\ResourceModel\Import\Data', [], [], '', false); 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 86360ade52b5b..6b805d044fb99 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 @@ -123,6 +123,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 6640cdad37883..2f8f57bb48e79 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 @@ -28,6 +28,7 @@ class GroupedTest extends \PHPUnit_Framework_TestCase * @var \PHPUnit_Framework_MockObject_MockObject */ protected $productRepository; + /** * @var \Magento\GroupedProduct\Model\Product\Initialization\Helper\ProductLinks\Plugin\Grouped */ @@ -90,6 +91,9 @@ public function testBeforeInitializeLinksRequestDoesNotHaveGrouped($productType) $this->model->beforeInitializeLinks($this->subjectMock, $this->productMock, []); } + /** + * @return array + */ public function productTypeDataProvider() { return [ @@ -142,6 +146,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 6155dbcfc153a..db9a21ede4489 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php @@ -97,6 +97,10 @@ public function testGetValue() $this->assertEquals(10, $this->finalPrice->getValue()); } + /** + * @param $price + * @return mixed + */ protected function getProductMock($price) { $priceTypeMock = $this->getMock('Magento\Catalog\Pricing\Price\FinalPrice', [], [], '', false); 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 793e631a29168..6c38d613057e8 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/Model/Report/Csv.php b/app/code/Magento/ImportExport/Model/Report/Csv.php index f45910e519847..5bc6519b94515 100644 --- a/app/code/Magento/ImportExport/Model/Report/Csv.php +++ b/app/code/Magento/ImportExport/Model/Report/Csv.php @@ -77,7 +77,7 @@ public function createReport( $outputCsv = $this->createOutputCsvModel($outputFileName); $columnsName = $sourceCsv->getColNames(); - array_push($columnsName, self::REPORT_ERROR_COLUMN_NAME); + $columnsName[] = self::REPORT_ERROR_COLUMN_NAME; $outputCsv->setHeaderCols($columnsName); foreach ($sourceCsv as $rowNum => $rowData) { 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 67bbc27b0d564..ee2c0545123ec 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/ConfigTest.php @@ -64,6 +64,9 @@ public function testGetEntities($value, $expected) $this->assertEquals($expected, $this->_model->getEntities('entities')); } + /** + * @return array + */ public function getEntitiesDataProvider() { return [ @@ -98,6 +101,9 @@ public function testGetEntityTypes($configData, $entity, $expectedResult) $this->assertEquals($expectedResult, $this->_model->getEntityTypes($entity)); } + /** + * @return array + */ public function getEntityTypesDataProvider() { return [ @@ -151,6 +157,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 4a60e272db4f2..c7bb78e2aa3e3 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ConfigTest.php @@ -64,6 +64,9 @@ public function testGetEntities($value, $expected) $this->assertEquals($expected, $this->_model->getEntities('entities')); } + /** + * @return array + */ public function getEntitiesDataProvider() { return [ @@ -98,6 +101,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 49a9dc2c76304..6cff1c96f4253 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 2b3dc1acc314a..ea09cba880cfe 100644 --- a/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php +++ b/app/code/Magento/Indexer/Test/Unit/App/IndexerTest.php @@ -39,7 +39,12 @@ protected function setUp() false ); - $this->entryPoint = new \Magento\Indexer\App\Indexer('reportDir', $this->filesystem, $this->processor, $this->_response); + $this->entryPoint = new \Magento\Indexer\App\Indexer( + 'reportDir', + $this->filesystem, + $this->processor, + $this->_response + ); } /** @@ -60,7 +65,11 @@ public function testExecute($isExist, $callCount) $this->assertEquals(0, $this->entryPoint->launch()->getCode()); } - public function executeProvider(){ + /** + * @return array + */ + public function executeProvider() + { return [ 'set1' => ['isExist' => true, 'expectsValue' => 1], 'set1' => ['delete' => false, 'expectsValue' => 0] 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 81c29481bb8e2..fb68d0b10ded9 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 b987ee3859787..53712347a23d9 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 df9038113b4ea..7b00b9c9afc2a 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 f93aed35d7de6..fc46855be3381 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php @@ -301,6 +301,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 4ecb986987b7f..b42f1f441f201 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/ResourceModel/AbstractResourceTest.php @@ -22,7 +22,6 @@ class AbstractResourceTest extends \PHPUnit_Framework_TestCase */ protected $_tableStrategyInterface; - protected function setUp() { $this->_resourceMock = $this->getMockBuilder('Magento\Framework\App\ResourceConnection') @@ -176,6 +175,9 @@ public function testInsertFromTable($readToIndex) ); } + /** + * @return array + */ public function insertFromTableData() { return [[false], [true]]; 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 ad615906f54fc..46e256ba6b4e9 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 bc8e409bd5387..9a3b724854eda 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 @@ -90,6 +90,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 4f8fd5f903f09..1fd272fb6a88e 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 e3029a4fdd349..25e329a5852fd 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,10 @@ 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 82174f5d7b104..64ba64ee2257e 100644 --- a/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php +++ b/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php @@ -156,6 +156,10 @@ public function tearDown() unset($this->_oauth); } + /** + * @param array $amendments + * @return array + */ protected function _getRequestTokenParams($amendments = []) { $requiredParams = [ @@ -233,6 +237,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 +300,9 @@ public function testGetRequestTokenOauthTimestampRefused($timestamp) ); } + /** + * @return array + */ public function dataProviderForGetRequestTokenNonceTimestampRefusedTest() { return [ @@ -302,6 +312,10 @@ public function dataProviderForGetRequestTokenNonceTimestampRefusedTest() ]; } + /** + * @param bool $isUsed + * @param int $timestamp + */ protected function _setupNonce($isUsed = false, $timestamp = 0) { $nonceMock = $this->getMockBuilder( @@ -361,6 +375,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 +625,9 @@ public function testGetAccessTokenVerifierInvalid($verifier, $verifierFromToken) ); } + /** + * @return array + */ public function dataProviderForGetAccessTokenVerifierInvalidTest() { // Verifier is not a string @@ -789,6 +813,9 @@ public function testMissingParamForBuildAuthorizationHeader($expectedMessage, $r $this->_oauth->buildAuthorizationHeader($request, $requestUrl); } + /** + * @return array + */ public function dataProviderMissingParamForBuildAuthorizationHeaderTest() { return [ @@ -838,6 +865,10 @@ public function dataProviderMissingParamForBuildAuthorizationHeaderTest() ]; } + /** + * @param array $amendments + * @return array + */ protected function _getAccessTokenRequiredParams($amendments = []) { $requiredParams = [ @@ -855,6 +886,10 @@ 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/Block/Navigation/State.php b/app/code/Magento/LayeredNavigation/Block/Navigation/State.php index df43ef60518aa..47d6f28245eed 100644 --- a/app/code/Magento/LayeredNavigation/Block/Navigation/State.php +++ b/app/code/Magento/LayeredNavigation/Block/Navigation/State.php @@ -16,7 +16,7 @@ class State extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'layer/state.phtml'; + protected $_template = 'Magento_LayeredNavigation::layer/state.phtml'; /** * Catalog layer diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Response.php b/app/code/Magento/MediaStorage/Model/File/Storage/Response.php index 216068c9fc32a..1125dfd81ad84 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Response.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Response.php @@ -56,7 +56,11 @@ public function __construct( public function sendResponse() { if ($this->_filePath && $this->getHttpResponseCode() == 200) { - $this->_transferAdapter->send($this->_filePath); + $options = [ + 'filepath' => $this->_filePath, + 'headers' => $this->getHeaders(), + ]; + $this->_transferAdapter->send($options); } else { parent::sendResponse(); } diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index 523ad88d018c1..fa44065456fcd 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 7a55f67cc31fe..e2128c31eec2b 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 a0c89b733867d..d71955d330440 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 @@ -74,6 +74,9 @@ public function testCheckDbUsage($storage, $expected) $this->assertEquals($expected, $this->helper->checkDbUsage()); } + /** + * @return array + */ public function checkDbUsageDataProvider() { return [ @@ -143,6 +146,9 @@ public function testSaveFile($storage, $callNum) $this->helper->saveFile('media-dir/filename'); } + /** + * @return array + */ public function updateFileDataProvider() { return [ @@ -225,6 +231,9 @@ public function testFileExists($storage, $callNum, $expected) $this->assertEquals($expected, $this->helper->fileExists('media-dir/file')); } + /** + * @return array + */ public function fileExistsDataProvider() { return [ @@ -263,6 +272,9 @@ public function testGetUniqueFilename($storage, $callNum, $expected) $this->assertSame($expected, $this->helper->getUniqueFilename('media-dir/directory/', 'filename.ext')); } + /** + * @return array + */ public function getUniqueFilenameDataProvider() { return [ @@ -307,6 +319,9 @@ public function testSaveFileToFileSystem($expected, $storage, $callNum, $id = 0, $this->assertEquals($expected, $this->helper->saveFileToFilesystem('media-dir/filename')); } + /** + * @return array + */ public function saveFileToFileSystemDataProvider() { return [ @@ -429,6 +444,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 bac81af9e6f5a..8e97b7933368c 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/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 22f07e1747e00..28df5df4e50e1 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.4", + "version": "100.1.5", "license": [ "OSL-3.0", "AFL-3.0" 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 0d424e331dace..7749c7461ee84 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 @@ -111,6 +111,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 5ea469f81b933..78ca9958fa953 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 @@ -160,6 +160,9 @@ public function testExecute($backUrl, $shippingAddress, $url) $this->controller->execute(); } + /** + * @return array + */ public function executeDataProvider() { return [ 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 26cc1ef3f457e..45d84d2d1c60f 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Apm/DeploymentsTest.php @@ -248,6 +248,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 f108c3bc59f46..a4403cb95b6aa 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php @@ -367,6 +367,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 2f0e578a25684..a63d5e8b08c85 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/Test/Unit/Model/SubscriberTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php index a12cefca9c45f..de8030a8709a3 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php @@ -381,6 +381,9 @@ public function testReceived() $this->assertEquals($this->subscriber, $this->subscriber->received($queue)); } + /** + * @return $this + */ protected function sendEmailCheck() { $storeModel = $this->getMockBuilder('\Magento\Store\Model\Store') diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php index 48fb69f306c7e..fc326f2af53ab 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php @@ -404,6 +404,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/Test/Unit/Model/CheckmoConfigProviderTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Model/CheckmoConfigProviderTest.php index b09009fea2312..7401575316d2d 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 16b677fc4bfd7..1af4beba3c904 100644 --- a/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php +++ b/app/code/Magento/OfflinePayments/Test/Unit/Model/InstructionsConfigProviderTest.php @@ -88,6 +88,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/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php index 49692827e3d78..7b81edc896368 100644 --- a/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php +++ b/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php @@ -63,6 +63,9 @@ public function testBeforeOrderPaymentSaveWithInstructions($methodCode) $this->_model->execute($observer); } + /** + * @return array + */ public function dataProviderBeforeOrderPaymentSaveWithInstructions() { return [ 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 7e74b9e9907f5..102a9839cbbc0 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 @@ -51,6 +51,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 f96e00383016e..366d1ae3b4cd5 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 27fedee39dd7e..8d7101ed372f9 100644 --- a/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php +++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/SalesRule/CalculatorTest.php @@ -23,6 +23,9 @@ protected function setUp() ); } + /** + * @return bool + */ public function testProcessFreeShipping() { $addressMock = $this->getMockBuilder('Magento\Quote\Model\Quote\Address') diff --git a/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php b/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php index e0487da54a3ca..2830a428c5886 100644 --- a/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Block/JavascriptTest.php @@ -136,6 +136,9 @@ public function testGetScriptOptions($isSecure, $url, $expectedResult) $this->assertRegExp($expectedResult, $this->blockJavascript->getScriptOptions()); } + /** + * @return array + */ public function getScriptOptionsDataProvider() { return [ @@ -199,6 +202,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 4367e1649ab48..a7e044c7a0567 100644 --- a/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Controller/Block/EsiTest.php @@ -126,6 +126,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 1cf1b02fac99c..47ea264acef42 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 @@ -232,6 +232,9 @@ public function testAroundDispatchDisabled($state) ); } + /** + * @return array + */ public function dataProvider() { return [ diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php index 65f32ceb76aac..a9b8532b05e75 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php @@ -128,6 +128,9 @@ public function testAroundDispatchDisabled($state) $this->plugin->aroundDispatch($this->frontControllerMock, $this->closure, $this->requestMock); } + /** + * @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 0bbac6c40420e..77b4b31aae295 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 7f64b2a042ea9..030e526a3488d 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 c9fc122984b5f..3cec59eb024cd 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 979232901ecc7..8e581712f806b 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 [ @@ -108,6 +111,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 bead1be5dfe0e..be047a472c70f 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php @@ -88,6 +88,9 @@ public function testExecute($cacheState) $this->_model->execute($observerObject); } + /** + * @return array + */ public function flushCacheByTagsDataProvider() { return [ diff --git a/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php b/app/code/Magento/Payment/Test/Unit/Block/InfoTest.php index 3cac4c4fc3ed6..6485efafdfa5f 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 0aea926135e4a..d429f5754ecbe 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 testStreetLine1DataProvider() { return [ @@ -73,6 +76,9 @@ public function testStreetLine2($street, $expected) $this->assertEquals($expected, $this->model->getStreetLine2()); } + /** + * @return array + */ public function testStreetLine2DataProvider() { 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 b416ac32a49a3..05b967ead3abc 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 testStreetLine1DataProvider() { return [ @@ -73,6 +76,9 @@ public function testStreetLine2($street, $expected) $this->assertEquals($expected, $this->model->getStreetLine2()); } + /** + * @return array + */ public function testStreetLine2DataProvider() { return [ 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 0d0dd2eb394f7..9d63f6466d7cb 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 84ff41fff9e0a..6b1ecccf99f35 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 4c7cbcb7e9c75..35102c4ba119d 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 b35aef2a3f123..3e603dead7e44 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 597b29cc2c03a..081e14b375b6b 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 c4c11292f9e39..60f27645ee4c7 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 1694ac7133eaa..c42fe02fd807c 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php @@ -150,6 +150,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/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php index ebbe2f9925a48..ea4c0134366a1 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php @@ -37,6 +37,9 @@ public function testAroundGetUrl($countryParam, $getUrlParams) $this->assertEquals(['', $getUrlParams], $this->_model->aroundGetUrl($subject, $getUrl, '', [])); } + /** + * @return array + */ public function aroundGetUrlDataProvider() { return [ 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 ee6843473dd61..ec9c72c3c63d1 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 c712b08f6cfcf..fa7f2cc726f60 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 37ea9fd4018ca..b4baefea51659 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 c1411a98a5197..17f988ca14bf6 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php @@ -81,6 +81,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 f14827f4c5f5c..6a94eb9fa0f2a 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/Controller/Payflow/ReturnUrlTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php index 6a015464aa677..77240eb9755ee 100644 --- a/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php @@ -419,6 +419,10 @@ public function testCheckAdvancedAcceptingByPaymentMethod() $payflowadvancedReturnUrl->execute(); } + /** + * @param $orderId + * @param $state + */ private function initOrderMock($orderId, $state) { $this->orderFactory @@ -466,6 +470,10 @@ private function initLayoutMock() ->will($this->returnValue($this->block)); } + /** + * @param $orderId + * @param $restoreQuote + */ private function initcheckoutSession($orderId, $restoreQuote) { $this->checkoutSession diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php index 0b00ecc5bbaa8..4724c42ffe979 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 2556ec758775c..73f6454b8d46f 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 2cbaba2501910..dd7b6c313adb2 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Api/NvpTest.php @@ -152,6 +152,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 cac2d01d74e2e..e596bd6b97879 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/Element/FieldPluginTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/Element/FieldPluginTest.php index c3f6c677a7cec..d4b6751985a8c 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/Element/FieldPluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/Element/FieldPluginTest.php @@ -70,6 +70,9 @@ public function testAroundGetConfigPath($subjectPath, $expectedConfigPath) $this->assertEquals($expectedConfigPath, $this->model->aroundGetConfigPath($this->subject, $callback)); } + /** + * @return array + */ public function aroundGetConfigPathDataProvider() { return [ 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 f5a470dd384df..8eead7d6938a1 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 @@ -151,6 +151,10 @@ public function testMovedToTargetSpecialGroup() ); } + /** + * @param $structure + * @return array + */ private function fetchAllAvailableGroups($structure) { $availableGroups = []; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php index 5ef12b39b7373..2abc2b48aa51d 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php @@ -75,6 +75,9 @@ public function testAroundGetElementByPathPartsNonPayment($pathParts, $returnRes ); } + /** + * @return array + */ public function aroundGetElementByPathPartsNonPaymentDataProvider() { return [ @@ -118,6 +121,9 @@ public function testAroundGetElementByPathParts($pathParts, $countryCode, $expec ); } + /** + * @return array + */ public function aroundGetElementByPathPartsDataProvider() { return [ @@ -180,6 +186,9 @@ public function testAroundGetSectionByPathParts($pathParts, $countryCode, $expec $this->_aroundGetElementByPathPartsAssertResult($result, $getElementByPathParts, $pathParts); } + /** + * @return array + */ public function aroundGetSectionByPathPartsDataProvider() { return [ 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 8e9b40fce09d0..1b1ae10c866d0 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/Method/Checks/SpecificationPluginTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php index ce3b46a24bd42..1a3e0bf294db6 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php @@ -89,6 +89,9 @@ public function testAroundIsApplicable($count) $this->assertEquals($count > 0, $this->callAroundIsApplicable($proceed, $paymentMethod, $quote)); } + /** + * @return array + */ public function aroundIsApplicableDataProvider() { return [[0], [1], [2]]; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php index a105dc602289e..547afc219fb86 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php @@ -203,6 +203,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 8d804f50bca55..498cdd60c2cc9 100644 --- a/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php @@ -169,6 +169,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 85bc73f9ad027..049fd2159fab7 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/composer.json b/app/code/Magento/Paypal/composer.json index a183129b7d867..d99ba747ce938 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -25,7 +25,7 @@ "magento/module-checkout-agreements": "100.1.*" }, "type": "magento2-module", - "version": "100.1.9", + "version": "100.1.10", "license": [ "proprietary" ], 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 fe9d97267f3a7..8471882a76f23 100644 --- a/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php +++ b/app/code/Magento/ProductAlert/Test/Unit/Block/Email/StockTest.php @@ -61,6 +61,9 @@ public function testGetFilteredContent($contentToFilter, $contentFiltered) $this->assertEquals($contentFiltered, $this->_block->getFilteredContent($contentToFilter)); } + /** + * @return array + */ public function testGetFilteredContentDataProvider() { 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 cab2f463fa091..36a312ce00650 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 @@ -132,6 +132,9 @@ public function testSetTemplateStockUrlNotAllowed($stockAlertAllowed, $productAv $this->assertNull($this->_block->getSignupUrl()); } + /** + * @return array + */ public function setTemplateStockUrlNotAllowedDataProvider() { return [ diff --git a/app/code/Magento/Quote/Model/Quote.php b/app/code/Magento/Quote/Model/Quote.php index 5e5c356583b16..727b02ba6b8be 100644 --- a/app/code/Magento/Quote/Model/Quote.php +++ b/app/code/Magento/Quote/Model/Quote.php @@ -2001,7 +2001,7 @@ public function getErrors() foreach ($this->getMessages() as $message) { /* @var $error \Magento\Framework\Message\AbstractMessage */ if ($message->getType() == \Magento\Framework\Message\MessageInterface::TYPE_ERROR) { - array_push($errors, $message); + $errors[] = $message; } } return $errors; 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 b03cf698e2c01..d6c685562b30d 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalManagementTest.php @@ -93,6 +93,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 eaae0d7fc16b2..72f38370b7e09 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php @@ -178,6 +178,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/Quote/Address/Total/SubtotalTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/SubtotalTest.php index e4f31106e1e25..ef7d773f6afa3 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 @@ -51,6 +51,9 @@ protected function setUp() ); } + /** + * @return array + */ public function collectDataProvider() { return [ @@ -82,7 +85,6 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri // @TODO this is a wrong test and it does not check methods. Any digital value will be correct $priceCurrency->expects($this->any())->method('convert')->willReturn(1231313); - /** @var \Magento\Quote\Model\Quote\Item|\PHPUnit_Framework_MockObject_MockObject $quoteItem */ $quoteItem = $this->objectManager->getObject( 'Magento\Quote\Model\Quote\Item', 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 1999900538a8b..84cb13acafb76 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 @@ -33,6 +33,9 @@ public function testSetTotalAmount($code, $amount, $storedCode) $this->assertSame($this->model, $result); } + /** + * @return array + */ public function setTotalAmountDataProvider() { return [ @@ -64,6 +67,9 @@ public function testSetBaseTotalAmount($code, $amount, $storedCode) $this->assertSame($this->model, $result); } + /** + * @return array + */ public function setBaseTotalAmountDataProvider() { return [ @@ -95,6 +101,9 @@ public function testAddTotalAmount($initialAmount, $delta, $updatedAmount) $this->assertEquals($updatedAmount, $this->model->getTotalAmount($code)); } + /** + * @return array + */ public function addTotalAmountDataProvider() { return [ @@ -126,6 +135,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/UpdaterTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php index f51e4d5615ec7..4592d72a7af65 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 @@ -143,6 +143,9 @@ public function testUpdateNotQtyDecimal($qty, $expectedQty) $this->object->update($this->itemMock, ['qty' => $qty]); } + /** + * @return array + */ public function qtyProvider() { return [ @@ -155,6 +158,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 2530477bdf747..615321588c7c0 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php @@ -411,6 +411,16 @@ public function testSetProductWithQuoteAndStockItem() $this->assertEquals($isQtyDecimal, $this->model->getIsQtyDecimal()); } + /** + * @param $productId + * @param $productType + * @param $productSku + * @param $productName + * @param $productWeight + * @param $productTaxClassId + * @param $productCost + * @return \PHPUnit_Framework_MockObject_MockObject + */ private function generateProductMock( $productId, $productType, @@ -846,6 +856,11 @@ 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') diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php index 684b68cd25a13..3f460cbe460c6 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php @@ -672,6 +672,9 @@ public function testGetAddressById($addressId, $expected) $this->assertEquals((bool)$expected, (bool)$result); } + /** + * @return array + */ public static function dataProviderGetAddress() { return [ @@ -713,6 +716,9 @@ public function testGetAddressByCustomerAddressId($isDeleted, $customerAddressId $this->assertEquals((bool)$expected, (bool)$result); } + /** + * @return array + */ public static function dataProviderGetAddressByCustomer() { return [ @@ -759,6 +765,9 @@ public function testGetShippingAddressByCustomerAddressId($isDeleted, $addressTy $this->assertEquals($expected, (bool)$result); } + /** + * @return array + */ public static function dataProviderShippingAddress() { 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 77839ff279ae1..57ac5a18defa2 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/Review/Test/Unit/Block/FormTest.php b/app/code/Magento/Review/Test/Unit/Block/FormTest.php index ed827f0e740d4..141d8cca3d53d 100644 --- a/app/code/Magento/Review/Test/Unit/Block/FormTest.php +++ b/app/code/Magento/Review/Test/Unit/Block/FormTest.php @@ -125,6 +125,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 bf04ebdcc483d..7c99f9b064b84 100644 --- a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php +++ b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php @@ -201,6 +201,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 3bfccbf6600ae..04268af2cae07 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 @@ -148,6 +148,9 @@ public function testAddEntityFilter( $this->model->addEntityFilter($entity, $pkValue); } + /** + * @return array + */ public function addEntityFilterDataProvider() { return [ diff --git a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php index 4be6aebb27f50..4d478b52688a9 100644 --- a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php +++ b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php @@ -26,6 +26,9 @@ protected function setUp() ->getMockForAbstractClass(); } + /** + * @return \Magento\Ui\DataProvider\Modifier\ModifierInterface|object + */ protected function createModel() { return $this->objectManager->getObject(Review::class, [ diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 4bb76ead4a548..498fa88eb9022 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -18,7 +18,7 @@ "magento/module-review-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.7", + "version": "100.1.8", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Robots/composer.json b/app/code/Magento/Robots/composer.json index a23211c6fa5d3..f0fcaf7d4c9ce 100644 --- a/app/code/Magento/Robots/composer.json +++ b/app/code/Magento/Robots/composer.json @@ -10,7 +10,7 @@ "magento/module-theme": "100.1.*" }, "type": "magento2-module", - "version": "100.1.1", + "version": "100.1.2", "license": [ "OSL-3.0", "AFL-3.0" 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 d0894be4ba34a..25a1482bf09e4 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 [ @@ -149,6 +152,9 @@ public function testValidate($existingValue, $operator, $valueForValidate, $expe ); } + /** + * @return array + */ public function validateAttributeArrayInputTypeDataProvider() { return [ 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 a758734f0caf4..f3f646eb2066b 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 @@ -89,6 +89,9 @@ protected function setUp() ); } + /** + * @return array + */ public function testAddWebsitesToResultDataProvider() { return [ diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo.php b/app/code/Magento/Sales/Block/Order/Creditmemo.php index 2d45285e9ca1a..aaa5076c8fffe 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo.php @@ -17,7 +17,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/Info.php b/app/code/Magento/Sales/Block/Order/Info.php index 7843479149cfd..c87444e528578 100644 --- a/app/code/Magento/Sales/Block/Order/Info.php +++ b/app/code/Magento/Sales/Block/Order/Info.php @@ -21,7 +21,7 @@ class Info extends \Magento\Framework\View\Element\Template /** * @var string */ - protected $_template = 'order/info.phtml'; + protected $_template = 'Magento_Sales::order/info.phtml'; /** * Core registry diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index 7c30d933e354a..688976e648bc4 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -1146,6 +1146,10 @@ public function addTransaction($type, $salesDocument = null, $failSafe = false) return $builder->build($type); } + /** + * @param $transaction + * @param $message + */ public function addTransactionCommentsToOrder($transaction, $message) { $order = $this->getOrder(); 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 3788272ef9ff2..95fa51e72a3cc 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 @@ -280,6 +280,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 ad8f237baf165..59c1c80ee1ab3 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 963b8d75a6e02..a1fe59e235cda 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 @@ -51,6 +51,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/Controller/Adminhtml/Order/Create/ProcessDataTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ProcessDataTest.php index 792d46afd6c01..a80a09361188f 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 @@ -236,6 +236,9 @@ public function testExecute($noDiscount, $couponCode, $errorMessage, $actualCoup $this->assertInstanceOf('Magento\Backend\Model\View\Result\Forward', $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 762cd71544cea..f522ba6b222ac 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php @@ -212,6 +212,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 88394075bd1a7..2ff2a9ce47aca 100644 --- a/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php +++ b/app/code/Magento/Sales/Test/Unit/Cron/CleanExpiredQuotesTest.php @@ -68,6 +68,9 @@ public function testExecute($lifetimes, $additionalFilterFields) $this->observer->execute(); } + /** + * @return array + */ public function cleanExpiredQuotesDataProvider() { return [ diff --git a/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php b/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php index 779a6e93ca27b..8bf7cefd58234 100644 --- a/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php +++ b/app/code/Magento/Sales/Test/Unit/Helper/AdminTest.php @@ -193,6 +193,9 @@ public function testDisplayPriceAttribute( ); } + /** + * @return array + */ public function displayPricesDataProvider() { return [ @@ -305,6 +308,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/InvoiceOrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php index f246a6c12d029..bdc252d8adbbb 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php @@ -434,6 +434,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 a52102ab274f0..b38a14225982f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php @@ -101,6 +101,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 27295ae9dbb48..d6f5f4a267e2c 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 616f3371ccc36..e56d4dec560c9 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 a285df1b8cd1e..508b528048ba3 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 @@ -157,6 +157,10 @@ public function stepMockSetup() ); } + /** + * @param $billingAddress + * @param bool $isVirtual + */ public function stepAddressFormat($billingAddress, $isVirtual = false) { $this->orderMock->expects($this->any()) @@ -183,6 +187,9 @@ public function stepSendWithCallSendCopyTo() $this->stepSend($this->never(), $this->once()); } + /** + * @param $identityMockClassName + */ public function stepIdentityContainerInit($identityMockClassName) { $this->identityContainerMock = $this->getMock( @@ -197,6 +204,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 963c085eaff33..c5009ecf09a29 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,11 @@ 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 +172,12 @@ 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 9cf79a764583b..77a38d32a88b4 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php @@ -160,6 +160,9 @@ public function testDefaultCanVoid($canVoid) $this->assertEquals($canVoid, $this->model->canVoid()); } + /** + * @return array + */ public function canVoidDataProvider() { return [[true], [false]]; @@ -386,6 +389,9 @@ public function testPay( $this->model->pay(); } + /** + * @return array + */ public function payDataProvider() { //ToDo: fill data provider and uncomment assertings totals in testPay 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 98f131d3cca7c..73b5c834a7587 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php @@ -20,6 +20,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Item */ protected $model; + /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ @@ -42,14 +43,12 @@ protected function setUp() $this->model = $this->objectManager->getObject('Magento\Sales\Model\Order\Item', $arguments); } - public function testSetParentItemNull() { $this->assertEquals($this->model, $this->model->setParentItem(null)); $this->assertNull($this->model->getParentItem()); } - public function testSetParentItem() { $item = $this->objectManager->getObject('Magento\Sales\Model\Order\Item', []); @@ -130,6 +129,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 3db657b1c1378..07e51d20635a6 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 @@ -176,6 +176,10 @@ public function testGetList() $this->assertSame($this->collection, $this->repository->getList($this->searchCriteria)); } + /** + * @param bool $id + * @return mixed + */ protected function mockPayment($id = false) { $payment = $this->getMock( 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 86d22fed46118..b84d75652fbc1 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 @@ -194,7 +194,6 @@ protected function expectsLinkWithParentTransaction( } } - /** * @param int $orderId * @param int $paymentId @@ -287,6 +286,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 fcd8e08d072bb..f4923dcd7aae3 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 @@ -183,6 +183,9 @@ public function generateTransactionIdDataProvider() ]; } + /** + * @return array + */ public function isTransactionExistsDataProvider() { return [ @@ -193,6 +196,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 03bf382b072df..544dd1e0c90ab 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php @@ -591,6 +591,9 @@ public function testAcceptApprovePaymentTrue() $this->assertEquals($baseGrandTotal, $this->payment->getBaseAmountPaidOnline()); } + /** + * @return array + */ public function acceptPaymentFalseProvider() { return [ @@ -1520,6 +1523,9 @@ public function testRefund() static::assertEquals($amount, $this->payment->getData('base_amount_refunded')); } + /** + * @return array + */ public function boolProvider() { return [ @@ -1558,6 +1564,9 @@ public function testGetShouldCloseParentTransaction() static::assertFalse($this->payment->getShouldCloseParentTransaction()); } + /** + * @return object + */ protected function initPayment() { return (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject( @@ -1577,6 +1586,12 @@ protected function initPayment() ); } + /** + * @param $state + * @param null $status + * @param null $message + * @param null $isCustomerNotified + */ protected function assertOrderUpdated( $state, $status = null, @@ -1605,6 +1620,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 */ @@ -1630,6 +1650,10 @@ protected function mockGetDefaultStatus($state, $status, $allStatuses = []) ->will($this->returnValue($orderConfigMock)); } + /** + * @param $transactionId + * @return mixed + */ protected function getTransactionMock($transactionId) { $transaction = $this->getMock( 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 af6535fae2c7a..25554f86f89aa 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 e6b402f6a4e3b..bdcbe5c1d8235 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php @@ -839,6 +839,9 @@ protected function prepareItemMock($qtyInvoiced) ->will($this->returnValue($itemCollectionMock)); } + /** + * @return array + */ public function canVoidPaymentDataProvider() { $data = []; @@ -850,6 +853,9 @@ public function canVoidPaymentDataProvider() return $data; } + /** + * @return array + */ public function dataProviderActionFlag() { return [ @@ -1023,6 +1029,9 @@ public function testSetPaymentNoId() ); } + /** + * @return array + */ public function notInvoicingStatesProvider() { return [ @@ -1032,6 +1041,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 7997f4f18ec24..beca74b0a6dc7 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 845bdeddc3cac..a0950aeef7e27 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/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php index 2a73729ab6730..59ca02ff2f3c0 100644 --- a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/AddVatRequestParamsOrderCommentTest.php @@ -87,6 +87,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 b12f171f8787b..fcbca8797cc14 100644 --- a/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Observer/Frontend/RestoreCustomerGroupIdTest.php @@ -69,6 +69,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 8b0e5c5444503..d7b20c3fbd9bd 100644 --- a/app/code/Magento/Sales/etc/di.xml +++ b/app/code/Magento/Sales/etc/di.xml @@ -669,8 +669,8 @@ BillingAddressAggregator ShippingAddressAggregator sales_order.shipping_description - sales_order.base_subtotal - sales_order.base_shipping_amount + sales_invoice.base_subtotal + sales_invoice.base_shipping_amount sales_invoice.base_grand_total sales_invoice.grand_total sales_invoice.created_at 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 469c9a5922dc0..c2d1bba9aa574 100644 --- a/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php +++ b/app/code/Magento/SalesInventory/Test/Unit/Model/Order/ReturnValidatorTest.php @@ -122,6 +122,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 dd3527e7f5051..6e05a6e1691e7 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 @@ -148,6 +148,9 @@ public function testAroundValidation($errorMessage) ); } + /** + * @return array + */ public function dataProvider() { return [ diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index 197b7366a8b8d..201df99aa5187 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -508,7 +508,7 @@ public function sortItemsByPriority($items, Address $address = null) foreach ($items as $itemKey => $itemValue) { if ($rule->getActions()->validate($itemValue)) { unset($items[$itemKey]); - array_push($itemsSorted, $itemValue); + $itemsSorted[] = $itemValue; } } } 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 8b324381f8372..19513917c587b 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php @@ -213,6 +213,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/ToModelTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Converter/ToModelTest.php index 834fb4d78131b..59743715f768b 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 b9c2b5d6cf5c0..002771ff34e6b 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/CouponRepositoryTest.php @@ -159,6 +159,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 3ab47b05cb5b6..c6155ceb54db3 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php @@ -234,6 +234,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 12add3504f75a..7b97f7b4f12c9 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php @@ -132,6 +132,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) @@ -152,6 +155,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 37e18111ae1b3..5c0612e82965e 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php @@ -149,6 +149,9 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed($isChildren, $this->assertEquals($appliedRuleIds, $result); } + /** + * @return array + */ public function dataProviderChildren() { return [ @@ -200,6 +203,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 6fd5135daae04..1c5af8a385edb 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php @@ -392,6 +392,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 efa81641d20dd..2e08adad3b914 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php @@ -513,6 +513,9 @@ public function testProcessShippingAmountActions($action) ); } + /** + * @return array + */ public static function dataProviderActions() { return [ diff --git a/app/code/Magento/SalesRule/Test/Unit/Observer/SalesOrderAfterPlaceObserverTest.php b/app/code/Magento/SalesRule/Test/Unit/Observer/SalesOrderAfterPlaceObserverTest.php index 3b12a1546a448..619a7647f22fe 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Observer/SalesOrderAfterPlaceObserverTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Observer/SalesOrderAfterPlaceObserverTest.php @@ -27,7 +27,6 @@ class SalesOrderAfterPlaceObserverTest extends \PHPUnit_Framework_TestCase */ protected $ruleCustomerFactory; - /** * @var \Magento\SalesRule\Model\ResourceModel\Coupon\Usage|\PHPUnit_Framework_MockObject_MockObject */ @@ -193,6 +192,9 @@ public function testSalesOrderAfterPlace($ruleCustomerId) $this->assertEquals($this->model, $this->model->execute($observer)); } + /** + * @return array + */ public function salesOrderAfterPlaceDataProvider() { return [ diff --git a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php index 5e31c1ed31867..39fcebeeec950 100644 --- a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php @@ -116,6 +116,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 a3cb5bfbd9b4f..1218840087aeb 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 d0c72319bcd76..0f0e8a9c33ec0 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 @@ -55,6 +55,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/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php index 38e563e63b4b1..fa80762dd628d 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 @@ -212,6 +212,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/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php b/app/code/Magento/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php index 1617161fff361..b65a374466d75 100644 --- a/app/code/Magento/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php @@ -202,6 +202,10 @@ public function testGet($path) $this->assertEquals($this->getExpectedResult($path), $this->configSource->get($path)); } + /** + * @param $path + * @return array + */ private function getExpectedResult($path) { switch ($this->getScope($path)) { @@ -221,6 +225,9 @@ private function getExpectedResult($path) return $result; } + /** + * @param $path + */ private function prepareStores($path) { $scope = $this->getScope($path); @@ -254,6 +261,9 @@ private function prepareStores($path) } } + /** + * @param $path + */ private function prepareGroups($path) { $scope = $this->getScope($path); @@ -287,6 +297,9 @@ private function prepareGroups($path) } } + /** + * @param $path + */ private function prepareWebsites($path) { $scope = $this->getScope($path); @@ -320,11 +333,19 @@ private function prepareWebsites($path) } } + /** + * @param $path + * @return string + */ private function getScopeCode($path) { return implode('/', array_slice(explode('/', $path), 1, 1)); } + /** + * @param $path + * @return string + */ private function getScope($path) { return implode('/', array_slice(explode('/', $path), 0, 1)); 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 49cfb681b1a50..5e92ddb7ef8a7 100644 --- a/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/Service/StoreConfigManagerTest.php @@ -52,6 +52,10 @@ protected function setUp() ); } + /** + * @param array $storeConfig + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function getStoreMock(array $storeConfig) { $storeMock = $this->getMockBuilder('Magento\Store\Model\Store') @@ -85,6 +89,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 97e52734689a9..3ee6d131cf00b 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') diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php index 5103e3de5bdef..5eb795d5acfb0 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php @@ -98,6 +98,9 @@ public function testLoad($key, $field) $model->load($key); } + /** + * @return array + */ public function loadDataProvider() { return [ @@ -258,6 +261,9 @@ function ($path, $scope, $scopeCode) use ($secure, $expectedPath) { $this->assertEquals($expectedBaseUrl, $model->getBaseUrl($type, $secure)); } + /** + * @return array + */ public function getBaseUrlDataProvider() { return [ @@ -563,6 +569,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 6ad7a824383d8..079dbd0df5a1c 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/composer.json b/app/code/Magento/Store/composer.json index d14fbc6d9ae57..92fcd2e46ea50 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -14,7 +14,7 @@ "magento/module-deploy": "100.1.*" }, "type": "magento2-module", - "version": "100.1.10", + "version": "100.1.11", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index 770261260acda..35c34dcf6461f 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.3", + "version": "100.1.4", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swatches/Controller/Ajax/Media.php b/app/code/Magento/Swatches/Controller/Ajax/Media.php index 6a5a2d32a8a25..83a8d6d0aa688 100644 --- a/app/code/Magento/Swatches/Controller/Ajax/Media.php +++ b/app/code/Magento/Swatches/Controller/Ajax/Media.php @@ -73,6 +73,11 @@ public function execute() return $resultJson; } + /** + * @param Product $currentConfigurable + * @param array $attributes + * @return bool|\Magento\Catalog\Api\Data\ProductInterface|null + */ protected function getProductVariationWithMedia(Product $currentConfigurable, array $attributes) { $product = null; diff --git a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php index 2028200a4370a..a91f420b5e6dd 100644 --- a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php +++ b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php @@ -8,6 +8,8 @@ use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Framework\Exception\InputException; use Magento\Swatches\Model\Swatch; +use Magento\Framework\Unserialize\SecureUnserializer; +use Magento\Framework\App\ObjectManager; /** * Plugin model for Catalog Resource Attribute @@ -50,19 +52,28 @@ class EavAttribute */ protected $isSwatchExists; + /** + * @var SecureUnserializer + */ + private $secureUnserializer; + /** * @param \Magento\Swatches\Model\ResourceModel\Swatch\CollectionFactory $collectionFactory * @param \Magento\Swatches\Model\SwatchFactory $swatchFactory * @param \Magento\Swatches\Helper\Data $swatchHelper + * @param SecureUnserializer|null $secureUnserializer */ public function __construct( \Magento\Swatches\Model\ResourceModel\Swatch\CollectionFactory $collectionFactory, \Magento\Swatches\Model\SwatchFactory $swatchFactory, - \Magento\Swatches\Helper\Data $swatchHelper + \Magento\Swatches\Helper\Data $swatchHelper, + SecureUnserializer $secureUnserializer = null ) { $this->swatchCollectionFactory = $collectionFactory; $this->swatchFactory = $swatchFactory; $this->swatchHelper = $swatchHelper; + $this->secureUnserializer = $secureUnserializer + ?: ObjectManager::getInstance()->get(SecureUnserializer::class); } /** @@ -143,7 +154,7 @@ protected function convertSwatchToDropdown(Attribute $attribute) if ($attribute->getData(Swatch::SWATCH_INPUT_TYPE_KEY) == Swatch::SWATCH_INPUT_TYPE_DROPDOWN) { $additionalData = $attribute->getData('additional_data'); if (!empty($additionalData)) { - $additionalData = unserialize($additionalData); + $additionalData = $this->secureUnserializer->unserialize($additionalData); if (is_array($additionalData) && isset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY])) { unset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY]); $attribute->setData('additional_data', serialize($additionalData)); 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 525c85b85047f..effe7db9a1aa9 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 @@ -171,6 +171,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 9e3e2b4824bef..5a09dc20365ed 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 @@ -20,6 +20,9 @@ public function testAddValues($values) $block->addValues($values); } + /** + * @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 cea0f7270d029..3b5baa16ee0e1 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 @@ -135,6 +135,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 5b76f4d4ae5c7..5a4db98c53c73 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 @@ -43,6 +43,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 3c93810b89c27..8531a53382694 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php @@ -148,6 +148,9 @@ protected function setUp() ); } + /** + * @return array + */ public function dataForAdditionalData() { $additionalData = [ @@ -200,6 +203,9 @@ public function testAssembleAdditionalDataEavAttribute($dataFromDb, $attributeDa $this->swatchHelperObject->assembleAdditionalDataEavAttribute($this->attributeMock); } + /** + * @return array + */ public function dataForAssembleEavAttribute() { $additionalData = [ @@ -245,6 +251,9 @@ public function testLoadFirstVariationWithSwatchImage($imageTypes, $expected, $r } } + /** + * @return array + */ public function dataForVariationWithSwatchImage() { return [ @@ -304,6 +313,9 @@ public function testLoadFirstVariationWithImage($imageTypes, $expected, $require } } + /** + * @return array + */ public function dataForVariationWithImage() { return [ @@ -410,6 +422,9 @@ public function testGetProductMediaGallery($mediaGallery, $image) } } + /** + * @return array + */ public function dataForMediaGallery() { return [ @@ -447,6 +462,10 @@ protected function getSwatchAttributes() ->willReturn($returnFromProvideMethod); } + /** + * @param array $attributes + * @param array $imageTypes + */ protected function getUsedProducts(array $attributes, array $imageTypes) { $this->productMock @@ -540,6 +559,9 @@ protected function addfilterByParent() $zendDbSelectMock->method('where')->willReturn($zendDbSelectMock); } + /** + * @return array + */ public function dataForCreateSwatchProduct() { $productMock = $this->getMock(\Magento\Catalog\Model\Product::class, [], [], '', false); @@ -576,6 +598,9 @@ public function dataForCreateSwatchProduct() ]; } + /** + * @return array + */ public function dataForCreateSwatchProductByFallback() { $productMock = $this->getMock(\Magento\Catalog\Model\Product::class, [], [], '', false); @@ -626,6 +651,9 @@ public function testGetSwatchAttributesAsArray($optionsArray, $attributeData, $e $this->assertEquals($result, $expected); } + /** + * @return array + */ public function dataForGettingSwatchAsArray() { return [ @@ -818,6 +846,9 @@ public function testIsVisualSwatch($swatchType, $boolResult) } } + /** + * @return array + */ public function dataIsVisualSwatch() { return [ @@ -859,6 +890,9 @@ public function testIsVisualSwatchFalse($data, $count, $swatchType, $boolResult) } } + /** + * @return array + */ public function dataForIsVisualSwatchType() { $additionalData = [ @@ -916,6 +950,9 @@ public function testIsTextSwatchFalse($data, $count, $swatchType, $boolResult) } } + /** + * @return array + */ public function dataForIsTextSwatchType() { $additionalData = [ @@ -965,6 +1002,9 @@ public function testIsTextSwatch($swatchType, $boolResult) } } + /** + * @return array + */ public function dataIsTextSwatch() { return [ @@ -999,6 +1039,9 @@ public function testIsSwatchAttribute($times, $swatchType, $boolResult) } } + /** + * @return array + */ public function dataIsSwatchAttribute() { return [ diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php index 01fe483b07b55..ca812e0cccc41 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php @@ -136,6 +136,9 @@ public function testGetSwatchAttributeImage($swatchType, $expectedResult) $this->assertEquals($result, $expectedResult); } + /** + * @return array + */ public function dataForFullPath() { return [ @@ -229,6 +232,9 @@ public function testGetFolderNameSize($swatchType, $imageConfig, $expectedResult $this->assertEquals($expectedResult, $result); } + /** + * @return array + */ public function dataForFolderName() { return [ @@ -320,6 +326,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 26117fac61f99..fbb26e27f7e46 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php @@ -78,6 +78,11 @@ protected function setUp() false ); + $secureUnserializer = $this->getMock( + \Magento\Framework\Unserialize\SecureUnserializer::class, + ['unserialize'] + ); + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->eavAttribute = $objectManager->getObject( \Magento\Swatches\Model\Plugin\EavAttribute::class, @@ -85,9 +90,15 @@ protected function setUp() 'collectionFactory' => $this->collectionFactory, 'swatchFactory' => $this->swatchFactory, 'swatchHelper' => $this->swatchHelper, + 'secureUnserializer' => $secureUnserializer, ] ); + $secureUnserializer->expects($this->any()) + ->method('unserialize')->willReturnCallback(function ($parameter) { + return unserialize($parameter); + }); + $this->optionIds = [ 'value' => ['option 89' => 'test 1', 'option 114' => 'test 2', 'option 170' => 'test 3'], 'delete' => ['option 89' => 0, 'option 114' => 1, 'option 170' => 0], @@ -303,6 +314,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 75a4ed02f63be..b96dafe735cb3 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php @@ -109,6 +109,9 @@ public function testBeforeGetImage($expected) $this->assertEquals([$this->productMock, $expected['page_handle'], []], $result); } + /** + * @param $expected + */ protected function getFilterArray($expected) { $this->eavConfigMock @@ -127,6 +130,9 @@ protected function getFilterArray($expected) ->willReturn($expected['getId']); } + /** + * @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 758aeecaccaee..69a7237cd9358 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/SwatchAttributeCodesTest.php b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php index 620507cf92dac..d13a717fbc029 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php @@ -156,6 +156,9 @@ public function testGetCodes($swatchAttributeCodesCache, $expected) $this->assertEquals($expected, $result); } + /** + * @return array + */ public function dataForGettingCodes() { return [ diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php index e60922a053df4..ca2a530777ce4 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php @@ -83,6 +83,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 d26dc4a000f84..33347955c2fa8 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php @@ -75,6 +75,9 @@ public function testAddSwatchAttributeType($exp) $this->observerMock->execute($this->eventObserverMock); } + /** + * @return array + */ public function dataAddSwatch() { return [ diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index 648f61329ade3..ac817f3d58db6 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -19,7 +19,7 @@ "magento/module-swatches-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.11", + "version": "100.1.12", "license": [ "proprietary" ], diff --git a/app/code/Magento/Swatches/i18n/en_US.csv b/app/code/Magento/Swatches/i18n/en_US.csv index 04101974cb4f5..ac3c1bfb71716 100644 --- a/app/code/Magento/Swatches/i18n/en_US.csv +++ b/app/code/Magento/Swatches/i18n/en_US.csv @@ -35,3 +35,4 @@ Image,Image "Image Position","Image Position" "The value of Admin must be unique.","The value of Admin must be unique." "Description","Description" +"More","More" diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 05757825b205c..00f7f5d0e44f7 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -235,7 +235,7 @@ define([ controlLabelId: '', // text for more button - moreButtonText: 'More', + moreButtonText: $t('More'), // Callback url for media mediaCallback: '', 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 e6a349ae7814f..a71e692ebf9a5 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 2978cb7fc631f..509d46762ac7d 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 @@ -94,6 +94,9 @@ public function testDisplayPriceInclTax($zone, $methodName) $this->assertEquals($flag, $this->renderer->displayPriceInclTax()); } + /** + * @return array + */ public function testDisplayPriceInclTaxDataProvider() { $data = [ @@ -141,6 +144,9 @@ public function testDisplayPriceExclTax($zone, $methodName) $this->assertEquals($flag, $this->renderer->displayPriceExclTax()); } + /** + * @return array + */ public function testDisplayPriceExclTaxDataProvider() { $data = [ @@ -188,6 +194,9 @@ public function testDisplayBothPrices($zone, $methodName) $this->assertEquals($flag, $this->renderer->displayBothPrices()); } + /** + * @return array + */ public function testDisplayBothPricesDataProvider() { $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 c98aa6cd727a9..3b3d41e221e33 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php @@ -345,6 +345,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 70444b360801c..79ab2c709f2c8 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') @@ -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') @@ -95,6 +101,9 @@ protected function setupExtensionAttributeMock() return $orderExtensionAttributeMock; } + /** + * @param $expectedTaxes + */ protected function verifyOrderTaxes($expectedTaxes) { $index = 0; @@ -127,6 +136,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 ec69f9930e6c1..041cca389075f 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php @@ -87,6 +87,10 @@ protected function setUp() ); } + /** + * @param array $data + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function setupTaxTotal(array $data) { $taxTotalMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address\Total') @@ -100,6 +104,10 @@ 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') @@ -121,6 +129,10 @@ 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') 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 4f8db8c586949..79d92d76b886c 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php @@ -60,6 +60,9 @@ protected function setUp() ); } + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function setupOrderExtensionAttributeMock() { $orderExtensionAttributeMock = $this->getMockBuilder('\Magento\Sales\Api\Data\OrderExtensionInterface') @@ -178,6 +181,7 @@ public function testAfterConvertNullExtensionAttribute( * Data provider for testAfterConvert and testAfterConvertNullExtensionAttribute * * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function afterConvertDataProvider() { 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 7fa5c2ac45df0..2a47be8d7ae42 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 @@ -178,6 +178,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 9ff681a7607e6..0de3826ccd302 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 7b136e6617e2f..fa6540bcdd8d6 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 665810194ea66..f709b735d80ba 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/TaxClass/FactoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php index 31bf319ce2693..d387d6d22821b 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/FactoryTest.php @@ -42,6 +42,9 @@ public function testCreate($classType, $className, $classTypeMock) $this->assertEquals($classTypeMock, $taxClassFactory->create($classMock)); } + /** + * @return array + */ public function createDataProvider() { $customerClassMock = $this->getMock('Magento\Tax\Model\TaxClass\Type\Customer', [], [], '', false); diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php index 1c42118d4443f..b87670e498c3a 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php @@ -162,6 +162,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/Pricing/AdjustmentTest.php b/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php index 9815f89e7de95..8d6027489b43d 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/Theme/Controller/Adminhtml/Design/Config/Save.php b/app/code/Magento/Theme/Controller/Adminhtml/Design/Config/Save.php index be8ae3c092ac2..0effa170316b1 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/Design/Config/Save.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/Design/Config/Save.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Theme\Controller\Adminhtml\Design\Config; use Magento\Backend\App\Action; @@ -68,9 +69,12 @@ public function execute() $data = $this->getRequestData(); try { + if (!$this->getRequest()->isPost()) { + throw new LocalizedException(__('Wrong request.')); + } $designConfigData = $this->configFactory->create($scope, $scopeId, $data); $this->designConfigRepository->save($designConfigData); - $this->messageManager->addSuccess(__('You saved the configuration.')); + $this->messageManager->addSuccessMessage(__('You saved the configuration.')); $this->dataPersistor->clear('theme_design_config'); @@ -83,10 +87,10 @@ public function execute() } catch (LocalizedException $e) { $messages = explode("\n", $e->getMessage()); foreach ($messages as $message) { - $this->messageManager->addError(__('%1', $message)); + $this->messageManager->addErrorMessage(__('%1', $message)); } } catch (\Exception $e) { - $this->messageManager->addException( + $this->messageManager->addExceptionMessage( $e, __('Something went wrong while saving this configuration:') . ' ' . $e->getMessage() ); @@ -110,7 +114,7 @@ protected function getRequestData() $this->getRequest()->getFiles()->toArray() ); $data = array_filter($data, function ($param) { - return isset($param['error']) && $param['error'] > 0 ? false : true; + return !(isset($param['error']) && $param['error'] > 0); }); return $data; } 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 137114ad4bc35..8d73f9f077e19 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php @@ -111,6 +111,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/Controller/Adminhtml/Design/Config/SaveTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/Design/Config/SaveTest.php index d3c4465d7f415..bdaca2bdf4783 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/Design/Config/SaveTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/Design/Config/SaveTest.php @@ -71,15 +71,13 @@ public function setUp() '', false ); - $this->request = $this->getMockForAbstractClass( - 'Magento\Framework\App\RequestInterface', - [], - '', - false, - false, - true, - ['getFiles', 'getParam', 'getParams'] - ); + $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + ->disableOriginalConstructor()->getMock(); + + $this->request->expects($this->atLeastOnce()) + ->method('isPost') + ->willReturn(true); + $this->context = $objectManager->getObject( 'Magento\Backend\App\Action\Context', [ @@ -147,7 +145,7 @@ public function testSave() ->method('save') ->with($this->designConfig); $this->messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with(__('You saved the configuration.')); $this->dataPersistor->expects($this->once()) ->method('clear') @@ -203,7 +201,7 @@ public function testSaveWithLocalizedException() ->with($this->designConfig) ->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('Exception message'))); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with(__('Exception message')->render()); $this->dataPersistor->expects($this->once()) @@ -258,7 +256,7 @@ public function testSaveWithException() ->with($this->designConfig) ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addException') + ->method('addExceptionMessage') ->with($exception, 'Something went wrong while saving this configuration: Exception message'); $this->dataPersistor->expects($this->once()) 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 978a813f58290..c0137159cc0f7 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 eb924df52428b..5cc7264f7aa29 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/Url/Plugin/SignatureTest.php b/app/code/Magento/Theme/Test/Unit/Model/Url/Plugin/SignatureTest.php index 1ff6e98ebe3ae..c2f5c6d6e6f52 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Url/Plugin/SignatureTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Url/Plugin/SignatureTest.php @@ -63,6 +63,9 @@ public function testAroundGetBaseUrlInactive($fixtureConfigFlag, $inputUrlType) $this->assertEquals('http://127.0.0.1/magento/pub/static/', $actualResult); } + /** + * @return array + */ public function aroundGetBaseUrlInactiveDataProvider() { 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 c68e99a35fa69..24e3f2099dfbf 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -4,11 +4,12 @@ * See COPYING.txt for license details. */ -/** - * Storage model test - */ namespace Magento\Theme\Test\Unit\Model\Wysiwyg; +/** + * Class StorageTest + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class StorageTest extends \PHPUnit_Framework_TestCase { /** @@ -179,6 +180,9 @@ public function testUploadInvalidFile() $this->_storageModel->uploadFile($this->_storageRoot); } + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ protected function _prepareUploader() { $uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class) @@ -550,6 +554,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 e6a55956adc84..b4c6bbf490bf7 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 @@ -88,6 +88,9 @@ public function testPrepareDataSource($dataSourceItem, $scope, $scopeId) $this->assertEquals($expectedDataSource, $dataSource); } + /** + * @return array + */ public function getPrepareDataSourceDataProvider() { return [ diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index a3cfa4cbe9b4a..72804eb521879 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -21,7 +21,7 @@ "magento/module-theme-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.10", + "version": "100.1.11", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 936a6e9dfef88..9fe0b662ec8bc 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -13,7 +13,7 @@ "magento/module-deploy": "100.1.*" }, "type": "magento2-module", - "version": "100.1.5", + "version": "100.1.6", "license": [ "OSL-3.0", "AFL-3.0" 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 ed6eda85dcd35..33e0488f306b4 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 @@ -54,6 +54,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/WysiwygTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/WysiwygTest.php index d0e0542a19480..7413f7904dcaa 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, [ diff --git a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php index f16ef497d707e..a5815b977ddce 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php @@ -92,6 +92,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/Model/ManagerTest.php b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php index 2528d69584cf7..a0d234ec6d978 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php @@ -169,6 +169,9 @@ public function testPrepareGetData($componentName, $componentData, $isCached, $r ); } + /** + * @return array + */ public function getComponentData() { $cachedData = new \ArrayObject( @@ -269,6 +272,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/composer.json b/app/code/Magento/Ui/composer.json index c9bc0aa0d64ee..4f1bbd806a973 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -10,7 +10,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.11", + "version": "100.1.12", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal.js b/app/code/Magento/Ui/view/base/web/js/modal/modal.js index cb8831d6c7ad1..b2ce644afce45 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal.js @@ -196,7 +196,7 @@ define([ */ setSubTitle: function (subTitle) { this.options.subTitle = subTitle; - this.modal.find(this.options.modalSubTitle).html(subTitle); + this.modal.find(this.options.modalSubTitle).text(subTitle); }, /** diff --git a/app/code/Magento/UrlRewrite/Service/V1/Data/UrlRewrite.php b/app/code/Magento/UrlRewrite/Service/V1/Data/UrlRewrite.php index 2d3807a635c6e..716d87afbf0c7 100644 --- a/app/code/Magento/UrlRewrite/Service/V1/Data/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/Service/V1/Data/UrlRewrite.php @@ -58,7 +58,7 @@ public function getUrlRewriteId() /** * @param int $urlRewriteId - * @return int + * @return $this */ public function setUrlRewriteId($urlRewriteId) { diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php index 0207bb0340868..702fd9fbb04f3 100644 --- a/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php +++ b/app/code/Magento/UrlRewrite/Test/Unit/Helper/UrlRewriteTest.php @@ -16,7 +16,9 @@ class UrlRewriteTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_helper = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject('Magento\UrlRewrite\Helper\UrlRewrite'); + $this->_helper = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject( + 'Magento\UrlRewrite\Helper\UrlRewrite' + ); } /** @@ -53,6 +55,9 @@ public function testValidateSuffixException($suffix) $this->_helper->validateSuffix($suffix); } + /** + * @return array + */ public function requestPathDataProvider() { return [ @@ -61,6 +66,9 @@ public function requestPathDataProvider() ]; } + /** + * @return array + */ public function requestPathExceptionDataProvider() { return [ diff --git a/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php b/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php index bc99f4af6ad78..402e5c9dc2d52 100644 --- a/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php +++ b/app/code/Magento/Variable/Test/Unit/Model/VariableTest.php @@ -99,6 +99,9 @@ public function testValidate($variableArray, $objectId, $expectedResult) $this->assertEquals($expectedResult, $this->model->validate($variableArray)); } + /** + * @return array + */ public function validateDataProvider() { $variable = [ @@ -111,6 +114,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 4cbf96bca03b1..db81587b08a79 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 testPositiveCaseDataProvider() { return [ diff --git a/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php b/app/code/Magento/Webapi/Test/Unit/Controller/PathProcessorTest.php index ac9a761f41e7d..5762d09b962a0 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/Model/Authorization/TokenUserContextTest.php b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php index 7b88365544a5c..1426e3da04198 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php +++ b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/TokenUserContextTest.php @@ -231,6 +231,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/Files/TestDataObject.php b/app/code/Magento/Webapi/Test/Unit/Model/Files/TestDataObject.php index 4d087cb741fe0..09100dc6fa7aa 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Files/TestDataObject.php +++ b/app/code/Magento/Webapi/Test/Unit/Model/Files/TestDataObject.php @@ -8,21 +8,33 @@ class TestDataObject implements TestDataInterface { + /** + * @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'; 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 0c316c249f63d..d857ec8cd2c13 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 @@ -275,6 +275,9 @@ public function testGetObjectSchema($typeName, $description, $result) $this->assertSame(json_encode($result), json_encode($actual)); } + /** + * @return array + */ public function testGetObjectSchemaDataProvider() { return [ @@ -334,6 +337,9 @@ public function testGenerateDefinition($typeData, $expected) $this->assertSame(json_encode($expected), json_encode($actual)); } + /** + * @return array + */ public function testGenerateDefinitionDataProvider() { return [ 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 373dc7fba5528..6bf49bac5a2e7 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 testDisplayPriceWithWeeeDetailsDataProvider() { $data = [ @@ -472,6 +475,9 @@ public function testGetBaseRowDisplayPriceInclTax( $this->assertEquals($expectedValue, $this->renderer->getBaseRowDisplayPriceInclTax()); } + /** + * @return array + */ public function testGetDisplayPriceDataProvider() { $data = [ @@ -739,6 +745,9 @@ public function testGetBaseFinalRowDisplayPriceInclTax( $this->assertEquals($expectedValue, $this->renderer->getBaseFinalRowDisplayPriceInclTax()); } + /** + * @return array + */ public function testGetFinalDisplayPriceDataProvider() { $data = [ 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 b869ca2e955df..65badb9ef5c57 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 @@ -86,6 +86,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/Pricing/AdjustmentTest.php b/app/code/Magento/Weee/Test/Unit/Pricing/AdjustmentTest.php index 12dad451604e9..832a0334addfa 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/composer.json b/app/code/Magento/Widget/composer.json index 54bcddc835670..173e991f700b0 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -16,7 +16,7 @@ "magento/module-widget-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.7", + "version": "100.1.8", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/Model/Wishlist.php b/app/code/Magento/Wishlist/Model/Wishlist.php index 525789e9b3c6d..b747c4fe6ac48 100644 --- a/app/code/Magento/Wishlist/Model/Wishlist.php +++ b/app/code/Magento/Wishlist/Model/Wishlist.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Wishlist\Model; use Magento\Catalog\Api\ProductRepositoryInterface; @@ -611,6 +612,7 @@ public function updateItem($itemId, $buyRequest, $params = null) $item = null; if ($itemId instanceof Item) { $item = $itemId; + $itemId = $item->getId(); } else { $item = $this->getItem((int)$itemId); } 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 fadbcf512bda6..5b4f6cbb360c3 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/AllcartTest.php @@ -133,6 +133,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 095350cbaacb0..6bef67bb5f1ba 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/IndexTest.php @@ -120,6 +120,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 7a6ad6305d8a8..c032ae2c9add5 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 d2574664e3d55..35f0eb6d173af 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 893c5c17989fd..9a2795616e7a7 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Model/ItemTest.php @@ -171,6 +171,9 @@ public function testRemoveOptionByCode($code, $option) $this->assertTrue($actualOption->isDeleted()); } + /** + * @return array + */ public function getOptionsDataProvider() { $optionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/LocaleQuantityProcessorTest.php index 99e45e47f0421..810863dd42a5a 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/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 57dac63f88f9e..f4815e60698fe 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.8", + "version": "100.1.9", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less index 7acb082bdff65..84f116c2c9547 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_listings.less @@ -425,7 +425,7 @@ .product-item { margin-left: calc(~'(100% - 4 * 24.439%) / 3'); - padding: 0; + padding: 5px; width: 24.439%; &:nth-child(4n + 1) { diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 689a3b69ec652..469095f9f704a 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.8", + "version": "100.1.9", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/composer.json b/composer.json index d3d1fb2b2c716..eac41d0eca83f 100644 --- a/composer.json +++ b/composer.json @@ -81,41 +81,41 @@ "magento/module-advanced-pricing-import-export": "100.1.4", "magento/module-authorization": "100.1.3", "magento/module-authorizenet": "100.1.7", - "magento/module-backend": "100.1.8", + "magento/module-backend": "100.1.9", "magento/module-backup": "100.1.6", "magento/module-braintree": "100.1.9", "magento/module-bundle": "100.1.7", "magento/module-bundle-import-export": "100.1.5", "magento/module-cache-invalidate": "100.1.4", "magento/module-captcha": "100.1.4", - "magento/module-catalog": "101.0.13", - "magento/module-catalog-import-export": "100.1.9", + "magento/module-catalog": "101.0.14", + "magento/module-catalog-import-export": "100.1.10", "magento/module-catalog-inventory": "100.1.8", - "magento/module-catalog-rule": "100.1.6", + "magento/module-catalog-rule": "100.1.7", "magento/module-catalog-rule-configurable": "100.1.4", "magento/module-catalog-search": "100.1.9", "magento/module-catalog-url-rewrite": "100.1.6", "magento/module-catalog-widget": "100.1.5", "magento/module-checkout": "100.1.12", "magento/module-checkout-agreements": "100.1.4", - "magento/module-cms": "101.0.11", + "magento/module-cms": "101.0.12", "magento/module-cms-url-rewrite": "100.1.4", "magento/module-config": "100.1.8", "magento/module-configurable-import-export": "100.1.4", - "magento/module-configurable-product": "100.1.13", + "magento/module-configurable-product": "100.1.14", "magento/module-contact": "100.1.4", "magento/module-cookie": "100.1.4", - "magento/module-cron": "100.1.5", - "magento/module-currency-symbol": "100.1.4", - "magento/module-customer": "100.1.12", + "magento/module-cron": "100.1.6", + "magento/module-currency-symbol": "100.1.5", + "magento/module-customer": "100.1.13", "magento/module-customer-import-export": "100.1.6", "magento/module-deploy": "100.1.7", "magento/module-developer": "100.1.4", "magento/module-dhl": "100.1.4", - "magento/module-directory": "100.1.6", + "magento/module-directory": "100.1.7", "magento/module-downloadable": "100.1.6", "magento/module-downloadable-import-export": "100.1.3", - "magento/module-eav": "100.1.10", + "magento/module-eav": "100.1.11", "magento/module-email": "100.1.7", "magento/module-encryption-key": "100.1.3", "magento/module-fedex": "100.1.5", @@ -129,7 +129,7 @@ "magento/module-indexer": "100.1.6", "magento/module-integration": "100.1.7", "magento/module-layered-navigation": "100.1.3", - "magento/module-media-storage": "100.1.4", + "magento/module-media-storage": "100.1.5", "magento/module-msrp": "100.1.4", "magento/module-multishipping": "100.1.4", "magento/module-new-relic-reporting": "100.1.4", @@ -138,15 +138,15 @@ "magento/module-offline-shipping": "100.1.5", "magento/module-page-cache": "100.1.6", "magento/module-payment": "100.1.9", - "magento/module-paypal": "100.1.9", + "magento/module-paypal": "100.1.10", "magento/module-persistent": "100.1.5", "magento/module-product-alert": "100.1.4", "magento/module-product-video": "100.1.9", "magento/module-quote": "100.1.8", "magento/module-reports": "100.1.8", "magento/module-require-js": "100.1.4", - "magento/module-review": "100.1.7", - "magento/module-robots": "100.1.1", + "magento/module-review": "100.1.8", + "magento/module-robots": "100.1.2", "magento/module-rss": "100.1.4", "magento/module-rule": "100.1.8", "magento/module-sales": "100.1.11", @@ -159,15 +159,15 @@ "magento/module-send-friend": "100.1.3", "magento/module-shipping": "100.1.7", "magento/module-sitemap": "100.1.6", - "magento/module-store": "100.1.10", - "magento/module-swagger": "100.1.3", - "magento/module-swatches": "100.1.11", + "magento/module-store": "100.1.11", + "magento/module-swagger": "100.1.4", + "magento/module-swatches": "100.1.12", "magento/module-swatches-layered-navigation": "100.1.3", "magento/module-tax": "100.1.5", "magento/module-tax-import-export": "100.1.3", - "magento/module-theme": "100.1.10", - "magento/module-translation": "100.1.5", - "magento/module-ui": "100.1.11", + "magento/module-theme": "100.1.11", + "magento/module-translation": "100.1.6", + "magento/module-ui": "100.1.12", "magento/module-ups": "100.1.5", "magento/module-url-rewrite": "100.1.5", "magento/module-user": "100.1.5", @@ -178,11 +178,11 @@ "magento/module-webapi": "100.1.6", "magento/module-webapi-security": "100.1.3", "magento/module-weee": "100.1.3", - "magento/module-widget": "100.1.7", + "magento/module-widget": "100.1.8", "magento/module-wishlist": "100.1.8", "magento/theme-adminhtml-backend": "100.1.4", - "magento/theme-frontend-blank": "100.1.8", - "magento/theme-frontend-luma": "100.1.8", + "magento/theme-frontend-blank": "100.1.9", + "magento/theme-frontend-luma": "100.1.9", "magento/language-de_de": "100.1.2", "magento/language-en_us": "100.1.2", "magento/language-es_es": "100.1.2", @@ -190,7 +190,7 @@ "magento/language-nl_nl": "100.1.2", "magento/language-pt_br": "100.1.2", "magento/language-zh_hans_cn": "100.1.2", - "magento/framework": "100.1.13", + "magento/framework": "100.1.14", "trentrichardson/jquery-timepicker-addon": "1.4.3", "components/jquery": "1.11.0", "blueimp/jquery-file-upload": "5.6.14", diff --git a/composer.lock b/composer.lock index 9c849f5e9f280..4c011b3e28be5 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "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": "8251f2744a4ccef37e10596b1fb66393", + "hash": "21b6ccece5ca8f21a1c3cccdb6a81d63", + "content-hash": "4b18aa14166fcef73950f26d7466d82a", "packages": [ { "name": "braintree/braintree_php", @@ -51,7 +52,7 @@ } ], "description": "Braintree PHP Client Library", - "time": "2015-11-19T19:14:47+00:00" + "time": "2015-11-19 19:14:47" }, { "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": "2016-10-03T16:55:11+00:00" + "time": "2016-10-03 16:55:11" }, { "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/composer", @@ -275,7 +276,7 @@ "dependency", "package" ], - "time": "2016-03-03T15:15:10+00:00" + "time": "2016-03-03 15:15:10" }, { "name": "composer/semver", @@ -337,20 +338,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": { @@ -398,7 +399,7 @@ "spdx", "validator" ], - "time": "2018-01-31T13:17:27+00:00" + "time": "2018-04-30 10:33:04" }, { "name": "justinrainbow/json-schema", @@ -464,7 +465,7 @@ "json", "schema" ], - "time": "2016-01-25T15:43:01+00:00" + "time": "2016-01-25 15:43:01" }, { "name": "league/climate", @@ -513,7 +514,7 @@ "php", "terminal" ], - "time": "2015-01-18T14:31:58+00:00" + "time": "2015-01-18 14:31:58" }, { "name": "magento/composer", @@ -549,7 +550,7 @@ "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2016-03-08T20:50:51+00:00" + "time": "2016-03-08 20:50:51" }, { "name": "magento/magento-composer-installer", @@ -628,7 +629,7 @@ "composer-installer", "magento" ], - "time": "2017-12-29T16:45:24+00:00" + "time": "2017-12-29 16:45:24" }, { "name": "magento/zendframework1", @@ -675,7 +676,7 @@ "ZF1", "framework" ], - "time": "2017-02-27T21:19:07+00:00" + "time": "2017-02-27 21:19:07" }, { "name": "monolog/monolog", @@ -751,7 +752,7 @@ "logging", "psr-3" ], - "time": "2015-08-09T17:44:44+00:00" + "time": "2015-08-09 17:44:44" }, { "name": "oyejorge/less.php", @@ -813,7 +814,7 @@ "php", "stylesheet" ], - "time": "2017-03-28T22:19:25+00:00" + "time": "2017-03-28 22:19:25" }, { "name": "pelago/emogrifier", @@ -869,7 +870,7 @@ ], "description": "Converts CSS styles into inline style attributes in your HTML code", "homepage": "http://www.pelagodesign.com/sidecar/emogrifier/", - "time": "2015-05-15T11:37:51+00:00" + "time": "2015-05-15 11:37:51" }, { "name": "phpseclib/phpseclib", @@ -961,7 +962,7 @@ "x.509", "x509" ], - "time": "2018-04-15T16:55:05+00:00" + "time": "2018-04-15 16:55:05" }, { "name": "psr/log", @@ -1008,7 +1009,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "seld/cli-prompt", @@ -1056,7 +1057,7 @@ "input", "prompt" ], - "time": "2017-03-18T11:32:45+00:00" + "time": "2017-03-18 11:32:45" }, { "name": "seld/jsonlint", @@ -1105,7 +1106,7 @@ "parser", "validator" ], - "time": "2018-01-24T12:46:19+00:00" + "time": "2018-01-24 12:46:19" }, { "name": "seld/phar-utils", @@ -1149,7 +1150,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2015-10-13 18:44:15" }, { "name": "sjparkinson/static-review", @@ -1203,7 +1204,7 @@ ], "description": "An extendable framework for version control hooks.", "abandoned": "phpro/grumphp", - "time": "2014-09-22T08:40:36+00:00" + "time": "2014-09-22 08:40:36" }, { "name": "symfony/console", @@ -1261,11 +1262,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-07-26T09:08:40+00:00" + "time": "2015-07-26 09:08:40" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1321,24 +1322,25 @@ ], "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.11", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541" + "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/253a4490b528597aa14d2bf5aeded6f5e5e4a541", - "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", + "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { @@ -1370,20 +1372,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-02-22T10:48:49+00:00" + "time": "2018-05-16 08:49:21" }, { "name": "symfony/finder", - "version": "v3.4.8", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433" + "reference": "472a92f3df8b247b49ae364275fb32943b9656c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/bd14efe8b1fabc4de82bf50dce62f05f9a102433", - "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433", + "url": "https://api.github.com/repos/symfony/finder/zipball/472a92f3df8b247b49ae364275fb32943b9656c6", + "reference": "472a92f3df8b247b49ae364275fb32943b9656c6", "shasum": "" }, "require": { @@ -1419,20 +1421,75 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-04-04T05:07:11+00:00" + "time": "2018-05-16 08:49:21" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30 19:57:29" }, { "name": "symfony/process", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ee2c91470ff262b1a00aec27875d38594aa87629" + "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ee2c91470ff262b1a00aec27875d38594aa87629", - "reference": "ee2c91470ff262b1a00aec27875d38594aa87629", + "url": "https://api.github.com/repos/symfony/process/zipball/713952f2ccbcc8342ecdbe1cb313d3e2da8aad28", + "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28", "shasum": "" }, "require": { @@ -1468,7 +1525,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-04-03T05:20:27+00:00" + "time": "2018-05-15 21:17:45" }, { "name": "tedivm/jshrink", @@ -1514,7 +1571,7 @@ "javascript", "minifier" ], - "time": "2014-11-11T03:54:14+00:00" + "time": "2014-11-11 03:54:14" }, { "name": "tubalmartin/cssmin", @@ -1562,7 +1619,7 @@ "minify", "yui" ], - "time": "2017-04-04T14:33:00+00:00" + "time": "2017-04-04 14:33:00" }, { "name": "zendframework/zend-code", @@ -1615,7 +1672,7 @@ "code", "zf2" ], - "time": "2015-05-11T16:17:05+00:00" + "time": "2015-05-11 16:17:05" }, { "name": "zendframework/zend-config", @@ -1672,7 +1729,7 @@ "config", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-console", @@ -1722,7 +1779,7 @@ "console", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-crypt", @@ -1774,7 +1831,7 @@ "crypt", "zf2" ], - "time": "2015-11-23T16:33:27+00:00" + "time": "2015-11-23 16:33:27" }, { "name": "zendframework/zend-di", @@ -1825,7 +1882,7 @@ "di", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-escaper", @@ -1870,7 +1927,7 @@ "escaper", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-eventmanager", @@ -1916,7 +1973,7 @@ "eventmanager", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-filter", @@ -1972,7 +2029,7 @@ "filter", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-form", @@ -2043,7 +2100,7 @@ "form", "zf2" ], - "time": "2015-09-09T19:11:05+00:00" + "time": "2015-09-09 19:11:05" }, { "name": "zendframework/zend-http", @@ -2094,7 +2151,7 @@ "http", "zf2" ], - "time": "2015-09-14T16:11:20+00:00" + "time": "2015-09-14 16:11:20" }, { "name": "zendframework/zend-i18n", @@ -2158,7 +2215,7 @@ "i18n", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-inputfilter", @@ -2209,7 +2266,7 @@ "inputfilter", "zf2" ], - "time": "2015-09-09T15:44:54+00:00" + "time": "2015-09-09 15:44:54" }, { "name": "zendframework/zend-json", @@ -2263,7 +2320,7 @@ "json", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-loader", @@ -2308,7 +2365,7 @@ "loader", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-log", @@ -2370,7 +2427,7 @@ "logging", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-math", @@ -2421,7 +2478,7 @@ "math", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-modulemanager", @@ -2479,7 +2536,7 @@ "modulemanager", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-mvc", @@ -2567,7 +2624,7 @@ "mvc", "zf2" ], - "time": "2015-09-14T16:32:50+00:00" + "time": "2015-09-14 16:32:50" }, { "name": "zendframework/zend-serializer", @@ -2620,7 +2677,7 @@ "serializer", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-server", @@ -2667,7 +2724,7 @@ "server", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-servicemanager", @@ -2717,7 +2774,7 @@ "servicemanager", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-soap", @@ -2769,7 +2826,7 @@ "soap", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-stdlib", @@ -2824,7 +2881,7 @@ "stdlib", "zf2" ], - "time": "2015-07-21T13:55:46+00:00" + "time": "2015-07-21 13:55:46" }, { "name": "zendframework/zend-text", @@ -2871,7 +2928,7 @@ "text", "zf2" ], - "time": "2015-05-07T14:55:31+00:00" + "time": "2015-05-07 14:55:31" }, { "name": "zendframework/zend-uri", @@ -2919,7 +2976,7 @@ "uri", "zf2" ], - "time": "2015-09-14T16:17:10+00:00" + "time": "2015-09-14 16:17:10" }, { "name": "zendframework/zend-validator", @@ -2984,7 +3041,7 @@ "validator", "zf2" ], - "time": "2015-09-08T21:04:17+00:00" + "time": "2015-09-08 21:04:17" }, { "name": "zendframework/zend-view", @@ -3061,7 +3118,7 @@ "view", "zf2" ], - "time": "2015-06-16T15:22:37+00:00" + "time": "2015-06-16 15:22:37" } ], "packages-dev": [ @@ -3117,7 +3174,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "fabpot/php-cs-fixer", @@ -3176,7 +3233,7 @@ ], "description": "A tool to automatically fix PHP code style", "abandoned": "friendsofphp/php-cs-fixer", - "time": "2017-09-11T14:11:16+00:00" + "time": "2017-09-11 14:11:16" }, { "name": "lusitanian/oauth", @@ -3243,7 +3300,7 @@ "oauth", "security" ], - "time": "2015-10-07T00:20:04+00:00" + "time": "2015-10-07 00:20:04" }, { "name": "pdepend/pdepend", @@ -3283,7 +3340,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2017-01-10T13:45:16+00:00" + "time": "2017-01-10 13:45:16" }, { "name": "phpmd/phpmd", @@ -3348,7 +3405,7 @@ "phpmd", "pmd" ], - "time": "2016-11-23T20:33:32+00:00" + "time": "2016-11-23 20:33:32" }, { "name": "phpunit/php-code-coverage", @@ -3410,7 +3467,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -3455,7 +3512,7 @@ "filesystem", "iterator" ], - "time": "2013-10-10T15:34:57+00:00" + "time": "2013-10-10 15:34:57" }, { "name": "phpunit/php-text-template", @@ -3496,7 +3553,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -3545,7 +3602,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -3594,7 +3651,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2017-12-04 08:55:13" }, { "name": "phpunit/phpunit", @@ -3668,7 +3725,7 @@ "testing", "xunit" ], - "time": "2014-05-02T07:13:40+00:00" + "time": "2014-05-02 07:13:40" }, { "name": "phpunit/phpunit-mock-objects", @@ -3724,7 +3781,7 @@ "mock", "xunit" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", @@ -3788,7 +3845,7 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -3840,7 +3897,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -3890,7 +3947,7 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", @@ -3957,7 +4014,7 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/finder-facade", @@ -3996,7 +4053,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/phpcpd", @@ -4047,7 +4104,7 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2013-11-08T09:05:42+00:00" + "time": "2013-11-08 09:05:42" }, { "name": "sebastian/recursion-context", @@ -4100,7 +4157,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-10-03 07:41:43" }, { "name": "sebastian/version", @@ -4135,7 +4192,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2015-06-21 13:59:46" }, { "name": "squizlabs/php_codesniffer", @@ -4210,7 +4267,7 @@ "phpcs", "standards" ], - "time": "2014-05-01T03:07:07+00:00" + "time": "2014-05-01 03:07:07" }, { "name": "symfony/config", @@ -4266,7 +4323,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-04-12 14:13:17" }, { "name": "symfony/dependency-injection", @@ -4326,11 +4383,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-01-28T00:04:57+00:00" + "time": "2017-01-28 00:04:57" }, { "name": "symfony/stopwatch", - "version": "v3.4.8", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -4375,24 +4432,25 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-02-17T14:55:25+00:00" + "time": "2018-02-17 14:55:25" }, { "name": "symfony/yaml", - "version": "v2.8.39", + "version": "v2.8.42", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e" + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d20bd2bdee063863e426297af41eda45ccad6f7e", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { @@ -4424,7 +4482,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-04-08T07:53:13+00:00" + "time": "2018-05-01 22:52:40" }, { "name": "theseer/fdomdocument", @@ -4464,7 +4522,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" } ], "aliases": [], diff --git a/dev/tests/functional/utils/command.php b/dev/tests/functional/utils/command.php index 895b117df5095..8eaf82475a4e4 100644 --- a/dev/tests/functional/utils/command.php +++ b/dev/tests/functional/utils/command.php @@ -4,41 +4,20 @@ * See COPYING.txt for license details. */ -$commandList = [ - 'cache:flush', - 'cache:disable', - 'cache:enable', - 'setup:static-content:deploy', - 'cron:run', -]; +require_once __DIR__ . '/../../../../app/bootstrap.php'; + +use Symfony\Component\Console\Input\StringInput; +use Symfony\Component\Console\Output\NullOutput; if (isset($_GET['command'])) { - $php = PHP_BINARY ?: (PHP_BINDIR ? PHP_BINDIR . '/php' : 'php'); $command = urldecode($_GET['command']); - if (!strpos($command, '&&') && !strpos($command, ';')) { - if (in_array(explode(' ', $command)[0], $commandList)) { - exec(escapeCommand($php . ' -f ../../../../bin/magento ' . $command)); - } - } + $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); + $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); + $cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class); + $input = new StringInput($command); + $input->setInteractive(false); + $output = new NullOutput(); + $cli->doRun($input, $output); } else { throw new \InvalidArgumentException("Command GET parameter is not set."); } - -/** - * Returns escaped command. - * - * @param string $command - * @return string - */ -function escapeCommand($command) -{ - $escapeExceptions = [ - '> /dev/null &' => '--dev-null-amp--' - ]; - - $command = escapeshellcmd( - str_replace(array_keys($escapeExceptions), array_values($escapeExceptions), $command) - ); - - return str_replace(array_values($escapeExceptions), array_keys($escapeExceptions), $command); -} 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..ef28eef8531ef --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php @@ -0,0 +1,58 @@ +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..db4758e2a9c72 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php @@ -0,0 +1,51 @@ +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..799bcb8099e2c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php @@ -0,0 +1,58 @@ +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..ff2483e1ceaf7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend.php @@ -0,0 +1,16 @@ +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..9c05a4c4c04a5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_backend_rollback.php @@ -0,0 +1,16 @@ +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..8a72a4d6c4afc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend.php @@ -0,0 +1,16 @@ +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..523aeeed27eda --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/_files/failed_logins_frontend_rollback.php @@ -0,0 +1,16 @@ +get(LogFactory::class); + +/** @var Log $captchaLog */ +$captchaLog = $logFactory->create(); +$captchaLog->deleteUserAttempts('mageuser@dummy.com'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php new file mode 100644 index 0000000000000..5b65a2286d654 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php @@ -0,0 +1,145 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Framework\Filesystem $filesystem */ + $this->filesystem = $this->objectManager->get(\Magento\Framework\Filesystem::class); + $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); + /** @var $uploader \Magento\MediaStorage\Model\File\Uploader */ + $this->imageUploader = $this->objectManager->create( + \Magento\Catalog\Model\ImageUploader::class, + [ + 'baseTmpPath' => $this->mediaDirectory->getRelativePath('tmp'), + 'basePath' => __DIR__, + 'allowedExtensions' => ['jpg', 'jpeg', 'gif', 'png'], + ] + ); + } + + /** + * @return void + */ + public function testSaveFileToTmpDir() + { + $fileName = 'magento_small_image.jpg'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $fixtureDir = realpath(__DIR__ . '/../_files'); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image/jpeg', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->imageUploader->saveFileToTmpDir('image'); + $filePath = $this->imageUploader->getBaseTmpPath() . DIRECTORY_SEPARATOR. $fileName; + $this->assertTrue(is_file($this->mediaDirectory->getAbsolutePath($filePath))); + } + + /** + * @return void + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage File validation failed. + */ + public function testSaveFileToTmpDirWithWrongExtension() + { + $fileName = 'text.txt'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + $file = fopen($filePath, "wb"); + fwrite($file, 'just a text'); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'text/plain', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->imageUploader->saveFileToTmpDir('image'); + $filePath = $this->imageUploader->getBaseTmpPath() . DIRECTORY_SEPARATOR. $fileName; + $this->assertFalse(is_file($this->mediaDirectory->getAbsolutePath($filePath))); + } + + /** + * @return void + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage File validation failed. + */ + public function testSaveFileToTmpDirWithWrongFile() + { + $fileName = 'file.gif'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + $file = fopen($filePath, "wb"); + fwrite($file, 'just a text'); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image/gif', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->imageUploader->saveFileToTmpDir('image'); + $filePath = $this->imageUploader->getBaseTmpPath() . DIRECTORY_SEPARATOR. $fileName; + $this->assertFalse(is_file($this->mediaDirectory->getAbsolutePath($filePath))); + } + + /** + * @inheritdoc + */ + public static function tearDownAfterClass() + { + parent::tearDownAfterClass(); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Framework\Filesystem::class + ); + /** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */ + $mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $mediaDirectory->delete('tmp'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php new file mode 100644 index 0000000000000..a550095c57bfb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php @@ -0,0 +1,82 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->uploader = $this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Uploader::class); + + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + + $appParams = \Magento\TestFramework\Helper\Bootstrap::getInstance() + ->getBootstrap() + ->getApplication() + ->getInitParams()[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS]; + $mediaPath = $appParams[DirectoryList::MEDIA][DirectoryList::PATH]; + $this->directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $tmpDir = $this->directory->getRelativePath($mediaPath . '/import'); + $this->uploader->setTmpDir($tmpDir); + + parent::setUp(); + } + + /** + * @return void + * @magentoAppIsolation enabled + */ + public function testMoveWithValidFile() + { + $fileName = 'magento_additional_image_one.jpg'; + $filePath = $this->directory->getAbsolutePath($this->uploader->getTmpDir() . '/' . $fileName); + copy(__DIR__ . '/_files/' . $fileName, $filePath); + $this->uploader->move($fileName); + + $this->assertTrue($this->directory->isExist($this->uploader->getTmpDir() . '/' . $fileName)); + } + + /** + * @return void + * @magentoAppIsolation enabled + * @expectedException \Exception + */ + public function testMoveWithInvalidFile() + { + $fileName = 'media_import_image.php'; + $filePath = $this->directory->getAbsolutePath($this->uploader->getTmpDir() . '/' . $fileName); + copy(__DIR__ . '/_files/' . $fileName, $filePath); + $this->uploader->move($fileName); + + $this->assertFalse($this->directory->isExist($this->uploader->getTmpDir() . '/' . $fileName)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index 44cd8a0f0dd40..6160ff4612e9f 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -19,10 +19,28 @@ class StorageTest extends \PHPUnit_Framework_TestCase */ protected static $_baseDir; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * @var \Magento\Framework\Filesystem + */ + private $filesystem; + + /** + * @var \Magento\Cms\Model\Wysiwyg\Images\Storage + */ + private $storage; + + /** + * @inheritdoc + */ public static function setUpBeforeClass() { self::$_baseDir = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Cms\Helper\Wysiwyg\Images' + \Magento\Cms\Helper\Wysiwyg\Images::class )->getCurrentPath() . 'MagentoCmsModelWysiwygImagesStorageTest'; if (!file_exists(self::$_baseDir)) { mkdir(self::$_baseDir); @@ -30,79 +48,129 @@ public static function setUpBeforeClass() touch(self::$_baseDir . '/1.swf'); } + /** + * @inheritdoc + */ public static function tearDownAfterClass() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\Filesystem\Driver\File' + \Magento\Framework\Filesystem\Driver\File::class )->deleteDirectory( self::$_baseDir ); } /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->filesystem = $this->objectManager->get(\Magento\Framework\Filesystem::class); + $this->storage = $this->objectManager->create(\Magento\Cms\Model\Wysiwyg\Images\Storage::class); + } + + /** + * @return void * @magentoAppIsolation enabled */ public function testGetFilesCollection() { \Magento\TestFramework\Helper\Bootstrap::getInstance() ->loadArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\Framework\View\DesignInterface') - ->setDesignTheme('Magento/backend'); - /** @var $model \Magento\Cms\Model\Wysiwyg\Images\Storage */ - $model = $objectManager->create('Magento\Cms\Model\Wysiwyg\Images\Storage'); - $collection = $model->getFilesCollection(self::$_baseDir, 'media'); - $this->assertInstanceOf('Magento\Cms\Model\Wysiwyg\Images\Storage\Collection', $collection); + $collection = $this->storage->getFilesCollection(self::$_baseDir, 'media'); + $this->assertInstanceOf(\Magento\Cms\Model\Wysiwyg\Images\Storage\Collection::class, $collection); foreach ($collection as $item) { - $this->assertInstanceOf('Magento\Framework\DataObject', $item); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $item); $this->assertStringEndsWith('/1.swf', $item->getUrl()); $this->assertStringMatchesFormat( 'http://%s/static/%s/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg', $item->getThumbUrl() ); + return; } } /** + * @return void * @magentoAppArea adminhtml */ public function testGetThumbsPath() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\Framework\Filesystem $filesystem */ - $filesystem = $objectManager->get('Magento\Framework\Filesystem'); - $session = $objectManager->get('Magento\Backend\Model\Session'); - $backendUrl = $objectManager->get('Magento\Backend\Model\UrlInterface'); - $imageFactory = $objectManager->get('Magento\Framework\Image\AdapterFactory'); - $assetRepo = $objectManager->get('Magento\Framework\View\Asset\Repository'); - $imageHelper = $objectManager->get('Magento\Cms\Helper\Wysiwyg\Images'); - $coreFileStorageDb = $objectManager->get('Magento\MediaStorage\Helper\File\Storage\Database'); - $storageCollectionFactory = $objectManager->get('Magento\Cms\Model\Wysiwyg\Images\Storage\CollectionFactory'); - $storageFileFactory = $objectManager->get('Magento\MediaStorage\Model\File\Storage\FileFactory'); - $storageDatabaseFactory = $objectManager->get('Magento\MediaStorage\Model\File\Storage\DatabaseFactory'); - $directoryDatabaseFactory = $objectManager->get( - 'Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory' - ); - $uploaderFactory = $objectManager->get('Magento\MediaStorage\Model\File\UploaderFactory'); - - $model = new \Magento\Cms\Model\Wysiwyg\Images\Storage( - $session, - $backendUrl, - $imageHelper, - $coreFileStorageDb, - $filesystem, - $imageFactory, - $assetRepo, - $storageCollectionFactory, - $storageFileFactory, - $storageDatabaseFactory, - $directoryDatabaseFactory, - $uploaderFactory - ); $this->assertStringStartsWith( - $filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath(), - $model->getThumbsPath() + $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath(), + $this->storage->getThumbsPath() ); } + + public function testUploadFile() + { + $fileName = 'magento_small_image.jpg'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + $fixtureDir = realpath(__DIR__ . '/../../../../Catalog/_files'); + copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image/jpeg', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->storage->uploadFile(self::$_baseDir); + $this->assertTrue(is_file(self::$_baseDir . DIRECTORY_SEPARATOR . $fileName)); + } + + /** + * @return void + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage File validation failed. + */ + public function testUploadFileWithWrongExtension() + { + $fileName = 'text.txt'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + $file = fopen($filePath, "wb"); + fwrite($file, 'just a text'); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'text/plain', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->storage->uploadFile(self::$_baseDir); + $this->assertFalse(is_file(self::$_baseDir . DIRECTORY_SEPARATOR . $fileName)); + } + + /** + * @return void + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage File validation failed. + */ + public function testUploadFileWithWrongFile() + { + $fileName = 'file.gif'; + $tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($fileName); + $file = fopen($filePath, "wb"); + fwrite($file, 'just a text'); + + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image/gif', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + + $this->storage->uploadFile(self::$_baseDir); + $this->assertFalse(is_file(self::$_baseDir . DIRECTORY_SEPARATOR . $fileName)); + } } diff --git a/lib/internal/Magento/Framework/Acl/AclResource/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Acl/AclResource/Config/SchemaLocator.php index e6b8023f04ccb..aee90e1e20889 100644 --- a/lib/internal/Magento/Framework/Acl/AclResource/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Acl/AclResource/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; diff --git a/lib/internal/Magento/Framework/Acl/Test/Unit/CacheTest.php b/lib/internal/Magento/Framework/Acl/Test/Unit/CacheTest.php index b611a5ae90e04..50fad06093c30 100644 --- a/lib/internal/Magento/Framework/Acl/Test/Unit/CacheTest.php +++ b/lib/internal/Magento/Framework/Acl/Test/Unit/CacheTest.php @@ -88,6 +88,9 @@ public function testHasWithAcl($dataAcl) $this->assertTrue($this->model->has()); } + /** + * @param $aclData + */ protected function initAcl($aclData) { $this->cacheConfig->expects($this->once()) 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 9c963577dba96..506fe84ee1ec7 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,12 @@ 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->getMock('Zend_Acl_Role_Interface'); diff --git a/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php index 6b346be8962b2..329f2fe31383e 100644 --- a/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Api/ExtensionAttribute/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; diff --git a/lib/internal/Magento/Framework/Api/SortOrder.php b/lib/internal/Magento/Framework/Api/SortOrder.php index 5e7b67565cfb8..6abde4c7d4f36 100644 --- a/lib/internal/Magento/Framework/Api/SortOrder.php +++ b/lib/internal/Magento/Framework/Api/SortOrder.php @@ -30,9 +30,11 @@ public function __construct(array $data = []) if (null !== $this->getDirection()) { $this->validateDirection($this->getDirection()); } + if ($this->getField() !== null) { + $this->validateField($this->getField()); + } } - /** * Get sorting field. * @@ -51,6 +53,8 @@ public function getField() */ public function setField($field) { + $this->validateField($field); + return $this->setData(SortOrder::FIELD, $field); } @@ -128,4 +132,23 @@ private function normalizeDirectionInput($direction) { return strtoupper($direction); } + + /** + * Check if given value can be used as sorting field. + * + * @param string $field + * @return void + * @throws InputException + */ + private function validateField($field) + { + if (preg_match('/[^a-z0-9\_]/i', $field)) { + throw new InputException( + new Phrase( + 'Sort order field %1 contains restricted symbols', + [$field] + ) + ); + } + } } 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 2554fda092c58..189ffc9b66938 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 22e2746df497c..576d764166771 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php @@ -366,6 +366,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 100ac8bb7b00a..acc24bc3e18a6 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 [ @@ -86,4 +92,27 @@ public function testItValidatesADirectionAssignedDuringInstantiation() SortOrder::DIRECTION => 'not-asc-or-desc' ]); } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Sort order field invalid field (value); contains restricted symbols + */ + public function testSetFieldValidateException() + { + $this->sortOrder = new SortOrder([ + SortOrder::FIELD => 'value', + ]); + $this->sortOrder->setField('invalid field (value);'); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Sort order field invalid field (value); contains restricted symbols + */ + public function testValidateField() + { + $this->sortOrder = new SortOrder([ + SortOrder::FIELD => 'invalid field (value);', + ]); + } } diff --git a/lib/internal/Magento/Framework/App/ResourceConnection/Config/SchemaLocator.php b/lib/internal/Magento/Framework/App/ResourceConnection/Config/SchemaLocator.php index b6d3d38d9893e..e92a073ff9f5a 100644 --- a/lib/internal/Magento/Framework/App/ResourceConnection/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/App/ResourceConnection/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; diff --git a/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php b/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php index fe1db9c30412c..09987ff1317c8 100644 --- a/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/App/Route/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; 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 11ec9e53bf809..ddffcea7f5a37 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 305311218cdae..474e009c30213 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php @@ -182,6 +182,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 71ec6b0f42a79..2d695295d336b 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 35ae5a4333f29..6c72dd989188a 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 8a0b040a9011a..777d2d9fc4f8e 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 b3bb28f2c0ecc..cfab1ed347708 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/CacheTest.php @@ -143,6 +143,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; @@ -186,6 +189,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/DataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php index c4f124627fc77..51ffd92f34d02 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/DataTest.php @@ -41,6 +41,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 2a2958734001c..fe2913a477b67 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/InitialTest.php @@ -62,6 +62,9 @@ public function testGetData($scope, $expectedResult) $this->assertEquals($expectedResult, $this->_model->getData($scope)); } + /** + * @return array + */ public function getDataDataProvider() { return [ diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php index 869950affd08d..c02dde3db5718 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php @@ -165,6 +165,9 @@ public function testGetScope($scopeType, $scope, array $data, $cachedData) ); } + /** + * @return array + */ public function getScopeDataProvider() { $baseScope = $this->getMockForAbstractClass('Magento\Framework\App\ScopeInterface'); 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 85187690d5431..9e8f50993da06 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 3353a4e2cc7b0..e5c7426e12513 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ConfigTest.php @@ -77,6 +77,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/ResponseTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php index eec51796542ed..9217bc7a09966 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/DeploymentConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfigTest.php index ef21f6aa7d716..448ab5d3b2f75 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 eac0b47c064cd..d5b29c14eecec 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 2e744bc8aec25..d810dbc002d47 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 [ @@ -59,6 +62,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 4f49299f2bac4..809506c2b6c9d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php @@ -111,6 +111,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 a8656c1adfd64..0f17b9f366f46 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php @@ -141,6 +141,9 @@ public function testProcessSaveCache($httpCode, $at) $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 4033318db7f14..637ae12e99c58 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 fda01bab489bf..184e9f9b383d1 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -267,6 +267,9 @@ public function testGetDistroBaseUrlPath($scriptName, $expected) $this->assertEquals($expected, Http::getDistroBaseUrlPath(['SCRIPT_NAME' => $scriptName])); } + /** + * @return array + */ public function getDistroBaseUrlPathDataProvider() { return [ @@ -282,6 +285,9 @@ public function getDistroBaseUrlPathDataProvider() } + /** + * @return array + */ public function serverVariablesProvider() { $returnValue = []; @@ -385,6 +391,9 @@ public function testIsSafeMethodFalse($httpMethod) $this->assertEquals(false, $this->_model->IsSafeMethod()); } + /** + * @return array + */ public function httpSafeMethodProvider() { return [ @@ -395,6 +404,9 @@ public function httpSafeMethodProvider() ]; } + /** + * @return array + */ public function httpNotSafeMethodProvider() { return [ @@ -407,6 +419,9 @@ public function httpNotSafeMethodProvider() ]; } + /** + * @return array + */ public function isSecureDataProvider() { /** @@ -449,6 +464,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 eec3091eb5922..373ed7ac99216 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php @@ -107,6 +107,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 34b949d6d848c..3e907c09534b6 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ScopeResolverPoolTest.php @@ -47,6 +47,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 f9429787359f3..d451563033edd 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/SetupInfoTest.php @@ -28,6 +28,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 8c2d4092a09d6..32714441a5778 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php @@ -68,6 +68,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/View/Deployment/VersionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/View/Deployment/VersionTest.php index 90e4edeedac77..ff6c5cae5350e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/View/Deployment/VersionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/View/Deployment/VersionTest.php @@ -61,6 +61,9 @@ public function testGetValueFromStorage($appMode) $this->object->getValue(); // Ensure caching in memory } + /** + * @return array + */ public function getValueFromStorageDataProvider() { return [ diff --git a/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php index 6956c523f0325..34d8800a541d6 100644 --- a/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Cache/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; 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 89125c9240e2a..8262b80e70f4e 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 @@ -126,12 +126,21 @@ 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 d2bcbcce4b0a9..802a96089b880 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', [$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 7762951c736c1..dcda3ad898813 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/MongoDbTest.php @@ -55,6 +55,9 @@ public function testGetIds(array $ids, array $expected) $this->assertEquals($expected, $actual); } + /** + * @return array + */ public function getIdsDataProvider() { return [ @@ -74,6 +77,9 @@ public function testGetTags(array $tags) $this->assertEquals($tags, $actual); } + /** + * @return array + */ public function getTagsDataProvider() { return ['no tags' => [[]], 'multiple tags' => [['tag1', 'tag2']]]; @@ -102,6 +108,9 @@ public function testGetIdsMatchingTags($method, $tags, $expectedInput) $this->assertEquals($expectedIds, $actualIds); } + /** + * @return array + */ public function getIdsMatchingTagsDataProvider() { return [ @@ -180,6 +189,9 @@ public function testGetMetadatas($cacheId, $expectedInput, $mongoOutput, $expect $this->assertEquals($expected, $actual); } + /** + * @return array + */ public function getMetadatasDataProvider() { $time = time(); @@ -247,6 +259,9 @@ public function testLoad($doNotTestValidity) $this->assertSame($expected, $actual); } + /** + * @return array + */ public function loadDataProvider() { return ['test validity' => [false], 'do not test validity' => [true]]; @@ -332,6 +347,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 cfdec46e2a44a..fde25e0d3cd2a 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php @@ -60,6 +60,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 ec3bb352a37ac..1eeafab8a3f2b 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 @@ -85,6 +85,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 dc402a6c3051e..504a19ad2d833 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 03bee5485e5f2..81a7a25b519a8 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,10 @@ 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 dd3355a82e777..317b850dc8f5d 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/InterfaceGeneratorTest.php @@ -113,6 +113,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 308b368adc2d1..24f8375f47028 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 f388d03b03cb6..be198356209c0 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php @@ -131,6 +131,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 cc6189919532d..896ab1a7163fa 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 4da61f2b24a5f..43a32b7cb0f81 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Reader/ArgumentsReaderTest.php @@ -277,6 +277,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 ab01ff5f7a49d..2ed13c5927a13 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 e46f03c3de970..c10447371a60c 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 @@ -38,6 +38,15 @@ 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 7d472e56ea297..3ceb7e4cad70e 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 @@ -55,6 +55,14 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface */ protected $_implOfBInterface; + /** + * Context constructor. + * @param ClassA $exA + * @param ClassB $exB + * @param ClassC $exC + * @param InterfaceA $interfaceA + * @param ImplementationOfInterfaceB $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..9e38bf2be7d49 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,10 @@ 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..7368ff1e7e767 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,11 @@ 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..9bb858cc16751 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,10 @@ 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..6fe98d08547b6 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,11 @@ 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..90086f1b1d50e 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,11 @@ 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..f4ba4ab8e6a3e 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,11 @@ 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 799862f8eddf7..bae3df40a7f7e 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/Config/Test/Unit/Converter/DomTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Converter/DomTest.php index c3c12f0cab51e..a3887c1df835d 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 256c2232a1dda..3c63342470db4 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ConfigDataTest.php @@ -46,6 +46,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 be678b5a6b77e..8866f5c9d7429 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Data/ScopedTest.php @@ -60,6 +60,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 86b63d0831cde..cb638ba9a9f2d 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 b81b96424bee2..51975fce743b9 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/GenericSchemaLocatorTest.php @@ -30,6 +30,13 @@ 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/Convert/Test/Unit/XmlTest.php b/lib/internal/Magento/Framework/Convert/Test/Unit/XmlTest.php index 66442cd88b485..22ccf436917b4 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 ad7883283b916..8a3e13aa71510 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/Test/Unit/Argument/Interpreter/ArrayTypeTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Argument/Interpreter/ArrayTypeTest.php index 02ce7494fba35..0f82b17b1ba5c 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 ce6f761ea0a58..ef72ff1b97608 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 @@ -59,6 +59,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 6e9fe804508dc..d2138c2a17248 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 6f14e7c838bdf..ad588c9f9b0fa 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php @@ -327,6 +327,9 @@ public function testPrintLogQueryPrinting($printQuery, $printFlag, $query, $expe $this->collection->printLogQuery($printQuery, false, $query); } + /** + * @return array + */ public function printLogQueryPrintingDataProvider() { return [ @@ -350,6 +353,9 @@ public function testPrintLogQueryLogging($logQuery, $logFlag, $expectedCalls) $this->collection->printLogQuery(false, $logQuery, 'some_query'); } + /** + * @return array + */ public function printLogQueryLoggingDataProvider() { return [ @@ -541,6 +547,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 c751e59f0ba8b..cab88f04749c3 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 @@ -92,6 +92,9 @@ public function testGetElementHtmlDateFormat($fieldName) $this->model->getElementHtml(); } + /** + * @return array + */ public function providerGetElementHtmlDateFormat() { return [ @@ -100,6 +103,10 @@ public function providerGetElementHtmlDateFormat() ]; } + /** + * @param $exactly + * @return mixed + */ 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 9fe0cf548a6e9..7f56e73a2f400 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 @@ -56,6 +56,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 b2e7e25043d82..6a3d55a6be705 100644 --- a/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php +++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/CryptTest.php @@ -30,6 +30,10 @@ protected function setUp() $this->_key = substr(__CLASS__, -32, 32); } + /** + * @param $length + * @return bool|string + */ protected function _getRandomString($length) { $result = ''; @@ -64,18 +68,31 @@ 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 +119,9 @@ public function testConstructor($cipher, $mode) $this->assertEquals($initVector, $crypt->getInitVector()); } + /** + * @return array + */ public function getConstructorExceptionData() { $result = []; @@ -137,6 +157,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 4fdbd558dafd3..892f8902fd432 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 f4403c5c97797..875d8aff40ef2 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/EntityManager/Test/Unit/CustomAttributesMapperTest.php b/lib/internal/Magento/Framework/EntityManager/Test/Unit/CustomAttributesMapperTest.php index a404811f9e4db..108af4de2f7c8 100644 --- a/lib/internal/Magento/Framework/EntityManager/Test/Unit/CustomAttributesMapperTest.php +++ b/lib/internal/Magento/Framework/EntityManager/Test/Unit/CustomAttributesMapperTest.php @@ -197,6 +197,9 @@ public function testDatabaseToEntity() $this->assertEquals($expected, $actual); } + /** + * @return array + */ private function getAttributes() { /* Attribute with the code we want to copy */ diff --git a/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php index 82f54b7ebc3e6..1a646be88b84c 100644 --- a/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Event/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; 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 b3a6a4a429453..4b774b544cf55 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 2e505c7753399..1c2a451cea91f 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 df31d4ae71cd1..0c9b09996178a 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/File/Mime.php b/lib/internal/Magento/Framework/File/Mime.php index 2fa3de869b759..2ce61bb36e184 100644 --- a/lib/internal/Magento/Framework/File/Mime.php +++ b/lib/internal/Magento/Framework/File/Mime.php @@ -59,7 +59,24 @@ class Mime ]; /** - * Get mime type of a file + * List of mime types that can be defined by file extension. + * + * @var array $defineByExtensionList + */ + private $defineByExtensionList = [ + 'txt' => 'text/plain', + 'htm' => 'text/html', + 'html' => 'text/html', + 'php' => 'text/html', + 'css' => 'text/css', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'xml' => 'application/xml', + 'svg' => 'image/svg+xml', + ]; + + /** + * Get mime type of a file. * * @param string $file * @return string @@ -71,19 +88,50 @@ public function getMimeType($file) throw new \InvalidArgumentException("File '$file' doesn't exist"); } - $extension = pathinfo($file, PATHINFO_EXTENSION); - if (isset($this->mimeTypes[$extension])) { - $result = $this->mimeTypes[$extension]; - } + $result = null; + $extension = $this->getFileExtension($file); - if (empty($result) && (function_exists('mime_content_type') && ini_get('mime_magic.magicfile'))) { - $result = mime_content_type($file); + if (function_exists('mime_content_type')) { + $result = $this->getNativeMimeType($file); } - if (empty($result)) { + if (null === $result && isset($this->mimeTypes[$extension])) { + $result = $this->mimeTypes[$extension]; + } elseif (null === $result) { $result = 'application/octet-stream'; } return $result; } + + /** + * Get mime type by the native mime_content_type function. + * Search for extended mime type if mime_content_type() returned 'application/octet-stream' or 'text/plain' + * + * @param string $file + * @return string + */ + private function getNativeMimeType($file) + { + $extension = $this->getFileExtension($file); + $result = mime_content_type($file); + if (isset($this->mimeTypes[$extension], $this->defineByExtensionList[$extension]) + && strpos($result, 'text/') === 0 + ) { + $result = $this->mimeTypes[$extension]; + } + + return $result; + } + + /** + * Get file extension by file name. + * + * @param string $file + * @return string + */ + private function getFileExtension($file) + { + return strtolower(pathinfo($file, PATHINFO_EXTENSION)); + } } diff --git a/lib/internal/Magento/Framework/File/Test/Unit/Transfer/Adapter/HttpTest.php b/lib/internal/Magento/Framework/File/Test/Unit/Transfer/Adapter/HttpTest.php index 68664fc6a03ba..7d1162b157e86 100644 --- a/lib/internal/Magento/Framework/File/Test/Unit/Transfer/Adapter/HttpTest.php +++ b/lib/internal/Magento/Framework/File/Test/Unit/Transfer/Adapter/HttpTest.php @@ -28,7 +28,7 @@ protected function setUp() { $this->response = $this->getMock( '\Magento\Framework\HTTP\PhpEnvironment\Response', - ['setHeader', 'sendHeaders'], + ['setHeader', 'sendHeaders', 'setHeaders'], [], '', false @@ -59,6 +59,29 @@ public function testSend() $this->object->send($file); } + public function testSendWithOptions() + { + $file = __DIR__ . '/../../_files/javascript.js'; + $contentType = 'content/type'; + + $headers = $this->getMockBuilder(\Zend\Http\Headers::class)->getMock(); + $this->response->expects($this->atLeastOnce()) + ->method('setHeader') + ->withConsecutive(['Content-length', filesize($file)], ['Content-Type', $contentType]); + $this->response->expects($this->once()) + ->method('setHeaders') + ->with($headers); + $this->response->expects($this->once()) + ->method('sendHeaders'); + $this->mime->expects($this->once()) + ->method('getMimeType') + ->with($file) + ->willReturn($contentType); + $this->expectOutputString(file_get_contents($file)); + + $this->object->send(['filepath' => $file, 'headers' => $headers]); + } + /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Filename is not set diff --git a/lib/internal/Magento/Framework/File/Test/Unit/_files/UPPERCASE.WEIRD b/lib/internal/Magento/Framework/File/Test/Unit/_files/UPPERCASE.WEIRD new file mode 100644 index 0000000000000..f4d9182aa98b2 --- /dev/null +++ b/lib/internal/Magento/Framework/File/Test/Unit/_files/UPPERCASE.WEIRD @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/lib/internal/Magento/Framework/File/Test/Unit/_files/file.weird b/lib/internal/Magento/Framework/File/Test/Unit/_files/file.weird index e69de29bb2d1d..f4d9182aa98b2 100644 --- a/lib/internal/Magento/Framework/File/Test/Unit/_files/file.weird +++ b/lib/internal/Magento/Framework/File/Test/Unit/_files/file.weird @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php index d2626e73ad2fc..5a35faf3eb70c 100644 --- a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php +++ b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php @@ -40,13 +40,7 @@ public function __construct(\Magento\Framework\HTTP\PhpEnvironment\Response $res */ public function send($options = null) { - if (is_string($options)) { - $filepath = $options; - } elseif (is_array($options) && isset($options['filepath'])) { - $filepath = $options['filepath']; - } else { - throw new \InvalidArgumentException("Filename is not set."); - } + $filepath = $this->getFilePath($options); if (!is_file($filepath) || !is_readable($filepath)) { throw new \InvalidArgumentException("File '{$filepath}' does not exists."); @@ -54,6 +48,10 @@ public function send($options = null) $mimeType = $this->mime->getMimeType($filepath); + if (isset($options['headers']) && $options['headers'] instanceof \Zend\Http\Headers) { + $this->response->setHeaders($options['headers']); + } + $this->response->setHeader('Content-length', filesize($filepath)); $this->response->setHeader('Content-Type', $mimeType); @@ -70,4 +68,26 @@ public function send($options = null) fclose($handle); } } + + /** + * Get filepath by provided parameter $options. + * If the $options is a string it assumes it's a file path. If the option is an array method will look for the + * 'filepath' key and return it's value. + * + * @param string|array|null $options + * @return string + * @throws \InvalidArgumentException + */ + private function getFilePath($options = null) + { + if (is_string($options)) { + $filePath = $options; + } elseif (isset($options['filepath'])) { + $filePath = $options['filepath']; + } else { + throw new \InvalidArgumentException("Filename is not set."); + } + + return $filePath; + } } diff --git a/lib/internal/Magento/Framework/File/Uploader.php b/lib/internal/Magento/Framework/File/Uploader.php index f4b7f1fa50109..6aedac8fae733 100644 --- a/lib/internal/Magento/Framework/File/Uploader.php +++ b/lib/internal/Magento/Framework/File/Uploader.php @@ -118,6 +118,11 @@ class Uploader */ protected $_validateCallbacks = []; + /** + * @var \Magento\Framework\File\Mime + */ + private $fileMime; + /**#@+ * File upload type (multiple or single) */ @@ -154,10 +159,13 @@ class Uploader * Init upload * * @param string|array $fileId + * @param null|\Magento\Framework\File\Mime $fileMime * @throws \Exception */ - public function __construct($fileId) - { + public function __construct( + $fileId, + Mime $fileMime = null + ) { $this->_setUploadFileId($fileId); if (!file_exists($this->_file['tmp_name'])) { $code = empty($this->_file['tmp_name']) ? self::TMP_NAME_EMPTY : 0; @@ -165,6 +173,7 @@ public function __construct($fileId) } else { $this->_fileExists = true; } + $this->fileMime = $fileMime ?: \Magento\Framework\App\ObjectManager::getInstance()->get(Mime::class); } /** @@ -511,7 +520,7 @@ public function checkAllowedExtension($extension) */ private function _getMimeType() { - return $this->_file['type']; + return $this->fileMime->getMimeType($this->_file['tmp_name']); } /** 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 89e58f5728dc0..ca600e7ebb713 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php @@ -30,7 +30,10 @@ public function testGetAbsolutePath($basePath, $path, $expected) $file = new File(); $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 7e342fea6ff0c..d0fb24f7b748d 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/File/ExcludeFilterTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php index 9dd2f09a60d84..aaf61637d5fc5 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 e79e07b89752e..69ff285a2b3fb 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 7a44bf7cb4ef6..47e815ae4a719 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 6c3e1edd5371e..19d3d0556b8e3 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 ad47b4122ad67..a305fb6309b15 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 $stub \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php index cb7fa45f07109..4a688a7d9c561 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php @@ -5,20 +5,22 @@ */ namespace Magento\Framework\HTTP\PhpEnvironment; +use Magento\Framework\App\RequestInterface; + /** - * Library for working with client ip address + * Library for working with client ip address. */ class RemoteAddress { /** - * Request object + * Request object. * - * @var \Magento\Framework\App\RequestInterface + * @var RequestInterface */ protected $request; /** - * Remote address cache + * Remote address cache. * * @var string */ @@ -30,46 +32,114 @@ class RemoteAddress protected $alternativeHeaders; /** - * @param \Magento\Framework\App\RequestInterface $httpRequest + * @var string[]|null + */ + private $trustedProxies; + + /** + * @param RequestInterface $httpRequest * @param array $alternativeHeaders + * @param string[]|null $trustedProxies */ - public function __construct(\Magento\Framework\App\RequestInterface $httpRequest, array $alternativeHeaders = []) - { + public function __construct( + RequestInterface $httpRequest, + array $alternativeHeaders = [], + array $trustedProxies = null + ) { $this->request = $httpRequest; $this->alternativeHeaders = $alternativeHeaders; + $this->trustedProxies = $trustedProxies; } /** - * Retrieve Client Remote Address + * Read address based on settings. * - * @param bool $ipToLong converting IP to long format - * @return string IPv4|long + * @return string|null */ - public function getRemoteAddress($ipToLong = false) + private function readAddress() { - if ($this->remoteAddress === null) { - foreach ($this->alternativeHeaders as $var) { - if ($this->request->getServer($var, false)) { - $this->remoteAddress = $this->request->getServer($var); - break; - } + $remoteAddress = null; + foreach ($this->alternativeHeaders as $var) { + if ($this->request->getServer($var, false)) { + $remoteAddress = $this->request->getServer($var); + break; } + } + + if (!$remoteAddress) { + $remoteAddress = $this->request->getServer('REMOTE_ADDR'); + } + + return $remoteAddress; + } - if (!$this->remoteAddress) { - $this->remoteAddress = $this->request->getServer('REMOTE_ADDR'); + /** + * Filter addresses by trusted proxies list. + * + * @param string $remoteAddress + * @return string|null + */ + private function filterAddress($remoteAddress) + { + if (strpos($remoteAddress, ',') !== false) { + $ipList = explode(',', $remoteAddress); + } else { + $ipList = [$remoteAddress]; + } + $ipList = array_filter( + $ipList, + function ($ip) { + return filter_var(trim($ip), FILTER_VALIDATE_IP); } + ); + if ($this->trustedProxies !== null) { + $ipList = array_filter( + $ipList, + function ($ip) { + return !in_array(trim($ip), $this->trustedProxies, true); + } + ); + $remoteAddress = trim(array_pop($ipList)); + } else { + $remoteAddress = trim(reset($ipList)); } - if (!$this->remoteAddress) { - return false; + return $remoteAddress ?: null; + } + + /** + * Retrieve Client Remote Address. + * If alternative headers are used and said headers allow multiple IPs + * it is suggested that trusted proxies is also used + * for more accurate IP recognition. + * + * @param bool $ipToLong converting IP to long format + * + * @return string IPv4|long + */ + public function getRemoteAddress($ipToLong = false) + { + if ($this->remoteAddress !== null) { + return $this->remoteAddress; } - if (strpos($this->remoteAddress, ',') !== false) { - $ipList = explode(',', $this->remoteAddress); - $this->remoteAddress = trim(reset($ipList)); + $remoteAddress = $this->readAddress(); + if (!$remoteAddress) { + $this->remoteAddress = false; + + return false; } + $remoteAddress = $this->filterAddress($remoteAddress); - return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress; + if (!$remoteAddress) { + $this->remoteAddress = false; + + return false; + } else { + $this->remoteAddress = $remoteAddress; + + return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress; + } } /** 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 b839254e07035..34c0c4069a241 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/RemoteAddressTest.php b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RemoteAddressTest.php index cf0d688947c94..f07d30fedf993 100644 --- a/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RemoteAddressTest.php +++ b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RemoteAddressTest.php @@ -5,44 +5,67 @@ */ namespace Magento\Framework\HTTP\Test\Unit\PhpEnvironment; +use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; + class RemoteAddressTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Request\Http + * @var \PHPUnit_Framework_MockObject_MockObject|\HttpRequest */ protected $_request; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var ObjectManager */ protected $_objectManager; protected function setUp() { - $this->_request = $this->getMockBuilder( - 'Magento\Framework\App\Request\Http' - )->disableOriginalConstructor()->setMethods( - ['getServer'] - )->getMock(); + $this->_request = $this->getMockBuilder(HttpRequest::class) + ->disableOriginalConstructor() + ->setMethods(['getServer']) + ->getMock(); - $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->_objectManager = new ObjectManager($this); } /** + * @param string[] $alternativeHeaders + * @param array $serverValueMap + * @param string|bool $expected + * @param bool $ipToLong + * @param string[]|null $trustedProxies + * @return void * @dataProvider getRemoteAddressProvider */ - public function testGetRemoteAddress($alternativeHeaders, $serverValueMap, $expected, $ipToLong) - { + public function testGetRemoteAddress( + array $alternativeHeaders, + array $serverValueMap, + $expected, + $ipToLong, + array $trustedProxies = null + ) { $remoteAddress = $this->_objectManager->getObject( - 'Magento\Framework\HTTP\PhpEnvironment\RemoteAddress', - ['httpRequest' => $this->_request, 'alternativeHeaders' => $alternativeHeaders] + RemoteAddress::class, + [ + 'httpRequest' => $this->_request, + 'alternativeHeaders' => $alternativeHeaders, + 'trustedProxies' => $trustedProxies, + ] ); - $this->_request->expects($this->any())->method('getServer')->will($this->returnValueMap($serverValueMap)); + $this->_request->expects($this->any()) + ->method('getServer') + ->will($this->returnValueMap($serverValueMap)); + $this->assertEquals($expected, $remoteAddress->getRemoteAddress($ipToLong)); } /** * @return array + * + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function getRemoteAddressProvider() { @@ -52,18 +75,21 @@ public function getRemoteAddressProvider() 'serverValueMap' => [['REMOTE_ADDR', null, null]], 'expected' => false, 'ipToLong' => false, + 'trustedProxies' => null, ], [ 'alternativeHeaders' => [], 'serverValueMap' => [['REMOTE_ADDR', null, '192.168.0.1']], 'expected' => '192.168.0.1', - 'ipToLong' => false + 'ipToLong' => false, + 'trustedProxies' => null, ], [ 'alternativeHeaders' => [], 'serverValueMap' => [['REMOTE_ADDR', null, '192.168.1.1']], 'expected' => ip2long('192.168.1.1'), - 'ipToLong' => true + 'ipToLong' => true, + 'trustedProxies' => null, ], [ 'alternativeHeaders' => ['TEST_HEADER'], @@ -73,7 +99,8 @@ public function getRemoteAddressProvider() ['TEST_HEADER', false, '192.168.0.1'], ], 'expected' => '192.168.0.1', - 'ipToLong' => false + 'ipToLong' => false, + 'trustedProxies' => null, ], [ 'alternativeHeaders' => ['TEST_HEADER'], @@ -83,8 +110,74 @@ public function getRemoteAddressProvider() ['TEST_HEADER', false, '192.168.0.1'], ], 'expected' => ip2long('192.168.0.1'), - 'ipToLong' => true - ] + 'ipToLong' => true, + 'trustedProxies' => null, + ], + [ + 'alternativeHeaders' => [], + 'serverValueMap' => [ + ['REMOTE_ADDR', null, 'NotValidIp'], + ], + 'expected' => false, + 'ipToLong' => false, + 'trustedProxies' => ['127.0.0.1'], + ], + [ + 'alternativeHeaders' => ['TEST_HEADER'], + 'serverValueMap' => [ + ['TEST_HEADER', null, 'NotValid, 192.168.0.1'], + ['TEST_HEADER', false, 'NotValid, 192.168.0.1'], + ], + 'expected' => '192.168.0.1', + 'ipToLong' => false, + 'trustedProxies' => ['127.0.0.1'], + ], + [ + 'alternativeHeaders' => ['TEST_HEADER'], + 'serverValueMap' => [ + ['TEST_HEADER', null, '192.168.0.2, 192.168.0.1'], + ['TEST_HEADER', false, '192.168.0.2, 192.168.0.1'], + ], + 'expected' => '192.168.0.2', + 'ipToLong' => false, + 'trustedProxies' => null, + ], + [ + 'alternativeHeaders' => [], + 'serverValueMap' => [ + [ + 'REMOTE_ADDR', + null, + '192.168.0.2, 192.168.0.1, 192.168.0.3', + ], + [ + 'REMOTE_ADDR', + false, + '192.168.0.2, 192.168.0.1, 192.168.0.3', + ], + ], + 'expected' => '192.168.0.1', + 'ipToLong' => false, + 'trustedProxies' => ['192.168.0.3'], + ], + [ + 'alternativeHeaders' => [], + 'serverValueMap' => [ + [ + 'REMOTE_ADDR', + null, + '192.168.0.2, 192.168.0.1, 192.168.0.3', + ], + [ + 'REMOTE_ADDR', + false, + '192.168.0.2, 192.168.0.1, 192.168.0.3', + ], + ], + 'expected' => '192.168.0.3', + 'ipToLong' => false, + 'trustedProxies' => [], + ], ]; } } 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 be65479f5503f..e553f0e041fa8 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,10 @@ public function tearDown() $_SERVER = $this->serverArray; } + /** + * @param null $uri + * @return Request + */ private function getModel($uri = null) { return new Request($this->cookieReader, $this->converter, $uri); @@ -213,7 +217,6 @@ public function testGetAliasWhenAliasAreEmpty() $this->assertNull($this->model->getAlias('')); } - public function testGetCookie() { $key = "cookieName"; @@ -227,7 +230,6 @@ public function testGetCookie() $this->getModel()->getCookie($key, $default); } - public function testGetCookieDefault() { $key = "cookieName"; 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 8e4fc4f389d1d..1dcf076767235 100644 --- a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php +++ b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/AbstractTest.php @@ -54,7 +54,7 @@ protected function setUp() )->will( $this->returnValue($this->directoryWriteMock) ); - $this->loggerMock = $this->getMockBuilder( 'Psr\Log\LoggerInterface')->getMock(); + $this->loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $this->_model = $this->getMockForAbstractClass( 'Magento\Framework\Image\Adapter\AbstractAdapter', @@ -120,6 +120,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 d142ac98a4201..e64c277a7276a 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/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php index e91d5e6bc2f10..6f338256b8c3e 100644 --- a/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Indexer/Config/SchemaLocator.php @@ -12,6 +12,10 @@ class SchemaLocator implements SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php index 6dfcf19604a79..e55afd8a43dc0 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php @@ -182,6 +182,12 @@ 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++)) @@ -197,6 +203,11 @@ 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') @@ -219,6 +230,11 @@ 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') 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 88c510d797845..0bd02f49b66be 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -178,6 +178,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/Math/Test/Unit/RandomTest.php b/lib/internal/Magento/Framework/Math/Test/Unit/RandomTest.php index 6b4b574c5a866..e7e0140c70839 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 d876207c3430c..61e95ec3a1508 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php @@ -247,6 +247,9 @@ public function testAddMessage($type, $methodName) $this->assertTrue($this->model->hasMessages()); } + /** + * @return array + */ public function addMessageDataProvider() { return [ @@ -277,6 +280,9 @@ public function testAddUniqueMessagesWhenMessagesImplementMessageInterface($mess $this->model->addUniqueMessages([$messages]); } + /** + * @return array + */ public function addUniqueMessagesWhenMessagesImplementMessageInterfaceDataProvider() { return [ @@ -310,6 +316,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 ba35fa1af7496..aaafe0005b8ec 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 @@ -165,6 +165,9 @@ public function testGetMainTable($tableName, $expectedResult) $this->assertEquals($expectedResult, $this->_model->getMainTable()); } + /** + * @return array + */ public function getTableDataProvider() { return [ @@ -216,6 +219,9 @@ public function testGetChecksum($checksum, $expected) $this->assertEquals($expected, $this->_model->getChecksum($checksum)); } + /** + * @return array + */ public function getChecksumProvider() { return [ @@ -401,6 +407,9 @@ public function testGetDataChanged($getOriginData, $expected) $this->assertEquals($expected, $this->_model->hasDataChanged($abstractModelMock)); } + /** + * @return array + */ public function hasDataChangedDataProvider() { return [ @@ -566,6 +575,9 @@ public function testSaveNewObject($pkIncrement) $reflectionMethod->invokeArgs($model, [$inputObject]); } + /** + * @return array + */ public function saveNewObjectDataProvider() { return [[true], [false]]; 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 8ca30b525511b..7caf463457ed6 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 @@ -98,6 +98,9 @@ protected function tearDown() \Magento\Framework\App\ObjectManager::setInstance($objectManagerMock); } + /** + * @return object + */ protected function getUut() { return $this->objectManagerHelper->getObject( @@ -219,6 +222,9 @@ public function testGetSelect($idFieldNameRet, $getPartRet, $expected) $this->assertTrue($this->uut->getSelect() instanceof Select); } + /** + * @return array + */ public function getSelectDataProvider() { $columnMock = $this->getMock('Zend_Db_Expr', ['__toString'], [], '', false); @@ -245,6 +251,9 @@ public function testAddFieldToSelect($field, $alias, $expectedFieldsToSelect) $this->assertTrue($this->uut->wereFieldsToSelectChanged()); } + /** + * @return array + */ public function addFieldToSelectDataProvider() { return [ @@ -264,6 +273,9 @@ public function testAddExpressionFieldToSelect($alias, $expression, $fields, $ex $this->assertTrue($this->uut->addExpressionFieldToSelect($alias, $expression, $fields) instanceof Uut); } + /** + * @return array + */ public function addExpressionFieldToSelectDataProvider() { return [ @@ -288,6 +300,9 @@ public function testRemoveFieldFromSelect( $this->assertEquals($expectedWereFieldsToSelectChanged, $this->uut->wereFieldsToSelectChanged()); } + /** + * @return array + */ public function removeFieldFromSelectDataProvider() { return [ @@ -375,6 +390,9 @@ public function testJoin($table, $cond, $cols, $expected) $this->assertEquals($expected, $this->uut->getJoinedTables()); } + /** + * @return array + */ public function joinDataProvider() { return [ @@ -416,26 +434,41 @@ public function testSave() */ 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 6a34f0ae4081e..b335804f58b02 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 4ab10bb953f85..7678d4a928e08 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 1d555bd782bae..1e2e957ff334f 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php @@ -80,6 +80,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]]; @@ -100,6 +103,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 3f942b241c021..6fe52712ccd3e 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -262,6 +262,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 68d2783158e8e..64f56b6d1de12 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -498,6 +498,9 @@ public function testResumeNotSuspended($status) $this->model->resume(); } + /** + * @return array + */ public function dataProviderResumeNotSuspended() { return [ @@ -554,6 +557,9 @@ public function testIsEnabled($mode, $result) $this->assertEquals($result, $this->model->isEnabled()); } + /** + * @return array + */ public function dataProviderIsEnabled() { return [ @@ -575,6 +581,9 @@ public function testIsIdle($status, $result) $this->assertEquals($result, $this->model->isIdle()); } + /** + * @return array + */ public function dataProviderIsIdle() { return [ @@ -597,6 +606,9 @@ public function testIsWorking($status, $result) $this->assertEquals($result, $this->model->isWorking()); } + /** + * @return array + */ public function dataProviderIsWorking() { return [ @@ -619,6 +631,9 @@ public function testIsSuspended($status, $result) $this->assertEquals($result, $this->model->isSuspended()); } + /** + * @return array + */ public function dataProviderIsSuspended() { return [ @@ -651,6 +666,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 cd02708e1023c..c70287a58577c 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 @@ -18,21 +18,33 @@ class RepositoryTest extends EntityChildTestAbstract const GENERATOR_CLASS_NAME = 'Magento\Framework\ObjectManager\Code\Generator\Repository'; const OUTPUT_FILE_NAME = 'SampleConverter.php'; + /** + * @return string + */ protected function getSourceClassName() { return self::SOURCE_CLASS_NAME; } + /** + * @return string + */ protected function getResultClassName() { return self::RESULT_CLASS_NAME; } + /** + * @return string + */ protected function getGeneratorClassName() { return self::GENERATOR_CLASS_NAME; } + /** + * @return string + */ protected function getOutputFileName() { return self::OUTPUT_FILE_NAME; 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 b4b9e628164b3..3a9cf3b9efe8a 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/DefinitionFactoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/DefinitionFactoryTest.php index a48e4fa3e88e3..cb6bfd1cdaadf 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/DefinitionFactoryTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/DefinitionFactoryTest.php @@ -68,6 +68,9 @@ public function testCreatePluginsAndRelationsReadable($path, $callMethod, $expec $this->assertInstanceOf($expectedClass, $this->model->$callMethod()); } + /** + * @return array + */ public function createPluginsAndRelationsReadableDataProvider() { return [ @@ -98,6 +101,9 @@ public function testCreatePluginsAndRelationsNotReadable($path, $callMethod, $ex $this->assertInstanceOf($expectedClass, $this->model->$callMethod()); } + /** + * @return array + */ public function createPluginsAndRelationsNotReadableDataProvider() { return [ 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 37a3c9a57a620..9ac1700a22c8c 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..826e94c6cb8df 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,14 @@ 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..2d24e640e90fa 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,16 @@ 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..58ee7c819490d 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,11 @@ 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 f22213a19d76d..8d2ae0e923647 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 8e7f9b49fd4cd..066a2ee575f93 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 b177c4d4fcb85..9699b30cd8527 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 7a982673c8999..859068e09bbe2 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php @@ -92,6 +92,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 e6b1ebc05f216..8f3b21ab70852 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php @@ -283,6 +283,12 @@ 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 eca27dfc5324b..a18472d655389 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php @@ -113,6 +113,9 @@ public function testToHtml($data, $priceCode, $cssClasses) $this->assertEquals($cssClasses, $priceBox->getData('css_classes')); } + /** + * @return array + */ public function toHtmlDataProvider() { return [ @@ -216,6 +219,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/ExtensionAttributesProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/ExtensionAttributesProcessorTest.php index 8dffc20aa1630..d1570d5848728 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/TypeProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php index 092f0aa1dd63f..666ef8b7c2ef3 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php @@ -217,6 +217,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/Search/Request/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php index 8c2c158f9d539..4b14acb13b02c 100644 --- a/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php +++ b/lib/internal/Magento/Framework/Search/Request/Config/SchemaLocator.php @@ -13,6 +13,10 @@ class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; + /** + * SchemaLocator constructor. + * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver + */ public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver) { $this->urnResolver = $urnResolver; 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 08403ba5e9dc2..c6c2082c6f2c1 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Request/MapperTest.php @@ -849,6 +849,9 @@ public function testGetFilterException() $this->assertEquals($this->queryBool, $mapper->getRootQuery()); } + /** + * @return array + */ public function getQueryMatchProvider() { return [ @@ -876,6 +879,9 @@ public function getQueryMatchProvider() ]; } + /** + * @return array + */ public function getQueryFilterQueryReferenceProvider() { return [ @@ -923,6 +929,9 @@ public function getQueryFilterQueryReferenceProvider() ]; } + /** + * @return array + */ public function getQueryBoolProvider() { return [ diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php index 4a613d2685142..08a8896a64833 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php @@ -81,6 +81,9 @@ public function testSetOptions($option, $getter, $value) $this->assertSame($value, $this->config->{$getter}()); } + /** + * @return array + */ public function optionsProvider() { return [ @@ -342,6 +345,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 b85d2c6f61e95..18a8e20c3b7f3 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 79c06abce30a8..88d07e349fd89 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 e1c96fd6e04bc..7c3b80350a41a 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 7589d2f58ba51..5cc3a0132afcc 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 cef58f94edbd9..d40c25b86f1da 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php @@ -252,6 +252,9 @@ public function testSetSensitiveCookieNoMetadata($cookieName, $secure) $this->assertTrue(self::$isSetCookieInvoked); } + /** + * @return array + */ public function isCurrentlySecureDataProvider() { return [ @@ -814,6 +817,11 @@ private static function assertCookieSize( 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 ff8aba1424a92..60dea5fd2d61d 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/TimezoneTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php index efe2dca4a1d10..c51f598fa305e 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php @@ -50,6 +50,9 @@ public function testDate($date, $locale, $expectedTimestamp) $this->assertEquals($expectedTimestamp, $date->getTimestamp()); } + /** + * @return array + */ public function dateDataProvider() { return [ diff --git a/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php b/lib/internal/Magento/Framework/Test/Unit/ArchiveTest.php index db9f0feb1b37a..afee925772e75 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/FlagTest.php b/lib/internal/Magento/Framework/Test/Unit/FlagTest.php index 1e35a012ff60b..a7265583306ca 100644 --- a/lib/internal/Magento/Framework/Test/Unit/FlagTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/FlagTest.php @@ -23,6 +23,9 @@ protected function setUp() $this->createInstance($data); } + /** + * @param array $data + */ protected function createInstance(array $data = []) { $eventManager = $this->getMock('Magento\Framework\Event\Manager', ['dispatch'], [], '', false, false); diff --git a/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php b/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php index 9e59e6a844539..9b3a9d8e21ef3 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'); @@ -52,5 +55,4 @@ public function dataProvider() ], ]; } - } diff --git a/lib/internal/Magento/Framework/Test/Unit/ObjectTest.php b/lib/internal/Magento/Framework/Test/Unit/ObjectTest.php index 625a1102f9dab..c274503bdf915 100644 --- a/lib/internal/Magento/Framework/Test/Unit/ObjectTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/ObjectTest.php @@ -366,6 +366,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/ShellTest.php b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php index b185bbd68c3ff..42b16af34af67 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 cac16773c989b..5ca91b2d05101 100644 --- a/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php @@ -121,6 +121,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']; @@ -216,6 +219,9 @@ public function testLoadData($area, $forceReload) $this->assertEquals($expected, $this->translate->getData()); } + /** + * @return array + */ public function dataProviderForTestLoadData() { return [ @@ -243,6 +249,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/Translate/Test/Unit/InlineTest.php b/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php index 19b83aac6cc5f..12bea7f541513 100644 --- a/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php +++ b/lib/internal/Magento/Framework/Translate/Test/Unit/InlineTest.php @@ -92,6 +92,9 @@ public function testIsAllowed($isEnabled, $isActive, $isDevAllowed, $result) $this->assertEquals($result, $model->isAllowed()); } + /** + * @return array + */ public function isAllowedDataProvider() { return [ @@ -144,6 +147,9 @@ public function testProcessResponseBodyStripInline($body, $expected) $this->assertEquals($body, $expected); } + /** + * @return array + */ public function processResponseBodyStripInlineDataProvider() { return [ @@ -210,6 +216,9 @@ public function testProcessResponseBody($scope, $body, $expected) $this->assertEquals($body, $expected); } + /** + * @return array + */ public function processResponseBodyDataProvider() { return [ @@ -272,6 +281,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 cca250e7eef23..258866cc982cd 100644 --- a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php +++ b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php @@ -36,6 +36,9 @@ public function testUnserializeObject($serialized) $this->assertFalse($this->unserialize->unserialize($serialized)); } + /** + * @return array + */ public function serializedObjectDataProvider() { 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 b0c5e11592d95..bea8bfcfad6d6 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 0cb5bac48509d..d2d3463d181b0 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 8179ba7e342fc..5662e40683831 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/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index ff75afafbe689..ee68ef2cbdcc2 100755 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -517,7 +517,7 @@ public function renderNonCachedElement($name) } elseif ($this->isBlock($name)) { $result = $this->_renderBlock($name); } else { - $result = $this->_renderContainer($name); + $result = $this->_renderContainer($name, false); } } catch (\Exception $e) { if ($this->appState->getMode() === AppState::MODE_DEVELOPER) { @@ -559,14 +559,15 @@ protected function _renderUiComponent($name) * Gets HTML of container element * * @param string $name + * @param bool $useCache * @return string */ - protected function _renderContainer($name) + protected function _renderContainer($name, $useCache = true) { $html = ''; $children = $this->getChildNames($name); foreach ($children as $child) { - $html .= $this->renderElement($child); + $html .= $this->renderElement($child, $useCache); } if ($html == '' || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { return $html; 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 05006b82b7b31..d43dd6e8c47fc 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 6f781171f15c9..0d391fc865307 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 c920360971abb..137e01891b664 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php @@ -18,6 +18,7 @@ /** * Class MergeServiceTest + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MergeServiceTest extends \PHPUnit_Framework_TestCase { @@ -117,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 8047442510fef..4d39251340b98 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/ContextTest.php @@ -221,6 +221,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 d7342a202486f..18d0f02c2a261 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php @@ -46,6 +46,10 @@ public function testAddWithException() $this->dataSourcePool->add('DataSourcePoolTestBlock', 'NotExistingBlockClass'); } + /** + * @param $blockClass + * @return mixed + */ protected function createBlock($blockClass) { $block = $this->getMock('Magento\Framework\View\Element\BlockInterface'); 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 f4e3e6ebf56e2..4841ec3e2671d 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 8291c1dbfa9b4..f6c80ff28cdf8 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/Text/TextList/ItemTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Text/TextList/ItemTest.php index d29fc50b10396..efa2c30cde0a2 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 @@ -56,6 +56,9 @@ public function testToHtml($liParams, $attrName, $attrValue, $innerText) ], $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 395bc9fec086d..15070facd5945 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 @@ -62,6 +62,9 @@ public function testToHtml($liParams, $liAttr, $aParams, $aAttr, $innerText, $af ], $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 6c0b8487b465b..dfb77bb3b58c4 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 62203b72dd391..8dba7c9ce753b 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 @@ -59,6 +59,10 @@ public function testEvaluate() $this->assertSame($expected, $actual); } + /** + * @param $input + * @return string + */ public function help($input) { $this->assertSame('some text (evaluated)', $input); @@ -78,6 +82,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 f9ad4d387c991..857ca1a7c496f 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 @@ -64,6 +64,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/ObjectTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/ObjectTest.php index 1d7232d7ada41..89b7bd7c27982 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/ObjectTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Argument/Interpreter/ObjectTest.php @@ -67,6 +67,9 @@ function ($className) use ($self) { $this->_model->evaluate($input); } + /** + * @return array + */ public function evaluateWrongClassDataProvider() { 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 51b34ea810662..b8a924ef93cd7 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 @@ -71,6 +71,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 8d615441399b0..89a32603fe670 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 70daa9676685d..86968293fa988 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 a0646ff365a8b..12cdb16e0d9b1 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 @@ -77,6 +77,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/Page/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php index 6f4bf8da7bb57..4862816a9efe6 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php @@ -282,6 +282,9 @@ public function testAddPageAsset($file, $properties, $name, $expectedName) ); } + /** + * @return array + */ public function pageAssetDataProvider() { return [ @@ -321,6 +324,9 @@ public function testAddRemotePageAsset($url, $contentType, $properties, $name, $ ); } + /** + * @return array + */ public function remotePageAssetDataProvider() { return [ @@ -377,6 +383,9 @@ public function testElementAttribute($elementType, $attribute, $value) $this->assertEquals($value, $this->model->getElementAttribute($elementType, $attribute)); } + /** + * @return array + */ public function elementAttributeDataProvider() { return [ @@ -411,6 +420,9 @@ public function testElementAttributeException($elementType, $attribute, $value) $this->model->setElementAttribute($elementType, $attribute, $value); } + /** + * @return array + */ public function elementAttributeExceptionDataProvider() { return [ @@ -446,6 +458,9 @@ public function testElementAttributes($elementType, $attributes) $this->assertEquals($attributes, $this->model->getElementAttributes($elementType)); } + /** + * @return array + */ public function elementAttributesDataProvider() { return [ @@ -470,6 +485,9 @@ public function testPageLayout($handle) $this->assertEquals($handle, $this->model->getPageLayout()); } + /** + * @return array + */ public function pageLayoutDataProvider() { return [ @@ -530,6 +548,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/Rest/Response/FieldsFilter.php b/lib/internal/Magento/Framework/Webapi/Rest/Response/FieldsFilter.php index 75a18dab6b2a7..327b7af93e62b 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Response/FieldsFilter.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Response/FieldsFilter.php @@ -104,9 +104,9 @@ protected function parse($filterString) } switch ($filterString[$position]) { case '[': - array_push($parent, $currentElement); + $parent[] = $currentElement; // push current field in stack and initialize current - array_push($stack, $current); + $stack[] = $current; $current = []; break; diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/RequestTest.php index 212477a2e0bdc..a03a18ac33fe7 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 94c9d9cebdc79..7ddf86edec540 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php @@ -518,6 +518,9 @@ public function testCustomAttributesExceptions($inputData) ); } + /** + * @return array + */ public function invalidCustomAttributesDataProvider() { return [ diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index a42ec4231f2d7..be2c1eec5dc58 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "100.1.13", + "version": "100.1.14", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js index 11186b5761efd..de4292b56e684 100644 --- a/lib/web/mage/calendar.js +++ b/lib/web/mage/calendar.js @@ -238,12 +238,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"' : '') + '>' + @@ -291,7 +293,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/mage/collapsible.js b/lib/web/mage/collapsible.js index fd99ee55b6bf6..58f4cfe6b5948 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -100,7 +100,8 @@ define([ _processState: function () { var anchor = window.location.hash, isValid = $.mage.isValidSelector(anchor), - urlPath = window.location.pathname.replace('.', ''); + urlPath = window.location.pathname.replace(/\./g, ''), + state; this.stateKey = encodeURIComponent(urlPath + this.element.attr("id")); @@ -113,7 +114,7 @@ define([ } } } else if (this.options.saveState && !this.options.disabled) { - var state = this.storage.get(this.stateKey); + state = this.storage.get(this.stateKey); if (typeof state === 'undefined' || state === null) { this.storage.set(this.stateKey,this.options.active); } else if (state === true) { diff --git a/setup/src/Magento/Setup/Module/Dependency/Circular.php b/setup/src/Magento/Setup/Module/Dependency/Circular.php index 8f5bd8716f650..a10d2752fa410 100644 --- a/setup/src/Magento/Setup/Module/Dependency/Circular.php +++ b/setup/src/Magento/Setup/Module/Dependency/Circular.php @@ -118,7 +118,7 @@ protected function buildCircular($modules) return; } $this->circularDependencies[$path] = $modules; - array_push($modules, array_shift($modules)); + $modules[] = array_shift($modules); $this->buildCircular($modules); } @@ -133,7 +133,7 @@ protected function divideByModules($circularDependencies) $dependenciesByModule = []; foreach ($circularDependencies as $circularDependency) { $module = $circularDependency[0]; - array_push($circularDependency, $module); + $circularDependency[] = $module; $dependenciesByModule[$module][] = $circularDependency; } diff --git a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php index e88ca9197096a..75c6e1144e8d2 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php @@ -42,9 +42,9 @@ protected function _collectEntitiesFromString($content) $attributes = $entityNode->attributes; $type = $attributes->getNamedItem('type'); if ($type !== null) { - array_push($output, $type->nodeValue); + $output[] = $type->nodeValue; } else { - array_push($output, $attributes->getNamedItem('name')->nodeValue); + $output[] = $attributes->getNamedItem('name')->nodeValue; } } return $output; @@ -80,7 +80,7 @@ protected function _filterEntities(array $output) $this->_handleControllerClassName($entityName); } if (class_exists($entityName) || interface_exists($entityName)) { - array_push($filteredEntities, $entityName . '\\Interceptor'); + $filteredEntities[] = $entityName . '\\Interceptor'; } } return $filteredEntities; diff --git a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlScanner.php index 6a798f3226570..39d764cc32ce8 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlScanner.php @@ -72,7 +72,7 @@ protected function _filterEntities(array $output) } if (false === $isClassExists) { if (class_exists($entityName) || interface_exists($entityName)) { - array_push($filteredEntities, $className); + $filteredEntities[] = $className; } else { $this->_log->add( \Magento\Setup\Module\Di\Compiler\Log\Log::CONFIGURATION_ERROR, 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 c8ffd5ea47b02..3246a43c10189 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php @@ -60,6 +60,9 @@ public function testExecute(array $outdatedInfo, $expectedMessage) $this->assertStringMatchesFormat($expectedMessage, $tester->getDisplay()); } + /** + * @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 21fa10379a751..d51e3c40d1058 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->getMock('Symfony\Component\Console\Helper\QuestionHelper', [], [], '', false); diff --git a/setup/src/Magento/Setup/Test/Unit/Console/CompilerPreparationTest.php b/setup/src/Magento/Setup/Test/Unit/Console/CompilerPreparationTest.php index 979407662aaf1..69263497fd6c4 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/CompilerPreparationTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/CompilerPreparationTest.php @@ -74,6 +74,9 @@ public function testClearGenerationDirWhenNeeded($commandName, $isCompileCommand $this->model->handleCompilerEnvironment(); } + /** + * @return array + */ public function commandNameDataProvider() { return [ diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php index 0b2bd10fd0f50..7e8872def5da4 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsListTest.php @@ -169,6 +169,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 f1b27407af851..e766fd42cbcf8 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobComponentUninstallTest.php @@ -282,6 +282,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 00d53368e50de..3fe5836c086c9 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 a415378a32854..7919f773ebe0a 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/ReadinessCheckTest.php @@ -202,6 +202,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 0da08d41feb4e..d36cba0b80dcc 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 f603937c26570..c2a8886e79a7b 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 f9aa4a09fa9a8..3e6108e43b716 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 df34973e2c1fa..736a03cde9aa2 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 0c2c7b3d89717..3e1d65242d545 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 3033182d29623..ebf203f729145 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 755821ea0a557..dadc2bdcf51c9 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 mixed + */ 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 ee27ce7b449ee..59fcc6c7c97cf 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 5c2ad73de9da0..115578d1d108b 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php @@ -394,6 +394,10 @@ 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 e85b3fcaf88c9..0f10566d27459 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 df517f97ec89c..66a4d784170ad 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 2738e50b7eef9..696c4f5af7b12 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,12 @@ 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 72ea95f99778f..53b72614c3357 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 @@ -35,6 +35,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 7e43aa9076dd7..d2d6abe55ff98 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 88ff6c994e2d7..2492318d45bc1 100644 --- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php @@ -139,6 +139,9 @@ public function testCreateService($zfAppConfig, $env, $cliParam, $expectedArray) $this->assertEquals($expectedArray, $listener->createService($serviceLocator)); } + /** + * @return array + */ public function createServiceDataProvider() { return [