From a5b80faab8590ac064a904990319a6b21a8da744 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Mon, 30 Mar 2015 19:22:23 +0300 Subject: [PATCH 1/2] MAGETWO-35602: Failures in unit tests coverage builds - PersonalInfoTest::testGetCurrentStatus - added mock for interval because all data providers run before any test for suite --- .../Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php index a196a2917f994..29adf1a01cca1 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php @@ -165,6 +165,14 @@ public function testGetStoreLastLoginDateTimezone() */ public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastLogoutAt) { + $this->scopeConfig->expects($this->any()) + ->method('getValue') + ->with( + 'customer/online_customers/online_minutes_interval', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ) + ->willReturn(60); //TODO: it's value mocked because unit tests run data providers before all testsuite + $this->customerLog->expects($this->any())->method('getLastLoginAt')->willReturn($lastLoginAt); $this->customerLog->expects($this->any())->method('getLastVisitAt')->willReturn($lastVisitAt); $this->customerLog->expects($this->any())->method('getLastLogoutAt')->willReturn($lastLogoutAt); From a65a9dcaa7c82c56bdc930cc143c95101d6420b6 Mon Sep 17 00:00:00 2001 From: okarpenko Date: Fri, 3 Apr 2015 17:33:38 +0300 Subject: [PATCH 2/2] MAGETWO-35818: Incorrect order of static.js file on page --- .../RequireJs/Block/Html/Head/Config.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/RequireJs/Block/Html/Head/Config.php b/app/code/Magento/RequireJs/Block/Html/Head/Config.php index 2d5e1c3322b94..7bdba353abac2 100644 --- a/app/code/Magento/RequireJs/Block/Html/Head/Config.php +++ b/app/code/Magento/RequireJs/Block/Html/Head/Config.php @@ -58,15 +58,10 @@ public function __construct( */ protected function _prepareLayout() { + $after = RequireJsConfig::REQUIRE_JS_FILE_NAME; $requireJsConfig = $this->fileManager->createRequireJsConfigAsset(); $assetCollection = $this->pageConfig->getAssetCollection(); - $assetCollection->insert( - $requireJsConfig->getFilePath(), - $requireJsConfig, - RequireJsConfig::REQUIRE_JS_FILE_NAME - ); - if ($this->bundleConfig->isBundlingJsFiles()) { $bundleAssets = $this->fileManager->createBundleJsPool(); $staticAsset = $this->fileManager->createStaticJsAsset(); @@ -81,10 +76,21 @@ protected function _prepareLayout() RequireJsConfig::REQUIRE_JS_FILE_NAME ); } - $assetCollection->insert($staticAsset->getFilePath(), $staticAsset, RequireJsConfig::CONFIG_FILE_NAME); + $assetCollection->insert( + $staticAsset->getFilePath(), + $staticAsset, + reset($bundleAssets)->getFilePath() + ); + $after = $staticAsset->getFilePath(); } } + $assetCollection->insert( + $requireJsConfig->getFilePath(), + $requireJsConfig, + $after + ); + return parent::_prepareLayout(); }