diff --git a/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php b/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php
index 12bd773d35a2f..2dee31f4048b9 100644
--- a/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php
+++ b/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php
@@ -7,6 +7,8 @@
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
+use Magento\Framework\App\Request\InvalidRequestException;
+use Magento\Framework\App\RequestInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Signifyd\Api\CaseRepositoryInterface;
use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory;
@@ -21,7 +23,7 @@
*
* @see https://www.signifyd.com/docs/api/#/reference/webhooks/
*/
-class Handler extends Action
+class Handler extends Action implements \Magento\Framework\App\CsrfAwareActionInterface
{
/**
* Event topic of test webhook request.
@@ -136,4 +138,20 @@ public function execute()
$this->logger->critical($e);
}
}
+
+ /**
+ * @inheritDoc
+ */
+ public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException
+ {
+ return null;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function validateForCsrf(RequestInterface $request): ?bool
+ {
+ return true;
+ }
}
diff --git a/app/code/Magento/Signifyd/Test/Mftf/composer.json b/app/code/Magento/Signifyd/Test/Mftf/composer.json
deleted file mode 100644
index dc969cc4780ef..0000000000000
--- a/app/code/Magento/Signifyd/Test/Mftf/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "magento/functional-test-module-signifyd",
- "description": "Submitting Case Entry to Signifyd on Order Creation",
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-checkout": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-payment": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "php": "~7.1.3||~7.2.0"
- },
- "suggest": {
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "proprietary"
- ]
-}
diff --git a/app/code/Magento/Signifyd/composer.json b/app/code/Magento/Signifyd/composer.json
index c766ccd848ca4..992a74d0dc3ec 100644
--- a/app/code/Magento/Signifyd/composer.json
+++ b/app/code/Magento/Signifyd/composer.json
@@ -21,7 +21,8 @@
},
"type": "magento2-module",
"license": [
- "proprietary"
+ "OSL-3.0",
+ "AFL-3.0"
],
"autoload": {
"files": [
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Delete.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Delete.php
index 422fed9d9a688..29d50ea8408fd 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Delete.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Delete.php
@@ -65,20 +65,20 @@ public function execute()
}
$sitemap->delete();
// display success message
- $this->messageManager->addSuccess(__('You deleted the sitemap.'));
+ $this->messageManager->addSuccessMessage(__('You deleted the sitemap.'));
// go to grid
$this->_redirect('adminhtml/*/');
return;
} catch (\Exception $e) {
// display error message
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
// go back to edit form
$this->_redirect('adminhtml/*/edit', ['sitemap_id' => $id]);
return;
}
}
// display error message
- $this->messageManager->addError(__('We can\'t find a sitemap to delete.'));
+ $this->messageManager->addErrorMessage(__('We can\'t find a sitemap to delete.'));
// go to grid
$this->_redirect('adminhtml/*/');
}
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Edit.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Edit.php
index 04ab4f8725e0e..111353550b9cd 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Edit.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Edit.php
@@ -41,7 +41,7 @@ public function execute()
if ($id) {
$model->load($id);
if (!$model->getId()) {
- $this->messageManager->addError(__('This sitemap no longer exists.'));
+ $this->messageManager->addErrorMessage(__('This sitemap no longer exists.'));
$this->_redirect('adminhtml/*/');
return;
}
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php
index 67d2ce4f4f148..9592ab6f57c55 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php
@@ -6,8 +6,29 @@
*/
namespace Magento\Sitemap\Controller\Adminhtml\Sitemap;
+use Magento\Backend\App\Action;
+use Magento\Store\Model\App\Emulation;
+use Magento\Framework\App\ObjectManager;
+
class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
{
+ /** @var \Magento\Store\Model\App\Emulation $appEmulation */
+ private $appEmulation;
+
+ /**
+ * Generate constructor.
+ * @param Action\Context $context
+ * @param \Magento\Store\Model\App\Emulation|null $appEmulation
+ */
+ public function __construct(
+ Action\Context $context,
+ Emulation $appEmulation = null
+ ) {
+ parent::__construct($context);
+ $this->appEmulation = $appEmulation ?: ObjectManager::getInstance()
+ ->get(\Magento\Store\Model\App\Emulation::class);
+ }
+
/**
* Generate sitemap
*
@@ -23,18 +44,26 @@ public function execute()
// if sitemap record exists
if ($sitemap->getId()) {
try {
+ //We need to emulate to get the correct frontend URL for the product images
+ $this->appEmulation->startEnvironmentEmulation(
+ $sitemap->getStoreId(),
+ \Magento\Framework\App\Area::AREA_FRONTEND,
+ true
+ );
$sitemap->generateXml();
- $this->messageManager->addSuccess(
+ $this->messageManager->addSuccessMessage(
__('The sitemap "%1" has been generated.', $sitemap->getSitemapFilename())
);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
- $this->messageManager->addException($e, __('We can\'t generate the sitemap right now.'));
+ $this->messageManager->addExceptionMessage($e, __('We can\'t generate the sitemap right now.'));
+ } finally {
+ $this->appEmulation->stopEnvironmentEmulation();
}
} else {
- $this->messageManager->addError(__('We can\'t find a sitemap to generate.'));
+ $this->messageManager->addErrorMessage(__('We can\'t find a sitemap to generate.'));
}
// go to grid
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
index 5c38cc68e6ef7..1e0d1cb248f00 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
@@ -30,7 +30,7 @@ protected function validatePath(array $data)
$validator->setPaths($helper->getValidPaths());
if (!$validator->isValid($path)) {
foreach ($validator->getMessages() as $message) {
- $this->messageManager->addError($message);
+ $this->messageManager->addErrorMessage($message);
}
// save data in session
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData($data);
@@ -83,13 +83,13 @@ protected function saveData($data)
// save the data
$model->save();
// display success message
- $this->messageManager->addSuccess(__('You saved the sitemap.'));
+ $this->messageManager->addSuccessMessage(__('You saved the sitemap.'));
// clear previously saved data from session
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData(false);
return $model->getId();
} catch (\Exception $e) {
// display error message
- $this->messageManager->addError($e->getMessage());
+ $this->messageManager->addErrorMessage($e->getMessage());
// save data in session
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData($data);
}
diff --git a/app/code/Magento/Sitemap/Test/Mftf/composer.json b/app/code/Magento/Sitemap/Test/Mftf/composer.json
deleted file mode 100644
index 46ad680c9fb1e..0000000000000
--- a/app/code/Magento/Sitemap/Test/Mftf/composer.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "magento/functional-test-module-sitemap",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-catalog-url-rewrite": "100.0.0-dev",
- "magento/functional-test-module-cms": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-media-storage": "100.0.0-dev",
- "magento/functional-test-module-robots": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
index 36e3aa0312627..f77954101df7c 100644
--- a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
+++ b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
@@ -154,7 +154,7 @@ public function testTryToSaveInvalidDataShouldFailWithErrors()
->willReturnMap([[$helperClass, $helper], [$sessionClass, $session]]);
$this->messageManagerMock->expects($this->at(0))
- ->method('addError')
+ ->method('addErrorMessage')
->withConsecutive(
[$messages[0]],
[$messages[1]]
diff --git a/app/code/Magento/Store/App/Config/Type/Scopes.php b/app/code/Magento/Store/App/Config/Type/Scopes.php
index 9fbecc4db303e..e6b9d0000e4a6 100644
--- a/app/code/Magento/Store/App/Config/Type/Scopes.php
+++ b/app/code/Magento/Store/App/Config/Type/Scopes.php
@@ -114,5 +114,6 @@ private function convertIdPathToCodePath(array $patchChunks)
public function clean()
{
$this->data = null;
+ $this->idCodeMap = [];
}
}
diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php
index b18f2cfc22613..534c6be41c937 100644
--- a/app/code/Magento/Store/App/Response/Redirect.php
+++ b/app/code/Magento/Store/App/Response/Redirect.php
@@ -171,16 +171,6 @@ public function success($defaultUrl)
*/
public function updatePathParams(array $arguments)
{
- if ($this->_session->getCookieShouldBeReceived()
- && $this->_sidResolver->getUseSessionInUrl()
- && $this->_canUseSessionIdInParam
- ) {
- $arguments += [
- '_query' => [
- $this->_sidResolver->getSessionIdQueryParam($this->_session) => $this->_session->getSessionId(),
- ]
- ];
- }
return $arguments;
}
diff --git a/app/code/Magento/Store/Block/Switcher.php b/app/code/Magento/Store/Block/Switcher.php
index b0659b7caf7e8..58a7ba3c1c283 100644
--- a/app/code/Magento/Store/Block/Switcher.php
+++ b/app/code/Magento/Store/Block/Switcher.php
@@ -13,6 +13,9 @@
use Magento\Store\Api\StoreResolverInterface;
use Magento\Store\Model\Group;
use Magento\Store\Model\Store;
+use Magento\Framework\App\ActionInterface;
+use Magento\Framework\App\ObjectManager;
+use Magento\Framework\Url\Helper\Data as UrlHelper;
/**
* @api
@@ -30,20 +33,28 @@ class Switcher extends \Magento\Framework\View\Element\Template
*/
protected $_postDataHelper;
+ /**
+ * @var UrlHelper
+ */
+ private $urlHelper;
+
/**
* Constructs
*
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param array $data
+ * @param UrlHelper $urlHelper
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
- array $data = []
+ array $data = [],
+ UrlHelper $urlHelper = null
) {
$this->_postDataHelper = $postDataHelper;
parent::__construct($context, $data);
+ $this->urlHelper = $urlHelper ?: ObjectManager::getInstance()->get(UrlHelper::class);
}
/**
@@ -222,15 +233,20 @@ public function getStoreName()
* @param Store $store
* @param array $data
* @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getTargetStorePostData(Store $store, $data = [])
{
- $data[StoreResolverInterface::PARAM_NAME] = $store->getCode();
+ $data[\Magento\Store\Api\StoreResolverInterface::PARAM_NAME] = $store->getCode();
+ $data['___from_store'] = $this->_storeManager->getStore()->getCode();
+
+ $urlOnTargetStore = $store->getCurrentUrl(false);
+ $data[ActionInterface::PARAM_NAME_URL_ENCODED] = $this->urlHelper->getEncodedUrl($urlOnTargetStore);
+
+ $url = $this->getUrl('stores/store/redirect');
- //We need to set fromStore argument as true because
- //it will enable proper URL rewriting during store switching.
return $this->_postDataHelper->getPostData(
- $store->getCurrentUrl(true),
+ $url,
$data
);
}
diff --git a/app/code/Magento/Store/Controller/Store/Redirect.php b/app/code/Magento/Store/Controller/Store/Redirect.php
new file mode 100644
index 0000000000000..21692e9d6dd1e
--- /dev/null
+++ b/app/code/Magento/Store/Controller/Store/Redirect.php
@@ -0,0 +1,113 @@
+storeRepository = $storeRepository;
+ $this->storeResolver = $storeResolver;
+ $this->session = $session;
+ $this->sidResolver = $sidResolver;
+ }
+
+ /**
+ * @return ResponseInterface|\Magento\Framework\Controller\ResultInterface
+ * @throws NoSuchEntityException
+ */
+ public function execute()
+ {
+ /** @var \Magento\Store\Model\Store $currentStore */
+ $currentStore = $this->storeRepository->getById($this->storeResolver->getCurrentStoreId());
+ $targetStoreCode = $this->_request->getParam(StoreResolver::PARAM_NAME);
+ $fromStoreCode = $this->_request->getParam('___from_store');
+ $error = null;
+
+ if ($targetStoreCode === null) {
+ return $this->_redirect($currentStore->getBaseUrl());
+ }
+
+ try {
+ /** @var \Magento\Store\Model\Store $targetStore */
+ $fromStore = $this->storeRepository->get($fromStoreCode);
+ } catch (NoSuchEntityException $e) {
+ $error = __('Requested store is not found');
+ }
+
+ if ($error !== null) {
+ $this->messageManager->addErrorMessage($error);
+ $this->_redirect->redirect($this->_response, $currentStore->getBaseUrl());
+ } else {
+ $encodedUrl = $this->_request->getParam(\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED);
+
+ $query = [
+ '___from_store' => $fromStore->getCode(),
+ StoreResolverInterface::PARAM_NAME => $targetStoreCode,
+ \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl,
+ ];
+
+ if ($this->sidResolver->getUseSessionInUrl()) {
+ // allow customers to stay logged in during store switching
+ $sidName = $this->sidResolver->getSessionIdQueryParam($this->session);
+ $query[$sidName] = $this->session->getSessionId();
+ }
+
+ $arguments = [
+ '_nosid' => true,
+ '_query' => $query
+ ];
+ $this->_redirect->redirect($this->_response, 'stores/store/switch', $arguments);
+ }
+ }
+}
diff --git a/app/code/Magento/Store/Controller/Store/SwitchAction.php b/app/code/Magento/Store/Controller/Store/SwitchAction.php
index f2872a51db6f4..df946b45d60e5 100644
--- a/app/code/Magento/Store/Controller/Store/SwitchAction.php
+++ b/app/code/Magento/Store/Controller/Store/SwitchAction.php
@@ -10,16 +10,19 @@
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context as ActionContext;
use Magento\Framework\App\Http\Context as HttpContext;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Store\Api\StoreCookieManagerInterface;
use Magento\Store\Api\StoreRepositoryInterface;
-use Magento\Store\Model\Store;
use Magento\Store\Model\StoreIsInactiveException;
use Magento\Store\Model\StoreResolver;
use Magento\Store\Model\StoreManagerInterface;
+use Magento\Store\Model\StoreSwitcher;
+use Magento\Store\Model\StoreSwitcherInterface;
/**
- * Switch current store view.
+ * Handles store switching url and makes redirect.
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SwitchAction extends Action
{
@@ -30,6 +33,7 @@ class SwitchAction extends Action
/**
* @var HttpContext
+ * @deprecated
*/
protected $httpContext;
@@ -40,9 +44,15 @@ class SwitchAction extends Action
/**
* @var StoreManagerInterface
+ * @deprecated
*/
protected $storeManager;
+ /**
+ * @var StoreSwitcherInterface
+ */
+ private $storeSwitcher;
+
/**
* Initialize dependencies.
*
@@ -51,69 +61,55 @@ class SwitchAction extends Action
* @param HttpContext $httpContext
* @param StoreRepositoryInterface $storeRepository
* @param StoreManagerInterface $storeManager
+ * @param StoreSwitcherInterface $storeSwitcher
*/
public function __construct(
ActionContext $context,
StoreCookieManagerInterface $storeCookieManager,
HttpContext $httpContext,
StoreRepositoryInterface $storeRepository,
- StoreManagerInterface $storeManager
+ StoreManagerInterface $storeManager,
+ StoreSwitcherInterface $storeSwitcher = null
) {
parent::__construct($context);
$this->storeCookieManager = $storeCookieManager;
$this->httpContext = $httpContext;
$this->storeRepository = $storeRepository;
$this->storeManager = $storeManager;
+ $this->messageManager = $context->getMessageManager();
+ $this->storeSwitcher = $storeSwitcher ?: ObjectManager::getInstance()->get(StoreSwitcherInterface::class);
}
/**
* @return void
+ * @throws StoreSwitcher\CannotSwitchStoreException
*/
public function execute()
{
- $currentActiveStore = $this->storeManager->getStore();
- $storeCode = $this->_request->getParam(
+ $targetStoreCode = $this->_request->getParam(
StoreResolver::PARAM_NAME,
$this->storeCookieManager->getStoreCodeFromCookie()
);
+ $fromStoreCode = $this->_request->getParam('___from_store');
+ $requestedUrlToRedirect = $this->_redirect->getRedirectUrl();
+ $redirectUrl = $requestedUrlToRedirect;
+
+ $error = null;
try {
- $store = $this->storeRepository->getActiveStoreByCode($storeCode);
+ $fromStore = $this->storeRepository->get($fromStoreCode);
+ $targetStore = $this->storeRepository->getActiveStoreByCode($targetStoreCode);
} catch (StoreIsInactiveException $e) {
$error = __('Requested store is inactive');
} catch (NoSuchEntityException $e) {
$error = __("The store that was requested wasn't found. Verify the store and try again.");
}
-
- if (isset($error)) {
- $this->messageManager->addError($error);
- $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
- return;
- }
-
- $defaultStoreView = $this->storeManager->getDefaultStoreView();
- if ($defaultStoreView->getId() == $store->getId()) {
- $this->storeCookieManager->deleteStoreCookie($store);
+ if ($error !== null) {
+ $this->messageManager->addErrorMessage($error);
} else {
- $this->httpContext->setValue(Store::ENTITY, $store->getCode(), $defaultStoreView->getCode());
- $this->storeCookieManager->setStoreCookie($store);
+ $redirectUrl = $this->storeSwitcher->switch($fromStore, $targetStore, $requestedUrlToRedirect);
}
- if ($store->isUseStoreInUrl()) {
- // Change store code in redirect url
- if (strpos($this->_redirect->getRedirectUrl(), $currentActiveStore->getBaseUrl()) !== false) {
- $this->getResponse()->setRedirect(
- str_replace(
- $currentActiveStore->getBaseUrl(),
- $store->getBaseUrl(),
- $this->_redirect->getRedirectUrl()
- )
- );
- } else {
- $this->getResponse()->setRedirect($store->getBaseUrl());
- }
- } else {
- $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
- }
+ $this->getResponse()->setRedirect($redirectUrl);
}
}
diff --git a/app/code/Magento/Store/Model/Indexer/WebsiteDimensionProvider.php b/app/code/Magento/Store/Model/Indexer/WebsiteDimensionProvider.php
new file mode 100644
index 0000000000000..6fceeabc3597e
--- /dev/null
+++ b/app/code/Magento/Store/Model/Indexer/WebsiteDimensionProvider.php
@@ -0,0 +1,73 @@
+dimensionFactory = $dimensionFactory;
+ $this->collectionFactory = $collectionFactory;
+ }
+
+ /**
+ * @return Dimension[]|\Traversable
+ */
+ public function getIterator(): \Traversable
+ {
+ foreach ($this->getWebsites() as $website) {
+ yield $this->dimensionFactory->create(self::DIMENSION_NAME, (string)$website);
+ }
+ }
+
+ /**
+ * @return array
+ */
+ private function getWebsites(): array
+ {
+ if ($this->websitesDataIterator === null) {
+ $websites = $this->collectionFactory->create()
+ ->addFieldToFilter('code', ['neq' => Store::ADMIN_CODE])
+ ->getAllIds();
+ $this->websitesDataIterator = is_array($websites) ? $websites : [];
+ }
+
+ return $this->websitesDataIterator;
+ }
+}
diff --git a/app/code/Magento/Store/Model/Plugin/StoreCookie.php b/app/code/Magento/Store/Model/Plugin/StoreCookie.php
index 612d35e136d7e..9fca86ab71762 100644
--- a/app/code/Magento/Store/Model/Plugin/StoreCookie.php
+++ b/app/code/Magento/Store/Model/Plugin/StoreCookie.php
@@ -82,12 +82,5 @@ public function beforeDispatch(
$this->storeCookieManager->deleteStoreCookie($this->storeManager->getDefaultStoreView());
}
}
- if ($this->storeCookieManager->getStoreCodeFromCookie() === null
- || $request->getParam(StoreResolverInterface::PARAM_NAME) !== null
- ) {
- $storeId = $this->storeResolver->getCurrentStoreId();
- $store = $this->storeRepository->getActiveStoreById($storeId);
- $this->storeCookieManager->setStoreCookie($store);
- }
}
}
diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php
index 6e749df6a768d..af25957257421 100644
--- a/app/code/Magento/Store/Model/Store.php
+++ b/app/code/Magento/Store/Model/Store.php
@@ -1163,7 +1163,7 @@ public function isDefault()
/**
* Retrieve current url for store
*
- * @param bool|string $fromStore
+ * @param bool $fromStore
* @return string
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -1223,7 +1223,7 @@ public function getCurrentUrl($fromStore = true)
. (isset($storeParsedUrl['port']) ? ':' . $storeParsedUrl['port'] : '')
. $storeParsedUrl['path']
. $requestStringPath
- . ($currentUrlQueryParams ? '?' . http_build_query($currentUrlQueryParams, '', '&') : '');
+ . ($currentUrlQueryParams ? '?' . http_build_query($currentUrlQueryParams) : '');
return $currentUrl;
}
@@ -1379,7 +1379,8 @@ public function getExtensionAttributes()
}
/**
- * {@inheritdoc}
+ * @param \Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes
+ * @return $this
*/
public function setExtensionAttributes(
\Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes
diff --git a/app/code/Magento/Store/Model/StoreDimensionProvider.php b/app/code/Magento/Store/Model/StoreDimensionProvider.php
index 5bc019ea6835f..17f75fb863d9c 100644
--- a/app/code/Magento/Store/Model/StoreDimensionProvider.php
+++ b/app/code/Magento/Store/Model/StoreDimensionProvider.php
@@ -8,7 +8,7 @@
namespace Magento\Store\Model;
use Magento\Framework\Indexer\DimensionFactory;
-use Magento\Framework\Indexer\Dimension\DimensionProviderInterface;
+use Magento\Framework\Indexer\DimensionProviderInterface;
/**
* Provide a list of stores as Dimension
@@ -47,7 +47,7 @@ public function __construct(StoreManagerInterface $storeManager, DimensionFactor
public function getIterator(): \Traversable
{
foreach (array_keys($this->storeManager->getStores()) as $storeId) {
- yield [self::DIMENSION_NAME => $this->dimensionFactory->create(self::DIMENSION_NAME, $storeId)];
+ yield [self::DIMENSION_NAME => $this->dimensionFactory->create(self::DIMENSION_NAME, (string)$storeId)];
}
}
}
diff --git a/app/code/Magento/Store/Model/StoreSwitcher.php b/app/code/Magento/Store/Model/StoreSwitcher.php
new file mode 100644
index 0000000000000..a294b6a0d6b0a
--- /dev/null
+++ b/app/code/Magento/Store/Model/StoreSwitcher.php
@@ -0,0 +1,58 @@
+ $switcherInstance) {
+ if (!$switcherInstance instanceof StoreSwitcherInterface) {
+ throw new \InvalidArgumentException(
+ "Store switcher '{$switcherName}' is expected to implement interface "
+ . StoreSwitcherInterface::class
+ );
+ }
+ }
+ $this->storeSwitchers = $storeSwitchers;
+ }
+
+ /**
+ * @param StoreInterface $fromStore store where we came from
+ * @param StoreInterface $targetStore store where to go to
+ * @param string $redirectUrl original url requested for redirect after switching
+ * @return string url to be redirected after switching
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ * @throws CannotSwitchStoreException
+ */
+ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string
+ {
+ $targetUrl = $redirectUrl;
+
+ foreach ($this->storeSwitchers as $storeSwitcher) {
+ $targetUrl = $storeSwitcher->switch($fromStore, $targetStore, $targetUrl);
+ }
+
+ return $targetUrl;
+ }
+}
diff --git a/app/code/Magento/Store/Model/StoreSwitcher/CannotSwitchStoreException.php b/app/code/Magento/Store/Model/StoreSwitcher/CannotSwitchStoreException.php
new file mode 100644
index 0000000000000..c6afd71cb6f01
--- /dev/null
+++ b/app/code/Magento/Store/Model/StoreSwitcher/CannotSwitchStoreException.php
@@ -0,0 +1,27 @@
+urlHelper = $urlHelper;
+ $this->session = $session;
+ $this->sidResolver = $sidResolver;
+ }
+
+ /**
+ * @param StoreInterface $fromStore store where we came from
+ * @param StoreInterface $targetStore store where to go to
+ * @param string $redirectUrl original url requested for redirect after switching
+ * @return string redirect url
+ */
+ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string
+ {
+ $targetUrl = $redirectUrl;
+ $sidName = $this->sidResolver->getSessionIdQueryParam($this->session);
+ $targetUrl = $this->urlHelper->removeRequestParam($targetUrl, $sidName);
+ $targetUrl = $this->urlHelper->removeRequestParam($targetUrl, '___from_store');
+ $targetUrl = $this->urlHelper->removeRequestParam($targetUrl, StoreResolverInterface::PARAM_NAME);
+
+ return $targetUrl;
+ }
+}
diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php
new file mode 100644
index 0000000000000..8aed785641efe
--- /dev/null
+++ b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php
@@ -0,0 +1,66 @@
+cookieMetadataFactory = $cookieMetadataFactory;
+ $this->cookieManager = $cookieManager;
+ }
+
+ /**
+ * @param StoreInterface $fromStore store where we came from
+ * @param StoreInterface $targetStore store where to go to
+ * @param string $redirectUrl original url requested for redirect after switching
+ * @return string redirect url
+ * @throws CannotSwitchStoreException
+ */
+ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string
+ {
+ try {
+ $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
+ ->setDurationOneYear()
+ ->setPath('/')
+ ->setSecure(false)
+ ->setHttpOnly(false);
+ $this->cookieManager->setPublicCookie(
+ \Magento\Framework\App\PageCache\Version::COOKIE_NAME,
+ 'should_be_updated',
+ $publicCookieMetadata
+ );
+ } catch (\Exception $e) {
+ throw new CannotSwitchStoreException($e);
+ }
+
+ return $redirectUrl;
+ }
+}
diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManageStoreCookie.php b/app/code/Magento/Store/Model/StoreSwitcher/ManageStoreCookie.php
new file mode 100644
index 0000000000000..7a485be090af6
--- /dev/null
+++ b/app/code/Magento/Store/Model/StoreSwitcher/ManageStoreCookie.php
@@ -0,0 +1,72 @@
+storeCookieManager = $storeCookieManager;
+ $this->httpContext = $httpContext;
+ $this->storeManager = $storeManager;
+ }
+
+ /**
+ * @param StoreInterface $fromStore store where we came from
+ * @param StoreInterface $targetStore store where to go to
+ * @param string $redirectUrl original url requested for redirect after switching
+ * @return string redirect url
+ */
+ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string
+ {
+ $defaultStoreView = $this->storeManager->getDefaultStoreView();
+ if ($defaultStoreView !== null) {
+ if ($defaultStoreView->getId() === $targetStore->getId()) {
+ $this->storeCookieManager->deleteStoreCookie($targetStore);
+ } else {
+ $this->httpContext->setValue(Store::ENTITY, $targetStore->getCode(), $defaultStoreView->getCode());
+ $this->storeCookieManager->setStoreCookie($targetStore);
+ }
+ }
+
+ return $redirectUrl;
+ }
+}
diff --git a/app/code/Magento/Store/Model/StoreSwitcherInterface.php b/app/code/Magento/Store/Model/StoreSwitcherInterface.php
new file mode 100644
index 0000000000000..ee6fb0b4763c6
--- /dev/null
+++ b/app/code/Magento/Store/Model/StoreSwitcherInterface.php
@@ -0,0 +1,26 @@
+1
null
add
- group
+ store
customStoreGroup
@@ -27,7 +27,7 @@
1
null
add
- group
+ store
customStoreGroup
@@ -46,7 +46,7 @@
1
null
add
- group
+ store
customStoreGroup
diff --git a/app/code/Magento/Store/Test/Mftf/composer.json b/app/code/Magento/Store/Test/Mftf/composer.json
deleted file mode 100644
index 81305cf049e6c..0000000000000
--- a/app/code/Magento/Store/Test/Mftf/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "magento/functional-test-module-store",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-media-storage": "100.0.0-dev",
- "magento/functional-test-module-ui": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-deploy": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Store/Test/Unit/Block/SwitcherTest.php b/app/code/Magento/Store/Test/Unit/Block/SwitcherTest.php
index 8b4799d2b3437..aca3525a4400e 100644
--- a/app/code/Magento/Store/Test/Unit/Block/SwitcherTest.php
+++ b/app/code/Magento/Store/Test/Unit/Block/SwitcherTest.php
@@ -25,6 +25,12 @@ class SwitcherTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */
protected $urlBuilder;
+ /** @var \Magento\Store\Api\Data\StoreInterface|\PHPUnit_Framework_MockObject_MockObject */
+ private $store;
+
+ /**
+ * @return void
+ */
protected function setUp()
{
$this->storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)->getMock();
@@ -33,6 +39,9 @@ protected function setUp()
$this->context->expects($this->any())->method('getStoreManager')->will($this->returnValue($this->storeManager));
$this->context->expects($this->any())->method('getUrlBuilder')->will($this->returnValue($this->urlBuilder));
$this->corePostDataHelper = $this->createMock(\Magento\Framework\Data\Helper\PostHelper::class);
+ $this->store = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
+ ->disableOriginalConstructor()
+ ->getMockForAbstractClass();
$this->switcher = (new ObjectManager($this))->getObject(
\Magento\Store\Block\Switcher::class,
[
@@ -42,6 +51,9 @@ protected function setUp()
);
}
+ /**
+ * @return void
+ */
public function testGetTargetStorePostData()
{
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
@@ -50,20 +62,30 @@ public function testGetTargetStorePostData()
$store->expects($this->any())
->method('getCode')
->willReturn('new-store');
- $storeSwitchUrl = 'http://domain.com/stores/store/switch';
+ $storeSwitchUrl = 'http://domain.com/stores/store/redirect';
$store->expects($this->atLeastOnce())
->method('getCurrentUrl')
- ->with(true)
+ ->with(false)
+ ->willReturn($storeSwitchUrl);
+ $this->storeManager->expects($this->once())
+ ->method('getStore')
+ ->willReturn($this->store);
+ $this->store->expects($this->once())
+ ->method('getCode')
+ ->willReturn('old-store');
+ $this->urlBuilder->expects($this->once())
+ ->method('getUrl')
->willReturn($storeSwitchUrl);
$this->corePostDataHelper->expects($this->any())
->method('getPostData')
- ->with($storeSwitchUrl, ['___store' => 'new-store']);
+ ->with($storeSwitchUrl, ['___store' => 'new-store', 'uenc' => null, '___from_store' => 'old-store']);
$this->switcher->getTargetStorePostData($store);
}
/**
* @dataProvider isStoreInUrlDataProvider
+ * @param bool $isUseStoreInUrl
*/
public function testIsStoreInUrl($isUseStoreInUrl)
{
diff --git a/app/code/Magento/Store/Test/Unit/Controller/Store/SwitchActionTest.php b/app/code/Magento/Store/Test/Unit/Controller/Store/SwitchActionTest.php
index 1e7b2691a0084..0d337b91c192a 100644
--- a/app/code/Magento/Store/Test/Unit/Controller/Store/SwitchActionTest.php
+++ b/app/code/Magento/Store/Test/Unit/Controller/Store/SwitchActionTest.php
@@ -8,13 +8,15 @@
use Magento\Framework\App\Http\Context as HttpContext;
use Magento\Store\Api\StoreCookieManagerInterface;
use Magento\Store\Api\StoreRepositoryInterface;
-use Magento\Store\Model\Store;
-use Magento\Store\Model\StoreResolver;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
+use Magento\Store\Model\StoreResolver;
+use Magento\Store\Model\StoreSwitcher;
+use Magento\Store\Model\StoreSwitcherInterface;
/**
* Test class for \Magento\Store\Controller\Store\SwitchAction
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SwitchActionTest extends \PHPUnit\Framework\TestCase
{
@@ -58,6 +60,12 @@ class SwitchActionTest extends \PHPUnit\Framework\TestCase
*/
private $redirectMock;
+ /** @var StoreSwitcherInterface|\PHPUnit_Framework_MockObject_MockObject */
+ private $storeSwitcher;
+
+ /**
+ * @return void
+ */
protected function setUp()
{
$this->storeManagerMock = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)->getMock();
@@ -73,6 +81,10 @@ protected function setUp()
->getMockForAbstractClass();
$this->redirectMock =
$this->getMockBuilder(\Magento\Framework\App\Response\RedirectInterface::class)->getMock();
+ $this->storeSwitcher = $this->getMockBuilder(StoreSwitcher::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['switch'])
+ ->getMock();
$this->model = (new ObjectManager($this))->getObject(
\Magento\Store\Controller\Store\SwitchAction::class,
@@ -83,81 +95,48 @@ protected function setUp()
'storeManager' => $this->storeManagerMock,
'_request' => $this->requestMock,
'_response' => $this->responseMock,
- '_redirect' => $this->redirectMock
+ '_redirect' => $this->redirectMock,
+ 'storeSwitcher' => $this->storeSwitcher
]
);
}
- public function testExecuteSuccessWithoutUseStoreInUrl()
+ /**
+ * @return void
+ */
+ public function testExecute()
{
$storeToSwitchToCode = 'sv2';
$defaultStoreViewCode = 'default';
$expectedRedirectUrl = "magento.com/{$storeToSwitchToCode}";
- $currentActiveStoreMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)->getMock();
$defaultStoreViewMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)->getMock();
$storeToSwitchToMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
->disableOriginalConstructor()
->setMethods(['isUseStoreInUrl'])
->getMockForAbstractClass();
- $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($currentActiveStoreMock);
- $this->requestMock->expects($this->once())->method('getParam')->willReturn($storeToSwitchToCode);
+ $this->requestMock->expects($this->any())->method('getParam')->willReturnMap(
+ [
+ [StoreResolver::PARAM_NAME, null, $storeToSwitchToCode],
+ ['___from_store', null, $defaultStoreViewCode]
+ ]
+ );
$this->storeRepositoryMock
->expects($this->once())
- ->method('getActiveStoreByCode')
- ->willReturn($storeToSwitchToMock);
- $this->storeManagerMock
- ->expects($this->once())
- ->method('getDefaultStoreView')
+ ->method('get')
+ ->with($defaultStoreViewCode)
->willReturn($defaultStoreViewMock);
- $defaultStoreViewMock->expects($this->once())->method('getId')->willReturn($defaultStoreViewCode);
- $storeToSwitchToMock->expects($this->once())->method('getId')->willReturn($storeToSwitchToCode);
- $storeToSwitchToMock->expects($this->once())->method('isUseStoreInUrl')->willReturn(false);
- $this->redirectMock->expects($this->once())->method('getRedirectUrl')->willReturn($expectedRedirectUrl);
- $this->responseMock->expects($this->once())->method('setRedirect')->with($expectedRedirectUrl);
-
- $this->model->execute();
- }
-
- public function testExecuteSuccessWithUseStoreInUrl()
- {
- $currentActiveStoreCode = 'sv1';
- $storeToSwitchToCode = 'sv2';
- $defaultStoreViewCode = 'default';
- $originalRedirectUrl = "magento.com/{$currentActiveStoreCode}/test-page/test-sub-page";
- $expectedRedirectUrl = "magento.com/{$storeToSwitchToCode}/test-page/test-sub-page";
- $currentActiveStoreMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
- ->disableOriginalConstructor()
- ->setMethods(['isUseStoreInUrl', 'getBaseUrl'])
- ->getMockForAbstractClass();
- $defaultStoreViewMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)->getMock();
- $storeToSwitchToMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
- ->disableOriginalConstructor()
- ->setMethods(['isUseStoreInUrl', 'getBaseUrl'])
- ->getMockForAbstractClass();
-
- $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($currentActiveStoreMock);
- $this->requestMock->expects($this->once())->method('getParam')->willReturn($storeToSwitchToCode);
$this->storeRepositoryMock
->expects($this->once())
->method('getActiveStoreByCode')
+ ->with($storeToSwitchToCode)
->willReturn($storeToSwitchToMock);
- $this->storeManagerMock
- ->expects($this->once())
- ->method('getDefaultStoreView')
- ->willReturn($defaultStoreViewMock);
- $defaultStoreViewMock->expects($this->once())->method('getId')->willReturn($defaultStoreViewCode);
- $storeToSwitchToMock->expects($this->once())->method('getId')->willReturn($storeToSwitchToCode);
- $storeToSwitchToMock->expects($this->once())->method('isUseStoreInUrl')->willReturn(true);
- $this->redirectMock->expects($this->any())->method('getRedirectUrl')->willReturn($originalRedirectUrl);
- $currentActiveStoreMock
- ->expects($this->any())
- ->method('getBaseUrl')
- ->willReturn("magento.com/{$currentActiveStoreCode}");
- $storeToSwitchToMock
- ->expects($this->once())
- ->method('getBaseUrl')
- ->willReturn("magento.com/{$storeToSwitchToCode}");
+ $this->storeSwitcher->expects($this->once())
+ ->method('switch')
+ ->with($defaultStoreViewMock, $storeToSwitchToMock, $expectedRedirectUrl)
+ ->willReturn($expectedRedirectUrl);
+
+ $this->redirectMock->expects($this->once())->method('getRedirectUrl')->willReturn($expectedRedirectUrl);
$this->responseMock->expects($this->once())->method('setRedirect')->with($expectedRedirectUrl);
$this->model->execute();
diff --git a/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php b/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php
index e56b5c7fcaa19..0454c0096a6ab 100644
--- a/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php
@@ -110,6 +110,9 @@ protected function setUp()
);
}
+ /**
+ * @return void
+ */
public function testBeforeDispatchNoSuchEntity()
{
$storeCode = 'store';
@@ -125,14 +128,13 @@ public function testBeforeDispatchNoSuchEntity()
$this->storeCookieManagerMock->expects($this->once())
->method('deleteStoreCookie')
->with($this->storeMock);
- $this->requestMock->expects($this->atLeastOnce())
- ->method('getParam')
- ->with(StoreResolverInterface::PARAM_NAME)
- ->willReturn(null);
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
+ /**
+ * @return void
+ */
public function testBeforeDispatchStoreIsInactive()
{
$storeCode = 'store';
@@ -148,14 +150,13 @@ public function testBeforeDispatchStoreIsInactive()
$this->storeCookieManagerMock->expects($this->once())
->method('deleteStoreCookie')
->with($this->storeMock);
- $this->requestMock->expects($this->atLeastOnce())
- ->method('getParam')
- ->with(StoreResolverInterface::PARAM_NAME)
- ->willReturn(null);
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
+ /**
+ * @return void
+ */
public function testBeforeDispatchInvalidArgument()
{
$storeCode = 'store';
@@ -171,14 +172,13 @@ public function testBeforeDispatchInvalidArgument()
$this->storeCookieManagerMock->expects($this->once())
->method('deleteStoreCookie')
->with($this->storeMock);
- $this->requestMock->expects($this->atLeastOnce())
- ->method('getParam')
- ->with(StoreResolverInterface::PARAM_NAME)
- ->willReturn(null);
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
+ /**
+ * @return void
+ */
public function testBeforeDispatchNoStoreCookie()
{
$storeCode = null;
@@ -194,21 +194,12 @@ public function testBeforeDispatchNoStoreCookie()
->method('deleteStoreCookie')
->with($this->storeMock);
- $this->storeResolverMock->expects($this->atLeastOnce())
- ->method('getCurrentStoreId')
- ->willReturn(1);
-
- $this->storeRepositoryMock->expects($this->atLeastOnce())
- ->method('getActiveStoreById')
- ->willReturn($this->storeMock);
-
- $this->storeCookieManagerMock->expects($this->atLeastOnce())
- ->method('setStoreCookie')
- ->with($this->storeMock);
-
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
+ /**
+ * @return void
+ */
public function testBeforeDispatchWithStoreRequestParam()
{
$storeCode = 'store';
@@ -222,23 +213,6 @@ public function testBeforeDispatchWithStoreRequestParam()
->method('deleteStoreCookie')
->with($this->storeMock);
- $this->requestMock->expects($this->atLeastOnce())
- ->method('getParam')
- ->with(StoreResolverInterface::PARAM_NAME)
- ->willReturn($storeCode);
-
- $this->storeResolverMock->expects($this->atLeastOnce())
- ->method('getCurrentStoreId')
- ->willReturn(1);
-
- $this->storeRepositoryMock->expects($this->atLeastOnce())
- ->method('getActiveStoreById')
- ->willReturn($this->storeMock);
-
- $this->storeCookieManagerMock->expects($this->atLeastOnce())
- ->method('setStoreCookie')
- ->with($this->storeMock);
-
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
}
}
diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
index 4cbf78d0d6471..f98cf5d892e07 100644
--- a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
+++ b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php
@@ -43,6 +43,9 @@ class StoreTest extends \PHPUnit\Framework\TestCase
*/
private $urlModifierMock;
+ /**
+ * @return void
+ */
protected function setUp()
{
$this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -105,6 +108,9 @@ public function loadDataProvider()
];
}
+ /**
+ * @return void
+ */
public function testSetWebsite()
{
$website = $this->createPartialMock(\Magento\Store\Model\Website::class, ['getId', '__wakeup']);
@@ -115,6 +121,9 @@ public function testSetWebsite()
$this->assertEquals(2, $model->getWebsiteId());
}
+ /**
+ * @return void
+ */
public function testGetWebsite()
{
$websiteId = 2;
@@ -138,6 +147,9 @@ public function testGetWebsite()
$this->assertEquals($website, $model->getWebsite());
}
+ /**
+ * @return void
+ */
public function testGetWebsiteIfWebsiteIsNotExist()
{
$websiteRepository = $this->getMockBuilder(\Magento\Store\Api\WebsiteRepositoryInterface::class)
@@ -156,6 +168,9 @@ public function testGetWebsiteIfWebsiteIsNotExist()
$this->assertFalse($model->getWebsite());
}
+ /**
+ * @return void
+ */
public function testGetGroup()
{
$groupId = 2;
@@ -179,6 +194,9 @@ public function testGetGroup()
$this->assertEquals($group, $model->getGroup());
}
+ /**
+ * @return void
+ */
public function testGetGroupIfGroupIsNotExist()
{
$groupRepository = $this->getMockBuilder(\Magento\Store\Api\GroupRepositoryInterface::class)
@@ -197,6 +215,9 @@ public function testGetGroupIfGroupIsNotExist()
$this->assertFalse($model->getGroup());
}
+ /**
+ * @return void
+ */
public function testGetUrl()
{
$params = ['_scope_to_url' => true];
@@ -325,6 +346,9 @@ public function getBaseUrlDataProvider()
];
}
+ /**
+ * @return void
+ */
public function testGetBaseUrlEntryPoint()
{
$expectedPath = 'web/unsecure/base_link_url';
@@ -377,10 +401,11 @@ public function testGetBaseUrlWrongType()
* @param boolean $secure
* @param string $url
* @param string $expected
+ * @param bool|string $fromStore
*/
- public function testGetCurrentUrl($secure, $url, $expected)
+ public function testGetCurrentUrl($secure, $url, $expected, $fromStore)
{
- $defaultStore = $this->createPartialMock(\Magento\Store\Model\Store::class, [
+ $defaultStore = $this->createPartialMock(Store::class, [
'getId',
'isCurrentlySecure',
'__wakeup'
@@ -393,15 +418,31 @@ public function testGetCurrentUrl($secure, $url, $expected)
$config = $this->getMockForAbstractClass(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
- $this->requestMock->expects($this->atLeastOnce())->method('getRequestString')->will($this->returnValue(''));
+ $requestString = preg_replace(
+ '/http(s?)\:\/\/[a-z0-9\-]+\//i',
+ '',
+ $url
+ );
+ $this->requestMock
+ ->expects($this->atLeastOnce())
+ ->method('getRequestString')
+ ->willReturn($requestString);
$this->requestMock->expects($this->atLeastOnce())->method('getQueryValue')->will($this->returnValue([
'SID' => 'sid'
]));
$urlMock = $this->getMockForAbstractClass(\Magento\Framework\UrlInterface::class);
- $urlMock->expects($this->atLeastOnce())->method('setScope')->will($this->returnSelf());
- $urlMock->expects($this->any())->method('getUrl')
- ->will($this->returnValue($url));
+ $urlMock
+ ->expects($this->atLeastOnce())
+ ->method('setScope')
+ ->will($this->returnSelf());
+ $urlMock->expects($this->any())
+ ->method('getUrl')
+ ->will($this->returnValue(str_replace($requestString, '', $url)));
+ $urlMock
+ ->expects($this->atLeastOnce())
+ ->method('escape')
+ ->willReturnArgument(0);
$storeManager = $this->getMockForAbstractClass(\Magento\Store\Model\StoreManagerInterface::class);
$storeManager->expects($this->any())
@@ -416,7 +457,7 @@ public function testGetCurrentUrl($secure, $url, $expected)
$model->setStoreId(2);
$model->setCode('scope_code');
- $this->assertEquals($expected, $model->getCurrentUrl(false));
+ $this->assertEquals($expected, $model->getCurrentUrl($fromStore));
}
/**
@@ -425,9 +466,31 @@ public function testGetCurrentUrl($secure, $url, $expected)
public function getCurrentUrlDataProvider()
{
return [
- [true, 'http://test/url', 'http://test/url?SID=sid&___store=scope_code'],
- [true, 'http://test/url?SID=sid1&___store=scope', 'http://test/url?SID=sid&___store=scope_code'],
- [false, 'https://test/url', 'https://test/url?SID=sid&___store=scope_code']
+ [
+ true,
+ 'http://test/url',
+ 'http://test/url?SID=sid&___store=scope_code',
+ false
+ ],
+ [
+ true,
+ 'http://test/url?SID=sid1&___store=scope',
+ 'http://test/url?SID=sid&___store=scope_code',
+ false
+ ],
+ [
+ false,
+ 'https://test/url',
+ 'https://test/url?SID=sid&___store=scope_code',
+ false
+ ],
+ [
+ true,
+ 'http://test/u/u.2?___store=scope_code',
+ 'http://test/u/u.2?'
+ . '___store=scope_code&SID=sid&___from_store=old-store',
+ 'old-store'
+ ]
];
}
@@ -487,6 +550,9 @@ public function getBaseCurrencyDataProvider()
];
}
+ /**
+ * @return void
+ */
public function testGetAllowedCurrencies()
{
$currencyPath = 'cur/ren/cy/path';
@@ -612,11 +678,17 @@ public function testGetBaseStaticDir()
$this->assertEquals($expectedResult, $this->store->getBaseStaticDir());
}
+ /**
+ * @return void
+ */
public function testGetScopeType()
{
$this->assertEquals(ScopeInterface::SCOPE_STORE, $this->store->getScopeType());
}
+ /**
+ * @return void
+ */
public function testGetScopeTypeName()
{
$this->assertEquals('Store View', $this->store->getScopeTypeName());
diff --git a/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php b/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
index ed9ac7ebe438a..f31acd40a2e69 100644
--- a/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
+++ b/app/code/Magento/Store/Test/Unit/Url/Plugin/RouteParamsResolverTest.php
@@ -22,6 +22,11 @@ class RouteParamsResolverTest extends \PHPUnit\Framework\TestCase
*/
protected $queryParamsResolverMock;
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Store
+ */
+ protected $storeMock;
+
/**
* @var \Magento\Store\Url\Plugin\RouteParamsResolver
*/
@@ -30,7 +35,19 @@ class RouteParamsResolverTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
$this->scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
+
+ $this->storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
+ ->setMethods(['getCode'])
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->storeMock->expects($this->any())->method('getCode')->willReturn('custom_store');
+
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
+ $this->storeManagerMock
+ ->expects($this->once())
+ ->method('getStore')
+ ->willReturn($this->storeMock);
+
$this->queryParamsResolverMock = $this->createMock(\Magento\Framework\Url\QueryParamsResolverInterface::class);
$this->model = new \Magento\Store\Url\Plugin\RouteParamsResolver(
$this->scopeConfigMock,
@@ -42,6 +59,8 @@ protected function setUp()
public function testBeforeSetRouteParamsScopeInParams()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -52,7 +71,7 @@ public function testBeforeSetRouteParamsScopeInParams()
)
->will($this->returnValue(false));
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -61,7 +80,7 @@ public function testBeforeSetRouteParamsScopeInParams()
$routeParamsResolverMock->expects($this->once())->method('setScope')->with($storeCode);
$routeParamsResolverMock->expects($this->once())->method('getScope')->willReturn($storeCode);
- $this->queryParamsResolverMock->expects($this->once())->method('setQueryParam')->with('___store', $storeCode);
+ $this->queryParamsResolverMock->expects($this->never())->method('setQueryParam');
$this->model->beforeSetRouteParams(
$routeParamsResolverMock,
@@ -72,6 +91,8 @@ public function testBeforeSetRouteParamsScopeInParams()
public function testBeforeSetRouteParamsScopeUseStoreInUrl()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -81,8 +102,9 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
$storeCode
)
->will($this->returnValue(true));
+
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -91,7 +113,7 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
$routeParamsResolverMock->expects($this->once())->method('setScope')->with($storeCode);
$routeParamsResolverMock->expects($this->once())->method('getScope')->willReturn($storeCode);
- $this->queryParamsResolverMock->expects($this->never())->method('setQueryParam');
+ $this->queryParamsResolverMock->expects($this->once())->method('setQueryParam')->with('___store', $storeCode);
$this->model->beforeSetRouteParams(
$routeParamsResolverMock,
@@ -102,6 +124,8 @@ public function testBeforeSetRouteParamsScopeUseStoreInUrl()
public function testBeforeSetRouteParamsSingleStore()
{
$storeCode = 'custom_store';
+ $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -112,7 +136,7 @@ public function testBeforeSetRouteParamsSingleStore()
)
->will($this->returnValue(false));
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(true);
- $data = ['_scope' => $storeCode, '_scope_to_url' => true];
+
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
@@ -132,6 +156,8 @@ public function testBeforeSetRouteParamsSingleStore()
public function testBeforeSetRouteParamsNoScopeInParams()
{
$storeCode = 'custom_store';
+ $data = ['_scope_to_url' => true];
+
$this->scopeConfigMock
->expects($this->once())
->method('getValue')
@@ -140,17 +166,10 @@ public function testBeforeSetRouteParamsNoScopeInParams()
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeCode
)
- ->will($this->returnValue(false));
+ ->will($this->returnValue(true));
+
$this->storeManagerMock->expects($this->any())->method('hasSingleStore')->willReturn(false);
- /** @var \PHPUnit_Framework_MockObject_MockObject| $routeParamsResolverMock */
- $storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
- ->setMethods(['getCode'])
- ->disableOriginalConstructor()
- ->getMock();
- $storeMock->expects($this->any())->method('getCode')->willReturn($storeCode);
- $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock);
- $data = ['_scope_to_url' => true];
/** @var \PHPUnit_Framework_MockObject_MockObject $routeParamsResolverMock */
$routeParamsResolverMock = $this->getMockBuilder(\Magento\Framework\Url\RouteParamsResolver::class)
->setMethods(['setScope', 'getScope'])
diff --git a/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php b/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
index c4f8a31430963..468352af78cbc 100644
--- a/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
+++ b/app/code/Magento/Store/Url/Plugin/RouteParamsResolver.php
@@ -6,6 +6,7 @@
namespace Magento\Store\Url\Plugin;
use \Magento\Store\Model\Store;
+use \Magento\Store\Api\Data\StoreInterface;
use \Magento\Store\Model\ScopeInterface as StoreScopeInterface;
/**
@@ -51,6 +52,8 @@ public function __construct(
* @param \Magento\Framework\Url\RouteParamsResolver $subject
* @param array $data
* @param bool $unsetOldParams
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ *
* @return array
*/
public function beforeSetRouteParams(
@@ -63,13 +66,19 @@ public function beforeSetRouteParams(
unset($data['_scope']);
}
if (isset($data['_scope_to_url']) && (bool)$data['_scope_to_url'] === true) {
- $storeCode = $subject->getScope() ?: $this->storeManager->getStore()->getCode();
+ /** @var StoreInterface $currentScope */
+ $currentScope = $subject->getScope();
+ $storeCode = $currentScope && $currentScope instanceof StoreInterface ?
+ $currentScope->getCode() :
+ $this->storeManager->getStore()->getCode();
+
$useStoreInUrl = $this->scopeConfig->getValue(
Store::XML_PATH_STORE_IN_URL,
StoreScopeInterface::SCOPE_STORE,
$storeCode
);
- if (!$useStoreInUrl && !$this->storeManager->hasSingleStore()) {
+
+ if ($useStoreInUrl && !$this->storeManager->hasSingleStore()) {
$this->queryParamsResolver->setQueryParam('___store', $storeCode);
}
}
diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml
index 27133de270e2f..5f088558b41d9 100644
--- a/app/code/Magento/Store/etc/di.xml
+++ b/app/code/Magento/Store/etc/di.xml
@@ -25,6 +25,14 @@
+
+
+
+
+ - 0
+
+
+
@@ -417,4 +425,13 @@
+
+
+
+ - Magento\Store\Model\StoreSwitcher\CleanTargetUrl
+ - Magento\Store\Model\StoreSwitcher\ManageStoreCookie
+ - Magento\Store\Model\StoreSwitcher\ManagePrivateContent
+
+
+
diff --git a/app/code/Magento/StoreGraphQl/Test/Mftf/composer.json b/app/code/Magento/StoreGraphQl/Test/Mftf/composer.json
deleted file mode 100644
index 10407d0dc179c..0000000000000
--- a/app/code/Magento/StoreGraphQl/Test/Mftf/composer.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "magento/functional-test-module-store-graph-ql",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0"
- },
- "suggest": {
- "magento/functional-test-module-graph-ql": "100.0.0-dev",
- "magento/functional-test-module-catalog-graph-ql": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Swagger/Test/Mftf/composer.json b/app/code/Magento/Swagger/Test/Mftf/composer.json
deleted file mode 100644
index a997257192fce..0000000000000
--- a/app/code/Magento/Swagger/Test/Mftf/composer.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "magento/functional-test-module-swagger",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/SwaggerWebapi/Test/Mftf/composer.json b/app/code/Magento/SwaggerWebapi/Test/Mftf/composer.json
deleted file mode 100644
index 22ed346ef2081..0000000000000
--- a/app/code/Magento/SwaggerWebapi/Test/Mftf/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "magento/functional-test-module-swagger-webapi",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-swagger": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/SwaggerWebapiAsync/Test/Mftf/composer.json b/app/code/Magento/SwaggerWebapiAsync/Test/Mftf/composer.json
deleted file mode 100644
index fe20e7a539d03..0000000000000
--- a/app/code/Magento/SwaggerWebapiAsync/Test/Mftf/composer.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "magento/functional-test-module-swagger-webapi-async",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-swagger": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "proprietary"
- ]
-}
diff --git a/app/code/Magento/SwaggerWebapiAsync/composer.json b/app/code/Magento/SwaggerWebapiAsync/composer.json
index 5ca538636b38a..3735bcd0ee458 100644
--- a/app/code/Magento/SwaggerWebapiAsync/composer.json
+++ b/app/code/Magento/SwaggerWebapiAsync/composer.json
@@ -14,7 +14,8 @@
},
"type": "magento2-module",
"license": [
- "proprietary"
+ "OSL-3.0",
+ "AFL-3.0"
],
"autoload": {
"files": [
diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml
new file mode 100644
index 0000000000000..f8cfa3071ce0f
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$grabStyle1}
+ {{expectedStyle}}
+
+
+
+
+
+
+
+
+
+ {$grabStyle1}
+ background: center center no-repeat {{expectedRgb}};
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Swatches/Test/Mftf/Section/AdminColorPickerSection.xml b/app/code/Magento/Swatches/Test/Mftf/Section/AdminColorPickerSection.xml
new file mode 100644
index 0000000000000..772b724b6648d
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/Section/AdminColorPickerSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Section/AdminManageSwatchSection.xml b/app/code/Magento/Swatches/Test/Mftf/Section/AdminManageSwatchSection.xml
new file mode 100644
index 0000000000000..39db9f92837e3
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/Section/AdminManageSwatchSection.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
index 4da84f92e20ed..68c1d29258727 100644
--- a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
@@ -10,6 +10,9 @@
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml
new file mode 100644
index 0000000000000..0c26c6a8174af
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Something red.
+ {$grabRedLabel}
+
+
+
+
+ Something green.
+ {$grabGreenLabel}
+
+
+
+
+ Something blue.
+ {$grabBlueLabel}
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml
new file mode 100644
index 0000000000000..67750ac931f0b
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml
index cfd220d12b1d7..cc6699e989101 100644
--- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/composer.json b/app/code/Magento/Swatches/Test/Mftf/composer.json
deleted file mode 100644
index 76c8037995754..0000000000000
--- a/app/code/Magento/Swatches/Test/Mftf/composer.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "magento/functional-test-module-swatches",
- "description": "Add Swatches to Products",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-configurable-product": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-media-storage": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-theme": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-layered-navigation": "100.0.0-dev",
- "magento/functional-test-module-swatches-sample-data": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "proprietary"
- ]
-}
diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json
index 71f9fc8f80baa..0940003b6a72d 100644
--- a/app/code/Magento/Swatches/composer.json
+++ b/app/code/Magento/Swatches/composer.json
@@ -23,7 +23,8 @@
},
"type": "magento2-module",
"license": [
- "proprietary"
+ "OSL-3.0",
+ "AFL-3.0"
],
"autoload": {
"files": [
diff --git a/app/code/Magento/SwatchesGraphQl/Test/Mftf/composer.json b/app/code/Magento/SwatchesGraphQl/Test/Mftf/composer.json
deleted file mode 100644
index 7a62d9bd33ab9..0000000000000
--- a/app/code/Magento/SwatchesGraphQl/Test/Mftf/composer.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "magento/functional-test-module-swatches-graph-ql",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-swatches": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-catalog-graph-ql": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/SwatchesLayeredNavigation/Test/Mftf/composer.json b/app/code/Magento/SwatchesLayeredNavigation/Test/Mftf/composer.json
deleted file mode 100644
index e37d2bfda247d..0000000000000
--- a/app/code/Magento/SwatchesLayeredNavigation/Test/Mftf/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "magento/functional-test-module-swatches-layered-navigation",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/magento-composer-installer": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php
index afcfa1bbebcb0..bad64260cf58a 100644
--- a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php
+++ b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php
@@ -10,7 +10,7 @@
abstract class AbstractAggregateCalculator extends AbstractCalculator
{
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $quantity, $round = true)
{
@@ -86,7 +86,7 @@ protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $qua
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $quantity, $round = true)
{
@@ -149,6 +149,7 @@ protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $
$rowTaxBeforeDiscount = array_sum($rowTaxesBeforeDiscount);
$rowTotalInclTax = $rowTotal + $rowTaxBeforeDiscount;
$priceInclTax = $rowTotalInclTax / $quantity;
+
if ($round) {
$priceInclTax = $this->calculationTool->round($priceInclTax);
}
diff --git a/app/code/Magento/Tax/Model/Plugin/OrderSave.php b/app/code/Magento/Tax/Model/Plugin/OrderSave.php
index a1a3ebf861d60..38952eec02ca1 100644
--- a/app/code/Magento/Tax/Model/Plugin/OrderSave.php
+++ b/app/code/Magento/Tax/Model/Plugin/OrderSave.php
@@ -7,6 +7,8 @@
namespace Magento\Tax\Model\Plugin;
+use Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxExtension;
+
class OrderSave
{
/**
@@ -79,8 +81,9 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
foreach ($taxesForItems as $taxesArray) {
foreach ($taxesArray['applied_taxes'] as $rates) {
if (isset($rates['extension_attributes'])) {
- /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */
- $taxRates = $rates['extension_attributes']->getRates();
+ $taxRates = $rates['extension_attributes'] instanceof OrderTaxDetailsAppliedTaxExtension
+ ? $rates['extension_attributes']->getRates()
+ : $rates['extension_attributes']['rates'];
if (is_array($taxRates)) {
if (count($taxRates) == 1) {
$ratesIdQuoteItemId[$rates['id']][] = [
@@ -124,8 +127,9 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
foreach ($taxes as $row) {
$id = $row['id'];
if (isset($row['extension_attributes'])) {
- /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */
- $taxRates = $row['extension_attributes']->getRates();
+ $taxRates = $row['extension_attributes'] instanceof OrderTaxDetailsAppliedTaxExtension
+ ? $row['extension_attributes']->getRates()
+ : $row['extension_attributes']['rates'];
if (is_array($taxRates)) {
foreach ($taxRates as $tax) {
if ($row['percent'] == null) {
diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml
index c54c525d8d7ed..af33b6b4ad539 100644
--- a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml
+++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml
@@ -50,5 +50,6 @@
+
diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml
index 752585830638f..c0b32e4bc71e7 100644
--- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml
+++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml
@@ -248,8 +248,9 @@
-
-
+
+
+
@@ -356,8 +357,9 @@
-
-
+
+
+
diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml
index f051d4f8c3b82..3e85ecc783253 100644
--- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml
+++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml
@@ -313,7 +313,7 @@
-
+
@@ -329,7 +329,7 @@
-
+
diff --git a/app/code/Magento/Tax/Test/Mftf/composer.json b/app/code/Magento/Tax/Test/Mftf/composer.json
deleted file mode 100644
index e2d9db9f8f76e..0000000000000
--- a/app/code/Magento/Tax/Test/Mftf/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "magento/functional-test-module-tax",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-checkout": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-page-cache": "100.0.0-dev",
- "magento/functional-test-module-quote": "100.0.0-dev",
- "magento/functional-test-module-reports": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-shipping": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-tax-sample-data": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
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 82a473b42a82e..17246df8c5b45 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php
@@ -222,93 +222,6 @@ public function testAfterSave(
*/
public function afterSaveDataProvider()
{
- $orderTaxDetailsApplied = $this->getMockBuilder(\Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface::class)
- ->disableOriginalConstructor()
- ->setMethods(['getRates'])
- ->getMockForAbstractClass();
-
- $orderTaxDetailsApplied->expects($this->at(0))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 6,
- 'code' => 'IL',
- 'title' => 'IL',
- ],
- [
- 'percent' => 5,
- 'code' => 'US',
- 'title' => 'US',
- ]
- ]
- );
- $orderTaxDetailsApplied->expects($this->at(1))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 3,
- 'code' => 'CityTax',
- 'title' => 'CityTax',
- ],
- ]
- );
- $orderTaxDetailsApplied->expects($this->at(2))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 6,
- 'code' => 'IL',
- 'title' => 'IL',
- ],
- [
- 'percent' => 5,
- 'code' => 'US',
- 'title' => 'US',
- ],
- ]
- );
- $orderTaxDetailsApplied->expects($this->at(3))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 3,
- 'code' => 'CityTax',
- 'title' => 'CityTax',
- ],
- ]
- );
- $orderTaxDetailsApplied->expects($this->at(4))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 6,
- 'code' => 'IL',
- 'title' => 'IL',
- ],
- [
- 'percent' => 5,
- 'code' => 'US',
- 'title' => 'US',
- ],
- ]
- );
- $orderTaxDetailsApplied->expects($this->at(5))
- ->method('getRates')
- ->willReturn(
- [
- [
- 'percent' => 3,
- 'code' => 'CityTax',
- 'title' => 'CityTax',
- ],
- ]
- );
-
return [
//one item with shipping
//three tax rates: state and national tax rates of 6 and 5 percent with priority 0
@@ -320,14 +233,35 @@ public function afterSaveDataProvider()
'base_amount' => 0.66,
'percent' => 11,
'id' => 'ILUS',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 6,
+ 'code' => 'IL',
+ 'title' => 'IL',
+ ],
+ [
+ 'percent' => 5,
+ 'code' => 'US',
+ 'title' => 'US',
+ ],
+ ]
+ ],
],
[
'amount' => 0.2,
'base_amount' => 0.2,
'percent' => 3.33,
'id' => 'CityTax',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 3,
+ 'code' => 'CityTax',
+ 'title' => 'CityTax',
+ ],
+ ]
+ ],
],
],
'item_applied_taxes' => [
@@ -343,7 +277,20 @@ public function afterSaveDataProvider()
'base_amount' => 0.11,
'percent' => 11,
'id' => 'ILUS',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 6,
+ 'code' => 'IL',
+ 'title' => 'IL',
+ ],
+ [
+ 'percent' => 5,
+ 'code' => 'US',
+ 'title' => 'US',
+ ],
+ ]
+ ],
],
//city tax
[
@@ -351,7 +298,15 @@ public function afterSaveDataProvider()
'base_amount' => 0.03,
'percent' => 3.33,
'id' => 'CityTax',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 3,
+ 'code' => 'CityTax',
+ 'title' => 'CityTax',
+ ],
+ ]
+ ],
],
],
],
@@ -367,7 +322,20 @@ public function afterSaveDataProvider()
'base_amount' => 0.55,
'percent' => 11,
'id' => 'ILUS',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 6,
+ 'code' => 'IL',
+ 'title' => 'IL',
+ ],
+ [
+ 'percent' => 5,
+ 'code' => 'US',
+ 'title' => 'US',
+ ],
+ ]
+ ],
],
//city tax
[
@@ -375,7 +343,15 @@ public function afterSaveDataProvider()
'base_amount' => 0.17,
'percent' => 3.33,
'id' => 'CityTax',
- 'extension_attributes' => $orderTaxDetailsApplied,
+ 'extension_attributes' => [
+ 'rates' => [
+ [
+ 'percent' => 3,
+ 'code' => 'CityTax',
+ 'title' => 'CityTax',
+ ],
+ ]
+ ],
],
],
],
diff --git a/app/code/Magento/TaxGraphQl/Test/Mftf/composer.json b/app/code/Magento/TaxGraphQl/Test/Mftf/composer.json
deleted file mode 100644
index 144f778833cd4..0000000000000
--- a/app/code/Magento/TaxGraphQl/Test/Mftf/composer.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "magento/functional-test-module-tax-graph-ql",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0"
- },
- "suggest": {
- "magento/functional-test-module-tax": "100.0.0-dev",
- "magento/functional-test-module-catalog-graph-ql": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/composer.json b/app/code/Magento/TaxImportExport/Test/Mftf/composer.json
deleted file mode 100644
index 39bc90df32651..0000000000000
--- a/app/code/Magento/TaxImportExport/Test/Mftf/composer.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "magento/functional-test-module-tax-import-export",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-tax": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php
index 145493b8e44d8..83172df748a47 100644
--- a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php
+++ b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php
@@ -5,9 +5,12 @@
*/
namespace Magento\Theme\Controller\Result;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Message\MessageInterface;
+use Magento\Framework\Translate\Inline\ParserInterface;
+use Magento\Framework\Translate\InlineInterface;
/**
* Plugin for putting messages to cookies
@@ -44,26 +47,34 @@ class MessagePlugin
*/
private $serializer;
+ /**
+ * @var InlineInterface
+ */
+ private $inlineTranslate;
+
/**
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
* @param \Magento\Framework\Message\ManagerInterface $messageManager
* @param \Magento\Framework\View\Element\Message\InterpretationStrategyInterface $interpretationStrategy
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
+ * @param InlineInterface|null $inlineTranslate
*/
public function __construct(
\Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory,
\Magento\Framework\Message\ManagerInterface $messageManager,
\Magento\Framework\View\Element\Message\InterpretationStrategyInterface $interpretationStrategy,
- \Magento\Framework\Serialize\Serializer\Json $serializer = null
+ \Magento\Framework\Serialize\Serializer\Json $serializer = null,
+ InlineInterface $inlineTranslate = null
) {
$this->cookieManager = $cookieManager;
$this->cookieMetadataFactory = $cookieMetadataFactory;
$this->messageManager = $messageManager;
- $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
+ $this->serializer = $serializer ?: ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\Json::class);
$this->interpretationStrategy = $interpretationStrategy;
+ $this->inlineTranslate = $inlineTranslate ?: ObjectManager::getInstance()->get(InlineInterface::class);
}
/**
@@ -112,6 +123,12 @@ public function afterRenderResult(
private function setCookie(array $messages)
{
if (!empty($messages)) {
+ if ($this->inlineTranslate->isAllowed()) {
+ foreach ($messages as &$message) {
+ $message['text'] = $this->convertMessageText($message['text']);
+ }
+ }
+
$publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata();
$publicCookieMetadata->setDurationOneYear();
$publicCookieMetadata->setPath('/');
@@ -125,6 +142,21 @@ private function setCookie(array $messages)
}
}
+ /**
+ * Replace wrapping translation with html body.
+ *
+ * @param string $text
+ * @return string
+ */
+ private function convertMessageText(string $text): string
+ {
+ if (preg_match('#' . ParserInterface::REGEXP_TOKEN . '#', $text, $matches)) {
+ $text = $matches[1];
+ }
+
+ return $text;
+ }
+
/**
* Return messages array and clean message manager messages
*
diff --git a/app/code/Magento/Theme/Test/Mftf/Data/DesignData.xml b/app/code/Magento/Theme/Test/Mftf/Data/DesignData.xml
new file mode 100644
index 0000000000000..988d71bc4086b
--- /dev/null
+++ b/app/code/Magento/Theme/Test/Mftf/Data/DesignData.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ 1 column
+
+
diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml
index 2e5a786d45725..67a5146fd8b3a 100644
--- a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml
+++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml
@@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
-
+
diff --git a/app/code/Magento/Theme/Test/Mftf/composer.json b/app/code/Magento/Theme/Test/Mftf/composer.json
deleted file mode 100644
index f93dac15279a4..0000000000000
--- a/app/code/Magento/Theme/Test/Mftf/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "magento/functional-test-module-theme",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-cms": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-media-storage": "100.0.0-dev",
- "magento/functional-test-module-require-js": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-ui": "100.0.0-dev",
- "magento/functional-test-module-widget": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-translation": "100.0.0-dev",
- "magento/functional-test-module-theme-sample-data": "100.0.0-dev",
- "magento/functional-test-module-deploy": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php
index 60457fc1436c0..748f7a1fcb9fb 100644
--- a/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php
+++ b/app/code/Magento/Theme/Test/Unit/Controller/Result/MessagePluginTest.php
@@ -14,6 +14,7 @@
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
use Magento\Framework\Stdlib\Cookie\PublicCookieMetadata;
use Magento\Framework\Stdlib\CookieManagerInterface;
+use Magento\Framework\Translate\InlineInterface;
use Magento\Framework\View\Element\Message\InterpretationStrategyInterface;
use Magento\Theme\Controller\Result\MessagePlugin;
@@ -40,6 +41,9 @@ class MessagePluginTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\Serialize\Serializer\Json|\PHPUnit_Framework_MockObject_MockObject */
private $serializerMock;
+ /** @var InlineInterface|\PHPUnit_Framework_MockObject_MockObject */
+ private $inlineTranslateMock;
+
protected function setUp()
{
$this->cookieManagerMock = $this->getMockBuilder(CookieManagerInterface::class)
@@ -53,13 +57,15 @@ protected function setUp()
->getMockForAbstractClass();
$this->serializerMock = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)
->getMock();
+ $this->inlineTranslateMock = $this->getMockBuilder(InlineInterface::class)->getMockForAbstractClass();
$this->model = new MessagePlugin(
$this->cookieManagerMock,
$this->cookieMetadataFactoryMock,
$this->managerMock,
$this->interpretationStrategyMock,
- $this->serializerMock
+ $this->serializerMock,
+ $this->inlineTranslateMock
);
}
@@ -450,4 +456,93 @@ function ($data) {
$this->assertEquals($resultMock, $this->model->afterRenderResult($resultMock, $resultMock));
}
+
+ /**
+ * @return void
+ */
+ public function testAfterRenderResultWithAllowedInlineTranslate(): void
+ {
+ $messageType = 'message1type';
+ $messageText = '{{{message1text}}{{message1text}}{{message1text}}{{theme/luma}}}';
+ $expectedMessages = [
+ [
+ 'type' => $messageType,
+ 'text' => 'message1text',
+ ],
+ ];
+
+ /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $resultMock */
+ $resultMock = $this->getMockBuilder(Redirect::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ /** @var PublicCookieMetadata|\PHPUnit_Framework_MockObject_MockObject $cookieMetadataMock */
+ $cookieMetadataMock = $this->getMockBuilder(PublicCookieMetadata::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->cookieMetadataFactoryMock->expects($this->once())
+ ->method('createPublicCookieMetadata')
+ ->willReturn($cookieMetadataMock);
+
+ $this->cookieManagerMock->expects($this->once())
+ ->method('setPublicCookie')
+ ->with(
+ MessagePlugin::MESSAGES_COOKIES_NAME,
+ json_encode($expectedMessages),
+ $cookieMetadataMock
+ );
+ $this->cookieManagerMock->expects($this->once())
+ ->method('getCookie')
+ ->with(
+ MessagePlugin::MESSAGES_COOKIES_NAME
+ )
+ ->willReturn(json_encode([]));
+
+ $this->serializerMock->expects($this->once())
+ ->method('unserialize')
+ ->willReturnCallback(
+ function ($data) {
+ return json_decode($data, true);
+ }
+ );
+ $this->serializerMock->expects($this->once())
+ ->method('serialize')
+ ->willReturnCallback(
+ function ($data) {
+ return json_encode($data);
+ }
+ );
+
+ /** @var MessageInterface|\PHPUnit_Framework_MockObject_MockObject $messageMock */
+ $messageMock = $this->getMockBuilder(MessageInterface::class)
+ ->getMock();
+ $messageMock->expects($this->once())
+ ->method('getType')
+ ->willReturn($messageType);
+
+ $this->interpretationStrategyMock->expects($this->once())
+ ->method('interpret')
+ ->with($messageMock)
+ ->willReturn($messageText);
+
+ $this->inlineTranslateMock->expects($this->once())
+ ->method('isAllowed')
+ ->willReturn(true);
+
+ /** @var Collection|\PHPUnit_Framework_MockObject_MockObject $collectionMock */
+ $collectionMock = $this->getMockBuilder(Collection::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $collectionMock->expects($this->once())
+ ->method('getItems')
+ ->willReturn([$messageMock]);
+
+ $this->managerMock->expects($this->once())
+ ->method('getMessages')
+ ->with(true, null)
+ ->willReturn($collectionMock);
+
+ $this->assertEquals($resultMock, $this->model->afterRenderResult($resultMock, $resultMock));
+ }
}
diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml
index 55119f3449389..5ff82ce2db6f6 100644
--- a/app/code/Magento/Theme/etc/di.xml
+++ b/app/code/Magento/Theme/etc/di.xml
@@ -69,7 +69,7 @@
- Magento\Framework\Translate
+ Magento\Framework\TranslateInterface
Magento\Theme\Model\Design\Proxy
diff --git a/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml b/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml
index 318bcc8f2cc7c..c3ad4a89399a0 100644
--- a/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml
+++ b/app/code/Magento/Theme/view/frontend/templates/html/collapsible.phtml
@@ -10,7 +10,7 @@
- = /* @escapeNotVerified */ $block->getBlockTitle() ?>
+ = /* @escapeNotVerified */ __($block->getBlockTitle()) ?>
= $block->getChildHtml() ?>
diff --git a/app/code/Magento/Theme/view/frontend/web/templates/breadcrumbs.html b/app/code/Magento/Theme/view/frontend/web/templates/breadcrumbs.html
index f298c0a58e814..792eb2e636005 100644
--- a/app/code/Magento/Theme/view/frontend/web/templates/breadcrumbs.html
+++ b/app/code/Magento/Theme/view/frontend/web/templates/breadcrumbs.html
@@ -10,9 +10,9 @@
<% if (crumb.link) { %>
<%- crumb.label %>
<% } else if (crumb.last) { %>
- <%- crumb.label %>
+ <%= crumb.label %>
<% } else { %>
- <%- crumb.label %>
+ <%= crumb.label %>
<% } %>
<% }); %>
diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml
index 4a1c7e07c38c6..0806011e8ffbc 100644
--- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml
+++ b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml
@@ -17,8 +17,9 @@
-
-
+
+
+
diff --git a/app/code/Magento/Tinymce3/Test/Mftf/composer.json b/app/code/Magento/Tinymce3/Test/Mftf/composer.json
deleted file mode 100644
index 84c1f9376bf45..0000000000000
--- a/app/code/Magento/Tinymce3/Test/Mftf/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "magento/functional-test-module-tinymce-3",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-ui": "100.0.0-dev",
- "magento/functional-test-module-variable": "100.0.0-dev",
- "magento/functional-test-module-widget": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-cms": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js
index 88e2d4cc78f96..7c587c1c8768a 100644
--- a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js
+++ b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js
@@ -495,7 +495,7 @@ define([
*/
encodeDirectives: function (content) {
// collect all HTML tags with attributes that contain directives
- return content.gsub(/<([a-z0-9\-\_]+[^>]+?)([a-z0-9\-\_]+=".*?\{\{.+?\}\}.*?".*?)>/i, function (match) {
+ return content.gsub(/<([a-z0-9\-\_]+[^>]+?)([a-z0-9\-\_]+="[^"]*?\{\{.+?\}\}.*?".*?)>/i, function (match) {
var attributesString = match[2],
decodedDirectiveString;
diff --git a/app/code/Magento/Translation/Model/Js/DataProvider.php b/app/code/Magento/Translation/Model/Js/DataProvider.php
index a73d4ee99b5d6..7aad7c765bcd5 100644
--- a/app/code/Magento/Translation/Model/Js/DataProvider.php
+++ b/app/code/Magento/Translation/Model/Js/DataProvider.php
@@ -113,7 +113,8 @@ public function getData($themePath)
}
} catch (\Exception $e) {
throw new LocalizedException(
- __('Error while translating phrase "%s" in file %s.', $phrase, $filePath[0])
+ __('Error while translating phrase "%s" in file %s.', $phrase, $filePath[0]),
+ $e
);
}
}
diff --git a/app/code/Magento/Translation/Test/Mftf/composer.json b/app/code/Magento/Translation/Test/Mftf/composer.json
deleted file mode 100644
index 36bfa66adda0f..0000000000000
--- a/app/code/Magento/Translation/Test/Mftf/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "magento/functional-test-module-translation",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-developer": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-deploy": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Ui/Component/MassAction/Filter.php b/app/code/Magento/Ui/Component/MassAction/Filter.php
index 6877303f5c491..a8ed5d901d860 100644
--- a/app/code/Magento/Ui/Component/MassAction/Filter.php
+++ b/app/code/Magento/Ui/Component/MassAction/Filter.php
@@ -99,14 +99,12 @@ public function getCollection(AbstractDb $collection)
throw new LocalizedException(__('An item needs to be selected. Select and try again.'));
}
}
- /** @var \Magento\Customer\Model\ResourceModel\Customer\Collection $collection */
- $idsArray = $this->getFilterIds();
- if (!empty($idsArray)) {
- $collection->addFieldToFilter(
- $collection->getIdFieldName(),
- ['in' => $idsArray]
- );
- }
+
+ $collection->addFieldToFilter(
+ $collection->getIdFieldName(),
+ ['in' => $this->getFilterIds()]
+ );
+
return $collection;
}
diff --git a/app/code/Magento/Ui/DataProvider/EavValidationRules.php b/app/code/Magento/Ui/DataProvider/EavValidationRules.php
index 12e345e1fa12c..6e2bb3866e947 100644
--- a/app/code/Magento/Ui/DataProvider/EavValidationRules.php
+++ b/app/code/Magento/Ui/DataProvider/EavValidationRules.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Ui\DataProvider;
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
@@ -31,25 +32,51 @@ class EavValidationRules
*/
public function build(AbstractAttribute $attribute, array $data)
{
- $validation = [];
+ $validations = [];
if (isset($data['required']) && $data['required'] == 1) {
- $validation = array_merge($validation, ['required-entry' => true]);
+ $validations = array_merge($validations, ['required-entry' => true]);
}
if ($attribute->getFrontendInput() === 'price') {
- $validation = array_merge($validation, ['validate-zero-or-greater' => true]);
+ $validations = array_merge($validations, ['validate-zero-or-greater' => true]);
}
if ($attribute->getValidateRules()) {
- $validation = array_merge($validation, $attribute->getValidateRules());
+ $validations = array_merge($validations, $this->clipLengthRules($attribute->getValidateRules()));
}
+ return $this->aggregateRules($validations);
+ }
+
+ /**
+ * @param array $validations
+ * @return array
+ */
+ private function aggregateRules(array $validations): array
+ {
$rules = [];
- foreach ($validation as $type => $ruleName) {
- $rule = [$type => $ruleName];
+ foreach ($validations as $type => $ruleValue) {
+ $rule = [$type => $ruleValue];
if ($type === 'input_validation') {
- $rule = isset($this->validationRules[$ruleName]) ? $this->validationRules[$ruleName] : [];
+ $rule = $this->validationRules[$ruleValue] ?? [];
+ }
+ if (count($rule) !== 0) {
+ $key = key($rule);
+ $rules[$key] = $rule[$key];
}
- $rules = array_merge($rules, $rule);
}
+ return $rules;
+ }
+ /**
+ * @param array $rules
+ * @return array
+ */
+ private function clipLengthRules(array $rules): array
+ {
+ if (empty($rules['input_validation'])) {
+ unset(
+ $rules['min_text_length'],
+ $rules['max_text_length']
+ );
+ }
return $rules;
}
}
diff --git a/app/code/Magento/Ui/Test/Mftf/composer.json b/app/code/Magento/Ui/Test/Mftf/composer.json
deleted file mode 100644
index 86a99d02bd959..0000000000000
--- a/app/code/Magento/Ui/Test/Mftf/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "magento/functional-test-module-ui",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-authorization": "100.0.0-dev",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-user": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php b/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php
index debcde4765fc7..cdb62ce1db68d 100644
--- a/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php
+++ b/app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Ui\Test\Unit\DataProvider;
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
@@ -29,6 +30,9 @@ class EavValidationRulesTest extends \PHPUnit\Framework\TestCase
*/
protected $attributeMock;
+ /**
+ * {@inheritDoc}
+ */
protected function setUp()
{
$this->objectManager = new ObjectManager($this);
@@ -42,11 +46,13 @@ protected function setUp()
}
/**
+ * @param string $attributeInputType
+ * @param mixed $validateRules
* @param array $data
* @param array $expected
* @dataProvider buildDataProvider
*/
- public function testBuild($attributeInputType, $validateRules, $data, $expected)
+ public function testBuild($attributeInputType, $validateRules, $data, $expected): void
{
$this->attributeMock->expects($this->once())->method('getFrontendInput')->willReturn($attributeInputType);
$this->attributeMock->expects($this->any())->method('getValidateRules')->willReturn($validateRules);
@@ -70,11 +76,25 @@ public function buildDataProvider()
['', ['input_validation' => 'email'], [], ['validate-email' => true]],
['', ['input_validation' => 'date'], [], ['validate-date' => true]],
['', ['input_validation' => 'other'], [], []],
- ['', ['max_text_length' => '254'], ['required' => 1], ['max_text_length' => 254, 'required-entry' => true]],
- ['', ['max_text_length' => '254', 'min_text_length' => 1], [],
- ['max_text_length' => 254, 'min_text_length' => 1]],
- ['', ['max_text_length' => '254', 'input_validation' => 'date'], [],
- ['max_text_length' => 254, 'validate-date' => true]],
+ ['', ['max_text_length' => '254'], ['required' => 1], ['required-entry' => true]],
+ [
+ '',
+ ['input_validation' => 'other', 'max_text_length' => '254'],
+ ['required' => 1],
+ ['max_text_length' => 254, 'required-entry' => true]
+ ],
+ [
+ '',
+ ['input_validation' => 'other', 'max_text_length' => '254', 'min_text_length' => 1],
+ [],
+ ['max_text_length' => 254, 'min_text_length' => 1]
+ ],
+ [
+ '',
+ ['max_text_length' => '254', 'input_validation' => 'date'],
+ [],
+ ['max_text_length' => 254, 'validate-date' => true]
+ ],
];
}
}
diff --git a/app/code/Magento/Ui/etc/adminhtml/system.xml b/app/code/Magento/Ui/etc/adminhtml/system.xml
index 74e2e076b93c8..ab4272f8d2a34 100644
--- a/app/code/Magento/Ui/etc/adminhtml/system.xml
+++ b/app/code/Magento/Ui/etc/adminhtml/system.xml
@@ -9,12 +9,12 @@
-
+
Magento\Config\Model\Config\Source\Yesno
If enabled, can be used by functional tests for extended reporting
-
+
Use this key to retrieve collected js errors
diff --git a/app/code/Magento/Ui/i18n/en_US.csv b/app/code/Magento/Ui/i18n/en_US.csv
index ed4386f6000c3..106526f66e708 100644
--- a/app/code/Magento/Ui/i18n/en_US.csv
+++ b/app/code/Magento/Ui/i18n/en_US.csv
@@ -125,30 +125,18 @@ Ok,Ok
"Label Actions Two","Label Actions Two"
"Some Dynamic Actions","Some Dynamic Actions"
"Log JS Errors to Session Storage","Log JS Errors to Session Storage"
+"If enabled, can be used by functional tests for extended reporting","If enabled, can be used by functional tests for extended reporting"
"Log JS Errors to Session Storage Key","Log JS Errors to Session Storage Key"
+"Use this key to retrieve collected js errors","Use this key to retrieve collected js errors"
settings/label,settings/label
settings/confirm/title,settings/confirm/title
-"settings/confirm/message
- ","settings/confirm/message
- "
-"
- settings/callback/provider
- ","
- settings/callback/provider
- "
-"settings/callback/target
- ","settings/callback/target
- "
-"settings/newViewLabel
- ","settings/newViewLabel
- "
+"settings/confirm/message","settings/confirm/message"
+"settings/callback/provider","settings/callback/provider"
+"settings/callback/target","settings/callback/target"
+"settings/newViewLabel","settings/newViewLabel"
settings/title,settings/title
settings/description,settings/description
-"
- settings/addButtonLabel
- ","
- settings/addButtonLabel
- "
+"settings/addButtonLabel","settings/addButtonLabel"
"
formElements/*[name(.)=../../@formElement]/settings/description
","
diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition.map.xml b/app/code/Magento/Ui/view/base/ui_component/etc/definition.map.xml
index 94272f723ec77..ccd702c23ea65 100644
--- a/app/code/Magento/Ui/view/base/ui_component/etc/definition.map.xml
+++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition.map.xml
@@ -16,15 +16,11 @@
- settings/url
-
- settings/confirm/title
- - settings/confirm/message
-
+ - settings/confirm/message
-
-
-
- settings/callback/provider
-
- - settings/callback/target
-
+ - settings/callback/provider
+ - settings/callback/target
@@ -59,8 +55,7 @@
-
- settings/childDefaults
- settings/viewTmpl
- - settings/newViewLabel
-
+ - settings/newViewLabel
@@ -265,9 +260,7 @@
- settings/columnsHeaderClasses
- settings/recordTemplate
- settings/collapsibleHeader
- -
- settings/addButtonLabel
-
+ - settings/addButtonLabel
- settings/addButton
- settings/deleteProperty
- settings/identificationProperty
diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js
index 7537107560cb4..1d52fc78d7a85 100644
--- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js
+++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js
@@ -330,9 +330,7 @@ define([
}
if (this.defaultPagesState[this.currentPage()]) {
- this.pagesChanged[this.currentPage()] =
- !compareArrays(this.defaultPagesState[this.currentPage()], this.arrayFilter(this.getChildItems()));
- this.changed(_.some(this.pagesChanged));
+ this.setChangedForCurrentPage();
}
},
@@ -442,13 +440,9 @@ define([
return initialize;
}));
- this.pagesChanged[this.currentPage()] =
- !compareArrays(this.defaultPagesState[this.currentPage()], this.arrayFilter(this.getChildItems()));
- this.changed(_.some(this.pagesChanged));
+ this.setChangedForCurrentPage();
} else if (this.hasInitialPagesState[this.currentPage()]) {
- this.pagesChanged[this.currentPage()] =
- !compareArrays(this.defaultPagesState[this.currentPage()], this.arrayFilter(this.getChildItems()));
- this.changed(_.some(this.pagesChanged));
+ this.setChangedForCurrentPage();
}
},
@@ -848,7 +842,8 @@ define([
deleteRecord: function (index, recordId) {
var recordInstance,
lastRecord,
- recordsData;
+ recordsData,
+ lastRecordIndex;
if (this.deleteProperty) {
recordsData = this.recordData();
@@ -867,12 +862,13 @@ define([
this.update = true;
if (~~this.currentPage() === this.pages()) {
+ lastRecordIndex = this.startIndex + this.getChildItems().length - 1;
lastRecord =
_.findWhere(this.elems(), {
- index: this.startIndex + this.getChildItems().length - 1
+ index: lastRecordIndex
}) ||
_.findWhere(this.elems(), {
- index: (this.startIndex + this.getChildItems().length - 1).toString()
+ index: lastRecordIndex.toString()
});
lastRecord.destroy();
@@ -1133,6 +1129,18 @@ define([
});
this.isDifferedFromDefault(!_.isEqual(recordData, this.default));
+ },
+
+ /**
+ * Set the changed property if the current page is different
+ * than the default state
+ *
+ * @return void
+ */
+ setChangedForCurrentPage: function () {
+ this.pagesChanged[this.currentPage()] =
+ !compareArrays(this.defaultPagesState[this.currentPage()], this.arrayFilter(this.getChildItems()));
+ this.changed(_.some(this.pagesChanged));
}
});
});
diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js
index b729dd3127d90..6d33386fa1f1c 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js
@@ -22,7 +22,7 @@ define([
opened: false,
level: 0,
visible: true,
- initializeFieldsetDataByDefault: false, /* Data in some fieldsets should be initialized before open */
+ initializeFieldsetDataByDefault: false, /* Data in some fieldsets should be initialized before open */
disabled: false,
listens: {
'opened': 'onVisibilityChange'
@@ -77,9 +77,9 @@ define([
elem.initContainer(this);
elem.on({
- 'update': this.onChildrenUpdate,
- 'loading': this.onContentLoading,
- 'error': this.onChildrenError
+ 'update': this.onChildrenUpdate,
+ 'loading': this.onContentLoading,
+ 'error': this.onChildrenError
});
if (this.disabled) {
@@ -155,11 +155,42 @@ define([
* @param {String} message - error message.
*/
onChildrenError: function (message) {
- var hasErrors = this.elems.some('error');
+ var hasErrors = false;
+
+ if (!message) {
+ hasErrors = this._isChildrenHasErrors(hasErrors, this);
+ }
this.error(hasErrors || message);
},
+ /**
+ * Returns errors of children if exist
+ *
+ * @param {Boolean} hasErrors
+ * @param {*} container
+ * @return {Boolean}
+ * @private
+ */
+ _isChildrenHasErrors: function (hasErrors, container) {
+ var self = this;
+
+ if (hasErrors === false && container.hasOwnProperty('elems')) {
+ hasErrors = container.elems.some('error');
+
+ if (hasErrors === false && container.hasOwnProperty('_elems')) {
+ container._elems.forEach(function (child) {
+
+ if (hasErrors === false) {
+ hasErrors = self._isChildrenHasErrors(hasErrors, child);
+ }
+ });
+ }
+ }
+
+ return hasErrors;
+ },
+
/**
* Callback that sets loading property to true.
*/
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
index 5177b4a378d69..5d79ac77218f5 100755
--- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
@@ -40,6 +40,7 @@ define([
showFallbackReset: false,
additionalClasses: {},
isUseDefault: '',
+ serviceDisabled: false,
valueUpdate: false, // ko binding valueUpdate
switcherConfig: {
@@ -97,7 +98,7 @@ define([
this._super();
this.observe('error disabled focused preview visible value warn notice isDifferedFromDefault')
- .observe('isUseDefault')
+ .observe('isUseDefault serviceDisabled')
.observe({
'required': !!rules['required-entry']
});
@@ -407,7 +408,7 @@ define([
this.bubble('error', message);
//TODO: Implement proper result propagation for form
- if (!isValid) {
+ if (this.source && !isValid) {
this.source.set('params.invalid', true);
}
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
index b583d0be69f34..6492d0821fc21 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
@@ -6,6 +6,7 @@
/**
* @api
*/
+/* global Base64 */
define([
'jquery',
'underscore',
@@ -168,6 +169,10 @@ define([
processFile: function (file) {
file.previewType = this.getFilePreviewType(file);
+ if (!file.id && file.name) {
+ file.id = Base64.mageEncode(file.name);
+ }
+
this.observe.call(file, true, [
'previewWidth',
'previewHeight'
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js b/app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js
index 69c9fb74cbce1..0ae09f14fa946 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js
@@ -17,6 +17,15 @@ define([
'use strict';
return Element.extend({
+ /**
+ * {@inheritDoc}
+ */
+ initialize: function () {
+ this._super();
+
+ // Listen for file deletions from the media browser
+ $(window).on('fileDeleted.mediabrowser', this.onDeleteFile.bind(this));
+ },
/**
* Assign uid for media gallery
@@ -76,6 +85,40 @@ define([
browser.openDialog(openDialogUrl, null, null, this.mediaGallery.openDialogTitle);
},
+ /**
+ * @param {jQuery.event} e
+ * @param {Object} data
+ * @returns {Object} Chainables
+ */
+ onDeleteFile: function (e, data) {
+ var fileId = this.getFileId(),
+ deletedFileIds = data.ids;
+
+ if (fileId && $.inArray(fileId, deletedFileIds) > -1) {
+ this.clear();
+ }
+
+ return this;
+ },
+
+ /**
+ * {@inheritDoc}
+ */
+ clear: function () {
+ this.value([]);
+
+ return this;
+ },
+
+ /**
+ * Gets the ID of the file used if set
+ *
+ * @return {String|Null} ID
+ */
+ getFileId: function () {
+ return this.hasData() ? this.value()[0].id : null;
+ },
+
/**
* Trigger native browser file upload UI via clicking on 'Upload' button
*
diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js
index a4c56958911a8..be7a1a13fbd61 100644
--- a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js
+++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js
@@ -78,8 +78,8 @@ define([
},
/**
- * Adds new action. If action with a specfied identifier
- * already exists, than the original will be overrided.
+ * Adds new action. If an action with the specified identifier
+ * already exists, then the original will be overridden.
*
* @param {String} index - Actions' identifier.
* @param {Object} action - Actions' data.
@@ -108,7 +108,7 @@ define([
/**
* Processes actions, setting additional information to them and
- * evaluating ther properties as a string templates.
+ * evaluating their properties as string templates.
*
* @private
* @param {Object} row - Row object.
@@ -204,11 +204,11 @@ define([
},
/**
- * Creates action callback based on its' data. If action doesn't spicify
+ * Creates action callback based on it's data. If the action doesn't specify
* a callback function than the default one will be used.
*
* @private
- * @param {Object} action - Actions' object.
+ * @param {Object} action - Action's object.
* @returns {Function} Callback function.
*/
_getCallback: function (action) {
@@ -234,7 +234,7 @@ define([
* Creates action callback for multiple actions.
*
* @private
- * @param {Object} action - Actions' object.
+ * @param {Object} action - Action's object.
* @returns {Function} Callback function.
*/
_getCallbacks: function (action) {
@@ -259,12 +259,12 @@ define([
/**
* Default action callback. Redirects to
- * the specified in actions' data url.
+ * the specified in action's data url.
*
- * @param {String} actionIndex - Actions' identifier.
- * @param {(Number|String)} recordId - Id of the record accociated
- * with a specfied action.
- * @param {Object} action - Actions' data.
+ * @param {String} actionIndex - Action's identifier.
+ * @param {(Number|String)} recordId - Id of the record associated
+ * with a specified action.
+ * @param {Object} action - Action's data.
*/
defaultCallback: function (actionIndex, recordId, action) {
window.location.href = action.href;
@@ -273,7 +273,7 @@ define([
/**
* Shows actions' confirmation window.
*
- * @param {Object} action - Actions' data.
+ * @param {Object} action - Action's data.
* @param {Function} callback - Callback that will be
* invoked if action is confirmed.
*/
diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js
index 0a29728390592..ba0f4d25c25a4 100644
--- a/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js
+++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js
@@ -229,6 +229,15 @@ define([
return this;
},
+ /**
+ * Selects or deselects all records on the current page.
+ *
+ * @returns {Multiselect} Chainable.
+ */
+ togglePage: function () {
+ return this.isPageSelected() ? this.deselectPage() : this.selectPage();
+ },
+
/**
* Clears the array of not selected records.
*
@@ -259,7 +268,7 @@ define([
* Returns identifier of a record.
*
* @param {*} id - Id of a record or its' index in a rows array.
- * @param {Boolean} [isIndex=false] - Flag that specifies whith what
+ * @param {Boolean} [isIndex=false] - Flag that specifies with what
* kind of identifier we are dealing with.
* @returns {*}
*/
diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js
index ecc4ec1902d87..98c3eb1c6f882 100644
--- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js
+++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js
@@ -257,7 +257,7 @@ define([
/**
* Creates filter component configuration associated with the provided column.
*
- * @param {Column} column - Column component whith a basic filter declaration.
+ * @param {Column} column - Column component with a basic filter declaration.
* @returns {Object} Filters' configuration.
*/
buildFilter: function (column) {
@@ -331,7 +331,7 @@ define([
},
/**
- * Finds filters whith a not empty data
+ * Finds filters with a not empty data
* and sets them to the 'active' filters array.
*
* @returns {Filters} Chainable.
diff --git a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js
index 046ff12bfaa6f..48c04458ff49a 100644
--- a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js
+++ b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js
@@ -175,11 +175,14 @@ define([
* invoked if action is confirmed.
*/
_confirm: function (action, callback) {
- var confirmData = action.confirm;
+ var confirmData = action.confirm,
+ data = this.getSelections(),
+ total = data.total ? data.total : 0,
+ confirmMessage = confirmData.message + ' (' + total + ' record' + (total > 1 ? 's' : '') + ')';
confirm({
title: confirmData.title,
- content: confirmData.message,
+ content: confirmMessage,
actions: {
confirm: callback
}
diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js b/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js
index 1684f0b220175..b05fed939b7a5 100644
--- a/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js
+++ b/app/code/Magento/Ui/view/base/web/js/lib/core/element/element.js
@@ -66,7 +66,7 @@ define([
Element = _.extend({
defaults: {
- _requesetd: {},
+ _requested: {},
containers: [],
exports: {},
imports: {},
@@ -249,7 +249,7 @@ define([
* @returns {Function} Async module wrapper.
*/
requestModule: function (name) {
- var requested = this._requesetd;
+ var requested = this._requested;
if (!requested[name]) {
requested[name] = registry.async(name);
diff --git a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js
index 5c3c71e31823d..826e8ec8c33b4 100644
--- a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js
+++ b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js
@@ -17,7 +17,7 @@ define([
var privateData = new WeakMap();
/**
- * Extarcts private items storage associated
+ * Extracts private item storage associated
* with a provided registry instance.
*
* @param {Object} container
@@ -39,7 +39,7 @@ define([
}
/**
- * Wrapper function used for convinient access to the elements.
+ * Wrapper function used for convenient access to the elements.
* See 'async' method for examples of usage and comparison
* with a regular 'get' method.
*
@@ -139,7 +139,7 @@ define([
* which matches specified search criteria.
*
* @param {Object} data - Data object where to perform a lookup.
- * @param {(String|Object|Function)} query - Seach criteria.
+ * @param {(String|Object|Function)} query - Search criteria.
* @param {Boolean} findAll - Flag that defines whether to
* search for all applicable items or to stop on a first found entry.
* @returns {Array|Object|*}
@@ -322,8 +322,8 @@ define([
/**
* Creates a wrapper function over the provided search query
- * in order to provide somehow more convinient access to the
- * registrie's items.
+ * in order to provide somehow more convenient access to the
+ * registry's items.
*
* @param {(String|Object|Function)} query - Search criteria.
* See 'get' method for the syntax examples.
diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
index c63b4588d2d16..e52791deaf2ad 100644
--- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
+++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
@@ -636,7 +636,7 @@ define([
'validate-number': [
function (value) {
return utils.isEmptyNoTrim(value) ||
- !isNaN(utils.parseNumber(value)) && /^\s*-?\d*(\.\d*)?\s*$/.test(value);
+ !isNaN(utils.parseNumber(value)) && /^\s*-?\d*(,\d*)*(\.\d*)?\s*$/.test(value);
},
$.mage.__('Please enter a valid number in this field.')
],
diff --git a/app/code/Magento/Ui/view/base/web/js/modal/confirm.js b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js
index 9cb14f7b2ef11..eceab940d1141 100644
--- a/app/code/Magento/Ui/view/base/web/js/modal/confirm.js
+++ b/app/code/Magento/Ui/view/base/web/js/modal/confirm.js
@@ -9,10 +9,10 @@
define([
'jquery',
'underscore',
+ 'mage/translate',
'jquery/ui',
- 'Magento_Ui/js/modal/modal',
- 'mage/translate'
-], function ($, _) {
+ 'Magento_Ui/js/modal/modal'
+], function ($, _, $t) {
'use strict';
$.widget('mage.confirm', $.mage.modal, {
@@ -38,7 +38,7 @@ define([
cancel: function () {}
},
buttons: [{
- text: $.mage.__('Cancel'),
+ text: $t('Cancel'),
class: 'action-secondary action-dismiss',
/**
@@ -48,7 +48,7 @@ define([
this.closeModal(event);
}
}, {
- text: $.mage.__('OK'),
+ text: $t('OK'),
class: 'action-primary action-accept',
/**
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 147a18c08c54c..f016b0dbefd87 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
@@ -340,6 +340,12 @@ define([
var zIndex = this.modal.zIndex(),
baseIndex = zIndex + this._getVisibleCount();
+ if (this.modal.data('active')) {
+ return;
+ }
+
+ this.modal.data('active', true);
+
this.overlay.zIndex(++baseIndex);
this.prevOverlayIndex = this.overlay.zIndex();
this.modal.zIndex(this.overlay.zIndex() + 1);
@@ -354,6 +360,7 @@ define([
*/
_unsetActive: function () {
this.modal.removeAttr('style');
+ this.modal.data('active', false);
if (this.overlay) {
// In cases when one modal is closed but there is another modal open (e.g. admin notifications)
diff --git a/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html b/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html
index 2c0ce802b4bc0..806ac767d7b59 100644
--- a/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html
+++ b/app/code/Magento/Ui/view/base/web/templates/form/components/collection/preview.html
@@ -11,7 +11,7 @@
'company',
'street',
{
- items: 'city region_id postcode',
+ items: 'city region_id region_id_input postcode',
separator: ', '
},
'country_id',
diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
index e3c3ab5b5df5c..46f0a2df52441 100644
--- a/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
+++ b/app/code/Magento/Ui/view/base/web/templates/form/element/helper/service.html
@@ -12,6 +12,7 @@
name: 'use_default[' + $data.index + ']',
'data-form-part': $data.ns
"
- ko-checked="isUseDefault">
+ ko-checked="isUseDefault"
+ ko-disabled="$data.serviceDisabled">
diff --git a/app/code/Magento/Ui/view/base/web/templates/form/field.html b/app/code/Magento/Ui/view/base/web/templates/form/field.html
index 888bc911d747f..24ed194d666ee 100644
--- a/app/code/Magento/Ui/view/base/web/templates/form/field.html
+++ b/app/code/Magento/Ui/view/base/web/templates/form/field.html
@@ -8,9 +8,9 @@
visible="visible"
css="$data.additionalClasses"
attr="'data-index': index">
-
+
+
+
diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html
index 18dd49bd56ee3..e6e14d5aa335b 100644
--- a/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html
+++ b/app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html
@@ -11,7 +11,7 @@
data-bind="
checked: allSelected(),
attr: {id: ++ko.uid},
- event: { change: toggleSelectAll },
+ event: { change: togglePage },
css: { '_indeterminate': indetermine },
enable: totalRecords">
diff --git a/app/code/Magento/Ups/Test/Mftf/composer.json b/app/code/Magento/Ups/Test/Mftf/composer.json
deleted file mode 100644
index 560eaab1a19b1..0000000000000
--- a/app/code/Magento/Ups/Test/Mftf/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "magento/functional-test-module-ups",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog-inventory": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-quote": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-shipping": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/UrlRewrite/Block/Edit.php b/app/code/Magento/UrlRewrite/Block/Edit.php
index baee8af893083..115c5db43a70a 100644
--- a/app/code/Magento/UrlRewrite/Block/Edit.php
+++ b/app/code/Magento/UrlRewrite/Block/Edit.php
@@ -65,7 +65,7 @@ public function __construct(
*/
protected function _prepareLayout()
{
- $this->setTemplate('edit.phtml');
+ $this->setTemplate('Magento_UrlRewrite::edit.phtml');
$this->_addBackButton();
$this->_prepareLayoutFeatures();
@@ -243,7 +243,7 @@ private function _getSelectorBlock()
* Since buttons are set as children, we remove them as children after generating them
* not to duplicate them in future
*
- * @param null $area
+ * @param string $area
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
diff --git a/app/code/Magento/UrlRewrite/Block/Plugin/Store/Switcher/SetRedirectUrl.php b/app/code/Magento/UrlRewrite/Block/Plugin/Store/Switcher/SetRedirectUrl.php
deleted file mode 100644
index 9bdff38e7aaa2..0000000000000
--- a/app/code/Magento/UrlRewrite/Block/Plugin/Store/Switcher/SetRedirectUrl.php
+++ /dev/null
@@ -1,89 +0,0 @@
-urlHelper = $urlHelper;
- $this->urlBuilder = $urlBuilder;
- $this->urlFinder = $urlFinder;
- $this->request = $request;
- }
-
- /**
- * Set redirect url for store view based on request path info
- *
- * @param \Magento\Store\Block\Switcher $switcher
- * @param \Magento\Store\Model\Store $store
- * @param array $data
- * @return array
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function beforeGetTargetStorePostData(
- \Magento\Store\Block\Switcher $switcher,
- \Magento\Store\Model\Store $store,
- $data = []
- ) {
- $urlRewrite = $this->urlFinder->findOneByData([
- UrlRewrite::TARGET_PATH => $this->trimSlashInPath($this->request->getPathInfo()),
- UrlRewrite::STORE_ID => $store->getId(),
- ]);
- if ($urlRewrite) {
- $data[ActionInterface::PARAM_NAME_URL_ENCODED] = $this->urlHelper->getEncodedUrl(
- $this->trimSlashInPath($this->urlBuilder->getUrl($urlRewrite->getRequestPath(), ['_scope' => $store]))
- );
- }
- return [$store, $data];
- }
-
- /**
- * @param string $path
- * @return string
- */
- private function trimSlashInPath($path)
- {
- return trim($path, '/');
- }
-}
diff --git a/app/code/Magento/UrlRewrite/Controller/Router.php b/app/code/Magento/UrlRewrite/Controller/Router.php
index 73002c10cf1b6..ce432f24365a6 100644
--- a/app/code/Magento/UrlRewrite/Controller/Router.php
+++ b/app/code/Magento/UrlRewrite/Controller/Router.php
@@ -7,7 +7,6 @@
use Magento\Framework\App\RequestInterface;
use Magento\UrlRewrite\Controller\Adminhtml\Url\Rewrite;
-use Magento\UrlRewrite\Model\OptionProvider;
use Magento\UrlRewrite\Model\UrlFinderInterface;
use Magento\UrlRewrite\Service\V1\Data\UrlRewrite;
use Magento\Framework\App\Request\Http as HttpRequest;
@@ -78,44 +77,6 @@ public function __construct(
*/
public function match(RequestInterface $request)
{
- if ($fromStore = $request->getParam('___from_store')) {
- //If we're in the process of switching stores then matching rewrite
- //rule from previous store because the URL was not changed yet from
- //old store's format.
- $oldStoreId = $this->storeManager->getStore($fromStore)->getId();
- $oldRewrite = $this->getRewrite(
- $request->getPathInfo(),
- $oldStoreId
- );
- if ($oldRewrite && $oldRewrite->getRedirectType() === 0) {
- //If there is a match and it's a correct URL then just
- //redirecting to current store's URL equivalent,
- //otherwise just continuing finding a rule within current store.
- $currentRewrite = $this->urlFinder->findOneByData(
- [
- UrlRewrite::ENTITY_TYPE => $oldRewrite->getEntityType(),
- UrlRewrite::ENTITY_ID => $oldRewrite->getEntityId(),
- UrlRewrite::STORE_ID =>
- $this->storeManager->getStore()->getId(),
- UrlRewrite::REDIRECT_TYPE => 0,
- ]
- );
- if ($currentRewrite
- && $currentRewrite->getRequestPath()
- !== $oldRewrite->getRequestPath()
- ) {
- return $this->redirect(
- $request,
- $this->url->getUrl(
- '',
- ['_direct' => $currentRewrite->getRequestPath()]
- ),
- OptionProvider::TEMPORARY
- );
- }
- }
- }
-
$rewrite = $this->getRewrite(
$request->getPathInfo(),
$this->storeManager->getStore()->getId()
diff --git a/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php b/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
new file mode 100644
index 0000000000000..2ce00d53588b3
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
@@ -0,0 +1,82 @@
+urlFinder = $urlFinder;
+ $this->requestFactory = $requestFactory;
+ }
+
+ /**
+ * @param StoreInterface $fromStore
+ * @param StoreInterface $targetStore
+ * @param string $redirectUrl
+ * @return string
+ */
+ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string
+ {
+ $targetUrl = $redirectUrl;
+ /** @var \Magento\Framework\HTTP\PhpEnvironment\Request $request */
+ $request = $this->requestFactory->create(['uri' => $targetUrl]);
+
+ $urlPath = ltrim($request->getPathInfo(), '/');
+
+ if ($targetStore->isUseStoreInUrl()) {
+ // Remove store code in redirect url for correct rewrite search
+ $storeCode = preg_quote($targetStore->getCode() . '/', '/');
+ $pattern = "@^($storeCode)@";
+ $urlPath = preg_replace($pattern, '', $urlPath);
+ }
+
+ $oldStoreId = $fromStore->getId();
+ $oldRewrite = $this->urlFinder->findOneByData([
+ UrlRewrite::REQUEST_PATH => $urlPath,
+ UrlRewrite::STORE_ID => $oldStoreId,
+ ]);
+ if ($oldRewrite) {
+ // look for url rewrite match on the target store
+ $currentRewrite = $this->urlFinder->findOneByData([
+ UrlRewrite::REQUEST_PATH => $urlPath,
+ UrlRewrite::STORE_ID => $targetStore->getId(),
+ ]);
+ if (null === $currentRewrite) {
+ /** @var \Magento\Framework\App\Response\Http $response */
+ $targetUrl = $targetStore->getBaseUrl();
+ }
+ }
+
+ return $targetUrl;
+ }
+}
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/composer.json b/app/code/Magento/UrlRewrite/Test/Mftf/composer.json
deleted file mode 100644
index 2d906c3499ac6..0000000000000
--- a/app/code/Magento/UrlRewrite/Test/Mftf/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "magento/functional-test-module-url-rewrite",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-catalog-url-rewrite": "100.0.0-dev",
- "magento/functional-test-module-cms": "100.0.0-dev",
- "magento/functional-test-module-cms-url-rewrite": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Block/Plugin/Store/Switcher/SetRedirectUrlTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Block/Plugin/Store/Switcher/SetRedirectUrlTest.php
deleted file mode 100644
index 46bf90493004d..0000000000000
--- a/app/code/Magento/UrlRewrite/Test/Unit/Block/Plugin/Store/Switcher/SetRedirectUrlTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-store = $this->createMock(\Magento\Store\Model\Store::class);
- $this->request = $this->createMock(\Magento\Framework\App\Request\Http::class);
- $this->urlBuilder = $this->createMock(\Magento\Framework\UrlInterface::class);
- $this->urlHelper = $this->createMock(\Magento\Framework\Url\Helper\Data::class);
- $this->urlFinder = $this->createMock(\Magento\UrlRewrite\Model\UrlFinderInterface::class);
- $this->switcher = $this->createMock(\Magento\Store\Block\Switcher::class);
-
- $this->unit = (new ObjectManager($this))->getObject(
- \Magento\UrlRewrite\Block\Plugin\Store\Switcher\SetRedirectUrl::class,
- [
- 'urlFinder' => $this->urlFinder,
- 'urlHelper' => $this->urlHelper,
- 'urlBuilder' => $this->urlBuilder,
- 'request' => $this->request,
- ]
- );
- }
-
- public function testNoUrlRewriteForSpecificStoreOnGetTargetStorePostData()
- {
- $this->request->expects($this->once())->method('getPathInfo')->willReturn('path');
- $this->urlFinder->expects($this->once())->method('findOneByData')->willReturn(null);
- $this->urlHelper->expects($this->never())->method('getEncodedUrl');
- $this->assertEquals(
- [$this->store, []],
- $this->unit->beforeGetTargetStorePostData($this->switcher, $this->store, [])
- );
- }
-
- public function testTrimPathInfoForGetTargetStorePostData()
- {
- $this->request->expects($this->once())->method('getPathInfo')->willReturn('path/with/trim/');
- $this->store->expects($this->once())->method('getId')->willReturn(1);
- $this->urlFinder->expects($this->once())->method('findOneByData')
- ->with([
- \Magento\UrlRewrite\Service\V1\Data\UrlRewrite::TARGET_PATH => 'path/with/trim',
- \Magento\UrlRewrite\Service\V1\Data\UrlRewrite::STORE_ID => 1,
- ])
- ->willReturn(null);
- $this->urlHelper->expects($this->never())->method('getEncodedUrl');
- $this->assertEquals(
- [$this->store, []],
- $this->unit->beforeGetTargetStorePostData($this->switcher, $this->store, [])
- );
- }
-
- public function testGetTargetStorePostData()
- {
- $urlRewrite = $this->createMock(\Magento\UrlRewrite\Service\V1\Data\UrlRewrite::class);
- $urlRewrite->expects($this->once())->method('getRequestPath')->willReturn('path');
-
- $this->request->expects($this->once())->method('getPathInfo')->willReturn('path');
- $this->urlFinder->expects($this->once())->method('findOneByData')->willReturn($urlRewrite);
- $this->urlHelper->expects($this->once())->method('getEncodedUrl')->willReturn('encoded-path');
- $this->urlBuilder->expects($this->once())->method('getUrl')->willReturn('path');
- $this->assertEquals(
- [$this->store, [\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => 'encoded-path']],
- $this->unit->beforeGetTargetStorePostData($this->switcher, $this->store, [])
- );
- }
-}
diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php
index 49300448146f2..642ca0f9af6d1 100644
--- a/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php
+++ b/app/code/Magento/UrlRewrite/Test/Unit/Controller/RouterTest.php
@@ -6,9 +6,10 @@
namespace Magento\UrlRewrite\Test\Unit\Controller;
+use Magento\Framework\App\Action\Forward;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\UrlRewrite\Model\OptionProvider;
use Magento\UrlRewrite\Service\V1\Data\UrlRewrite;
+use Magento\Store\Model\Store;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -39,6 +40,9 @@ class RouterTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\UrlRewrite\Model\UrlFinderInterface|\PHPUnit_Framework_MockObject_MockObject */
protected $urlFinder;
+ /**
+ * @return void
+ */
protected function setUp()
{
$this->actionFactory = $this->createMock(\Magento\Framework\App\ActionFactory::class);
@@ -67,6 +71,9 @@ protected function setUp()
);
}
+ /**
+ * @return void
+ */
public function testNoRewriteExist()
{
$this->urlFinder->expects($this->any())->method('findOneByData')->will($this->returnValue(null));
@@ -76,6 +83,81 @@ public function testNoRewriteExist()
$this->assertNull($this->router->match($this->request));
}
+ /**
+ * @return void
+ */
+ public function testRewriteAfterStoreSwitcher()
+ {
+ $initialRequestPath = 'request-path';
+ $newRequestPath = 'new-request-path';
+ $oldStoreAlias = 'old-store';
+ $oldStoreId = 'old-store-id';
+ $currentStoreId = 'current-store-id';
+ $rewriteEntityType = 'entity-type';
+ $rewriteEntityId = 42;
+ $this->request
+ ->expects($this->any())
+ ->method('getParam')
+ ->with('___from_store')
+ ->willReturn($oldStoreAlias);
+ $this->request
+ ->expects($this->any())
+ ->method('getPathInfo')
+ ->willReturn($initialRequestPath);
+ $oldStore = $this->getMockBuilder(Store::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $oldStore->expects($this->any())
+ ->method('getId')
+ ->willReturn($oldStoreId);
+ $this->store
+ ->expects($this->any())
+ ->method('getId')
+ ->willReturn($currentStoreId);
+ $this->storeManager
+ ->expects($this->any())
+ ->method('getStore')
+ ->willReturnMap([[$oldStoreAlias, $oldStore], [null, $this->store]]);
+ $oldUrlRewrite = $this->getMockBuilder(UrlRewrite::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $oldUrlRewrite->expects($this->any())
+ ->method('getEntityType')
+ ->willReturn($rewriteEntityType);
+ $oldUrlRewrite->expects($this->any())
+ ->method('getEntityId')
+ ->willReturn($rewriteEntityId);
+ $oldUrlRewrite->expects($this->any())
+ ->method('getRedirectType')
+ ->willReturn(0);
+ $urlRewrite = $this->getMockBuilder(UrlRewrite::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $urlRewrite->expects($this->any())
+ ->method('getRequestPath')
+ ->willReturn($newRequestPath);
+ $this->urlFinder
+ ->expects($this->any())
+ ->method('findOneByData')
+ ->willReturnMap([
+ [
+ [
+ UrlRewrite::REQUEST_PATH => $initialRequestPath,
+ UrlRewrite::STORE_ID => $currentStoreId,
+ ],
+ $urlRewrite,
+ ]
+ ]);
+ $this->actionFactory
+ ->expects($this->once())
+ ->method('create')
+ ->with(Forward::class);
+ $this->router->match($this->request);
+ }
+
+ /**
+ * @return void
+ */
public function testNoRewriteAfterStoreSwitcherWhenNoOldRewrite()
{
$this->request->expects($this->any())->method('getPathInfo')->will($this->returnValue('request-path'));
@@ -98,6 +180,9 @@ public function testNoRewriteAfterStoreSwitcherWhenNoOldRewrite()
$this->assertNull($this->router->match($this->request));
}
+ /**
+ * @return void
+ */
public function testNoRewriteAfterStoreSwitcherWhenOldRewriteEqualsToNewOne()
{
$this->request->expects($this->any())->method('getPathInfo')->will($this->returnValue('request-path'));
@@ -138,6 +223,9 @@ public function testNoRewriteAfterStoreSwitcherWhenOldRewriteEqualsToNewOne()
$this->assertNull($this->router->match($this->request));
}
+ /**
+ * @return void
+ */
public function testMatchWithRedirect()
{
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
@@ -157,6 +245,9 @@ public function testMatchWithRedirect()
$this->router->match($this->request);
}
+ /**
+ * @return void
+ */
public function testMatchWithCustomInternalRedirect()
{
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
@@ -208,6 +299,9 @@ public function externalRedirectTargetPathDataProvider()
];
}
+ /**
+ * @return void
+ */
public function testMatch()
{
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
diff --git a/app/code/Magento/UrlRewrite/etc/di.xml b/app/code/Magento/UrlRewrite/etc/di.xml
index dfeb5d026d508..26055efbd2ba8 100644
--- a/app/code/Magento/UrlRewrite/etc/di.xml
+++ b/app/code/Magento/UrlRewrite/etc/di.xml
@@ -9,4 +9,11 @@
+
+
+
+ - Magento\UrlRewrite\Model\StoreSwitcher\RewriteUrl
+
+
+
diff --git a/app/code/Magento/UrlRewrite/etc/frontend/di.xml b/app/code/Magento/UrlRewrite/etc/frontend/di.xml
index d46bb1c5d14a2..bc5b6aa767fa8 100644
--- a/app/code/Magento/UrlRewrite/etc/frontend/di.xml
+++ b/app/code/Magento/UrlRewrite/etc/frontend/di.xml
@@ -17,7 +17,4 @@
-
-
-
diff --git a/app/code/Magento/UrlRewriteGraphQl/Test/Mftf/composer.json b/app/code/Magento/UrlRewriteGraphQl/Test/Mftf/composer.json
deleted file mode 100644
index 06c58dbb59468..0000000000000
--- a/app/code/Magento/UrlRewriteGraphQl/Test/Mftf/composer.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "magento/functional-test-module-url-rewrite-graph-ql",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-url-rewrite": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-graph-ql": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php
index 27604c9aed29a..a95a68cbe14f3 100644
--- a/app/code/Magento/User/Block/Role/Tab/Users.php
+++ b/app/code/Magento/User/Block/Role/Tab/Users.php
@@ -45,7 +45,9 @@ protected function _construct()
$roleId = $this->getRequest()->getParam('rid', false);
/** @var \Magento\User\Model\ResourceModel\User\Collection $users */
$users = $this->_userCollectionFactory->create()->load();
- $this->setTemplate('role/users.phtml')->assign('users', $users->getItems())->assign('roleId', $roleId);
+ $this->setTemplate('Magento_User::role/users.phtml')
+ ->assign('users', $users->getItems())
+ ->assign('roleId', $roleId);
}
/**
diff --git a/app/code/Magento/User/Controller/Adminhtml/Auth.php b/app/code/Magento/User/Controller/Adminhtml/Auth.php
index 173fdcc764f6f..ea539b64a5cc3 100644
--- a/app/code/Magento/User/Controller/Adminhtml/Auth.php
+++ b/app/code/Magento/User/Controller/Adminhtml/Auth.php
@@ -7,28 +7,32 @@
namespace Magento\User\Controller\Adminhtml;
use Magento\Framework\Encryption\Helper\Security;
+use Magento\Backend\App\AbstractAction;
+use Magento\Backend\App\Action\Context;
+use Magento\User\Model\UserFactory;
+use Magento\Framework\Exception\LocalizedException;
/**
* \Magento\User Auth controller
*/
-abstract class Auth extends \Magento\Backend\App\AbstractAction
+abstract class Auth extends AbstractAction
{
/**
* User model factory
*
- * @var \Magento\User\Model\UserFactory
+ * @var UserFactory
*/
protected $_userFactory;
/**
* Construct
*
- * @param \Magento\Backend\App\Action\Context $context
- * @param \Magento\User\Model\UserFactory $userFactory
+ * @param Context $context
+ * @param UserFactory $userFactory
*/
public function __construct(
- \Magento\Backend\App\Action\Context $context,
- \Magento\User\Model\UserFactory $userFactory
+ Context $context,
+ UserFactory $userFactory
) {
parent::__construct($context);
$this->_userFactory = $userFactory;
@@ -40,7 +44,7 @@ public function __construct(
* @param int $userId
* @param string $resetPasswordToken
* @return void
- * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws LocalizedException
*/
protected function _validateResetPasswordLinkToken($userId, $resetPasswordToken)
{
@@ -50,22 +54,20 @@ protected function _validateResetPasswordLinkToken($userId, $resetPasswordToken)
$resetPasswordToken
) || empty($resetPasswordToken) || empty($userId) || $userId < 0
) {
- throw new \Magento\Framework\Exception\LocalizedException(
- __('The password reset token is incorrect. Verify the token and try again.')
- );
+ throw new LocalizedException(__('Please correct the password reset token.'));
}
/** @var $user \Magento\User\Model\User */
$user = $this->_userFactory->create()->load($userId);
if (!$user->getId()) {
- throw new \Magento\Framework\Exception\LocalizedException(
+ throw new LocalizedException(
__('Please specify the correct account and try again.')
);
}
$userToken = $user->getRpToken();
if (!Security::compareStrings($userToken, $resetPasswordToken) || $user->isResetPasswordLinkTokenExpired()) {
- throw new \Magento\Framework\Exception\LocalizedException(__('Your password reset link has expired.'));
+ throw new LocalizedException(__('Your password reset link has expired.'));
}
}
diff --git a/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php b/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php
index cd4c3d6950685..c0e78fae2c2c6 100644
--- a/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php
+++ b/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php
@@ -7,8 +7,17 @@
namespace Magento\User\Controller\Adminhtml\Auth;
use Magento\Security\Model\SecurityManager;
+use Magento\Framework\App\ObjectManager;
+use Magento\Backend\App\Action\Context;
+use Magento\User\Model\UserFactory;
+use Magento\User\Model\ResourceModel\User\CollectionFactory;
+use Magento\Framework\Validator\EmailAddress;
+use Magento\Security\Model\PasswordResetRequestEvent;
+use Magento\Framework\Exception\SecurityViolationException;
+use Magento\User\Controller\Adminhtml\Auth;
+use Magento\Backend\Helper\Data;
-class Forgotpassword extends \Magento\User\Controller\Adminhtml\Auth
+class Forgotpassword extends Auth
{
/**
* @var SecurityManager
@@ -16,17 +25,36 @@ class Forgotpassword extends \Magento\User\Controller\Adminhtml\Auth
protected $securityManager;
/**
- * @param \Magento\Backend\App\Action\Context $context
- * @param \Magento\User\Model\UserFactory $userFactory
- * @param \Magento\Security\Model\SecurityManager $securityManager
+ * User model factory
+ *
+ * @var CollectionFactory
+ */
+ private $userCollectionFactory;
+
+ /**
+ * @var Data
+ */
+ private $backendDataHelper;
+
+ /**
+ * @param Context $context
+ * @param UserFactory $userFactory
+ * @param SecurityManager $securityManager
+ * @param CollectionFactory $userCollectionFactory
*/
public function __construct(
- \Magento\Backend\App\Action\Context $context,
- \Magento\User\Model\UserFactory $userFactory,
- \Magento\Security\Model\SecurityManager $securityManager
+ Context $context,
+ UserFactory $userFactory,
+ SecurityManager $securityManager,
+ CollectionFactory $userCollectionFactory = null,
+ Data $backendDataHelper = null
) {
parent::__construct($context, $userFactory);
$this->securityManager = $securityManager;
+ $this->userCollectionFactory = $userCollectionFactory ?:
+ ObjectManager::getInstance()->get(CollectionFactory::class);
+ $this->backendDataHelper = $backendDataHelper ?:
+ ObjectManager::getInstance()->get(Data::class);
}
/**
@@ -44,18 +72,18 @@ public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
if (!empty($email) && !empty($params)) {
// Validate received data to be an email address
- if (\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
+ if (\Zend_Validate::is($email, EmailAddress::class)) {
try {
$this->securityManager->performSecurityCheck(
- \Magento\Security\Model\PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST,
+ PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST,
$email
);
- } catch (\Magento\Framework\Exception\SecurityViolationException $exception) {
+ } catch (SecurityViolationException $exception) {
$this->messageManager->addErrorMessage($exception->getMessage());
return $resultRedirect->setPath('admin');
}
- $collection = $this->_objectManager->get(\Magento\User\Model\ResourceModel\User\Collection::class);
/** @var $collection \Magento\User\Model\ResourceModel\User\Collection */
+ $collection = $this->userCollectionFactory->create();
$collection->addFieldToFilter('email', $email);
$collection->load(false);
@@ -65,9 +93,7 @@ public function execute()
/** @var \Magento\User\Model\User $user */
$user = $this->_userFactory->create()->load($item->getId());
if ($user->getId()) {
- $newPassResetToken = $this->_objectManager->get(
- \Magento\User\Helper\Data::class
- )->generateResetPasswordLinkToken();
+ $newPassResetToken = $this->backendDataHelper->generateResetPasswordLinkToken();
$user->changeResetPasswordLinkToken($newPassResetToken);
$user->save();
$user->sendPasswordResetConfirmationEmail();
@@ -86,7 +112,7 @@ public function execute()
$this->messageManager->addSuccess(__('We\'ll email you a link to reset your password.'));
// @codingStandardsIgnoreEnd
$this->getResponse()->setRedirect(
- $this->_objectManager->get(\Magento\Backend\Helper\Data::class)->getHomePageUrl()
+ $this->backendDataHelper->getHomePageUrl()
);
return;
} else {
diff --git a/app/code/Magento/User/Controller/Adminhtml/Auth/ResetPasswordPost.php b/app/code/Magento/User/Controller/Adminhtml/Auth/ResetPasswordPost.php
index 2c6be98439919..c2e29534b1251 100644
--- a/app/code/Magento/User/Controller/Adminhtml/Auth/ResetPasswordPost.php
+++ b/app/code/Magento/User/Controller/Adminhtml/Auth/ResetPasswordPost.php
@@ -6,8 +6,32 @@
*/
namespace Magento\User\Controller\Adminhtml\Auth;
-class ResetPasswordPost extends \Magento\User\Controller\Adminhtml\Auth
+use Magento\User\Controller\Adminhtml\Auth;
+use Magento\Backend\App\Action\Context;
+use Magento\Framework\App\ObjectManager;
+use Magento\Backend\Helper\Data;
+use Magento\User\Model\UserFactory;
+
+class ResetPasswordPost extends Auth
{
+ /**
+ * @var Data
+ */
+ private $backendDataHelper;
+
+ /**
+ * @param Context $context
+ * @param UserFactory $userFactory
+ * @param Data $backendDataHelper
+ */
+ public function __construct(
+ Context $context,
+ UserFactory $userFactory,
+ Data $backendDataHelper = null
+ ) {
+ parent::__construct($context, $userFactory);
+ $this->backendDataHelper = $backendDataHelper ?: ObjectManager::getInstance()->get(Data::class);
+ }
/**
* Reset forgotten password
*
@@ -27,7 +51,7 @@ public function execute()
} catch (\Exception $exception) {
$this->messageManager->addError(__('Your password reset link has expired.'));
$this->getResponse()->setRedirect(
- $this->_objectManager->get(\Magento\Backend\Helper\Data::class)->getHomePageUrl()
+ $this->backendDataHelper->getHomePageUrl()
);
return;
}
@@ -53,7 +77,7 @@ public function execute()
$user->save();
$this->messageManager->addSuccess(__('You updated your password.'));
$this->getResponse()->setRedirect(
- $this->_objectManager->get(\Magento\Backend\Helper\Data::class)->getHomePageUrl()
+ $this->backendDataHelper->getHomePageUrl()
);
}
} catch (\Magento\Framework\Validator\Exception $exception) {
diff --git a/app/code/Magento/User/Test/Mftf/composer.json b/app/code/Magento/User/Test/Mftf/composer.json
deleted file mode 100644
index 6deceeb6b856f..0000000000000
--- a/app/code/Magento/User/Test/Mftf/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "magento/functional-test-module-user",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-authorization": "100.0.0-dev",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-email": "100.0.0-dev",
- "magento/functional-test-module-integration": "100.0.0-dev",
- "magento/functional-test-module-security": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Usps/Test/Mftf/composer.json b/app/code/Magento/Usps/Test/Mftf/composer.json
deleted file mode 100644
index e3b487ad80d9f..0000000000000
--- a/app/code/Magento/Usps/Test/Mftf/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "magento/functional-test-module-usps",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-catalog-inventory": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-quote": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-shipping": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Variable/Test/Mftf/composer.json b/app/code/Magento/Variable/Test/Mftf/composer.json
deleted file mode 100644
index 2360634369fed..0000000000000
--- a/app/code/Magento/Variable/Test/Mftf/composer.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "magento/functional-test-module-variable",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-config": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Vault/Test/Mftf/composer.json b/app/code/Magento/Vault/Test/Mftf/composer.json
deleted file mode 100644
index 78e765bebc429..0000000000000
--- a/app/code/Magento/Vault/Test/Mftf/composer.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "magento/functional-test-module-vault",
- "description": "",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-checkout": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-payment": "100.0.0-dev",
- "magento/functional-test-module-quote": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "proprietary"
- ]
-}
diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json
index a4093617b82cc..f888a98692288 100644
--- a/app/code/Magento/Vault/composer.json
+++ b/app/code/Magento/Vault/composer.json
@@ -16,7 +16,8 @@
},
"type": "magento2-module",
"license": [
- "proprietary"
+ "OSL-3.0",
+ "AFL-3.0"
],
"autoload": {
"files": [
diff --git a/app/code/Magento/Version/Test/Mftf/composer.json b/app/code/Magento/Version/Test/Mftf/composer.json
deleted file mode 100644
index 24037307b7878..0000000000000
--- a/app/code/Magento/Version/Test/Mftf/composer.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "magento/functional-test-module-version",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Webapi/Test/Mftf/composer.json b/app/code/Magento/Webapi/Test/Mftf/composer.json
deleted file mode 100644
index 28d5769034a39..0000000000000
--- a/app/code/Magento/Webapi/Test/Mftf/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "magento/functional-test-module-webapi",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-authorization": "100.0.0-dev",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-integration": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-user": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/WebapiAsync/Test/Mftf/composer.json b/app/code/Magento/WebapiAsync/Test/Mftf/composer.json
deleted file mode 100644
index 6bf5375b7c873..0000000000000
--- a/app/code/Magento/WebapiAsync/Test/Mftf/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "magento/functional-test-module-webapi-async",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-webapi": "100.0.0-dev",
- "magento/functional-test-module-asynchronous-operations": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-user": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/WebapiSecurity/Test/Mftf/composer.json b/app/code/Magento/WebapiSecurity/Test/Mftf/composer.json
deleted file mode 100644
index de96b3a3210f0..0000000000000
--- a/app/code/Magento/WebapiSecurity/Test/Mftf/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "magento/functional-test-module-webapi-security",
- "description": "WebapiSecurity module provides option to loosen security on some webapi resources.",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-webapi": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/WebapiSecurity/etc/adminhtml/system.xml b/app/code/Magento/WebapiSecurity/etc/adminhtml/system.xml
index 425a2047cfd51..c38ea402718e3 100644
--- a/app/code/Magento/WebapiSecurity/etc/adminhtml/system.xml
+++ b/app/code/Magento/WebapiSecurity/etc/adminhtml/system.xml
@@ -5,10 +5,10 @@
-->
-
+
-
+
Magento\Config\Model\Config\Source\Yesno
This feature applies only to CMS, Catalog and Store APIs. Please consult your developers for details on potential security risks.
diff --git a/app/code/Magento/WebapiSecurity/i18n/en_US.csv b/app/code/Magento/WebapiSecurity/i18n/en_US.csv
index 94a4e8706bcd8..5e5e821e63e7f 100644
--- a/app/code/Magento/WebapiSecurity/i18n/en_US.csv
+++ b/app/code/Magento/WebapiSecurity/i18n/en_US.csv
@@ -1,2 +1,3 @@
"Web API Security","Web API Security"
"Allow Anonymous Guest Access","Allow Anonymous Guest Access"
+"This feature applies only to CMS, Catalog and Store APIs. Please consult your developers for details on potential security risks.","This feature applies only to CMS, Catalog and Store APIs. Please consult your developers for details on potential security risks."
diff --git a/app/code/Magento/Weee/Model/Tax.php b/app/code/Magento/Weee/Model/Tax.php
index 3c6d29ae75217..941faed0498f4 100644
--- a/app/code/Magento/Weee/Model/Tax.php
+++ b/app/code/Magento/Weee/Model/Tax.php
@@ -248,10 +248,20 @@ public function getProductWeeeAttributes(
$round = true
) {
$result = [];
-
- $websiteId = $this->_storeManager->getWebsite($website)->getId();
+ $websiteId = null;
/** @var \Magento\Store\Model\Store $store */
- $store = $this->_storeManager->getWebsite($website)->getDefaultGroup()->getDefaultStore();
+ $store = null;
+ if (!$website) {
+ $store = $product->getStore();
+ if ($store) {
+ $websiteId = $store->getWebsiteId();
+ }
+ }
+ if (!$websiteId) {
+ $websiteObject = $this->_storeManager->getWebsite($website);
+ $websiteId = $websiteObject->getId();
+ $store = $websiteObject->getDefaultGroup()->getDefaultStore();
+ }
$allWeee = $this->getWeeeTaxAttributeCodes($store);
if (!$allWeee) {
diff --git a/app/code/Magento/Weee/Test/Mftf/composer.json b/app/code/Magento/Weee/Test/Mftf/composer.json
deleted file mode 100644
index 9e5f7c5772a4e..0000000000000
--- a/app/code/Magento/Weee/Test/Mftf/composer.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "magento/functional-test-module-weee",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-checkout": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-directory": "100.0.0-dev",
- "magento/functional-test-module-eav": "100.0.0-dev",
- "magento/functional-test-module-page-cache": "100.0.0-dev",
- "magento/functional-test-module-quote": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-tax": "100.0.0-dev",
- "magento/functional-test-module-ui": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-bundle": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php b/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php
index 7414e0444598b..ac90dfade07e2 100644
--- a/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php
+++ b/app/code/Magento/Weee/Test/Unit/Model/TaxTest.php
@@ -157,13 +157,17 @@ protected function setUp()
}
/**
- * test GetProductWeeeAttributes
* @dataProvider getProductWeeeAttributesDataProvider
* @param array $weeeTaxCalculationsByEntity
- * @param array $expectedFptLabel
+ * @param mixed $websitePassed
+ * @param string $expectedFptLabel
+ * @return void
*/
- public function testGetProductWeeeAttributes($weeeTaxCalculationsByEntity, $expectedFptLabel)
- {
+ public function testGetProductWeeeAttributes(
+ array $weeeTaxCalculationsByEntity,
+ $websitePassed,
+ string $expectedFptLabel
+ ): void {
$product = $this->createMock(\Magento\Catalog\Model\Product::class);
$website = $this->createMock(\Magento\Store\Model\Website::class);
$store = $this->createMock(\Magento\Store\Model\Store::class);
@@ -187,28 +191,38 @@ public function testGetProductWeeeAttributes($weeeTaxCalculationsByEntity, $expe
->method('getAttributeCodesByFrontendType')
->willReturn(['0'=>'fpt']);
- $store->expects($this->any())
- ->method('getId')
- ->willReturn(1);
-
- $product->expects($this->any())
- ->method('getId')
- ->willReturn(1);
-
+ $this->storeManager->expects($this->any())
+ ->method('getWebsite')
+ ->willReturn($website);
$website->expects($this->any())
->method('getId')
- ->willReturn(1);
+ ->willReturn($websitePassed);
$website->expects($this->any())
->method('getDefaultGroup')
->willReturn($group);
-
$group->expects($this->any())
->method('getDefaultStore')
->willReturn($store);
+ $store->expects($this->any())
+ ->method('getId')
+ ->willReturn(1);
- $this->storeManager->expects($this->any())
- ->method('getWebsite')
- ->willReturn($website);
+ if ($websitePassed) {
+ $product->expects($this->never())
+ ->method('getStore')
+ ->willReturn($store);
+ } else {
+ $product->expects($this->once())
+ ->method('getStore')
+ ->willReturn($store);
+ $store->expects($this->once())
+ ->method('getWebsiteId')
+ ->willReturn(1);
+ }
+
+ $product->expects($this->any())
+ ->method('getId')
+ ->willReturn(1);
$this->weeeConfig->expects($this->any())
->method('isEnabled')
@@ -237,7 +251,7 @@ public function testGetProductWeeeAttributes($weeeTaxCalculationsByEntity, $expe
0 => $weeeTaxCalculationsByEntity
]);
- $result = $this->model->getProductWeeeAttributes($product, null, null, null, true);
+ $result = $this->model->getProductWeeeAttributes($product, null, null, $websitePassed, true);
$this->assertTrue(is_array($result));
$this->assertArrayHasKey(0, $result);
$obj = $result[0];
@@ -312,7 +326,8 @@ public function getProductWeeeAttributesDataProvider()
'frontend_label' => 'fpt_label_frontend',
'attribute_code' => 'fpt_code',
],
- 'expectedFptLabel' => 'fpt_label'
+ 'websitePassed' => 1,
+ 'expectedFptLabel' => 'fpt_label',
],
'store_label_not_defined' => [
'weeeTaxCalculationsByEntity' => [
@@ -321,8 +336,19 @@ public function getProductWeeeAttributesDataProvider()
'frontend_label' => 'fpt_label_frontend',
'attribute_code' => 'fpt_code',
],
- 'expectedFptLabel' => 'fpt_label_frontend'
- ]
+ 'websitePassed' => 1,
+ 'expectedFptLabel' => 'fpt_label_frontend',
+ ],
+ 'website_not_passed' => [
+ 'weeeTaxCalculationsByEntity' => [
+ 'weee_value' => 1,
+ 'label_value' => '',
+ 'frontend_label' => 'fpt_label_frontend',
+ 'attribute_code' => 'fpt_code',
+ ],
+ 'websitePassed' => null,
+ 'expectedFptLabel' => 'fpt_label_frontend',
+ ],
];
}
diff --git a/app/code/Magento/WeeeGraphQl/Test/Mftf/composer.json b/app/code/Magento/WeeeGraphQl/Test/Mftf/composer.json
deleted file mode 100644
index 09b1dc9afe551..0000000000000
--- a/app/code/Magento/WeeeGraphQl/Test/Mftf/composer.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "magento/functional-test-module-weee-graph-ql",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0"
- },
- "suggest": {
- "magento/functional-test-module-weee": "100.0.0-dev",
- "magento/functional-test-module-catalog-graph-ql": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php
index 98275c3b906db..b5d31dc10be34 100644
--- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php
+++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php
@@ -49,7 +49,5 @@ public function execute()
$this->_redirect('adminhtml/*/edit', ['_current' => true]);
return;
}
- $this->_redirect('adminhtml/*/');
- return;
}
}
diff --git a/app/code/Magento/Widget/Test/Mftf/composer.json b/app/code/Magento/Widget/Test/Mftf/composer.json
deleted file mode 100644
index 693fa651f5974..0000000000000
--- a/app/code/Magento/Widget/Test/Mftf/composer.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "magento/functional-test-module-widget",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-cms": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-theme": "100.0.0-dev",
- "magento/functional-test-module-variable": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-widget-sample-data": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php
index 0e1f722cd366a..b85a458ed4121 100644
--- a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php
+++ b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php
@@ -168,7 +168,7 @@ public function testGetWidgetDeclaration()
'show_pager' => '1',
'products_per_page' => '5',
'products_count' => '10',
- 'template' => 'product/widget/content/grid.phtml',
+ 'template' => 'Magento_CatalogWidget::product/widget/content/grid.phtml',
'conditions' => $conditions
];
@@ -181,7 +181,10 @@ public function testGetWidgetDeclaration()
['1', false, '1'],
['5', false, '5'],
['10', false, '10'],
- ['product/widget/content/grid.phtml', false, 'product/widget/content/grid.phtml'],
+ ['Magento_CatalogWidget::product/widget/content/grid.phtml',
+ false,
+ 'Magento_CatalogWidget::product/widget/content/grid.phtml'
+ ],
['encoded-conditions-string', false, 'encoded-conditions-string'],
]);
@@ -226,7 +229,7 @@ public function testGetWidgetDeclarationWithZeroValueParam()
'show_pager' => '1',
'products_per_page' => '5',
'products_count' => '0',
- 'template' => 'product/widget/content/grid.phtml',
+ 'template' => 'Magento_CatalogWidget::product/widget/content/grid.phtml',
'conditions' => $conditions
];
diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml
index 981ee51954fb4..95beae991384f 100644
--- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml
+++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml
@@ -35,6 +35,10 @@
+
+
+
+
diff --git a/app/code/Magento/Wishlist/Test/Mftf/composer.json b/app/code/Magento/Wishlist/Test/Mftf/composer.json
deleted file mode 100644
index d016f9346f60c..0000000000000
--- a/app/code/Magento/Wishlist/Test/Mftf/composer.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "magento/functional-test-module-wishlist",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-backend": "100.0.0-dev",
- "magento/functional-test-module-catalog": "100.0.0-dev",
- "magento/functional-test-module-catalog-inventory": "100.0.0-dev",
- "magento/functional-test-module-checkout": "100.0.0-dev",
- "magento/functional-test-module-customer": "100.0.0-dev",
- "magento/functional-test-module-rss": "100.0.0-dev",
- "magento/functional-test-module-sales": "100.0.0-dev",
- "magento/functional-test-module-store": "100.0.0-dev",
- "magento/functional-test-module-ui": "100.0.0-dev"
- },
- "suggest": {
- "magento/functional-test-module-configurable-product": "100.0.0-dev",
- "magento/functional-test-module-downloadable": "100.0.0-dev",
- "magento/functional-test-module-bundle": "100.0.0-dev",
- "magento/functional-test-module-cookie": "100.0.0-dev",
- "magento/functional-test-module-grouped-product": "100.0.0-dev",
- "magento/functional-test-module-wishlist-sample-data": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/code/Magento/Wishlist/etc/adminhtml/system.xml b/app/code/Magento/Wishlist/etc/adminhtml/system.xml
index 86c24bab11ffb..50ea4b01fe12b 100644
--- a/app/code/Magento/Wishlist/etc/adminhtml/system.xml
+++ b/app/code/Magento/Wishlist/etc/adminhtml/system.xml
@@ -22,12 +22,12 @@
Email template chosen based on theme fallback when "Default" option is selected.
Magento\Config\Model\Config\Source\Email\Template
-
+
10 by default. Max - 10000
validate-digits validate-digits-range digits-range-1-10000
-
+
255 by default
validate-digits validate-digits-range digits-range-1-10000
diff --git a/app/code/Magento/Wishlist/i18n/en_US.csv b/app/code/Magento/Wishlist/i18n/en_US.csv
index 75d5a2e840102..a1d33cbd574f0 100644
--- a/app/code/Magento/Wishlist/i18n/en_US.csv
+++ b/app/code/Magento/Wishlist/i18n/en_US.csv
@@ -99,7 +99,9 @@ Back,Back
"Email Template","Email Template"
"Email template chosen based on theme fallback when ""Default"" option is selected.","Email template chosen based on theme fallback when ""Default"" option is selected."
"Max Emails Allowed to be Sent","Max Emails Allowed to be Sent"
+"10 by default. Max - 10000","10 by default. Max - 10000"
"Email Text Length Limit","Email Text Length Limit"
+"255 by default","255 by default"
"General Options","General Options"
Enabled,Enabled
"My Wish List Link","My Wish List Link"
diff --git a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml
index 00fb87b411fe0..84b607adb6362 100644
--- a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml
+++ b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml
@@ -31,7 +31,7 @@ $wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data');
-
+
diff --git a/app/code/Magento/WishlistAnalytics/Test/Mftf/composer.json b/app/code/Magento/WishlistAnalytics/Test/Mftf/composer.json
deleted file mode 100644
index 6969178cfdaa6..0000000000000
--- a/app/code/Magento/WishlistAnalytics/Test/Mftf/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "magento/functional-test-module-wishlist-analytics",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "2.2.0",
- "magento/functional-test-module-wishlist": "100.0.0-dev"
- },
- "type": "magento2-test",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ]
-}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Analytics/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Analytics/web/css/source/_module.less
index 45f1a835d18d8..6d21462d753ca 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Analytics/web/css/source/_module.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Analytics/web/css/source/_module.less
@@ -18,65 +18,65 @@
// _____________________________________________
.dashboard-advanced-reports {
- .lib-vendor-prefix-display(flex);
- border-color: @color-gray89;
- border-style: solid;
- border-width: 1px 0;
- margin-bottom: @indent__l;
- padding: @indent__m 0;
+ .lib-vendor-prefix-display(flex);
+ border-color: @color-gray89;
+ border-style: solid;
+ border-width: 1px 0;
+ margin-bottom: @indent__l;
+ padding: @indent__m 0;
}
.dashboard-advanced-reports-title {
- &:extend(.dashboard-item-title all);
- margin-bottom: @indent__s;
+ &:extend(.dashboard-item-title all);
+ margin-bottom: @indent__s;
}
.dashboard-advanced-reports-content {
- line-height: @line-height__xl;
+ line-height: @line-height__xl;
}
.dashboard-advanced-reports-actions {
- .lib-vendor-prefix-flex-basis(auto);
- .lib-vendor-prefix-flex-grow(1);
- .lib-vendor-prefix-flex-shrink(1);
- align-self: center;
- margin-left: @indent__m;
- margin-right: @page-main-actions__padding;
- text-align: right;
+ .lib-vendor-prefix-flex-basis(auto);
+ .lib-vendor-prefix-flex-grow(1);
+ .lib-vendor-prefix-flex-shrink(1);
+ align-self: center;
+ margin-left: @indent__m;
+ margin-right: @page-main-actions__padding;
+ text-align: right;
}
.action-advanced-reports {
- &:extend(.abs-action-l all);
- &:extend(.abs-action-pattern all);
- background-color: @button-advanced-reports__background-color;
- border-color: @button-advanced-reports__background-color;
- color: @button-advanced-reports__color;
- text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
- white-space: nowrap;
-
- &:after {
- &:extend(.abs-icon all);
- content: @icon-external-link__content;
- font-size: @font-size__xs;
- vertical-align: super;
- }
-
- &:hover,
- &:active,
- &:focus {
- background-color: @button-advanced-reports__hover__background-color;
- border-color: @button-advanced-reports__hover__border-color;
- box-shadow: @button__hover__box-shadow;
+ &:extend(.abs-action-l all);
+ &:extend(.abs-action-pattern all);
+ background-color: @button-advanced-reports__background-color;
+ border-color: @button-advanced-reports__background-color;
color: @button-advanced-reports__color;
- text-decoration: none;
- }
-
- &.disabled,
- &[disabled] {
- cursor: default;
- opacity: @disabled__opacity;
- pointer-events: none;
- }
+ text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
+ white-space: nowrap;
+
+ &:after {
+ &:extend(.abs-icon all);
+ content: @icon-external-link__content;
+ font-size: @font-size__xs;
+ vertical-align: super;
+ }
+
+ &:hover,
+ &:active,
+ &:focus {
+ background-color: @button-advanced-reports__hover__background-color;
+ border-color: @button-advanced-reports__hover__border-color;
+ box-shadow: @button__hover__box-shadow;
+ color: @button-advanced-reports__color;
+ text-decoration: none;
+ }
+
+ &.disabled,
+ &[disabled] {
+ cursor: default;
+ opacity: @disabled__opacity;
+ pointer-events: none;
+ }
}
//
@@ -84,42 +84,42 @@
// ---------------------------------------------
.advanced-reports-subscription-modal {
- .modal-inner-wrap {
- max-width: 75rem;
- margin-top: 13rem;
-
- .modal-content, .modal-header {
- padding-left: 4rem;
- padding-right: 4rem;
-
- .action-close {
- display: none;
- }
+ .modal-inner-wrap {
+ margin-top: 13rem;
+ max-width: 75rem;
+
+ .modal-content,
+ .modal-header {
+ padding-left: 4rem;
+ padding-right: 4rem;
+
+ .action-close {
+ display: none;
+ }
+ }
}
- }
- .admin__fieldset {
- padding: 0;
- }
+ .admin__fieldset {
+ padding: 0;
+ }
}
.advanced-reports-subscription-text {
- line-height: @line-height__xl;
- padding-bottom: 8rem;
+ line-height: @line-height__xl;
+ padding-bottom: 8rem;
}
.advanced-reports-subscription-close {
- display: inline-block;
- vertical-align: top;
- float: right;
+ display: block;
+ float: right;
}
.advanced-reports-subscription-modal {
- h1:first-of-type {
- background: url("Magento_Analytics::images/analytics-icon.svg") no-repeat;
- background-size: 55px 49.08px;
- padding: 1.5rem 0 2rem 7rem;
- }
+ h1:first-of-type {
+ background: url("Magento_Analytics::images/analytics-icon.svg") no-repeat;
+ background-size: 55px 49.08px;
+ padding: 1.5rem 0 2rem 7rem;
+ }
}
//
@@ -127,41 +127,44 @@
// _____________________________________________
.config-additional-comment {
- border-color: @color-gray80;
- border-style: solid;
- border-width: 1px 0;
- margin: @indent__l 0;
- padding: @indent__m;
+ border-color: @color-gray80;
+ border-style: solid;
+ border-width: 1px 0;
+ margin: @indent__l 0;
+ padding: @indent__m;
}
.config-additional-comment-title {
- margin-bottom: @indent__xs;
+ margin-bottom: @indent__xs;
}
.config-additional-comment-content {
- line-height: @line-height__l;
+ line-height: @line-height__l;
}
.config-vertical-title {
- clear: both;
- color: #303030;
- font-size: 1.7rem;
- font-weight: 600;
- letter-spacing: .025em;
- padding: 1.9rem 2.8rem 1.9rem 0;
- position: relative;
+ clear: both;
+ color: rgb(48, 48, 48);
+ font-size: 1.7rem;
+ font-weight: 600;
+ letter-spacing: .025em;
+ padding: 1.9rem 2.8rem 1.9rem 0;
+ position: relative;
}
.config-vertical-comment {
- line-height: 1.5;
- margin-bottom: .5em;
- margin-top: 1rem;
+ line-height: 1.5;
+ margin-bottom: .5em;
+ margin-top: 1rem;
}
+/**
+ * @codingStandardsIgnoreStart
+ */
#row_analytics_general_vertical {
- >td.config-vertical-label {
- >label.admin__field-label {
- padding-right: 0;
+ >td.config-vertical-label {
+ >label.admin__field-label {
+ padding-right: 0;
+ }
}
- }
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml
index da16bde107673..337d63369b160 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml
+++ b/app/design/adminhtml/Magento/backend/Magento_Backend/layout/default.xml
@@ -7,6 +7,7 @@
-->
+
diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/_module-old.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/_module-old.less
index 16db9092db368..c4bed53dcbe80 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/_module-old.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/_module-old.less
@@ -54,7 +54,6 @@
.search-global-field .mage-suggest {
position: static;
display: block;
- vertical-align: baseline;
width: auto;
background-color: transparent;
border: none;
@@ -177,7 +176,7 @@
}
&:before {
- display: inline-block;
+ display: block;
float: right;
margin-left: 4px;
font-size: 13px;
diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less
index 8825f4ea3f5a2..ba28108326006 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less
@@ -187,12 +187,12 @@
display: block;
}
- // External link marker
+ // External link marker
[target='_blank'] {
&:after {
&:extend(.abs-icon all);
content: @icon-external-link__content;
- font-size: 0.5rem;
+ font-size: .5rem;
margin-left: @indent__xs;
vertical-align: super;
}
@@ -263,7 +263,6 @@
visibility: hidden;
z-index: @submenu__z-index - 1;
- .ie10 &,
.ie11 & {
height: 100%;
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/pages/_login.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/pages/_login.less
index 97ed1d8cdb1ec..e7f4c41de9750 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/pages/_login.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/pages/_login.less
@@ -49,10 +49,6 @@
position: relative;
width: 100%;
z-index: 1;
-
- .ie9 & {
- margin-top: 10%;
- }
}
:-ms-input-placeholder {
@@ -84,7 +80,7 @@
}
.messages {
- margin-top: 0.5rem;
+ margin-top: .5rem;
+ form .admin__legend {
display: none;
diff --git a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less
index f3bb1fede2512..659b1fa811db1 100644
--- a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less
+++ b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less
@@ -18,8 +18,8 @@
// _____________________________________________
.currency-addon {
+ border: 1px solid rgb(173,173,173);
position: relative;
- border: 1px solid #adadad;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
-webkit-flex-direction: row;
@@ -30,17 +30,18 @@
width: 100%;
.admin__control-text {
- appearence: none;
- -webkit-flex-grow: 1;
- flex-grow: 1;
-ms-flex-order: 1;
- -webkit-order: 1;
- order: 1;
+ -webkit-appearance: none;
+ -webkit-flex-grow: 1;
-webkit-flex-shrink: 1;
- flex-shrink: 1;
+ -webkit-order: 1;
+ appearance: none;
background-color: transparent;
border-color: transparent;
box-shadow: none;
+ flex-grow: 1;
+ flex-shrink: 1;
+ order: 1;
vertical-align: top;
&:focus {
@@ -51,28 +52,28 @@
}
label.error {
- position: absolute;
left: 0;
+ position: absolute;
top: 33px;
}
.currency-symbol {
+ -webkit-flex-basis: auto;
+ -webkit-flex-grow: 0;
+ -webkit-flex-shrink: 0;
border: solid @currency-addon-symbol__border-color;
border-width: 0;
box-sizing: border-box;
color: @currency-addon-symbol__color;
+ flex-basis: auto;
+ flex-grow: 0;
+ flex-shrink: 0;
height: @currency-addon-symbol__height;
+ order: 0;
padding: 7px 0 0 @indent__xs;
position: static;
transition: @smooth__border-color;
- -webkit-flex-basis: auto;
- flex-basis: auto;
- -webkit-flex-grow: 0;
- flex-grow: 0;
- -webkit-flex-shrink: 0;
- flex-shrink: 0;
z-index: 1;
- order: 0;
}
._error & {
diff --git a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/steps/_bulk-images.less b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/steps/_bulk-images.less
index b2dc94d9ffa74..35dae432a6c4f 100644
--- a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/steps/_bulk-images.less
+++ b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/steps/_bulk-images.less
@@ -97,8 +97,8 @@
margin-left: 0;
.admin__field-control {
+ display: block;
float: right;
- display: inline-block;
}
}
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_GiftRegistry/web/css/source/_module-old.less b/app/design/adminhtml/Magento/backend/Magento_GiftRegistry/web/css/source/_module-old.less
index 6b0d73299d903..3e1a1b9cf9be9 100644
--- a/app/design/adminhtml/Magento/backend/Magento_GiftRegistry/web/css/source/_module-old.less
+++ b/app/design/adminhtml/Magento/backend/Magento_GiftRegistry/web/css/source/_module-old.less
@@ -7,7 +7,3 @@
// Stores -> Gift Registry
// ---------------------------------------------
-.eq-ie9 [class^=' adminhtml-giftregistry-'] .custom-options .data-table {
- table-layout: auto;
- word-wrap: normal;
-}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Marketplace/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Marketplace/web/css/source/_module.less
index d4f918567e579..92a08eb7909c4 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Marketplace/web/css/source/_module.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Marketplace/web/css/source/_module.less
@@ -15,22 +15,12 @@
.lib-vendor-prefix-display(flex);
.lib-vendor-prefix-flex-direction(row);
.lib-vendor-prefix-flex-wrap(wrap);
-
- .ie9 & {
- word-spacing: -.45rem;
- }
}
.partner {
margin-bottom: @indent__xl;
padding: 0 @indent__m;
width: 100% / 3;
-
- .ie9 & {
- display: inline-block;
- vertical-align: top;
- word-spacing: normal;
- }
}
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_ReleaseNotification/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_ReleaseNotification/web/css/source/_module.less
index a7b6f553f1ff8..6f1e4224fa7a5 100644
--- a/app/design/adminhtml/Magento/backend/Magento_ReleaseNotification/web/css/source/_module.less
+++ b/app/design/adminhtml/Magento/backend/Magento_ReleaseNotification/web/css/source/_module.less
@@ -8,111 +8,112 @@
// ---------------------------------------------
.release-notification-modal {
- -webkit-transition: visibility 0s .5s, opacity .5s ease;
- transition: visibility 0s .5s, opacity .5s ease;
-
- &._show {
- visibility: visible;
- opacity: 1;
- -webkit-transition: opacity .5s ease;
- transition: opacity .5s ease;
- }
-
- .modal-inner-wrap {
- -webkit-transform: translateX(0);
- transform: translateX(0);
- -webkit-transition: -webkit-transform 0s;
- transition: transform 0s;
- height: 50rem;
- max-width: 75rem;
- margin-top: 13rem;
-
- .modal-content, .modal-header {
- padding-left: 4rem;
- padding-right: 4rem;
-
- .action-close {
- display: none;
- }
+ -webkit-transition: visibility 0s .5s, opacity .5s ease;
+ transition: visibility 0s .5s, opacity .5s ease;
+
+ &._show {
+ -webkit-transition: opacity .5s ease;
+ opacity: 1;
+ transition: opacity .5s ease;
+ visibility: visible;
}
- }
- .admin__fieldset {
- padding: 0;
- }
+ .modal-inner-wrap {
+ .modal-content,
+ .modal-header {
+ padding-left: 4rem;
+ padding-right: 4rem;
+
+ .action-close {
+ display: none;
+ }
+ }
+
+ -webkit-transform: translateX(0);
+ -webkit-transition: -webkit-transform 0s;
+ height: 50rem;
+ transition: transform 0s;
+ transform: translateX(0);
+ margin-top: 13rem;
+ max-width: 75rem;
+ }
+
+ .admin__fieldset {
+ padding: 0;
+ }
}
.release-notification-title-with-image {
- padding: 1.5rem 0 2rem 7rem;
- background-size: 55px 49.08px;
- background-repeat: no-repeat;
+ background-repeat: no-repeat;
+ background-size: 55px 49.08px;
+ padding: 1.5rem 0 2rem 7rem;
}
.release-notification-text {
- line-height: @line-height__l;
-
- ul {
- margin: 2rem 0 2rem 0;
-
- li {
- font-size: @font-size__xs;
- margin: 1.5rem 0 1.5rem 2rem;
-
- span {
- font-size: @font-size__base;
- vertical-align: middle;
- position: relative;
- left: 1rem;
- }
+ line-height: @line-height__l;
+
+ ul {
+ margin: 2rem 0 2rem 0;
+
+ li {
+ font-size: @font-size__xs;
+ margin: 1.5rem 0 1.5rem 2rem;
+
+ span {
+ font-size: @font-size__base;
+ vertical-align: middle;
+ position: relative;
+ left: 1rem;
+ }
+ }
}
- }
}
-.release-notification-button-next, .release-notification-button-back {
- display: inline-block;
- vertical-align: top;
- float: right;
- position: absolute;
- bottom: 4rem;
+.release-notification-button-next,
+.release-notification-button-back {
+ bottom: 4rem;
+ display: block;
+ float: right;
+ position: absolute;
}
.release-notification-button-next {
- .lib-button-as-link();
- right: 4rem;
- font-weight: 400;
+ .lib-button-as-link();
+ font-weight: 400;
+ right: 4rem;
}
.release-notification-button-back {
- .lib-button-as-link();
- left: 4rem;
- font-weight: 400;
+ .lib-button-as-link();
+ font-weight: 400;
+ left: 4rem;
}
.highlight-item {
- padding: 0 0 2rem 8.5rem;
- margin-left: 1rem;
- background-size: 65px 58px;
- background-repeat: no-repeat;
-
- h3 {
- margin: 0;
-
- span {
- font-style: @font-style__emphasis;
- font-size: @font-size__s;
- font-weight: @font-weight__light;
+ h3 {
+ margin: 0;
+
+ span {
+ font-size: @font-size__s;
+ font-style: @font-style__emphasis;
+ font-weight: @font-weight__light;
+ }
}
- }
+
+ background-size: 65px 58px;
+ background-repeat: no-repeat;
+ padding: 0 0 2rem 8.5rem;
+ margin-left: 1rem;
}
.highlight-item-no-image {
- padding: 0 0 2rem 0;
+ padding: 0 0 2rem 0;
- h3 {
- margin: 0;
- }
+ h3 {
+ margin: 0;
+ }
}
.hide-release-notification {
- display: none;
+ display: none;
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Staging/web/css/source/module/_staging-preview.less b/app/design/adminhtml/Magento/backend/Magento_Staging/web/css/source/module/_staging-preview.less
index a71731320c5ce..3e1f4e75031d2 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Staging/web/css/source/module/_staging-preview.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Staging/web/css/source/module/_staging-preview.less
@@ -1,5 +1,5 @@
// /**
-// * Copyright © 2015 Magento. All rights reserved.
+// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
@@ -366,7 +366,7 @@
// Generic data grid
.admin__data-grid-outer-wrap {
border-top: 1px solid @staging-preview-table-dark__border-color;
- max-height: 400px; // ToDO: remove after JS adjustment implemented
+ max-height: 400px; // ToDO remove after JS adjustment implemented
overflow-y: auto;
padding: 15px @indent__s 0 0;
}
@@ -730,15 +730,9 @@
top: @indent__l;
width: 1px;
- .ie9 &,
- .ie10 &,
.ie11 & {
height: 1000px;
}
-
- .ie9 & {
- border-right: 1px dashed @staging-preview-table-lighten__border-color;
- }
}
}
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/_module-old.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/_module-old.less
index 11e0fcc7c8b84..3756fe678a3c9 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/_module-old.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/_module-old.less
@@ -180,14 +180,14 @@
.lib-clearfix();
[data-part=left] {
- display: inline-block;
+ display: block;
width: 45%;
float: left;
text-align: left;
}
[data-part=right] {
- display: inline-block;
+ display: block;
width: 45%;
text-align: right;
float: right;
diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
index 065f870dbfe01..d55608ade4a05 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less
@@ -59,18 +59,6 @@
margin-top: -(@data-grid-spinner__size / 2);
position: absolute;
top: 50%;
-
- .ie9 & {
- background: url('@{baseDir}images/loader-2.gif') 50% 50% no-repeat;
- bottom: 0;
- height: 149px;
- left: 0;
- margin: auto;
- position: absolute;
- right: 0;
- top: 0;
- width: 218px;
- }
}
}
@@ -999,10 +987,6 @@ body._in-resize {
transform: rotate(45deg);
width: 1.6rem;
z-index: 3;
-
- .ie9 & {
- display: none;
- }
}
}
}
diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/data-grid/data-grid-header/_data-grid-action-bookmarks.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/data-grid/data-grid-header/_data-grid-action-bookmarks.less
index dfaf340f90b6c..f9c93dce57002 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/data-grid/data-grid-header/_data-grid-action-bookmarks.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/data-grid/data-grid-header/_data-grid-action-bookmarks.less
@@ -132,10 +132,6 @@
font-size: @action-dropdown-menu__font-size;
min-width: 15rem;
width: ~'calc(100% - 4rem)';
-
- .ie9 & {
- width: 15rem;
- }
}
.action-dropdown-menu-item-actions {
diff --git a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less
index 909935e1f8ea8..1cd867efdd13b 100644
--- a/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less
+++ b/app/design/adminhtml/Magento/backend/Magento_VisualMerchandiser/web/css/source/_module.less
@@ -68,7 +68,7 @@
a {
color: @color-gray85;
- display: inline-block;
+ display: block;
float: left;
text-decoration: none;
}
diff --git a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/_buttons.less b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/_buttons.less
index ec7509cba6dda..2c60af8dfa178 100644
--- a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/_buttons.less
+++ b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/_buttons.less
@@ -73,12 +73,6 @@
cursor: default;
opacity: @disabled__opacity;
pointer-events: none;
-
- .ie9 & {
- background-color: @btn__base__disabled__background-color;
- opacity: 1;
- text-shadow: none;
- }
}
}
@@ -135,22 +129,6 @@
);
color: @btn-prime__color;
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- .ie9 & {
- background-color: @btn-prime__disabled__background-color;
- }
-
- &:hover,
- &:active {
- .ie9 & {
- background-color: @btn-prime__disabled__background-color;
- filter: none;
- }
- }
- }
}
.btn-secondary {
@@ -167,21 +145,6 @@
background-color: @btn-secondary__active__background-color;
color: @btn-secondary__color;
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- .ie9 & {
- background-color: @btn-secondary__disabled__background-color;
- }
-
- &:active {
- .ie9 & {
- background-color: @btn-secondary__disabled__background-color;
- filter: none;
- }
- }
- }
}
//
@@ -239,26 +202,6 @@
left: 1px;
}
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- &:after {
- .ie9 & {
- border-color: transparent transparent transparent @btn__base__disabled__background-color;
- }
- }
-
- &:focus,
- &:hover,
- &:active {
- &:after {
- .ie9 & {
- border-left-color: @btn__base__disabled__background-color;
- }
- }
- }
- }
}
.btn-prime {
@@ -285,25 +228,6 @@
left: 1px;
}
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- &:after {
- .ie9 & {
- border-color: transparent transparent transparent @btn-prime__disabled__background-color;
- }
- }
-
- &:hover,
- &:active {
- &:after {
- .ie9 & {
- border-left-color: @btn-prime__disabled__background-color;
- }
- }
- }
- }
}
}
@@ -342,25 +266,6 @@
right: 1px;
}
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- &:after {
- .ie9 & {
- border-color: transparent @btn__base__disabled__background-color transparent transparent;
- }
- }
-
- &:hover,
- &:active {
- &:after {
- .ie9 & {
- border-right-color: @btn__base__disabled__background-color;
- }
- }
- }
- }
}
.btn-prime {
@@ -387,25 +292,6 @@
right: 1px;
}
}
-
- // Disabled state for IE9
- &[disabled],
- &.disabled {
- &:after {
- .ie9 & {
- border-color: transparent @btn-prime__disabled__background-color transparent transparent;
- }
- }
-
- &:hover,
- &:active {
- &:after {
- .ie9 & {
- border-right-color: @btn-prime__disabled__background-color;
- }
- }
- }
- }
}
}
diff --git a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/forms/_selects.less b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/forms/_selects.less
index 7e5d34e48892a..76973802a3d2e 100644
--- a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/forms/_selects.less
+++ b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/lib/forms/_selects.less
@@ -47,10 +47,6 @@
top: 0;
width: @select-check__size;
z-index: -2;
-
- .ie9 & {
- display: none;
- }
}
&:before {
@@ -66,10 +62,6 @@
top: 50%;
width: 0;
z-index: -1;
-
- .ie9 & {
- display: none;
- }
}
.form-el-select {
@@ -82,11 +74,6 @@
padding: @form-el__padding-top ~'calc(@{select-check__size} + 10%)' @form-el__padding-bottom @form-el__padding-side;
width: 110%;
- .ie9 & {
- padding-right: @form-el__padding-side;
- width: 100%;
- }
-
&::-ms-expand {
display: none;
}
diff --git a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/pages/_common.less b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/pages/_common.less
index b71c94f2917c8..2b33d1fa542b6 100644
--- a/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/pages/_common.less
+++ b/app/design/adminhtml/Magento/backend/web/app/setup/styles/less/pages/_common.less
@@ -19,12 +19,6 @@
padding-top: @main__indent-top;
}
-.menu-wrapper {
- .logo-static {
- pointer-events: none;
- }
-}
-
//
// Header
// _____________________________________________
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less
index 4377687fd3d39..886bbcc29a3b9 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less
@@ -23,8 +23,15 @@
}
.abs-action-pattern {
+ &[disabled],
+ &.disabled {
+ cursor: default;
+ opacity: @disabled__opacity;
+ pointer-events: none;
+ }
+
border: @button__border-size @button__border-style;
- border-radius: 0; // ToDo UI: Delete with admin scope
+ border-radius: 0; // ToDo UI Delete with admin scope
display: inline-block;
font-family: @button__font-family;
font-size: @button__font-size;
@@ -33,13 +40,6 @@
padding: @button__padding-top @button__padding-horizontal @button__padding-bottom;
text-align: center;
vertical-align: baseline;
-
- &[disabled],
- &.disabled {
- cursor: default;
- opacity: @disabled__opacity;
- pointer-events: none;
- }
}
.abs-action-l {
@@ -142,16 +142,6 @@
box-shadow: @button__hover__box-shadow;
}
}
-
- &[disabled],
- &.disabled {
- .ie9 &,
- .ie10 & {
- background-color: @button-triangle__base__disabled__background-color;
- opacity: 1;
- text-shadow: none;
- }
- }
}
}
@@ -182,17 +172,6 @@
border-left-color: @button__hover__background-color;
}
}
-
- // Disabled state for IE9, IE10
- &.disabled,
- &[disabled] {
- &:after {
- .ie9 &,
- .ie10 & {
- border-color: transparent transparent transparent @button-triangle__base__disabled__background-color;
- }
- }
- }
}
.action-primary {
@@ -238,17 +217,6 @@
border-right-color: @button__hover__background-color;
}
}
-
- // Disabled state for IE9, IE10
- &.disabled,
- &[disabled] {
- &:after {
- .ie9 &,
- .ie10 & {
- border-color: transparent @button-triangle__base__disabled__background-color transparent transparent;
- }
- }
- }
}
.action-primary {
@@ -433,7 +401,7 @@ button {
left: 0;
list-style: none;
margin: 2px 0 0; // Action box-shadow + 1px indent
- min-width: 0; // ToDo UI: Should be deleted with old styles
+ min-width: 0; // ToDo UI Should be deleted with old styles
padding: 0;
position: absolute;
right: 0;
@@ -444,7 +412,7 @@ button {
}
> li {
- border: none; // ToDo UI: Should be deleted with old styles
+ border: none; // ToDo UI Should be deleted with old styles
display: block;
padding: 0;
transition: background-color .1s linear;
@@ -495,11 +463,6 @@ button {
position: absolute;
right: auto;
top: auto;
-
- .ie9 & {
- margin-left: 99%;
- margin-top: -3.5rem;
- }
}
a {
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_reset.less b/app/design/adminhtml/Magento/backend/web/css/source/_reset.less
index 3a2847c82b8ce..51de756bff16c 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/_reset.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/_reset.less
@@ -12,6 +12,7 @@ html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
box-sizing: border-box;
+ text-size-adjust: 100%;
}
* {
@@ -87,8 +88,6 @@ template {
// ---------------------------------------------
a {
- background-color: transparent; // Remove the gray background color from active links in IE 10.
-
// Improve readability when focused and also mouse hovered in all browsers.
&:active,
&:hover {
@@ -107,7 +106,7 @@ abbr {
}
}
-// Address style set to 'bolder' in Firefox 4+, Safari, and Chrome.
+// Address style set to 'bolder' in Firefox 4 and later, Safari, and Chrome.
b,
strong {
font-weight: bold;
@@ -206,9 +205,9 @@ input,
optgroup,
select,
textarea {
- color: inherit; // Correct color not being inherited. Known issue: affects color of disabled elements.
+ color: inherit; // Correct color not being inherited. Known issue affects color of disabled elements.
font: inherit; // Correct font properties not being inherited.
- margin: 0; // Address margins set differently in Firefox 4+, Safari, and Chrome.
+ margin: 0; // Address margins set differently in Firefox 4 and later, Safari, and Chrome.
}
// Address 'overflow' set to 'hidden' in IE 8/9/10/11.
@@ -234,6 +233,7 @@ html input[type='button'],
input[type='reset'],
input[type='submit'] {
-webkit-appearance: button;
+ appearance: button;
cursor: pointer;
}
@@ -243,7 +243,7 @@ html input[disabled] {
cursor: default;
}
-// Remove inner padding and border in Firefox 4+.
+// Remove inner padding and border in Firefox 4 and later.
button,
input {
&::-moz-focus-inner {
@@ -252,7 +252,7 @@ input {
}
}
-// Address Firefox 4+ setting 'line-height' on 'input' using '!important' in the UA stylesheet.
+// Address Firefox 4 and later setting 'line-height' on 'input' using '!important' in the UA stylesheet.
input {
line-height: normal;
}
@@ -275,6 +275,7 @@ input[type='number'] {
// Address 'appearance' set to 'searchfield' in Safari and Chrome.
input[type='search'] {
-webkit-appearance: textfield;
+ appearance: textfield;
}
// Remove inner padding and search cancel button in Safari and Chrome on OS X.
@@ -283,6 +284,7 @@ input[type='search'] {
&::-webkit-search-cancel-button,
&::-webkit-search-decoration {
-webkit-appearance: none;
+ appearance: none;
}
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
index a2e6a4485cc02..cd089232412dc 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
@@ -168,6 +168,9 @@
width: auto;
z-index: 1;
+ /**
+ * @codingStandardsIgnoreStart
+ */
&:hover {
&:extend(.abs-form-control-pattern:hover);
}
@@ -231,7 +234,6 @@
border: 0;
display: inline;
margin: 0;
- width: 6rem;
body._keyfocus &:focus {
box-shadow: none;
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-switcher.less b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-switcher.less
index fbef3f4b5f3a6..cf7a8dd56cb3b 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-switcher.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-switcher.less
@@ -130,7 +130,6 @@
display: block;
height: @actions-switcher__height;
transition: background @actions-switcher-speed ease-in 0s;
- vertical-align: middle;
width: @actions-switcher__width;
z-index: 0;
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_file-insertion.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_file-insertion.less
index 96b8ce8df1219..88962a1019a19 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/components/_file-insertion.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_file-insertion.less
@@ -26,6 +26,7 @@
border: none;
opacity: 1;
position: static;
+ transform: none;
}
}
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_file-uploader.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_file-uploader.less
index 79e3975a41bc6..9a88d5e3593b9 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/components/_file-uploader.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_file-uploader.less
@@ -74,6 +74,14 @@
box-shadow: 0 0 0 1px @file-uploader-preview-focus__color;
}
}
+
+ &:disabled {
+ + .file-uploader-button {
+ cursor: default;
+ opacity: .5;
+ pointer-events: none;
+ }
+ }
}
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less
index 85ccc235a3bdd..9a5f35e4ede90 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less
@@ -159,7 +159,7 @@
}
.file-row {
- background: @color-white url("@{baseDir}mui/images/ajax-loader-big.gif") no-repeat 50% 50%; // TODO UI: remove after new uploader implemented
+ background: @color-white url("@{baseDir}mui/images/ajax-loader-big.gif") no-repeat 50% 50%;
bottom: 0;
height: 100%;
left: 0;
@@ -324,6 +324,7 @@
-ms-flex: 1;
-webkit-box-flex: 1;
-webkit-flex: 1;
+ box-flex: 1;
flex: 1;
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_popups.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_popups.less
index 7bd10ad491f0c..d1d1ff9891634 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/components/_popups.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_popups.less
@@ -283,6 +283,7 @@
border: none;
opacity: 1;
position: static;
+ transform: none;
}
}
@@ -462,25 +463,3 @@
}
}
}
-
-.ie9 {
- .catalog-product-attribute-edit {
- &.attribute-popup {
- min-width: 0;
-
- .menu-wrapper {
- display: none;
- }
-
- .page-actions {
- button {
- float: none;
- }
-
- .primary {
- float: right;
- }
- }
- }
- }
-}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_spinner.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_spinner.less
index c9e56a29f275f..f6f61c1efae91 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/components/_spinner.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_spinner.less
@@ -33,14 +33,6 @@
position: absolute;
width: 1em;
}
-
- .ie9 & {
- background: url('@{baseDir}images/ajax-loader.gif') no-repeat center;
-
- > span {
- display: none;
- }
- }
}
// ToDo UI: remove old loaders style while loaders redesign
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less
index 5f1cee13b5b88..bb51abaa0f156 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less
@@ -100,26 +100,8 @@
&::-ms-expand {
display: none;
}
-
- .ie9 & {
- background-image: none;
- padding-right: @field-control__padding-horizontal;
- }
}
-// ToDo UI: add month and date styles
-// .admin__control-select-month {
-// width: 140px;
-// }
-
-// .admin__control-select-year {
-// width: 103px;
-// }
-
-// .admin__control-cvn {
-// width: 3em;
-// }
-
option:empty {
display: none;
}
@@ -152,21 +134,24 @@ option:empty {
&:before {
&:extend(.abs-form-control-pattern);
- content:'';
- left: 0;
- position: absolute;
- top: 0;
- width: 100%;
- z-index: 0;
-
.admin__control-file:active + &,
.admin__control-file:focus + & {
+ /**
+ * @codingStandardsIgnoreStart
+ */
&:extend(.abs-form-control-pattern:focus);
}
.admin__control-file[disabled] + & {
&:extend(.abs-form-control-pattern[disabled]);
}
+
+ content: '';
+ left: 0;
+ position: absolute;
+ top: 0;
+ width: 100%;
+ z-index: 0;
}
}
@@ -336,35 +321,3 @@ option:empty {
.admin__addon-prefix {
.lib-vendor-prefix-order(0);
}
-
-.ie9 {
- .admin__control-addon {
- &:after {
- clear: both;
- content: '';
- display: block;
- height: 0;
- overflow: hidden;
- }
- }
-
- .admin__addon {
- min-width: 0;
- overflow: hidden;
- text-align: right;
- white-space: nowrap;
- width: auto;
-
- [class*='admin__control-'] {
- display: inline;
- }
-
- &-prefix {
- float: left;
- }
-
- &-suffix {
- float: right;
- }
- }
-}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
index 59675de698787..8f0d4c33a8ee7 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
@@ -183,10 +183,13 @@
.admin__field-label {
color: @field-label__color;
- cursor: pointer;
margin: 0;
text-align: right;
+ label {
+ cursor: pointer;
+ }
+
+ br {
display: none;
}
@@ -207,7 +210,7 @@
overflow: hidden;
}
- span {
+ label {
display: inline-block;
line-height: @field-label__line-height;
vertical-align: middle;
@@ -512,7 +515,7 @@
position: absolute;
top: 0;
- span {
+ label {
&:before {
display: block;
}
@@ -527,7 +530,7 @@
}
& > .admin__field-label {
- span {
+ label {
&:before {
display: none;
}
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
index 0bfa454adbf0d..df031bebeb24a 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
@@ -408,6 +408,9 @@ label.mage-error {
width: 16px;
z-index: 1;
+ /**
+ * @codingStandardsIgnoreStart
+ */
&:before {
&:extend(.admin__control-checkbox + label:before);
left: 0;
@@ -434,6 +437,7 @@ label.mage-error {
&:before {
&:extend(.admin__control-checkbox:checked + label:before);
}
+ // @codingStandardsIgnoreEnd
}
&._indeterminate {
@@ -470,6 +474,7 @@ label.mage-error {
.action-select-multiselect {
-webkit-appearance: menulist-button;
+ appearance: menulist-button;
height: 38px;
left: -1rem;
min-width: 0;
diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less
index 8d314e06899b3..74098f127eb73 100644
--- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less
+++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less
@@ -279,7 +279,6 @@
.nested .choice .label,
.nested .choice .control {
float: none;
- width: auto;
position: static;
left: auto;
text-align: left;
@@ -1215,6 +1214,7 @@
-webkit-user-select: none; // use in 41 Chrome
-moz-user-select: none; // use in 36 Firefox
-ms-user-select: none; // use in 11 IE
+ user-select: none;
min-height: 39px;
}
@@ -3905,117 +3905,6 @@
}
}
-//
-// IE9 styles
-// ---------------------------------------------
-
-.ie9 {
- .admin__scope-old {
- select {
- &:not([multiple]) {
- padding-right: 4px;
- min-width: 0;
- }
- }
-
- // Table Filters
- .filter select {
- &:not([multiple]) {
- padding-right: 0;
- }
- }
-
- .adminhtml-widget-instance-edit {
- .grid-chooser .control {
- margin-top: -18px;
- }
- }
- .page-layout-admin-1column .page-columns,
- .catalog-product-edit,
- .catalog-product-new,
- .catalog-category-edit {
- table.data {
- table-layout: fixed;
- word-wrap: break-word;
-
- th {
- word-wrap: normal;
- overflow: hidden;
- vertical-align: top;
-
- > span {
- white-space: normal;
- }
- }
-
- th:not(.col-select):not(.col-id):not(.col-severity),
- td:not(.col-select):not(.col-id):not(.col-severity) {
- width: auto;
- }
- }
- }
-
- #setGrid_table,
- #attributeGrid_table,
- .custom-options .data-table,
- .ui-dialog .data,
- .page-layout-admin-1column .page-columns .data,
- .catalog-category-edit .data {
- word-wrap: break-word;
- table-layout: fixed;
- }
-
- .fieldset-wrapper {
- table.data {
- table-layout: inherit;
- word-wrap: normal;
- }
- }
-
- .sales-order-create-index table.data,
- .sales-order-create-index .fieldset-wrapper table.data {
- table-layout: fixed;
- word-wrap: break-word;
-
- th {
- word-wrap: normal;
- overflow: hidden;
- vertical-align: top;
-
- > span {
- white-space: normal;
- }
- }
- }
-
- .entry-edit .product-options .grouped-items-table {
- table-layout: fixed;
- word-wrap: break-word;
-
- th {
- word-wrap: normal;
- overflow: hidden;
- vertical-align: top;
-
- > span {
- white-space: normal;
- }
- }
- }
-
- .catalog-category-edit,
- .adminhtml-cache-index,
- .adminhtml-process-list,
- .indexer-indexer-list,
- .adminhtml-notification-index {
- table.data {
- table-layout: inherit;
- word-wrap: normal;
- }
- }
- }
-}
-
//
// Pages styles
// ---------------------------------------------
diff --git a/app/design/adminhtml/Magento/backend/web/mui/styles/_table.less b/app/design/adminhtml/Magento/backend/web/mui/styles/_table.less
index 7565ee88714f6..70ae82045b3d1 100644
--- a/app/design/adminhtml/Magento/backend/web/mui/styles/_table.less
+++ b/app/design/adminhtml/Magento/backend/web/mui/styles/_table.less
@@ -204,16 +204,6 @@
}
}
-.eq-ie9 {
- .hor-scroll {
- display: inline-block;
- min-height: 0;
- overflow-y: hidden;
- overflow-x: auto;
- width: 100%;
- }
-}
-
td.col-period,
td.col-date,
td.col-date_to,
@@ -455,7 +445,6 @@ td.col-type {
.import {
display: block;
- vertical-align: top;
}
.action-reset {
diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less
index bb14a3c2521b0..d3d15019f0e87 100644
--- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less
+++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less
@@ -305,7 +305,7 @@
white-space: nowrap;
width: 33%;
- &:before {
+ &[data-th]:before {
content: attr(data-th) ':';
display: block;
font-weight: @font-weight__bold;
diff --git a/app/design/frontend/Magento/blank/Magento_Sales/web/css/source/_email.less b/app/design/frontend/Magento/blank/Magento_Sales/web/css/source/_email.less
index 84adec39c8892..215d7d8b322b4 100644
--- a/app/design/frontend/Magento/blank/Magento_Sales/web/css/source/_email.less
+++ b/app/design/frontend/Magento/blank/Magento_Sales/web/css/source/_email.less
@@ -203,7 +203,8 @@
text-align: center;
}
- .item-price {
+ .item-price,
+ .item-subtotal {
text-align: right;
}
diff --git a/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less
index ed7af5872483b..f1e1529d9820f 100644
--- a/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less
@@ -297,7 +297,6 @@
width: 100%;
}
- .ie10 &,
.ie11 & {
height: 100%;
}
diff --git a/app/design/frontend/Magento/blank/web/css/source/_extends.less b/app/design/frontend/Magento/blank/web/css/source/_extends.less
index c177f91e9e7e8..6df78859a1a80 100644
--- a/app/design/frontend/Magento/blank/web/css/source/_extends.less
+++ b/app/design/frontend/Magento/blank/web/css/source/_extends.less
@@ -846,7 +846,7 @@
white-space: nowrap;
width: 33%;
- &:before {
+ &[data-th]:before {
content: attr(data-th) ':';
display: block;
font-weight: @font-weight__bold;
diff --git a/app/design/frontend/Magento/blank/web/css/source/_layout.less b/app/design/frontend/Magento/blank/web/css/source/_layout.less
index 8d01ddc0a9bd3..a81a3fa8d1f17 100644
--- a/app/design/frontend/Magento/blank/web/css/source/_layout.less
+++ b/app/design/frontend/Magento/blank/web/css/source/_layout.less
@@ -98,10 +98,6 @@
.lib-vendor-prefix-flex-grow(1);
.lib-vendor-prefix-flex-shrink(0);
.lib-vendor-prefix-flex-basis(auto);
-
- .ie9 & {
- width: auto;
- }
}
.columns {
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less
index 43b0351f0ff77..9e3a28be4c90e 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less
@@ -460,7 +460,7 @@
white-space: nowrap;
width: 33%;
- &:before {
+ &[data-th]:before {
content: attr(data-th);
display: block;
font-weight: @font-weight__semibold;
diff --git a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
old mode 100644
new mode 100755
index c6a240fd55ea2..d7ae6c3b28f4a
--- a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
@@ -224,7 +224,7 @@
.column.main & {
}
}
-
+ display: block;
margin-bottom: @indent__s;
}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_email.less b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_email.less
index 9a3f433618c36..3f19d1020bab9 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_email.less
+++ b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_email.less
@@ -207,7 +207,8 @@
text-align: center;
}
- .item-price {
+ .item-price,
+ .item-subtotal {
text-align: right;
}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less
index 692f91ef463b1..a0f734b05cbd1 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less
@@ -482,7 +482,7 @@
.options-label + .item-options-container,
.item-options-container + .item-options-container {
- &:before {
+ &[data-th]:before {
content: attr(data-th) ':';
display: block;
font-weight: @font-weight__bold;
diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
index 2c177571b9f5a..af6cfa8605f6d 100644
--- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
@@ -62,13 +62,6 @@
// Common
// _____________________________________________
-.page-wrapper {
- .ie9 & {
- .lib-css(background-color, @page__background-color);
- min-height: 0;
- }
-}
-
& when (@media-common = true) {
body {
.lib-css(background-color, @page__background-color);
@@ -433,6 +426,17 @@
}
}
+//
+// Mobile
+// _____________________________________________
+
+.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
+ .cms-page-view .page-main {
+ padding-top: 41px;
+ position: relative;
+ }
+}
+
//
// Desktop
// _____________________________________________
@@ -443,12 +447,6 @@
height: 100%; // Stretch screen area for sticky footer
}
- body {
- .ie9 & {
- .lib-css(background-color, @copyright__background-color);
- }
- }
-
.navigation ul {
padding: 0 8px;
}
@@ -630,7 +628,6 @@
width: 100%;
}
- .ie10 &,
.ie11 & {
height: 100%;
}
diff --git a/app/design/frontend/Magento/luma/web/css/source/_extends.less b/app/design/frontend/Magento/luma/web/css/source/_extends.less
index 760ec9ed861a9..7c9f5b7a65ab4 100644
--- a/app/design/frontend/Magento/luma/web/css/source/_extends.less
+++ b/app/design/frontend/Magento/luma/web/css/source/_extends.less
@@ -7,6 +7,8 @@
// List default styles reset
// ---------------------------------------------
+@_column-number: 1;
+
& when (@media-common = true) {
.abs-reset-list {
.lib-list-reset-styles();
@@ -705,7 +707,7 @@
// ---------------------------------------------
@abs-form-field-revert-column-1: {
- .lib-form-field-column-number(@_column-number: 1);
+ .lib-form-field-column-number(@_column-number);
};
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
@@ -760,7 +762,7 @@
white-space: nowrap;
width: 33%;
- &:before {
+ &[data-th]:before {
content: attr(data-th) ':';
display: block;
font-weight: @font-weight__bold;
diff --git a/app/design/frontend/Magento/luma/web/css/source/_forms.less b/app/design/frontend/Magento/luma/web/css/source/_forms.less
index 7c5027aef113b..0c7150c18550b 100644
--- a/app/design/frontend/Magento/luma/web/css/source/_forms.less
+++ b/app/design/frontend/Magento/luma/web/css/source/_forms.less
@@ -98,11 +98,6 @@
&::-ms-expand {
display: none;
}
-
- .lt-ie10 & {
- background-image: none;
- padding-right: 4px;
- }
}
select {
diff --git a/app/etc/di.xml b/app/etc/di.xml
index 6a4a6d16b5568..5bc25e6cb85f7 100755
--- a/app/etc/di.xml
+++ b/app/etc/di.xml
@@ -206,6 +206,7 @@
+
diff --git a/composer.json b/composer.json
index 760ec0da13f42..b7435e98695c3 100644
--- a/composer.json
+++ b/composer.json
@@ -38,7 +38,7 @@
"elasticsearch/elasticsearch": "~2.0|~5.1",
"magento/composer": "~1.4.0",
"magento/magento-composer-installer": ">=0.1.11",
- "magento/zendframework1": "~1.14.0",
+ "magento/zendframework1": "~1.14.1",
"monolog/monolog": "^1.17",
"oyejorge/less.php": "~1.7.0",
"pelago/emogrifier": "^2.0.0",
@@ -81,6 +81,7 @@
"zendframework/zend-view": "~2.10.0"
},
"require-dev": {
+ "magento/magento2-functional-testing-framework": "2.3.4",
"friendsofphp/php-cs-fixer": "~2.12.0",
"lusitanian/oauth": "~0.8.10",
"pdepend/pdepend": "2.5.2",
diff --git a/composer.lock b/composer.lock
index 0966aee19489e..d90750e2547ef 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c6ae2be0f066e566e8280b2954aad257",
+ "content-hash": "74013a4027763e05b29b127b4c03c752",
"packages": [
{
"name": "braintree/braintree_php",
@@ -201,16 +201,16 @@
},
{
"name": "composer/ca-bundle",
- "version": "1.1.1",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169"
+ "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169",
- "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0",
+ "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0",
"shasum": ""
},
"require": {
@@ -253,30 +253,30 @@
"ssl",
"tls"
],
- "time": "2018-03-29T19:57:20+00:00"
+ "time": "2018-08-08T08:57:40+00:00"
},
{
"name": "composer/composer",
- "version": "1.6.5",
+ "version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
- "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9"
+ "reference": "5d9311d4555787c8a57fea15f82471499aedf712"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/b184a92419cc9a9c4c6a09db555a94d441cb11c9",
- "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9",
+ "url": "https://api.github.com/repos/composer/composer/zipball/5d9311d4555787c8a57fea15f82471499aedf712",
+ "reference": "5d9311d4555787c8a57fea15f82471499aedf712",
"shasum": ""
},
"require": {
"composer/ca-bundle": "^1.0",
"composer/semver": "^1.0",
"composer/spdx-licenses": "^1.2",
+ "composer/xdebug-handler": "^1.1",
"justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0",
"php": "^5.3.2 || ^7.0",
"psr/log": "^1.0",
- "seld/cli-prompt": "^1.0",
"seld/jsonlint": "^1.4",
"seld/phar-utils": "^1.0",
"symfony/console": "^2.7 || ^3.0 || ^4.0",
@@ -302,7 +302,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.6-dev"
+ "dev-master": "1.7-dev"
}
},
"autoload": {
@@ -333,7 +333,7 @@
"dependency",
"package"
],
- "time": "2018-05-04T09:44:59+00:00"
+ "time": "2018-08-07T07:39:23+00:00"
},
{
"name": "composer/semver",
@@ -458,6 +458,50 @@
],
"time": "2018-04-30T10:33:04+00:00"
},
+ {
+ "name": "composer/xdebug-handler",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08",
+ "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0",
+ "psr/log": "^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "description": "Restarts a process without xdebug.",
+ "keywords": [
+ "Xdebug",
+ "performance"
+ ],
+ "time": "2018-04-11T15:42:36+00:00"
+ },
{
"name": "container-interop/container-interop",
"version": "1.2.0",
@@ -546,16 +590,16 @@
},
{
"name": "guzzlehttp/ringphp",
- "version": "1.1.0",
+ "version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/RingPHP.git",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b"
+ "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b",
+ "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b",
"shasum": ""
},
"require": {
@@ -593,7 +637,7 @@
}
],
"description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
- "time": "2015-05-20T03:37:09+00:00"
+ "time": "2018-07-31T13:22:33+00:00"
},
{
"name": "guzzlehttp/streams",
@@ -828,25 +872,18 @@
},
{
"name": "magento/zendframework1",
- "version": "1.14.0",
+ "version": "1.14.1",
"source": {
"type": "git",
"url": "https://github.com/magento/zf1.git",
- "reference": "68522e5768edc8e829d1f64b620a3de3753f1141"
+ "reference": "4df018254c70b5b998b00a8cb1a30760f831ff0d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/magento/zf1/zipball/68522e5768edc8e829d1f64b620a3de3753f1141",
- "reference": "68522e5768edc8e829d1f64b620a3de3753f1141",
+ "url": "https://api.github.com/repos/magento/zf1/zipball/4df018254c70b5b998b00a8cb1a30760f831ff0d",
+ "reference": "4df018254c70b5b998b00a8cb1a30760f831ff0d",
"shasum": ""
},
- "archive": {
- "exclude": [
- "/demos",
- "/documentation",
- "/tests"
- ]
- },
"require": {
"php": ">=5.2.11"
},
@@ -865,6 +902,7 @@
"Zend_": "library/"
}
},
+ "notification-url": "https://packagist.org/downloads/",
"include-path": [
"library/"
],
@@ -874,14 +912,10 @@
"description": "Magento Zend Framework 1",
"homepage": "http://framework.zend.com/",
"keywords": [
- "framework",
- "zf1"
+ "ZF1",
+ "framework"
],
- "support": {
- "source": "https://github.com/magento-engcom/zf1-php-7.2-support/tree/master",
- "issues": "https://github.com/magento-engcom/zf1-php-7.2-support/issues"
- },
- "time": "2018-04-06T17:12:22+00:00"
+ "time": "2018-08-09T15:03:40+00:00"
},
{
"name": "monolog/monolog",
@@ -1025,16 +1059,16 @@
},
{
"name": "paragonie/random_compat",
- "version": "v2.0.15",
+ "version": "v2.0.17",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09"
+ "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09",
- "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d",
+ "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d",
"shasum": ""
},
"require": {
@@ -1070,7 +1104,7 @@
"pseudorandom",
"random"
],
- "time": "2018-06-08T15:26:40+00:00"
+ "time": "2018-07-04T16:31:37+00:00"
},
{
"name": "pelago/emogrifier",
@@ -1625,54 +1659,6 @@
],
"time": "2018-06-13T15:59:06+00:00"
},
- {
- "name": "seld/cli-prompt",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/cli-prompt.git",
- "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
- "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Seld\\CliPrompt\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be"
- }
- ],
- "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type",
- "keywords": [
- "cli",
- "console",
- "hidden",
- "input",
- "prompt"
- ],
- "time": "2017-03-18T11:32:45+00:00"
- },
{
"name": "seld/jsonlint",
"version": "1.7.1",
@@ -1768,16 +1754,16 @@
},
{
"name": "symfony/console",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f"
+ "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f",
- "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f",
+ "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f",
+ "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f",
"shasum": ""
},
"require": {
@@ -1832,20 +1818,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-05-31T10:17:53+00:00"
+ "time": "2018-07-26T11:24:31+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5"
+ "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5",
- "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
+ "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
"shasum": ""
},
"require": {
@@ -1895,20 +1881,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2018-04-06T07:35:57+00:00"
+ "time": "2018-07-26T09:10:45+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c"
+ "reference": "2e30335e0aafeaa86645555959572fe7cea22b43"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c",
- "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/2e30335e0aafeaa86645555959572fe7cea22b43",
+ "reference": "2e30335e0aafeaa86645555959572fe7cea22b43",
"shasum": ""
},
"require": {
@@ -1945,20 +1931,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2018-05-30T07:26:09+00:00"
+ "time": "2018-07-26T11:24:31+00:00"
},
{
"name": "symfony/finder",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb"
+ "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb",
- "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/e162f1df3102d0b7472805a5a9d5db9fcf0a8068",
+ "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068",
"shasum": ""
},
"require": {
@@ -1994,29 +1980,32 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2018-06-19T21:38:16+00:00"
+ "time": "2018-07-26T11:24:31+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.8.0",
+ "version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
- "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-master": "1.9-dev"
}
},
"autoload": {
@@ -2049,20 +2038,20 @@
"polyfill",
"portable"
],
- "time": "2018-04-30T19:57:29+00:00"
+ "time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.8.0",
+ "version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "3296adf6a6454a050679cde90f95350ad604b171"
+ "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
- "reference": "3296adf6a6454a050679cde90f95350ad604b171",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
+ "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"shasum": ""
},
"require": {
@@ -2074,7 +2063,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-master": "1.9-dev"
}
},
"autoload": {
@@ -2108,20 +2097,20 @@
"portable",
"shim"
],
- "time": "2018-04-26T10:06:28+00:00"
+ "time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/process",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a"
+ "reference": "f01fc7a4493572f7f506c49dcb50ad01fb3a2f56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
- "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
+ "url": "https://api.github.com/repos/symfony/process/zipball/f01fc7a4493572f7f506c49dcb50ad01fb3a2f56",
+ "reference": "f01fc7a4493572f7f506c49dcb50ad01fb3a2f56",
"shasum": ""
},
"require": {
@@ -2157,7 +2146,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2018-05-31T10:17:53+00:00"
+ "time": "2018-07-26T11:24:31+00:00"
},
{
"name": "tedivm/jshrink",
@@ -2728,16 +2717,16 @@
},
{
"name": "zendframework/zend-diactoros",
- "version": "1.8.0",
+ "version": "1.8.5",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
- "reference": "11c9c1835e60eef6f9234377a480fcec096ebd9e"
+ "reference": "3e4edb822c942f37ade0d09579cfbab11e2fee87"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/11c9c1835e60eef6f9234377a480fcec096ebd9e",
- "reference": "11c9c1835e60eef6f9234377a480fcec096ebd9e",
+ "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/3e4edb822c942f37ade0d09579cfbab11e2fee87",
+ "reference": "3e4edb822c942f37ade0d09579cfbab11e2fee87",
"shasum": ""
},
"require": {
@@ -2750,7 +2739,7 @@
"require-dev": {
"ext-dom": "*",
"ext-libxml": "*",
- "phpunit/phpunit": "^5.7.16 || ^6.0.8",
+ "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7",
"zendframework/zend-coding-standard": "~1.0"
},
"type": "library",
@@ -2787,7 +2776,7 @@
"psr",
"psr-7"
],
- "time": "2018-06-27T18:52:43+00:00"
+ "time": "2018-08-10T14:16:32+00:00"
},
{
"name": "zendframework/zend-escaper",
@@ -2883,16 +2872,16 @@
},
{
"name": "zendframework/zend-feed",
- "version": "2.10.2",
+ "version": "2.10.3",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-feed.git",
- "reference": "5253f949f4ad999086ab9b408908b6c6776f24db"
+ "reference": "6641f4cf3f4586c63f83fd70b6d19966025c8888"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/5253f949f4ad999086ab9b408908b6c6776f24db",
- "reference": "5253f949f4ad999086ab9b408908b6c6776f24db",
+ "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/6641f4cf3f4586c63f83fd70b6d19966025c8888",
+ "reference": "6641f4cf3f4586c63f83fd70b6d19966025c8888",
"shasum": ""
},
"require": {
@@ -2940,7 +2929,7 @@
"feed",
"zf"
],
- "time": "2018-06-18T20:14:01+00:00"
+ "time": "2018-08-01T13:53:20+00:00"
},
{
"name": "zendframework/zend-filter",
@@ -3085,16 +3074,16 @@
},
{
"name": "zendframework/zend-http",
- "version": "2.8.0",
+ "version": "2.8.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-http.git",
- "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51"
+ "reference": "2c8aed3d25522618573194e7cc51351f8cd4a45b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-http/zipball/f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51",
- "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51",
+ "url": "https://api.github.com/repos/zendframework/zend-http/zipball/2c8aed3d25522618573194e7cc51351f8cd4a45b",
+ "reference": "2c8aed3d25522618573194e7cc51351f8cd4a45b",
"shasum": ""
},
"require": {
@@ -3136,7 +3125,7 @@
"zend",
"zf"
],
- "time": "2018-04-26T21:04:50+00:00"
+ "time": "2018-08-13T18:47:03+00:00"
},
{
"name": "zendframework/zend-hydrator",
@@ -4446,150 +4435,142 @@
],
"packages-dev": [
{
- "name": "composer/xdebug-handler",
- "version": "1.1.0",
+ "name": "allure-framework/allure-codeception",
+ "version": "1.2.7",
"source": {
"type": "git",
- "url": "https://github.com/composer/xdebug-handler.git",
- "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08"
+ "url": "https://github.com/allure-framework/allure-codeception.git",
+ "reference": "48598f4b4603b50b663bfe977260113a40912131"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08",
- "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08",
+ "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/48598f4b4603b50b663bfe977260113a40912131",
+ "reference": "48598f4b4603b50b663bfe977260113a40912131",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0",
- "psr/log": "^1.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ "allure-framework/allure-php-api": "~1.1.0",
+ "codeception/codeception": "~2.1",
+ "php": ">=5.4.0",
+ "symfony/filesystem": ">=2.6",
+ "symfony/finder": ">=2.6"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Composer\\XdebugHandler\\": "src"
+ "psr-0": {
+ "Yandex": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "Apache-2.0"
],
"authors": [
{
- "name": "John Stevenson",
- "email": "john-stevenson@blueyonder.co.uk"
+ "name": "Ivan Krutov",
+ "email": "vania-pooh@yandex-team.ru",
+ "role": "Developer"
}
],
- "description": "Restarts a process without xdebug.",
+ "description": "A Codeception adapter for Allure report.",
+ "homepage": "http://allure.qatools.ru/",
"keywords": [
- "Xdebug",
- "performance"
- ],
- "time": "2018-04-11T15:42:36+00:00"
+ "allure",
+ "attachments",
+ "cases",
+ "codeception",
+ "report",
+ "steps",
+ "testing"
+ ],
+ "time": "2018-03-07T11:18:27+00:00"
},
{
- "name": "doctrine/annotations",
- "version": "v1.6.0",
+ "name": "allure-framework/allure-php-api",
+ "version": "1.1.4",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/annotations.git",
- "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5"
+ "url": "https://github.com/allure-framework/allure-php-adapter-api.git",
+ "reference": "a462a0da121681577033e13c123b6cc4e89cdc64"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
- "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
+ "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64",
+ "reference": "a462a0da121681577033e13c123b6cc4e89cdc64",
"shasum": ""
},
"require": {
- "doctrine/lexer": "1.*",
- "php": "^7.1"
- },
- "require-dev": {
- "doctrine/cache": "1.*",
- "phpunit/phpunit": "^6.4"
+ "jms/serializer": ">=0.16.0",
+ "moontoast/math": ">=1.1.0",
+ "php": ">=5.4.0",
+ "phpunit/phpunit": ">=4.0.0",
+ "ramsey/uuid": ">=3.0.0",
+ "symfony/http-foundation": ">=2.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.6.x-dev"
- }
- },
"autoload": {
- "psr-4": {
- "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ "psr-0": {
+ "Yandex": [
+ "src/",
+ "test/"
+ ]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "Apache-2.0"
],
"authors": [
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Ivan Krutov",
+ "email": "vania-pooh@yandex-team.ru",
+ "role": "Developer"
}
],
- "description": "Docblock Annotations Parser",
- "homepage": "http://www.doctrine-project.org",
+ "description": "PHP API for Allure adapter",
+ "homepage": "http://allure.qatools.ru/",
"keywords": [
- "annotations",
- "docblock",
- "parser"
+ "allure",
+ "api",
+ "php",
+ "report"
],
- "time": "2017-12-06T07:11:42+00:00"
+ "time": "2016-12-07T12:15:46+00:00"
},
{
- "name": "doctrine/instantiator",
- "version": "1.1.0",
+ "name": "behat/gherkin",
+ "version": "v4.4.5",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+ "url": "https://github.com/Behat/Gherkin.git",
+ "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
+ "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
"shasum": ""
},
"require": {
- "php": "^7.1"
+ "php": ">=5.3.1"
},
"require-dev": {
- "athletic/athletic": "~0.1.8",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpunit/phpunit": "^6.2.3",
- "squizlabs/php_codesniffer": "^3.0.2"
+ "phpunit/phpunit": "~4.5|~5",
+ "symfony/phpunit-bridge": "~2.7|~3",
+ "symfony/yaml": "~2.3|~3"
+ },
+ "suggest": {
+ "symfony/yaml": "If you want to parse features, represented in YAML files"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2.x-dev"
+ "dev-master": "4.4-dev"
}
},
"autoload": {
- "psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ "psr-0": {
+ "Behat\\Gherkin": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -4598,45 +4579,93 @@
],
"authors": [
{
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "http://ocramius.github.com/"
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
}
],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://github.com/doctrine/instantiator",
+ "description": "Gherkin DSL parser for PHP 5.3",
+ "homepage": "http://behat.org/",
"keywords": [
- "constructor",
- "instantiate"
+ "BDD",
+ "Behat",
+ "Cucumber",
+ "DSL",
+ "gherkin",
+ "parser"
],
- "time": "2017-07-22T11:58:36+00:00"
+ "time": "2016-10-30T11:50:56+00:00"
},
{
- "name": "doctrine/lexer",
- "version": "v1.0.1",
+ "name": "codeception/codeception",
+ "version": "2.3.9",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/lexer.git",
- "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+ "url": "https://github.com/Codeception/Codeception.git",
+ "reference": "104f46fa0bde339f1bcc3a375aac21eb36e65a1e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
- "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "url": "https://api.github.com/repos/Codeception/Codeception/zipball/104f46fa0bde339f1bcc3a375aac21eb36e65a1e",
+ "reference": "104f46fa0bde339f1bcc3a375aac21eb36e65a1e",
"shasum": ""
},
"require": {
- "php": ">=5.3.2"
+ "behat/gherkin": "~4.4.0",
+ "codeception/stub": "^1.0",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "facebook/webdriver": ">=1.1.3 <2.0",
+ "guzzlehttp/guzzle": ">=4.1.4 <7.0",
+ "guzzlehttp/psr7": "~1.0",
+ "php": ">=5.4.0 <8.0",
+ "phpunit/php-code-coverage": ">=2.2.4 <6.0",
+ "phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0",
+ "sebastian/comparator": ">1.1 <3.0",
+ "sebastian/diff": ">=1.4 <3.0",
+ "symfony/browser-kit": ">=2.7 <5.0",
+ "symfony/console": ">=2.7 <5.0",
+ "symfony/css-selector": ">=2.7 <5.0",
+ "symfony/dom-crawler": ">=2.7 <5.0",
+ "symfony/event-dispatcher": ">=2.7 <5.0",
+ "symfony/finder": ">=2.7 <5.0",
+ "symfony/yaml": ">=2.7 <5.0"
+ },
+ "require-dev": {
+ "codeception/specify": "~0.3",
+ "facebook/graph-sdk": "~5.3",
+ "flow/jsonpath": "~0.2",
+ "monolog/monolog": "~1.8",
+ "pda/pheanstalk": "~3.0",
+ "php-amqplib/php-amqplib": "~2.4",
+ "predis/predis": "^1.0",
+ "squizlabs/php_codesniffer": "~2.0",
+ "symfony/process": ">=2.7 <5.0",
+ "vlucas/phpdotenv": "^2.4.0"
+ },
+ "suggest": {
+ "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module",
+ "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests",
+ "codeception/specify": "BDD-style code blocks",
+ "codeception/verify": "BDD-style assertions",
+ "flow/jsonpath": "For using JSONPath in REST module",
+ "league/factory-muffin": "For DataFactory module",
+ "league/factory-muffin-faker": "For Faker support in DataFactory module",
+ "phpseclib/phpseclib": "for SFTP option in FTP Module",
+ "stecman/symfony-console-completion": "For BASH autocompletion",
+ "symfony/phpunit-bridge": "For phpunit-bridge support"
},
+ "bin": [
+ "codecept"
+ ],
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "branch-alias": []
},
"autoload": {
- "psr-0": {
- "Doctrine\\Common\\Lexer\\": "lib/"
+ "psr-4": {
+ "Codeception\\": "src\\Codeception",
+ "Codeception\\Extension\\": "ext"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -4645,49 +4674,817 @@
],
"authors": [
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Michael Bodnarchuk",
+ "email": "davert@mail.ua",
+ "homepage": "http://codegyre.com"
}
],
- "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
- "homepage": "http://www.doctrine-project.org",
+ "description": "BDD-style testing framework",
+ "homepage": "http://codeception.com/",
"keywords": [
- "lexer",
- "parser"
+ "BDD",
+ "TDD",
+ "acceptance testing",
+ "functional testing",
+ "unit testing"
],
- "time": "2014-09-09T13:34:57+00:00"
+ "time": "2018-02-26T23:29:41+00:00"
},
{
- "name": "friendsofphp/php-cs-fixer",
- "version": "v2.12.1",
+ "name": "codeception/stub",
+ "version": "1.0.4",
"source": {
"type": "git",
- "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "beef6cbe6dec7205edcd143842a49f9a691859a6"
+ "url": "https://github.com/Codeception/Stub.git",
+ "reference": "681b62348837a5ef07d10d8a226f5bc358cc8805"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/beef6cbe6dec7205edcd143842a49f9a691859a6",
- "reference": "beef6cbe6dec7205edcd143842a49f9a691859a6",
+ "url": "https://api.github.com/repos/Codeception/Stub/zipball/681b62348837a5ef07d10d8a226f5bc358cc8805",
+ "reference": "681b62348837a5ef07d10d8a226f5bc358cc8805",
"shasum": ""
},
"require": {
- "composer/semver": "^1.4",
- "composer/xdebug-handler": "^1.0",
- "doctrine/annotations": "^1.2",
- "ext-json": "*",
- "ext-tokenizer": "*",
- "php": "^5.6 || >=7.0 <7.3",
- "php-cs-fixer/diff": "^1.3",
- "symfony/console": "^3.2 || ^4.0",
+ "phpunit/phpunit-mock-objects": ">2.3 <7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": ">=4.8 <8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Codeception\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Flexible Stub wrapper for PHPUnit's Mock Builder",
+ "time": "2018-05-17T09:31:08+00:00"
+ },
+ {
+ "name": "consolidation/annotated-command",
+ "version": "2.8.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/consolidation/annotated-command.git",
+ "reference": "651541a0b68318a2a202bda558a676e5ad92223c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/651541a0b68318a2a202bda558a676e5ad92223c",
+ "reference": "651541a0b68318a2a202bda558a676e5ad92223c",
+ "shasum": ""
+ },
+ "require": {
+ "consolidation/output-formatters": "^3.1.12",
+ "php": ">=5.4.0",
+ "psr/log": "^1",
+ "symfony/console": "^2.8|^3|^4",
+ "symfony/event-dispatcher": "^2.5|^3|^4",
+ "symfony/finder": "^2.5|^3|^4"
+ },
+ "require-dev": {
+ "g1a/composer-test-scenarios": "^2",
+ "phpunit/phpunit": "^6",
+ "satooshi/php-coveralls": "^2",
+ "squizlabs/php_codesniffer": "^2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Consolidation\\AnnotatedCommand\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Greg Anderson",
+ "email": "greg.1.anderson@greenknowe.org"
+ }
+ ],
+ "description": "Initialize Symfony Console commands from annotated command class methods.",
+ "time": "2018-05-25T18:04:25+00:00"
+ },
+ {
+ "name": "consolidation/config",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/consolidation/config.git",
+ "reference": "c9fc25e9088a708637e18a256321addc0670e578"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/consolidation/config/zipball/c9fc25e9088a708637e18a256321addc0670e578",
+ "reference": "c9fc25e9088a708637e18a256321addc0670e578",
+ "shasum": ""
+ },
+ "require": {
+ "dflydev/dot-access-data": "^1.1.0",
+ "grasmash/expander": "^1",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "g1a/composer-test-scenarios": "^1",
+ "phpunit/phpunit": "^5",
+ "satooshi/php-coveralls": "^1.0",
+ "squizlabs/php_codesniffer": "2.*",
+ "symfony/console": "^2.5|^3|^4",
+ "symfony/yaml": "^2.8.11|^3|^4"
+ },
+ "suggest": {
+ "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Consolidation\\Config\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Greg Anderson",
+ "email": "greg.1.anderson@greenknowe.org"
+ }
+ ],
+ "description": "Provide configuration services for a commandline tool.",
+ "time": "2018-08-07T22:57:00+00:00"
+ },
+ {
+ "name": "consolidation/log",
+ "version": "1.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/consolidation/log.git",
+ "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/consolidation/log/zipball/dfd8189a771fe047bf3cd669111b2de5f1c79395",
+ "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.0",
+ "psr/log": "~1.0",
+ "symfony/console": "^2.8|^3|^4"
+ },
+ "require-dev": {
+ "g1a/composer-test-scenarios": "^1",
+ "phpunit/phpunit": "4.*",
+ "satooshi/php-coveralls": "^2",
+ "squizlabs/php_codesniffer": "2.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Consolidation\\Log\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Greg Anderson",
+ "email": "greg.1.anderson@greenknowe.org"
+ }
+ ],
+ "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.",
+ "time": "2018-05-25T18:14:39+00:00"
+ },
+ {
+ "name": "consolidation/output-formatters",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/consolidation/output-formatters.git",
+ "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/d78ef59aea19d3e2e5a23f90a055155ee78a0ad5",
+ "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0",
+ "symfony/console": "^2.8|^3|^4",
+ "symfony/finder": "^2.5|^3|^4"
+ },
+ "require-dev": {
+ "g1a/composer-test-scenarios": "^2",
+ "phpunit/phpunit": "^5.7.27",
+ "satooshi/php-coveralls": "^2",
+ "squizlabs/php_codesniffer": "^2.7",
+ "symfony/console": "3.2.3",
+ "symfony/var-dumper": "^2.8|^3|^4",
+ "victorjonsson/markdowndocs": "^1.3"
+ },
+ "suggest": {
+ "symfony/var-dumper": "For using the var_dump formatter"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Consolidation\\OutputFormatters\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Greg Anderson",
+ "email": "greg.1.anderson@greenknowe.org"
+ }
+ ],
+ "description": "Format text by applying transformations provided by plug-in formatters.",
+ "time": "2018-05-25T18:02:34+00:00"
+ },
+ {
+ "name": "consolidation/robo",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/consolidation/Robo.git",
+ "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/consolidation/Robo/zipball/ac563abfadf7cb7314b4e152f2b5033a6c255f6f",
+ "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f",
+ "shasum": ""
+ },
+ "require": {
+ "consolidation/annotated-command": "^2.8.2",
+ "consolidation/config": "^1.0.10",
+ "consolidation/log": "~1",
+ "consolidation/output-formatters": "^3.1.13",
+ "grasmash/yaml-expander": "^1.3",
+ "league/container": "^2.2",
+ "php": ">=5.5.0",
+ "symfony/console": "^2.8|^3|^4",
+ "symfony/event-dispatcher": "^2.5|^3|^4",
+ "symfony/filesystem": "^2.5|^3|^4",
+ "symfony/finder": "^2.5|^3|^4",
+ "symfony/process": "^2.5|^3|^4"
+ },
+ "replace": {
+ "codegyre/robo": "< 1.0"
+ },
+ "require-dev": {
+ "codeception/aspect-mock": "^1|^2.1.1",
+ "codeception/base": "^2.3.7",
+ "codeception/verify": "^0.3.2",
+ "g1a/composer-test-scenarios": "^2",
+ "goaop/framework": "~2.1.2",
+ "goaop/parser-reflection": "^1.1.0",
+ "natxet/cssmin": "3.0.4",
+ "nikic/php-parser": "^3.1.5",
+ "patchwork/jsqueeze": "~2",
+ "pear/archive_tar": "^1.4.2",
+ "phpunit/php-code-coverage": "~2|~4",
+ "satooshi/php-coveralls": "^2",
+ "squizlabs/php_codesniffer": "^2.8"
+ },
+ "suggest": {
+ "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch",
+ "natxet/CssMin": "For minifying CSS files in taskMinify",
+ "patchwork/jsqueeze": "For minifying JS files in taskMinify",
+ "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively."
+ },
+ "bin": [
+ "robo"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev",
+ "dev-state": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Robo\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Davert",
+ "email": "davert.php@resend.cc"
+ }
+ ],
+ "description": "Modern task runner",
+ "time": "2018-05-27T01:42:53+00:00"
+ },
+ {
+ "name": "dflydev/dot-access-data",
+ "version": "v1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dflydev/dflydev-dot-access-data.git",
+ "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a",
+ "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Dflydev\\DotAccessData": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Dragonfly Development Inc.",
+ "email": "info@dflydev.com",
+ "homepage": "http://dflydev.com"
+ },
+ {
+ "name": "Beau Simensen",
+ "email": "beau@dflydev.com",
+ "homepage": "http://beausimensen.com"
+ },
+ {
+ "name": "Carlos Frutos",
+ "email": "carlos@kiwing.it",
+ "homepage": "https://github.com/cfrutos"
+ }
+ ],
+ "description": "Given a deep data structure, access data by dot notation.",
+ "homepage": "https://github.com/dflydev/dflydev-dot-access-data",
+ "keywords": [
+ "access",
+ "data",
+ "dot",
+ "notation"
+ ],
+ "time": "2017-01-20T21:14:22+00:00"
+ },
+ {
+ "name": "doctrine/annotations",
+ "version": "v1.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
+ "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^6.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "time": "2017-12-06T07:11:42+00:00"
+ },
+ {
+ "name": "doctrine/collections",
+ "version": "v1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/collections.git",
+ "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
+ "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "~0.1@dev",
+ "phpunit/phpunit": "^5.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Collections\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Collections Abstraction library",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "array",
+ "collections",
+ "iterator"
+ ],
+ "time": "2017-07-22T10:37:32+00:00"
+ },
+ {
+ "name": "doctrine/instantiator",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "^6.2.3",
+ "squizlabs/php_codesniffer": "^3.0.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2017-07-22T11:58:36+00:00"
+ },
+ {
+ "name": "doctrine/lexer",
+ "version": "v1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Lexer\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "lexer",
+ "parser"
+ ],
+ "time": "2014-09-09T13:34:57+00:00"
+ },
+ {
+ "name": "epfremme/swagger-php",
+ "version": "v2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/epfremmer/swagger-php.git",
+ "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/epfremmer/swagger-php/zipball/eee28a442b7e6220391ec953d3c9b936354f23bc",
+ "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/annotations": "^1.2",
+ "doctrine/collections": "^1.3",
+ "jms/serializer": "^1.1",
+ "php": ">=5.5",
+ "phpoption/phpoption": "^1.1",
+ "symfony/yaml": "^2.7|^3.1"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "~4.8|~5.0",
+ "satooshi/php-coveralls": "^1.0"
+ },
+ "type": "package",
+ "autoload": {
+ "psr-4": {
+ "Epfremme\\Swagger\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Edward Pfremmer",
+ "email": "epfremme@nerdery.com"
+ }
+ ],
+ "description": "Library for parsing swagger documentation into PHP entities for use in testing and code generation",
+ "time": "2016-09-26T17:24:17+00:00"
+ },
+ {
+ "name": "facebook/webdriver",
+ "version": "1.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/facebook/php-webdriver.git",
+ "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e",
+ "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-zip": "*",
+ "php": "^5.6 || ~7.0",
+ "symfony/process": "^2.8 || ^3.1 || ^4.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.0",
+ "jakub-onderka/php-parallel-lint": "^0.9.2",
+ "php-coveralls/php-coveralls": "^2.0",
+ "php-mock/php-mock-phpunit": "^1.1",
+ "phpunit/phpunit": "^5.7",
+ "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0",
+ "squizlabs/php_codesniffer": "^2.6",
+ "symfony/var-dumper": "^3.3 || ^4.0"
+ },
+ "suggest": {
+ "ext-SimpleXML": "For Firefox profile creation"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-community": "1.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Facebook\\WebDriver\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "A PHP client for Selenium WebDriver",
+ "homepage": "https://github.com/facebook/php-webdriver",
+ "keywords": [
+ "facebook",
+ "php",
+ "selenium",
+ "webdriver"
+ ],
+ "time": "2018-05-16T17:37:13+00:00"
+ },
+ {
+ "name": "flow/jsonpath",
+ "version": "0.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FlowCommunications/JSONPath.git",
+ "reference": "f0222818d5c938e4ab668ab2e2c079bd51a27112"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/f0222818d5c938e4ab668ab2e2c079bd51a27112",
+ "reference": "f0222818d5c938e4ab668ab2e2c079bd51a27112",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "peekmo/jsonpath": "dev-master",
+ "phpunit/phpunit": "^4.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Flow\\JSONPath": "src/",
+ "Flow\\JSONPath\\Test": "tests/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Stephen Frank",
+ "email": "stephen@flowsa.com"
+ }
+ ],
+ "description": "JSONPath implementation for parsing, searching and flattening arrays",
+ "time": "2018-03-04T16:39:47+00:00"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v2.12.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
+ "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/dcc87d5414e9d0bd316fce81a5bedb9ce720b183",
+ "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183",
+ "shasum": ""
+ },
+ "require": {
+ "composer/semver": "^1.4",
+ "composer/xdebug-handler": "^1.0",
+ "doctrine/annotations": "^1.2",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": "^5.6 || >=7.0 <7.3",
+ "php-cs-fixer/diff": "^1.3",
+ "symfony/console": "^3.2 || ^4.0",
"symfony/event-dispatcher": "^3.0 || ^4.0",
"symfony/filesystem": "^3.0 || ^4.0",
"symfony/finder": "^3.0 || ^4.0",
@@ -4698,46 +5495,534 @@
"symfony/stopwatch": "^3.0 || ^4.0"
},
"conflict": {
- "hhvm": "*"
+ "hhvm": "*"
+ },
+ "require-dev": {
+ "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
+ "justinrainbow/json-schema": "^5.0",
+ "keradus/cli-executor": "^1.1",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.1",
+ "php-cs-fixer/accessible-object": "^1.0",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1",
+ "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
+ "phpunitgoodpractices/traits": "^1.5.1",
+ "symfony/phpunit-bridge": "^4.0"
+ },
+ "suggest": {
+ "ext-mbstring": "For handling non-UTF8 characters in cache signature.",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
+ "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
+ },
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "type": "application",
+ "autoload": {
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ },
+ "classmap": [
+ "tests/Test/AbstractFixerTestCase.php",
+ "tests/Test/AbstractIntegrationCaseFactory.php",
+ "tests/Test/AbstractIntegrationTestCase.php",
+ "tests/Test/Assert/AssertTokensTrait.php",
+ "tests/Test/IntegrationCase.php",
+ "tests/Test/IntegrationCaseFactory.php",
+ "tests/Test/IntegrationCaseFactoryInterface.php",
+ "tests/Test/InternalIntegrationCaseFactory.php",
+ "tests/TestCase.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "A tool to automatically fix PHP code style",
+ "time": "2018-07-06T10:37:40+00:00"
+ },
+ {
+ "name": "fzaninotto/faker",
+ "version": "v1.8.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fzaninotto/Faker.git",
+ "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de",
+ "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "ext-intl": "*",
+ "phpunit/phpunit": "^4.8.35 || ^5.7",
+ "squizlabs/php_codesniffer": "^1.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Faker\\": "src/Faker/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "François Zaninotto"
+ }
+ ],
+ "description": "Faker is a PHP library that generates fake data for you.",
+ "keywords": [
+ "data",
+ "faker",
+ "fixtures"
+ ],
+ "time": "2018-07-12T10:23:15+00:00"
+ },
+ {
+ "name": "grasmash/expander",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/grasmash/expander.git",
+ "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f",
+ "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f",
+ "shasum": ""
+ },
+ "require": {
+ "dflydev/dot-access-data": "^1.1.0",
+ "php": ">=5.4"
+ },
+ "require-dev": {
+ "greg-1-anderson/composer-test-scenarios": "^1",
+ "phpunit/phpunit": "^4|^5.5.4",
+ "satooshi/php-coveralls": "^1.0.2|dev-master",
+ "squizlabs/php_codesniffer": "^2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Grasmash\\Expander\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Matthew Grasmick"
+ }
+ ],
+ "description": "Expands internal property references in PHP arrays file.",
+ "time": "2017-12-21T22:14:55+00:00"
+ },
+ {
+ "name": "grasmash/yaml-expander",
+ "version": "1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/grasmash/yaml-expander.git",
+ "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1",
+ "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1",
+ "shasum": ""
+ },
+ "require": {
+ "dflydev/dot-access-data": "^1.1.0",
+ "php": ">=5.4",
+ "symfony/yaml": "^2.8.11|^3|^4"
+ },
+ "require-dev": {
+ "greg-1-anderson/composer-test-scenarios": "^1",
+ "phpunit/phpunit": "^4.8|^5.5.4",
+ "satooshi/php-coveralls": "^1.0.2|dev-master",
+ "squizlabs/php_codesniffer": "^2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Grasmash\\YamlExpander\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Matthew Grasmick"
+ }
+ ],
+ "description": "Expands internal property references in a yaml file.",
+ "time": "2017-12-16T16:06:03+00:00"
+ },
+ {
+ "name": "guzzlehttp/guzzle",
+ "version": "6.3.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle.git",
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/promises": "^1.0",
+ "guzzlehttp/psr7": "^1.4",
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+ "psr/log": "^1.0"
+ },
+ "suggest": {
+ "psr/log": "Required for using the Log middleware"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "6.3-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "time": "2018-04-22T15:46:56+00:00"
+ },
+ {
+ "name": "guzzlehttp/promises",
+ "version": "v1.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/promises.git",
+ "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+ "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle promises library",
+ "keywords": [
+ "promise"
+ ],
+ "time": "2016-12-20T10:07:11+00:00"
+ },
+ {
+ "name": "guzzlehttp/psr7",
+ "version": "1.4.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/psr7.git",
+ "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
+ "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0",
+ "psr/http-message": "~1.0"
+ },
+ "provide": {
+ "psr/http-message-implementation": "1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Psr7\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Schultze",
+ "homepage": "https://github.com/Tobion"
+ }
+ ],
+ "description": "PSR-7 message implementation that also provides common utility methods",
+ "keywords": [
+ "http",
+ "message",
+ "request",
+ "response",
+ "stream",
+ "uri",
+ "url"
+ ],
+ "time": "2017-03-20T17:10:46+00:00"
+ },
+ {
+ "name": "jms/metadata",
+ "version": "1.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/metadata.git",
+ "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab",
+ "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "doctrine/cache": "~1.0",
+ "symfony/cache": "~3.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Metadata\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Class/method/property metadata management in PHP",
+ "keywords": [
+ "annotations",
+ "metadata",
+ "xml",
+ "yaml"
+ ],
+ "time": "2016-12-05T10:18:33+00:00"
+ },
+ {
+ "name": "jms/parser-lib",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/parser-lib.git",
+ "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d",
+ "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d",
+ "shasum": ""
+ },
+ "require": {
+ "phpoption/phpoption": ">=0.9,<2.0-dev"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "JMS\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache2"
+ ],
+ "description": "A library for easily creating recursive-descent parsers.",
+ "time": "2012-11-18T18:08:43+00:00"
+ },
+ {
+ "name": "jms/serializer",
+ "version": "1.13.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/serializer.git",
+ "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c",
+ "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/annotations": "^1.0",
+ "doctrine/instantiator": "^1.0.3",
+ "jms/metadata": "^1.3",
+ "jms/parser-lib": "1.*",
+ "php": "^5.5|^7.0",
+ "phpcollection/phpcollection": "~0.1",
+ "phpoption/phpoption": "^1.1"
+ },
+ "conflict": {
+ "twig/twig": "<1.12"
},
"require-dev": {
- "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
- "justinrainbow/json-schema": "^5.0",
- "keradus/cli-executor": "^1.1",
- "mikey179/vfsstream": "^1.6",
- "php-coveralls/php-coveralls": "^2.1",
- "php-cs-fixer/accessible-object": "^1.0",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1",
- "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
- "phpunitgoodpractices/traits": "^1.5",
- "symfony/phpunit-bridge": "^4.0"
+ "doctrine/orm": "~2.1",
+ "doctrine/phpcr-odm": "^1.3|^2.0",
+ "ext-pdo_sqlite": "*",
+ "jackalope/jackalope-doctrine-dbal": "^1.1.5",
+ "phpunit/phpunit": "^4.8|^5.0",
+ "propel/propel1": "~1.7",
+ "psr/container": "^1.0",
+ "symfony/dependency-injection": "^2.7|^3.3|^4.0",
+ "symfony/expression-language": "^2.6|^3.0",
+ "symfony/filesystem": "^2.1",
+ "symfony/form": "~2.1|^3.0",
+ "symfony/translation": "^2.1|^3.0",
+ "symfony/validator": "^2.2|^3.0",
+ "symfony/yaml": "^2.1|^3.0",
+ "twig/twig": "~1.12|~2.0"
},
"suggest": {
- "ext-mbstring": "For handling non-UTF8 characters in cache signature.",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
- "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
+ "doctrine/cache": "Required if you like to use cache functionality.",
+ "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.",
+ "symfony/yaml": "Required if you'd like to serialize data to YAML format."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-1.x": "1.13-dev"
+ }
},
- "bin": [
- "php-cs-fixer"
- ],
- "type": "application",
"autoload": {
- "psr-4": {
- "PhpCsFixer\\": "src/"
- },
- "classmap": [
- "tests/Test/AbstractFixerTestCase.php",
- "tests/Test/AbstractIntegrationCaseFactory.php",
- "tests/Test/AbstractIntegrationTestCase.php",
- "tests/Test/Assert/AssertTokensTrait.php",
- "tests/Test/IntegrationCase.php",
- "tests/Test/IntegrationCaseFactory.php",
- "tests/Test/IntegrationCaseFactoryInterface.php",
- "tests/Test/InternalIntegrationCaseFactory.php",
- "tests/TestCase.php"
- ]
+ "psr-0": {
+ "JMS\\Serializer": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -4745,16 +6030,89 @@
],
"authors": [
{
- "name": "Dariusz Rumiński",
- "email": "dariusz.ruminski@gmail.com"
+ "name": "Asmir Mustafic",
+ "email": "goetas@gmail.com"
},
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
}
],
- "description": "A tool to automatically fix PHP code style",
- "time": "2018-06-10T08:26:56+00:00"
+ "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
+ "homepage": "http://jmsyst.com/libs/serializer",
+ "keywords": [
+ "deserialization",
+ "jaxb",
+ "json",
+ "serialization",
+ "xml"
+ ],
+ "time": "2018-07-25T13:58:54+00:00"
+ },
+ {
+ "name": "league/container",
+ "version": "2.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/container.git",
+ "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0",
+ "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0",
+ "shasum": ""
+ },
+ "require": {
+ "container-interop/container-interop": "^1.2",
+ "php": "^5.4.0 || ^7.0"
+ },
+ "provide": {
+ "container-interop/container-interop-implementation": "^1.2",
+ "psr/container-implementation": "^1.0"
+ },
+ "replace": {
+ "orno/di": "~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-2.x": "2.x-dev",
+ "dev-1.x": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Container\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Phil Bennett",
+ "email": "philipobenito@gmail.com",
+ "homepage": "http://www.philipobenito.com",
+ "role": "Developer"
+ }
+ ],
+ "description": "A fast and intuitive dependency injection container.",
+ "homepage": "https://github.com/thephpleague/container",
+ "keywords": [
+ "container",
+ "dependency",
+ "di",
+ "injection",
+ "league",
+ "provider",
+ "service"
+ ],
+ "time": "2017-05-10T09:20:27+00:00"
},
{
"name": "lusitanian/oauth",
@@ -4823,6 +6181,172 @@
],
"time": "2018-02-14T22:37:14+00:00"
},
+ {
+ "name": "magento/magento2-functional-testing-framework",
+ "version": "2.3.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/magento/magento2-functional-testing-framework.git",
+ "reference": "ac56e5a6520dd580658034ae53d3724985c2a901"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ac56e5a6520dd580658034ae53d3724985c2a901",
+ "reference": "ac56e5a6520dd580658034ae53d3724985c2a901",
+ "shasum": ""
+ },
+ "require": {
+ "allure-framework/allure-codeception": "~1.2.6",
+ "codeception/codeception": "~2.3.4",
+ "consolidation/robo": "^1.0.0",
+ "epfremme/swagger-php": "^2.0",
+ "flow/jsonpath": ">0.2",
+ "fzaninotto/faker": "^1.6",
+ "monolog/monolog": "^1.0",
+ "mustache/mustache": "~2.5",
+ "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0",
+ "symfony/process": "^2.8 || ^3.1 || ^4.0",
+ "vlucas/phpdotenv": "^2.4"
+ },
+ "require-dev": {
+ "brainmaestro/composer-git-hooks": "^2.3",
+ "codacy/coverage": "^1.4",
+ "codeception/aspect-mock": "^3.0",
+ "doctrine/cache": "<1.7.0",
+ "goaop/framework": "2.2.0",
+ "php-coveralls/php-coveralls": "^1.0",
+ "phpmd/phpmd": "^2.6.0",
+ "rregeer/phpunit-coverage-check": "^0.1.4",
+ "sebastian/phpcpd": "~3.0 || ~4.0",
+ "squizlabs/php_codesniffer": "~3.2",
+ "symfony/stopwatch": "~3.4.6"
+ },
+ "bin": [
+ "bin/mftf"
+ ],
+ "type": "library",
+ "extra": {
+ "hooks": {
+ "pre-push": "bin/all-checks"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/Magento/FunctionalTestingFramework/_bootstrap.php"
+ ],
+ "psr-4": {
+ "Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework",
+ "MFTF\\": "dev/tests/functional/MFTF"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "AGPL-3.0"
+ ],
+ "description": "Magento2 Functional Testing Framework",
+ "keywords": [
+ "automation",
+ "functional",
+ "magento",
+ "testing"
+ ],
+ "time": "2018-08-10T20:16:42+00:00"
+ },
+ {
+ "name": "moontoast/math",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ramsey/moontoast-math.git",
+ "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
+ "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
+ "shasum": ""
+ },
+ "require": {
+ "ext-bcmath": "*",
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "jakub-onderka/php-parallel-lint": "^0.9.0",
+ "phpunit/phpunit": "^4.7|>=5.0 <5.4",
+ "satooshi/php-coveralls": "^0.6.1",
+ "squizlabs/php_codesniffer": "^2.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Moontoast\\Math\\": "src/Moontoast/Math/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Ben Ramsey",
+ "email": "ben@benramsey.com",
+ "homepage": "https://benramsey.com"
+ }
+ ],
+ "description": "A mathematics library, providing functionality for large numbers",
+ "homepage": "https://github.com/ramsey/moontoast-math",
+ "keywords": [
+ "bcmath",
+ "math"
+ ],
+ "time": "2017-02-16T16:54:46+00:00"
+ },
+ {
+ "name": "mustache/mustache",
+ "version": "v2.12.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/bobthecow/mustache.php.git",
+ "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e",
+ "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.4"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~1.11",
+ "phpunit/phpunit": "~3.7|~4.0|~5.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Mustache": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Justin Hileman",
+ "email": "justin@justinhileman.info",
+ "homepage": "http://justinhileman.com"
+ }
+ ],
+ "description": "A Mustache implementation in PHP.",
+ "homepage": "https://github.com/bobthecow/mustache.php",
+ "keywords": [
+ "mustache",
+ "templating"
+ ],
+ "time": "2017-07-11T12:54:05+00:00"
+ },
{
"name": "myclabs/deep-copy",
"version": "1.8.1",
@@ -5064,6 +6588,54 @@
],
"time": "2018-02-15T16:58:55+00:00"
},
+ {
+ "name": "phpcollection/phpcollection",
+ "version": "0.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/php-collection.git",
+ "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
+ "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
+ "shasum": ""
+ },
+ "require": {
+ "phpoption/phpoption": "1.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "PhpCollection": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache2"
+ ],
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "General-Purpose Collection Library for PHP",
+ "keywords": [
+ "collection",
+ "list",
+ "map",
+ "sequence",
+ "set"
+ ],
+ "time": "2015-05-17T12:39:23+00:00"
+ },
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@@ -5282,18 +6854,68 @@
],
"time": "2017-01-20T14:41:10+00:00"
},
+ {
+ "name": "phpoption/phpoption",
+ "version": "1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/php-option.git",
+ "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed",
+ "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.7.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "PhpOption\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache2"
+ ],
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Option Type for PHP",
+ "keywords": [
+ "language",
+ "option",
+ "php",
+ "type"
+ ],
+ "time": "2015-07-25T16:39:46+00:00"
+ },
{
"name": "phpspec/prophecy",
- "version": "1.7.6",
+ "version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
+ "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
- "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
+ "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
"shasum": ""
},
"require": {
@@ -5305,12 +6927,12 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7.x-dev"
+ "dev-master": "1.8.x-dev"
}
},
"autoload": {
@@ -5343,7 +6965,7 @@
"spy",
"stub"
],
- "time": "2018-04-18T13:57:24+00:00"
+ "time": "2018-08-05T17:53:17+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -5596,16 +7218,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "6.5.8",
+ "version": "6.5.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b"
+ "reference": "7bab54cb366076023bbf457a2a0d513332cd40f2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
- "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7bab54cb366076023bbf457a2a0d513332cd40f2",
+ "reference": "7bab54cb366076023bbf457a2a0d513332cd40f2",
"shasum": ""
},
"require": {
@@ -5623,7 +7245,7 @@
"phpunit/php-file-iterator": "^1.4.3",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-timer": "^1.0.9",
- "phpunit/phpunit-mock-objects": "^5.0.5",
+ "phpunit/phpunit-mock-objects": "^5.0.9",
"sebastian/comparator": "^2.1",
"sebastian/diff": "^2.0",
"sebastian/environment": "^3.1",
@@ -5676,20 +7298,20 @@
"testing",
"xunit"
],
- "time": "2018-04-10T11:38:34+00:00"
+ "time": "2018-08-07T07:05:35+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
- "version": "5.0.7",
+ "version": "5.0.10",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce"
+ "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3eaf040f20154d27d6da59ca2c6e28ac8fd56dce",
- "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f",
+ "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f",
"shasum": ""
},
"require": {
@@ -5702,7 +7324,7 @@
"phpunit/phpunit": "<6.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.5"
+ "phpunit/phpunit": "^6.5.11"
},
"suggest": {
"ext-soap": "*"
@@ -5735,7 +7357,7 @@
"mock",
"xunit"
],
- "time": "2018-05-29T13:50:43+00:00"
+ "time": "2018-08-09T05:50:03+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -6314,158 +7936,396 @@
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
"shasum": ""
},
- "require": {
- "php": ">=5.6.0"
+ "require": {
+ "php": ">=5.6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "time": "2015-07-28T20:34:47+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2016-10-03T07:35:21+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
+ "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "time": "2018-06-06T23:58:19+00:00"
+ },
+ {
+ "name": "symfony/browser-kit",
+ "version": "v4.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/browser-kit.git",
+ "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd",
+ "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "symfony/dom-crawler": "~3.4|~4.0"
+ },
+ "require-dev": {
+ "symfony/css-selector": "~3.4|~4.0",
+ "symfony/process": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\BrowserKit\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony BrowserKit Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T09:10:45+00:00"
+ },
+ {
+ "name": "symfony/config",
+ "version": "v4.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/config.git",
+ "reference": "c868972ac26e4e19860ce11b300bb74145246ff9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/config/zipball/c868972ac26e4e19860ce11b300bb74145246ff9",
+ "reference": "c868972ac26e4e19860ce11b300bb74145246ff9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "symfony/filesystem": "~3.4|~4.0",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/finder": "<3.4"
+ },
+ "require-dev": {
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/event-dispatcher": "~3.4|~4.0",
+ "symfony/finder": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/yaml": "To use the yaml reference dumper"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
+ "psr-4": {
+ "Symfony\\Component\\Config\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Provides a list of PHP built-in functions that operate on resources",
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "time": "2015-07-28T20:34:47+00:00"
+ "description": "Symfony Config Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T11:24:31+00:00"
},
{
- "name": "sebastian/version",
- "version": "2.0.1",
+ "name": "symfony/css-selector",
+ "version": "v4.1.3",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+ "url": "https://github.com/symfony/css-selector.git",
+ "reference": "2a4df7618f869b456f9096781e78c57b509d76c7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/2a4df7618f869b456f9096781e78c57b509d76c7",
+ "reference": "2a4df7618f869b456f9096781e78c57b509d76c7",
"shasum": ""
},
"require": {
- "php": ">=5.6"
+ "php": "^7.1.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
+ "psr-4": {
+ "Symfony\\Component\\CssSelector\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "name": "Jean-François Simon",
+ "email": "jeanfrancois.simon@sensiolabs.com"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2016-10-03T07:35:21+00:00"
+ "description": "Symfony CssSelector Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T09:10:45+00:00"
},
{
- "name": "squizlabs/php_codesniffer",
- "version": "3.3.0",
+ "name": "symfony/dependency-injection",
+ "version": "v4.1.3",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266"
+ "url": "https://github.com/symfony/dependency-injection.git",
+ "reference": "f4f401fc2766eb8d766fc6043d9e6489b37a41e4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
- "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f4f401fc2766eb8d766fc6043d9e6489b37a41e4",
+ "reference": "f4f401fc2766eb8d766fc6043d9e6489b37a41e4",
"shasum": ""
},
"require": {
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": ">=5.4.0"
+ "php": "^7.1.3",
+ "psr/container": "^1.0"
+ },
+ "conflict": {
+ "symfony/config": "<4.1.1",
+ "symfony/finder": "<3.4",
+ "symfony/proxy-manager-bridge": "<3.4",
+ "symfony/yaml": "<3.4"
+ },
+ "provide": {
+ "psr/container-implementation": "1.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "symfony/config": "~4.1",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/config": "",
+ "symfony/expression-language": "For using expressions in service container configuration",
+ "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
},
- "bin": [
- "bin/phpcs",
- "bin/phpcbf"
- ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.x-dev"
+ "dev-master": "4.1-dev"
}
},
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\DependencyInjection\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Greg Sherwood",
- "role": "lead"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "http://www.squizlabs.com/php-codesniffer",
- "keywords": [
- "phpcs",
- "standards"
- ],
- "time": "2018-06-06T23:58:19+00:00"
+ "description": "Symfony DependencyInjection Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-01T08:24:03+00:00"
},
{
- "name": "symfony/config",
- "version": "v4.1.1",
+ "name": "symfony/dom-crawler",
+ "version": "v4.1.3",
"source": {
"type": "git",
- "url": "https://github.com/symfony/config.git",
- "reference": "e57e7b573df9d0eaa8c0152768c708ee7ea2b8e5"
+ "url": "https://github.com/symfony/dom-crawler.git",
+ "reference": "1c4519d257e652404c3aa550207ccd8ada66b38e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/e57e7b573df9d0eaa8c0152768c708ee7ea2b8e5",
- "reference": "e57e7b573df9d0eaa8c0152768c708ee7ea2b8e5",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/1c4519d257e652404c3aa550207ccd8ada66b38e",
+ "reference": "1c4519d257e652404c3aa550207ccd8ada66b38e",
"shasum": ""
},
"require": {
"php": "^7.1.3",
- "symfony/filesystem": "~3.4|~4.0",
- "symfony/polyfill-ctype": "~1.8"
- },
- "conflict": {
- "symfony/finder": "<3.4"
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
- "symfony/dependency-injection": "~3.4|~4.0",
- "symfony/event-dispatcher": "~3.4|~4.0",
- "symfony/finder": "~3.4|~4.0",
- "symfony/yaml": "~3.4|~4.0"
+ "symfony/css-selector": "~3.4|~4.0"
},
"suggest": {
- "symfony/yaml": "To use the yaml reference dumper"
+ "symfony/css-selector": ""
},
"type": "library",
"extra": {
@@ -6475,7 +8335,7 @@
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\Config\\": ""
+ "Symfony\\Component\\DomCrawler\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -6495,48 +8355,31 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Config Component",
+ "description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
- "time": "2018-06-20T11:15:17+00:00"
+ "time": "2018-07-26T11:00:49+00:00"
},
{
- "name": "symfony/dependency-injection",
- "version": "v4.1.1",
+ "name": "symfony/http-foundation",
+ "version": "v4.1.3",
"source": {
"type": "git",
- "url": "https://github.com/symfony/dependency-injection.git",
- "reference": "e761828a85d7dfc00b927f94ccbe1851ce0b6535"
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "7d93e3547660ec7ee3dad1428ba42e8076a0e5f1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e761828a85d7dfc00b927f94ccbe1851ce0b6535",
- "reference": "e761828a85d7dfc00b927f94ccbe1851ce0b6535",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7d93e3547660ec7ee3dad1428ba42e8076a0e5f1",
+ "reference": "7d93e3547660ec7ee3dad1428ba42e8076a0e5f1",
"shasum": ""
},
"require": {
"php": "^7.1.3",
- "psr/container": "^1.0"
- },
- "conflict": {
- "symfony/config": "<4.1.1",
- "symfony/finder": "<3.4",
- "symfony/proxy-manager-bridge": "<3.4",
- "symfony/yaml": "<3.4"
- },
- "provide": {
- "psr/container-implementation": "1.0"
+ "symfony/polyfill-mbstring": "~1.1"
},
"require-dev": {
- "symfony/config": "~4.1",
- "symfony/expression-language": "~3.4|~4.0",
- "symfony/yaml": "~3.4|~4.0"
- },
- "suggest": {
- "symfony/config": "",
- "symfony/expression-language": "For using expressions in service container configuration",
- "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
- "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
- "symfony/yaml": ""
+ "predis/predis": "~1.0",
+ "symfony/expression-language": "~3.4|~4.0"
},
"type": "library",
"extra": {
@@ -6546,7 +8389,7 @@
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\DependencyInjection\\": ""
+ "Symfony\\Component\\HttpFoundation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -6566,22 +8409,22 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony DependencyInjection Component",
+ "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2018-06-25T11:12:43+00:00"
+ "time": "2018-08-01T14:07:44+00:00"
},
{
"name": "symfony/options-resolver",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
- "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef"
+ "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45cdcc8a96ef92b43a50723e6d1f5f83096e8cef",
- "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1913f1962477cdbb13df951f8147d5da1fe2412c",
+ "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c",
"shasum": ""
},
"require": {
@@ -6622,30 +8465,30 @@
"configuration",
"options"
],
- "time": "2018-05-31T10:17:53+00:00"
+ "time": "2018-07-26T08:55:25+00:00"
},
{
"name": "symfony/polyfill-php70",
- "version": "v1.8.0",
+ "version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
- "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6"
+ "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6",
- "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934",
+ "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934",
"shasum": ""
},
"require": {
- "paragonie/random_compat": "~1.0|~2.0",
+ "paragonie/random_compat": "~1.0|~2.0|~9.99",
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-master": "1.9-dev"
}
},
"autoload": {
@@ -6681,20 +8524,20 @@
"portable",
"shim"
],
- "time": "2018-04-26T10:06:28+00:00"
+ "time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/polyfill-php72",
- "version": "v1.8.0",
+ "version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46"
+ "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46",
- "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/95c50420b0baed23852452a7f0c7b527303ed5ae",
+ "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae",
"shasum": ""
},
"require": {
@@ -6703,7 +8546,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-master": "1.9-dev"
}
},
"autoload": {
@@ -6736,20 +8579,20 @@
"portable",
"shim"
],
- "time": "2018-04-26T10:06:28+00:00"
+ "time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/stopwatch",
- "version": "v4.1.1",
+ "version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
- "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784"
+ "reference": "966c982df3cca41324253dc0c7ffe76b6076b705"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/07463bbbbbfe119045a24c4a516f92ebd2752784",
- "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/966c982df3cca41324253dc0c7ffe76b6076b705",
+ "reference": "966c982df3cca41324253dc0c7ffe76b6076b705",
"shasum": ""
},
"require": {
@@ -6785,7 +8628,66 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
- "time": "2018-02-19T16:51:42+00:00"
+ "time": "2018-07-26T11:00:49+00:00"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v3.4.14",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
+ "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/console": "<3.4"
+ },
+ "require-dev": {
+ "symfony/console": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/console": "For validating YAML files using the lint command"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T11:19:56+00:00"
},
{
"name": "theseer/fdomdocument",
@@ -6867,6 +8769,56 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"time": "2017-04-07T12:08:54+00:00"
},
+ {
+ "name": "vlucas/phpdotenv",
+ "version": "v2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/vlucas/phpdotenv.git",
+ "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
+ "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Dotenv\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Vance Lucas",
+ "email": "vance@vancelucas.com",
+ "homepage": "http://www.vancelucas.com"
+ }
+ ],
+ "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
+ "keywords": [
+ "dotenv",
+ "env",
+ "environment"
+ ],
+ "time": "2018-07-29T20:33:41+00:00"
+ },
{
"name": "webmozart/assert",
"version": "1.3.0",
diff --git a/dev/tests/acceptance/.env.example b/dev/tests/acceptance/.env.example
deleted file mode 100644
index 432851acbf286..0000000000000
--- a/dev/tests/acceptance/.env.example
+++ /dev/null
@@ -1,37 +0,0 @@
-#Copyright © Magento, Inc. All rights reserved.
-#See COPYING.txt for license details.
-
-#*** Set the base URL for your Magento instance ***#
-MAGENTO_BASE_URL=
-
-#*** Set the Admin Username and Password for your Magento instance ***#
-MAGENTO_BACKEND_NAME=
-MAGENTO_ADMIN_USERNAME=
-MAGENTO_ADMIN_PASSWORD=
-
-#*** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation
-#MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php
-#MAGENTO_CLI_COMMAND_PARAMETER=command
-
-#*** Selenium Server Protocol, Host, Port, and Path, with local defaults. Uncomment and change if not running Selenium locally.
-#SELENIUM_HOST=127.0.0.1
-#SELENIUM_PORT=4444
-#SELENIUM_PROTOCOL=http
-#SELENIUM_PATH=/wd/hub
-
-#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***#
-#MAGENTO_RESTAPI_SERVER_HOST=
-#MAGENTO_RESTAPI_SERVER_PORT=
-
-#*** Uncomment these properties to set up a dev environment with symlinked projects ***#
-#TESTS_BP=
-#FW_BP=
-#TESTS_MODULE_PATH=
-
-#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set
-MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
-#CUSTOM_MODULE_PATHS=
-
-#*** Bool property which allows the user to toggle debug output during test execution
-#MFTF_DEBUG=
-#*** End of .env ***#
diff --git a/dev/tests/acceptance/LICENSE.txt b/dev/tests/acceptance/LICENSE.txt
deleted file mode 100644
index 49525fd99da9c..0000000000000
--- a/dev/tests/acceptance/LICENSE.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-
-Open Software License ("OSL") v. 3.0
-
-This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
-
-Licensed under the Open Software License version 3.0
-
- 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
-
- 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
-
- 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
-
- 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
-
- 4. to perform the Original Work publicly; and
-
- 5. to display the Original Work publicly.
-
- 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
-
- 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
-
- 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
-
- 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
-
- 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
-
- 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
-
- 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
-
- 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
-
- 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
-
- 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
-
- 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
-
- 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
-
- 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
- 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
-
- 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
\ No newline at end of file
diff --git a/dev/tests/acceptance/LICENSE_AFL.txt b/dev/tests/acceptance/LICENSE_AFL.txt
deleted file mode 100644
index f39d641b18a19..0000000000000
--- a/dev/tests/acceptance/LICENSE_AFL.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-
-Academic Free License ("AFL") v. 3.0
-
-This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
-
-Licensed under the Academic Free License version 3.0
-
- 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
-
- 1. to reproduce the Original Work in copies, either alone or as part of a collective work;
-
- 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
-
- 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
-
- 4. to perform the Original Work publicly; and
-
- 5. to display the Original Work publicly.
-
- 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
-
- 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
-
- 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
-
- 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
-
- 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
-
- 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
-
- 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
-
- 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
-
- 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
-
- 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
-
- 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
-
- 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
-
- 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
- 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
-
- 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
diff --git a/dev/tests/acceptance/README.md b/dev/tests/acceptance/README.md
deleted file mode 100755
index 6350b9cabcdfa..0000000000000
--- a/dev/tests/acceptance/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# Magento Functional Testing Framework
-
-----
-
-## System Requirements
-[Magento Functional Testing Framework system requirements](http://devdocs.magento.com/guides/v2.2/magento-functional-testing-framework/getting-started.html#prepare-environment)
-
-## Installation
-To install the Magento Functional Testing Framework, see [Getting Started](http://devdocs.magento.com/guides/v2.2/magento-functional-testing-framework/getting-started.html)
-
-## Contributing
-Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
-
-To learn about how to make a contribution, click [here][1].
-
-To open an issue, click [here][2].
-
-To suggest documentation improvements, click [here][3].
-
-[1]:
-[2]:
-[3]:
-
-### Labels applied by the MFTF team
-
-Refer to the tables with descriptions of each label below. These labels are applied by the MFTF development team to community contributed issues and pull requests, to communicate status, impact, or which team is working on it.
-
-### Pull Request Status
-
-Label| Description
----|---
-**accept**| The pull request has been accepted and will be merged into mainline code.
-**reject**| The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution.
-**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the pull request.
-
-### Issue Resolution Status
-
-Label| Description
----|---
-**acknowledged**| The Magento Team has validated the issue and an internal ticket has been created.
-**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request.
-**cannot reproduce**| The Magento Team has not confirmed that this issue contains the minimum required information to reproduce.
-**non-issue**| The Magento Team has not recognised any issue according to provided information.
-
-### Domains Impacted
-
-Label| Description
----|---
-**PROD**| Affects the Product team (mostly feature requests or business logic change).
-**DOC**| Affects Documentation domain.
-**TECH**| Affects Architect Group (mostly to make decisions around technology changes).
-
-### Type
-
-Label| Description
----|---
-**bugfix**| The issue or pull request relates to bug fixing.
-**enhancement**| The issue or pull request that raises the MFTF to a higher degree (for example new features, optimization, refactoring, etc).
-
-## License
-
-Each Magento source file included in this distribution is licensed under APL 3.0
-
-Please see LICENSE_APL3.txt for the full text of the APL 3.0 license or contact license@magentocommerce.com for a copy.
diff --git a/dev/tests/acceptance/RoboFile.php b/dev/tests/acceptance/RoboFile.php
index dd84b4131e502..e6e9e591bbd8b 100644
--- a/dev/tests/acceptance/RoboFile.php
+++ b/dev/tests/acceptance/RoboFile.php
@@ -15,84 +15,6 @@ class RoboFile extends \Robo\Tasks
{
use Robo\Task\Base\loadShortcuts;
- public function __construct()
- {
- require 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR . '_bootstrap.php';
- define('VENDOR_BIN_PATH', PROJECT_ROOT . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR);
-
- }
- /**
- * Duplicate the Example configuration files used to customize the Project for customization.
- *
- * @return void
- */
- function cloneFiles()
- {
- $this->_exec('cp -vn .env.example .env');
- $this->_exec('cp -vf codeception.dist.yml codeception.yml');
- $this->_exec('cp -vf tests'. DIRECTORY_SEPARATOR .'functional.suite.dist.yml tests'. DIRECTORY_SEPARATOR .'functional.suite.yml');
- }
-
- /**
- * Finds relative paths between codeception.yml file and MFTF path, and overwrites the default paths.
- *
- * @return void
- */
- private function buildCodeceptionPaths()
- {
- $relativePathFunc = function ($from, $to)
- {
- $from = is_dir($from) ? rtrim($from, '\/') . '/' : $from;
- $to = is_dir($to) ? rtrim($to, '\/') . '/' : $to;
- $from = str_replace('\\', '/', $from);
- $to = str_replace('\\', '/', $to);
-
- $from = explode('/', $from);
- $to = explode('/', $to);
- $relPath = $to;
-
- foreach($from as $depth => $dir) {
- // find first non-matching dir
- if($dir === $to[$depth]) {
- // ignore this directory
- array_shift($relPath);
- } else {
- // get number of remaining dirs to $from
- $remaining = count($from) - $depth;
- if($remaining > 1) {
- // add traversals up to first matching dir
- $padLength = (count($relPath) + $remaining - 1) * -1;
- $relPath = array_pad($relPath, $padLength, '..');
- break;
- } else {
- $relPath[0] = './' . $relPath[0];
- }
- }
- }
- return implode('/', $relPath);
- };
-
- //Find travel path from codeception.yml to FW_BP
- $configYmlPath = dirname(dirname(TESTS_BP)) . DIRECTORY_SEPARATOR;
- $relativePath = call_user_func($relativePathFunc, $configYmlPath, FW_BP);
- $configYmlFile = $configYmlPath . "codeception.yml";
- $defaultConfigYmlFile = $configYmlPath . "codeception.dist.yml";
-
- if (file_exists($configYmlFile)) {
- $ymlContents = file_get_contents($configYmlFile);
- } else {
- $ymlContents = file_get_contents($defaultConfigYmlFile);
- }
- $ymlArray = Yaml::parse($ymlContents) ?? [];
- if (!array_key_exists("paths", $ymlArray)) {
- $ymlArray["paths"] = [];
- }
- $ymlArray["paths"]["support"] = $relativePath . 'src/Magento/FunctionalTestingFramework';
- $ymlArray["paths"]["envs"] = $relativePath . 'etc/_envs';
- $ymlText = Yaml::dump($ymlArray, 10);
- file_put_contents($configYmlFile, $ymlText);
- }
-
/**
* Duplicate the Example configuration files for the Project.
* Build the Codeception project.
@@ -101,9 +23,7 @@ private function buildCodeceptionPaths()
*/
function buildProject()
{
- $this->cloneFiles();
- $this->buildCodeceptionPaths();
- $this->_exec(VENDOR_BIN_PATH .'codecept build');
+ passthru($this->getBaseCmd("build:project"));
}
/**
@@ -111,99 +31,32 @@ function buildProject()
*
* @param array $tests
* @param array $opts
- * @return void
+ * @return \Robo\Result
*/
function generateTests(array $tests, $opts = [
'config' => null,
'force' => false,
'nodes' => null,
- 'lines' => 500,
+ 'lines' => null,
'tests' => null
])
{
- require 'tests'. DIRECTORY_SEPARATOR . 'functional' . DIRECTORY_SEPARATOR . '_bootstrap.php';
- $testConfiguration = $this->createTestConfiguration($tests, $opts);
-
- // maintain backwards compatability for devops by not removing the nodes option yet
- $lines = $opts['lines'];
-
- // create our manifest file here
- $testManifest = \Magento\FunctionalTestingFramework\Util\Manifest\TestManifestFactory::makeManifest($opts['config'],$testConfiguration['suites']);
- \Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance(null, $testConfiguration['tests'])->createAllTestFiles($testManifest);
-
- if ($opts['config'] == 'parallel') {
- $testManifest->createTestGroups($lines);
- }
-
- \Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance()->generateAllSuites($testManifest);
- $testManifest->generate();
-
- $this->say("Generate Tests Command Run");
- }
-
+ $baseCmd = $this->getBaseCmd("generate:tests");
- /**
- * Function which builds up a configuration including test and suites for consumption of Magento generation methods.
- *
- * @param array $tests
- * @param array $opts
- * @return array
- */
- private function createTestConfiguration($tests, $opts)
- {
- // set our application configuration so we can references the user options in our framework
- Magento\FunctionalTestingFramework\Config\MftfApplicationConfig::create(
- $opts['force'],
- Magento\FunctionalTestingFramework\Config\MftfApplicationConfig::GENERATION_PHASE,
- $opts['verbose']
- );
-
- $testConfiguration = [];
- $testConfiguration['tests'] = $tests;
- $testConfiguration['suites'] = [];
-
- $testConfiguration = $this->parseTestsConfigJson($opts['tests'], $testConfiguration);
-
- // if we have references to specific tests, we resolve the test objects and pass them to the config
- if (!empty($testConfiguration['tests']))
- {
- $testObjects = [];
-
- foreach ($testConfiguration['tests'] as $test)
- {
- $testObjects[$test] = Magento\FunctionalTestingFramework\Test\Handlers\TestObjectHandler::getInstance()->getObject($test);
+ $mftfArgNames = ['config', 'nodes', 'lines', 'tests'];
+ // append arguments to the end of the command
+ foreach ($opts as $argName => $argValue) {
+ if (in_array($argName, $mftfArgNames) && $argValue !== null) {
+ $baseCmd .= " --$argName $argValue";
}
-
- $testConfiguration['tests'] = $testObjects;
- }
-
- return $testConfiguration;
- }
-
- /**
- * Function which takes a json string of potential custom configuration and parses/validates the resulting json
- * passed in by the user. The result is a testConfiguration array.
- *
- * @param string $json
- * @param array $testConfiguration
- * @return array
- */
- private function parseTestsConfigJson($json, $testConfiguration) {
- if ($json == null) {
- return $testConfiguration;
}
- $jsonTestConfiguration = [];
- $testConfigArray = json_decode($json, true);
-
- // stop execution if we have failed to properly parse any json
- if (json_last_error() != JSON_ERROR_NONE) {
- throw new \Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException("JSON could not be parsed: " . json_last_error_msg());
+ // use a separate conditional for the force flag (casting bool to string in php is hard)
+ if ($opts['force']) {
+ $baseCmd .= ' --force';
}
- $jsonTestConfiguration['tests'] = $testConfigArray['tests'] ?? null;;
- $jsonTestConfiguration['suites'] = $testConfigArray['suites'] ?? null;
- return $jsonTestConfiguration;
+ return $this->taskExec($baseCmd)->args($tests)->run();
}
/**
@@ -211,61 +64,28 @@ private function parseTestsConfigJson($json, $testConfiguration) {
*
* @param array $args
* @throws Exception
- * @return void
+ * @return \Robo\Result
*/
function generateSuite(array $args)
{
if (empty($args)) {
throw new Exception("Please provide suite name(s) after generate:suite command");
}
-
- $sg = \Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance();
-
- foreach ($args as $arg) {
- $sg->generateSuite($arg);
- }
- }
-
- /**
- * Run all Functional tests.
- *
- * @return void
- */
- function functional()
- {
- $this->_exec(VENDOR_BIN_PATH . 'codecept run functional');
+ $baseCmd = $this->getBaseCmd("generate:suite");
+ return $this->taskExec($baseCmd)->args($args)->run();
}
/**
* Run all Tests with the specified @group tag'.
*
- * @param string $args
- * @return void
- */
- function group($args = '')
- {
- $this->taskExec(VENDOR_BIN_PATH . 'codecept run functional --verbose --steps --group')->args($args)->run();
- }
-
- /**
- * Run all Functional tests located under the Directory Path provided.
- *
- * @param string $args
- * @return void
- */
- function folder($args = '')
- {
- $this->taskExec(VENDOR_BIN_PATH . 'codecept run functional')->args($args)->run();
- }
-
- /**
- * Run all Tests marked with the @group tag 'example'.
- *
- * @return void
+ * @param array $args
+ * @return \Robo\Result
*/
- function example()
+ function group(array $args)
{
- $this->_exec(VENDOR_BIN_PATH . 'codecept run --group example');
+ $args = array_merge($args, ['-k']);
+ $baseCmd = $this->getBaseCmd("run:group");
+ return $this->taskExec($baseCmd)->args($args)->run();
}
/**
@@ -291,58 +111,65 @@ function allure2Generate()
/**
* Open the HTML Allure report - Allure v1.4.X
*
- * @return void
+ * @return \Robo\Result
*/
function allure1Open()
{
- $this->_exec('allure report open --report-dir tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
+ return $this->_exec('allure report open --report-dir tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
}
/**
* Open the HTML Allure report - Allure v2.3.X
*
- * @return void
+ * @return \Robo\Result
*/
function allure2Open()
{
- $this->_exec('allure open --port 0 tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
+ return $this->_exec('allure open --port 0 tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
}
/**
* Generate and open the HTML Allure report - Allure v1.4.X
*
- * @return void
+ * @return \Robo\Result
*/
function allure1Report()
{
$result1 = $this->allure1Generate();
if ($result1->wasSuccessful()) {
- $this->allure1Open();
+ return $this->allure1Open();
+ } else {
+ return $result1;
}
}
/**
* Generate and open the HTML Allure report - Allure v2.3.X
*
- * @return void
+ * @return \Robo\Result
*/
function allure2Report()
{
$result1 = $this->allure2Generate();
if ($result1->wasSuccessful()) {
- $this->allure2Open();
+ return $this->allure2Open();
+ } else {
+ return $result1;
}
}
/**
- * Run the Pre-Install system check script.
+ * Private function for returning the formatted command for the passthru to mftf bin execution.
*
- * @return void
+ * @param string $command
+ * @return string
*/
- function preInstall()
+ private function getBaseCmd($command)
{
- $this->_exec('php pre-install.php');
+ $this->writeln("\033[01;31m Use of robo will be deprecated with next major release, please use /vendor/bin/mftf $command \033[0m");
+ chdir(__DIR__);
+ return realpath('../../../vendor/bin/mftf') . " $command";
}
-}
+}
\ No newline at end of file
diff --git a/dev/tests/acceptance/codeception.dist.yml b/dev/tests/acceptance/codeception.dist.yml
deleted file mode 100644
index 683edcb107fd1..0000000000000
--- a/dev/tests/acceptance/codeception.dist.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright © Magento, Inc. All rights reserved.
-# See COPYING.txt for license details.
-actor: Tester
-paths:
- tests: tests
- log: tests/_output
- data: tests/_data
- support: "%REPLACED IN BUILD:PROJECT%"
- envs: "%REPLACED IN BUILD:PROJECT%"
-settings:
- bootstrap: _bootstrap.php
- colors: true
- memory_limit: 1024M
-extensions:
- enabled:
- - Codeception\Extension\RunFailed
- - Magento\FunctionalTestingFramework\Extension\TestContextExtension
- - Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter
- config:
- Yandex\Allure\Adapter\AllureAdapter:
- deletePreviousResults: true
- outputDirectory: allure-results
- ignoredAnnotations:
- - env
- - zephyrId
- - useCaseId
-params:
- - .env
-modules:
- config:
- Db:
- dsn: "%DB_DSN%"
- user: "%DB_USERNAME%"
- password: "%DB_PASSWORD%"
- dump: tests/_data/dump.sql
\ No newline at end of file
diff --git a/dev/tests/acceptance/composer.json b/dev/tests/acceptance/composer.json
index 787d2579e03ca..a20176a29c4c8 100755
--- a/dev/tests/acceptance/composer.json
+++ b/dev/tests/acceptance/composer.json
@@ -9,20 +9,17 @@
"config": {
"sort-packages": true
},
- "repositories": [
- {
- "type": "git",
- "url": "git@github.com:magento/magento2-functional-testing-framework.git"
- }
- ],
"require": {
"php": "~7.1.3||~7.2.0",
- "magento/magento2-functional-testing-framework": "~2.2.0"
+ "codeception/codeception": "~2.3.4",
+ "consolidation/robo": "^1.0.0",
+ "vlucas/phpdotenv": "^2.4"
},
"autoload": {
"psr-4": {
"Magento\\": "tests/functional/Magento"
- }
+ },
+ "files": ["tests/_bootstrap.php"]
},
"prefer-stable": true
}
diff --git a/dev/tests/acceptance/composer.lock b/dev/tests/acceptance/composer.lock
index afe2640b442f1..8542402a98f50 100644
--- a/dev/tests/acceptance/composer.lock
+++ b/dev/tests/acceptance/composer.lock
@@ -4,111 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "9f292f6e226938ad82d1189da7aa4024",
+ "content-hash": "46ca2d50566f5069daef753664080c5a",
"packages": [
- {
- "name": "allure-framework/allure-codeception",
- "version": "1.2.7",
- "source": {
- "type": "git",
- "url": "https://github.com/allure-framework/allure-codeception.git",
- "reference": "48598f4b4603b50b663bfe977260113a40912131"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/48598f4b4603b50b663bfe977260113a40912131",
- "reference": "48598f4b4603b50b663bfe977260113a40912131",
- "shasum": ""
- },
- "require": {
- "allure-framework/allure-php-api": "~1.1.0",
- "codeception/codeception": "~2.1",
- "php": ">=5.4.0",
- "symfony/filesystem": ">=2.6",
- "symfony/finder": ">=2.6"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Yandex": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Ivan Krutov",
- "email": "vania-pooh@yandex-team.ru",
- "role": "Developer"
- }
- ],
- "description": "A Codeception adapter for Allure report.",
- "homepage": "http://allure.qatools.ru/",
- "keywords": [
- "allure",
- "attachments",
- "cases",
- "codeception",
- "report",
- "steps",
- "testing"
- ],
- "time": "2018-03-07T11:18:27+00:00"
- },
- {
- "name": "allure-framework/allure-php-api",
- "version": "1.1.4",
- "source": {
- "type": "git",
- "url": "https://github.com/allure-framework/allure-php-adapter-api.git",
- "reference": "a462a0da121681577033e13c123b6cc4e89cdc64"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64",
- "reference": "a462a0da121681577033e13c123b6cc4e89cdc64",
- "shasum": ""
- },
- "require": {
- "jms/serializer": ">=0.16.0",
- "moontoast/math": ">=1.1.0",
- "php": ">=5.4.0",
- "phpunit/phpunit": ">=4.0.0",
- "ramsey/uuid": ">=3.0.0",
- "symfony/http-foundation": ">=2.0"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Yandex": [
- "src/",
- "test/"
- ]
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Ivan Krutov",
- "email": "vania-pooh@yandex-team.ru",
- "role": "Developer"
- }
- ],
- "description": "PHP API for Allure adapter",
- "homepage": "http://allure.qatools.ru/",
- "keywords": [
- "allure",
- "api",
- "php",
- "report"
- ],
- "time": "2016-12-07T12:15:46+00:00"
- },
{
"name": "behat/gherkin",
"version": "v4.4.5",
@@ -264,16 +161,16 @@
},
{
"name": "codeception/stub",
- "version": "1.0.2",
+ "version": "1.0.4",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Stub.git",
- "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99"
+ "reference": "681b62348837a5ef07d10d8a226f5bc358cc8805"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
- "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
+ "url": "https://api.github.com/repos/Codeception/Stub/zipball/681b62348837a5ef07d10d8a226f5bc358cc8805",
+ "reference": "681b62348837a5ef07d10d8a226f5bc358cc8805",
"shasum": ""
},
"require": {
@@ -293,20 +190,20 @@
"MIT"
],
"description": "Flexible Stub wrapper for PHPUnit's Mock Builder",
- "time": "2018-02-18T13:56:56+00:00"
+ "time": "2018-05-17T09:31:08+00:00"
},
{
"name": "consolidation/annotated-command",
- "version": "2.8.3",
+ "version": "2.8.4",
"source": {
"type": "git",
"url": "https://github.com/consolidation/annotated-command.git",
- "reference": "8f8f5da2ca06fbd3a85f7d551c49f844b7c59437"
+ "reference": "651541a0b68318a2a202bda558a676e5ad92223c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/8f8f5da2ca06fbd3a85f7d551c49f844b7c59437",
- "reference": "8f8f5da2ca06fbd3a85f7d551c49f844b7c59437",
+ "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/651541a0b68318a2a202bda558a676e5ad92223c",
+ "reference": "651541a0b68318a2a202bda558a676e5ad92223c",
"shasum": ""
},
"require": {
@@ -318,9 +215,9 @@
"symfony/finder": "^2.5|^3|^4"
},
"require-dev": {
- "greg-1-anderson/composer-test-scenarios": "^1",
- "phpunit/phpunit": "^4.8",
- "satooshi/php-coveralls": "^1.0.2 | dev-master",
+ "g1a/composer-test-scenarios": "^2",
+ "phpunit/phpunit": "^6",
+ "satooshi/php-coveralls": "^2",
"squizlabs/php_codesniffer": "^2.7"
},
"type": "library",
@@ -345,20 +242,20 @@
}
],
"description": "Initialize Symfony Console commands from annotated command class methods.",
- "time": "2018-02-23T16:32:04+00:00"
+ "time": "2018-05-25T18:04:25+00:00"
},
{
"name": "consolidation/config",
- "version": "1.0.9",
+ "version": "1.0.11",
"source": {
"type": "git",
"url": "https://github.com/consolidation/config.git",
- "reference": "34ca8d7c1ee60a7b591b10617114cf1210a2e92c"
+ "reference": "ede41d946078e97e7a9513aadc3352f1c26817af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/consolidation/config/zipball/34ca8d7c1ee60a7b591b10617114cf1210a2e92c",
- "reference": "34ca8d7c1ee60a7b591b10617114cf1210a2e92c",
+ "url": "https://api.github.com/repos/consolidation/config/zipball/ede41d946078e97e7a9513aadc3352f1c26817af",
+ "reference": "ede41d946078e97e7a9513aadc3352f1c26817af",
"shasum": ""
},
"require": {
@@ -367,7 +264,7 @@
"php": ">=5.4.0"
},
"require-dev": {
- "greg-1-anderson/composer-test-scenarios": "^1",
+ "g1a/composer-test-scenarios": "^1",
"phpunit/phpunit": "^4",
"satooshi/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "2.*",
@@ -399,20 +296,20 @@
}
],
"description": "Provide configuration services for a commandline tool.",
- "time": "2017-12-22T17:28:19+00:00"
+ "time": "2018-05-27T01:17:02+00:00"
},
{
"name": "consolidation/log",
- "version": "1.0.5",
+ "version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/consolidation/log.git",
- "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821"
+ "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/consolidation/log/zipball/dbc7c535f319a4a2d5a5077738f8eb7c10df8821",
- "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821",
+ "url": "https://api.github.com/repos/consolidation/log/zipball/dfd8189a771fe047bf3cd669111b2de5f1c79395",
+ "reference": "dfd8189a771fe047bf3cd669111b2de5f1c79395",
"shasum": ""
},
"require": {
@@ -421,8 +318,9 @@
"symfony/console": "^2.8|^3|^4"
},
"require-dev": {
+ "g1a/composer-test-scenarios": "^1",
"phpunit/phpunit": "4.*",
- "satooshi/php-coveralls": "dev-master",
+ "satooshi/php-coveralls": "^2",
"squizlabs/php_codesniffer": "2.*"
},
"type": "library",
@@ -447,20 +345,20 @@
}
],
"description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.",
- "time": "2017-11-29T01:44:16+00:00"
+ "time": "2018-05-25T18:14:39+00:00"
},
{
"name": "consolidation/output-formatters",
- "version": "3.2.0",
+ "version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/consolidation/output-formatters.git",
- "reference": "da889e4bce19f145ca4ec5b1725a946f4eb625a9"
+ "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/da889e4bce19f145ca4ec5b1725a946f4eb625a9",
- "reference": "da889e4bce19f145ca4ec5b1725a946f4eb625a9",
+ "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/d78ef59aea19d3e2e5a23f90a055155ee78a0ad5",
+ "reference": "d78ef59aea19d3e2e5a23f90a055155ee78a0ad5",
"shasum": ""
},
"require": {
@@ -469,7 +367,7 @@
"symfony/finder": "^2.5|^3|^4"
},
"require-dev": {
- "g-1-a/composer-test-scenarios": "^2",
+ "g1a/composer-test-scenarios": "^2",
"phpunit/phpunit": "^5.7.27",
"satooshi/php-coveralls": "^2",
"squizlabs/php_codesniffer": "^2.7",
@@ -502,25 +400,25 @@
}
],
"description": "Format text by applying transformations provided by plug-in formatters.",
- "time": "2018-03-20T15:18:32+00:00"
+ "time": "2018-05-25T18:02:34+00:00"
},
{
"name": "consolidation/robo",
- "version": "1.2.3",
+ "version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/consolidation/Robo.git",
- "reference": "54a13e268917b92576d75e10dca8227b95a574d9"
+ "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/consolidation/Robo/zipball/54a13e268917b92576d75e10dca8227b95a574d9",
- "reference": "54a13e268917b92576d75e10dca8227b95a574d9",
+ "url": "https://api.github.com/repos/consolidation/Robo/zipball/ac563abfadf7cb7314b4e152f2b5033a6c255f6f",
+ "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f",
"shasum": ""
},
"require": {
"consolidation/annotated-command": "^2.8.2",
- "consolidation/config": "^1.0.1",
+ "consolidation/config": "^1.0.10",
"consolidation/log": "~1",
"consolidation/output-formatters": "^3.1.13",
"grasmash/yaml-expander": "^1.3",
@@ -539,7 +437,7 @@
"codeception/aspect-mock": "^1|^2.1.1",
"codeception/base": "^2.3.7",
"codeception/verify": "^0.3.2",
- "g-1-a/composer-test-scenarios": "^2",
+ "g1a/composer-test-scenarios": "^2",
"goaop/framework": "~2.1.2",
"goaop/parser-reflection": "^1.1.0",
"natxet/cssmin": "3.0.4",
@@ -582,7 +480,7 @@
}
],
"description": "Modern task runner",
- "time": "2018-04-06T05:27:37+00:00"
+ "time": "2018-05-27T01:42:53+00:00"
},
{
"name": "container-interop/container-interop",
@@ -674,141 +572,6 @@
],
"time": "2017-01-20T21:14:22+00:00"
},
- {
- "name": "doctrine/annotations",
- "version": "v1.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/annotations.git",
- "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
- "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
- "shasum": ""
- },
- "require": {
- "doctrine/lexer": "1.*",
- "php": "^7.1"
- },
- "require-dev": {
- "doctrine/cache": "1.*",
- "phpunit/phpunit": "^6.4"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.6.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Docblock Annotations Parser",
- "homepage": "http://www.doctrine-project.org",
- "keywords": [
- "annotations",
- "docblock",
- "parser"
- ],
- "time": "2017-12-06T07:11:42+00:00"
- },
- {
- "name": "doctrine/collections",
- "version": "v1.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/collections.git",
- "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
- "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
- "shasum": ""
- },
- "require": {
- "php": "^7.1"
- },
- "require-dev": {
- "doctrine/coding-standard": "~0.1@dev",
- "phpunit/phpunit": "^5.7"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Doctrine\\Common\\Collections\\": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Collections Abstraction library",
- "homepage": "http://www.doctrine-project.org",
- "keywords": [
- "array",
- "collections",
- "iterator"
- ],
- "time": "2017-07-22T10:37:32+00:00"
- },
{
"name": "doctrine/instantiator",
"version": "1.1.0",
@@ -863,136 +626,41 @@
],
"time": "2017-07-22T11:58:36+00:00"
},
- {
- "name": "doctrine/lexer",
- "version": "v1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/lexer.git",
- "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
- "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.2"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Doctrine\\Common\\Lexer\\": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
- "homepage": "http://www.doctrine-project.org",
- "keywords": [
- "lexer",
- "parser"
- ],
- "time": "2014-09-09T13:34:57+00:00"
- },
- {
- "name": "epfremme/swagger-php",
- "version": "v2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/epfremmer/swagger-php.git",
- "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/epfremmer/swagger-php/zipball/eee28a442b7e6220391ec953d3c9b936354f23bc",
- "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc",
- "shasum": ""
- },
- "require": {
- "doctrine/annotations": "^1.2",
- "doctrine/collections": "^1.3",
- "jms/serializer": "^1.1",
- "php": ">=5.5",
- "phpoption/phpoption": "^1.1",
- "symfony/yaml": "^2.7|^3.1"
- },
- "require-dev": {
- "mockery/mockery": "^0.9.4",
- "phpunit/phpunit": "~4.8|~5.0",
- "satooshi/php-coveralls": "^1.0"
- },
- "type": "package",
- "autoload": {
- "psr-4": {
- "Epfremme\\Swagger\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Edward Pfremmer",
- "email": "epfremme@nerdery.com"
- }
- ],
- "description": "Library for parsing swagger documentation into PHP entities for use in testing and code generation",
- "time": "2016-09-26T17:24:17+00:00"
- },
{
"name": "facebook/webdriver",
- "version": "1.5.0",
+ "version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/facebook/php-webdriver.git",
- "reference": "86b5ca2f67173c9d34340845dd690149c886a605"
+ "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/86b5ca2f67173c9d34340845dd690149c886a605",
- "reference": "86b5ca2f67173c9d34340845dd690149c886a605",
+ "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e",
+ "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e",
"shasum": ""
},
"require": {
"ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
"ext-zip": "*",
"php": "^5.6 || ~7.0",
"symfony/process": "^2.8 || ^3.1 || ^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
- "guzzle/guzzle": "^3.4.1",
- "php-coveralls/php-coveralls": "^1.0.2",
+ "jakub-onderka/php-parallel-lint": "^0.9.2",
+ "php-coveralls/php-coveralls": "^2.0",
"php-mock/php-mock-phpunit": "^1.1",
"phpunit/phpunit": "^5.7",
"sebastian/environment": "^1.3.4 || ^2.0 || ^3.0",
"squizlabs/php_codesniffer": "^2.6",
"symfony/var-dumper": "^3.3 || ^4.0"
},
+ "suggest": {
+ "ext-SimpleXML": "For Firefox profile creation"
+ },
"type": "library",
"extra": {
"branch-alias": {
@@ -1016,98 +684,7 @@
"selenium",
"webdriver"
],
- "time": "2017-11-15T11:08:09+00:00"
- },
- {
- "name": "flow/jsonpath",
- "version": "0.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/FlowCommunications/JSONPath.git",
- "reference": "f0222818d5c938e4ab668ab2e2c079bd51a27112"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/f0222818d5c938e4ab668ab2e2c079bd51a27112",
- "reference": "f0222818d5c938e4ab668ab2e2c079bd51a27112",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.0"
- },
- "require-dev": {
- "peekmo/jsonpath": "dev-master",
- "phpunit/phpunit": "^4.0"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Flow\\JSONPath": "src/",
- "Flow\\JSONPath\\Test": "tests/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Stephen Frank",
- "email": "stephen@flowsa.com"
- }
- ],
- "description": "JSONPath implementation for parsing, searching and flattening arrays",
- "time": "2018-03-04T16:39:47+00:00"
- },
- {
- "name": "fzaninotto/faker",
- "version": "v1.7.1",
- "source": {
- "type": "git",
- "url": "https://github.com/fzaninotto/Faker.git",
- "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d",
- "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d",
- "shasum": ""
- },
- "require": {
- "php": "^5.3.3 || ^7.0"
- },
- "require-dev": {
- "ext-intl": "*",
- "phpunit/phpunit": "^4.0 || ^5.0",
- "squizlabs/php_codesniffer": "^1.5"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.8-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Faker\\": "src/Faker/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "François Zaninotto"
- }
- ],
- "description": "Faker is a PHP library that generates fake data for you.",
- "keywords": [
- "data",
- "faker",
- "fixtures"
- ],
- "time": "2017-08-15T16:48:10+00:00"
+ "time": "2018-05-16T17:37:13+00:00"
},
{
"name": "grasmash/expander",
@@ -1206,16 +783,16 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "6.3.2",
+ "version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90"
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90",
- "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
@@ -1225,7 +802,7 @@
},
"require-dev": {
"ext-curl": "*",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
@@ -1267,7 +844,7 @@
"rest",
"web service"
],
- "time": "2018-03-26T16:33:04+00:00"
+ "time": "2018-04-22T15:46:56+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -1375,185 +952,15 @@
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
- "http",
- "message",
- "request",
- "response",
- "stream",
- "uri",
- "url"
- ],
- "time": "2017-03-20T17:10:46+00:00"
- },
- {
- "name": "jms/metadata",
- "version": "1.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/schmittjoh/metadata.git",
- "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab",
- "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "doctrine/cache": "~1.0",
- "symfony/cache": "~3.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.5.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Metadata\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Johannes M. Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Class/method/property metadata management in PHP",
- "keywords": [
- "annotations",
- "metadata",
- "xml",
- "yaml"
- ],
- "time": "2016-12-05T10:18:33+00:00"
- },
- {
- "name": "jms/parser-lib",
- "version": "1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/schmittjoh/parser-lib.git",
- "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d",
- "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d",
- "shasum": ""
- },
- "require": {
- "phpoption/phpoption": ">=0.9,<2.0-dev"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "JMS\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache2"
- ],
- "description": "A library for easily creating recursive-descent parsers.",
- "time": "2012-11-18T18:08:43+00:00"
- },
- {
- "name": "jms/serializer",
- "version": "1.11.0",
- "source": {
- "type": "git",
- "url": "https://github.com/schmittjoh/serializer.git",
- "reference": "e7c53477ff55c21d1b1db7d062edc050a24f465f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/e7c53477ff55c21d1b1db7d062edc050a24f465f",
- "reference": "e7c53477ff55c21d1b1db7d062edc050a24f465f",
- "shasum": ""
- },
- "require": {
- "doctrine/annotations": "^1.0",
- "doctrine/instantiator": "^1.0.3",
- "jms/metadata": "~1.1",
- "jms/parser-lib": "1.*",
- "php": "^5.5|^7.0",
- "phpcollection/phpcollection": "~0.1",
- "phpoption/phpoption": "^1.1"
- },
- "conflict": {
- "twig/twig": "<1.12"
- },
- "require-dev": {
- "doctrine/orm": "~2.1",
- "doctrine/phpcr-odm": "^1.3|^2.0",
- "ext-pdo_sqlite": "*",
- "jackalope/jackalope-doctrine-dbal": "^1.1.5",
- "phpunit/phpunit": "^4.8|^5.0",
- "propel/propel1": "~1.7",
- "psr/container": "^1.0",
- "symfony/dependency-injection": "^2.7|^3.3|^4.0",
- "symfony/expression-language": "^2.6|^3.0",
- "symfony/filesystem": "^2.1",
- "symfony/form": "~2.1|^3.0",
- "symfony/translation": "^2.1|^3.0",
- "symfony/validator": "^2.2|^3.0",
- "symfony/yaml": "^2.1|^3.0",
- "twig/twig": "~1.12|~2.0"
- },
- "suggest": {
- "doctrine/cache": "Required if you like to use cache functionality.",
- "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.",
- "symfony/yaml": "Required if you'd like to serialize data to YAML format."
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.11-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "JMS\\Serializer": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Asmir Mustafic",
- "email": "goetas@gmail.com"
- },
- {
- "name": "Johannes M. Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
- "homepage": "http://jmsyst.com/libs/serializer",
- "keywords": [
- "deserialization",
- "jaxb",
- "json",
- "serialization",
- "xml"
+ "http",
+ "message",
+ "request",
+ "response",
+ "stream",
+ "uri",
+ "url"
],
- "time": "2018-02-04T17:48:54+00:00"
+ "time": "2017-03-20T17:10:46+00:00"
},
{
"name": "league/container",
@@ -1620,194 +1027,30 @@
],
"time": "2017-05-10T09:20:27+00:00"
},
- {
- "name": "magento/magento2-functional-testing-framework",
- "version": "2.2.0",
- "source": {
- "type": "git",
- "url": "git@github.com:magento/magento2-functional-testing-framework.git",
- "reference": "4dd196d745bf836cbf0c5904a1df6dd241124309"
- },
- "require": {
- "allure-framework/allure-codeception": "~1.2.6",
- "codeception/codeception": "~2.3.4",
- "consolidation/robo": "^1.0.0",
- "epfremme/swagger-php": "^2.0",
- "flow/jsonpath": ">0.2",
- "fzaninotto/faker": "^1.6",
- "mustache/mustache": "~2.5",
- "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0",
- "symfony/process": "^2.8 || ^3.1 || ^4.0",
- "vlucas/phpdotenv": "^2.4"
- },
- "require-dev": {
- "brainmaestro/composer-git-hooks": "^2.3",
- "codacy/coverage": "^1.4",
- "codeception/aspect-mock": "^2.0",
- "goaop/framework": "2.1.2",
- "php-coveralls/php-coveralls": "^1.0",
- "phpmd/phpmd": "^2.6.0",
- "rregeer/phpunit-coverage-check": "^0.1.4",
- "sebastian/phpcpd": "~3.0",
- "squizlabs/php_codesniffer": "1.5.3",
- "symfony/stopwatch": "~3.4.6"
- },
- "bin": [
- "bin/mftf"
- ],
- "type": "library",
- "extra": {
- "hooks": {
- "pre-push": "bin/all-checks"
- }
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework",
- "MFTF\\": "dev/tests/functional/MFTF"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "tests\\unit\\": "dev/tests/unit"
- }
- },
- "scripts": {
- "tests": [
- "bin/phpunit-checks"
- ],
- "static": [
- "bin/static-checks"
- ]
- },
- "license": [
- "AGPL-3.0"
- ],
- "description": "Magento2 Functional Testing Framework",
- "keywords": [
- "automation",
- "functional",
- "magento",
- "testing"
- ],
- "time": "2018-04-24T01:46:09+00:00"
- },
- {
- "name": "moontoast/math",
- "version": "1.1.2",
- "source": {
- "type": "git",
- "url": "https://github.com/ramsey/moontoast-math.git",
- "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
- "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
- "shasum": ""
- },
- "require": {
- "ext-bcmath": "*",
- "php": ">=5.3.3"
- },
- "require-dev": {
- "jakub-onderka/php-parallel-lint": "^0.9.0",
- "phpunit/phpunit": "^4.7|>=5.0 <5.4",
- "satooshi/php-coveralls": "^0.6.1",
- "squizlabs/php_codesniffer": "^2.3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Moontoast\\Math\\": "src/Moontoast/Math/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "authors": [
- {
- "name": "Ben Ramsey",
- "email": "ben@benramsey.com",
- "homepage": "https://benramsey.com"
- }
- ],
- "description": "A mathematics library, providing functionality for large numbers",
- "homepage": "https://github.com/ramsey/moontoast-math",
- "keywords": [
- "bcmath",
- "math"
- ],
- "time": "2017-02-16T16:54:46+00:00"
- },
- {
- "name": "mustache/mustache",
- "version": "v2.12.0",
- "source": {
- "type": "git",
- "url": "https://github.com/bobthecow/mustache.php.git",
- "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e",
- "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2.4"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "~1.11",
- "phpunit/phpunit": "~3.7|~4.0|~5.0"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Mustache": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Justin Hileman",
- "email": "justin@justinhileman.info",
- "homepage": "http://justinhileman.com"
- }
- ],
- "description": "A Mustache implementation in PHP.",
- "homepage": "https://github.com/bobthecow/mustache.php",
- "keywords": [
- "mustache",
- "templating"
- ],
- "time": "2017-07-11T12:54:05+00:00"
- },
{
"name": "myclabs/deep-copy",
- "version": "1.7.0",
+ "version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
+ "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
- "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
+ "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0"
+ "php": "^7.1"
+ },
+ "replace": {
+ "myclabs/deep-copy": "self.version"
},
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
- "phpunit/phpunit": "^4.1"
+ "phpunit/phpunit": "^7.1"
},
"type": "library",
"autoload": {
@@ -1830,55 +1073,7 @@
"object",
"object graph"
],
- "time": "2017-10-19T19:58:43+00:00"
- },
- {
- "name": "paragonie/random_compat",
- "version": "v2.0.12",
- "source": {
- "type": "git",
- "url": "https://github.com/paragonie/random_compat.git",
- "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
- "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "4.*|5.*"
- },
- "suggest": {
- "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
- },
- "type": "library",
- "autoload": {
- "files": [
- "lib/random.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Paragon Initiative Enterprises",
- "email": "security@paragonie.com",
- "homepage": "https://paragonie.com"
- }
- ],
- "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
- "keywords": [
- "csprng",
- "pseudorandom",
- "random"
- ],
- "time": "2018-04-04T21:24:14+00:00"
+ "time": "2018-06-11T23:09:50+00:00"
},
{
"name": "phar-io/manifest",
@@ -1982,54 +1177,6 @@
"description": "Library for handling version information and constraints",
"time": "2017-03-05T17:38:23+00:00"
},
- {
- "name": "phpcollection/phpcollection",
- "version": "0.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/schmittjoh/php-collection.git",
- "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
- "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
- "shasum": ""
- },
- "require": {
- "phpoption/phpoption": "1.*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.4-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "PhpCollection": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache2"
- ],
- "authors": [
- {
- "name": "Johannes M. Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "General-Purpose Collection Library for PHP",
- "keywords": [
- "collection",
- "list",
- "map",
- "sequence",
- "set"
- ],
- "time": "2015-05-17T12:39:23+00:00"
- },
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@@ -2182,56 +1329,6 @@
],
"time": "2017-07-14T14:27:02+00:00"
},
- {
- "name": "phpoption/phpoption",
- "version": "1.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/schmittjoh/php-option.git",
- "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed",
- "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "4.7.*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "PhpOption\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache2"
- ],
- "authors": [
- {
- "name": "Johannes M. Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "Option Type for PHP",
- "keywords": [
- "language",
- "option",
- "php",
- "type"
- ],
- "time": "2015-07-25T16:39:46+00:00"
- },
{
"name": "phpspec/prophecy",
"version": "1.7.6",
@@ -2546,16 +1643,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "6.5.8",
+ "version": "6.5.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b"
+ "reference": "093ca5508174cd8ab8efe44fd1dde447adfdec8f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
- "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/093ca5508174cd8ab8efe44fd1dde447adfdec8f",
+ "reference": "093ca5508174cd8ab8efe44fd1dde447adfdec8f",
"shasum": ""
},
"require": {
@@ -2626,20 +1723,20 @@
"testing",
"xunit"
],
- "time": "2018-04-10T11:38:34+00:00"
+ "time": "2018-07-03T06:40:40+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
- "version": "5.0.6",
+ "version": "5.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf"
+ "reference": "6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
- "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f",
+ "reference": "6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f",
"shasum": ""
},
"require": {
@@ -2685,7 +1782,7 @@
"mock",
"xunit"
],
- "time": "2018-01-06T05:45:45+00:00"
+ "time": "2018-07-13T03:27:23+00:00"
},
{
"name": "psr/container",
@@ -2833,86 +1930,6 @@
],
"time": "2016-10-10T12:19:37+00:00"
},
- {
- "name": "ramsey/uuid",
- "version": "3.7.3",
- "source": {
- "type": "git",
- "url": "https://github.com/ramsey/uuid.git",
- "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
- "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
- "shasum": ""
- },
- "require": {
- "paragonie/random_compat": "^1.0|^2.0",
- "php": "^5.4 || ^7.0"
- },
- "replace": {
- "rhumsaa/uuid": "self.version"
- },
- "require-dev": {
- "codeception/aspect-mock": "^1.0 | ~2.0.0",
- "doctrine/annotations": "~1.2.0",
- "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1",
- "ircmaxell/random-lib": "^1.1",
- "jakub-onderka/php-parallel-lint": "^0.9.0",
- "mockery/mockery": "^0.9.9",
- "moontoast/math": "^1.1",
- "php-mock/php-mock-phpunit": "^0.3|^1.1",
- "phpunit/phpunit": "^4.7|^5.0",
- "squizlabs/php_codesniffer": "^2.3"
- },
- "suggest": {
- "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator",
- "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator",
- "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
- "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).",
- "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid",
- "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type."
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Ramsey\\Uuid\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Marijn Huizendveld",
- "email": "marijn.huizendveld@gmail.com"
- },
- {
- "name": "Thibaud Fabre",
- "email": "thibaud@aztech.io"
- },
- {
- "name": "Ben Ramsey",
- "email": "ben@benramsey.com",
- "homepage": "https://benramsey.com"
- }
- ],
- "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).",
- "homepage": "https://github.com/ramsey/uuid",
- "keywords": [
- "guid",
- "identifier",
- "uuid"
- ],
- "time": "2018-01-20T00:28:24+00:00"
- },
{
"name": "sebastian/code-unit-reverse-lookup",
"version": "1.0.1",
@@ -3474,16 +2491,16 @@
},
{
"name": "symfony/browser-kit",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
- "reference": "c43bfa0182363b3fd64331b5e64e467349ff4670"
+ "reference": "ff9ac5d5808a530b2e7f6abcf3a2412d4f9bcd62"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c43bfa0182363b3fd64331b5e64e467349ff4670",
- "reference": "c43bfa0182363b3fd64331b5e64e467349ff4670",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/ff9ac5d5808a530b2e7f6abcf3a2412d4f9bcd62",
+ "reference": "ff9ac5d5808a530b2e7f6abcf3a2412d4f9bcd62",
"shasum": ""
},
"require": {
@@ -3500,7 +2517,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3527,20 +2544,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
- "time": "2018-03-19T22:35:49+00:00"
+ "time": "2018-06-04T17:31:56+00:00"
},
{
"name": "symfony/console",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64"
+ "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/aad9a6fe47319f22748fd764f52d3a7ca6fa6b64",
- "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64",
+ "url": "https://api.github.com/repos/symfony/console/zipball/5c31f6a97c1c240707f6d786e7e59bfacdbc0219",
+ "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219",
"shasum": ""
},
"require": {
@@ -3560,7 +2577,7 @@
"symfony/process": "~3.4|~4.0"
},
"suggest": {
- "psr/log": "For using the console logger",
+ "psr/log-implementation": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/lock": "",
"symfony/process": ""
@@ -3568,7 +2585,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3595,20 +2612,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-04-03T05:24:00+00:00"
+ "time": "2018-07-16T14:05:40+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2"
+ "reference": "03ac71606ecb0b0ce792faa17d74cc32c2949ef4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/03f965583147957f1ecbad7ea1c9d6fd5e525ec2",
- "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/03ac71606ecb0b0ce792faa17d74cc32c2949ef4",
+ "reference": "03ac71606ecb0b0ce792faa17d74cc32c2949ef4",
"shasum": ""
},
"require": {
@@ -3617,7 +2634,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3648,24 +2665,25 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2018-03-19T22:35:49+00:00"
+ "time": "2018-05-30T07:26:09+00:00"
},
{
"name": "symfony/dom-crawler",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
- "reference": "d6c04c7532535b5e0b63db45b543cd60818e0fbc"
+ "reference": "eb501fa8aab8c8e2db790d8d0f945697769f6c41"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d6c04c7532535b5e0b63db45b543cd60818e0fbc",
- "reference": "d6c04c7532535b5e0b63db45b543cd60818e0fbc",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/eb501fa8aab8c8e2db790d8d0f945697769f6c41",
+ "reference": "eb501fa8aab8c8e2db790d8d0f945697769f6c41",
"shasum": ""
},
"require": {
"php": "^7.1.3",
+ "symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
@@ -3677,7 +2695,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3704,20 +2722,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
- "time": "2018-03-19T22:35:49+00:00"
+ "time": "2018-07-05T11:54:23+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "63353a71073faf08f62caab4e6889b06a787f07b"
+ "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b",
- "reference": "63353a71073faf08f62caab4e6889b06a787f07b",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f",
+ "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f",
"shasum": ""
},
"require": {
@@ -3740,7 +2758,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3767,29 +2785,30 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2018-04-06T07:35:43+00:00"
+ "time": "2018-07-10T11:02:47+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21"
+ "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21",
- "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c",
+ "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c",
"shasum": ""
},
"require": {
- "php": "^7.1.3"
+ "php": "^7.1.3",
+ "symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3816,20 +2835,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2018-02-22T10:50:29+00:00"
+ "time": "2018-05-30T07:26:09+00:00"
},
{
"name": "symfony/finder",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49"
+ "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
- "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb",
+ "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb",
"shasum": ""
},
"require": {
@@ -3838,7 +2857,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3865,41 +2884,37 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2018-04-04T05:10:37+00:00"
+ "time": "2018-06-19T21:38:16+00:00"
},
{
- "name": "symfony/http-foundation",
- "version": "v4.0.8",
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.8.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/http-foundation.git",
- "reference": "d0864a82e5891ab61d31eecbaa48bed5a09b8e6c"
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0864a82e5891ab61d31eecbaa48bed5a09b8e6c",
- "reference": "d0864a82e5891ab61d31eecbaa48bed5a09b8e6c",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+ "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
- "symfony/polyfill-mbstring": "~1.1"
- },
- "require-dev": {
- "symfony/expression-language": "~3.4|~4.0"
+ "php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\HttpFoundation\\": ""
+ "Symfony\\Polyfill\\Ctype\\": ""
},
- "exclude-from-classmap": [
- "/Tests/"
+ "files": [
+ "bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -3907,31 +2922,37 @@
"MIT"
],
"authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
+ },
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
}
],
- "description": "Symfony HttpFoundation Component",
+ "description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
- "time": "2018-04-03T05:24:00+00:00"
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "time": "2018-04-30T19:57:29+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": ""
},
"require": {
@@ -3943,7 +2964,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
@@ -3977,20 +2998,20 @@
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26T10:06:28+00:00"
},
{
"name": "symfony/process",
- "version": "v4.0.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25"
+ "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25",
- "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25",
+ "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
+ "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
"shasum": ""
},
"require": {
@@ -3999,7 +3020,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -4026,24 +3047,25 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2018-04-03T05:24:00+00:00"
+ "time": "2018-05-31T10:17:53+00:00"
},
{
"name": "symfony/yaml",
- "version": "v3.4.8",
+ "version": "v4.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "a42f9da85c7c38d59f5e53f076fe81a091f894d0"
+ "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/a42f9da85c7c38d59f5e53f076fe81a091f894d0",
- "reference": "a42f9da85c7c38d59f5e53f076fe81a091f894d0",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/80e4bfa9685fc4a09acc4a857ec16974a9cd944e",
+ "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e",
"shasum": ""
},
"require": {
- "php": "^5.5.9|>=7.0.8"
+ "php": "^7.1.3",
+ "symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
@@ -4057,7 +3079,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.4-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -4084,7 +3106,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2018-04-03T05:14:20+00:00"
+ "time": "2018-05-30T07:26:09+00:00"
},
{
"name": "theseer/tokenizer",
@@ -4128,28 +3150,28 @@
},
{
"name": "vlucas/phpdotenv",
- "version": "v2.4.0",
+ "version": "v2.5.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
- "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c"
+ "reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
- "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/6ae3e2e6494bb5e58c2decadafc3de7f1453f70a",
+ "reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
- "phpunit/phpunit": "^4.8 || ^5.0"
+ "phpunit/phpunit": "^4.8.35 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.4-dev"
+ "dev-master": "2.5-dev"
}
},
"autoload": {
@@ -4159,7 +3181,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause-Attribution"
+ "BSD-3-Clause"
],
"authors": [
{
@@ -4174,7 +3196,7 @@
"env",
"environment"
],
- "time": "2016-09-01T10:05:43+00:00"
+ "time": "2018-07-01T10:25:50+00:00"
},
{
"name": "webmozart/assert",
@@ -4233,6 +3255,8 @@
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
- "platform": [],
+ "platform": {
+ "php": "~7.1.3||~7.2.0"
+ },
"platform-dev": []
}
diff --git a/dev/tests/acceptance/pre-install.php b/dev/tests/acceptance/pre-install.php
deleted file mode 100644
index 4021dc1094948..0000000000000
--- a/dev/tests/acceptance/pre-install.php
+++ /dev/null
@@ -1,395 +0,0 @@
-foreground_colors['black'] = '0;30';
- $this->foreground_colors['dark_gray'] = '1;30';
- $this->foreground_colors['blue'] = '0;34';
- $this->foreground_colors['light_blue'] = '1;34';
- $this->foreground_colors['green'] = '0;32';
- $this->foreground_colors['light_green'] = '1;32';
- $this->foreground_colors['cyan'] = '0;36';
- $this->foreground_colors['light_cyan'] = '1;36';
- $this->foreground_colors['red'] = '0;31';
- $this->foreground_colors['light_red'] = '1;31';
- $this->foreground_colors['purple'] = '0;35';
- $this->foreground_colors['light_purple'] = '1;35';
- $this->foreground_colors['brown'] = '0;33';
- $this->foreground_colors['yellow'] = '1;33';
- $this->foreground_colors['light_gray'] = '0;37';
- $this->foreground_colors['white'] = '1;37';
-
- $this->background_colors['black'] = '40';
- $this->background_colors['red'] = '41';
- $this->background_colors['green'] = '42';
- $this->background_colors['yellow'] = '43';
- $this->background_colors['blue'] = '44';
- $this->background_colors['magenta'] = '45';
- $this->background_colors['cyan'] = '46';
- $this->background_colors['light_gray'] = '47';
- }
-
- /**
- * Returns colored string
- *
- * @param $string
- * @param null $foreground_color
- * @param null $background_color
- * @return string
- */
- public function getColoredString($string, $foreground_color = null, $background_color = null) {
- $colored_string = "";
-
- // Check if given foreground color found
- if (isset($this->foreground_colors[$foreground_color])) {
- $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m";
- }
- // Check if given background color found
- if (isset($this->background_colors[$background_color])) {
- $colored_string .= "\033[" . $this->background_colors[$background_color] . "m";
- }
-
- // Add string and end coloring
- $colored_string .= $string . "\033[0m";
-
- return $colored_string;
- }
-
- /**
- * Returns all foreground color names
- *
- * @return array
- */
- public function getForegroundColors() {
- return array_keys($this->foreground_colors);
- }
-
- /**
- * Returns all background color names
- *
- * @return array
- */
- public function getBackgroundColors() {
- return array_keys($this->background_colors);
- }
-}
-
-/**
- * @SuppressWarnings(PHPMD)
- */
-class PreInstallCheck {
- private $installedViaBrew = false;
- private $filePath = '';
- private $seleniumJarVersion = '';
-
- private $phpWebsite = 'http://php.net/manual/en/install.php';
- private $composerWebsite = 'https://getcomposer.org/download/';
- private $javaWebsite = 'https://www.java.com/en/download/';
- private $allureCliWebsite = 'https://docs.qameta.io/allure/latest/#_installing_a_commandline';
- private $seleniumWebsite = 'http://www.seleniumhq.org/download/';
- private $chromeDriverWebsite = 'https://sites.google.com/a/chromium.org/chromedriver/downloads';
- private $geckoDriverWebsite = 'https://github.com/mozilla/geckodriver';
- private $phantomJsWebsite = 'http://phantomjs.org/';
-
- private $phpSupportedVersion = '7.1.0';
- private $composerSupportedVersion = '1.3.0';
- private $javaSupportedVersion = '1.8.0';
- private $allureCliSupportedVersion = '2.3.0';
- private $seleniumSupportedVersion = '3.6.0';
- private $chromeDriverSupportedVersion = '2.33.0';
- private $geckoDriverSupportedVersion = '0.19.0';
- private $phantomJsSupportedVersion = '2.1.0';
-
- private $getPhpVersion;
- private $getComposerVersion;
- private $getJavaVersion;
- private $getAllureCliVersion;
- private $getSeleniumVersion;
- private $getChromeDriverVersion;
- private $getGeckoDriverVersion;
- private $getPhantomJsVersion;
-
- private $phpVersion;
- private $composerVersion;
- private $javaVersion;
- private $allureCliVersion;
- private $seleniumVersion;
- private $chromeDriverVersion;
- private $geckoDriverVersion;
- private $phantomJsVersion;
-
- private $phpStatus;
- private $composerStatus;
- private $javaStatus;
- private $allureCliStatus;
- private $seleniumStatus;
- private $chromeDriverStatus;
- private $geckoDriverStatus;
- private $phantomJsStatus;
-
- function __construct() {
- $this->didYouInstallViaBrew();
-
- $this->getPhpVersion = shell_exec('php --version');
- $this->getComposerVersion = shell_exec('composer --version');
- $this->getJavaVersion = shell_exec("java -version 2>&1");
- $this->getAllureCliVersion = shell_exec('allure --version');
- $this->getSeleniumVersion = $this->getSeleniumVersion();
- $this->getChromeDriverVersion = $this->getChromeDriverVersion();
- $this->getGeckoDriverVersion = shell_exec('geckodriver --version');
- $this->getPhantomJsVersion = $this->getPhantomJsVersion();
-
- $this->phpVersion = $this->parseVersion($this->getPhpVersion);
- $this->composerVersion = $this->parseVersion($this->getComposerVersion);
- $this->javaVersion = $this->parseJavaVersion($this->getJavaVersion);
- $this->allureCliVersion = $this->parseVersion($this->getAllureCliVersion);
- $this->seleniumVersion = $this->parseVersion($this->getSeleniumVersion);
- $this->chromeDriverVersion = $this->parseVersion($this->getChromeDriverVersion);
- $this->geckoDriverVersion = $this->parseVersion($this->getGeckoDriverVersion);
- $this->phantomJsVersion = $this->parseVersion($this->getPhantomJsVersion);
-
- // String of null Versions - For Testing
-// $this->phpVersion = null;
-// $this->composerVersion = null;
-// $this->javaVersion = null;
-// $this->allureCliVersion = null;
-// $this->seleniumVersion = null;
-// $this->chromeDriverVersion = null;
-// $this->geckoDriverVersion = null;
-// $this->phantomJsVersion = null;
-
- // String of invalid Versions - For Testing
-// $this->phpVersion = '7.0.0';
-// $this->composerVersion = '1.0.0';
-// $this->javaVersion = '1.0.0';
-// $this->allureCliVersion = '2.0.0';
-// $this->seleniumVersion = '3.0.0';
-// $this->chromeDriverVersion = '2.0.0';
-// $this->geckoDriverVersion = '0.0.0';
-// $this->phantomJsVersion = '2.0.0';
-
- $this->phpStatus = $this->verifyVersion('PHP', $this->phpVersion, $this->phpSupportedVersion, $this->phpWebsite);
- $this->composerStatus = $this->verifyVersion('Composer', $this->composerVersion, $this->composerSupportedVersion, $this->composerWebsite);
- $this->javaStatus = $this->verifyVersion('Java', $this->javaVersion, $this->javaSupportedVersion, $this->javaWebsite);
- $this->allureCliStatus = $this->verifyVersion('Allure CLI', $this->allureCliVersion, $this->allureCliSupportedVersion, $this->allureCliWebsite);
- $this->seleniumStatus = $this->verifyVersion('Selenium Standalone Server', $this->seleniumVersion, $this->seleniumSupportedVersion, $this->seleniumWebsite);
- $this->chromeDriverStatus = $this->verifyVersion('ChromeDriver', $this->chromeDriverVersion, $this->chromeDriverSupportedVersion, $this->chromeDriverWebsite);
- $this->geckoDriverStatus = $this->verifyVersion('GeckoDriver', $this->geckoDriverVersion, $this->geckoDriverSupportedVersion, $this->geckoDriverWebsite);
- $this->phantomJsStatus = $this->verifyVersion('PhantomJS', $this->phantomJsVersion, $this->phantomJsSupportedVersion, $this->phantomJsWebsite);
-
- ECHO "\n";
- $mask = "|%-13.13s |%18.18s |%18.18s |%-23.23s |\n";
- printf("---------------------------------------------------------------------------------\n");
- printf($mask, ' Software', 'Supported Version', 'Installed Version', ' Status');
- printf("---------------------------------------------------------------------------------\n");
- printf($mask, ' PHP', $this->phpSupportedVersion . '+', $this->phpVersion, ' ' . $this->phpStatus);
- printf($mask, ' Composer', $this->composerSupportedVersion . '+', $this->composerVersion, ' ' . $this->composerStatus);
- printf($mask, ' Java', $this->javaSupportedVersion . '+', $this->javaVersion, ' ' . $this->javaStatus);
- printf($mask, ' Allure CLI', $this->allureCliSupportedVersion . '+', $this->allureCliVersion, ' ' . $this->allureCliStatus);
- printf($mask, ' Selenium', $this->seleniumSupportedVersion . '+', $this->seleniumVersion, ' ' . $this->seleniumStatus);
- printf($mask, ' ChromeDriver', $this->chromeDriverSupportedVersion . '+', $this->chromeDriverVersion, ' ' . $this->chromeDriverStatus);
- printf($mask, ' GeckoDriver', $this->geckoDriverSupportedVersion . '+', $this->geckoDriverVersion, ' ' . $this->geckoDriverStatus);
- printf($mask, ' PhantomJS', $this->phantomJsSupportedVersion . '+', $this->phantomJsVersion, ' ' . $this->phantomJsStatus);
- printf("---------------------------------------------------------------------------------\n");
- }
-
- /**
- * Ask if they installed the Browser Drivers via Brew.
- * Brew installs things globally making them easier for us to access.
- */
- public function didYouInstallViaBrew()
- {
- ECHO "Did you install Selenium Server, ChromeDriver, GeckoDriver and PhantomJS using Brew? (y/n) ";
- $handle1 = fopen ("php://stdin","r");
- $line1 = fgets($handle1);
- if (trim($line1) != 'y') {
- ECHO "Where did you save the files? (ex /Users/first_last/Automation/) ";
- $handle2 = fopen ("php://stdin","r");
- $this->filePath = fgets($handle2);
- fclose($handle2);
-
- ECHO "Which selenium-server-standalone-X.X.X.jar file did you download? (ex 3.6.0) ";
- $handle3 = fopen ("php://stdin","r");
- $this->seleniumJarVersion = fgets($handle3);
- fclose($handle3);
- fclose($handle1);
- ECHO "\n";
- } else {
- $this->installedViaBrew = true;
- fclose($handle1);
- ECHO "\n";
- }
- }
-
- /**
- * Parse the string that is returned for the Version number only.
- *
- * @param $stdout
- * @return null
- */
- public function parseVersion($stdout)
- {
- preg_match("/\d+(?:\.\d+)+/", $stdout, $matches);
-
- if (!is_null($matches) && isset($matches[0])) {
- return $matches[0];
- } else {
- return null;
- }
- }
-
- /**
- * Parse the string that is returned for the Version number only.
- * The message Java returns differs from the others hence the separate function.
- *
- * @param $stdout
- * @return null
- */
- public function parseJavaVersion($stdout)
- {
- preg_match('/\"(.+?)\"/', $stdout, $output_array);
-
- if (!is_null($output_array)) {
- return $output_array[1];
- } else {
- return null;
- }
- }
-
- /**
- * Get the Selenium Server version based on how it was installed.
- *
- * @return string
- */
- public function getSeleniumVersion()
- {
- $this->installedViaBrew;
- $this->filePath;
- $this->seleniumJarVersion;
-
- if ($this->installedViaBrew) {
- return shell_exec('selenium-server --version');
- } else {
- $command = sprintf('java -jar %s/selenium-server-standalone-%s.jar --version', $this->filePath, $this->seleniumJarVersion);
- $command = str_replace(array("\r", "\n"), '', $command) . "\n";
- return shell_exec($command);
- }
- }
-
- /**
- * Get the ChromeDriver version based on how it was installed.
- *
- * @return string
- */
- public function getChromeDriverVersion()
- {
- $this->installedViaBrew;
- $this->filePath;
-
- if ($this->installedViaBrew) {
- return shell_exec('chromedriver --version');
- } else {
- $command = sprintf('%s/chromedriver --version', $this->filePath);
- $command = str_replace(array("\r", "\n"), '', $command) . "\n";
- return shell_exec($command);
- }
- }
-
- /**
- * Get the PhantomJS version based on how it was installed.
- *
- * @return string
- */
- public function getPhantomJsVersion()
- {
- $this->installedViaBrew;
- $this->filePath;
-
- if ($this->installedViaBrew) {
- return shell_exec('phantomjs --version');
- } else {
- $command = sprintf('%s/phantomjs --version', $this->filePath);
- $command = str_replace(array("\r", "\n"), '', $command) . "\n";
- return shell_exec($command);
- }
- }
-
- /**
- * Print a "Valid Version Detected" message in color.
- *
- * @param $softwareName
- */
- public function printValidVersion($softwareName)
- {
- $colors = new CliColors();
- $string = sprintf("%s detected. Version is supported!", $softwareName);
- ECHO $colors->getColoredString($string, "black", "green") . "\n";
- }
-
- /**
- * Print a "Upgraded Version Needed" message in color.
- *
- * @param $softwareName
- * @param $supportedVersion
- * @param $website
- */
- public function printUpgradeVersion($softwareName, $supportedVersion, $website)
- {
- $colors = new CliColors();
- $string = sprintf("Unsupported version of %s detected. Please upgrade to v%s+: %s", $softwareName, $supportedVersion, $website);
- ECHO $colors->getColoredString($string, "black", "yellow") . "\n";
- }
-
- /**
- * Print a "Not Installed. Install Required." message in color.
- *
- * @param $softwareName
- * @param $supportedVersion
- * @param $website
- */
- public function printNoInstalledVersion($softwareName, $supportedVersion, $website)
- {
- $colors = new CliColors();
- $string = sprintf("%s not detected. Please install v%s+: %s", $softwareName, $supportedVersion, $website);
- ECHO $colors->getColoredString($string, "black", "red") . "\n";
- }
-
- /**
- * Verify that the versions.
- * Print the correct status message.
- *
- * @param $softwareName
- * @param $installedVersion
- * @param $supportedVersion
- * @param $website
- * @return string
- */
- public function verifyVersion($softwareName, $installedVersion, $supportedVersion, $website)
- {
- if (is_null($installedVersion)) {
- $this->printNoInstalledVersion($softwareName, $supportedVersion, $website);
- return 'Installation Required!';
- } else if ($installedVersion >= $supportedVersion) {
- $this->printValidVersion($softwareName);
- return 'Correct Version!';
- } else {
- $this->printUpgradeVersion($softwareName, $supportedVersion, $website);
- return 'Upgrade Required!';
- }
- }
-}
-
-$preCheck = new PreInstallCheck();
-// @codingStandardsIgnoreEnd
\ No newline at end of file
diff --git a/dev/tests/acceptance/tests/_bootstrap.php b/dev/tests/acceptance/tests/_bootstrap.php
index d15481d18098c..2fa2da03d8f8b 100644
--- a/dev/tests/acceptance/tests/_bootstrap.php
+++ b/dev/tests/acceptance/tests/_bootstrap.php
@@ -4,107 +4,6 @@
* See COPYING.txt for license details.
*/
-$bootstrapRoot = dirname(__DIR__);
-$projectRootPath = $bootstrapRoot;
-
-// If we're under a vendor directory, find project root.
-if (strpos($bootstrapRoot, '/vendor') !== false) {
- $projectRootPath = substr($bootstrapRoot, 0, strpos($bootstrapRoot, '/vendor/'));
-}
-
-define('PROJECT_ROOT', $projectRootPath);
-
-
-//Load base paths from composer autoload file
-$autoloadFile = PROJECT_ROOT . '/vendor/autoload.php';
-
-$loader = require $autoloadFile;
-
-// Package Names.
-$FW_PACKAGE_NAME = "Magento\FunctionalTestingFramework\\";
-$TESTS_PACKAGE_NAME = "TODO";
-$MAGENTO_PACKAGE_NAME = "Magento\\";
-
-// Find framework path
-$COMPOSER_FW_FULL_PREFIX = $loader->getPrefixesPsr4()[$FW_PACKAGE_NAME][0] ?? null;
-if ($COMPOSER_FW_FULL_PREFIX === null) {
- throw new Exception(
- "You must have the magento/magento2-functional-testing-framework
- installed to be able to generate tests."
- );
-}
-$FW_PATH = substr(
- $COMPOSER_FW_FULL_PREFIX,
- 0,
- strpos($COMPOSER_FW_FULL_PREFIX, "/src/Magento/FunctionalTestingFramework")
-);
-
-// Find tests path
-$COMPOSER_TEST_FULL_PREFIX = $loader->getPrefixesPsr4()[$TESTS_PACKAGE_NAME][0] ?? null;
-if ($COMPOSER_TEST_FULL_PREFIX === null) {
- $TEST_PATH = __DIR__ . "/functional";
-} else {
- // Can't determine what to trim; we don't know the package name/structure yet
- $TEST_PATH = $COMPOSER_TEST_FULL_PREFIX;
-}
-
-// We register "Magento\\" to "tests/functional/Magento" for our own class loading, need to try and find a
-// prefix that isn't that one.
-$COMPOSER_MAGENTO_PREFIXES = $loader->getPrefixesPsr4()[$MAGENTO_PACKAGE_NAME];
-$COMPOSER_MAGENTO_FULL_PREFIX = null;
-foreach ($COMPOSER_MAGENTO_PREFIXES as $path) {
- if (strpos($path, "tests/functional/Magento") === 0) {
- $COMPOSER_MAGENTO_FULL_PREFIX = $path;
- }
-}
-if ($COMPOSER_MAGENTO_FULL_PREFIX === null) {
- $MAGENTO_PATH = dirname(__DIR__ . "/../../../../../");
-} else {
- $MAGENTO_PATH = substr(
- $COMPOSER_MAGENTO_FULL_PREFIX,
- 0,
- strpos($COMPOSER_MAGENTO_FULL_PREFIX, "/app/code/Magento")
- );
-}
-
-$RELATIVE_TESTS_MODULE_PATH = '/Magento/FunctionalTest';
-
-defined('MAGENTO_BP') || define('MAGENTO_BP', realpath($MAGENTO_PATH));
-
-//Load constants from .env file
-if (file_exists(MAGENTO_BP . '/dev/tests/acceptance/.env')) {
- $env = new \Dotenv\Loader(MAGENTO_BP . '/dev/tests/acceptance/.env');
- $env->load();
-
- if (array_key_exists('TESTS_MODULE_PATH', $_ENV) xor array_key_exists('TESTS_BP', $_ENV)) {
- throw new Exception(
- 'You must define both parameters TESTS_BP and TESTS_MODULE_PATH or neither parameter'
- );
- }
-
- foreach ($_ENV as $key => $var) {
- defined($key) || define($key, $var);
- }
-
- defined('MAGENTO_CLI_COMMAND_PATH') || define(
- 'MAGENTO_CLI_COMMAND_PATH',
- 'dev/tests/acceptance/utils/command.php'
- );
- $env->setEnvironmentVariable('MAGENTO_CLI_COMMAND_PATH', MAGENTO_CLI_COMMAND_PATH);
-
- defined('MAGENTO_CLI_COMMAND_PARAMETER') || define('MAGENTO_CLI_COMMAND_PARAMETER', 'command');
- $env->setEnvironmentVariable('MAGENTO_CLI_COMMAND_PARAMETER', MAGENTO_CLI_COMMAND_PARAMETER);
-}
-
-defined('FW_BP') || define('FW_BP', realpath($FW_PATH));
-defined('TESTS_BP') || define('TESTS_BP', realpath($TEST_PATH));
-defined('TESTS_MODULE_PATH') || define(
- 'TESTS_MODULE_PATH',
- realpath($TEST_PATH . $RELATIVE_TESTS_MODULE_PATH)
-);
-
-// add the debug flag here
-$debug_mode = $_ENV['MFTF_DEBUG'] ?? false;
-if (!(bool)$debug_mode && extension_loaded('xdebug')) {
- xdebug_disable();
-}
+//TODO remove this file once MFTF is fully decoupled from Magento
+// Need to load in the root level autload file
+require_once realpath(dirname(__DIR__) . "/../../../vendor/autoload.php");
diff --git a/dev/tests/acceptance/tests/functional.suite.dist.yml b/dev/tests/acceptance/tests/functional.suite.dist.yml
deleted file mode 100644
index e01c46ea7c649..0000000000000
--- a/dev/tests/acceptance/tests/functional.suite.dist.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright © Magento, Inc. All rights reserved.
-# See COPYING.txt for license details.
-
-# Codeception Test Suite Configuration
-#
-# Suite for acceptance tests.
-# Perform tests in browser using the WebDriver or PhpBrowser.
-# If you need both WebDriver and PHPBrowser tests - create a separate suite.
-
-class_name: AcceptanceTester
-namespace: Magento\FunctionalTestingFramework
-modules:
- enabled:
- - \Magento\FunctionalTestingFramework\Module\MagentoWebDriver
- - \Magento\FunctionalTestingFramework\Helper\Acceptance
- - \Magento\FunctionalTestingFramework\Helper\MagentoFakerData
- - \Magento\FunctionalTestingFramework\Module\MagentoRestDriver:
- url: "%MAGENTO_BASE_URL%/rest/default/V1/"
- username: "%MAGENTO_ADMIN_USERNAME%"
- password: "%MAGENTO_ADMIN_PASSWORD%"
- depends: PhpBrowser
- part: Json
- - \Magento\FunctionalTestingFramework\Module\MagentoSequence
- - \Magento\FunctionalTestingFramework\Module\MagentoAssert
- - Asserts
- config:
- \Magento\FunctionalTestingFramework\Module\MagentoWebDriver:
- url: "%MAGENTO_BASE_URL%"
- backend_name: "%MAGENTO_BACKEND_NAME%"
- browser: 'chrome'
- window_size: maximize
- username: "%MAGENTO_ADMIN_USERNAME%"
- password: "%MAGENTO_ADMIN_PASSWORD%"
- pageload_timeout: 30
- host: %SELENIUM_HOST%
- port: %SELENIUM_PORT%
- protocol: %SELENIUM_PROTOCOL%
- path: %SELENIUM_PATH%
- capabilities:
- chromeOptions:
- args: ["--start-maximized", "--disable-extensions", "--enable-automation"]
-
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/composer.json b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/composer.json
deleted file mode 100644
index df8598a93a2d8..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/composer.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "magento/magento2-functional-test-module-configurable-product-catalog-search",
- "description": "Magento 2 Functional Test Module Configurable Product Catalog Search",
- "type": "magento2-test-module",
- "version": "100.0.0-dev",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "1.0.0",
- "magento/magento2-functional-test-module-catalog": "100.0.0-dev",
- "magento/magento2-functional-test-module-catalog-search": "100.0.0-dev",
- "magento/magento2-functional-test-module-configurable-product": "100.0.0-dev",
- "php": "~7.1.3||~7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTest\\ConfigurableProductCatalogSearch\\": ""
- }
- },
- "extra": {
- "map": [
- [
- "*",
- "tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch"
- ]
- ]
- }
-}
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/composer.json b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/composer.json
deleted file mode 100644
index e7f61c1bc660d..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/composer.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "magento/magento2-functional-test-module-configurable-product-wishlist",
- "description": "Magento 2 Functional Test Module Configurable Product Wishlist",
- "type": "magento2-test-module",
- "version": "100.0.0-dev",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "1.0.0",
- "magento/magento2-functional-test-module-catalog": "100.0.0-dev",
- "magento/magento2-functional-test-module-configurable-product": "100.0.0-dev",
- "magento/magento2-functional-test-module-wishlist": "100.0.0-dev",
- "php": "~7.1.3||~7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTest\\ConfigurableProductWishlist\\": ""
- }
- },
- "extra": {
- "map": [
- [
- "*",
- "tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist"
- ]
- ]
- }
-}
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Framework/composer.json b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Framework/composer.json
deleted file mode 100644
index 3a00a525a5478..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Framework/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "magento/magento2-functional-test-framework",
- "description": "Magento 2 Functional Test Framework",
- "type": "magento2-test-module",
- "version": "100.0.0-dev",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "~2.0.0",
- "php": "~7.1.3||~7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTest\\Framework\\": ""
- }
- },
- "extra": {
- "map": [
- [
- "*",
- "dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Framework"
- ]
- ]
- }
-}
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTemplates/composer.json b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTemplates/composer.json
deleted file mode 100644
index e0ceb5bd23c1c..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTemplates/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "magento/magento2-functional-test-module-sample-templates",
- "description": "Magento 2 Functional Test Module Sample Templates",
- "type": "magento2-test-module",
- "version": "100.0.0-dev",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "1.0.0",
- "php": "~7.1.3||~7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTest\\SampleTemplates\\": ""
- }
- },
- "extra": {
- "map": [
- [
- "*",
- "tests/functional/Magento/FunctionalTest/SampleTemplates"
- ]
- ]
- }
-}
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AdvancedSampleTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AdvancedSampleTest.xml
index d7a03d4f0198f..4fead0e51497e 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AdvancedSampleTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AdvancedSampleTest.xml
@@ -16,7 +16,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AssertsTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AssertsTest.xml
index e1e0602d6103d..200c52cab797d 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AssertsTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/AssertsTest.xml
@@ -11,7 +11,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateConfigurableProductByApiTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateConfigurableProductByApiTest.xml
index cf0ea0225a4b1..d759d1ab27498 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateConfigurableProductByApiTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateConfigurableProductByApiTest.xml
@@ -12,7 +12,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateSalesRuleByApiTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateSalesRuleByApiTest.xml
index 8e9336dd6f149..8cd83fd62067f 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateSalesRuleByApiTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/CreateSalesRuleByApiTest.xml
@@ -12,7 +12,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/PersistMultipleEntitiesTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/PersistMultipleEntitiesTest.xml
index b809ab89cba52..6a196c2c32c02 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/PersistMultipleEntitiesTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/PersistMultipleEntitiesTest.xml
@@ -11,7 +11,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/SetPaymentConfigurationTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/SetPaymentConfigurationTest.xml
index 1bc6bd1865f7c..f908c5cb4572e 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/SetPaymentConfigurationTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/SetPaymentConfigurationTest.xml
@@ -11,7 +11,9 @@
-
+
+
+
@@ -19,7 +21,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/UpdateSimpleProductByApiTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/UpdateSimpleProductByApiTest.xml
index fbf203834b45e..b18c24050d3a6 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/UpdateSimpleProductByApiTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/Test/UpdateSimpleProductByApiTest.xml
@@ -11,7 +11,9 @@
-
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/composer.json b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/composer.json
deleted file mode 100644
index dc91e593e745b..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/SampleTests/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "magento/magento2-functional-test-module-sample-tests",
- "description": "Magento 2 Functional Test Module Sample Tests",
- "type": "magento2-test-module",
- "version": "100.0.0-dev",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "config": {
- "sort-packages": true
- },
- "require": {
- "magento/magento2-functional-testing-framework": "1.0.0",
- "php": "~7.1.3||~7.2.0"
- },
- "autoload": {
- "psr-4": {
- "Magento\\FunctionalTest\\SampleTests\\": ""
- }
- },
- "extra": {
- "map": [
- [
- "*",
- "tests/functional/Magento/FunctionalTest/SampleTests"
- ]
- ]
- }
-}
diff --git a/dev/tests/acceptance/tests/functional/_bootstrap.php b/dev/tests/acceptance/tests/functional/_bootstrap.php
deleted file mode 100644
index ac7a13ea41d29..0000000000000
--- a/dev/tests/acceptance/tests/functional/_bootstrap.php
+++ /dev/null
@@ -1,8 +0,0 @@
-&1", $output, $exitCode);
- if ($exitCode == 0) {
- http_response_code(202);
- } else {
- http_response_code(500);
- }
- echo implode("\n", $output);
- } else {
- http_response_code(403);
- echo "Given command not found valid in Magento CLI Command list.";
- }
-} else {
- http_response_code(412);
- echo("Command 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);
-}
-
-/**
- * Checks magento list of CLI commands for given $command. Does not check command parameters, just base command.
- * @param string $command
- * @return bool
- */
-function validateCommand($command)
-{
- $php = PHP_BINARY ?: (PHP_BINDIR ? PHP_BINDIR . '/php' : 'php');
- exec($php . ' -f ../../../../bin/magento list', $commandList);
- // Trim list of commands after first whitespace
- $commandList = array_map("trimAfterWhitespace", $commandList);
- return in_array(trimAfterWhitespace($command), $commandList);
-}
-
-/**
- * Returns given string trimmed of everything after the first found whitespace.
- * @param string $string
- * @return string
- */
-function trimAfterWhitespace($string)
-{
- return strtok($string, ' ');
-}
diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php
index af01e455fdd9d..84ac6360643c4 100644
--- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php
+++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php
@@ -92,9 +92,10 @@ private function getAppCache()
private function getGraphQlClient()
{
if ($this->graphQlClient === null) {
- return Bootstrap::getObjectManager()->get(\Magento\TestFramework\TestCase\GraphQl\Client::class);
- } else {
- $this->graphQlClient;
+ $this->graphQlClient = Bootstrap::getObjectManager()->get(
+ \Magento\TestFramework\TestCase\GraphQl\Client::class
+ );
}
+ return $this->graphQlClient;
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
index 1cd9a5c2b9c86..e83811042fd8b 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
@@ -208,7 +208,7 @@ public function testAddNegative($optionData)
];
if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
- if (isset($optionDataPost['title']) && empty($optionDataPost['title'])) {
+ if ($optionDataPost['title'] === null || $optionDataPost['title'] === '') {
$this->expectException('SoapFault');
$this->expectExceptionMessage('Missed values for option required fields');
} else {
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRenderListInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRenderListInterfaceTest.php
index 807269c03c06f..fb3ff3b134081 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRenderListInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRenderListInterfaceTest.php
@@ -25,7 +25,6 @@ class ProductRenderListInterfaceTest extends WebapiAbstract
* @magentoApiDataFixture Magento/Catalog/_files/product_special_price.php
* @dataProvider productRenderInfoProvider
* @param array $expectedRenderInfo
- * @param string $ids
* @return void
*/
public function testGetList(array $expectedRenderInfo)
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options.php
index 144f3a9926fe3..8a00de1be094f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options.php
@@ -10,7 +10,7 @@
'type' => 'field',
'sort_order' => 1,
'is_require' => 1,
- 'price' => 10,
+ 'price' => -10,
'price_type' => 'fixed',
'sku' => 'sku1',
'max_characters' => 10,
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options_negative.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options_negative.php
index 5d2737b3aa532..f8890ca2eaac0 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options_negative.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options_negative.php
@@ -6,7 +6,7 @@
return [
'empty_required_field' => [
- 'title' => '',
+ 'title' => null,
'type' => 'field',
'sort_order' => 1,
'is_require' => 1,
@@ -15,17 +15,6 @@
'sku' => 'sku1',
'max_characters' => 10,
],
- 'negative_price' => [
- 'title' => 'area option',
- 'type' => 'area',
- 'sort_order' => 2,
- 'is_require' => 0,
- 'price' => -20,
- 'price_type' => 'percent',
- 'sku' => 'sku2',
- 'max_characters' => 20,
-
- ],
'negative_value_of_image_size' => [
'title' => 'file option',
'type' => 'file',
@@ -54,7 +43,7 @@
'price' => 10.0,
'price_type' => 'fixed',
'sku' => 'radio option 1 sku',
- 'title' => '',
+ 'title' => null,
'sort_order' => 1,
],
],
diff --git a/dev/tests/functional/.gitignore b/dev/tests/functional/.gitignore
index d47f62b56bb9a..92e3004580b0c 100644
--- a/dev/tests/functional/.gitignore
+++ b/dev/tests/functional/.gitignore
@@ -6,3 +6,4 @@
/vendor
phpunit.xml
credentials.xml
+.htaccess
diff --git a/dev/tests/functional/bootstrap.php b/dev/tests/functional/bootstrap.php
index 9967697124e80..04156ca88ea70 100644
--- a/dev/tests/functional/bootstrap.php
+++ b/dev/tests/functional/bootstrap.php
@@ -6,23 +6,25 @@
defined('MTF_BOOT_FILE') || define('MTF_BOOT_FILE', __FILE__);
defined('MTF_BP') || define('MTF_BP', str_replace('\\', '/', (__DIR__)));
+defined('BP') || define('BP', str_replace('\\', '/', dirname(dirname(dirname((__DIR__))))));
defined('MTF_TESTS_PATH') || define('MTF_TESTS_PATH', MTF_BP . '/tests/app/');
defined('MTF_STATES_PATH') || define('MTF_STATES_PATH', MTF_BP . '/lib/Magento/Mtf/App/State/');
-require_once __DIR__ . '/../../../app/bootstrap.php';
restore_error_handler();
-$vendorAutoload = __DIR__ . '/vendor/autoload.php';
-
-if (isset($composerAutoloader)) {
- /** var $mtfComposerAutoload \Composer\Autoload\ClassLoader */
- $mtfComposerAutoload = include $vendorAutoload;
- $composerAutoloader->addClassMap($mtfComposerAutoload->getClassMap());
-} else {
- $composerAutoloader = include $vendorAutoload;
-}
-
+include __DIR__ . '/vendor/autoload.php';
setCustomErrorHandler();
+/* Custom umask value may be provided in optional mage_umask file in root */
+$umaskFile = BP . '/magento_umask';
+$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
+umask($mask);
+
+date_default_timezone_set('UTC');
+
+/* For data consistency between displaying (printing) and serialization a float number */
+ini_set('precision', 14);
+ini_set('serialize_precision', 14);
+
/**
* Set custom error handler
*/
diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory.php
index 5bb1efee62959..192cab5751986 100644
--- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory.php
+++ b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory.php
@@ -6,9 +6,6 @@
namespace Magento\Mtf\Util\Generate;
-use Magento\Framework\App;
-use Magento\Framework\ObjectManagerInterface;
-
/**
* Factory classes generator.
*
@@ -16,24 +13,10 @@
*/
class Factory extends AbstractGenerate
{
- /**
- * @var \Magento\Framework\ObjectManagerInterface
- */
- protected $objectManager;
-
- /**
- * @constructor
- * @param ObjectManagerInterface $objectManager
- */
- public function __construct(ObjectManagerInterface $objectManager)
- {
- $this->objectManager = $objectManager;
- }
-
/**
* Generate Handlers.
*
- * @return \Magento\Framework\App\ResponseInterface
+ * @return bool
*/
public function launch()
{
@@ -43,7 +26,7 @@ public function launch()
$this->objectManager->create(\Magento\Mtf\Util\Generate\Factory\Page::class)->launch();
$this->objectManager->create(\Magento\Mtf\Util\Generate\Factory\Repository::class)->launch();
- return $this->objectManager->get(\Magento\Framework\App\ResponseInterface::class);
+ return true;
}
/**
diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php b/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php
index a4b438a1d2de0..110d9d5fbd6c3 100644
--- a/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php
+++ b/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php
@@ -10,37 +10,6 @@
*/
class SequenceSorter implements SequenceSorterInterface
{
- /**
- * Magento ObjectManager.
- *
- * @var \Magento\Framework\ObjectManagerInterface
- */
- protected $magentoObjectManager;
-
- /**
- * @constructor
- */
- public function __construct()
- {
- $this->initObjectManager();
- }
-
- /**
- * Initialize Magento ObjectManager.
- *
- * @return void
- */
- protected function initObjectManager()
- {
- if (!$this->magentoObjectManager) {
- $objectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(
- BP,
- $_SERVER
- );
- $this->magentoObjectManager = $objectManagerFactory->create($_SERVER);
- }
- }
-
/**
* Get Magento module sequence load.
*
@@ -48,7 +17,8 @@ protected function initObjectManager()
*/
protected function getModuleSequence()
{
- return $this->magentoObjectManager->create(\Magento\Framework\Module\ModuleList\Loader::class)->load();
+ $ds = DIRECTORY_SEPARATOR;
+ return json_decode(file_get_contents(MTF_BP . $ds . 'generated' . $ds . 'moduleSequence.json'), true);
}
/**
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpUsedOnFrontend.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpUsedOnFrontend.php
index f028a0bcf65ba..7d75db5f0368c 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpUsedOnFrontend.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpUsedOnFrontend.php
@@ -22,7 +22,7 @@ class AssertHttpUsedOnFrontend extends AbstractConstraint
*
* @var string
*/
- private $unsecuredProtocol = \Magento\Framework\HTTP\PhpEnvironment\Request::SCHEME_HTTP;
+ const SCHEME_HTTP = 'http';
/**
* Browser interface.
@@ -53,11 +53,11 @@ public function processAssert(BrowserInterface $browser, Customer $customer)
// Log in to Customer Account on Storefront to assert that http is used indeed.
$this->objectManager->create(LogInCustomerOnStorefront::class, ['customer' => $this->customer])->run();
- $this->assertUsedProtocol($this->unsecuredProtocol);
+ $this->assertUsedProtocol(self::SCHEME_HTTP);
// Log out from Customer Account on Storefront to assert that JS is deployed validly as a part of statics.
$this->objectManager->create(LogOutCustomerOnStorefront::class)->run();
- $this->assertUsedProtocol($this->unsecuredProtocol);
+ $this->assertUsedProtocol(self::SCHEME_HTTP);
}
/**
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpsUsedOnBackend.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpsUsedOnBackend.php
index 5da51c8079d7f..cc64e4a4c7299 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpsUsedOnBackend.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertHttpsUsedOnBackend.php
@@ -16,18 +16,10 @@
class AssertHttpsUsedOnBackend extends AbstractConstraint
{
/**
- * Secured protocol format.
- *
- * @var string
- */
- private $securedProtocol = \Magento\Framework\HTTP\PhpEnvironment\Request::SCHEME_HTTPS;
-
- /**
- * Unsecured protocol format.
- *
- * @var string
+ * Protocols
*/
- private $unsecuredProtocol = \Magento\Framework\HTTP\PhpEnvironment\Request::SCHEME_HTTP;
+ const SCHEME_HTTP = 'http';
+ const SCHEME_HTTPS = 'https';
/**
* Browser interface.
@@ -50,7 +42,7 @@ public function processAssert(BrowserInterface $browser, Dashboard $adminDashboa
// Open specified Admin page using Navigation Menu to assert that JS is deployed validly as a part of statics.
$adminDashboardPage->open()->getMenuBlock()->navigate($navMenuPath);
- $this->assertUsedProtocol($this->securedProtocol);
+ $this->assertUsedProtocol(self::SCHEME_HTTPS);
$this->assertDirectHttpUnavailable();
}
@@ -80,10 +72,10 @@ protected function assertUsedProtocol($expectedProtocol)
*/
protected function assertDirectHttpUnavailable()
{
- $fakeUrl = str_replace($this->securedProtocol, $this->unsecuredProtocol, $this->browser->getUrl());
+ $fakeUrl = str_replace(self::SCHEME_HTTPS, self::SCHEME_HTTP, $this->browser->getUrl());
$this->browser->open($fakeUrl);
\PHPUnit\Framework\Assert::assertStringStartsWith(
- $this->securedProtocol,
+ self::SCHEME_HTTPS,
$this->browser->getUrl(),
'Merchant is not redirected to https if tries to access the Admin panel page directly via http.'
);
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php
index 9331c2c987549..61142adc8f9b3 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php
@@ -28,7 +28,7 @@ class ProductForm extends FormSections
*
* @var string
*/
- protected $attribute = './/*[contains(@class,"label")]/span[text()="%s"]';
+ protected $attribute = './/*[contains(@class,"label")]/label[text()="%s"]';
/**
* Product new from date field on the product form
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php
index 2b72d2b915ee6..990906b7e302a 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php
@@ -89,7 +89,7 @@ class View extends AbstractConfigureBlock
*
* @var string
*/
- protected $productDescription = '.product.attribute.description';
+ protected $productDescription = '.product.attribute.description .value';
/**
* Product short-description element.
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml
index b999900042c37..387e6418ee572 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.xml
@@ -102,7 +102,7 @@
- MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 is not stable
+ MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable
test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0
@@ -125,6 +125,7 @@
+ MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable
test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
index 9e20bbdaac1d9..5c05d4a840009 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
@@ -49,6 +49,10 @@
+
+ stable:no
+ MAGETWO-94169: [MTF] - OnePageCheckoutUsingNonDefaultAddress_0 fails on 2.3-develop
+
severity:S1
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php
index 37a4d5c26189f..42d6c4502ef49 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/AddProductsToTheCartStep.php
@@ -123,6 +123,7 @@ public function run()
}
}
$cart['data']['items'] = ['products' => $this->products];
+ sleep(10);
return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)];
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/EstimateShippingAndTaxStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/EstimateShippingAndTaxStep.php
index 21da4c66fa2f3..0780b7d13a285 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/EstimateShippingAndTaxStep.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/EstimateShippingAndTaxStep.php
@@ -107,6 +107,7 @@ public function run()
{
$this->checkoutCart->open();
$this->checkoutCart->getCartBlock()->waitCartContainerLoading();
+ sleep(20);
/** @var \Magento\Checkout\Test\Fixture\Cart $cart */
if ($this->cart !== null) {
$cart = $this->fixtureFactory->createByCode(
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php
index 9df49d2440568..d951d84bab78d 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php
@@ -91,8 +91,10 @@ public function __construct(
*/
public function run()
{
+ sleep(20);
$this->processLogin();
$this->processRegister();
+ sleep(20);
}
/**
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
index 1c697d9f1e5da..f1a8b17ae2855 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
@@ -6,9 +6,6 @@
namespace Magento\Customer\Test\TestCase;
-use Magento\Config\Test\Fixture\ConfigData;
-use Magento\Customer\Test\Constraint\AssertChangingWebsiteChangeCountries;
-use Magento\Framework\App\ObjectManager;
use Magento\Mtf\Fixture\FixtureFactory;
use Magento\Mtf\Fixture\FixtureInterface;
use Magento\Mtf\TestCase\Injectable;
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php
index 74d522e9545a8..431116903d372 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form/Items.php
@@ -51,6 +51,9 @@ public function getItemProductBlock($productSku)
*/
public function clickUpdateQty()
{
- $this->_rootElement->find($this->updateQty)->click();
+ $button = $this->_rootElement->find($this->updateQty);
+ if (!$button->isDisabled()) {
+ $button->click();
+ }
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
index 22ba984b489e2..c9bdbac4aa7ec 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php
@@ -30,7 +30,7 @@ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderI
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
\PHPUnit\Framework\Assert::assertFalse(
$salesOrderView->getPageActions()->isActionButtonVisible('Credit Memo'),
- 'Credit memo button is present on order view page.'
+ 'Credit memo button should not be present on order view page.'
);
}
diff --git a/dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertSuccessfulReadinessCheck.php b/dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertSuccessfulReadinessCheck.php
index 96fbc1905b5d0..676703924e59a 100644
--- a/dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertSuccessfulReadinessCheck.php
+++ b/dev/tests/functional/tests/app/Magento/Setup/Test/Constraint/AssertSuccessfulReadinessCheck.php
@@ -67,11 +67,13 @@ public function processAssert(SetupWizard $setupWizard)
$setupWizard->getReadiness()->getDependencyCheck(),
'Dependency check is incorrect.'
);
- \PHPUnit\Framework\Assert::assertContains(
- self::PHP_VERSION_MESSAGE,
- $setupWizard->getReadiness()->getPhpVersionCheck(),
- 'PHP version is incorrect.'
- );
+ if ($setupWizard->getReadiness()->isPhpVersionCheckVisible()) {
+ \PHPUnit\Framework\Assert::assertContains(
+ self::PHP_VERSION_MESSAGE,
+ $setupWizard->getReadiness()->getPhpVersionCheck(),
+ 'PHP version is incorrect.'
+ );
+ }
\PHPUnit\Framework\Assert::assertContains(
self::PHP_SETTING_REGEXP,
$setupWizard->getReadiness()->getSettingsCheck(),
diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php
index 5fe6096035803..1529755fdc3c9 100644
--- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php
+++ b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php
@@ -73,7 +73,7 @@ class CaseInfo extends Block
*
* @var string
*/
- private $orderAmount = '[ng-bind*="currentCase.orderAmount"]';
+ private $orderAmount = '[ng-bind*="currentCase.orderTotalAmount"]';
/**
* Locator value for order amount currency.
@@ -108,7 +108,7 @@ class CaseInfo extends Block
*
* @var string
*/
- private $shippingPrice = '[ng-if$="caseOrderSummary.shipments[0].shippingPrice"]';
+ private $shippingPrice = '[ng-if="shipment.shippingPrice"]';
/**
* Check if device data are present.
diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php
index ef292de3a9e5f..16621f9a0cd48 100644
--- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php
+++ b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php
@@ -33,6 +33,20 @@ class CaseSearch extends Form
*/
private $selectCaseLink = 'ul[case-list=cases] li[case-list-case=case] a';
+ /**
+ * Locator for resolving applied filters list.
+ *
+ * @var string
+ */
+ private $appliedFilters = '.app-taglist > ul > li > a';
+
+ /**
+ * Locator for loading spinner.
+ *
+ * @var string
+ */
+ private $spinner = '.cases-loading-spinner';
+
/**
* Fill search input with customer name and submit.
*
@@ -41,8 +55,46 @@ class CaseSearch extends Form
*/
public function searchCaseByCustomerName($customerName)
{
+ $this->resetFilters();
$this->_rootElement->find($this->searchBar)->setValue($customerName);
$this->_rootElement->find($this->submitButton)->click();
+ $this->waitLoadingSpinner();
+ }
+
+ /**
+ * Reset applied filters.
+ *
+ * @return void
+ */
+ private function resetFilters(): void
+ {
+ $filters = $this->_rootElement->getElements($this->appliedFilters);
+ if (!empty($filters)) {
+ foreach ($filters as $filter) {
+ $filter->click();
+ $this->waitLoadingSpinner();
+ }
+ }
+ }
+
+ /**
+ * Wait until loading spinner disappeared.
+ *
+ * @return void
+ */
+ private function waitLoadingSpinner(): void
+ {
+ $this->waitForElementNotVisible($this->spinner);
+ }
+
+ /**
+ * Checks if any case is visible.
+ *
+ * @return bool
+ */
+ public function isAnyCaseVisible(): bool
+ {
+ return $this->_rootElement->find($this->selectCaseLink)->isVisible();
}
/**
diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php
index 7f530afe4df63..7705a67360e55 100644
--- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php
+++ b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php
@@ -6,6 +6,8 @@
namespace Magento\Signifyd\Test\Block\SignifydConsole;
use Magento\Mtf\Block\Form;
+use Magento\Mtf\Client\Element\SimpleElement;
+use Magento\Mtf\Fixture\FixtureInterface;
/**
* Signifyd login block.
@@ -19,6 +21,23 @@ class SignifydLogin extends Form
*/
private $loginButton = '[type=submit]';
+ /**
+ * Locator for admin form notification window.
+ *
+ * @var string
+ */
+ private $notificationCloseButton = '.wm-close-button';
+
+ /**
+ * @inheritdoc
+ */
+ public function fill(FixtureInterface $fixture, SimpleElement $element = null)
+ {
+ $this->closeNotification();
+
+ return parent::fill($fixture, $element);
+ }
+
/**
* Login to Signifyd.
*
@@ -26,6 +45,20 @@ class SignifydLogin extends Form
*/
public function login()
{
+ $this->closeNotification();
$this->_rootElement->find($this->loginButton)->click();
}
+
+ /**
+ * Close notification popup.
+ *
+ * @return void
+ */
+ private function closeNotification(): void
+ {
+ $notification = $this->browser->find($this->notificationCloseButton);
+ if ($notification->isVisible()) {
+ $notification->click();
+ }
+ }
}
diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml
index 404229c2451cd..082627fe5821d 100644
--- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml
@@ -62,7 +62,6 @@
-
diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php
index 126e32489e6c9..c00c81fa237e0 100644
--- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php
+++ b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php
@@ -75,6 +75,11 @@ class SignifydObserveCaseStep implements TestStepInterface
*/
private $testStepFactory;
+ /**
+ * @var int
+ */
+ private $searchAttempts = 10;
+
/**
* @param AssertCaseInfoOnSignifydConsole $assertCaseInfoOnSignifydConsole
* @param SignifydAddress $signifydAddress
@@ -111,8 +116,16 @@ public function __construct(
public function run()
{
$this->signifydCases->open();
- $this->signifydCases->getCaseSearchBlock()
- ->searchCaseByCustomerName($this->signifydAddress->getFirstname());
+ // Search case few times because it can appear with delay.
+ for ($attempts = $this->searchAttempts; $attempts > 0; $attempts--) {
+ $this->signifydCases->getCaseSearchBlock()
+ ->searchCaseByCustomerName($this->signifydAddress->getFirstname());
+ if ($this->signifydCases->getCaseSearchBlock()->isAnyCaseVisible()) {
+ break;
+ }
+ sleep(3);
+ }
+
$this->signifydCases->getCaseSearchBlock()->selectCase();
$this->signifydCases->getCaseInfoBlock()->flagCase($this->signifydData->getCaseFlag());
diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php
index c98b5a874a762..170fef137ec9f 100644
--- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php
+++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php
@@ -6,7 +6,6 @@
namespace Magento\Ui\Test\Block\Adminhtml;
-use Magento\Framework\Exception\LocalizedException;
use Magento\Mtf\Fixture\InjectableFixture;
/**
@@ -53,13 +52,13 @@ protected function openContainer($sectionName)
*
* @param string $sectionName
* @return $this
- * @throws LocalizedException if section is not visible
+ * @throws \Exception if section is not visible
*/
public function openSection($sectionName)
{
$container = $this->getContainerElement($sectionName);
if (!$container->isVisible()) {
- throw new LocalizedException(__('Container is not found "' . $sectionName . '""'));
+ throw new \Exception('Container is not found "' . $sectionName . '""');
}
$section = $container->find($this->collapsedSection);
if ($section->isVisible()) {
diff --git a/dev/tests/functional/utils/bootstrap.php b/dev/tests/functional/utils/bootstrap.php
index 00c548e6b5cef..0b74dc6727a13 100644
--- a/dev/tests/functional/utils/bootstrap.php
+++ b/dev/tests/functional/utils/bootstrap.php
@@ -16,6 +16,3 @@
$objectManager = \Magento\Mtf\ObjectManagerFactory::getObjectManager();
\Magento\Mtf\ObjectManagerFactory::configure($objectManager);
-
-$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
-$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
diff --git a/dev/tests/functional/utils/generate.php b/dev/tests/functional/utils/generate.php
index e9a81a1eea224..61bcc3523f551 100644
--- a/dev/tests/functional/utils/generate.php
+++ b/dev/tests/functional/utils/generate.php
@@ -3,19 +3,15 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\Filesystem;
require_once dirname(__FILE__) . '/' . 'bootstrap.php';
-// Generate fixtures
-$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
-$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
-// Remove previously generated static classes
-$fs = $magentoObjectManager->create(Filesystem::class);
-$fs->getDirectoryWrite(DirectoryList::ROOT)->delete('dev/tests/functional/generated/');
+deleteDirectory(MTF_BP . '/generated');
+
+// Generate moduleSequence.json file
+generateModuleSequence();
// Generate factories for old end-to-end tests
-$magentoObjectManager->create(\Magento\Mtf\Util\Generate\Factory::class)->launch();
+$objectManager->create(\Magento\Mtf\Util\Generate\Factory::class)->launch();
$generatorPool = $objectManager->get('Magento\Mtf\Util\Generate\Pool');
foreach ($generatorPool->getGenerators() as $generator) {
@@ -28,3 +24,28 @@
}
\Magento\Mtf\Util\Generate\GenerateResult::displayResults();
+
+
+function deleteDirectory($dir)
+{
+ if (!file_exists($dir)) {
+ return true;
+ }
+ if (!is_dir($dir)) {
+ return unlink($dir);
+ }
+ foreach (scandir($dir) as $item) {
+ if ($item == '.' || $item == '..') {
+ continue;
+ }
+ if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
+ return false;
+ }
+ }
+ return rmdir($dir);
+}
+
+function generateModuleSequence()
+{
+ require_once "generate/moduleSequence.php";
+}
diff --git a/dev/tests/functional/utils/generate/fixture.php b/dev/tests/functional/utils/generate/fixture.php
index 9f454fb9dc5f1..68cdae4552261 100644
--- a/dev/tests/functional/utils/generate/fixture.php
+++ b/dev/tests/functional/utils/generate/fixture.php
@@ -5,6 +5,4 @@
*/
require_once dirname(__DIR__) . '/' . 'bootstrap.php';
-$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
-$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
$objectManager->create(\Magento\Mtf\Util\Generate\Fixture::class)->launch();
diff --git a/dev/tests/functional/utils/generate/moduleSequence.php b/dev/tests/functional/utils/generate/moduleSequence.php
new file mode 100644
index 0000000000000..22688d1b75820
--- /dev/null
+++ b/dev/tests/functional/utils/generate/moduleSequence.php
@@ -0,0 +1,20 @@
+create($_SERVER);
+$magentoComponentSequence = $magentoObjectManager->create(\Magento\Framework\Module\ModuleList\Loader::class)->load();
+if (!file_exists(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'generated')) {
+ mkdir(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'generated');
+}
+file_put_contents(
+ dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'generated' . DIRECTORY_SEPARATOR . 'moduleSequence.json',
+ json_encode($magentoComponentSequence, JSON_PRETTY_PRINT)
+);
diff --git a/dev/tests/functional/utils/generate/repository.php b/dev/tests/functional/utils/generate/repository.php
index b2dc75c076f43..6633e776c9410 100644
--- a/dev/tests/functional/utils/generate/repository.php
+++ b/dev/tests/functional/utils/generate/repository.php
@@ -5,5 +5,4 @@
*/
require_once dirname(__DIR__) . '/' . 'bootstrap.php';
-$magentoObjectManager->get(\Magento\Framework\App\State::class)->setAreaCode('frontend');
$objectManager->create(\Magento\Mtf\Util\Generate\Repository::class)->launch();
diff --git a/dev/tests/functional/utils/generateFixtureXml.php b/dev/tests/functional/utils/generateFixtureXml.php
deleted file mode 100644
index 73fc266f34052..0000000000000
--- a/dev/tests/functional/utils/generateFixtureXml.php
+++ /dev/null
@@ -1,12 +0,0 @@
-create(
- \Magento\Mtf\Util\Generate\Fixture\SchemaXml::class,
- ['objectManager' => $magentoObjectManager]
-)->launch();
diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
index 1aea568395c99..481cc629c6777 100644
--- a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
@@ -7,7 +7,7 @@
use Magento\Framework\App\Filesystem\DirectoryList;
-class AdvancedPricingTest extends \PHPUnit\Framework\TestCase
+class AdvancedPricingTest extends \Magento\TestFramework\Indexer\TestCase
{
/**
* @var \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing
@@ -24,6 +24,19 @@ class AdvancedPricingTest extends \PHPUnit\Framework\TestCase
*/
protected $fileSystem;
+ public static function setUpBeforeClass()
+ {
+ $db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()
+ ->getApplication()
+ ->getDbInstance();
+ if (!$db->isDbDumpExists()) {
+ throw new \LogicException('DB dump does not exist.');
+ }
+ $db->restoreFromDbDump();
+
+ parent::setUpBeforeClass();
+ }
+
protected function setUp()
{
parent::setUp();
@@ -37,7 +50,7 @@ protected function setUp()
/**
* @magentoAppArea adminhtml
- * @magentoDbIsolation enabled
+ * @magentoDbIsolation disabled
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
*/
@@ -49,6 +62,7 @@ public function testExport()
$index = 0;
$ids = [];
$origPricingData = [];
+ $skus = ['simple'];
while (isset($skus[$index])) {
$ids[$index] = $productRepository->get($skus[$index])->getId();
$origPricingData[$index] = $this->objectManager->create(\Magento\Catalog\Model\Product::class)
@@ -94,7 +108,7 @@ private function assertDiscountTypes($exportContent)
/**
* @magentoAppArea adminhtml
- * @magentoDbIsolation enabled
+ * @magentoDbIsolation disabled
* @magentoAppIsolation enabled
* @magentoConfigFixture current_store catalog/price/scope 1
* @magentoDataFixture Magento/AdvancedPricingImportExport/_files/product_with_second_website.php
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
index cc04e48adb620..ec2e97f942451 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
@@ -22,6 +22,9 @@ class CompareTest extends \Magento\TestFramework\TestCase\AbstractController
*/
protected $productRepository;
+ /**
+ * Test setup
+ */
protected function setUp()
{
parent::setUp();
@@ -32,6 +35,9 @@ protected function setUp()
$this->productRepository = $objectManager->create(\Magento\Catalog\Model\ProductRepository::class);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
public function testAddAction()
{
$this->_requireVisitorWithNoProducts();
@@ -48,7 +54,12 @@ public function testAddAction()
);
$this->assertSessionMessages(
- $this->equalTo(['You added product Simple Product 1 Name to the comparison list.']),
+ $this->equalTo(
+ [
+ 'You added product Simple Product 1 Name to the '.
+ 'comparison list.'
+ ]
+ ),
MessageInterface::TYPE_SUCCESS
);
@@ -57,17 +68,23 @@ public function testAddAction()
$this->_assertCompareListEquals([$product->getEntityId()]);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
public function testIndexActionAddProducts()
{
$this->_requireVisitorWithNoProducts();
$product = $this->productRepository->get('simple_product_2');
$this->dispatch('catalog/product_compare/index/items/' . $product->getEntityId());
- $this->assertRedirect($this->equalTo('http://localhost/index.php/catalog/product_compare/index/'));
+ $this->assertRedirect($this->stringStartsWith('http://localhost/index.php/catalog/product_compare/index/'));
$this->_assertCompareListEquals([$product->getEntityId()]);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
public function testRemoveAction()
{
$this->_requireVisitorWithTwoProducts();
@@ -84,6 +101,9 @@ public function testRemoveAction()
$this->_assertCompareListEquals([$restProduct->getEntityId()]);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
public function testRemoveActionWithSession()
{
$this->_requireCustomerWithTwoProducts();
@@ -101,6 +121,9 @@ public function testRemoveActionWithSession()
$this->_assertCompareListEquals([$secondProduct->getEntityId()]);
}
+ /**
+ * testIndexActionDisplay
+ */
public function testIndexActionDisplay()
{
$this->_requireVisitorWithTwoProducts();
@@ -127,6 +150,9 @@ public function testIndexActionDisplay()
$this->assertContains('$987.65', $responseBody);
}
+ /**
+ * testClearAction
+ */
public function testClearAction()
{
$this->_requireVisitorWithTwoProducts();
@@ -160,6 +186,9 @@ public function testRemoveActionProductNameXss()
);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
protected function _prepareCompareListWithProductNameXss()
{
/** @var $visitor \Magento\Customer\Model\Visitor */
@@ -182,6 +211,9 @@ protected function _prepareCompareListWithProductNameXss()
);
}
+ /**
+ * _requireVisitorWithNoProducts
+ */
protected function _requireVisitorWithNoProducts()
{
/** @var $visitor \Magento\Customer\Model\Visitor */
@@ -201,6 +233,9 @@ protected function _requireVisitorWithNoProducts()
$this->_assertCompareListEquals([]);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
protected function _requireVisitorWithTwoProducts()
{
/** @var $visitor \Magento\Customer\Model\Visitor */
@@ -233,6 +268,9 @@ protected function _requireVisitorWithTwoProducts()
$this->_assertCompareListEquals([$firstProductEntityId, $secondProductEntityId]);
}
+ /**
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
protected function _requireCustomerWithTwoProducts()
{
$customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php
index 2b7c416f6be16..15c90891878a0 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php
@@ -61,12 +61,13 @@ public function testProductUpdate()
$this->_processor->getIndexer()->isScheduled(),
'Indexer is in scheduled mode when turned to update on save mode'
);
- $this->_processor->reindexAll();
$this->_product->load(1);
$this->_product->setName('Updated Product');
$this->_product->save();
+ $this->_processor->reindexAll();
+
$category = $categoryFactory->create()->load(9);
$layer = $listProduct->getLayer();
$layer->setCurrentCategory($category);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
index 41556d5558006..d4214a32f31dc 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
@@ -30,6 +30,9 @@ class ValidatorInfoTest extends \PHPUnit\Framework\TestCase
*/
protected $validateFactoryMock;
+ /**
+ * {@inheritdoc}
+ */
protected function setUp()
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -111,11 +114,11 @@ public function testExceptionWithoutErrors()
*/
public function testValidate()
{
- $validateMock = $this->createPartialMock(\Zend_Validate::class, ['isValid']);
- $validateMock->expects($this->once())->method('isValid')->will($this->returnValue(true));
+ //use actual zend class to test changed functionality
+ $validate = $this->objectManager->create(\Zend_Validate::class);
$this->validateFactoryMock->expects($this->once())
->method('create')
- ->will($this->returnValue($validateMock));
+ ->will($this->returnValue($validate));
$this->assertTrue(
$this->model->validate(
$this->getOptionValue(),
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
index 594133e984a46..7b7a0591d1d97 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
@@ -8,6 +8,7 @@
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
+use Magento\CatalogInventory\Api\StockRegistryInterface;
/**
* Tests product model:
@@ -23,11 +24,23 @@ class ProductPriceTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
+ /**
+ * @var ProductRepositoryInterface
+ */
+ private $productRepository;
+
+ /**
+ * @inheritdoc
+ */
protected function setUp()
{
$this->_model = Bootstrap::getObjectManager()->create(Product::class);
+ $this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
}
+ /**
+ * @return void
+ */
public function testGetPrice()
{
$this->assertEmpty($this->_model->getPrice());
@@ -35,6 +48,9 @@ public function testGetPrice()
$this->assertEquals(10.0, $this->_model->getPrice());
}
+ /**
+ * @return void
+ */
public function testGetPriceModel()
{
$default = $this->_model->getPriceModel();
@@ -66,6 +82,9 @@ public function testGetFormatedPrice()
$this->assertEquals('$0.00', $this->_model->getFormatedPrice());
}
+ /**
+ * @return void
+ */
public function testSetGetFinalPrice()
{
$this->assertEquals(0, $this->_model->getFinalPrice());
@@ -81,14 +100,37 @@ public function testSetGetFinalPrice()
*/
public function testGetMinPrice(): void
{
- $productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
- $product = $productRepository->get('simple');
+ $product = $this->productRepository->get('simple');
$collection = Bootstrap::getObjectManager()->create(Collection::class);
$collection->addIdFilter($product->getId());
$collection->addPriceData();
$collection->load();
/** @var \Magento\Catalog\Model\Product $product */
$product = $collection->getFirstItem();
- $this->assertEquals(333, $product->getData('min_price'));
+ $this->assertEquals(323, $product->getData('min_price'));
+ }
+
+ /**
+ * @magentoDbIsolation disabled
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php
+ */
+ public function testGetMinPriceForComposite(): void
+ {
+ $confProduct = $this->productRepository->get('configurable');
+ $collection = Bootstrap::getObjectManager()->create(Collection::class);
+ $collection->addIdFilter($confProduct->getId());
+ $collection->addPriceData();
+ $collection->load();
+ $product = $collection->getFirstItem();
+ $this->assertEquals(10, $product->getData('min_price'));
+
+ $childProduct = $this->productRepository->get('simple_10');
+ $stockRegistry = Bootstrap::getObjectManager()->get(StockRegistryInterface::class);
+ $stockItem = $stockRegistry->getStockItem($childProduct->getId());
+ $stockItem->setIsInStock(false);
+ $stockRegistry->updateStockItemBySku($childProduct->getSku(), $stockItem);
+ $collection->clear()->load();
+ $product = $collection->getFirstItem();
+ $this->assertEquals(20, $product->getData('min_price'));
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
index b00090850e09b..82d39bbb7066a 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
@@ -20,6 +20,8 @@
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.TooManyMethods)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ProductTest extends \PHPUnit\Framework\TestCase
{
@@ -33,6 +35,9 @@ class ProductTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
+ /**
+ * @inheritdoc
+ */
protected function setUp()
{
$this->productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
@@ -43,6 +48,10 @@ protected function setUp()
);
}
+ /**
+ * @throws \Magento\Framework\Exception\FileSystemException
+ * @return void
+ */
public static function tearDownAfterClass()
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -64,6 +73,9 @@ public static function tearDownAfterClass()
}
}
+ /**
+ * @return void
+ */
public function testCanAffectOptions()
{
$this->assertFalse($this->_model->canAffectOptions());
@@ -103,6 +115,9 @@ public function testCRUD()
$crud->testCrud();
}
+ /**
+ * @return void
+ */
public function testCleanCache()
{
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
@@ -123,6 +138,9 @@ public function testCleanCache()
);
}
+ /**
+ * @return void
+ */
public function testAddImageToMediaGallery()
{
// Model accepts only files in tmp media path, we need to copy fixture file there
@@ -330,6 +348,9 @@ public function testIsVirtual()
$this->assertTrue($model->getIsVirtual());
}
+ /**
+ * @return void
+ */
public function testToArray()
{
$this->assertEquals([], $this->_model->toArray());
@@ -337,6 +358,9 @@ public function testToArray()
$this->assertEquals(['sku' => 'sku', 'name' => 'name'], $this->_model->toArray());
}
+ /**
+ * @return void
+ */
public function testFromArray()
{
$this->_model->fromArray(['sku' => 'sku', 'name' => 'name', 'stock_item' => ['key' => 'value']]);
@@ -408,6 +432,9 @@ public function testIsProductsHasSku()
);
}
+ /**
+ * @return void
+ */
public function testProcessBuyRequest()
{
$request = new \Magento\Framework\DataObject();
@@ -416,6 +443,9 @@ public function testProcessBuyRequest()
$this->assertArrayHasKey('errors', $result->getData());
}
+ /**
+ * @return void
+ */
public function testValidate()
{
$this->_model->setTypeId(
@@ -534,6 +564,8 @@ public function testValidateUniqueInputAttributeOnTheSameProduct()
}
/**
+ * Tests Customizable Options price values including negative value.
+ *
* @magentoDataFixture Magento/Catalog/_files/product_simple_with_custom_options.php
* @magentoAppIsolation enabled
*/
@@ -543,7 +575,7 @@ public function testGetOptions()
$options = $this->_model->getOptions();
$this->assertNotEmpty($options);
$expectedValue = [
- '3-1-select' => 3000.00,
+ '3-1-select' => -3000.00,
'3-2-select' => 5000.00,
'4-1-radio' => 600.234,
'4-2-radio' => 40000.00
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
index e58d445a25650..a5e55e181cbaf 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
@@ -50,6 +50,7 @@ public function testAddPriceDataOnSchedule()
{
$this->processor->getIndexer()->setScheduled(true);
$this->assertTrue($this->processor->getIndexer()->isScheduled());
+
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
/** @var \Magento\Catalog\Api\Data\ProductInterface $product */
@@ -81,7 +82,6 @@ public function testAddPriceDataOnSchedule()
$product = reset($items);
$this->assertCount(2, $items);
$this->assertEquals(15, $product->getPrice());
- $this->processor->getIndexer()->reindexList([1]);
$this->processor->getIndexer()->setScheduled(false);
}
@@ -127,6 +127,42 @@ public function testGetProductsWithTierPrice()
$this->assertEquals(5, $tierPrices[2]->getValue());
}
+ /**
+ * Test addAttributeToSort() with attribute 'is_saleable' works properly on frontend.
+ *
+ * @dataProvider addAttributeToSortDataProvider
+ * @magentoDataFixture Magento/Catalog/_files/multiple_products_with_non_saleable_product.php
+ * @magentoConfigFixture current_store cataloginventory/options/show_out_of_stock 1
+ * @magentoAppIsolation enabled
+ * @magentoAppArea frontend
+ */
+ public function testAddAttributeToSort(string $productSku, string $order)
+ {
+ /** @var Collection $productCollection */
+ $this->collection->addAttributeToSort('is_saleable', $order);
+ self::assertEquals(2, $this->collection->count());
+ self::assertSame($productSku, $this->collection->getFirstItem()->getSku());
+ }
+
+ /**
+ * Provide test data for testAddAttributeToSort().
+ *
+ * @return array
+ */
+ public function addAttributeToSortDataProvider()
+ {
+ return [
+ [
+ 'product_sku' => 'simple_saleable',
+ 'order' => Collection::SORT_ORDER_DESC,
+ ],
+ [
+ 'product_sku' => 'simple_not_saleable',
+ 'order' => Collection::SORT_ORDER_ASC,
+ ]
+ ];
+ }
+
/**
* Checks a case if table for join specified as an array.
*
@@ -151,20 +187,4 @@ public function testJoinTable()
self::assertContains($expected, str_replace(PHP_EOL, '', $sql));
}
-
- /**
- * Checks that a collection uses the correct join when filtering by null.
- *
- * This actually affects AbstractCollection, but inheritance yada yada.
- *
- * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
- * @magentoDbIsolation enabled
- */
- public function testFilterByNull()
- {
- $this->collection->addAttributeToFilter([['attribute' => 'special_price', 'null' => true]]);
- $productCount = $this->collection->count();
-
- $this->assertEquals(1, $productCount, 'Product with null special_price not found');
- }
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product.php
new file mode 100644
index 0000000000000..30b2aad2317c4
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product.php
@@ -0,0 +1,53 @@
+create(\Magento\Catalog\Model\Product::class);
+$product->isObjectNew(true);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setAttributeSetId(4)
+ ->setName('Simple Product')
+ ->setSku('simple_saleable')
+ ->setTaxClassId('none')
+ ->setDescription('description')
+ ->setShortDescription('short description')
+ ->setOptionsContainer('container1')
+ ->setMsrpDisplayActualPriceType(\Magento\Msrp\Model\Product\Attribute\Source\Type::TYPE_IN_CART)
+ ->setPrice(10)
+ ->setWeight(1)
+ ->setMetaTitle('meta title')
+ ->setMetaKeyword('meta keyword')
+ ->setMetaDescription('meta description')
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setWebsiteIds([1])
+ ->setCategoryIds([])
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1])
+ ->save();
+
+$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+$product->isObjectNew(true);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setAttributeSetId(4)
+ ->setName('Simple Product2')
+ ->setSku('simple_not_saleable')
+ ->setTaxClassId('none')
+ ->setDescription('description')
+ ->setShortDescription('short description')
+ ->setOptionsContainer('container1')
+ ->setMsrpDisplayActualPriceType(\Magento\Msrp\Model\Product\Attribute\Source\Type::TYPE_ON_GESTURE)
+ ->setPrice(20)
+ ->setWeight(1)
+ ->setMetaTitle('meta title')
+ ->setMetaKeyword('meta keyword')
+ ->setMetaDescription('meta description')
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_IN_CATALOG)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setWebsiteIds([1])
+ ->setCategoryIds([])
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 50, 'is_qty_decimal' => 0, 'is_in_stock' => 0])
+ ->save();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product_rollback.php
new file mode 100644
index 0000000000000..220509698dc33
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_with_non_saleable_product_rollback.php
@@ -0,0 +1,29 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+
+foreach (['simple_saleable', 'simple_not_saleable'] as $sku) {
+ try {
+ $product = $productRepository->get($sku, false, null, true);
+ $productRepository->delete($product);
+ } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
+ //Product already removed
+ }
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute.php
index 6ab607b5de88f..7dacdc42463a9 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute.php
@@ -12,45 +12,48 @@
$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
);
-$attribute->setData(
- [
- 'attribute_code' => 'multiselect_attribute',
- 'entity_type_id' => $installer->getEntityTypeId('catalog_product'),
- 'is_global' => 1,
- 'is_user_defined' => 1,
- 'frontend_input' => 'multiselect',
- 'is_unique' => 0,
- 'is_required' => 0,
- 'is_searchable' => 0,
- 'is_visible_in_advanced_search' => 0,
- 'is_comparable' => 0,
- 'is_filterable' => 1,
- 'is_filterable_in_search' => 0,
- 'is_used_for_promo_rules' => 0,
- 'is_html_allowed_on_front' => 1,
- 'is_visible_on_front' => 0,
- 'used_in_product_listing' => 0,
- 'used_for_sort_by' => 0,
- 'frontend_label' => ['Multiselect Attribute'],
- 'backend_type' => 'varchar',
- 'backend_model' => \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend::class,
- 'option' => [
- 'value' => [
- 'option_1' => ['Option 1'],
- 'option_2' => ['Option 2'],
- 'option_3' => ['Option 3'],
- 'option_4' => ['Option 4 "!@#$%^&*']
+$entityType = $installer->getEntityTypeId('catalog_product');
+if (!$attribute->loadByCode($entityType, 'multiselect_attribute')->getAttributeId()) {
+ $attribute->setData(
+ [
+ 'attribute_code' => 'multiselect_attribute',
+ 'entity_type_id' => $entityType,
+ 'is_global' => 1,
+ 'is_user_defined' => 1,
+ 'frontend_input' => 'multiselect',
+ 'is_unique' => 0,
+ 'is_required' => 0,
+ 'is_searchable' => 0,
+ 'is_visible_in_advanced_search' => 0,
+ 'is_comparable' => 0,
+ 'is_filterable' => 1,
+ 'is_filterable_in_search' => 0,
+ 'is_used_for_promo_rules' => 0,
+ 'is_html_allowed_on_front' => 1,
+ 'is_visible_on_front' => 0,
+ 'used_in_product_listing' => 0,
+ 'used_for_sort_by' => 0,
+ 'frontend_label' => ['Multiselect Attribute'],
+ 'backend_type' => 'varchar',
+ 'backend_model' => \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend::class,
+ 'option' => [
+ 'value' => [
+ 'option_1' => ['Option 1'],
+ 'option_2' => ['Option 2'],
+ 'option_3' => ['Option 3'],
+ 'option_4' => ['Option 4 "!@#$%^&*']
+ ],
+ 'order' => [
+ 'option_1' => 1,
+ 'option_2' => 2,
+ 'option_3' => 3,
+ 'option_4' => 4,
+ ],
],
- 'order' => [
- 'option_1' => 1,
- 'option_2' => 2,
- 'option_3' => 3,
- 'option_4' => 4,
- ],
- ],
- ]
-);
-$attribute->save();
+ ]
+ );
+ $attribute->save();
-/* Assign attribute to attribute set */
-$installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId());
+ /* Assign attribute to attribute set */
+ $installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId());
+}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute.php
new file mode 100644
index 0000000000000..3d2dfcdff53e0
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute.php
@@ -0,0 +1,39 @@
+create(
+ \Magento\Catalog\Setup\CategorySetup::class
+);
+
+/** @var $options \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection */
+$options = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class
+);
+$options->setAttributeFilter($attribute->getId());
+$optionIds = $options->getAllIds();
+
+$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
+ ->setId($optionIds[1] * 20)
+ ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default'))
+ ->setWebsiteIds([1])
+ ->setName('Out of Stock With Multiselect')
+ ->setSku('simple_ms_out_of_stock')
+ ->setPrice(10)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setMultiselectAttribute([$optionIds[1], $optionIds[2], $optionIds[3]])
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData(['use_config_manage_stock' => 1, 'qty' => 0,'is_in_stock' => 0])
+ ->save();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute_rollback.php
new file mode 100644
index 0000000000000..d1926f4769f77
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_out_of_stock_with_multiselect_attribute_rollback.php
@@ -0,0 +1,33 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+try {
+ $product = $productRepository->get('simple_ms_out_of_stock', false, null, true);
+ $productRepository->delete($product);
+} catch (NoSuchEntityException $e) {
+}
+
+\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(IndexerRegistry::class)
+ ->get(Magento\CatalogInventory\Model\Indexer\Stock\Processor::INDEXER_ID)
+ ->reindexAll();
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_options.php
index c3abd2dfcdae7..059b784978a22 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_options.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_options.php
@@ -51,7 +51,7 @@
[
'option_type_id' => null,
'title' => 'Option 1',
- 'price' => '3,000.00',
+ 'price' => '-3,000.00',
'price_type' => 'fixed',
'sku' => '3-1-select',
],
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options.php
index a6e01370dfefb..a9bc557fd9b72 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options.php
@@ -11,8 +11,6 @@
$product->setTypeId(
'simple'
-)->setId(
- 1
)->setAttributeSetId(
4
)->setWebsiteIds(
@@ -49,7 +47,7 @@
'type' => 'field',
'is_require' => true,
'sort_order' => 1,
- 'price' => 10.0,
+ 'price' => -10.0,
'price_type' => 'fixed',
'sku' => 'sku1',
'max_characters' => 10,
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_rollback.php
index 7a72f168f924f..eb8201f04e6cc 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_rollback.php
@@ -3,7 +3,11 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
require __DIR__ . '/multiselect_attribute_rollback.php';
+
+use Magento\Framework\Indexer\IndexerRegistry;
+
/**
* Remove all products as strategy of isolation process
*/
@@ -22,3 +26,7 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
+
+\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(IndexerRegistry::class)
+ ->get(Magento\CatalogInventory\Model\Indexer\Stock\Processor::INDEXER_ID)
+ ->reindexAll();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
index b1a10c894f83a..495d19a2745e5 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
@@ -3,8 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-declare(strict_types=1);
-
namespace Magento\CatalogRule\Model\Indexer\Product;
use Magento\TestFramework\Helper\Bootstrap;
@@ -14,13 +12,6 @@
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\SortOrder;
-/**
- * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/attribute.php
- * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/product_with_attribute.php
- * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/rule_by_attribute.php
- * @magentoDbIsolation enabled
- * @magentoAppIsolation enabled
- */
class PriceTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -28,18 +19,18 @@ class PriceTest extends \PHPUnit\Framework\TestCase
*/
private $resourceRule;
- /**
- * {@inheritdoc}
- */
protected function setUp()
{
$this->resourceRule = Bootstrap::getObjectManager()->get(Rule::class);
}
/**
- * @return void
+ * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/configurable_product.php
+ * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/rule_by_attribute.php
+ * @magentoDbIsolation enabled
+ * @magentoAppIsolation enabled
*/
- public function testPriceApplying() : void
+ public function testPriceApplying()
{
$customerGroupId = 1;
$websiteId = 1;
@@ -52,7 +43,6 @@ public function testPriceApplying() : void
/** @var \Magento\Catalog\Model\Product $simpleProduct */
$simpleProduct = $collection->getFirstItem();
$simpleProduct->setPriceCalculation(false);
-
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), $websiteId, $customerGroupId, $simpleProductId);
$this->assertEquals($rulePrice, $simpleProduct->getFinalPrice());
@@ -63,16 +53,17 @@ public function testPriceApplying() : void
$collection->load();
/** @var \Magento\Catalog\Model\Product $confProduct */
$confProduct = $collection->getFirstItem();
-
- $this->assertEquals($simpleProduct->getMinimalPrice(), $confProduct->getMinimalPrice());
+ $this->assertEquals($simpleProduct->getFinalPrice(), $confProduct->getMinimalPrice());
}
/**
+ * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/simple_products.php
+ * @magentoDataFixtureBeforeTransaction Magento/CatalogRule/_files/rule_by_attribute.php
+ * @magentoDbIsolation enabled
+ * @magentoAppIsolation enabled
* @magentoAppArea frontend
- *
- * @return void
*/
- public function testSortByPrice() : void
+ public function testSortByPrice()
{
$searchCriteria = Bootstrap::getObjectManager()->create(SearchCriteriaInterface::class);
$sortOrder = Bootstrap::getObjectManager()->create(SortOrder::class);
@@ -80,10 +71,10 @@ public function testSortByPrice() : void
$searchCriteria->setSortOrders([$sortOrder]);
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$searchResults = $productRepository->getList($searchCriteria);
- $products = $searchResults->getItems();
+ /** @var \Magento\Catalog\Model\Product[] $products */
+ $products = array_values($searchResults->getItems());
- /** @var \Magento\Catalog\Model\Product $product1 */
- $product1 = array_values($products)[0];
+ $product1 = $products[0];
$product1->setPriceCalculation(false);
$this->assertEquals('simple1', $product1->getSku());
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $product1->getId());
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product.php
similarity index 52%
rename from dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute.php
rename to dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product.php
index 071f5d7d9fd00..ef7144d9d8438 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product.php
@@ -6,12 +6,12 @@
declare(strict_types=1);
require __DIR__ . '/../../ConfigurableProduct/_files/configurable_attribute.php';
+require __DIR__ . '/simple_products.php';
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$storeManager = $objectManager->get(\Magento\Store\Model\StoreManager::class);
$store = $storeManager->getStore('default');
-
$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
$installer = $objectManager->get(\Magento\Catalog\Setup\CategorySetup::class);
@@ -19,63 +19,22 @@
$attributeValues = [];
$associatedProductIds = [];
-/** @var Magento\Eav\Model\Entity\Attribute\Option[] $options */
+$attributeRepository = $objectManager->get(\Magento\Eav\Api\AttributeRepositoryInterface::class);
+$attribute = $attributeRepository->get('catalog_product', 'test_configurable');
$options = $attribute->getOptions();
array_shift($options); //remove the first option which is empty
-
-$product = $objectManager->create(\Magento\Catalog\Model\Product::class)
- ->setTypeId('simple')
- ->setId(1)
- ->setAttributeSetId($attributeSetId)
- ->setWebsiteIds([1])
- ->setName('Simple Product 1')
- ->setSku('simple1')
- ->setPrice(10)
- ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
- ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
- ->setStockData([
- 'use_config_manage_stock' => 1,
- 'qty' => 100,
- 'is_qty_decimal' => 0,
- 'is_in_stock' => 1,
- ]);
-$option = array_shift($options);
-$product->setTestConfigurable($option->getValue());
-$productRepository->save($product);
-$attributeValues[] = [
- 'label' => 'test',
- 'attribute_id' => $attribute->getId(),
- 'value_index' => $option->getValue(),
-];
-$associatedProductIds[] = $product->getId();
-$productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class);
-$productAction->updateAttributes([$product->getId()], ['test_attribute' => 'test_attribute_value'], $store->getId());
-
-$product = $objectManager->create(\Magento\Catalog\Model\Product::class)
- ->setTypeId('simple')
- ->setId(2)
- ->setAttributeSetId($attributeSetId)
- ->setWebsiteIds([1])
- ->setName('Simple Product 2')
- ->setSku('simple2')
- ->setPrice(9.9)
- ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
- ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
- ->setStockData([
- 'use_config_manage_stock' => 1,
- 'qty' => 100,
- 'is_qty_decimal' => 0,
- 'is_in_stock' => 1,
- ]);
-$option = array_shift($options);
-$product->setTestConfigurable($option->getValue());
-$productRepository->save($product);
-$attributeValues[] = [
- 'label' => 'test',
- 'attribute_id' => $attribute->getId(),
- 'value_index' => $option->getValue(),
-];
-$associatedProductIds[] = $product->getId();
+foreach (['simple1', 'simple2'] as $sku) {
+ $option = array_shift($options);
+ $product = $productRepository->get($sku);
+ $product->setTestConfigurable($option->getValue());
+ $productRepository->save($product);
+ $attributeValues[] = [
+ 'label' => 'test',
+ 'attribute_id' => $attribute->getId(),
+ 'value_index' => $option->getValue(),
+ ];
+ $associatedProductIds[] = $product->getId();
+}
$product = $objectManager->create(\Magento\Catalog\Model\Product::class)
->setTypeId('configurable')
@@ -88,7 +47,9 @@
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
->setStockData([
'use_config_manage_stock' => 1,
- 'is_in_stock' => 0,
+ 'qty' => 100,
+ 'is_qty_decimal' => 0,
+ 'is_in_stock' => 1,
]);
$configurableAttributesData = [
[
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product_rollback.php
new file mode 100644
index 0000000000000..915da48c915b2
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/configurable_product_rollback.php
@@ -0,0 +1,32 @@
+getInstance()->reinitialize();
+
+/** @var $objectManager \Magento\TestFramework\ObjectManager */
+$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+
+/** @var \Magento\Framework\Registry $registry */
+$registry = $objectManager->get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+try {
+ $product = $productRepository->get('configurable', false, null, true);
+ $productRepository->delete($product);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
+ //Nothing to delete
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
+
+require __DIR__ . '/simple_products_rollback.php';
+require __DIR__ . '/../../ConfigurableProduct/_files/configurable_attribute_rollback.php';
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php
new file mode 100644
index 0000000000000..84ce4e1bca87c
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products.php
@@ -0,0 +1,55 @@
+get(\Magento\Store\Model\StoreManager::class);
+$store = $storeManager->getStore('default');
+$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+
+$installer = $objectManager->get(\Magento\Catalog\Setup\CategorySetup::class);
+$attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default');
+
+$product = $objectManager->create(\Magento\Catalog\Model\Product::class)
+ ->setTypeId('simple')
+ ->setId(1)
+ ->setAttributeSetId($attributeSetId)
+ ->setWebsiteIds([1])
+ ->setName('Simple Product 1')
+ ->setSku('simple1')
+ ->setPrice(10)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData([
+ 'use_config_manage_stock' => 1,
+ 'qty' => 100,
+ 'is_qty_decimal' => 0,
+ 'is_in_stock' => 1,
+ ]);
+$productRepository->save($product);
+$productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class);
+$productAction->updateAttributes([$product->getId()], ['test_attribute' => 'test_attribute_value'], $store->getId());
+
+$product = $objectManager->create(\Magento\Catalog\Model\Product::class)
+ ->setTypeId('simple')
+ ->setId(2)
+ ->setAttributeSetId($attributeSetId)
+ ->setWebsiteIds([1])
+ ->setName('Simple Product 2')
+ ->setSku('simple2')
+ ->setPrice(9.9)
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData([
+ 'use_config_manage_stock' => 1,
+ 'qty' => 100,
+ 'is_qty_decimal' => 0,
+ 'is_in_stock' => 1,
+ ]);
+$productRepository->save($product);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php
similarity index 87%
rename from dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute_rollback.php
rename to dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php
index 0ce909a3f9ecd..6625b1926fc10 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/product_with_attribute_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_products_rollback.php
@@ -18,7 +18,7 @@
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
-foreach (['simple1', 'simple2', 'configurable'] as $sku) {
+foreach (['simple1', 'simple2'] as $sku) {
try {
$product = $productRepository->get($sku, false, null, true);
$productRepository->delete($product);
@@ -30,4 +30,4 @@
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
-require __DIR__ . '/../../ConfigurableProduct/_files/configurable_attribute_rollback.php';
+require __DIR__ . '/attribute_rollback.php';
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterTest.php
deleted file mode 100644
index a8a404a1ee2d6..0000000000000
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterTest.php
+++ /dev/null
@@ -1,240 +0,0 @@
-objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
- $this->resource = $this->objectManager->create(ResourceConnection::class);
- $this->conditionManager = $this->objectManager->create(ConditionManager::class);
- $this->stockConfiguration = $this->objectManager->create(StockConfigurationInterface::class);
- $this->stockRegistry = $this->objectManager->create(StockRegistryInterface::class);
- $this->stockStatusFilter = $this->objectManager->create(StockStatusFilter::class);
- }
-
- /**
- * @expectedException InvalidArgumentException
- * @expectedExceptionMessage Invalid filter type: Luke I am your father!
- */
- public function testApplyWithWrongType()
- {
- $select = $this->resource->getConnection()->select();
- $this->stockStatusFilter->apply(
- $select,
- Stock::STOCK_IN_STOCK,
- 'Luke I am your father!',
- self::SHOW_OUT_OF_STOCK_ENABLED
- );
- }
-
- public function testApplyGeneralFilterWithOutOfStock()
- {
- $select = $this->resource->getConnection()->select();
- $select->from(
- ['some_index' => 'some_table'],
- ['entity_id' => 'entity_id']
- );
-
- $resultSelect = $this->stockStatusFilter->apply(
- $select,
- Stock::STOCK_IN_STOCK,
- StockStatusFilter::FILTER_JUST_ENTITY,
- self::SHOW_OUT_OF_STOCK_ENABLED
- );
-
- $expectedSelect = $this->getExpectedSelectForGeneralFilter(self::SHOW_OUT_OF_STOCK_ENABLED);
-
- $this->assertEquals(
- (string) $expectedSelect,
- (string) $resultSelect,
- 'Select queries must be the same'
- );
- }
-
- public function testApplyGeneralFilterWithoutOutOfStock()
- {
- $select = $this->resource->getConnection()->select();
- $select->from(
- ['some_index' => 'some_table'],
- ['entity_id' => 'entity_id']
- );
-
- $resultSelect = $this->stockStatusFilter->apply(
- $select,
- Stock::STOCK_IN_STOCK,
- StockStatusFilter::FILTER_JUST_ENTITY,
- self::SHOW_OUT_OF_STOCK_DISABLED
- );
-
- $expectedSelect = $this->getExpectedSelectForGeneralFilter(self::SHOW_OUT_OF_STOCK_DISABLED);
-
- $this->assertEquals(
- (string) $expectedSelect,
- (string) $resultSelect,
- 'Select queries must be the same'
- );
- }
-
- public function testApplyFullFilterWithOutOfStock()
- {
- $select = $this->resource->getConnection()->select();
- $select->from(
- ['some_index' => 'some_table'],
- ['entity_id' => 'entity_id']
- );
-
- $resultSelect = $this->stockStatusFilter->apply(
- $select,
- Stock::STOCK_IN_STOCK,
- StockStatusFilter::FILTER_ENTITY_AND_SUB_PRODUCTS,
- self::SHOW_OUT_OF_STOCK_ENABLED
- );
-
- $expectedSelect = $this->getExpectedSelectForFullFilter(self::SHOW_OUT_OF_STOCK_ENABLED);
-
- $this->assertEquals(
- (string) $expectedSelect,
- (string) $resultSelect,
- 'Select queries must be the same'
- );
- }
-
- public function testApplyFullFilterWithoutOutOfStock()
- {
- $select = $this->resource->getConnection()->select();
- $select->from(
- ['some_index' => 'some_table'],
- ['entity_id' => 'entity_id']
- );
-
- $resultSelect = $this->stockStatusFilter->apply(
- $select,
- Stock::STOCK_IN_STOCK,
- StockStatusFilter::FILTER_ENTITY_AND_SUB_PRODUCTS,
- self::SHOW_OUT_OF_STOCK_DISABLED
- );
-
- $expectedSelect = $this->getExpectedSelectForFullFilter(self::SHOW_OUT_OF_STOCK_DISABLED);
-
- $this->assertEquals(
- (string) $expectedSelect,
- (string) $resultSelect,
- 'Select queries must be the same'
- );
- }
-
- /**
- * @param bool $withOutOfStock
- * @return Select
- */
- private function getExpectedSelectForGeneralFilter($withOutOfStock)
- {
- $select = $this->resource->getConnection()->select();
- $select->from(
- ['some_index' => 'some_table'],
- ['entity_id' => 'entity_id']
- )->joinInner(
- ['stock_index' => $this->resource->getTableName('cataloginventory_stock_status')],
- $this->conditionManager->combineQueries(
- [
- 'stock_index.product_id = some_index.entity_id',
- $this->conditionManager->generateCondition(
- 'stock_index.website_id',
- '=',
- $this->stockConfiguration->getDefaultScopeId()
- ),
- $withOutOfStock
- ? ''
- : $this->conditionManager->generateCondition(
- 'stock_index.stock_status',
- '=',
- Stock::STOCK_IN_STOCK
- ),
- $this->conditionManager->generateCondition(
- 'stock_index.stock_id',
- '=',
- (int) $this->stockRegistry->getStock()->getStockId()
- ),
- ],
- Select::SQL_AND
- ),
- []
- );
-
- return $select;
- }
-
- /**
- * @param bool $withOutOfStock
- * @return Select
- */
- private function getExpectedSelectForFullFilter($withOutOfStock)
- {
- $select = $this->getExpectedSelectForGeneralFilter($withOutOfStock);
- $select->joinInner(
- ['sub_products_stock_index' => $this->resource->getTableName('cataloginventory_stock_status')],
- $this->conditionManager->combineQueries(
- [
- 'sub_products_stock_index.product_id = some_index.source_id',
- $this->conditionManager->generateCondition(
- 'sub_products_stock_index.website_id',
- '=',
- $this->stockConfiguration->getDefaultScopeId()
- ),
- $withOutOfStock
- ? ''
- : $this->conditionManager->generateCondition(
- 'sub_products_stock_index.stock_status',
- '=',
- Stock::STOCK_IN_STOCK
- ),
- $this->conditionManager->generateCondition(
- 'sub_products_stock_index.stock_id',
- '=',
- (int) $this->stockRegistry->getStock()->getStockId()
- ),
- ],
- Select::SQL_AND
- ),
- []
- );
-
- return $select;
- }
-}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php
new file mode 100644
index 0000000000000..e94eda11a3fc5
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php
@@ -0,0 +1,122 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->resource = $this->objectManager->get(ResourceConnection::class);
+ $this->stockStatusFilter = $this->objectManager->get(StockStatusFilter::class);
+ $this->customAttributeFilter = $this->objectManager->get(CustomAttributeFilter::class);
+ $eavConfig = $this->objectManager->get(EavConfig::class);
+ $attribute = $eavConfig->getAttribute(Product::ENTITY, 'multiselect_attribute');
+
+ $productRepository = $this->objectManager->get(ProductRepository::class);
+ $product = $productRepository->get('simple_ms_2');
+ $multiSelectArray = explode(',', $product->getData('multiselect_attribute'));
+
+ $this->filter = $this->objectManager->create(
+ Term::class,
+ [
+ 'field' => $attribute->getAttributeCode(),
+ 'name' => $attribute->getAttributeCode() . '_filter',
+ 'value' => reset($multiSelectArray),
+ ]
+ );
+ }
+
+ /**
+ * @param bool $showOutOfStockFlag
+ * @param int $expectedResult
+ * @return void
+ *
+ * @dataProvider applyDataProvider
+ */
+ public function testApply(bool $showOutOfStockFlag, int $expectedResult)
+ {
+ $select = $this->resource->getConnection()->select();
+ $select->from(
+ [$this->resource->getTableName('catalog_product_index_eav')],
+ ['entity_id']
+ )->distinct(true);
+ $select = $this->customAttributeFilter->apply($select, $this->filter);
+ $select = $this->stockStatusFilter->apply(
+ $select,
+ Stock::STOCK_IN_STOCK,
+ StockStatusFilter::FILTER_ENTITY_AND_SUB_PRODUCTS,
+ $showOutOfStockFlag
+ );
+
+ $data = $select->query()->fetchAll();
+
+ $this->assertEquals($expectedResult, count($data));
+ }
+
+ /**
+ * @return array
+ */
+ public function applyDataProvider(): array
+ {
+ return [
+ [true, 2],
+ [false, 1],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php
new file mode 100644
index 0000000000000..809116e9c7d84
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php
@@ -0,0 +1,105 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->resource = $this->objectManager->get(ResourceConnection::class);
+ $this->stockStatusFilter = $this->objectManager->get(StockStatusFilter::class);
+ }
+
+ /**
+ * @return void
+ *
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Invalid filter type: some_wrong_type
+ */
+ public function testApplyWithWrongType()
+ {
+ $select = $this->resource->getConnection()->select();
+ $this->stockStatusFilter->apply(
+ $select,
+ Stock::STOCK_IN_STOCK,
+ 'some_wrong_type',
+ true
+ );
+ }
+
+ /**
+ * @param bool $showOutOfStockFlag
+ * @param int $expectedResult
+ * @return void
+ *
+ * @dataProvider applyDataProvider
+ */
+ public function testApply(bool $showOutOfStockFlag, int $expectedResult)
+ {
+ $select = $this->resource->getConnection()->select();
+ $select->from(
+ [$this->resource->getTableName('catalog_product_index_eav')],
+ ['entity_id']
+ )->distinct(true);
+
+ $select = $this->stockStatusFilter->apply(
+ $select,
+ Stock::STOCK_IN_STOCK,
+ StockStatusFilter::FILTER_JUST_ENTITY,
+ $showOutOfStockFlag
+ );
+ $data = $select->query()->fetchAll();
+
+ $this->assertEquals($expectedResult, count($data));
+ }
+
+ /**
+ * @return array
+ */
+ public function applyDataProvider(): array
+ {
+ return [
+ [true, 6],
+ [false, 4],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Store/Block/SwitcherTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Store/Block/SwitcherTest.php
deleted file mode 100644
index 5b3879b592245..0000000000000
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Store/Block/SwitcherTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
- $this->model = $this->objectManager->create(\Magento\Store\Block\Switcher::class);
- $this->storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
- }
-
- /**
- * Test that after switching from Store 1 to Store 2 with another root Category user gets correct store url.
- *
- * @magentoDataFixture Magento/Store/_files/store.php
- * @magentoDataFixture Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups.php
- * @magentoAppArea frontend
- * @return void
- */
- public function testGetTargetStorePostData(): void
- {
- $storeCode = 'test';
- $store = $this->storeRepository->get($storeCode);
- $result = json_decode($this->model->getTargetStorePostData($store), true);
-
- $this->assertContains($storeCode, $result['action']);
- }
-}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups.php
deleted file mode 100644
index f77413e18f472..0000000000000
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups.php
+++ /dev/null
@@ -1,67 +0,0 @@
-create(\Magento\Catalog\Helper\DefaultCategory::class);
-/** @var \Magento\Catalog\Model\Category $category */
-$category = $objectManager->create(\Magento\Catalog\Model\Category::class);
-$category->isObjectNew(true);
-$category->setCreatedAt('2014-06-23 09:50:07')
- ->setName('Category 1')
- ->setParentId($defaultCategory->getId())
- ->setPath('1/2/3')
- ->setLevel(2)
- ->setAvailableSortBy('name')
- ->setDefaultSortBy('name')
- ->setIsActive(true)
- ->setPosition(1)
- ->setAvailableSortBy(['position'])
- ->save();
-
-/** @var \Magento\Store\Model\Store $store */
-$store = $objectManager->create(\Magento\Store\Model\Store::class);
-
-$category->setStoreId($store->load('default')->getId())
- ->setName('category-default-store')
- ->setUrlKey('category-default-store')
- ->save();
-
-$rootCategoryForTestStoreGroup = $objectManager->create(\Magento\Catalog\Model\Category::class);
-$rootCategoryForTestStoreGroup->isObjectNew(true);
-$rootCategoryForTestStoreGroup->setCreatedAt('2014-06-23 09:50:07')
- ->setName('Category 2')
- ->setParentId(\Magento\Catalog\Model\Category::TREE_ROOT_ID)
- ->setPath('1/2/334')
- ->setLevel(2)
- ->setAvailableSortBy('name')
- ->setDefaultSortBy('name')
- ->setIsActive(true)
- ->setPosition(1)
- ->setAvailableSortBy(['position'])
- ->save();
-
-$rootCategoryForTestStoreGroup->setStoreId($store->load('test')->getId())
- ->setName('category-test-store')
- ->setUrlKey('category-test-store')
- ->save();
-
-$storeCode = 'test';
-/** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
-$storeRepository = $objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
-/** @var \Magento\Store\Api\Data\StoreInterface $store */
-$store = $storeRepository->get($storeCode);
-
-/** @var \Magento\Store\Model\Group $storeGroup */
-$storeGroup = $objectManager->create(\Magento\Store\Model\Group::class)
- ->setWebsiteId('1')
- ->setCode('test_store_group')
- ->setName('Test Store Group')
- ->setRootCategoryId($rootCategoryForTestStoreGroup->getId())
- ->setDefaultStoreId($store->getId())
- ->save();
-
-$store->setGroupId($storeGroup->getId())->save();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups_rollback.php
deleted file mode 100644
index 9592e9d0e69b4..0000000000000
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/_files/two_categories_per_two_store_groups_rollback.php
+++ /dev/null
@@ -1,47 +0,0 @@
-get(Registry::class);
-$registry->unregister('isSecureArea');
-$registry->register('isSecureArea', true);
-// Delete first category
-/** @var SearchCriteriaBuilder $searchCriteriaBuilder */
-$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class);
-$searchCriteria = $searchCriteriaBuilder->addFilter('name', 'Category 1')->create();
-/** @var CategoryListInterface $categoryList */
-$categoryList = $objectManager->get(CategoryListInterface::class);
-$categories = $categoryList->getList($searchCriteria)->getItems();
-/** @var CategoryRepositoryInterface $categoryRepository */
-$categoryRepository = $objectManager->get(CategoryRepositoryInterface::class);
-foreach ($categories as $category) {
- $categoryRepository->delete($category);
-}
-// Delete second category
-$searchCriteria = $searchCriteriaBuilder->addFilter('name', 'Category 2')->create();
-$categories = $categoryList->getList($searchCriteria)->getItems();
-foreach ($categories as $category) {
- $categoryRepository->delete($category);
-}
-// Delete store group
-/** @var Group $store */
-$storeGroup = $objectManager->get(Group::class);
-$storeGroup->load('test_store_group', 'code');
-if ($storeGroup->getId()) {
- $storeGroup->delete();
-}
-$registry->unregister('isSecureArea');
-$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php
new file mode 100644
index 0000000000000..4c653ab9ae33f
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php
@@ -0,0 +1,120 @@
+json = $this->_objectManager->create(Json::class);
+ $this->formKey = $this->_objectManager->get(FormKey::class);
+ $this->session = $this->_objectManager->create(Session::class);
+ $this->productRepository = $this->_objectManager->create(ProductRepositoryInterface::class);
+ }
+
+ /**
+ * Tests of cart validation.
+ *
+ * @param array $requestQuantity
+ * @param array $expectedResponse
+ *
+ * @magentoDbIsolation enabled
+ * @magentoAppArea frontend
+ * @magentoDataFixture Magento/Checkout/_files/quote_with_simple_product.php
+ * @dataProvider requestDataProvider
+ */
+ public function testExecute($requestQuantity, $expectedResponse)
+ {
+ try {
+ /** @var $product Product */
+ $product = $this->productRepository->get('simple');
+ } catch (\Exception $e) {
+ $this->fail('No such product entity');
+ }
+
+ $quoteItem = $this->session
+ ->getQuote()
+ ->getItemByProduct($product);
+
+ $this->assertNotNull($quoteItem, 'Cannot get quote item for simple product');
+
+ $request = [];
+ if (!empty($requestQuantity) && is_array($requestQuantity)) {
+ $request= [
+ 'form_key' => $this->formKey->getFormKey(),
+ 'cart' => [
+ $quoteItem->getId() => $requestQuantity,
+ ]
+ ];
+ }
+
+ $this->getRequest()->setPostValue($request);
+ $this->dispatch('checkout/cart/updateItemQty');
+ $response = $this->getResponse()->getBody();
+
+ $this->assertEquals($this->json->unserialize($response), $expectedResponse);
+ }
+
+ /**
+ * Variations of request data.
+ * @returns array
+ */
+ public function requestDataProvider(): array
+ {
+ return [
+ [
+ 'request' => [],
+ 'response' => [
+ 'success' => false,
+ 'error_message' => 'Something went wrong while saving the page.'.
+ ' Please refresh the page and try again.'
+ ]
+ ],
+ [
+ 'request' => ['qty' => 2],
+ 'response' => [
+ 'success' => true,
+ ]
+ ],
+ [
+ 'request' => ['qty' => 230],
+ 'response' => [
+ 'success' => false,
+ 'error_message' => 'The requested qty is not available']
+ ],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php
new file mode 100644
index 0000000000000..c740609773b90
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php
@@ -0,0 +1,66 @@
+getRequest()
+ ->getHeaders()
+ ->addHeaderLine('Accept', 'application/json');
+ $this->dispatch($url);
+ $response = $this->getResponse();
+ $data = json_decode($response->getBody(), true);
+ self::assertEquals($expectedRows, $data['totalRecords']);
+
+ $titleList = array_column($data['items'], 'title');
+ self::assertEquals($expectedTitles, $titleList);
+ }
+
+ /**
+ * Gets list of variations with different search queries.
+ *
+ * @return array
+ */
+ public function queryDataProvider(): array
+ {
+ return [
+ [
+ 'query' => 'simple',
+ 'expectedRows' => 3,
+ 'expectedTitles' => ['simplePage', 'simplePage01', '01simplePage']
+ ],
+ [
+ 'query' => 'page01',
+ 'expectedRows' => 1,
+ 'expectedTitles' => ['simplePage01']
+ ],
+ [
+ 'query' => '01simple',
+ 'expectedRows' => 1,
+ 'expectedTitles' => ['01simplePage']
+ ],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php
new file mode 100644
index 0000000000000..ae431f5c4cf1a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list.php
@@ -0,0 +1,34 @@
+ 'simplePage',
+ 'is_active' => 1
+ ],
+ [
+ 'title' => 'simplePage01',
+ 'is_active' => 1
+ ],
+ [
+ 'title' => '01simplePage',
+ 'is_active' => 1
+ ],
+];
+
+/** @var PageRepositoryInterface $pageRepository */
+$pageRepository = $objectManager->get(PageRepositoryInterface::class);
+foreach ($data as $item) {
+ $page = $objectManager->create(PageInterface::class, ['data' => $item]);
+ $pageRepository->save($page);
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php
new file mode 100644
index 0000000000000..261cdba589653
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Cms/Fixtures/page_list_rollback.php
@@ -0,0 +1,25 @@
+get(PageRepositoryInterface::class);
+
+/** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class);
+$searchCriteria = $searchCriteriaBuilder->addFilter('title', ['simplePage', 'simplePage01', '01simplePage'], 'in')
+ ->create();
+$result = $pageRepository->getList($searchCriteria);
+
+foreach ($result->getItems() as $item) {
+ $pageRepository->delete($item);
+}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php b/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
index b3bbd64b83e7e..7dbc3d2cc1dbd 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
@@ -34,8 +34,8 @@ public function convertDataProvider()
Hot Sellers
Here is what`s trending on Luma right now
';
- $serializedWidgetContent = '{{widget type="Magento\\CatalogWidget\\Block\\Product\\ProductsList" products_per_page="8" products_count="8" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Combine`;s:10:`aggregator`;s:3:`all`;s:5:`value`;s:1:`1`;s:9:`new_child`;s:0:``;]s:4:`1--1`;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Product`;s:9:`attribute`;s:3:`sku`;s:8:`operator`;s:2:`()`;s:5:`value`;a:8:[i:0;s:4:`WS12`;i:1;s:4:`WT09`;i:2;s:4:`MT07`;i:3;s:4:`MH07`;i:4;s:7:`24-MB02`;i:5;s:7:`24-WB04`;i:6;s:8:`241-MB08`;i:7;s:8:`240-LV05`;]]]"}}';
- $jsonEncodedWidgetContent = '{{widget type="Magento\\CatalogWidget\\Block\\Product\\ProductsList" products_per_page="8" products_count="8" template="product/widget/content/grid.phtml" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`()`,`value`:[`WS12`,`WT09`,`MT07`,`MH07`,`24-MB02`,`24-WB04`,`241-MB08`,`240-LV05`]^]^]"}}';
+ $serializedWidgetContent = '{{widget type="Magento\\CatalogWidget\\Block\\Product\\ProductsList" products_per_page="8" products_count="8" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Combine`;s:10:`aggregator`;s:3:`all`;s:5:`value`;s:1:`1`;s:9:`new_child`;s:0:``;]s:4:`1--1`;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Product`;s:9:`attribute`;s:3:`sku`;s:8:`operator`;s:2:`()`;s:5:`value`;a:8:[i:0;s:4:`WS12`;i:1;s:4:`WT09`;i:2;s:4:`MT07`;i:3;s:4:`MH07`;i:4;s:7:`24-MB02`;i:5;s:7:`24-WB04`;i:6;s:8:`241-MB08`;i:7;s:8:`240-LV05`;]]]"}}';
+ $jsonEncodedWidgetContent = '{{widget type="Magento\\CatalogWidget\\Block\\Product\\ProductsList" products_per_page="8" products_count="8" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`()`,`value`:[`WS12`,`WT09`,`MT07`,`MH07`,`24-MB02`,`24-WB04`,`241-MB08`,`240-LV05`]^]^]"}}';
// @codingStandardsIgnoreEnd
return [
'no widget' => [
diff --git a/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
index a06a981a4c891..2f89cb72b0cd9 100644
--- a/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
@@ -6,11 +6,16 @@
namespace Magento\Contact\Controller;
+use Zend\Http\Request;
+
/**
* Contact index controller test
*/
class IndexTest extends \Magento\TestFramework\TestCase\AbstractController
{
+ /**
+ * testPostAction
+ */
public function testPostAction()
{
$params = [
@@ -20,6 +25,7 @@ public function testPostAction()
'hideit' => '',
];
$this->getRequest()->setPostValue($params);
+ $this->getRequest()->setMethod(Request::METHOD_POST);
$this->dispatch('contact/index/post');
$this->assertRedirect($this->stringContains('contact/index'));
@@ -33,12 +39,13 @@ public function testPostAction()
/**
* @dataProvider dataInvalidPostAction
- * @param $params
- * @param $expectedMessage
+ * @param array $params
+ * @param string $expectedMessage
*/
public function testInvalidPostAction($params, $expectedMessage)
{
$this->getRequest()->setPostValue($params);
+ $this->getRequest()->setMethod(Request::METHOD_POST);
$this->dispatch('contact/index/post');
$this->assertRedirect($this->stringContains('contact/index'));
@@ -48,6 +55,9 @@ public function testInvalidPostAction($params, $expectedMessage)
);
}
+ /**
+ * @return array
+ */
public static function dataInvalidPostAction()
{
return [
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
index 1cbdbd128bbf4..186d9c8f87dc2 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
@@ -55,6 +55,9 @@ public function testIndexAction()
$this->assertContains('Green str, 67', $body);
}
+ /**
+ * @return void
+ */
public function testCreateAction()
{
$this->dispatch('customer/account/create');
@@ -522,7 +525,7 @@ public function testEditPostAction()
$this->dispatch('customer/account/editPost');
- $this->assertRedirect($this->stringEndsWith('customer/account/'));
+ $this->assertRedirect($this->stringContains('customer/account/'));
$this->assertSessionMessages(
$this->equalTo(['You saved the account information.']),
MessageInterface::TYPE_SUCCESS
@@ -570,7 +573,7 @@ public function testChangePasswordEditPostAction()
$this->dispatch('customer/account/editPost');
- $this->assertRedirect($this->stringEndsWith('customer/account/'));
+ $this->assertRedirect($this->stringContains('customer/account/'));
$this->assertSessionMessages(
$this->equalTo(['You saved the account information.']),
MessageInterface::TYPE_SUCCESS
@@ -603,7 +606,7 @@ public function testMissingDataEditPostAction()
$this->dispatch('customer/account/editPost');
- $this->assertRedirect($this->stringEndsWith('customer/account/edit/'));
+ $this->assertRedirect($this->stringContains('customer/account/edit/'));
$this->assertSessionMessages(
$this->equalTo(['"Email" is not a valid email address.']),
MessageInterface::TYPE_ERROR
@@ -633,7 +636,7 @@ public function testWrongPasswordEditPostAction()
$this->dispatch('customer/account/editPost');
- $this->assertRedirect($this->stringEndsWith('customer/account/edit/'));
+ $this->assertRedirect($this->stringContains('customer/account/edit/'));
// Not sure if its the most secure message. Not changing the behavior for now in the new AccountManagement APIs.
$this->assertSessionMessages(
$this->equalTo(["The password doesn't match this account. Verify the password and try again."]),
@@ -662,7 +665,7 @@ public function testWrongConfirmationEditPostAction()
$this->dispatch('customer/account/editPost');
- $this->assertRedirect($this->stringEndsWith('customer/account/edit/'));
+ $this->assertRedirect($this->stringContains('customer/account/edit/'));
$this->assertSessionMessages(
$this->equalTo(['Password confirmation doesn\'t match entered password.']),
MessageInterface::TYPE_ERROR
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php
index 4c30adb6894e2..32a622d4aa654 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php
@@ -18,6 +18,9 @@ class AddressTest extends \Magento\TestFramework\TestCase\AbstractController
/** @var FormKey */
private $formKey;
+ /**
+ * {@inheritDoc}
+ */
protected function setUp()
{
parent::setUp();
@@ -150,8 +153,8 @@ public function testFailedFormPostAction()
$this->equalTo(
[
'One or more input exceptions have occurred.',
- '"street" is required. Enter and try again.',
- '"city" is required. Enter and try again.',
+ '"street" is required. Enter and try again.',
+ '"city" is required. Enter and try again.',
]
),
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php
index ef5b4cae5ff16..8ee12fa1aa8d5 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php
@@ -3,16 +3,21 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
namespace Magento\Customer\Controller\Adminhtml\Index;
-use Magento\TestFramework\Helper\Bootstrap;
+use Magento\Backend\Model\Session;
use Magento\Customer\Api\CustomerRepositoryInterface;
+use Magento\Customer\Api\Data\CustomerInterface;
+use Magento\Framework\Message\MessageInterface;
+use Magento\TestFramework\Helper\Bootstrap;
+use Magento\TestFramework\TestCase\AbstractBackendController;
/**
* @magentoAppArea adminhtml
*/
-class MassAssignGroupTest extends \Magento\TestFramework\TestCase\AbstractBackendController
+class MassAssignGroupTest extends AbstractBackendController
{
/**
* Base controller URL
@@ -29,9 +34,7 @@ class MassAssignGroupTest extends \Magento\TestFramework\TestCase\AbstractBacken
protected function setUp()
{
parent::setUp();
- $this->customerRepository = Bootstrap::getObjectManager()->get(
- \Magento\Customer\Api\CustomerRepositoryInterface::class
- );
+ $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class);
}
protected function tearDown()
@@ -39,75 +42,97 @@ protected function tearDown()
/**
* Unset customer data
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->setCustomerData(null);
+ Bootstrap::getObjectManager()->get(Session::class)->setCustomerData(null);
/**
* Unset messages
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getMessages(true);
+ Bootstrap::getObjectManager()->get(Session::class)->getMessages(true);
}
/**
- * @magentoDataFixture Magento/Customer/_files/customer.php
+ * Tests os update a single customer record.
+ *
+ * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php
+ * @magentoDbIsolation disabled
*/
public function testMassAssignGroupAction()
{
- $customer = $this->customerRepository->getById(1);
+ $customerEmail = 'customer1@example.com';
+ /** @var CustomerInterface $customer */
+ $customer = $this->customerRepository->get($customerEmail);
$this->assertEquals(1, $customer->getGroupId());
- $this->getRequest()
- ->setParam('group', 0)
- ->setPostValue('namespace', 'customer_listing')
- ->setPostValue('selected', [1]);
+ $params = [
+ 'group' => 0,
+ 'namespace' => 'customer_listing',
+ 'selected' => [$customer->getId()]
+ ];
+
+ $this->getRequest()->setParams($params);
$this->dispatch('backend/customer/index/massAssignGroup');
$this->assertSessionMessages(
- $this->equalTo(['A total of 1 record(s) were updated.']),
- \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ self::equalTo(['A total of 1 record(s) were updated.']),
+ MessageInterface::TYPE_SUCCESS
);
$this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
- $customer = $this->customerRepository->getById(1);
+ $customer = $this->customerRepository->get($customerEmail);
$this->assertEquals(0, $customer->getGroupId());
}
/**
- * @magentoDataFixture Magento/Customer/_files/twenty_one_customers.php
+ * Tests os update a multiple customer records.
+ *
+ * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php
+ * @magentoDbIsolation disabled
*/
public function testLargeGroupMassAssignGroupAction()
{
-
- for ($i = 1; $i < 22; $i++) {
- $customer = $this->customerRepository->getById($i);
+ $ids = [];
+ for ($i = 1; $i <= 5; $i++) {
+ /** @var CustomerInterface $customer */
+ $customer = $this->customerRepository->get('customer' . $i . '@example.com');
$this->assertEquals(1, $customer->getGroupId());
+ $ids[] = $customer->getId();
}
- $this->getRequest()
- ->setParam('group', 0)
- ->setPostValue('namespace', 'customer_listing')
- ->setPostValue('selected', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]);
+ $params = [
+ 'group' => 0,
+ 'namespace' => 'customer_listing',
+ 'selected' => $ids,
+ ];
+
+ $this->getRequest()->setParams($params);
$this->dispatch('backend/customer/index/massAssignGroup');
$this->assertSessionMessages(
- $this->equalTo(['A total of 21 record(s) were updated.']),
- \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ self::equalTo(['A total of 5 record(s) were updated.']),
+ MessageInterface::TYPE_SUCCESS
);
$this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
- for ($i = 1; $i < 22; $i++) {
- $customer = $this->customerRepository->getById($i);
+ for ($i = 1; $i < 5; $i++) {
+ /** @var CustomerInterface $customer */
+ $customer = $this->customerRepository->get('customer' . $i . '@example.com');
$this->assertEquals(0, $customer->getGroupId());
}
}
/**
* Valid group Id but no customer Ids specified
+ *
* @magentoDbIsolation enabled
*/
public function testMassAssignGroupActionNoCustomerIds()
{
- $this->getRequest()->setParam('group', 0)->setPostValue('namespace', 'customer_listing');
+ $params = [
+ 'group' => 0,
+ 'namespace' => 'customer_listing',
+ ];
+ $this->getRequest()->setParams($params);
$this->dispatch('backend/customer/index/massAssignGroup');
$this->assertSessionMessages(
$this->equalTo(['An item needs to be selected. Select and try again.']),
- \Magento\Framework\Message\MessageInterface::TYPE_ERROR
+ MessageInterface::TYPE_ERROR
);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php
index b7aefe7c31707..940f7c84325f6 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php
@@ -3,61 +3,162 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
namespace Magento\Customer\Controller\Adminhtml\Index;
+use Magento\Backend\Model\Session;
+use Magento\Customer\Api\CustomerRepositoryInterface;
+use Magento\Customer\Api\Data\CustomerInterface;
+use PHPUnit\Framework\Constraint\Constraint;
+use Magento\Framework\Message\MessageInterface;
use Magento\TestFramework\Helper\Bootstrap;
+use Magento\TestFramework\TestCase\AbstractBackendController;
/**
* @magentoAppArea adminhtml
*/
-class MassDeleteTest extends \Magento\TestFramework\TestCase\AbstractBackendController
+class MassDeleteTest extends AbstractBackendController
{
+ /**
+ * @var CustomerRepositoryInterface
+ */
+ private $customerRepository;
+
/**
* Base controller URL
*
* @var string
*/
- protected $baseControllerUrl = 'http://localhost/index.php/backend/customer/index/index';
+ private $baseControllerUrl = 'http://localhost/index.php/backend/customer/index/index';
+
+ protected function setUp()
+ {
+ parent::setUp();
+ $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class);
+ }
protected function tearDown()
{
/**
* Unset customer data
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->setCustomerData(null);
+ Bootstrap::getObjectManager()->get(Session::class)->setCustomerData(null);
/**
* Unset messages
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getMessages(true);
+ Bootstrap::getObjectManager()->get(Session::class)->getMessages(true);
}
/**
- * @magentoDataFixture Magento/Customer/_files/customer.php
+ * Validates failure attempts to delete customers from grid.
+ *
+ * @param array|null $ids
+ * @param Constraint $constraint
+ * @param string|null $messageType
+ * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php
+ * @magentoDbIsolation disabled
+ * @dataProvider failedRequestDataProvider
*/
- public function testMassDeleteAction()
+ public function testFailedMassDeleteAction($ids, Constraint $constraint, $messageType)
{
- $this->getRequest()->setPostValue('selected', [1])->setPostValue('namespace', 'customer_listing');
- $this->dispatch('backend/customer/index/massDelete');
- $this->assertSessionMessages(
- $this->equalTo(['A total of 1 record(s) were deleted.']),
- \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ $this->massDeleteAssertions($ids, $constraint, $messageType);
+ }
+
+ /**
+ * Validates success attempt to delete customer from grid.
+ *
+ * @param array $emails
+ * @param Constraint $constraint
+ * @param string $messageType
+ * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php
+ * @magentoDbIsolation disabled
+ * @dataProvider successRequestDataProvider
+ */
+ public function testSuccessMassDeleteAction(array $emails, Constraint $constraint, string $messageType)
+ {
+ $ids = [];
+ foreach ($emails as $email) {
+ /** @var CustomerInterface $customer */
+ $customer = $this->customerRepository->get($email);
+ $ids[] = $customer->getId();
+ }
+
+ $this->massDeleteAssertions(
+ $ids,
+ $constraint,
+ $messageType
);
- $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
}
/**
- * Valid group Id but no customer Ids specified
- * @magentoDbIsolation enabled
+ * Performs required request and assertions.
+ *
+ * @param array|null $ids
+ * @param Constraint $constraint
+ * @param string|null $messageType
*/
- public function testMassDeleteActionNoCustomerIds()
+ private function massDeleteAssertions($ids, Constraint $constraint, $messageType)
{
- $this->getRequest()->setPostValue('namespace', 'customer_listing');
+ $requestData = [
+ 'selected' => $ids,
+ 'namespace' => 'customer_listing',
+ ];
+
+ $this->getRequest()->setParams($requestData);
$this->dispatch('backend/customer/index/massDelete');
$this->assertSessionMessages(
- $this->equalTo(['An item needs to be selected. Select and try again.']),
- \Magento\Framework\Message\MessageInterface::TYPE_ERROR
+ $constraint,
+ $messageType
);
+ $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
+ }
+
+ /**
+ * Provides sets of data for unsuccessful attempts.
+ *
+ * @return array
+ */
+ public function failedRequestDataProvider(): array
+ {
+ return [
+ [
+ 'ids' => [],
+ 'constraint' => self::equalTo(['An item needs to be selected. Select and try again.']),
+ 'messageType' => MessageInterface::TYPE_ERROR,
+ ],
+ [
+ 'ids' => [111],
+ 'constraint' => self::isEmpty(),
+ 'messageType' => null,
+ ],
+ [
+ 'ids' => null,
+ 'constraint' => self::equalTo(['An item needs to be selected. Select and try again.']),
+ 'messageType' => MessageInterface::TYPE_ERROR,
+ ]
+ ];
+ }
+
+ /**
+ * Provides sets of data for successful attempts.
+ *
+ * @return array
+ */
+ public function successRequestDataProvider(): array
+ {
+ return [
+ [
+ 'customerEmails' => ['customer1@example.com'],
+ 'constraint' => self::equalTo(['A total of 1 record(s) were deleted.']),
+ 'messageType' => MessageInterface::TYPE_SUCCESS,
+ ],
+ [
+ 'customerEmails' => ['customer2@example.com', 'customer3@example.com'],
+ 'constraint' => self::equalTo(['A total of 2 record(s) were deleted.']),
+ 'messageType' => MessageInterface::TYPE_SUCCESS,
+ ],
+ ];
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php
index d9880b2dc741a..c2fc7b1b58756 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php
@@ -3,11 +3,17 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
namespace Magento\Customer\Controller\Adminhtml\Index;
+use Magento\Backend\Model\Session;
+use Magento\Framework\Message\MessageInterface;
use Magento\Newsletter\Model\Subscriber;
+use Magento\Newsletter\Model\SubscriberFactory;
use Magento\TestFramework\Helper\Bootstrap;
+use Magento\Customer\Api\CustomerRepositoryInterface;
+use Magento\Customer\Api\Data\CustomerInterface;
/**
* @magentoAppArea adminhtml
@@ -26,58 +32,90 @@ protected function tearDown()
/**
* Unset customer data
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->setCustomerData(null);
+ Bootstrap::getObjectManager()->get(Session::class)->setCustomerData(null);
/**
* Unset messages
*/
- Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getMessages(true);
+ Bootstrap::getObjectManager()->get(Session::class)->getMessages(true);
}
/**
- * @magentoDataFixture Magento/Customer/_files/two_customers.php
+ * Tests subscriber status of customers.
+ *
+ * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php
+ * @magentoDbIsolation disabled
*/
public function testMassSubscriberAction()
{
- // Pre-condition
- /** @var \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory */
- $subscriberFactory = Bootstrap::getObjectManager()->get(\Magento\Newsletter\Model\SubscriberFactory::class);
- $this->assertNull($subscriberFactory->create()->loadByCustomerId(1)->getSubscriberStatus());
- $this->assertNull($subscriberFactory->create()->loadByCustomerId(2)->getSubscriberStatus());
- // Setup
- $this->getRequest()->setPostValue('selected', [1, 2])->setPostValue('namespace', 'customer_listing');
+ /** @var SubscriberFactory $subscriberFactory */
+ $subscriberFactory = Bootstrap::getObjectManager()->get(SubscriberFactory::class);
+ $customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class);
+
+ $this->assertNull(
+ $subscriberFactory->create()
+ ->loadByEmail('customer1@example.com')
+ ->getSubscriberStatus()
+ );
+ $this->assertNull(
+ $subscriberFactory->create()
+ ->loadByEmail('customer2@example.com')
+ ->getSubscriberStatus()
+ );
+
+ /** @var CustomerInterface $customer1 */
+ $customer1 = $customerRepository->get('customer1@example.com');
+ /** @var CustomerInterface $customer2 */
+ $customer2 = $customerRepository->get('customer2@example.com');
+
+ $params = [
+ 'selected' => [
+ $customer1->getId(),
+ $customer2->getId(),
+ ],
+ 'namespace' => 'customer_listing',
+ ];
+ $this->getRequest()->setParams($params);
- // Test
$this->dispatch('backend/customer/index/massSubscribe');
// Assertions
$this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
$this->assertSessionMessages(
- $this->equalTo(['A total of 2 record(s) were updated.']),
- \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ self::equalTo(['A total of 2 record(s) were updated.']),
+ MessageInterface::TYPE_SUCCESS
);
$this->assertEquals(
Subscriber::STATUS_SUBSCRIBED,
- $subscriberFactory->create()->loadByCustomerId(1)->getSubscriberStatus()
+ $subscriberFactory->create()
+ ->loadByEmail('customer1@example.com')
+ ->getSubscriberStatus()
);
$this->assertEquals(
Subscriber::STATUS_SUBSCRIBED,
- $subscriberFactory->create()->loadByCustomerId(2)->getSubscriberStatus()
+ $subscriberFactory->create()
+ ->loadByEmail('customer2@example.com')
+ ->getSubscriberStatus()
);
}
/**
+ * @magentoAppIsolation enabled
* @magentoDbIsolation enabled
*/
public function testMassSubscriberActionNoSelection()
{
- $this->getRequest()->setPostValue('namespace', 'customer_listing');
+ $params = [
+ 'namespace' => 'customer_listing'
+ ];
+
+ $this->getRequest()->setParams($params);
$this->dispatch('backend/customer/index/massSubscribe');
$this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
$this->assertSessionMessages(
- $this->equalTo(['An item needs to be selected. Select and try again.']),
- \Magento\Framework\Message\MessageInterface::TYPE_ERROR
+ self::equalTo(['An item needs to be selected. Select and try again.']),
+ MessageInterface::TYPE_ERROR
);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
index b942365d64a75..6448816c9345c 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
@@ -44,6 +44,9 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendControlle
/** @var \Magento\TestFramework\ObjectManager */
protected $objectManager;
+ /**
+ * {@inheritDoc}
+ */
protected function setUp()
{
parent::setUp();
@@ -67,6 +70,9 @@ protected function setUp()
);
}
+ /**
+ * {@inheritDoc}
+ */
protected function tearDown()
{
/**
@@ -522,7 +528,10 @@ public function testEditAction()
$this->assertContains('test firstname test lastname', $body);
}
- public function testNewAction()
+ /**
+ * Tests new action
+ */
+ public function testNewAction(): void
{
$this->dispatch('backend/customer/index/edit');
$body = $this->getResponse()->getBody();
@@ -717,12 +726,9 @@ public function testValidateCustomerWithAddressFailure()
$this->assertContains('{"error":true,"messages":', $body);
$this->assertContains('\"First Name\" is a required value', $body);
- $this->assertContains('\"First Name\" length must be equal or greater than 1 characters', $body);
$this->assertContains('\"Last Name\" is a required value.', $body);
- $this->assertContains('\"Last Name\" length must be equal or greater than 1 characters.', $body);
$this->assertContains('\"Country\" is a required value.', $body);
$this->assertContains('\"Phone Number\" is a required value.', $body);
- $this->assertContains('\"Phone Number\" length must be equal or greater than 1 characters.', $body);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_website_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_website_rollback.php
new file mode 100644
index 0000000000000..2dbd1381b6f3c
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_with_website_rollback.php
@@ -0,0 +1,28 @@
+get(\Magento\Framework\Registry::class);
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var \Magento\Store\Model\StoreManager $store */
+$store = $objectManager->get(\Magento\Store\Model\StoreManager::class);
+
+/** @var $customer \Magento\Customer\Model\Customer*/
+$customer = $objectManager->create(\Magento\Customer\Model\Customer::class);
+$customer->setWebsiteId($store->getDefaultStoreView()->getWebsiteId());
+$customer->loadByEmail('john.doe@magento.com');
+if ($customer->getId()) {
+ $customer->delete();
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php
new file mode 100644
index 0000000000000..1722e471a5bbc
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php
@@ -0,0 +1,49 @@
+create(CustomerRepositoryInterface::class);
+/** @var CustomerInterfaceFactory $customerFactory */
+$customerFactory = $objectManager->get(CustomerInterfaceFactory::class);
+
+for ($i = 1; $i <= 5; $i++) {
+ /** @var CustomerInterface $customer */
+ $customer = $customerFactory->create();
+ $customer->setFirstname('John')
+ ->setGroupId(1)
+ ->setLastname('Smith')
+ ->setWebsiteId(1)
+ ->setEmail('customer'.$i.'@example.com');
+ try {
+ $customerRepository->save($customer, 'password');
+ } catch (\Exception $e) {
+ }
+}
+
+/** @var EavModelConfig $eavConfig */
+$eavConfig = $objectManager->get(EavModelConfig::class);
+$eavConfig->clear();
+
+/** @var IndexerRegistry $indexerRegistry */
+$indexerRegistry = $objectManager->create(IndexerRegistry::class);
+/** @var IndexerInterface $indexer */
+$indexer = $indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
+try {
+ $indexer->reindexAll();
+} catch (\Exception $e) {
+}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php
new file mode 100644
index 0000000000000..5272d9cdbf06d
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php
@@ -0,0 +1,29 @@
+create(CustomerRepositoryInterface::class);
+
+for ($i = 1; $i <= 5; $i++) {
+ try {
+ /** @var CustomerInterface $customer */
+ $customer = $customerRepository->get('customer'.$i.'@example.com');
+ $customerRepository->delete($customer);
+ } catch (\Exception $e) {
+ }
+}
+
+/** @var EavModelConfig $eavConfig */
+$eavConfig = $objectManager->get(EavModelConfig::class);
+$eavConfig->clear();
diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_with_files.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_with_files.php
index cf0da5599914f..86aa61a99e1e8 100644
--- a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_with_files.php
+++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_with_files.php
@@ -154,3 +154,10 @@
$product->setTypeHasRequiredOptions(false)->setRequiredOptions(false);
}
$product->save();
+
+$stockRegistry = $objectManager->get(\Magento\CatalogInventory\Api\StockRegistryInterface::class);
+$stockItem = $stockRegistry->getStockItem($product->getId());
+$stockItem->setUseConfigManageStock(true);
+$stockItem->setQty(100);
+$stockItem->setIsInStock(true);
+$stockRegistry->updateStockItemBySku($product->getSku(), $stockItem);
diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php
new file mode 100644
index 0000000000000..2750e2a768aab
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php
@@ -0,0 +1,119 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->attribute = $this->objectManager->get(Attribute::class);
+ $this->_localeResolver = $this->objectManager->get(ResolverInterface::class);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function tearDown()
+ {
+ $this->attribute = null;
+ $this->objectManager = null;
+ $this->_localeResolver = null;
+ }
+
+ /**
+ * @param string $defaultValue
+ * @param string $backendType
+ * @param string $locale
+ * @param string $expected
+ * @dataProvider beforeSaveDataProvider
+ * @throws
+ */
+ public function testBeforeSave($defaultValue, $backendType, $locale, $expected)
+ {
+ $this->attribute->setDefaultValue($defaultValue);
+ $this->attribute->setBackendType($backendType);
+ $this->_localeResolver->setLocale($locale);
+ $this->attribute->beforeSave();
+
+ $this->assertEquals($expected, $this->attribute->getDefaultValue());
+ }
+
+ /**
+ * Data provider for beforeSaveData.
+ *
+ * @return array
+ */
+ public function beforeSaveDataProvider()
+ {
+ return [
+ ['21/07/18', 'datetime', 'en_AU', '2018-07-21 00:00:00'],
+ ['07/21/18', 'datetime', 'en_US', '2018-07-21 00:00:00'],
+ ['21/07/18', 'datetime', 'fr_FR', '2018-07-21 00:00:00'],
+ ['21/07/18', 'datetime', 'de_DE', '2018-07-21 00:00:00'],
+ ['21/07/18', 'datetime', 'uk_UA', '2018-07-21 00:00:00'],
+ ['100.50', 'decimal', 'en_US', '100.50'],
+ ['100,50', 'decimal', 'uk_UA', '100.5'],
+ ];
+ }
+
+ /**
+ * @param string $defaultValue
+ * @param string $backendType
+ * @param string $locale
+ * @param string $expected
+ * @dataProvider beforeSaveErrorDataDataProvider
+ * @expectedException \Magento\Framework\Exception\LocalizedException
+ */
+ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $expected)
+ {
+ $this->attribute->setDefaultValue($defaultValue);
+ $this->attribute->setBackendType($backendType);
+ $this->_localeResolver->setLocale($locale);
+ $this->attribute->beforeSave();
+
+ $this->expectExceptionMessage($expected);
+ }
+
+ /**
+ * Data provider for beforeSaveData with error result.
+ *
+ * @return array
+ */
+ public function beforeSaveErrorDataDataProvider()
+ {
+ return [
+ 'wrong date for Australia' => ['32/38', 'datetime', 'en_AU', 'Invalid default date'],
+ 'wrong date for States' => ['32/38', 'datetime', 'en_US', 'Invalid default date'],
+ 'wrong decimal separator for US' => ['100,50', 'decimal', 'en_US', 'Invalid default decimal value'],
+ 'wrong decimal separator for UA' => ['100.50', 'decimal', 'uk_UA', 'Invalid default decimal value'],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/Entity/Attribute/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/Entity/Attribute/CollectionTest.php
index e39f1e2fd8390..c273e87f6d738 100644
--- a/dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/Entity/Attribute/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/Entity/Attribute/CollectionTest.php
@@ -52,6 +52,20 @@ public function testSetAttributeGroupFilter()
$this->assertEquals([$includeGroupId], $groups);
}
+ /**
+ * Test if getAllIds method return results after using setInAllAttributeSetsFilter method
+ *
+ * @covers \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection::setInAllAttributeSetsFilter()
+ * @covers \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection::getAllIds()
+ */
+ public function testSetInAllAttributeSetsFilterWithGetAllIds()
+ {
+ $sets = [1];
+ $this->_model->setInAllAttributeSetsFilter($sets);
+ $attributeIds = $this->_model->getAllIds();
+ $this->assertGreaterThan(0, count($attributeIds));
+ }
+
/**
* Returns array of group ids, present in collection attributes
*
diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php
new file mode 100644
index 0000000000000..9ac778da91f29
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php
@@ -0,0 +1,56 @@
+get(FileFactory::class);
+ /** @var Filesystem $filesystem */
+ $filesystem = $objectManager->get(Filesystem::class);
+ $filename = 'test.pdf';
+ $contentType = 'application/pdf';
+ $fileContent = ['type' => 'string', 'value' => ''];
+ $response = $fileFactory->create($filename, $fileContent, DirectoryList::VAR_DIR, $contentType);
+ /** @var ContentType $contentTypeHeader */
+ $contentTypeHeader = $response->getHeader('Content-type');
+
+ /* Check the system returns the correct type */
+ self::assertEquals("Content-Type: $contentType", $contentTypeHeader->toString());
+
+ $varDirectory = $filesystem->getDirectoryRead(DirectoryList::VAR_DIR);
+ $varDirectory->isFile($filename);
+
+ /* Check the file is generated */
+ self::assertTrue($varDirectory->isFile($filename));
+
+ /* Check the file is removed after generation if the corresponding option is set */
+ $fileContent = ['type' => 'string', 'value' => '', 'rm' => true];
+ $fileFactory->create($filename, $fileContent, DirectoryList::VAR_DIR, $contentType);
+
+ self::assertFalse($varDirectory->isFile($filename));
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php
new file mode 100644
index 0000000000000..02f031fae336a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php
@@ -0,0 +1,176 @@
+checkoutSession = $this->_objectManager->get(Session::class);
+ $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class);
+ $this->json = $this->_objectManager->get(Json::class);
+ $this->quote = $this->getQuote('test01');
+ $this->checkoutSession->setQuoteId($this->quote->getId());
+ $this->checkoutSession->setCartWasUpdated(false);
+ }
+
+ /**
+ * Validator of quote items.
+ *
+ * @param array $requestQuantity
+ * @param array $expectedResponse
+ *
+ * @magentoConfigFixture current_store multishipping/options/checkout_multiple 1
+ * @magentoConfigFixture current_store multishipping/options/checkout_multiple_maximum_qty 200
+ * @dataProvider requestDataProvider
+ */
+ public function testExecute($requestQuantity, $expectedResponse)
+ {
+ $this->loginCustomer();
+
+ try {
+ /** @var $product Product */
+ $product = $this->productRepository->get('simple');
+ } catch (\Exception $e) {
+ $this->fail('No such product entity');
+ }
+
+ $quoteItem = $this->quote->getItemByProduct($product);
+ $this->assertNotFalse($quoteItem, 'Cannot get quote item for simple product');
+
+ $request = [];
+ if (!empty($requestQuantity) && is_array($requestQuantity)) {
+ $request= [
+ 'ship' => [
+ [$quoteItem->getId() => $requestQuantity],
+ ]
+ ];
+ }
+
+ $this->getRequest()->setPostValue($request);
+ $this->dispatch('multishipping/checkout/checkItems');
+ $response = $this->getResponse()->getBody();
+
+ $this->assertEquals($expectedResponse, $this->json->unserialize($response));
+ }
+
+ /**
+ * Authenticates customer and creates customer session.
+ */
+ private function loginCustomer()
+ {
+ $logger = $this->createMock(\Psr\Log\LoggerInterface::class);
+ /** @var AccountManagementInterface $service */
+ $service = $this->_objectManager->create(AccountManagementInterface::class);
+ try {
+ $customer = $service->authenticate('customer@example.com', 'password');
+ } catch (LocalizedException $e) {
+ $this->fail($e->getMessage());
+ }
+ /** @var CustomerSession $customerSession */
+ $customerSession = $this->_objectManager->create(CustomerSession::class, [$logger]);
+ $customerSession->setCustomerDataAsLoggedIn($customer);
+ }
+
+ /**
+ * Gets quote by reserved order id.
+ *
+ * @param string $reservedOrderId
+ * @return Quote
+ */
+ private function getQuote($reservedOrderId)
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->_objectManager->create(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+ /** @var QuoteRepository $quoteRepository */
+ $quoteRepository = $this->_objectManager->get(QuoteRepository::class);
+ $items = $quoteRepository->getList($searchCriteria)
+ ->getItems();
+ return array_pop($items);
+ }
+
+ /**
+ * Variations of request data.
+ * @returns array
+ */
+ public function requestDataProvider(): array
+ {
+ return [
+ [
+ 'request' => [],
+ 'response' => [
+ 'success' => false,
+ 'error_message' => 'We are unable to process your request. Please, try again later.'
+ ]
+ ],
+ [
+ 'request' => ['qty' => 2],
+ 'response' => [
+ 'success' => true,
+ ]
+ ],
+ [
+ 'request' => ['qty' => 101],
+ 'response' => [
+ 'success' => false,
+ 'error_message' => 'The requested qty is not available']
+ ],
+ [
+ 'request' => ['qty' => 230],
+ 'response' => [
+ 'success' => false,
+ 'error_message' => 'Maximum qty allowed for Shipping to multiple addresses is 200']
+ ],
+ ];
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php
index 1a27994b607f1..5a094eb05c774 100644
--- a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php
+++ b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php
@@ -21,6 +21,9 @@ class ManageTest extends \Magento\TestFramework\TestCase\AbstractController
*/
protected $coreSession;
+ /**
+ * Test setup
+ */
protected function setUp()
{
parent::setUp();
@@ -31,6 +34,9 @@ protected function setUp()
$this->coreSession->setData('_form_key', 'formKey');
}
+ /**
+ * test tearDown
+ */
protected function tearDown()
{
$this->customerSession->setCustomerId(null);
@@ -58,7 +64,7 @@ public function testSaveAction()
* Check that success message
*/
$this->assertSessionMessages(
- $this->equalTo(['We saved the subscription.']),
+ $this->equalTo(['We have saved your subscription.']),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
);
}
@@ -68,6 +74,7 @@ public function testSaveAction()
*/
public function testSaveActionRemoveSubscription()
{
+
$this->getRequest()
->setParam('form_key', 'formKey')
->setParam('is_subscribed', '0');
@@ -84,7 +91,7 @@ public function testSaveActionRemoveSubscription()
* Check that success message
*/
$this->assertSessionMessages(
- $this->equalTo(['We removed the subscription.']),
+ $this->equalTo(['We have updated your subscription.']),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
);
}
diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml
index 2552d383bbcc3..2bd346a6e8f7b 100644
--- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml
+++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml
@@ -350,7 +350,7 @@
Learn More]]>
+ Learn More]]>
payment/payflow_express_bml/active
Magento\Paypal\Block\Adminhtml\System\Config\Field\Enable\Bml
@@ -371,12 +371,12 @@
- Why Advertise Financing?
+ Why Advertise Financing?
Give your sales a boost when you advertise financing. PayPal helps turn browsers into buyers with financing
from PayPal Credit®. Your customers have more time to pay, while you get paid up front – at no additional cost to you.
Use PayPal’s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
- or more. See Details.]]>
+ or more. See Details.]]>
@@ -731,7 +731,7 @@
Learn More]]>
+ Learn More]]>
payment/paypal_express_bml/active
Magento\Config\Model\Config\Source\Yesno
@@ -753,12 +753,12 @@
- Why Advertise Financing?
+ Why Advertise Financing?
Give your sales a boost when you advertise financing. PayPal helps turn browsers into buyers with financing
from PayPal Credit®. Your customers have more time to pay, while you get paid up front – at no additional cost to you.
Use PayPal’s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
- or more. See Details.]]>
+ or more. See Details.]]>
@@ -768,7 +768,7 @@
Get Publisher ID from PayPal
-
+
Magento\Paypal\Block\Adminhtml\System\Config\BmlApiWizard
@@ -1261,7 +1261,7 @@
Learn More]]>
+ Learn More]]>
@@ -1270,12 +1270,12 @@
- Why Advertise Financing?
+ Why Advertise Financing?
Give your sales a boost when you advertise financing. PayPal helps turn browsers into buyers with financing
from PayPal Credit®. Your customers have more time to pay, while you get paid up front – at no additional cost to you.
Use PayPal’s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
- or more. See Details.]]>
+ or more. See Details.]]>
@@ -1536,7 +1536,7 @@
Learn More]]>
+ Learn More]]>
payment/payflow_express_bml/active
Magento\Paypal\Block\Adminhtml\System\Config\Field\Enable\Bml
@@ -1836,7 +1836,7 @@
Learn More]]>
+ Learn More]]>
payment/payflow_express_bml/active
Magento\Config\Model\Config\Source\Yesno
@@ -1855,12 +1855,12 @@
- Why Advertise Financing?
+ Why Advertise Financing?
Give your sales a boost when you advertise financing. PayPal helps turn browsers into buyers with financing
from PayPal Credit®. Your customers have more time to pay, while you get paid up front – at no additional cost to you.
Use PayPal’s free banner ads that let you advertise PayPal Credit® financing as a payment option when your customers check out with PayPal.
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
- or more. See Details.]]>
+ or more. See Details.]]>
diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/Plugin/UpdateQuoteStoreTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/Plugin/UpdateQuoteStoreTest.php
new file mode 100644
index 0000000000000..cbacab1139c10
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Quote/Model/Plugin/UpdateQuoteStoreTest.php
@@ -0,0 +1,130 @@
+objectManager = BootstrapHelper::getObjectManager();
+ $this->quoteRepository = $this->objectManager->create(CartRepositoryInterface::class);
+ }
+
+ /**
+ * Tests that active quote store id updates after store cookie change.
+ *
+ * @magentoDataFixture Magento/Quote/_files/empty_quote.php
+ * @magentoDataFixture Magento/Store/_files/second_store.php
+ * @throws \ReflectionException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function testUpdateQuoteStoreAfterChangeStoreCookie()
+ {
+ $secondStoreCode = 'fixture_second_store';
+ $reservedOrderId = 'reserved_order_id';
+
+ /** @var StoreManagerInterface $storeManager */
+ $storeManager = $this->objectManager->get(StoreManagerInterface::class);
+ $currentStore = $storeManager->getStore();
+
+ $quote = $this->getQuote($reservedOrderId);
+ $this->assertEquals(
+ $currentStore->getId(),
+ $quote->getStoreId(),
+ 'Current store id and quote store id are not match'
+ );
+
+ /** @var Session $checkoutSession */
+ $checkoutSession = $this->objectManager->get(Session::class);
+ $checkoutSession->setQuoteId($quote->getId());
+
+ $storeRepository = $this->objectManager->create(StoreRepository::class);
+ $secondStore = $storeRepository->get($secondStoreCode);
+
+ $storeCookieManager = $this->getStoreCookieManager($currentStore);
+ $storeCookieManager->setStoreCookie($secondStore);
+
+ $updatedQuote = $this->getQuote($reservedOrderId);
+ $this->assertEquals(
+ $secondStore->getId(),
+ $updatedQuote->getStoreId(),
+ 'Active quote store id should be equal second store id'
+ );
+ }
+
+ /**
+ * Retrieves quote by reserved order id.
+ *
+ * @param string $reservedOrderId
+ * @return Quote
+ */
+ private function getQuote(string $reservedOrderId): Quote
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+
+ $items = $this->quoteRepository->getList($searchCriteria)->getItems();
+
+ return array_pop($items);
+ }
+
+ /**
+ * Returns instance of StoreCookieManagerInterface with mocked cookieManager dependency.
+ *
+ * Mock is needed since integration test framework use own cookie manager with
+ * behavior that differs from real environment.
+ *
+ * @param $currentStore
+ * @return StoreCookieManagerInterface
+ * @throws \ReflectionException
+ */
+ private function getStoreCookieManager(StoreInterface $currentStore): StoreCookieManagerInterface
+ {
+ /** @var StoreCookieManagerInterface $storeCookieManager */
+ $storeCookieManager = $this->objectManager->get(StoreCookieManagerInterface::class);
+ $cookieManagerMock = $this->getMockBuilder(\Magento\Framework\Stdlib\Cookie\PhpCookieManager::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $cookieManagerMock->method('getCookie')
+ ->willReturn($currentStore->getCode());
+
+ $reflection = new \ReflectionClass($storeCookieManager);
+ $cookieManager = $reflection->getProperty('cookieManager');
+ $cookieManager->setAccessible(true);
+ $cookieManager->setValue($storeCookieManager, $cookieManagerMock);
+
+ return $storeCookieManager;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php
index d59c402e22a71..62e417d27c51b 100644
--- a/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php
+++ b/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php
@@ -11,7 +11,7 @@
* @magentoDataFixture Magento/Sales/_files/quote_with_customer.php
* @magentoDataFixture Magento/Customer/_files/customer_two_addresses.php
*/
-class AddressTest extends \PHPUnit\Framework\TestCase
+class AddressTest extends \Magento\TestFramework\Indexer\TestCase
{
/** @var \Magento\Quote\Model\Quote $quote */
protected $_quote;
@@ -25,6 +25,19 @@ class AddressTest extends \PHPUnit\Framework\TestCase
/**@var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
protected $customerRepository;
+ public static function setUpBeforeClass()
+ {
+ $db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()
+ ->getApplication()
+ ->getDbInstance();
+ if (!$db->isDbDumpExists()) {
+ throw new \LogicException('DB dump does not exist.');
+ }
+ $db->restoreFromDbDump();
+
+ parent::setUpBeforeClass();
+ }
+
/**
* Initialize quote and customer fixtures
*/
diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteRepositoryTest.php
index 88c66fedd10ed..3e093876349d0 100644
--- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteRepositoryTest.php
@@ -5,6 +5,7 @@
*/
namespace Magento\Quote\Model;
+use Magento\Store\Model\StoreRepository;
use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
@@ -50,6 +51,34 @@ protected function setUp()
$this->filterBuilder = $this->objectManager->create(FilterBuilder::class);
}
+ /**
+ * Tests that quote saved with custom store id has same store id after getting via repository.
+ *
+ * @magentoDataFixture Magento/Sales/_files/quote.php
+ * @magentoDataFixture Magento/Store/_files/second_store.php
+ */
+ public function testGetQuoteWithCustomStoreId()
+ {
+ $secondStoreCode = 'fixture_second_store';
+ $reservedOrderId = 'test01';
+
+ $storeRepository = $this->objectManager->create(StoreRepository::class);
+ $secondStore = $storeRepository->get($secondStoreCode);
+
+ // Set store_id in quote to second store_id
+ $quote = $this->getQuote($reservedOrderId);
+ $quote->setStoreId($secondStore->getId());
+ $this->quoteRepository->save($quote);
+
+ $savedQuote = $this->quoteRepository->get($quote->getId());
+
+ $this->assertEquals(
+ $secondStore->getId(),
+ $savedQuote->getStoreId(),
+ 'Quote store id should be equal with store id value in DB'
+ );
+ }
+
/**
* @magentoDataFixture Magento/Sales/_files/quote.php
*/
@@ -126,6 +155,24 @@ public function testSaveWithNotExistingCustomerAddress()
);
}
+ /**
+ * Returns quote by reserved order id.
+ *
+ * @param string $reservedOrderId
+ * @return CartInterface
+ */
+ private function getQuote(string $reservedOrderId)
+ {
+ $searchCriteria = $this->getSearchCriteria($reservedOrderId);
+ $searchResult = $this->quoteRepository->getList($searchCriteria);
+ $items = $searchResult->getItems();
+
+ /** @var CartInterface $quote */
+ $quote = array_pop($items);
+
+ return $quote;
+ }
+
/**
* Get search criteria
*
diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php
index 39db5b1572cb7..5df185cad7ac3 100644
--- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php
@@ -9,15 +9,36 @@
use Magento\Customer\Api\Data\CustomerInterfaceFactory;
use Magento\Framework\Exception\LocalizedException;
use Magento\TestFramework\Helper\Bootstrap;
+use Magento\TestFramework\ObjectManager;
+use Magento\Framework\Api\SearchCriteriaBuilder;
+use Magento\Quote\Api\CartRepositoryInterface;
+use Magento\Framework\Api\ExtensibleDataInterface;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class QuoteTest extends \PHPUnit\Framework\TestCase
{
- private function convertToArray($entity)
+ /**
+ * @var ObjectManager
+ */
+ private $objectManager;
+
+ /**
+ * @inheritdoc
+ */
+ protected function setUp()
+ {
+ $this->objectManager = Bootstrap::getObjectManager();
+ }
+
+ /**
+ * @param ExtensibleDataInterface $entity
+ * @return array
+ */
+ private function convertToArray(ExtensibleDataInterface $entity): array
{
- return Bootstrap::getObjectManager()
+ return $this->objectManager
->create(\Magento\Framework\Api\ExtensibleDataObjectConverter::class)
->toFlatArray($entity);
}
@@ -25,13 +46,14 @@ private function convertToArray($entity)
/**
* @magentoDataFixture Magento/Catalog/_files/product_virtual.php
* @magentoDataFixture Magento/Sales/_files/quote.php
+ * @return void
*/
- public function testCollectTotalsWithVirtual()
+ public function testCollectTotalsWithVirtual(): void
{
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ $quote = $this->objectManager->create(Quote::class);
$quote->load('test01', 'reserved_order_id');
- $productRepository = Bootstrap::getObjectManager()->create(
+ $productRepository = $this->objectManager->create(
\Magento\Catalog\Api\ProductRepositoryInterface::class
);
$product = $productRepository->get('virtual-product', false, null, true);
@@ -44,16 +66,19 @@ public function testCollectTotalsWithVirtual()
$this->assertEquals(20, $quote->getBaseGrandTotal());
}
- public function testSetCustomerData()
+ /**
+ * @return void
+ */
+ public function testSetCustomerData(): void
{
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
/** @var CustomerInterfaceFactory $customerFactory */
- $customerFactory = Bootstrap::getObjectManager()->create(
+ $customerFactory = $this->objectManager->create(
CustomerInterfaceFactory::class
);
/** @var \Magento\Framework\Api\DataObjectHelper $dataObjectHelper */
- $dataObjectHelper = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\DataObjectHelper::class);
+ $dataObjectHelper = $this->objectManager->create(\Magento\Framework\Api\DataObjectHelper::class);
$expected = $this->_getCustomerDataArray();
$customer = $customerFactory->create();
$dataObjectHelper->populateWithArray(
@@ -70,15 +95,18 @@ public function testSetCustomerData()
$this->assertEquals('qa@example.com', $quote->getCustomerEmail());
}
- public function testUpdateCustomerData()
+ /**
+ * @return void
+ */
+ public function testUpdateCustomerData(): void
{
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
- $customerFactory = Bootstrap::getObjectManager()->create(
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
+ $customerFactory = $this->objectManager->create(
CustomerInterfaceFactory::class
);
/** @var \Magento\Framework\Api\DataObjectHelper $dataObjectHelper */
- $dataObjectHelper = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\DataObjectHelper::class);
+ $dataObjectHelper = $this->objectManager->create(\Magento\Framework\Api\DataObjectHelper::class);
$expected = $this->_getCustomerDataArray();
//For save in repository
$expected = $this->removeIdFromCustomerData($expected);
@@ -92,7 +120,7 @@ public function testUpdateCustomerData()
/**
* @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
*/
- $customerRepository = Bootstrap::getObjectManager()
+ $customerRepository = $this->objectManager
->create(\Magento\Customer\Api\CustomerRepositoryInterface::class);
$customerRepository->save($customerDataSet);
$quote->setCustomer($customerDataSet);
@@ -116,18 +144,20 @@ public function testUpdateCustomerData()
/**
* Customer data is set to quote (which contains valid group ID).
+ *
+ * @return void
*/
- public function testGetCustomerGroupFromCustomer()
+ public function testGetCustomerGroupFromCustomer(): void
{
/** Preconditions */
/** @var CustomerInterfaceFactory $customerFactory */
- $customerFactory = Bootstrap::getObjectManager()->create(
+ $customerFactory = $this->objectManager->create(
CustomerInterfaceFactory::class
);
$customerGroupId = 3;
$customerData = $customerFactory->create()->setId(1)->setGroupId($customerGroupId);
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$quote->setCustomer($customerData);
$quote->unsetData('customer_group_id');
@@ -137,8 +167,9 @@ public function testGetCustomerGroupFromCustomer()
/**
* @magentoDataFixture Magento/Customer/_files/customer_group.php
+ * @return void
*/
- public function testGetCustomerTaxClassId()
+ public function testGetCustomerTaxClassId(): void
{
/**
* Preconditions: create quote and assign ID of customer group created in fixture to it.
@@ -146,10 +177,10 @@ public function testGetCustomerTaxClassId()
$fixtureGroupCode = 'custom_group';
$fixtureTaxClassId = 3;
/** @var \Magento\Customer\Model\Group $group */
- $group = Bootstrap::getObjectManager()->create(\Magento\Customer\Model\Group::class);
+ $group = $this->objectManager->create(\Magento\Customer\Model\Group::class);
$fixtureGroupId = $group->load($fixtureGroupCode, 'customer_group_code')->getId();
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$quote->setCustomerGroupId($fixtureGroupId);
/** Execute SUT */
@@ -162,15 +193,16 @@ public function testGetCustomerTaxClassId()
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoDataFixture Magento/Customer/_files/customer_two_addresses.php
+ * @return void
*/
- public function testAssignCustomerWithAddressChangeAddressesNotSpecified()
+ public function testAssignCustomerWithAddressChangeAddressesNotSpecified(): void
{
/** Preconditions:
* Customer with two addresses created
* First address is default billing, second is default shipping.
*/
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$customerData = $this->_prepareQuoteForTestAssignCustomerWithAddressChange($quote);
/** Execute SUT */
@@ -227,16 +259,16 @@ public function testAssignCustomerWithAddressChangeAddressesNotSpecified()
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoDataFixture Magento/Customer/_files/customer_two_addresses.php
+ * @return void
*/
- public function testAssignCustomerWithAddressChange()
+ public function testAssignCustomerWithAddressChange(): void
{
/** Preconditions:
* Customer with two addresses created
* First address is default billing, second is default shipping.
*/
- /** @var \Magento\Quote\Model\Quote $quote */
- $objectManager = Bootstrap::getObjectManager();
- $quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$customerData = $this->_prepareQuoteForTestAssignCustomerWithAddressChange($quote);
/** @var \Magento\Quote\Model\Quote\Address $quoteBillingAddress */
$expectedBillingAddressData = [
@@ -249,7 +281,7 @@ public function testAssignCustomerWithAddressChange()
'firstname' => 'FirstBilling',
'region_id' => 1
];
- $quoteBillingAddress = $objectManager->create(\Magento\Quote\Model\Quote\Address::class);
+ $quoteBillingAddress = $this->objectManager->create(\Magento\Quote\Model\Quote\Address::class);
$quoteBillingAddress->setData($expectedBillingAddressData);
$expectedShippingAddressData = [
@@ -262,7 +294,7 @@ public function testAssignCustomerWithAddressChange()
'firstname' => 'FirstShipping',
'region_id' => 1
];
- $quoteShippingAddress = $objectManager->create(\Magento\Quote\Model\Quote\Address::class);
+ $quoteShippingAddress = $this->objectManager->create(\Magento\Quote\Model\Quote\Address::class);
$quoteShippingAddress->setData($expectedShippingAddressData);
/** Execute SUT */
@@ -292,16 +324,17 @@ public function testAssignCustomerWithAddressChange()
/**
* @magentoDataFixture Magento/Catalog/_files/product_simple_duplicated.php
+ * @return void
*/
- public function testAddProductUpdateItem()
+ public function testAddProductUpdateItem(): void
{
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$quote->load('test01', 'reserved_order_id');
$productStockQty = 100;
- $productRepository = Bootstrap::getObjectManager()->create(
+ $productRepository = $this->objectManager->create(
\Magento\Catalog\Api\ProductRepositoryInterface::class
);
$product = $productRepository->get('simple-1', false, null, true);
@@ -324,7 +357,7 @@ public function testAddProductUpdateItem()
$this->assertEquals(1, $quote->getItemsQty());
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
- $this->expectExceptionMessage('We don\'t have as many "Simple Product" as you requested.');
+ $this->expectExceptionMessage('The requested qty is not available');
$updateParams['qty'] = $productStockQty + 1;
$quote->updateItem($updateParams['id'], $updateParams);
}
@@ -334,17 +367,19 @@ public function testAddProductUpdateItem()
*
* Customer with two addresses created. First address is default billing, second is default shipping.
*
- * @param \Magento\Quote\Model\Quote $quote
+ * @param Quote $quote
* @return \Magento\Customer\Api\Data\CustomerInterface
*/
- protected function _prepareQuoteForTestAssignCustomerWithAddressChange($quote)
- {
- $objectManager = Bootstrap::getObjectManager();
+ protected function _prepareQuoteForTestAssignCustomerWithAddressChange(
+ Quote $quote
+ ): \Magento\Customer\Api\Data\CustomerInterface {
/** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
- $customerRepository = $objectManager->create(\Magento\Customer\Api\CustomerRepositoryInterface::class);
+ $customerRepository = $this->objectManager->create(
+ \Magento\Customer\Api\CustomerRepositoryInterface::class
+ );
$fixtureCustomerId = 1;
/** @var \Magento\Customer\Model\Customer $customer */
- $customer = $objectManager->create(\Magento\Customer\Model\Customer::class);
+ $customer = $this->objectManager->create(\Magento\Customer\Model\Customer::class);
$fixtureSecondAddressId = 2;
$customer->load($fixtureCustomerId)->setDefaultShipping($fixtureSecondAddressId)->save();
$customerData = $customerRepository->getById($fixtureCustomerId);
@@ -360,11 +395,11 @@ protected function _prepareQuoteForTestAssignCustomerWithAddressChange($quote)
}
/**
- * @param $email
+ * @param string $email
* @param array $customerData
* @return array
*/
- protected function changeEmailInCustomerData($email, array $customerData)
+ protected function changeEmailInCustomerData(string $email, array $customerData): array
{
$customerData[\Magento\Customer\Model\Data\Customer::EMAIL] = $email;
return $customerData;
@@ -374,13 +409,16 @@ protected function changeEmailInCustomerData($email, array $customerData)
* @param array $customerData
* @return array
*/
- protected function removeIdFromCustomerData(array $customerData)
+ protected function removeIdFromCustomerData(array $customerData): array
{
unset($customerData[\Magento\Customer\Model\Data\Customer::ID]);
return $customerData;
}
- protected function _getCustomerDataArray()
+ /**
+ * @return array
+ */
+ protected function _getCustomerDataArray(): array
{
return [
\Magento\Customer\Model\Data\Customer::CONFIRMATION => 'test',
@@ -410,12 +448,12 @@ protected function _getCustomerDataArray()
*
* @magentoDataFixture Magento/Sales/_files/order.php
* @magentoDataFixture Magento/Quote/_files/empty_quote.php
+ * @return void
*/
- public function testReserveOrderId()
+ public function testReserveOrderId(): void
{
- $objectManager = Bootstrap::getObjectManager();
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$quote->load('reserved_order_id', 'reserved_order_id');
$quote->reserveOrderId();
$this->assertEquals('reserved_order_id', $quote->getReservedOrderId());
@@ -427,38 +465,38 @@ public function testReserveOrderId()
/**
* Test to verify that disabled product cannot be added to cart
* @magentoDataFixture Magento/Quote/_files/is_not_salable_product.php
+ * @return void
*/
- public function testAddedProductToQuoteIsSalable()
+ public function testAddedProductToQuoteIsSalable(): void
{
$productId = 99;
- $objectManager = Bootstrap::getObjectManager();
/** @var ProductRepository $productRepository */
- $productRepository = $objectManager->get(ProductRepository::class);
+ $productRepository = $this->objectManager->get(ProductRepository::class);
- /** @var \Magento\Quote\Model\Quote $quote */
+ /** @var Quote $quote */
$product = $productRepository->getById($productId, false, null, true);
$this->expectException(LocalizedException::class);
$this->expectExceptionMessage('Product that you are trying to add is not available.');
- $quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+ $quote = $this->objectManager->create(Quote::class);
$quote->addProduct($product);
}
/**
* @magentoDataFixture Magento/Sales/_files/quote.php
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
+ * @return void
*/
- public function testGetItemById()
+ public function testGetItemById(): void
{
- $objectManager = Bootstrap::getObjectManager();
- $quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+ $quote = $this->objectManager->create(Quote::class);
$quote->load('test01', 'reserved_order_id');
- $quoteItem = $objectManager->create(\Magento\Quote\Model\Quote\Item::class);
+ $quoteItem = $this->objectManager->create(\Magento\Quote\Model\Quote\Item::class);
- $productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+ $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
$product = $productRepository->get('simple');
$quoteItem->setProduct($product);
@@ -468,4 +506,45 @@ public function testGetItemById()
$this->assertInstanceOf(\Magento\Quote\Model\Quote\Item::class, $quote->getItemById($quoteItem->getId()));
$this->assertEquals($quoteItem->getId(), $quote->getItemById($quoteItem->getId())->getId());
}
+
+ /**
+ * Tests of quotes merging.
+ *
+ * @magentoDataFixture Magento/Sales/_files/quote.php
+ * @return void
+ */
+ public function testMerge(): void
+ {
+ $giftMessageId = 1;
+
+ /** @var Quote $quote */
+ $guestQuote = $this->getQuote('test01');
+ $guestQuote->setGiftMessageId($giftMessageId);
+
+ /** @var Quote $customerQuote */
+ $customerQuote = $this->objectManager->create(Quote::class);
+ $customerQuote->merge($guestQuote);
+
+ self::assertEquals($giftMessageId, $customerQuote->getGiftMessageId());
+ }
+
+ /**
+ * Gets quote by reserved order id.
+ *
+ * @param string $reservedOrderId
+ * @return Quote
+ */
+ private function getQuote(string $reservedOrderId): Quote
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+
+ /** @var CartRepositoryInterface $quoteRepository */
+ $quoteRepository = $this->objectManager->get(CartRepositoryInterface::class);
+ $items = $quoteRepository->getList($searchCriteria)->getItems();
+
+ return array_pop($items);
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
index 6b4e9a66f4c6b..999522a49e006 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
@@ -5,39 +5,50 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
+declare(strict_types=1);
+
namespace Magento\Sales\Block\Adminhtml\Order\Create\Form;
+use Magento\Backend\Model\Session\Quote as SessionQuote;
+use Magento\Customer\Api\Data\AttributeMetadataInterfaceFactory;
+use Magento\Customer\Model\Metadata\Form;
+use Magento\Customer\Model\Metadata\FormFactory;
+use Magento\Framework\View\LayoutInterface;
+use Magento\Quote\Model\Quote;
+use Magento\TestFramework\Helper\Bootstrap;
+
/**
* @magentoAppArea adminhtml
*/
class AccountTest extends \PHPUnit\Framework\TestCase
{
- /** @var \Magento\Sales\Block\Adminhtml\Order\Create\Form\Account */
- protected $_accountBlock;
+ /** @var Account */
+ private $accountBlock;
/**
- * @var \Magento\TestFramework\Helper\Bootstrap
+ * @var Bootstrap
*/
- protected $_objectManager;
+ private $objectManager;
/**
* @magentoDataFixture Magento/Sales/_files/quote.php
*/
protected function setUp()
{
- $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
- $quote = $this->_objectManager->create(\Magento\Quote\Model\Quote::class)->load(1);
+ $this->objectManager = Bootstrap::getObjectManager();
+ $quote = $this->objectManager->create(Quote::class)->load(1);
$sessionQuoteMock = $this->getMockBuilder(
- \Magento\Backend\Model\Session\Quote::class
+ SessionQuote::class
)->disableOriginalConstructor()->setMethods(
['getCustomerId', 'getStore', 'getStoreId', 'getQuote']
)->getMock();
$sessionQuoteMock->expects($this->any())->method('getCustomerId')->will($this->returnValue(1));
$sessionQuoteMock->expects($this->any())->method('getQuote')->will($this->returnValue($quote));
- /** @var \Magento\Framework\View\LayoutInterface $layout */
- $layout = $this->_objectManager->get(\Magento\Framework\View\LayoutInterface::class);
- $this->_accountBlock = $layout->createBlock(
- \Magento\Sales\Block\Adminhtml\Order\Create\Form\Account::class,
+ /** @var LayoutInterface $layout */
+ $layout = $this->objectManager->get(LayoutInterface::class);
+ $this->accountBlock = $layout->createBlock(
+ Account::class,
'address_block' . rand(),
['sessionQuote' => $sessionQuoteMock]
);
@@ -50,7 +61,7 @@ protected function setUp()
public function testGetForm()
{
$expectedFields = ['group_id', 'email'];
- $form = $this->_accountBlock->getForm();
+ $form = $this->accountBlock->getForm();
$this->assertEquals(1, $form->getElements()->count(), "Form has invalid number of fieldsets");
$fieldset = $form->getElements()[0];
@@ -63,4 +74,56 @@ public function testGetForm()
);
}
}
+
+ /**
+ * Tests a case when user defined custom attribute has default value.
+ *
+ * @magentoDataFixture Magento/Customer/_files/customer.php
+ */
+ public function testGetFormWithUserDefinedAttribute()
+ {
+ $formFactory = $this->getFormFactoryMock();
+ $this->objectManager->addSharedInstance($formFactory, FormFactory::class);
+
+ /** @var LayoutInterface $layout */
+ $layout = $this->objectManager->get(LayoutInterface::class);
+ $accountBlock = $layout->createBlock(Account::class, 'address_block' . rand());
+
+ $form = $accountBlock->getForm();
+ $form->setUseContainer(true);
+
+ $this->assertContains(
+ '',
+ $form->toHtml(),
+ 'Default value for user defined custom attribute should be selected'
+ );
+ }
+
+ /**
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
+ private function getFormFactoryMock(): \PHPUnit_Framework_MockObject_MockObject
+ {
+ /** @var AttributeMetadataInterfaceFactory $attributeMetadataFactory */
+ $attributeMetadataFactory = $this->objectManager->create(AttributeMetadataInterfaceFactory::class);
+ $booleanAttribute = $attributeMetadataFactory->create()
+ ->setAttributeCode('boolean')
+ ->setBackendType('boolean')
+ ->setFrontendInput('boolean')
+ ->setDefaultValue('1')
+ ->setFrontendLabel('Yes/No');
+
+ $form = $this->getMockBuilder(Form::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $form->method('getUserAttributes')->willReturn([$booleanAttribute]);
+ $form->method('getSystemAttributes')->willReturn([]);
+
+ $formFactory = $this->getMockBuilder(FormFactory::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $formFactory->method('create')->willReturn($form);
+
+ return $formFactory;
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
index b6df7eb05c03d..abdbab2c24d16 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php
@@ -1,151 +1,201 @@
_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
-
- $sessionMock = $this->getMockBuilder(
- \Magento\Backend\Model\Session\Quote::class
- )->disableOriginalConstructor()->setMethods(
- ['getCustomerId', 'getQuote', 'getStoreId', 'getStore']
- )->getMock();
- $sessionMock->expects($this->any())->method('getCustomerId')->will($this->returnValue(1));
-
- $quote = $this->_objectManager->create(\Magento\Quote\Model\Quote::class)->load(1);
- $sessionMock->expects($this->any())->method('getQuote')->will($this->returnValue($quote));
-
- $sessionMock->expects($this->any())->method('getStoreId')->will($this->returnValue(1));
-
- $storeMock = $this->getMockBuilder(
- \Magento\Store\Model\Store::class
- )->disableOriginalConstructor()->setMethods(
- ['getCurrentCurrencyCode']
- )->getMock();
- $storeMock->expects($this->any())->method('getCurrentCurrencyCode')->will($this->returnValue('USD'));
- $sessionMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
-
- /** @var \Magento\Framework\View\LayoutInterface $layout */
- $layout = $this->_objectManager->get(\Magento\Framework\View\LayoutInterface::class);
- $this->_orderCreateBlock = $layout->createBlock(
- \Magento\Sales\Block\Adminhtml\Order\Create\Form::class,
- 'order_create_block' . rand(),
- ['sessionQuote' => $sessionMock]
+ $this->objectManager = Bootstrap::getObjectManager();
+
+ $this->session = $this->getMockBuilder(QuoteSession::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getCustomerId', 'getQuote', 'getStoreId', 'getStore', 'getQuoteId'])
+ ->getMock();
+ $this->session->method('getCustomerId')
+ ->willReturn(1);
+
+ $this->session->method('getStoreId')
+ ->willReturn(1);
+
+ $store = $this->getMockBuilder(Store::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getCurrentCurrencyCode'])
+ ->getMock();
+ $store->method('getCurrentCurrencyCode')
+ ->willReturn('USD');
+ $this->session->method('getStore')
+ ->willReturn($store);
+
+ /** @var LayoutInterface $layout */
+ $layout = $this->objectManager->get(LayoutInterface::class);
+ $this->block = $layout->createBlock(
+ Form::class,
+ 'order_create_block' . mt_rand(),
+ ['sessionQuote' => $this->session]
);
parent::setUp();
}
/**
+ * Checks if all needed order's data is correctly returned to the form.
+ *
* @magentoDataFixture Magento/Customer/_files/customer.php
+ * @magentoDataFixture Magento/Sales/_files/quote.php
*/
public function testOrderDataJson()
{
- /** @var array $addressIds */
- $addressIds = $this->setUpMockAddress();
- $orderDataJson = $this->_orderCreateBlock->getOrderDataJson();
- $expectedOrderDataJson = <<assertEquals(json_decode($expectedOrderDataJson), json_decode($orderDataJson));
+ $customerId = 1;
+ $quote = $this->getQuote('test01');
+ $this->session->method('getQuote')
+ ->willReturn($quote);
+ $this->session->method('getQuoteId')
+ ->willReturn($quote->getId());
+ $addressData = $this->getAddressData();
+ $addressIds = $this->setUpMockAddress($customerId, $addressData);
+ $expected = [
+ 'customer_id' => $customerId,
+ 'addresses' => [
+ $addressIds[0] => $addressData[0],
+ $addressIds[1] => $addressData[1]
+ ],
+ 'store_id' => 1,
+ 'currency_symbol' => '$',
+ 'shipping_method_reseted' => true,
+ 'payment_method' => 'checkmo',
+ 'quote_id' => $quote->getId()
+ ];
+
+ self::assertEquals($expected, json_decode($this->block->getOrderDataJson(), true));
}
- private function setUpMockAddress()
+ /**
+ * Saves customer's addresses.
+ *
+ * @param int $customerId
+ * @param array $addressData
+ * @return array
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ private function setUpMockAddress(int $customerId, array $addressData)
{
- /** @var \Magento\Customer\Api\Data\RegionInterfaceFactory $regionFactory */
- $regionFactory = $this->_objectManager->create(\Magento\Customer\Api\Data\RegionInterfaceFactory::class);
-
- /** @var \Magento\Customer\Api\Data\AddressInterfaceFactory $addressFactory */
- $addressFactory = $this->_objectManager->create(\Magento\Customer\Api\Data\AddressInterfaceFactory::class);
- /** @var \Magento\Customer\Api\AddressRepositoryInterface $addressRepository */
- $addressRepository = $this->_objectManager->create(\Magento\Customer\Api\AddressRepositoryInterface::class);
-
- $addressData1 = $addressFactory->create()->setCountryId(
- 'US'
- )->setCustomerId(
- 1
- )->setIsDefaultBilling(
- true
- )->setIsDefaultShipping(
- true
- )->setPostcode(
- '75477'
- )->setRegion(
- $regionFactory->create()->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)
- )->setStreet(
- ['Green str, 67']
- )->setTelephone(
- '3468676'
- )->setCity(
- 'CityM'
- )->setFirstname(
- 'John'
- )->setLastname(
- 'Smith'
- );
-
- $addressData2 = $addressFactory->create()->setCountryId(
- 'US'
- )->setCustomerId(
- 1
- )->setIsDefaultBilling(
- false
- )->setIsDefaultShipping(
- false
- )->setPostcode(
- '47676'
- )->setRegion(
- $regionFactory->create()->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)
- )->setStreet(
- ['Black str, 48']
- )->setCity(
- 'CityX'
- )->setTelephone(
- '3234676'
- )->setFirstname(
- 'John'
- )->setLastname(
- 'Smith'
- );
+ /** @var RegionInterfaceFactory $regionFactory */
+ $regionFactory = $this->objectManager->create(RegionInterfaceFactory::class);
+ /** @var AddressInterfaceFactory $addressFactory */
+ $addressFactory = $this->objectManager->create(AddressInterfaceFactory::class);
+ /** @var AddressRepositoryInterface $addressRepository */
+ $addressRepository = $this->objectManager->create(AddressRepositoryInterface::class);
+ $region = $regionFactory->create()
+ ->setRegionCode('AL')
+ ->setRegion('Alabama')
+ ->setRegionId(1);
+
+ $ids = [];
+ foreach ($addressData as $data) {
+ $address = $addressFactory->create(['data' => $data]);
+ $address->setRegion($region)
+ ->setCustomerId($customerId)
+ ->setIsDefaultBilling(true)
+ ->setIsDefaultShipping(true);
+ $address = $addressRepository->save($address);
+ $ids[] = $address->getId();
+ }
+
+ return $ids;
+ }
- $savedAddress1 = $addressRepository->save($addressData1);
- $savedAddress2 = $addressRepository->save($addressData2);
+ /**
+ * Gets test address data.
+ *
+ * @return array
+ */
+ private function getAddressData(): array
+ {
+ return [
+ [
+ 'firstname' => 'John',
+ 'lastname' => 'Smith',
+ 'company' => false,
+ 'street' => 'Green str, 67',
+ 'city' => 'CityM',
+ 'country_id' => 'US',
+ 'region' => 'Alabama',
+ 'region_id' => 1,
+ 'postcode' => '75477',
+ 'telephone' => '3468676',
+ 'vat_id' => false
+ ],
+ [
+ 'firstname' => 'John',
+ 'lastname' => 'Smith',
+ 'company' => false,
+ 'street' => 'Black str, 48',
+ 'city' => 'CityX',
+ 'country_id' => 'US',
+ 'region' => 'Alabama',
+ 'region_id' => 1,
+ 'postcode' => '47676',
+ 'telephone' => '3234676',
+ 'vat_id' => false,
+ ]
+ ];
+ }
- return [$savedAddress1->getId(), $savedAddress2->getId()];
+ /**
+ * Gets quote by ID.
+ *
+ * @param string $reservedOrderId
+ * @return Quote
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getQuote(string $reservedOrderId): Quote
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+ /** @var CartRepositoryInterface $repository */
+ $repository = $this->objectManager->get(CartRepositoryInterface::class);
+ $items = $repository->getList($searchCriteria)
+ ->getItems();
+
+ return array_pop($items);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/address_data.php b/dev/tests/integration/testsuite/Magento/Sales/_files/address_data.php
index 2d131bf5f57e2..394b13078010a 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/_files/address_data.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/address_data.php
@@ -6,6 +6,7 @@
return [
'region' => 'CA',
+ 'region_id' => '12',
'postcode' => '11111',
'lastname' => 'lastname',
'firstname' => 'firstname',
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php
index 31aa8aafd94d9..f3e528b9c0d28 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php
@@ -85,6 +85,9 @@
$invoice = $invoiceFactory->prepareInvoice($order, [$item->getId() => 10]);
$invoice->register();
$invoice->save();
+$order->save();
+
+$invoice = $objectManager->get(\Magento\Sales\Api\InvoiceRepositoryInterface::class)->get($invoice->getId());
/** @var \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory */
$creditmemoFactory = $objectManager->get(\Magento\Sales\Model\Order\CreditmemoFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php
index e601e2dd59232..694310f2cbc89 100644
--- a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php
+++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php
@@ -93,6 +93,36 @@ public function applyFixedDiscountDataProvider(): array
];
}
+ /**
+ * Tests that coupon with wildcard symbols in code can be successfully applied.
+ *
+ * @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
+ */
+ public function testCouponCodeWithWildcard()
+ {
+ $expectedDiscount = '-5.00';
+ $couponCode = '2?ds5!2d';
+ $cartId = $this->cartManagement->createEmptyCart();
+ $productPrice = 10;
+
+ $product = $this->createProduct($productPrice);
+
+ /** @var CartItemInterface $quoteItem */
+ $quoteItem = Bootstrap::getObjectManager()->create(CartItemInterface::class);
+ $quoteItem->setQuoteId($cartId);
+ $quoteItem->setProduct($product);
+ $quoteItem->setQty(1);
+ $this->cartItemRepository->save($quoteItem);
+
+ $this->couponManagement->set($cartId, $couponCode);
+
+ /** @var GuestCartTotalRepositoryInterface $cartTotalRepository */
+ $cartTotalRepository = Bootstrap::getObjectManager()->get(GuestCartTotalRepositoryInterface::class);
+ $total = $cartTotalRepository->get($cartId);
+
+ $this->assertEquals($expectedDiscount, $total->getBaseDiscountAmount());
+ }
+
/**
* Returns simple product with given price.
*
diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Condition/ProductTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Condition/ProductTest.php
index 98826adeb2147..00f1b1f451815 100644
--- a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Condition/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Condition/ProductTest.php
@@ -6,6 +6,14 @@
namespace Magento\SalesRule\Model\Rule\Condition;
+use Magento\Quote\Api\CartRepositoryInterface;
+use Magento\Framework\Api\SearchCriteriaBuilder;
+use Magento\Quote\Api\Data\CartInterface;
+use Magento\SalesRule\Api\RuleRepositoryInterface;
+
+/**
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class ProductTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -98,4 +106,71 @@ public function validateProductConditionDataProvider()
]
];
}
+
+ /**
+ * Ensure that SalesRules filtering on quote items quantity validates configurable product correctly
+ *
+ * 1. Load a quote with a configured product and a sales rule set to filter items with quantity 2.
+ * 2. Attempt to validate the sales rule against the quote and assert the output is negative.
+ *
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php
+ * @magentoDataFixture Magento/SalesRule/_files/cart_rule_10_percent_off.php
+ */
+ public function testValidateQtySalesRuleWithConfigurable()
+ {
+ // Load the quote that contains a child of a configurable product with quantity 1.
+ $quote = $this->getQuote('test_cart_with_configurable');
+
+ // Load the SalesRule looking for products with quantity 2.
+ $rule = $this->getSalesRule('10% Off on orders with two items');
+
+ $this->assertFalse(
+ $rule->validate($quote->getBillingAddress())
+ );
+ }
+
+ /**
+ * Gets quote by reserved order id.
+ *
+ * @param string $reservedOrderId
+ * @return CartInterface
+ */
+ private function getQuote($reservedOrderId)
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)
+ ->create();
+
+ /** @var CartRepositoryInterface $quoteRepository */
+ $quoteRepository = $this->objectManager->get(CartRepositoryInterface::class);
+ $items = $quoteRepository->getList($searchCriteria)->getItems();
+ return array_pop($items);
+ }
+
+ /**
+ * Gets rule by name.
+ *
+ * @param string $name
+ * @return \Magento\SalesRule\Model\Rule
+ * @throws \Magento\Framework\Exception\InputException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getSalesRule(string $name): \Magento\SalesRule\Model\Rule
+ {
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('name', $name)
+ ->create();
+
+ /** @var CartRepositoryInterface $quoteRepository */
+ $ruleRepository = $this->objectManager->get(RuleRepositoryInterface::class);
+ $items = $ruleRepository->getList($searchCriteria)->getItems();
+
+ $rule = array_pop($items);
+ /** @var \Magento\SalesRule\Model\Converter\ToModel $converter */
+ $converter = $this->objectManager->get(\Magento\SalesRule\Model\Converter\ToModel::class);
+
+ return $converter->toModel($rule);
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_10_percent_off.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_10_percent_off.php
new file mode 100644
index 0000000000000..0761e5753da75
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_10_percent_off.php
@@ -0,0 +1,64 @@
+get(StoreManagerInterface::class)
+ ->getWebsite()
+ ->getId();
+
+/** @var Rule $salesRule */
+$salesRule = $objectManager->create(Rule::class);
+$salesRule->setData(
+ [
+ 'name' => '10% Off on orders with two items',
+ 'is_active' => 1,
+ 'customer_group_ids' => [GroupManagement::NOT_LOGGED_IN_ID],
+ 'coupon_type' => Rule::COUPON_TYPE_NO_COUPON,
+ 'simple_action' => 'by_percent',
+ 'discount_amount' => 10,
+ 'discount_step' => 0,
+ 'stop_rules_processing' => 1,
+ 'website_ids' => [$websiteId]
+ ]
+);
+
+$salesRule->getConditions()->loadArray([
+ 'type' => \Magento\SalesRule\Model\Rule\Condition\Combine::class,
+ 'attribute' => null,
+ 'operator' => null,
+ 'value' => '1',
+ 'is_value_processed' => null,
+ 'aggregator' => 'all',
+ 'conditions' =>
+ [
+ [
+ 'type' => \Magento\SalesRule\Model\Rule\Condition\Product\Subselect::class,
+ 'attribute' => 'qty',
+ 'operator' => '==',
+ 'value' => '2',
+ 'is_value_processed' => null,
+ 'aggregator' => 'all',
+ 'conditions' =>
+ [
+ [
+ 'type' => \Magento\SalesRule\Model\Rule\Condition\Product::class,
+ 'attribute' => 'attribute_set_id',
+ 'operator' => '==',
+ 'value' => '4',
+ 'is_value_processed' => false,
+ ],
+ ],
+ ],
+ ],
+]);
+
+$salesRule->save();
diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard.php
new file mode 100644
index 0000000000000..9005284f984cf
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard.php
@@ -0,0 +1,45 @@
+create(Rule::class);
+$salesRule->setData(
+ [
+ 'name' => '5$ fixed discount on whole cart',
+ 'is_active' => 1,
+ 'customer_group_ids' => [GroupManagement::NOT_LOGGED_IN_ID],
+ 'coupon_type' => Rule::COUPON_TYPE_SPECIFIC,
+ 'conditions' => [],
+ 'simple_action' => Rule::CART_FIXED_ACTION,
+ 'discount_amount' => 5,
+ 'discount_step' => 0,
+ 'stop_rules_processing' => 1,
+ 'website_ids' => [
+ $objectManager->get(StoreManagerInterface::class)->getWebsite()->getId(),
+ ],
+ ]
+);
+$objectManager->get(\Magento\SalesRule\Model\ResourceModel\Rule::class)->save($salesRule);
+
+// Create coupon and assign "15$ fixed discount" rule to this coupon.
+$coupon = $objectManager->create(Coupon::class);
+$coupon->setRuleId($salesRule->getId())
+ ->setCode('2?ds5!2d')
+ ->setType(0);
+
+/** @var CouponRepositoryInterface $couponRepository */
+$couponRepository = $objectManager->get(CouponRepositoryInterface::class);
+$couponRepository->save($coupon);
diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard_rollback.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard_rollback.php
new file mode 100644
index 0000000000000..776c302210351
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/coupon_code_with_wildcard_rollback.php
@@ -0,0 +1,46 @@
+get(RuleRepositoryInterface::class);
+ $ruleRepository->deleteById($salesRule->getRuleId());
+}
+
+$coupon = $objectManager->create(Coupon::class);
+$coupon->loadByCode('2?ds5!2d');
+if ($coupon->getCouponId()) {
+ /** @var CouponRepositoryInterface $couponRepository */
+ $couponRepository = $objectManager->get(CouponRepositoryInterface::class);
+ $couponRepository->deleteById($coupon->getCouponId());
+}
+
+function getSalesRule(string $name)
+{
+ /** @var SearchCriteriaBuilder $searchCriteriaBuilder */
+ $searchCriteriaBuilder = Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
+ $searchCriteria = $searchCriteriaBuilder->addFilter('name', $name)
+ ->create();
+
+ /** @var RuleRepositoryInterface $ruleRepository */
+ $ruleRepository = Bootstrap::getObjectManager()->get(RuleRepositoryInterface::class);
+ $items = $ruleRepository->getList($searchCriteria)
+ ->getItems();
+
+ return array_pop($items);
+}
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php
new file mode 100644
index 0000000000000..79028a159d1aa
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php
@@ -0,0 +1,168 @@
+objectManager = Bootstrap::getObjectManager();
+
+ $this->objectManager->get(\Magento\TestFramework\App\Config::class)->clean();
+
+ $this->command = $this->objectManager->create(
+ \Magento\Catalog\Console\Command\PriceIndexerDimensionsModeSetCommand::class
+ );
+
+ $this->commandTester = new CommandTester($this->command);
+
+ parent::setUp();
+ }
+
+ /**
+ * tearDown
+ */
+ public function tearDown()
+ {
+ parent::tearDown();
+ }
+
+ /**
+ * setUpBeforeClass
+ */
+ public static function setUpBeforeClass()
+ {
+ $db = Bootstrap::getInstance()->getBootstrap()
+ ->getApplication()
+ ->getDbInstance();
+ if (!$db->isDbDumpExists()) {
+ throw new \LogicException('DB dump does not exist.');
+ }
+ $db->restoreFromDbDump();
+
+ parent::setUpBeforeClass();
+ }
+
+ /**
+ * @magentoAppArea adminhtml
+ * @magentoAppIsolation enabled
+ *
+ * @param $previousMode
+ * @param $currentMode
+ * @dataProvider modesDataProvider
+ */
+ public function testSwitchMode($previousMode, $currentMode)
+ {
+ $this->commandTester->execute(
+ [
+ PriceIndexerDimensionsModeSetCommand::INPUT_KEY_MODE => $currentMode
+ ]
+ );
+ $expectedOutput = 'Dimensions mode for indexer Product Price was changed from \''
+ . $previousMode . '\' to \'' . $currentMode . '\'';
+
+ $actualOutput = $this->commandTester->getDisplay();
+
+ $this->assertContains($expectedOutput, $actualOutput);
+
+ static::assertEquals(
+ Cli::RETURN_SUCCESS,
+ $this->commandTester->getStatusCode(),
+ $this->commandTester->getDisplay(true)
+ );
+ }
+
+ public function modesDataProvider()
+ {
+ return [
+ [DimensionModeConfiguration::DIMENSION_NONE, DimensionModeConfiguration::DIMENSION_WEBSITE],
+ [DimensionModeConfiguration::DIMENSION_WEBSITE, DimensionModeConfiguration::DIMENSION_CUSTOMER_GROUP],
+ [
+ DimensionModeConfiguration::DIMENSION_CUSTOMER_GROUP,
+ DimensionModeConfiguration::DIMENSION_WEBSITE_AND_CUSTOMER_GROUP
+ ],
+ [
+ DimensionModeConfiguration::DIMENSION_WEBSITE_AND_CUSTOMER_GROUP,
+ DimensionModeConfiguration::DIMENSION_NONE
+ ],
+ [
+ DimensionModeConfiguration::DIMENSION_NONE,
+ DimensionModeConfiguration::DIMENSION_WEBSITE_AND_CUSTOMER_GROUP
+ ],
+ [
+ DimensionModeConfiguration::DIMENSION_WEBSITE_AND_CUSTOMER_GROUP,
+ DimensionModeConfiguration::DIMENSION_CUSTOMER_GROUP
+ ],
+ [DimensionModeConfiguration::DIMENSION_CUSTOMER_GROUP, DimensionModeConfiguration::DIMENSION_WEBSITE],
+ [DimensionModeConfiguration::DIMENSION_WEBSITE, DimensionModeConfiguration::DIMENSION_NONE],
+ ];
+ }
+
+ /**
+ * @magentoAppArea adminhtml
+ * @magentoAppIsolation enabled
+ */
+ public function testSwitchModeForSameMode()
+ {
+ $this->commandTester->execute(
+ [
+ PriceIndexerDimensionsModeSetCommand::INPUT_KEY_MODE => DimensionModeConfiguration::DIMENSION_NONE
+ ]
+ );
+ $expectedOutput = 'Dimensions mode for indexer Product Price has not been changed';
+
+ $actualOutput = $this->commandTester->getDisplay();
+
+ $this->assertContains($expectedOutput, $actualOutput);
+
+ static::assertEquals(
+ Cli::RETURN_SUCCESS,
+ $this->commandTester->getStatusCode(),
+ $this->commandTester->getDisplay(true)
+ );
+ }
+
+ /**
+ * @magentoAppArea adminhtml
+ * @magentoAppIsolation enabled
+ *
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSwitchModeWithInvalidArgument()
+ {
+ $this->commandTester->execute(
+ [
+ PriceIndexerDimensionsModeSetCommand::INPUT_KEY_MODE => DimensionModeConfiguration::DIMENSION_NONE .
+ '_not_valid'
+ ]
+ );
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Store/Block/SwitcherTest.php b/dev/tests/integration/testsuite/Magento/Store/Block/SwitcherTest.php
index b3707fc605017..9d1f584bfcd77 100644
--- a/dev/tests/integration/testsuite/Magento/Store/Block/SwitcherTest.php
+++ b/dev/tests/integration/testsuite/Magento/Store/Block/SwitcherTest.php
@@ -5,6 +5,11 @@
*/
namespace Magento\Store\Block;
+use Magento\Framework\App\ActionInterface;
+use Magento\TestFramework\Helper\Bootstrap;
+use Magento\Framework\Url\DecoderInterface;
+use Magento\Framework\App\ScopeInterface;
+
/**
* Integration tests for \Magento\Store\Block\Switcher block.
*/
@@ -15,6 +20,11 @@ class SwitcherTest extends \PHPUnit\Framework\TestCase
*/
private $_objectManager;
+ /**
+ * @var DecoderInterface
+ */
+ private $decoder;
+
/**
* Set up.
*
@@ -22,11 +32,12 @@ class SwitcherTest extends \PHPUnit\Framework\TestCase
*/
protected function setUp()
{
- $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+ $this->_objectManager = Bootstrap::getObjectManager();
+ $this->decoder = Bootstrap::getObjectManager()->create(DecoderInterface::class);
}
/**
- * Test that GetTargetStorePostData() method return correct store URL.
+ * Test that GetTargetStorePostData() method returns correct data.
*
* @magentoDataFixture Magento/Store/_files/store.php
* @return void
@@ -39,8 +50,16 @@ public function testGetTargetStorePostData()
/** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
$storeRepository = $this->_objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
$store = $storeRepository->get($storeCode);
+
$result = json_decode($block->getTargetStorePostData($store), true);
-
- $this->assertContains($storeCode, $result['action']);
+ $url = parse_url($this->decoder->decode($result['data'][ActionInterface::PARAM_NAME_URL_ENCODED]));
+ $storeParsedQuery = [];
+ if (isset($url['query'])) {
+ parse_str($url['query'], $storeParsedQuery);
+ }
+
+ $this->assertSame($storeCode, $result['data']['___store']);
+ $this->assertSame($storeCode, $storeParsedQuery['___store']);
+ $this->assertSame(ScopeInterface::SCOPE_DEFAULT, $result['data']['___from_store']);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreSwitcherTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreSwitcherTest.php
new file mode 100644
index 0000000000000..0e4d129d17aa6
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreSwitcherTest.php
@@ -0,0 +1,59 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->storeSwitcher = $this->objectManager->get(StoreSwitcher::class);
+ }
+
+ /**
+ * @magentoDataFixture Magento/Store/_files/store.php
+ * @magentoDataFixture Magento/Store/_files/second_store.php
+ * @return void
+ * @throws StoreSwitcher\CannotSwitchStoreException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function testSwitch(): void
+ {
+ $redirectUrl = "http://domain.com/?SID=e5h3e086dce3ckkqt9ia7avl27&___store=fixture_second_store";
+ $expectedUrl = "http://domain.com/";
+ $fromStoreCode = 'test';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $fromStore = $storeRepository->get($fromStoreCode);
+
+ $toStoreCode = 'fixture_second_store';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $toStore = $storeRepository->get($toStoreCode);
+
+ $this->assertEquals($expectedUrl, $this->storeSwitcher->switch($fromStore, $toStore, $redirectUrl));
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SubtotalTest.php b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SubtotalTest.php
index b021040079538..ae1f475d43b71 100644
--- a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SubtotalTest.php
+++ b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SubtotalTest.php
@@ -4,6 +4,8 @@
* See COPYING.txt for license details.
*/
+// @codingStandardsIgnoreFile
+
namespace Magento\Tax\Model\Sales\Total\Quote;
use Magento\TestFramework\Helper\Bootstrap;
@@ -13,7 +15,7 @@
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class SubtotalTest extends \PHPUnit\Framework\TestCase
+class SubtotalTest extends \Magento\TestFramework\Indexer\TestCase
{
/**
* Object Manager
@@ -27,12 +29,23 @@ class SubtotalTest extends \PHPUnit\Framework\TestCase
*/
private $productRepository;
+ public static function setUpBeforeClass()
+ {
+ $db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()
+ ->getApplication()
+ ->getDbInstance();
+ if (!$db->isDbDumpExists()) {
+ throw new \LogicException('DB dump does not exist.');
+ }
+ $db->restoreFromDbDump();
+
+ parent::setUpBeforeClass();
+ }
+
protected function setUp()
{
$this->objectManager = Bootstrap::getObjectManager();
- $this->productRepository = $this->objectManager->create(
- \Magento\Catalog\Api\ProductRepositoryInterface::class
- );
+ $this->productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
}
protected function getCustomerById($id)
@@ -46,6 +59,7 @@ protected function getCustomerById($id)
/**
* @magentoAppIsolation enabled
+ * @magentoDbIsolation enabled
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoDataFixture Magento/Tax/_files/tax_classes.php
@@ -61,8 +75,12 @@ public function testCollectUnitBased($expected)
/** @var \Magento\Customer\Model\Customer $customer */
$customer = $this->objectManager->create(\Magento\Customer\Model\Customer::class)->load($fixtureCustomerId);
/** @var \Magento\Customer\Model\Group $customerGroup */
- $customerGroup = $this->objectManager->create(\Magento\Customer\Model\Group::class)
- ->load('custom_group', 'customer_group_code');
+ $customerGroup = $this->objectManager->create(
+ \Magento\Customer\Model\Group::class
+ )->load(
+ 'custom_group',
+ 'customer_group_code'
+ );
$customerGroup->setTaxClassId($customerTaxClassId)->save();
$customer->setGroupId($customerGroup->getId())->save();
@@ -160,6 +178,7 @@ public function collectUnitBasedDataProvider()
}
/**
+ * @magentoDbIsolation disabled
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoDataFixture Magento/Tax/_files/tax_classes.php
@@ -177,7 +196,10 @@ public function testCollectUnitBasedBundleProduct($expected)
/** @var \Magento\Customer\Model\Group $customerGroup */
$customerGroup = $this->objectManager->create(
\Magento\Customer\Model\Group::class
- )->load('custom_group', 'customer_group_code');
+ )->load(
+ 'custom_group',
+ 'customer_group_code'
+ );
$customerGroup->setTaxClassId($customerTaxClassId)->save();
$customer->setGroupId($customerGroup->getId())->save();
diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php
index 9b498afc2500d..19343e49192ac 100644
--- a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php
+++ b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php
@@ -5,17 +5,19 @@
*/
namespace Magento\Tax\Model\Sales\Total\Quote;
+use Magento\Quote\Model\Quote\TotalsCollector;
use Magento\Tax\Model\Calculation;
use Magento\TestFramework\Helper\Bootstrap;
require_once __DIR__ . '/SetupUtil.php';
require_once __DIR__ . '/../../../../_files/tax_calculation_data_aggregated.php';
+require_once __DIR__ . '/../../../../_files/full_discount_with_tax.php';
/**
* Class TaxTest
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class TaxTest extends \PHPUnit\Framework\TestCase
+class TaxTest extends \Magento\TestFramework\Indexer\TestCase
{
/**
* Utility object for setting up tax rates, tax classes and tax rules
@@ -24,6 +26,24 @@ class TaxTest extends \PHPUnit\Framework\TestCase
*/
protected $setupUtil = null;
+ /**
+ * @var TotalsCollector
+ */
+ private $totalsCollector;
+
+ /**
+ * test setup
+ */
+ public function setUp()
+ {
+ /** @var \Magento\Framework\ObjectManagerInterface $objectManager */
+ $objectManager = Bootstrap::getObjectManager();
+ $this->totalsCollector = $objectManager->create(TotalsCollector::class);
+ $this->setupUtil = new SetupUtil($objectManager);
+
+ parent::setUp();
+ }
+
/**
* Test taxes collection for quote.
*
@@ -108,6 +128,40 @@ public function testCollect()
);
}
+ /**
+ * Test taxes collection with full discount for quote.
+ *
+ * Test tax calculation and price when the discount may be bigger than total
+ * This method will test the collector through $quote->collectTotals() method
+ *
+ * @see \Magento\SalesRule\Model\Utility::deltaRoundingFix
+ * @magentoDataFixture Magento/Tax/_files/full_discount_with_tax.php
+ * @magentoDbIsolation enabled
+ * @magentoAppIsolation enabled
+ */
+ public function testFullDiscountWithDeltaRoundingFix()
+ {
+ global $fullDiscountIncTax;
+ $configData = $fullDiscountIncTax['config_data'];
+ $quoteData = $fullDiscountIncTax['quote_data'];
+ $expectedResults = $fullDiscountIncTax['expected_result'];
+
+ /** @var \Magento\Framework\ObjectManagerInterface $objectManager */
+ $objectManager = Bootstrap::getObjectManager();
+
+ //Setup tax configurations
+ $this->setupUtil = new SetupUtil($objectManager);
+ $this->setupUtil->setupTax($configData);
+
+ $quote = $this->setupUtil->setupQuote($quoteData);
+
+ $quote->collectTotals();
+
+ $quoteAddress = $quote->getShippingAddress();
+
+ $this->verifyResult($quoteAddress, $expectedResults);
+ }
+
/**
* Verify fields in quote item
*
@@ -227,25 +281,26 @@ protected function verifyResult($quoteAddress, $expectedResults)
* @param array $configData
* @param array $quoteData
* @param array $expectedResults
- * @magentoDbIsolation enabled
+ * @magentoDbIsolation disabled
* @magentoAppIsolation enabled
* @dataProvider taxDataProvider
* @return void
*/
public function testTaxCalculation($configData, $quoteData, $expectedResults)
{
- /** @var \Magento\Framework\ObjectManagerInterface $objectManager */
- $objectManager = Bootstrap::getObjectManager();
- /** @var \Magento\Quote\Model\Quote\TotalsCollector $totalsCollector */
- $totalsCollector = $objectManager->create(\Magento\Quote\Model\Quote\TotalsCollector::class);
-
+ $db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()
+ ->getApplication()
+ ->getDbInstance();
+ if (!$db->isDbDumpExists()) {
+ throw new \LogicException('DB dump does not exist.');
+ }
+ $db->restoreFromDbDump();
//Setup tax configurations
- $this->setupUtil = new SetupUtil($objectManager);
$this->setupUtil->setupTax($configData);
$quote = $this->setupUtil->setupQuote($quoteData);
$quoteAddress = $quote->getShippingAddress();
- $totalsCollector->collectAddressTotals($quote, $quoteAddress);
+ $this->totalsCollector->collectAddressTotals($quote, $quoteAddress);
$this->verifyResult($quoteAddress, $expectedResults);
}
diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php
index cb45e1971ecab..0b98b9a519391 100644
--- a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php
@@ -109,7 +109,7 @@ public function testSave()
* @expectedExceptionMessage No such entity with taxRuleId = 9999
* @magentoDbIsolation enabled
*/
- public function testSaveThrowsExceptionIdTargetTaxRulDoesNotExist()
+ public function testSaveThrowsExceptionIdIfTargetTaxRuleDoesNotExist()
{
$taxRuleDataObject = $this->taxRuleFactory->create();
$taxRuleDataObject->setId(9999)
diff --git a/dev/tests/integration/testsuite/Magento/Tax/_files/full_discount_with_tax.php b/dev/tests/integration/testsuite/Magento/Tax/_files/full_discount_with_tax.php
new file mode 100644
index 0000000000000..2b5ef07de341a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Tax/_files/full_discount_with_tax.php
@@ -0,0 +1,120 @@
+ [
+ 'config_overrides' => [
+ Config::CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT => 0,
+ Config::CONFIG_XML_PATH_DISCOUNT_TAX => 1,
+ Config::XML_PATH_ALGORITHM => 'ROW_BASE_CALCULATION',
+ Config::CONFIG_XML_PATH_SHIPPING_TAX_CLASS => SetupUtil::SHIPPING_TAX_CLASS,
+ ],
+ 'tax_rate_overrides' => [
+ SetupUtil::TAX_RATE_TX => 18,
+ SetupUtil::TAX_RATE_SHIPPING => 0,
+ ],
+ 'tax_rule_overrides' => [
+ [
+ 'code' => 'Product Tax Rule',
+ 'product_tax_class_ids' => [
+ SetupUtil::PRODUCT_TAX_CLASS_1
+ ],
+ ],
+ [
+ 'code' => 'Shipping Tax Rule',
+ 'product_tax_class_ids' => [
+ SetupUtil::SHIPPING_TAX_CLASS
+ ],
+ 'tax_rate_ids' => [
+ SetupUtil::TAX_RATE_SHIPPING,
+ ],
+ ],
+ ],
+ ],
+ 'quote_data' => [
+ 'billing_address' => [
+ 'region_id' => SetupUtil::REGION_TX,
+ ],
+ 'shipping_address' => [
+ 'region_id' => SetupUtil::REGION_TX,
+ ],
+ 'items' => [
+ [
+ 'sku' => 'simple1',
+ 'price' => 2542.37,
+ 'qty' => 2,
+ ]
+ ],
+ 'shipping_method' => 'free',
+ 'shopping_cart_rules' => [
+ [
+ 'discount_amount' => 100
+ ],
+ ],
+ ],
+ 'expected_result' => [
+ 'address_data' => [
+ 'subtotal' => 5084.74,
+ 'base_subtotal' => 5084.74,
+ 'subtotal_incl_tax' => 5999.99,
+ 'base_subtotal_incl_tax' => 5999.99,
+ 'tax_amount' => 915.25,
+ 'base_tax_amount' => 915.25,
+ 'shipping_amount' => 0,
+ 'base_shipping_amount' => 0,
+ 'shipping_incl_tax' => 0,
+ 'base_shipping_incl_tax' => 0,
+ 'shipping_tax_amount' => 0,
+ 'base_shipping_tax_amount' => 0,
+ 'discount_amount' => -5999.99,
+ 'base_discount_amount' => -5999.99,
+ 'discount_tax_compensation_amount' => 0,
+ 'base_discount_tax_compensation_amount' => 0,
+ 'shipping_discount_tax_compensation_amount' => 0,
+ 'base_shipping_discount_tax_compensation_amount' => 0,
+ 'grand_total' => 0,
+ 'base_grand_total' => 0,
+ 'applied_taxes' => [
+ SetupUtil::TAX_RATE_TX => [
+ 'percent' => 18,
+ 'amount' => 915.25,
+ 'base_amount' => 915.25,
+ 'rates' => [
+ [
+ 'code' => SetupUtil::TAX_RATE_TX,
+ 'title' => SetupUtil::TAX_RATE_TX,
+ 'percent' => 18,
+ ],
+ ],
+ ]
+ ],
+ ],
+ 'items_data' => [
+ 'simple1' => [
+ 'row_total' => 5084.74,
+ 'base_row_total' => 5084.74,
+ 'tax_percent' => 18,
+ 'price' => 2542.37,
+ 'base_price' => 2542.37,
+ 'price_incl_tax' => 3000,
+ 'base_price_incl_tax' => 3000,
+ 'row_total_incl_tax' => 5999.99,
+ 'base_row_total_incl_tax' => 5999.99,
+ 'tax_amount' => 915.25,
+ 'base_tax_amount' => 915.25,
+ 'discount_amount' => 5999.99,
+ 'base_discount_amount' => 5999.99,
+ 'discount_percent' => 100,
+ 'discount_tax_compensation_amount' => 0,
+ 'base_discount_tax_compensation_amount' => 0,
+ ],
+ ],
+ ]
+];
diff --git a/dev/tests/integration/testsuite/Magento/Ups/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Ups/Model/CarrierTest.php
index a9f6752c9de82..aa301e8d3e423 100644
--- a/dev/tests/integration/testsuite/Magento/Ups/Model/CarrierTest.php
+++ b/dev/tests/integration/testsuite/Magento/Ups/Model/CarrierTest.php
@@ -5,20 +5,27 @@
*/
namespace Magento\Ups\Model;
+use Magento\TestFramework\Helper\Bootstrap;
+use Magento\Quote\Model\Quote\Address\RateRequestFactory;
+
class CarrierTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\Ups\Model\Carrier
+ * @var Carrier
*/
private $carrier;
+ /**
+ * @return void
+ */
protected function setUp()
{
- $this->carrier = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
- \Magento\Ups\Model\Carrier::class
- );
+ $this->carrier = Bootstrap::getObjectManager()->create(Carrier::class);
}
+ /**
+ * @return void
+ */
public function testGetShipAcceptUrl()
{
$this->assertEquals('https://wwwcie.ups.com/ups.app/xml/ShipAccept', $this->carrier->getShipAcceptUrl());
@@ -34,6 +41,9 @@ public function testGetShipAcceptUrlLive()
$this->assertEquals('https://onlinetools.ups.com/ups.app/xml/ShipAccept', $this->carrier->getShipAcceptUrl());
}
+ /**
+ * @return void
+ */
public function testGetShipConfirmUrl()
{
$this->assertEquals('https://wwwcie.ups.com/ups.app/xml/ShipConfirm', $this->carrier->getShipConfirmUrl());
@@ -51,4 +61,27 @@ public function testGetShipConfirmUrlLive()
$this->carrier->getShipConfirmUrl()
);
}
+
+ /**
+ * @magentoConfigFixture current_store carriers/ups/active 1
+ * @magentoConfigFixture current_store carriers/ups/allowed_methods 1DA,GND
+ * @magentoConfigFixture current_store carriers/ups/free_method GND
+ */
+ public function testCollectFreeRates()
+ {
+ $rateRequest = Bootstrap::getObjectManager()->get(RateRequestFactory::class)->create();
+ $rateRequest->setDestCountryId('US');
+ $rateRequest->setDestRegionId('CA');
+ $rateRequest->setDestPostcode('90001');
+ $rateRequest->setPackageQty(1);
+ $rateRequest->setPackageWeight(1);
+ $rateRequest->setFreeMethodWeight(0);
+ $rateRequest->setLimitCarrier($this->carrier::CODE);
+ $rateRequest->setFreeShipping(true);
+ $rateResult = $this->carrier->collectRates($rateRequest);
+ $result = $rateResult->asArray();
+ $methods = $result[$this->carrier::CODE]['methods'];
+ $this->assertEquals(0, $methods['GND']['price']);
+ $this->assertNotEquals(0, $methods['1DA']['price']);
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php
index 1ebbb35dd7dc4..5593cecb10d91 100644
--- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php
@@ -42,6 +42,9 @@ public function testMatchUrlRewrite(
);
}
+ /**
+ * @return array
+ */
public function requestDataProvider()
{
return [
@@ -69,12 +72,6 @@ public function requestDataProvider()
'request' => '/page-similar/',
'redirect' => '/page-b',
],
- 'Use Case #7: Rewrite during stores switching' => [
- 'request' => '/page-c-on-2nd-store'
- . '?___store=default&___from_store=fixture_second_store',
- 'redirect' => '/page-c-on-1st-store',
- 'expectedCode' => 302
- ],
];
}
}
diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php
new file mode 100644
index 0000000000000..2cb86358667c0
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrlTest.php
@@ -0,0 +1,122 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->storeSwitcher = $this->objectManager->get(StoreSwitcher::class);
+ $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
+ }
+
+ /**
+ * @magentoDataFixture Magento/UrlRewrite/_files/url_rewrite.php
+ * @magentoDataFixture Magento/Catalog/_files/category_product.php
+ * @return void
+ * @throws StoreSwitcher\CannotSwitchStoreException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function testSwitchToNonExistingPage(): void
+ {
+ $fromStoreCode = 'default';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $fromStore = $storeRepository->get($fromStoreCode);
+
+ $toStoreCode = 'fixture_second_store';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $toStore = $storeRepository->get($toStoreCode);
+
+ $this->setBaseUrl($toStore);
+
+ $product = $this->productRepository->get('simple333');
+
+ $redirectUrl = "http://domain.com/{$product->getUrlKey()}.html";
+ $expectedUrl = $toStore->getBaseUrl();
+
+ $this->assertEquals($expectedUrl, $this->storeSwitcher->switch($fromStore, $toStore, $redirectUrl));
+ }
+
+ /**
+ * @magentoDataFixture Magento/UrlRewrite/_files/url_rewrite.php
+ * @return void
+ * @throws StoreSwitcher\CannotSwitchStoreException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function testSwitchToExistingPage(): void
+ {
+ $fromStoreCode = 'default';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $fromStore = $storeRepository->get($fromStoreCode);
+
+ $toStoreCode = 'fixture_second_store';
+ /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */
+ $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class);
+ $toStore = $storeRepository->get($toStoreCode);
+
+ $redirectUrl = $expectedUrl = "http://localhost/page-c";
+
+ $this->assertEquals($expectedUrl, $this->storeSwitcher->switch($fromStore, $toStore, $redirectUrl));
+ }
+
+ /**
+ * Set base url to store.
+ *
+ * @param StoreInterface $targetStore
+ * @return void
+ */
+ private function setBaseUrl(StoreInterface $targetStore): void
+ {
+ $configValue = $this->objectManager->create(Value::class);
+ $configValue->load('web/unsecure/base_url', 'path');
+ $baseUrl = 'http://domain.com/';
+ if (!$configValue->getPath()) {
+ $configValue->setPath('web/unsecure/base_url');
+ }
+ $configValue->setValue($baseUrl);
+ $configValue->setScope(ScopeInterface::SCOPE_STORES);
+ $configValue->setScopeId($targetStore->getId());
+ $configValue->save();
+
+ $reinitibleConfig = $this->objectManager->create(ReinitableConfigInterface::class);
+ $reinitibleConfig->reinit();
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php
new file mode 100644
index 0000000000000..19cce769b1c19
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_rollback.php
@@ -0,0 +1,29 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+
+/** @var \Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection $urlRewriteCollection */
+$urlRewriteCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection::class);
+$collection = $urlRewriteCollection
+ ->addFieldToFilter('entity_type', 'custom')
+ ->addFieldToFilter('request_path', ['page-a', 'page-b', 'page-c'])
+ ->addFieldToFilter('entity_id', '333')
+ ->load()
+ ->walk('delete');
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Widget/Setup/LayoutUpdateConverterTest.php b/dev/tests/integration/testsuite/Magento/Widget/Setup/LayoutUpdateConverterTest.php
index 083876d7eddb3..43c0bd202cc92 100644
--- a/dev/tests/integration/testsuite/Magento/Widget/Setup/LayoutUpdateConverterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Widget/Setup/LayoutUpdateConverterTest.php
@@ -32,7 +32,7 @@ public function testConvert($value, $expected)
public function convertDataProvider()
{
// @codingStandardsIgnoreStart
- $beginning = 'show_pager0products_count10';
+ $beginning = 'show_pager0products_count10';
$serializedWidgetXml = 'conditions_encodeda:3:[i:1;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Combine`;s:10:`aggregator`;s:3:`all`;s:5:`value`;s:1:`1`;s:9:`new_child`;s:0:``;]s:4:`1--1`;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Product`;s:9:`attribute`;s:3:`sku`;s:8:`operator`;s:2:`()`;s:5:`value`;s:15:`simple, simple1`;]s:4:`1--2`;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Product`;s:9:`attribute`;s:5:`price`;s:8:`operator`;s:2:`<=`;s:5:`value`;s:2:`10`;]]';
$jsonEncodedWidgetXml = 'conditions_encoded^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`()`,`value`:`simple, simple1`^],`1--2`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`price`,`operator`:`<=`,`value`:`10`^]^]';
$ending = 'page_var_namepobqks';
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
index 596017be9a33c..6fabc513da9af 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
@@ -27,7 +27,24 @@ define([
})
},
'Magento_Braintree/js/view/payment/adapter': {
+ config: {},
+
+ /** Stub */
+ onReady: function () {},
+
+ /** Stub */
+ setConfig: function (config) {
+ this.config = config;
+ },
+
+ /** Stub */
+ setup: function () {
+ this.config.onReady(this.checkout);
+ },
+
checkout: {
+ /** Stub */
+ teardown: function () {},
paypal: {
/** Stub */
initAuthFlow: function () {}
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/adminhtml/js/use-parent-settings/toggle-disabled-mixin.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/adminhtml/js/use-parent-settings/toggle-disabled-mixin.test.js
new file mode 100644
index 0000000000000..f3e53673a4e59
--- /dev/null
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/adminhtml/js/use-parent-settings/toggle-disabled-mixin.test.js
@@ -0,0 +1,141 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+/*eslint max-nested-callbacks: 0*/
+define([
+ 'underscore',
+ 'Magento_Catalog/js/components/use-parent-settings/select',
+ 'Magento_Catalog/js/components/use-parent-settings/toggle-disabled-mixin'
+], function (_, select, mixin) {
+ 'use strict';
+
+ var CustomInput = mixin(select),
+ defaultProperties = {
+ name: 'uiSelect',
+ dataScope: '',
+ provider: 'provider',
+ service: true
+ },
+ obj;
+
+ describe('toggle-disabled-mixin structure tests', function () {
+ var defaultContext = require.s.contexts._;
+
+ obj = new CustomInput(defaultProperties);
+
+ it('mixin is present in RequireJs config', function () {
+ var requireJsConfig = defaultContext.config
+ .config.mixins['Magento_Catalog/js/components/use-parent-settings/select'];
+
+ expect(
+ requireJsConfig['Magento_Catalog/js/components/use-parent-settings/toggle-disabled-mixin']
+ ).toBe(true);
+ });
+
+ it('Check for useParent property', function () {
+ expect(obj.hasOwnProperty('useParent')).toBeTruthy();
+ expect(typeof obj.useParent).toEqual('boolean');
+ expect(obj.useParent).toEqual(false);
+ });
+
+ it('Check for useDefaults property', function () {
+ expect(obj.hasOwnProperty('useDefaults')).toBeTruthy();
+ expect(typeof obj.useDefaults).toEqual('boolean');
+ expect(obj.useDefaults).toEqual(false);
+ });
+
+ it('Check for toggleDisabled method', function () {
+ expect(obj.toggleDisabled).toBeDefined();
+ expect(typeof obj.toggleDisabled).toEqual('function');
+ });
+
+ it('Check for saveUseDefaults method', function () {
+ expect(obj.saveUseDefaults).toBeDefined();
+ expect(typeof obj.saveUseDefaults).toEqual('function');
+ });
+
+ it('Check for setInitialValue method', function () {
+ expect(obj.setInitialValue).toBeDefined();
+ expect(typeof obj.setInitialValue).toEqual('function');
+ });
+
+ it('Check for toggleUseDefault method', function () {
+ expect(obj.toggleUseDefault).toBeDefined();
+ expect(typeof obj.toggleUseDefault).toEqual('function');
+ });
+ });
+
+ describe('toggle-disabled-mixin functionality', function () {
+ var dataProvider = [
+ {
+ defaults: {
+ useParent: false,
+ useDefaults: false
+ },
+ expected: {
+ disabled: false
+ }
+ },
+ {
+ defaults: {
+ useParent: true,
+ useDefaults: false
+ },
+ expected: {
+ disabled: true
+ }
+ },
+ {
+ defaults: {
+ useParent: false,
+ useDefaults: true
+ },
+ expected: {
+ disabled: true
+ }
+ },
+ {
+ defaults: {
+ useParent: true,
+ useDefaults: true
+ },
+ expected: {
+ disabled: true
+ }
+ }
+ ];
+
+ dataProvider.forEach(function (state) {
+ describe(JSON.stringify(state.defaults), function () {
+
+ beforeEach(function () {
+ obj = new CustomInput(
+ _.extend(defaultProperties, state.defaults)
+ );
+ });
+
+ it('Check disabled state', function () {
+ expect(obj.disabled()).toEqual(state.expected.disabled);
+ });
+
+ it('Check checked state', function () {
+ expect(obj.isUseDefault()).toEqual(state.defaults.useDefaults);
+ });
+
+ it('Check of using parent settings', function () {
+ obj.toggleDisabled(true);
+ expect(obj.isUseDefault()).toEqual(state.defaults.useDefaults);
+ expect(obj.disabled()).toEqual(true);
+ });
+
+ it('Check of using self settings', function () {
+ obj.toggleDisabled(false);
+ expect(obj.isUseDefault()).toEqual(state.defaults.useDefaults);
+ expect(obj.disabled()).toEqual(obj.isUseDefault());
+ });
+ });
+ });
+ });
+});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
index 4ef1aa2a98976..1a3a5726080bc 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js
@@ -12,22 +12,11 @@ define([
var injector = new Squire(),
mocks = {
- 'Magento_Catalog/js/product/storage/ids-storage': {
- name: 'IdsStorage',
- initialize: jasmine.createSpy().and.returnValue({})
- },
'Magento_Catalog/js/product/storage/data-storage': {},
'Magento_Catalog/js/product/storage/ids-storage-compare': {}
},
- obj;
-
- beforeEach(function (done) {
- injector.mock(mocks);
- injector.require(['Magento_Catalog/js/product/storage/storage-service'], function (insance) {
- obj = insance;
- done();
- });
- });
+ obj,
+ utils;
afterEach(function () {
try {
@@ -43,6 +32,19 @@ define([
},
storage;
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require([
+ 'Magento_Catalog/js/product/storage/ids-storage',
+ 'Magento_Catalog/js/product/storage/storage-service',
+ 'mageUtils'
+ ], function (IdsStorage, instance, mageUtils) {
+ obj = instance;
+ utils = mageUtils;
+ done();
+ });
+ });
+
describe('"createStorage" method', function () {
it('create new storage', function () {
obj.processSubscribers = jasmine.createSpy();
@@ -73,5 +75,54 @@ define([
expect(typeof obj.getStorage(config.namespace)).toBe('object');
});
});
+ describe('"add" method', function () {
+ var storageValue;
+
+ beforeEach(function () {
+ storage = new obj.createStorage(config);
+ storageValue = {
+ 'property1': 1
+ };
+
+ storage.set(storageValue);
+ });
+
+ it('method exists', function () {
+ expect(storage.add).toBeDefined();
+ expect(typeof storage.add).toEqual('function');
+ });
+
+ it('update value', function () {
+ spyOn(utils, 'copy').and.callThrough();
+ expect(storage.get()).toEqual(storageValue);
+
+ storageValue = {
+ 'property2': 2
+ };
+
+ storage.add(storageValue);
+
+ expect(utils.copy).toHaveBeenCalled();
+ expect(storage.get()).toEqual(
+ {
+ 'property1': 1,
+ 'property2': 2
+ }
+ );
+ });
+
+ it('add empty value', function () {
+ spyOn(utils, 'copy').and.callThrough();
+
+ storage.add({});
+
+ expect(utils.copy).not.toHaveBeenCalled();
+ expect(storage.get()).toEqual(
+ {
+ 'property1': 1
+ }
+ );
+ });
+ });
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js
index 47518bef19e56..184118f1d02ec 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js
@@ -113,6 +113,8 @@ define([
});
it('estimateTotals if data wasn\'t cached and request was successfully sent', function () {
+ var deferral = new $.Deferred();
+
spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'isChanged').and.returnValue(true);
spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue(
ko.observable({
@@ -124,9 +126,9 @@ define([
data.shippingMethodCode = mocks['Magento_Checkout/js/model/quote'].shippingMethod()['method_code'];
data.shippingCarrierCode = mocks['Magento_Checkout/js/model/quote'].shippingMethod()['carrier_code'];
- return new $.Deferred().resolve(result);
+ return deferral.resolve(result);
});
- expect(defaultProcessor.estimateTotals(address)).toBeUndefined();
+ expect(defaultProcessor.estimateTotals(address)).toBe(deferral);
expect(mocks['Magento_Checkout/js/model/quote'].setTotals).toHaveBeenCalledWith(totals);
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true);
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false);
@@ -136,6 +138,8 @@ define([
});
it('estimateTotals if data wasn\'t cached and request returns error', function () {
+ var deferral = new $.Deferred();
+
spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'isChanged').and.returnValue(true);
spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue(
ko.observable({
@@ -144,9 +148,9 @@ define([
);
spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'get');
spyOn(mocks['mage/storage'], 'post').and.callFake(function () {
- return new $.Deferred().reject('Error Message');
+ return deferral.reject('Error Message');
});
- expect(defaultProcessor.estimateTotals(address)).toBeUndefined();
+ expect(defaultProcessor.estimateTotals(address)).toBe(deferral);
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true);
expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false);
expect(mocks['mage/storage'].post).toHaveBeenCalled();
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js
new file mode 100644
index 0000000000000..8b4fae5a69461
--- /dev/null
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js
@@ -0,0 +1,109 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+/* eslint-disable max-nested-callbacks */
+/*jscs:disable jsDoc*/
+
+define([
+ 'squire',
+ 'jquery',
+ 'ko'
+], function (Squire, $, ko) {
+ 'use strict';
+
+ describe('Magento_Checkout/js/sidebar', function () {
+ var injector = new Squire(),
+ mocks = {
+ 'Magento_Customer/js/customer-data': {
+ get: function () {
+ return ko.observable();
+ }
+ }
+ },
+ sidebar,
+ cartData = {
+ 'items': [
+ {
+ 'item_id': 1,
+ 'product_sku': 'bundle'
+ },
+ {
+ 'item_id': 5,
+ 'product_sku': 'simple'
+ },
+ {
+ 'item_id': 7,
+ 'product_sku': 'configurable'
+ }
+ ]
+ },
+ cart = ko.observable(cartData);
+
+ beforeEach(function (done) {
+ injector.mock(mocks);
+ injector.require(['Magento_Checkout/js/sidebar'], function (Constr) {
+ sidebar = new Constr;
+ done();
+ });
+ });
+
+ describe('Check remove mini-cart item callback.', function () {
+ beforeEach(function () {
+ spyOn(jQuery.fn, 'trigger');
+ spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue(cart);
+ });
+
+ it('Method "_removeItemAfter" is defined', function () {
+ expect(sidebar._removeItemAfter).toBeDefined();
+ });
+
+ it('Cart item is exists', function () {
+ var elem = $('').data('cart-item', 5);
+
+ sidebar._removeItemAfter(elem);
+ expect(mocks['Magento_Customer/js/customer-data'].get).toHaveBeenCalledWith('cart');
+ expect(jQuery('body').trigger).toHaveBeenCalledWith('ajax:removeFromCart', 'simple');
+ });
+
+ it('Cart item doesn\'t exists', function () {
+ var elem = $('').data('cart-item', 100);
+
+ sidebar._removeItemAfter(elem);
+ expect(jQuery('body').trigger).not.toHaveBeenCalled();
+ });
+ });
+
+ describe('Check update item quantity callback.', function () {
+ beforeEach(function () {
+ spyOn(jQuery.fn, 'trigger');
+ spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue(cart);
+ });
+
+ it('Method "_updateItemQtyAfter" is defined', function () {
+ expect(sidebar._updateItemQtyAfter).toBeDefined();
+ });
+
+ it('Cart item is exists', function () {
+ var elem = $('').data('cart-item', 5);
+
+ spyOn(sidebar, '_hideItemButton');
+
+ sidebar._updateItemQtyAfter(elem);
+ expect(mocks['Magento_Customer/js/customer-data'].get).toHaveBeenCalledWith('cart');
+ expect(jQuery('body').trigger).toHaveBeenCalledWith('ajax:updateCartItemQty', 'simple');
+ expect(sidebar._hideItemButton).toHaveBeenCalledWith(elem);
+ });
+
+ it('Cart item doesn\'t exists', function () {
+ var elem = $('').data('cart-item', 100);
+
+ spyOn(sidebar, '_hideItemButton');
+
+ sidebar._updateItemQtyAfter(elem);
+ expect(jQuery('body').trigger).not.toHaveBeenCalled();
+ expect(sidebar._hideItemButton).toHaveBeenCalledWith(elem);
+ });
+ });
+ });
+});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
index c5b153f7cc100..390c5aa89fcc7 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/abstract.test.js
@@ -303,5 +303,11 @@ define([
expect(model.validate).toHaveBeenCalled();
});
});
+ describe('serviceDisabled property', function () {
+ it('check property state', function () {
+ expect(typeof model.serviceDisabled).toEqual('function');
+ expect(model.serviceDisabled()).toBeFalsy();
+ });
+ });
});
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
index 0f50cc2b6b9b1..201959a2598fd 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/i18n.test.js
@@ -38,14 +38,18 @@ define([
/** Stub */
turnOffInlineTranslation = function () {
manageInlineTranslation(false);
- };
+ },
+
+ storedConfig;
beforeEach(function () {
+ storedConfig = context.config.config;
$(document.body).append(elWithStaticText);
$(document.body).append(elWithVariable);
});
afterEach(function () {
+ context.config.config = storedConfig;
elWithStaticText.remove();
elWithVariable.remove();
});
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/validation/rules.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/validation/rules.test.js
index 1dfdfca8b2f50..0703374aaa9d6 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/validation/rules.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/validation/rules.test.js
@@ -39,6 +39,37 @@ define([
expect(rules['range-words'].handler(value, params)).toBe(true);
});
});
+ describe('"validate-number" method', function () {
+ it('Check on empty value', function () {
+ var value = '';
+
+ expect(rules['validate-number'].handler(value)).toBe(true);
+ });
+
+ it('Check on integer', function () {
+ var value = '125';
+
+ expect(rules['validate-number'].handler(value)).toBe(true);
+ });
+
+ it('Check on float', function () {
+ var value = '1000.50';
+
+ expect(rules['validate-number'].handler(value)).toBe(true);
+ });
+
+ it('Check on formatted float', function () {
+ var value = '1,000,000.50';
+
+ expect(rules['validate-number'].handler(value)).toBe(true);
+ });
+
+ it('Check on not a number', function () {
+ var value = 'string';
+
+ expect(rules['validate-number'].handler(value)).toBe(false);
+ });
+ });
});
describe('validate-color', function () {
diff --git a/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php
new file mode 100644
index 0000000000000..879334d8c553b
--- /dev/null
+++ b/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php
@@ -0,0 +1,587 @@
+validTokensBeforeClosingCommentTag);
+ }
+
+ /**
+ * Validates whether comment block exists
+ *
+ * @param File $phpcsFile
+ * @param int $previousCommentClosePtr
+ * @param int $stackPtr
+ * @return bool
+ */
+ private function validateCommentBlockExists(File $phpcsFile, int $previousCommentClosePtr, int $stackPtr) : bool
+ {
+ $tokens = $phpcsFile->getTokens();
+ for ($tempPtr = $previousCommentClosePtr + 1; $tempPtr < $stackPtr; $tempPtr++) {
+ if (!$this->isTokenBeforeClosingCommentTagValid($tokens[$tempPtr]['type'])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Checks whether the parameter type is invalid
+ *
+ * @param string $type
+ * @return bool
+ */
+ private function isInvalidType(string $type) : bool
+ {
+ return in_array(strtolower($type), $this->invalidTypes);
+ }
+
+ /**
+ * Get arguments from method signature
+ *
+ * @param File $phpcsFile
+ * @param int $openParenthesisPtr
+ * @param int $closedParenthesisPtr
+ * @return array
+ */
+ private function getMethodArguments(File $phpcsFile, int $openParenthesisPtr, int $closedParenthesisPtr) : array
+ {
+ $tokens = $phpcsFile->getTokens();
+ $methodArguments = [];
+ for ($i = $openParenthesisPtr; $i < $closedParenthesisPtr; $i++) {
+ $argumentsPtr = $phpcsFile->findNext(T_VARIABLE, $i + 1, $closedParenthesisPtr);
+ if ($argumentsPtr === false) {
+ break;
+ } elseif ($argumentsPtr < $closedParenthesisPtr) {
+ $arguments = $tokens[$argumentsPtr]['content'];
+ $methodArguments[] = $arguments;
+ $i = $argumentsPtr - 1;
+ }
+ }
+ return $methodArguments;
+ }
+
+ /**
+ * Get parameters from method annotation
+ *
+ * @param array $paramDefinitions
+ * @return array
+ */
+ private function getMethodParameters(array $paramDefinitions) : array
+ {
+ $paramName = [];
+ for ($i = 0; $i < count($paramDefinitions); $i++) {
+ if (isset($paramDefinitions[$i]['paramName'])) {
+ $paramName[] = $paramDefinitions[$i]['paramName'];
+ }
+ }
+ return $paramName;
+ }
+
+ /**
+ * Validates whether @inheritdoc without braces [@inheritdoc] exists or not
+ *
+ * @param File $phpcsFile
+ * @param int $previousCommentOpenPtr
+ * @param int $previousCommentClosePtr
+ */
+ private function validateInheritdocAnnotationWithoutBracesExists(
+ File $phpcsFile,
+ int $previousCommentOpenPtr,
+ int $previousCommentClosePtr
+ ) : bool {
+ return $this->validateInheritdocAnnotationExists(
+ $phpcsFile,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr,
+ '@inheritdoc'
+ );
+ }
+
+ /**
+ * Validates whether @inheritdoc with braces [{@inheritdoc}] exists or not
+ *
+ * @param File $phpcsFile
+ * @param int $previousCommentOpenPtr
+ * @param int $previousCommentClosePtr
+ */
+ private function validateInheritdocAnnotationWithBracesExists(
+ File $phpcsFile,
+ int $previousCommentOpenPtr,
+ int $previousCommentClosePtr
+ ) : bool {
+ return $this->validateInheritdocAnnotationExists(
+ $phpcsFile,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr,
+ '{@inheritdoc}'
+ );
+ }
+
+ /**
+ * Validates inheritdoc annotation exists
+ *
+ * @param File $phpcsFile
+ * @param int $previousCommentOpenPtr
+ * @param int $previousCommentClosePtr
+ * @param string $inheritdocAnnotation
+ * @return bool
+ */
+ private function validateInheritdocAnnotationExists(
+ File $phpcsFile,
+ int $previousCommentOpenPtr,
+ int $previousCommentClosePtr,
+ string $inheritdocAnnotation
+ ) : bool {
+ $tokens = $phpcsFile->getTokens();
+ for ($ptr = $previousCommentOpenPtr; $ptr < $previousCommentClosePtr; $ptr++) {
+ if (strtolower($tokens[$ptr]['content']) === $inheritdocAnnotation) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Validates if annotation exists for parameter in method annotation
+ *
+ * @param File $phpcsFile
+ * @param int $argumentsCount
+ * @param int $parametersCount
+ * @param int $previousCommentOpenPtr
+ * @param int $previousCommentClosePtr
+ * @param int $stackPtr
+ */
+ private function validateParameterAnnotationForArgumentExists(
+ File $phpcsFile,
+ int $argumentsCount,
+ int $parametersCount,
+ int $previousCommentOpenPtr,
+ int $previousCommentClosePtr,
+ int $stackPtr
+ ) : void {
+ if ($argumentsCount > 0 && $parametersCount === 0) {
+ $inheritdocAnnotationWithoutBracesExists = $this->validateInheritdocAnnotationWithoutBracesExists(
+ $phpcsFile,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr
+ );
+ $inheritdocAnnotationWithBracesExists = $this->validateInheritdocAnnotationWithBracesExists(
+ $phpcsFile,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr
+ );
+ if ($inheritdocAnnotationWithBracesExists) {
+ $phpcsFile->addFixableError(
+ '{@inheritdoc} does not import parameter annotation',
+ $stackPtr,
+ 'MethodArguments'
+ );
+ } elseif ($this->validateCommentBlockExists($phpcsFile, $previousCommentClosePtr, $stackPtr)
+ && !$inheritdocAnnotationWithoutBracesExists
+ ) {
+ $phpcsFile->addFixableError(
+ 'Missing @param for argument in method annotation',
+ $stackPtr,
+ 'MethodArguments'
+ );
+ }
+ }
+ }
+
+ /**
+ * Validates whether comment block have extra the parameters listed in method annotation
+ *
+ * @param File $phpcsFile
+ * @param int $argumentsCount
+ * @param int $parametersCount
+ * @param int $stackPtr
+ */
+ private function validateCommentBlockDoesnotHaveExtraParameterAnnotation(
+ File $phpcsFile,
+ int $argumentsCount,
+ int $parametersCount,
+ int $stackPtr
+ ) : void {
+ if ($argumentsCount < $parametersCount && $argumentsCount > 0) {
+ $phpcsFile->addFixableError(
+ 'Extra @param found in method annotation',
+ $stackPtr,
+ 'MethodArguments'
+ );
+ } elseif ($argumentsCount > 0 && $argumentsCount != $parametersCount && $parametersCount != 0) {
+ $phpcsFile->addFixableError(
+ '@param is not found for one or more params in method annotation',
+ $stackPtr,
+ 'MethodArguments'
+ );
+ }
+ }
+
+ /**
+ * Validates whether the argument name exists in method parameter annotation
+ *
+ * @param int $stackPtr
+ * @param int $ptr
+ * @param File $phpcsFile
+ * @param array $methodArguments
+ * @param array $paramDefinitions
+ */
+ private function validateArgumentNameInParameterAnnotationExists(
+ int $stackPtr,
+ int $ptr,
+ File $phpcsFile,
+ array $methodArguments,
+ array $paramDefinitions
+ ) : void {
+ $parameterNames = $this->getMethodParameters($paramDefinitions);
+ if (!in_array($methodArguments[$ptr], $parameterNames)) {
+ $error = $methodArguments[$ptr]. ' parameter is missing in method annotation';
+ $phpcsFile->addFixableError($error, $stackPtr, 'MethodArguments');
+ }
+ }
+
+ /**
+ * Validates whether parameter present in method signature
+ *
+ * @param int $ptr
+ * @param int $paramDefinitionsArguments
+ * @param array $methodArguments
+ * @param File $phpcsFile
+ * @param array $paramPointers
+ */
+ private function validateParameterPresentInMethodSignature(
+ int $ptr,
+ string $paramDefinitionsArguments,
+ array $methodArguments,
+ File $phpcsFile,
+ array $paramPointers
+ ) : void {
+ if (!in_array($paramDefinitionsArguments, $methodArguments)) {
+ $phpcsFile->addFixableError(
+ $paramDefinitionsArguments . ' parameter is missing in method arguments signature',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ }
+ }
+
+ /**
+ * Validates whether the parameters are in order or not in method annotation
+ *
+ * @param array $paramDefinitions
+ * @param array $methodArguments
+ * @param File $phpcsFile
+ * @param array $paramPointers
+ */
+ private function validateParameterOrderIsCorrect(
+ array $paramDefinitions,
+ array $methodArguments,
+ File $phpcsFile,
+ array $paramPointers
+ ) : void {
+ $parameterNames = $this->getMethodParameters($paramDefinitions);
+ $paramDefinitionsCount = count($paramDefinitions);
+ for ($ptr = 0; $ptr < $paramDefinitionsCount; $ptr++) {
+ if (isset($methodArguments[$ptr]) && isset($parameterNames[$ptr])
+ && in_array($methodArguments[$ptr], $parameterNames)
+ ) {
+ if ($methodArguments[$ptr] != $parameterNames[$ptr]) {
+ $phpcsFile->addFixableError(
+ $methodArguments[$ptr].' parameter is not in order',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * Validate whether duplicate annotation present in method annotation
+ *
+ * @param int $stackPtr
+ * @param array $paramDefinitions
+ * @param array $paramPointers
+ * @param File $phpcsFile
+ * @param array $methodArguments
+ */
+ private function validateDuplicateAnnotationDoesnotExists(
+ int $stackPtr,
+ array $paramDefinitions,
+ array $paramPointers,
+ File $phpcsFile,
+ array $methodArguments
+ ) : void {
+ $argumentsCount = count($methodArguments);
+ $parametersCount = count($paramPointers);
+ if ($argumentsCount <= $parametersCount && $argumentsCount > 0) {
+ $duplicateParameters = [];
+ for ($i = 0; $i < sizeof($paramDefinitions); $i++) {
+ if (isset($paramDefinitions[$i]['paramName'])) {
+ $parameterContent = $paramDefinitions[$i]['paramName'];
+ for ($j = $i + 1; $j < count($paramDefinitions); $j++) {
+ if (isset($paramDefinitions[$j]['paramName'])
+ && $parameterContent === $paramDefinitions[$j]['paramName']
+ ) {
+ $duplicateParameters[] = $parameterContent;
+ }
+ }
+ }
+ }
+ foreach ($duplicateParameters as $value) {
+ $phpcsFile->addFixableError(
+ $value . ' duplicate found in method annotation',
+ $stackPtr,
+ 'MethodArguments'
+ );
+ }
+ }
+ }
+
+ /**
+ * Validate parameter annotation format is correct or not
+ *
+ * @param int $ptr
+ * @param File $phpcsFile
+ * @param array $methodArguments
+ * @param array $paramDefinitions
+ * @param array $paramPointers
+ */
+ private function validateParameterAnnotationFormatIsCorrect(
+ int $ptr,
+ File $phpcsFile,
+ array $methodArguments,
+ array $paramDefinitions,
+ array $paramPointers
+ ) : void {
+ switch (count($paramDefinitions)) {
+ case 0:
+ $phpcsFile->addFixableError(
+ 'Missing both type and parameter',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ break;
+ case 1:
+ if (preg_match('/^\$.*/', $paramDefinitions[0])) {
+ $phpcsFile->addError(
+ 'Type is not specified',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ }
+ break;
+ case 2:
+ if ($this->isInvalidType($paramDefinitions[0])) {
+ $phpcsFile->addFixableError(
+ $paramDefinitions[0].' is not a valid PHP type',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ }
+ $this->validateParameterPresentInMethodSignature(
+ $ptr,
+ ltrim($paramDefinitions[1], '&'),
+ $methodArguments,
+ $phpcsFile,
+ $paramPointers
+ );
+ break;
+ default:
+ if (preg_match('/^\$.*/', $paramDefinitions[0])) {
+ $phpcsFile->addError(
+ 'Type is not specified',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ if ($this->isInvalidType($paramDefinitions[0])) {
+ $phpcsFile->addFixableError(
+ $paramDefinitions[0].' is not a valid PHP type',
+ $paramPointers[$ptr],
+ 'MethodArguments'
+ );
+ }
+ }
+ break;
+ }
+ }
+
+ /**
+ * Validate method parameter annotations
+ *
+ * @param int $stackPtr
+ * @param array $paramDefinitions
+ * @param array $paramPointers
+ * @param File $phpcsFile
+ * @param array $methodArguments
+ * @param int $previousCommentOpenPtr
+ * @param int $previousCommentClosePtr
+ */
+ private function validateMethodParameterAnnotations(
+ int $stackPtr,
+ array $paramDefinitions,
+ array $paramPointers,
+ File $phpcsFile,
+ array $methodArguments,
+ int $previousCommentOpenPtr,
+ int $previousCommentClosePtr
+ ) : void {
+ $argumentCount = count($methodArguments);
+ $paramCount = count($paramPointers);
+ $this->validateParameterAnnotationForArgumentExists(
+ $phpcsFile,
+ $argumentCount,
+ $paramCount,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr,
+ $stackPtr
+ );
+ $this->validateCommentBlockDoesnotHaveExtraParameterAnnotation(
+ $phpcsFile,
+ $argumentCount,
+ $paramCount,
+ $stackPtr
+ );
+ $this->validateDuplicateAnnotationDoesnotExists(
+ $stackPtr,
+ $paramDefinitions,
+ $paramPointers,
+ $phpcsFile,
+ $methodArguments
+ );
+ $this->validateParameterOrderIsCorrect(
+ $paramDefinitions,
+ $methodArguments,
+ $phpcsFile,
+ $paramPointers
+ );
+ for ($ptr = 0; $ptr < count($methodArguments); $ptr++) {
+ $tokens = $phpcsFile->getTokens();
+ if (isset($paramPointers[$ptr])) {
+ $this->validateArgumentNameInParameterAnnotationExists(
+ $stackPtr,
+ $ptr,
+ $phpcsFile,
+ $methodArguments,
+ $paramDefinitions
+ );
+ $paramContent = $tokens[$paramPointers[$ptr]+2]['content'];
+ $paramContentExplode = explode(' ', $paramContent);
+ $this->validateParameterAnnotationFormatIsCorrect(
+ $ptr,
+ $phpcsFile,
+ $methodArguments,
+ $paramContentExplode,
+ $paramPointers
+ );
+ }
+ }
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function process(File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+ $numTokens = count($tokens);
+ $previousCommentOpenPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr-1, 0);
+ $previousCommentClosePtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPtr-1, 0);
+ if (!$this->validateCommentBlockExists($phpcsFile, $previousCommentClosePtr, $stackPtr)) {
+ $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments');
+ return;
+ }
+ $openParenthesisPtr = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr+1, $numTokens);
+ $closedParenthesisPtr = $phpcsFile->findNext(T_CLOSE_PARENTHESIS, $stackPtr+1, $numTokens);
+ $methodArguments = $this->getMethodArguments($phpcsFile, $openParenthesisPtr, $closedParenthesisPtr);
+ $paramPointers = $paramDefinitions = [];
+ for ($tempPtr = $previousCommentOpenPtr; $tempPtr < $previousCommentClosePtr; $tempPtr++) {
+ if (strtolower($tokens[$tempPtr]['content']) === '@param') {
+ $paramPointers[] = $tempPtr;
+ $paramAnnotationParts = explode(' ', $tokens[$tempPtr+2]['content']);
+ if (count($paramAnnotationParts) === 1) {
+ if ((preg_match('/^\$.*/', $paramAnnotationParts[0]))) {
+ $paramDefinitions[] = [
+ 'type' => null,
+ 'paramName' => rtrim(ltrim($tokens[$tempPtr+2]['content'], '&'), ',')
+ ];
+ } else {
+ $paramDefinitions[] = [
+ 'type' => $tokens[$tempPtr+2]['content'],
+ 'paramName' => null
+ ];
+ }
+ } else {
+ $paramDefinitions[] = [
+ 'type' => $paramAnnotationParts[0],
+ 'paramName' => rtrim(ltrim($paramAnnotationParts[1], '&'), ',')
+ ];
+ }
+ }
+ }
+ $this->validateMethodParameterAnnotations(
+ $stackPtr,
+ $paramDefinitions,
+ $paramPointers,
+ $phpcsFile,
+ $methodArguments,
+ $previousCommentOpenPtr,
+ $previousCommentClosePtr
+ );
+ }
+}
diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml
index 14d05b466b407..f3e4893ba752f 100644
--- a/dev/tests/static/framework/Magento/ruleset.xml
+++ b/dev/tests/static/framework/Magento/ruleset.xml
@@ -22,6 +22,10 @@
*/_files/*
+
+
+ *
+
*/(app/code|vendor|setup/src|lib/internal/Magento)/*
*/lib/internal/Magento/Framework/Image/Adapter/Gd2.php
diff --git a/dev/tests/static/phpunit-all.xml.dist b/dev/tests/static/phpunit-all.xml.dist
index a0d1f2fe75dc9..3020889e6066b 100644
--- a/dev/tests/static/phpunit-all.xml.dist
+++ b/dev/tests/static/phpunit-all.xml.dist
@@ -21,6 +21,6 @@
-
+
diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist
index d9f9dbdfe54cd..ec581ec992f00 100644
--- a/dev/tests/static/phpunit.xml.dist
+++ b/dev/tests/static/phpunit.xml.dist
@@ -31,7 +31,7 @@
-
+
diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php
index 187cb9087013e..f204019988b79 100644
--- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php
@@ -232,7 +232,7 @@ private function isItTest($relativeFilePath)
*/
private function getControllerPath($relativeFilePath)
{
- if (preg_match('~(Magento\/.*Controller\/Adminhtml\/.*)\.php~', $relativeFilePath, $matches)) {
+ if (preg_match('~(Magento\/[^\/]+\/Controller\/Adminhtml\/.*)\.php~', $relativeFilePath, $matches)) {
if (count($matches) === 2) {
$partPath = $matches[1];
return $partPath;
diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
index fa62179ed34f5..21ca0a495dd19 100644
--- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
@@ -256,10 +256,16 @@ private function getFullWhitelist()
}
}
+ /**
+ * Test code quality using phpcs
+ */
public function testCodeStyle()
{
$isFullScan = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1';
$reportFile = self::$reportDir . '/phpcs_report.txt';
+ if (!file_exists($reportFile)) {
+ touch($reportFile);
+ }
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
$result = $codeSniffer->run($isFullScan ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']));
$report = file_get_contents($reportFile);
@@ -270,6 +276,9 @@ public function testCodeStyle()
);
}
+ /**
+ * Test code quality using phpmd
+ */
public function testCodeMess()
{
$reportFile = self::$reportDir . '/phpmd_report.txt';
@@ -298,6 +307,9 @@ public function testCodeMess()
}
}
+ /**
+ * Test code quality using phpcpd
+ */
public function testCopyPaste()
{
$reportFile = self::$reportDir . '/phpcpd_report.xml';
diff --git a/dev/tools/grunt/configs/autoprefixer.json b/dev/tools/grunt/configs/autoprefixer.json
index 78283d030919f..28cd9c8a1255f 100644
--- a/dev/tools/grunt/configs/autoprefixer.json
+++ b/dev/tools/grunt/configs/autoprefixer.json
@@ -2,7 +2,7 @@
"options": {
"browsers": [
"last 2 versions",
- "ie 9"
+ "ie 11"
]
},
"setup": {
diff --git a/dev/travis/before_script.sh b/dev/travis/before_script.sh
index f2ba20dc412b6..1dccc310c7a20 100755
--- a/dev/travis/before_script.sh
+++ b/dev/travis/before_script.sh
@@ -129,6 +129,7 @@ case $TEST_SUITE in
sed -e "s?basic?travis_acceptance?g" --in-place ./phpunit.xml
cp ./.htaccess.sample ./.htaccess
cd ./utils
+ php -f generate/moduleSequence.php
php -f mtf troubleshooting:check-all
cd ../../..
diff --git a/lib/internal/Magento/Framework/Api/AbstractExtensibleObject.php b/lib/internal/Magento/Framework/Api/AbstractExtensibleObject.php
index 7b2b94cbd0973..97c24167d47e1 100644
--- a/lib/internal/Magento/Framework/Api/AbstractExtensibleObject.php
+++ b/lib/internal/Magento/Framework/Api/AbstractExtensibleObject.php
@@ -76,7 +76,7 @@ public function getCustomAttribute($attributeCode)
*/
public function getCustomAttributes()
{
- return isset($this->_data[self::CUSTOM_ATTRIBUTES]) ? $this->_data[self::CUSTOM_ATTRIBUTES] : [];
+ return $this->_data[self::CUSTOM_ATTRIBUTES] ?? [];
}
/**
@@ -131,7 +131,7 @@ public function setCustomAttribute($attributeCode, $attributeValue)
*/
protected function getCustomAttributesCodes()
{
- return isset($this->customAttributesCodes) ? $this->customAttributesCodes : [];
+ return $this->customAttributesCodes ?? [];
}
/**
diff --git a/lib/internal/Magento/Framework/Api/AbstractSimpleObject.php b/lib/internal/Magento/Framework/Api/AbstractSimpleObject.php
index b907246139d42..9cc0ddab3bfcb 100644
--- a/lib/internal/Magento/Framework/Api/AbstractSimpleObject.php
+++ b/lib/internal/Magento/Framework/Api/AbstractSimpleObject.php
@@ -34,7 +34,7 @@ public function __construct(array $data = [])
*/
protected function _get($key)
{
- return isset($this->_data[$key]) ? $this->_data[$key] : null;
+ return $this->_data[$key] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Api/CombinedFilterGroup.php b/lib/internal/Magento/Framework/Api/CombinedFilterGroup.php
index 21d95b72fed1c..190085ddcae00 100644
--- a/lib/internal/Magento/Framework/Api/CombinedFilterGroup.php
+++ b/lib/internal/Magento/Framework/Api/CombinedFilterGroup.php
@@ -7,8 +7,6 @@
namespace Magento\Framework\Api;
-use Magento\Framework\Api\AbstractSimpleObject;
-use Magento\Framework\DB\Select;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Phrase;
diff --git a/lib/internal/Magento/Framework/Api/ImageProcessor.php b/lib/internal/Magento/Framework/Api/ImageProcessor.php
index beadb51bc7796..83390b3853212 100644
--- a/lib/internal/Magento/Framework/Api/ImageProcessor.php
+++ b/lib/internal/Magento/Framework/Api/ImageProcessor.php
@@ -172,7 +172,7 @@ public function processImageContent($entityType, $imageContent)
*/
protected function getMimeTypeExtension($mimeType)
{
- return isset($this->mimeTypeExtensionMap[$mimeType]) ? $this->mimeTypeExtensionMap[$mimeType] : '';
+ return $this->mimeTypeExtensionMap[$mimeType] ?? '';
}
/**
diff --git a/lib/internal/Magento/Framework/Api/Search/Document.php b/lib/internal/Magento/Framework/Api/Search/Document.php
index d60458a6e5585..7454fa7974ece 100644
--- a/lib/internal/Magento/Framework/Api/Search/Document.php
+++ b/lib/internal/Magento/Framework/Api/Search/Document.php
@@ -33,9 +33,7 @@ public function setId($id)
*/
public function getCustomAttribute($attributeCode)
{
- return isset($this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode])
- ? $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]
- : null;
+ return $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php
index c9f10c183b50c..024a4d2af3847 100644
--- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php
+++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php
@@ -123,6 +123,6 @@ private function getCustomFilterForField($field)
*/
private function getFieldMapping($field)
{
- return isset($this->fieldMapping[$field]) ? $this->fieldMapping[$field] : $field;
+ return $this->fieldMapping[$field] ?? $field;
}
}
diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php
index b8e52334bee1f..207325042c737 100644
--- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php
+++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php
@@ -121,6 +121,6 @@ private function getCustomJoin($field)
*/
private function getFieldMapping($field)
{
- return isset($this->fieldMapping[$field]) ? $this->fieldMapping[$field] : $field;
+ return $this->fieldMapping[$field] ?? $field;
}
}
diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/SortingProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/SortingProcessor.php
index 85a6d6f570d5e..9dda5cd682708 100644
--- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/SortingProcessor.php
+++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/SortingProcessor.php
@@ -59,7 +59,7 @@ public function process(SearchCriteriaInterface $searchCriteria, AbstractDb $col
*/
private function getFieldMapping($field)
{
- return isset($this->fieldMapping[$field]) ? $this->fieldMapping[$field] : $field;
+ return $this->fieldMapping[$field] ?? $field;
}
/**
diff --git a/lib/internal/Magento/Framework/App/ActionFlag.php b/lib/internal/Magento/Framework/App/ActionFlag.php
index 657c2ede9262d..55201504c968f 100644
--- a/lib/internal/Magento/Framework/App/ActionFlag.php
+++ b/lib/internal/Magento/Framework/App/ActionFlag.php
@@ -65,9 +65,7 @@ public function get($action, $flag = '')
$action = $this->_request->getActionName();
}
if ('' === $flag) {
- return isset(
- $this->_flags[$this->_getControllerKey()]
- ) ? $this->_flags[$this->_getControllerKey()] : [];
+ return $this->_flags[$this->_getControllerKey()] ?? [];
} elseif (isset($this->_flags[$this->_getControllerKey()][$action][$flag])) {
return $this->_flags[$this->_getControllerKey()][$action][$flag];
} else {
diff --git a/lib/internal/Magento/Framework/App/AreaList.php b/lib/internal/Magento/Framework/App/AreaList.php
index 7c123f7ff9d60..fb28d09d5fe09 100644
--- a/lib/internal/Magento/Framework/App/AreaList.php
+++ b/lib/internal/Magento/Framework/App/AreaList.php
@@ -88,7 +88,7 @@ public function getCodeByFrontName($frontName)
*/
public function getFrontName($areaCode)
{
- return isset($this->_areas[$areaCode]['frontName']) ? $this->_areas[$areaCode]['frontName'] : null;
+ return $this->_areas[$areaCode]['frontName'] ?? null;
}
/**
@@ -111,7 +111,7 @@ public function getCodes()
*/
public function getDefaultRouter($areaCode)
{
- return isset($this->_areas[$areaCode]['router']) ? $this->_areas[$areaCode]['router'] : null;
+ return $this->_areas[$areaCode]['router'] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php
index f2bc4eceb507d..f84dd304643da 100644
--- a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php
+++ b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php
@@ -10,9 +10,7 @@
namespace Magento\Framework\App\Cache\Frontend;
use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Filesystem;
-use Magento\Framework\Filesystem\DriverInterface;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
diff --git a/lib/internal/Magento/Framework/App/Config/Initial.php b/lib/internal/Magento/Framework/App/Config/Initial.php
index 1933682346ad3..b65c9a2f53489 100644
--- a/lib/internal/Magento/Framework/App/Config/Initial.php
+++ b/lib/internal/Magento/Framework/App/Config/Initial.php
@@ -72,9 +72,9 @@ public function getData($scope)
list($scopeType, $scopeCode) = array_pad(explode('|', $scope), 2, null);
if (ScopeConfigInterface::SCOPE_TYPE_DEFAULT == $scopeType) {
- return isset($this->_data[$scopeType]) ? $this->_data[$scopeType] : [];
+ return $this->_data[$scopeType] ?? [];
} elseif ($scopeCode) {
- return isset($this->_data[$scopeType][$scopeCode]) ? $this->_data[$scopeType][$scopeCode] : [];
+ return $this->_data[$scopeType][$scopeCode] ?? [];
}
return [];
}
diff --git a/lib/internal/Magento/Framework/App/DefaultPath/DefaultPath.php b/lib/internal/Magento/Framework/App/DefaultPath/DefaultPath.php
index 61d0aa138f9a4..8a4188aed9605 100644
--- a/lib/internal/Magento/Framework/App/DefaultPath/DefaultPath.php
+++ b/lib/internal/Magento/Framework/App/DefaultPath/DefaultPath.php
@@ -32,6 +32,6 @@ public function __construct(array $parts)
*/
public function getPart($code)
{
- return isset($this->_parts[$code]) ? $this->_parts[$code] : null;
+ return $this->_parts[$code] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig.php b/lib/internal/Magento/Framework/App/DeploymentConfig.php
index 0fe7703ef81c0..f83f89ee4caeb 100644
--- a/lib/internal/Magento/Framework/App/DeploymentConfig.php
+++ b/lib/internal/Magento/Framework/App/DeploymentConfig.php
@@ -70,7 +70,7 @@ public function get($key = null, $defaultValue = null)
if ($key === null) {
return $this->flatData;
}
- return isset($this->flatData[$key]) ? $this->flatData[$key] : $defaultValue;
+ return $this->flatData[$key] ?? $defaultValue;
}
/**
diff --git a/lib/internal/Magento/Framework/App/Http/Context.php b/lib/internal/Magento/Framework/App/Http/Context.php
index a5eba2753b510..79a15110234cd 100644
--- a/lib/internal/Magento/Framework/App/Http/Context.php
+++ b/lib/internal/Magento/Framework/App/Http/Context.php
@@ -84,9 +84,7 @@ public function unsValue($name)
*/
public function getValue($name)
{
- return isset($this->data[$name])
- ? $this->data[$name]
- : (isset($this->default[$name]) ? $this->default[$name] : null);
+ return $this->data[$name] ?? ($this->default[$name] ?? null);
}
/**
diff --git a/lib/internal/Magento/Framework/App/HttpRequestInterface.php b/lib/internal/Magento/Framework/App/HttpRequestInterface.php
new file mode 100644
index 0000000000000..674ccdb07f49f
--- /dev/null
+++ b/lib/internal/Magento/Framework/App/HttpRequestInterface.php
@@ -0,0 +1,53 @@
+_filesystem->getDirectoryWrite($baseDir);
$isFile = false;
$file = null;
+ $fileContent = $this->getFileContent($content);
if (is_array($content)) {
if (!isset($content['type']) || !isset($content['value'])) {
throw new \InvalidArgumentException("Invalid arguments. Keys 'type' and 'value' are required.");
@@ -76,7 +77,7 @@ public function create(
->setHeader('Pragma', 'public', true)
->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
->setHeader('Content-type', $contentType, true)
- ->setHeader('Content-Length', $contentLength === null ? strlen($content) : $contentLength, true)
+ ->setHeader('Content-Length', $contentLength === null ? strlen($fileContent) : $contentLength, true)
->setHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"', true)
->setHeader('Last-Modified', date('r'), true);
@@ -88,7 +89,8 @@ public function create(
echo $stream->read(1024);
}
} else {
- $dir->writeFile($fileName, $content);
+ $dir->writeFile($fileName, $fileContent);
+ $file = $fileName;
$stream = $dir->openFile($fileName, 'r');
while (!$stream->eof()) {
echo $stream->read(1024);
@@ -102,4 +104,19 @@ public function create(
}
return $this->_response;
}
+
+ /**
+ * Returns file content for writing.
+ *
+ * @param string|array $content
+ * @return string|array
+ */
+ private function getFileContent($content)
+ {
+ if (isset($content['type']) && $content['type'] === 'string') {
+ return $content['value'];
+ }
+
+ return $content;
+ }
}
diff --git a/lib/internal/Magento/Framework/Archive/Tar.php b/lib/internal/Magento/Framework/Archive/Tar.php
index e2a070503f61f..7fe1255e5b859 100644
--- a/lib/internal/Magento/Framework/Archive/Tar.php
+++ b/lib/internal/Magento/Framework/Archive/Tar.php
@@ -12,7 +12,6 @@
namespace Magento\Framework\Archive;
use Magento\Framework\Archive\Helper\File;
-use Magento\Framework\Filesystem\DriverInterface;
class Tar extends \Magento\Framework\Archive\AbstractArchive implements \Magento\Framework\Archive\ArchiveInterface
{
diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
index 0e85cf5260e9b..0a54d770300e8 100644
--- a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
+++ b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php
@@ -70,7 +70,7 @@ public function getPaths($type)
public function getPath($type, $componentName)
{
self::validateType($type);
- return isset(self::$paths[$type][$componentName]) ? self::$paths[$type][$componentName] : null;
+ return self::$paths[$type][$componentName] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
index 27a222e6bceb9..bf67f73009a08 100644
--- a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
+++ b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php
@@ -7,7 +7,6 @@
use Composer\Composer;
use Composer\Package\Locker;
-use Magento\Framework\Composer\ComposerInformation;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
class ComposerInformationTest extends \PHPUnit\Framework\TestCase
diff --git a/lib/internal/Magento/Framework/Config/View.php b/lib/internal/Magento/Framework/Config/View.php
index ef9c39e221e86..05863caeec2b6 100644
--- a/lib/internal/Magento/Framework/Config/View.php
+++ b/lib/internal/Magento/Framework/Config/View.php
@@ -71,7 +71,7 @@ public function __construct(
public function getVars($module)
{
$this->initData();
- return isset($this->data['vars'][$module]) ? $this->data['vars'][$module] : [];
+ return $this->data['vars'][$module] ?? [];
}
/**
@@ -110,7 +110,7 @@ public function getVarValue($module, $var)
public function getMediaEntities($module, $mediaType)
{
$this->initData();
- return isset($this->data['media'][$module][$mediaType]) ? $this->data['media'][$module][$mediaType] : [];
+ return $this->data['media'][$module][$mediaType] ?? [];
}
/**
@@ -124,9 +124,7 @@ public function getMediaEntities($module, $mediaType)
public function getMediaAttributes($module, $mediaType, $mediaId)
{
$this->initData();
- return isset($this->data['media'][$module][$mediaType][$mediaId])
- ? $this->data['media'][$module][$mediaType][$mediaId]
- : [];
+ return $this->data['media'][$module][$mediaType][$mediaId] ?? [];
}
/**
@@ -163,7 +161,7 @@ protected function getIdAttributes()
public function getExcludedFiles()
{
$items = $this->getItems();
- return isset($items['file']) ? $items['file'] : [];
+ return $items['file'] ?? [];
}
/**
@@ -174,7 +172,7 @@ public function getExcludedFiles()
public function getExcludedDir()
{
$items = $this->getItems();
- return isset($items['directory']) ? $items['directory'] : [];
+ return $items['directory'] ?? [];
}
/**
@@ -185,7 +183,7 @@ public function getExcludedDir()
protected function getItems()
{
$this->initData();
- return isset($this->data['exclude']) ? $this->data['exclude'] : [];
+ return $this->data['exclude'] ?? [];
}
/**
diff --git a/lib/internal/Magento/Framework/Console/Test/Unit/QuestionPerformer/YesNoTest.php b/lib/internal/Magento/Framework/Console/Test/Unit/QuestionPerformer/YesNoTest.php
index d8552f2ba5f31..4a951aa2987a8 100644
--- a/lib/internal/Magento/Framework/Console/Test/Unit/QuestionPerformer/YesNoTest.php
+++ b/lib/internal/Magento/Framework/Console/Test/Unit/QuestionPerformer/YesNoTest.php
@@ -11,8 +11,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\QuestionFactory;
use Symfony\Component\Console\Question\Question;
-use Magento\Framework\Exception\LocalizedException;
-use Magento\Framework\Phrase;
class YesNoTest extends \PHPUnit\Framework\TestCase
{
diff --git a/lib/internal/Magento/Framework/DB/AbstractMapper.php b/lib/internal/Magento/Framework/DB/AbstractMapper.php
index bce53caef8a39..9d043d6de7fbc 100644
--- a/lib/internal/Magento/Framework/DB/AbstractMapper.php
+++ b/lib/internal/Magento/Framework/DB/AbstractMapper.php
@@ -10,7 +10,6 @@
use Magento\Framework\Data\ObjectFactory;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Psr\Log\LoggerInterface as Logger;
-use Magento\Framework\DataObject;
/**
* Class AbstractMapper
diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
index e02c48222ebd4..441da10253a14 100644
--- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
+++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
@@ -490,7 +490,7 @@ public function rawFetchRow($sql, $field = null)
if (empty($field)) {
return $row;
} else {
- return isset($row[$field]) ? $row[$field] : false;
+ return $row[$field] ?? false;
}
}
diff --git a/lib/internal/Magento/Framework/DB/Select/GroupRenderer.php b/lib/internal/Magento/Framework/DB/Select/GroupRenderer.php
index df046c92203c2..692843aaa37e3 100644
--- a/lib/internal/Magento/Framework/DB/Select/GroupRenderer.php
+++ b/lib/internal/Magento/Framework/DB/Select/GroupRenderer.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\DB\Select;
use Magento\Framework\DB\Select;
-use Magento\Framework\DB\Platform;
use Magento\Framework\DB\Platform\Quote;
/**
diff --git a/lib/internal/Magento/Framework/DB/SelectFactory.php b/lib/internal/Magento/Framework/DB/SelectFactory.php
index bdbc35b395af7..3c64e78839c4d 100644
--- a/lib/internal/Magento/Framework/DB/SelectFactory.php
+++ b/lib/internal/Magento/Framework/DB/SelectFactory.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\DB;
-use Magento\Framework\DB\Select;
use Magento\Framework\DB\Select\SelectRenderer;
use Magento\Framework\DB\Adapter\AdapterInterface;
diff --git a/lib/internal/Magento/Framework/DB/TemporaryTableService.php b/lib/internal/Magento/Framework/DB/TemporaryTableService.php
index 03c1a9b9aa7f6..881ebbe5c85ad 100644
--- a/lib/internal/Magento/Framework/DB/TemporaryTableService.php
+++ b/lib/internal/Magento/Framework/DB/TemporaryTableService.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\DB;
use Magento\Framework\DB\Adapter\AdapterInterface;
-use Magento\Framework\DB\Select;
/**
* Class TemporaryTableService creates a temporary table in mysql from a Magento\Framework\DB\Select.
diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/SelectTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/SelectTest.php
index 7ce0ba4e4eb45..2be211a6c3da0 100644
--- a/lib/internal/Magento/Framework/DB/Test/Unit/SelectTest.php
+++ b/lib/internal/Magento/Framework/DB/Test/Unit/SelectTest.php
@@ -7,8 +7,6 @@
use \Magento\Framework\DB\Select;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-
/**
* Class SelectTest
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
diff --git a/lib/internal/Magento/Framework/Data/AbstractCriteria.php b/lib/internal/Magento/Framework/Data/AbstractCriteria.php
index c90ed2b03bf3d..d4811b79980a9 100644
--- a/lib/internal/Magento/Framework/Data/AbstractCriteria.php
+++ b/lib/internal/Magento/Framework/Data/AbstractCriteria.php
@@ -274,7 +274,7 @@ public function getLimit()
*/
public function getPart($name, $default = null)
{
- return isset($this->data[$name]) ? $this->data[$name] : $default;
+ return $this->data[$name] ?? $default;
}
/**
diff --git a/lib/internal/Magento/Framework/Data/AbstractDataObject.php b/lib/internal/Magento/Framework/Data/AbstractDataObject.php
index 5916100ffbbfa..da04fecc447cc 100644
--- a/lib/internal/Magento/Framework/Data/AbstractDataObject.php
+++ b/lib/internal/Magento/Framework/Data/AbstractDataObject.php
@@ -50,6 +50,6 @@ public function toArray()
*/
protected function get($key)
{
- return isset($this->data[$key]) ? $this->data[$key] : null;
+ return $this->data[$key] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/Data/Collection.php b/lib/internal/Magento/Framework/Data/Collection.php
index f8b82d3122234..71ec8c1aa8379 100644
--- a/lib/internal/Magento/Framework/Data/Collection.php
+++ b/lib/internal/Magento/Framework/Data/Collection.php
@@ -851,7 +851,7 @@ public function count()
*/
public function getFlag($flag)
{
- return isset($this->_flags[$flag]) ? $this->_flags[$flag] : null;
+ return $this->_flags[$flag] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php b/lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php
index 76bc4fce5f95c..3048be4d5dc1b 100644
--- a/lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php
+++ b/lib/internal/Magento/Framework/Data/Form/Element/Checkboxes.php
@@ -178,14 +178,6 @@ public function getOnchange($value)
return;
}
- // public function getName($value)
- // {
- // if ($name = $this->getData('name')) {
- // return str_replace('$value', $value, $name);
- // }
- // return ;
- // }
-
/**
* @param array $option
* @return string
diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Date.php b/lib/internal/Magento/Framework/Data/Form/Element/Date.php
index c4661c92e8c49..ed5457edc7f3f 100644
--- a/lib/internal/Magento/Framework/Data/Form/Element/Date.php
+++ b/lib/internal/Magento/Framework/Data/Form/Element/Date.php
@@ -12,7 +12,6 @@
namespace Magento\Framework\Data\Form\Element;
use Magento\Framework\Escaper;
-use Magento\Framework\Stdlib\DateTime;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
class Date extends AbstractElement
diff --git a/lib/internal/Magento/Framework/Data/Form/FilterFactory.php b/lib/internal/Magento/Framework/Data/Form/FilterFactory.php
index 2763e8bd17cce..22dfabb8fb565 100644
--- a/lib/internal/Magento/Framework/Data/Form/FilterFactory.php
+++ b/lib/internal/Magento/Framework/Data/Form/FilterFactory.php
@@ -7,7 +7,6 @@
use Magento\Framework\Data\Form\Filter\FilterInterface;
use Magento\Framework\ObjectManagerInterface;
-use Magento\Framework\Phrase;
class FilterFactory
{
diff --git a/lib/internal/Magento/Framework/Data/Structure.php b/lib/internal/Magento/Framework/Data/Structure.php
index f2c45fa160cc2..b22395f1ba835 100644
--- a/lib/internal/Magento/Framework/Data/Structure.php
+++ b/lib/internal/Magento/Framework/Data/Structure.php
@@ -172,7 +172,7 @@ public function createElement($elementId, array $data)
*/
public function getElement($elementId)
{
- return isset($this->_elements[$elementId]) ? $this->_elements[$elementId] : false;
+ return $this->_elements[$elementId] ?? false;
}
/**
@@ -466,9 +466,7 @@ public function getChildId($parentId, $alias)
*/
public function getChildren($parentId)
{
- return isset(
- $this->_elements[$parentId][self::CHILDREN]
- ) ? $this->_elements[$parentId][self::CHILDREN] : [];
+ return $this->_elements[$parentId][self::CHILDREN] ?? [];
}
/**
@@ -479,7 +477,7 @@ public function getChildren($parentId)
*/
public function getParentId($childId)
{
- return isset($this->_elements[$childId][self::PARENT]) ? $this->_elements[$childId][self::PARENT] : false;
+ return $this->_elements[$childId][self::PARENT] ?? false;
}
/**
diff --git a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php
index c7417439bac1f..0d35b3a4264e0 100644
--- a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php
+++ b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/SchemaLocatorTest.php
@@ -6,8 +6,6 @@
namespace Magento\Framework\DataObject\Test\Unit\Copy\Config;
-use Magento\Framework\App\Filesystem\DirectoryList;
-
class SchemaLocatorTest extends \PHPUnit\Framework\TestCase
{
/**
diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
index f4381a42775d7..74f2db9b05f2d 100644
--- a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
+++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php
@@ -7,7 +7,6 @@
use Magento\Framework\Encryption\Encryptor;
use Magento\Framework\Encryption\Crypt;
-use Magento\Framework\App\DeploymentConfig;
class EncryptorTest extends \PHPUnit\Framework\TestCase
{
diff --git a/lib/internal/Magento/Framework/EntityManager/AbstractModelHydrator.php b/lib/internal/Magento/Framework/EntityManager/AbstractModelHydrator.php
index ce35e72baea1f..9b31fcce10b9d 100644
--- a/lib/internal/Magento/Framework/EntityManager/AbstractModelHydrator.php
+++ b/lib/internal/Magento/Framework/EntityManager/AbstractModelHydrator.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\EntityManager;
-use Magento\Framework\Model\AbstractModel;
-
/**
* Class AbstractModelHydrator
*/
diff --git a/lib/internal/Magento/Framework/EntityManager/Hydrator.php b/lib/internal/Magento/Framework/EntityManager/Hydrator.php
index ccf5b0c8557ab..0ea4eb3cedcd9 100644
--- a/lib/internal/Magento/Framework/EntityManager/Hydrator.php
+++ b/lib/internal/Magento/Framework/EntityManager/Hydrator.php
@@ -5,10 +5,8 @@
*/
namespace Magento\Framework\EntityManager;
-use Magento\Framework\EntityManager\MapperPool;
use Magento\Framework\Reflection\DataObjectProcessor;
use Magento\Framework\Api\DataObjectHelper;
-use Magento\Framework\EntityManager\TypeResolver;
/**
* Class Hydrator
diff --git a/lib/internal/Magento/Framework/EntityManager/Observer/BeforeEntityDelete.php b/lib/internal/Magento/Framework/EntityManager/Observer/BeforeEntityDelete.php
index 5480b1c4feba9..6bc144929fb60 100644
--- a/lib/internal/Magento/Framework/EntityManager/Observer/BeforeEntityDelete.php
+++ b/lib/internal/Magento/Framework/EntityManager/Observer/BeforeEntityDelete.php
@@ -9,7 +9,6 @@
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use Magento\Framework\Model\AbstractModel;
-use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
/**
* Class BeforeEntityDelete
diff --git a/lib/internal/Magento/Framework/EntityManager/Operation/ExtensionPool.php b/lib/internal/Magento/Framework/EntityManager/Operation/ExtensionPool.php
index 703ed96ece4b9..5d3d37bb830d5 100644
--- a/lib/internal/Magento/Framework/EntityManager/Operation/ExtensionPool.php
+++ b/lib/internal/Magento/Framework/EntityManager/Operation/ExtensionPool.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\EntityManager\Operation;
use Magento\Framework\ObjectManagerInterface;
-use Magento\Framework\EntityManager\Operation\ExtensionInterface;
/**
* Class ExtensionPool
diff --git a/lib/internal/Magento/Framework/EntityManager/OperationPool.php b/lib/internal/Magento/Framework/EntityManager/OperationPool.php
index 97d580e328b1b..90a5acb8b8a03 100644
--- a/lib/internal/Magento/Framework/EntityManager/OperationPool.php
+++ b/lib/internal/Magento/Framework/EntityManager/OperationPool.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\EntityManager;
use Magento\Framework\ObjectManagerInterface as ObjectManager;
-use Magento\Framework\EntityManager\OperationInterface;
use Magento\Framework\EntityManager\Operation\CheckIfExists;
use Magento\Framework\EntityManager\Operation\Read;
use Magento\Framework\EntityManager\Operation\Create;
diff --git a/lib/internal/Magento/Framework/EntityManager/Sequence/SequenceManager.php b/lib/internal/Magento/Framework/EntityManager/Sequence/SequenceManager.php
index 25af4743ac9b8..7d92c05d6c830 100644
--- a/lib/internal/Magento/Framework/EntityManager/Sequence/SequenceManager.php
+++ b/lib/internal/Magento/Framework/EntityManager/Sequence/SequenceManager.php
@@ -68,7 +68,7 @@ public function force($entityType, $identifier)
if (!isset($sequenceInfo['sequenceTable'])) {
throw new \Exception(
- 'TODO: use correct Exception class' . PHP_EOL . ' Sequence table doesnt exists'
+ 'TODO: use correct Exception class' . PHP_EOL . ' Sequence table doesn\'t exists'
);
}
@@ -101,7 +101,7 @@ public function delete($entityType, $identifier)
$metadata = $this->metadataPool->getMetadata($entityType);
$sequenceInfo = $this->sequenceRegistry->retrieve($entityType);
if (!isset($sequenceInfo['sequenceTable'])) {
- throw new \Exception('TODO: use correct Exception class' . PHP_EOL . ' Sequence table doesnt exists');
+ throw new \Exception('TODO: use correct Exception class' . PHP_EOL . ' Sequence table doesn\'t exists');
}
try {
$connection = $this->appResource->getConnectionByName($metadata->getEntityConnectionName());
diff --git a/lib/internal/Magento/Framework/Event.php b/lib/internal/Magento/Framework/Event.php
index 4c116d0a33629..c7b15a8eb0722 100644
--- a/lib/internal/Magento/Framework/Event.php
+++ b/lib/internal/Magento/Framework/Event.php
@@ -88,7 +88,7 @@ public function dispatch()
*/
public function getName()
{
- return isset($this->_data['name']) ? $this->_data['name'] : null;
+ return $this->_data['name'] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php
index 5e5c60e149837..378de874974c6 100644
--- a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php
+++ b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php
@@ -8,8 +8,6 @@
use \Magento\Framework\Event\Observer;
-use Magento\Framework\Event;
-
/**
* Class ConfigTest
*
diff --git a/lib/internal/Magento/Framework/File/Uploader.php b/lib/internal/Magento/Framework/File/Uploader.php
index c86f98c4e413a..33f458d2082e1 100644
--- a/lib/internal/Magento/Framework/File/Uploader.php
+++ b/lib/internal/Magento/Framework/File/Uploader.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\File;
-use Magento\Framework\Filesystem\DriverInterface;
-
/**
* File upload class
*
diff --git a/lib/internal/Magento/Framework/Filesystem/Io/File.php b/lib/internal/Magento/Framework/Filesystem/Io/File.php
index c1cfebc7a0ac1..8fec7f7630257 100644
--- a/lib/internal/Magento/Framework/Filesystem/Io/File.php
+++ b/lib/internal/Magento/Framework/Filesystem/Io/File.php
@@ -233,7 +233,7 @@ public function streamStat($part = null, $default = null)
}
$stat = @fstat($this->_streamHandler);
if ($part !== null) {
- return isset($stat[$part]) ? $stat[$part] : $default;
+ return $stat[$part] ?? $default;
}
return $stat;
}
diff --git a/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php b/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php
index 1aa9d61f8865a..04df5fd3f3a6c 100644
--- a/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php
+++ b/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Filesystem\Io;
-use Magento\Framework\Filesystem\DriverInterface;
use Magento\Framework\Phrase;
use Magento\Framework\Exception\LocalizedException;
diff --git a/lib/internal/Magento/Framework/Filesystem/Io/IoInterface.php b/lib/internal/Magento/Framework/Filesystem/Io/IoInterface.php
index c31d3ff9e52ba..93c85ebafe727 100644
--- a/lib/internal/Magento/Framework/Filesystem/Io/IoInterface.php
+++ b/lib/internal/Magento/Framework/Filesystem/Io/IoInterface.php
@@ -5,10 +5,9 @@
*/
namespace Magento\Framework\Filesystem\Io;
-use Magento\Framework\Filesystem\DriverInterface;
-
/**
* Input/output client interface
+ * @api
*/
interface IoInterface
{
diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadFactoryTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadFactoryTest.php
index c2115205e6bd2..93b12f8d56ff8 100644
--- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadFactoryTest.php
+++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadFactoryTest.php
@@ -7,8 +7,6 @@
use \Magento\Framework\Filesystem\File\ReadFactory;
-use Magento\Framework\Filesystem\DriverPool;
-
/**
* Class ReadFactoryTest
*/
diff --git a/lib/internal/Magento/Framework/Filter/AbstractFactory.php b/lib/internal/Magento/Framework/Filter/AbstractFactory.php
index 2a0ae0ba15e42..c30b07aa09061 100644
--- a/lib/internal/Magento/Framework/Filter/AbstractFactory.php
+++ b/lib/internal/Magento/Framework/Filter/AbstractFactory.php
@@ -68,7 +68,7 @@ public function canCreateFilter($alias)
*/
public function isShared($class)
{
- return isset($this->shared[$class]) ? $this->shared[$class] : $this->shareByDefault;
+ return $this->shared[$class] ?? $this->shareByDefault;
}
/**
diff --git a/lib/internal/Magento/Framework/Filter/DataObject/Grid.php b/lib/internal/Magento/Framework/Filter/DataObject/Grid.php
index 7676558a927b0..54dccc8ae5b82 100644
--- a/lib/internal/Magento/Framework/Filter/DataObject/Grid.php
+++ b/lib/internal/Magento/Framework/Filter/DataObject/Grid.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Filter\DataObject;
-use Magento\Framework\DataObject;
-
class Grid extends \Magento\Framework\Filter\DataObject
{
/**
diff --git a/lib/internal/Magento/Framework/Filter/Input.php b/lib/internal/Magento/Framework/Filter/Input.php
index 39c7a54786edb..6da748fcbeb9f 100644
--- a/lib/internal/Magento/Framework/Filter/Input.php
+++ b/lib/internal/Magento/Framework/Filter/Input.php
@@ -183,7 +183,7 @@ public function getFilters($name = null)
if (null === $name) {
return $this->_filters;
} else {
- return isset($this->_filters[$name]) ? $this->_filters[$name] : null;
+ return $this->_filters[$name] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/Indexer/CacheContext.php b/lib/internal/Magento/Framework/Indexer/CacheContext.php
index 7a56b320859e9..4a6964477ebd5 100644
--- a/lib/internal/Magento/Framework/Indexer/CacheContext.php
+++ b/lib/internal/Magento/Framework/Indexer/CacheContext.php
@@ -30,7 +30,6 @@ class CacheContext implements \Magento\Framework\DataObject\IdentityInterface
public function registerEntities($cacheTag, $ids)
{
$this->entities[$cacheTag] = array_merge($this->getRegisteredEntity($cacheTag), $ids);
-
return $this;
}
@@ -40,7 +39,7 @@ public function registerEntities($cacheTag, $ids)
* @param array $cacheTags
* @return $this
*/
- public function registerTags(array $cacheTags)
+ public function registerTags($cacheTags)
{
$this->tags = array_merge($this->tags, $cacheTags);
return $this;
diff --git a/lib/internal/Magento/Framework/Indexer/Config/Reader.php b/lib/internal/Magento/Framework/Indexer/Config/Reader.php
index 6ef22b3b7f796..9ed35ef0e9af5 100644
--- a/lib/internal/Magento/Framework/Indexer/Config/Reader.php
+++ b/lib/internal/Magento/Framework/Indexer/Config/Reader.php
@@ -18,6 +18,7 @@ class Reader extends \Magento\Framework\Config\Reader\Filesystem
'/config/indexer/source' => 'name',
'/config/indexer/fieldset' => 'name',
'/config/indexer/fieldset/field' => 'name',
+ '/config/indexer/dependencies/indexer' => 'id',
];
/**
diff --git a/lib/internal/Magento/Framework/Indexer/Dimension.php b/lib/internal/Magento/Framework/Indexer/Dimension.php
index 4cb74003c46fc..dacc8d7f524f5 100644
--- a/lib/internal/Magento/Framework/Indexer/Dimension.php
+++ b/lib/internal/Magento/Framework/Indexer/Dimension.php
@@ -14,6 +14,16 @@
*/
class Dimension
{
+ /**
+ * @var string
+ */
+ private $name;
+
+ /**
+ * @var string
+ */
+ private $value;
+
/**
* @param string $name
* @param string $value
diff --git a/lib/internal/Magento/Framework/Indexer/DimensionFactory.php b/lib/internal/Magento/Framework/Indexer/DimensionFactory.php
index a137e2d0e94a6..8eaeff5628d60 100644
--- a/lib/internal/Magento/Framework/Indexer/DimensionFactory.php
+++ b/lib/internal/Magento/Framework/Indexer/DimensionFactory.php
@@ -34,11 +34,14 @@ public function __construct(ObjectManagerInterface $objectManager)
* @param string $value
* @return Dimension
*/
- public function create(string $name, $value): Dimension
+ public function create(string $name, string $value): Dimension
{
- return $this->objectManager->create(Dimension::class, [
- 'name' => $name,
- 'value' => (string) $value,
- ]);
+ return $this->objectManager->create(
+ Dimension::class,
+ [
+ 'name' => $name,
+ 'value' => $value,
+ ]
+ );
}
}
diff --git a/lib/internal/Magento/Framework/Indexer/Dimension/DimensionProviderInterface.php b/lib/internal/Magento/Framework/Indexer/DimensionProviderInterface.php
similarity index 90%
rename from lib/internal/Magento/Framework/Indexer/Dimension/DimensionProviderInterface.php
rename to lib/internal/Magento/Framework/Indexer/DimensionProviderInterface.php
index e2d05b2ae038f..ea4f56eb48d41 100644
--- a/lib/internal/Magento/Framework/Indexer/Dimension/DimensionProviderInterface.php
+++ b/lib/internal/Magento/Framework/Indexer/DimensionProviderInterface.php
@@ -5,7 +5,7 @@
*/
declare(strict_types=1);
-namespace Magento\Framework\Indexer\Dimension;
+namespace Magento\Framework\Indexer;
/**
* @api
diff --git a/lib/internal/Magento/Framework/Indexer/Dimension/DimensionalIndexerInterface.php b/lib/internal/Magento/Framework/Indexer/DimensionalIndexerInterface.php
similarity index 55%
rename from lib/internal/Magento/Framework/Indexer/Dimension/DimensionalIndexerInterface.php
rename to lib/internal/Magento/Framework/Indexer/DimensionalIndexerInterface.php
index e2f68272565a6..43c4e7a7fd70b 100644
--- a/lib/internal/Magento/Framework/Indexer/Dimension/DimensionalIndexerInterface.php
+++ b/lib/internal/Magento/Framework/Indexer/DimensionalIndexerInterface.php
@@ -5,11 +5,11 @@
*/
declare(strict_types=1);
-namespace Magento\Framework\Indexer\Dimension;
+namespace Magento\Framework\Indexer;
/**
* @api
- * Run indexer by specific dimension
+ * Run indexer by dimensions
*/
interface DimensionalIndexerInterface
{
@@ -17,9 +17,9 @@ interface DimensionalIndexerInterface
* Execute indexer by specified dimension.
* Accept array of dimensions DTO that represent indexer dimension
*
- * @param \Magento\Framework\Indexer\Dimension[] $dimension
- * @param \Traversable|null $entityIds
+ * @param \Magento\Framework\Indexer\Dimension[] $dimensions
+ * @param \Traversable $entityIds
* @return void
*/
- public function executeByDimension(array $dimension, \Traversable $entityIds = null);
+ public function executeByDimensions(array $dimensions, \Traversable $entityIds);
}
diff --git a/lib/internal/Magento/Framework/Indexer/MultiDimensionProvider.php b/lib/internal/Magento/Framework/Indexer/MultiDimensionProvider.php
new file mode 100644
index 0000000000000..a02637f755b89
--- /dev/null
+++ b/lib/internal/Magento/Framework/Indexer/MultiDimensionProvider.php
@@ -0,0 +1,156 @@
+addDimensionDataProvider($dimensionDataProvider);
+ }
+ }
+
+ /**
+ * Returns generator that will return multiplied dimensions on each iteration
+ *
+ * @return \Traversable|Dimension[][]
+ * @throws \LogicException
+ */
+ public function getIterator(): \Traversable
+ {
+ // just return empty array if we have no dimension providers to iterate over
+ if ($this->dimensionsProvidersCount === 0) {
+ yield [];
+ return;
+ }
+
+ // this recreates iterators for dimension so we can iterate over them
+ $this->rewind();
+
+ // if at leas one dimension provider has no dimensions to return we can't multiple dimension at all
+ if (!$this->hasCurrentDimension()) {
+ throw new \LogicException('Can`t multiple dimensions because some of them are empty.');
+ }
+
+ // return dimensions until all iterators become invalid
+ while ($this->hasCurrentDimension()) {
+ yield $this->getCurrentDimension();
+ $this->setNextDimension();
+ }
+ }
+
+ /**
+ * Return all dimensions for current state of each dimension provider
+ *
+ * @return array
+ */
+ private function getCurrentDimension(): array
+ {
+ $dimensions = [];
+
+ foreach ($this->dimensionsIterators as $dimensionIterator) {
+ /** @var Dimension $dimension */
+ $dimension = $dimensionIterator->current();
+ $dimensions[$dimension->getName()] = $dimension;
+ }
+
+ return $dimensions;
+ }
+
+ /**
+ * Iterates over dimension iterators one by one starting from right to left
+ * This approach emulates iterations over X nested foreach loops e.g.:
+ *
+ * @return void
+ */
+ private function setNextDimension()
+ {
+ $this->dimensionsIterators[$this->dimensionsProvidersCount - 1]->next();
+
+ for ($i = ($this->dimensionsProvidersCount - 1); $i > 0; $i--) {
+ if (!$this->dimensionsIterators[$i]->valid()) {
+ $this->dimensionsIterators[$i] = $this->dimensionsDataProviders[$i]->getIterator();
+ $this->dimensionsIterators[$i-1]->next();
+ }
+ }
+ }
+
+ /**
+ * Recreates iterators so all MultiDimensionProvider can be iterated again
+ *
+ * @return void
+ */
+ private function rewind()
+ {
+ $this->dimensionsIterators = [];
+
+ foreach ($this->dimensionsDataProviders as $dimensionDataProvider) {
+ $this->dimensionsIterators[] = $dimensionDataProvider->getIterator();
+ }
+ }
+
+ /**
+ * Check if all dimension iterators are in valid state
+ *
+ * If at least one of dimension iterators is invalid before very first iteration - we assume
+ * that dimension provider has no dimensions at all, which means we can't multiple all dimensions
+ *
+ * If all dimension iterators became invalid - we assume that multiplication is already done
+ *
+ * @return bool
+ */
+ private function hasCurrentDimension(): bool
+ {
+ $valid = true;
+
+ foreach ($this->dimensionsIterators as $dimensionsIterator) {
+ // if at least one data provider is invalid at this stage - all generator is invalid
+ if (!$dimensionsIterator->valid()) {
+ return false;
+ }
+ }
+
+ // generator is valid only when all data providers are valid
+ return $valid;
+ }
+
+ /**
+ * Collects dimension data providers
+ * This was done via separate method to ensure that each provider has required interface
+ *
+ * @param DimensionProviderInterface $dimensionDataProvider
+ * @return void
+ */
+ private function addDimensionDataProvider(DimensionProviderInterface $dimensionDataProvider)
+ {
+ $this->dimensionsDataProviders[] = $dimensionDataProvider;
+ $this->dimensionsProvidersCount++;
+ }
+}
diff --git a/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerHandler.php b/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerHandler.php
index 3908cf1e98762..c3ab971c992e6 100644
--- a/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerHandler.php
+++ b/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerHandler.php
@@ -12,7 +12,6 @@
use Magento\Framework\Indexer\IndexStructureInterface;
use Magento\Framework\Indexer\ScopeResolver\FlatScopeResolver;
use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver;
-use Magento\Framework\Indexer\SaveHandler\Batch;
class IndexerHandler implements IndexerInterface
{
diff --git a/lib/internal/Magento/Framework/Indexer/SaveHandlerFactory.php b/lib/internal/Magento/Framework/Indexer/SaveHandlerFactory.php
index 82e8a26553b89..80231dd7aa290 100644
--- a/lib/internal/Magento/Framework/Indexer/SaveHandlerFactory.php
+++ b/lib/internal/Magento/Framework/Indexer/SaveHandlerFactory.php
@@ -5,7 +5,6 @@
*/
namespace Magento\Framework\Indexer;
-use Magento\Framework\Indexer\IndexerInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Indexer\SaveHandler\IndexerInterface as SaveHandlerInterface;
diff --git a/lib/internal/Magento/Framework/Indexer/ScopeResolver/IndexScopeResolver.php b/lib/internal/Magento/Framework/Indexer/ScopeResolver/IndexScopeResolver.php
index 891a6cd1efe12..a68de6ad36f9a 100644
--- a/lib/internal/Magento/Framework/Indexer/ScopeResolver/IndexScopeResolver.php
+++ b/lib/internal/Magento/Framework/Indexer/ScopeResolver/IndexScopeResolver.php
@@ -42,16 +42,18 @@ public function __construct(
*/
public function resolve($index, array $dimensions)
{
- $tableNameParts = [$index];
+ $tableNameParts = [];
foreach ($dimensions as $dimension) {
switch ($dimension->getName()) {
case 'scope':
- $tableNameParts[] = $dimension->getName() . $this->getScopeId($dimension);
+ $tableNameParts[$dimension->getName()] = $dimension->getName() . $this->getScopeId($dimension);
break;
default:
- $tableNameParts[] = $dimension->getName() . $dimension->getValue();
+ $tableNameParts[$dimension->getName()] = $dimension->getName() . $dimension->getValue();
}
}
+ ksort($tableNameParts);
+ array_unshift($tableNameParts, $index);
return $this->resource->getTableName(implode('_', $tableNameParts));
}
diff --git a/lib/internal/Magento/Framework/Indexer/StructureFactory.php b/lib/internal/Magento/Framework/Indexer/StructureFactory.php
index f9b7eafdfc436..1b6729e4603ec 100644
--- a/lib/internal/Magento/Framework/Indexer/StructureFactory.php
+++ b/lib/internal/Magento/Framework/Indexer/StructureFactory.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Indexer;
-use Magento\Framework\Indexer\IndexStructureInterface;
-
class StructureFactory
{
/**
diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
index 514bd673f8525..2c0d9124b9603 100644
--- a/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
+++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/IndexStructureTest.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Indexer\Test\Unit;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Ddl\Table;
use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/MultiDimensionProviderTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/MultiDimensionProviderTest.php
new file mode 100644
index 0000000000000..b55ace9bdec3d
--- /dev/null
+++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/MultiDimensionProviderTest.php
@@ -0,0 +1,256 @@
+assertSame($expectedDimensions, $actualDimensions);
+ }
+
+ /**
+ * tests multiplication of dimensions from different providers
+ *
+ * e.g we have three dimensions:
+ * - dimension X with values (x1, x2)
+ * - dimension Y with values (y1, y2, y3)
+ * - dimension Z with values (z1, z2)
+ *
+ * the multiplication result set will be:
+ * x1-y1-z1
+ * x1-y1-z2
+ * x1-y2-z1
+ * x1-y2-z2
+ * x1-y3-z1
+ * x1-y3-z2
+ * x2-y1-z1
+ * x2-y1-z2
+ * x2-y2-z1
+ * x2-y2-z2
+ * x2-y3-z1
+ * x2-y3-z2
+ */
+ public function testWithMultipleDataProviders()
+ {
+ // prepare expected dimensions
+ $dimensionXData = [
+ $this->getDimensionMock('x', '1'),
+ $this->getDimensionMock('x', '2'),
+ $this->getDimensionMock('x', '3'),
+ ];
+
+ $dimensionYData = [
+ $this->getDimensionMock('y', '1'),
+ $this->getDimensionMock('y', '2'),
+ $this->getDimensionMock('y', '3'),
+ $this->getDimensionMock('y', '4'),
+ $this->getDimensionMock('y', '5'),
+ ];
+
+ $dimensionZData = [
+ $this->getDimensionMock('z', '1'),
+ $this->getDimensionMock('z', '2'),
+ ];
+
+ $expectedDimensions = [];
+
+ foreach ($dimensionXData as $dimensionX) {
+ foreach ($dimensionYData as $dimensionY) {
+ foreach ($dimensionZData as $dimensionZ) {
+ $expectedDimensions[] = [
+ $dimensionX->getName() => $dimensionX,
+ $dimensionY->getName() => $dimensionY,
+ $dimensionZ->getName() => $dimensionZ,
+ ];
+ }
+ }
+ }
+
+ // collect actual dimensions
+ $multiDimensionProvider = new MultiDimensionProvider(
+ [
+ $this->getDimensionProviderMock($dimensionXData),
+ $this->getDimensionProviderMock($dimensionYData),
+ $this->getDimensionProviderMock($dimensionZData),
+ ]
+ );
+
+ $actualDimensions = [];
+ foreach ($multiDimensionProvider as $dimension) {
+ $actualDimensions[] = $dimension;
+ }
+
+ $this->assertSame($expectedDimensions, $actualDimensions);
+ }
+
+ /**
+ * tests that the same MultiDimensionProvider can be used in foreach multiple times without creating again
+ */
+ public function testMultiDimensionProviderIsReIterable()
+ {
+ // prepare expected dimensions
+ $dimensionXData = [
+ $this->getDimensionMock('x', '1'),
+ $this->getDimensionMock('x', '2'),
+ $this->getDimensionMock('x', '3'),
+ ];
+
+ $dimensionZData = [
+ $this->getDimensionMock('z', '1'),
+ $this->getDimensionMock('z', '2'),
+ ];
+
+ // collect actual dimensions
+ $multiDimensionProvider = new MultiDimensionProvider(
+ [
+ $this->getDimensionProviderMock($dimensionXData),
+ $this->getDimensionProviderMock($dimensionZData),
+ ]
+ );
+
+ // first iteration
+ $actualDimensions1st = [];
+ foreach ($multiDimensionProvider as $dimension) {
+ $actualDimensions1st[] = $dimension;
+ }
+
+ // second iteration
+ $actualDimensions2nd = [];
+ foreach ($multiDimensionProvider as $dimension) {
+ $actualDimensions2nd[] = $dimension;
+ }
+
+ $this->assertSame($actualDimensions1st, $actualDimensions2nd);
+ }
+
+ /**
+ * tests that MultiDimensionProvider will throw exception when all dimension providers has nothing to return
+ *
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Can`t multiple dimensions because some of them are empty.
+ */
+ public function testMultiDimensionProviderWithEmptyDataProvider()
+ {
+ // collect actual dimensions
+ $multiDimensionProvider = new MultiDimensionProvider(
+ [
+ $this->getDimensionProviderMock([]),
+ $this->getDimensionProviderMock([]),
+ ]
+ );
+
+ $actualDimensions = [];
+ foreach ($multiDimensionProvider as $dimension) {
+ $actualDimensions[] = $dimension;
+ }
+ }
+
+ /**
+ * tests that MultiDimensionProvider will throw exception when one dimension providers has nothing to return
+ *
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Can`t multiple dimensions because some of them are empty.
+ */
+ public function testMultiDimensionProviderWithMixedDataProvider()
+ {
+
+ // prepare expected dimensions
+ $dimensionXData = [
+ $this->getDimensionMock('x', '1'),
+ $this->getDimensionMock('x', '2'),
+ $this->getDimensionMock('x', '3'),
+ ];
+
+ $dimensionYData = [
+ $this->getDimensionMock('y', '1'),
+ $this->getDimensionMock('y', '2'),
+ $this->getDimensionMock('y', '3'),
+ $this->getDimensionMock('y', '4'),
+ $this->getDimensionMock('y', '5'),
+ ];
+
+ $dimensionZData = [];
+
+ // collect actual dimensions
+ $multiDimensionProvider = new MultiDimensionProvider(
+ [
+ $this->getDimensionProviderMock($dimensionXData),
+ $this->getDimensionProviderMock($dimensionYData),
+ $this->getDimensionProviderMock($dimensionZData),
+ ]
+ );
+
+ $actualDimensions = [];
+ foreach ($multiDimensionProvider as $dimension) {
+ $actualDimensions[] = $dimension;
+ }
+ }
+
+ private function getDimensionProviderMock($dimensions)
+ {
+ $dimensionProviderMock = $this->getMockBuilder(DimensionProviderInterface::class)
+ ->disableOriginalConstructor()
+ ->disableOriginalClone()
+ ->disableArgumentCloning()
+ ->disallowMockingUnknownTypes()
+ ->setMethods(['getIterator'])
+ ->getMockForAbstractClass();
+
+ $dimensionProviderMock->expects($this->any())
+ ->method('getIterator')
+ ->will(
+ $this->returnCallback(
+ function () use ($dimensions) {
+ return \SplFixedArray::fromArray($dimensions);
+ }
+ )
+ );
+
+ return $dimensionProviderMock;
+ }
+
+ private function getDimensionMock(string $name, string $value)
+ {
+ $dimensionMock = $this->getMockBuilder(Dimension::class)
+ ->disableOriginalConstructor()
+ ->disableOriginalClone()
+ ->disableArgumentCloning()
+ ->disallowMockingUnknownTypes()
+ ->setMethods(['getName', 'getValue'])
+ ->getMock();
+
+ $dimensionMock->expects($this->any())
+ ->method('getName')
+ ->willReturn($name);
+
+ $dimensionMock->expects($this->any())
+ ->method('getValue')
+ ->willReturn($value);
+
+ return $dimensionMock;
+ }
+}
diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/ScopeResolver/IndexScopeResolverTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/ScopeResolver/IndexScopeResolverTest.php
index ae898657ccecf..b193a3eecdd98 100644
--- a/lib/internal/Magento/Framework/Indexer/Test/Unit/ScopeResolver/IndexScopeResolverTest.php
+++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/ScopeResolver/IndexScopeResolverTest.php
@@ -103,9 +103,19 @@ public function resolveDataProvider()
],
[
'index' => 'index_name',
- 'dimensions' => [['dimension', 10], ['dimension', 20]],
+ 'dimensions' => [['first', 10], ['second', 20]],
// actually you will get exception here thrown in ScopeResolverInterface
- 'expected' => 'index_name_dimension10_dimension20'
+ 'expected' => 'index_name_first10_second20'
+ ],
+ [
+ 'index' => 'index_name',
+ 'dimensions' => [['second', 10], ['first', 20]],
+ 'expected' => 'index_name_first20_second10'
+ ],
+ [
+ 'index' => 'index_name',
+ 'dimensions' => [[-1, 10], ['first', 20]],
+ 'expected' => 'index_name_-110_first20'
]
];
}
diff --git a/lib/internal/Magento/Framework/Interception/PluginList/PluginList.php b/lib/internal/Magento/Framework/Interception/PluginList/PluginList.php
index 82738a30266d8..e21841b48bc13 100644
--- a/lib/internal/Magento/Framework/Interception/PluginList/PluginList.php
+++ b/lib/internal/Magento/Framework/Interception/PluginList/PluginList.php
@@ -268,7 +268,7 @@ public function getNext($type, $method, $code = '__self')
$this->_inheritPlugins($type);
}
$key = $type . '_' . lcfirst($method) . '_' . $code;
- return isset($this->_processed[$key]) ? $this->_processed[$key] : null;
+ return $this->_processed[$key] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Locale/Format.php b/lib/internal/Magento/Framework/Locale/Format.php
index 89f6957011876..ca50cdb2440f4 100644
--- a/lib/internal/Magento/Framework/Locale/Format.php
+++ b/lib/internal/Magento/Framework/Locale/Format.php
@@ -65,7 +65,7 @@ public function getNumber($value)
}
//trim spaces and apostrophes
- $value = str_replace(['\'', ' '], '', $value);
+ $value = preg_replace('/[^0-9^\^.,-]/m', '', $value);
$separatorComa = strpos($value, ',');
$separatorDot = strpos($value, '.');
diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php
index 5ef1a3097402b..3e917425c31e0 100644
--- a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php
+++ b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\Locale\Test\Unit;
use Magento\Framework\Locale\Currency;
-use Magento\Framework\Locale\CurrencyInterface;
class CurrencyTest extends \PHPUnit\Framework\TestCase
{
diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php
index 41583fd1383a5..1141f451c13a5 100644
--- a/lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php
+++ b/lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php
@@ -33,6 +33,9 @@ class FormatTest extends \PHPUnit\Framework\TestCase
*/
protected $currency;
+ /**
+ * {@inheritDoc}
+ */
protected function setUp()
{
$this->currency = $this->getMockBuilder(\Magento\Directory\Model\Currency::class)
@@ -41,9 +44,7 @@ protected function setUp()
$this->scope = $this->getMockBuilder(\Magento\Framework\App\ScopeInterface::class)
->setMethods(['getCurrentCurrency'])
->getMockForAbstractClass();
- $this->scope->expects($this->once())
- ->method('getCurrentCurrency')
- ->willReturn($this->currency);
+
$this->scopeResolver = $this->getMockBuilder(\Magento\Framework\App\ScopeResolverInterface::class)
->setMethods(['getScope'])
->getMockForAbstractClass();
@@ -52,7 +53,10 @@ protected function setUp()
->willReturn($this->scope);
$this->localeResolver = $this->getMockBuilder(\Magento\Framework\Locale\ResolverInterface::class)
->getMock();
+
+ /** @var \Magento\Directory\Model\CurrencyFactory|\PHPUnit_Framework_MockObject_MockObject $currencyFactory */
$currencyFactory = $this->getMockBuilder(\Magento\Directory\Model\CurrencyFactory::class)
+ ->disableOriginalConstructor()
->getMock();
$this->formatModel = new \Magento\Framework\Locale\Format(
@@ -63,21 +67,26 @@ protected function setUp()
}
/**
- * @param $localeCode
- * @param $expectedResult
+ * @param string $localeCode
+ * @param array $expectedResult
* @dataProvider getPriceFormatDataProvider
*/
- public function testGetPriceFormat($localeCode, $expectedResult)
+ public function testGetPriceFormat($localeCode, array $expectedResult): void
{
+ $this->scope->expects($this->once())
+ ->method('getCurrentCurrency')
+ ->willReturn($this->currency);
+
$result = $this->formatModel->getPriceFormat($localeCode);
$intersection = array_intersect_assoc($result, $expectedResult);
$this->assertCount(count($expectedResult), $intersection);
}
/**
+ *
* @return array
*/
- public function getPriceFormatDataProvider()
+ public function getPriceFormatDataProvider(): array
{
return [
['en_US', ['decimalSymbol' => '.', 'groupSymbol' => ',']],
@@ -86,4 +95,35 @@ public function getPriceFormatDataProvider()
['uk_UA', ['decimalSymbol' => ',', 'groupSymbol' => ' ']]
];
}
+
+ /**
+ *
+ * @param mixed $value
+ * @param float $expected
+ * @dataProvider provideNumbers
+ */
+ public function testGetNumber($value, $expected): void
+ {
+ $this->assertEquals($expected, $this->formatModel->getNumber($value));
+ }
+
+ /**
+ *
+ * @return array
+ */
+ public function provideNumbers(): array
+ {
+ return [
+ [' 2345.4356,1234', 23454356.1234],
+ ['+23,3452.123', 233452.123],
+ ['12343', 12343],
+ ['-9456km', -9456],
+ ['0', 0],
+ ['2 054,10', 2054.1],
+ ['2046,45', 2046.45],
+ ['2 054.52', 2054.52],
+ ['2,46 GB', 2.46],
+ ['2,054.00', 2054],
+ ];
+ }
}
diff --git a/lib/internal/Magento/Framework/Message/Collection.php b/lib/internal/Magento/Framework/Message/Collection.php
index 8805d433f4ffb..32e84fc28f5a0 100644
--- a/lib/internal/Magento/Framework/Message/Collection.php
+++ b/lib/internal/Magento/Framework/Message/Collection.php
@@ -136,7 +136,7 @@ public function getItems()
*/
public function getItemsByType($type)
{
- return isset($this->messages[$type]) ? $this->messages[$type] : [];
+ return $this->messages[$type] ?? [];
}
/**
diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php
index 550f135ddc545..f4b73bdd2f293 100644
--- a/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php
+++ b/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Message\Test\Unit;
-use Magento\Framework\Message\MessageInterface;
-
/**
* \Magento\Framework\Message\AbstractMessage test case
*/
diff --git a/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php b/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php
index e7ffcde03ff64..1cffba2543b0b 100644
--- a/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php
+++ b/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php
@@ -154,9 +154,7 @@ public function getCustomAttributes()
public function getCustomAttribute($attributeCode)
{
$this->initializeCustomAttributes();
- return isset($this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode])
- ? $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]
- : null;
+ return $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/DeleteEntityRow.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/DeleteEntityRow.php
index 7ec43220dc85c..d7d63232c1191 100755
--- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/DeleteEntityRow.php
+++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/DeleteEntityRow.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Model\ResourceModel\Db;
use Magento\Framework\EntityManager\MetadataPool;
-use Magento\Framework\EntityManager\EntityMetadata;
class DeleteEntityRow
{
diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Relation/ActionPool.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Relation/ActionPool.php
index 433762556693d..f3ac5ed5ee1f8 100644
--- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Relation/ActionPool.php
+++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Relation/ActionPool.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\Model\ResourceModel\Db\Relation;
use Magento\Framework\ObjectManagerInterface as ObjectManager;
-use Magento\Framework\Model\ResourceModel\Db\ProcessEntityRelationInterface;
/**
* Class ActionPool
@@ -50,9 +49,6 @@ public function getActions($entityType, $actionName)
}
foreach ($this->relationActions[$entityType][$actionName] as $actionClassName) {
$action = $this->objectManager->get($actionClassName);
- //if (!$action instanceof ProcessEntityRelationInterface) {
- // throw new \Exception('Not compliant with action interface');
- //}
$actions[] = $action;
}
return $actions;
diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php
index 1b16427040709..7e68b8daf2aef 100644
--- a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php
+++ b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\Model\Test\Unit;
use Magento\Framework\Api\AttributeValue;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
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 147cac47d3829..4f27f083509d7 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
@@ -7,7 +7,6 @@
namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db\Collection;
use Magento\Framework\DB\Select;
-use Magento\Framework\DataObject as MagentoObject;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
use Magento\Framework\ObjectManagerInterface;
diff --git a/lib/internal/Magento/Framework/Module/Dir.php b/lib/internal/Magento/Framework/Module/Dir.php
index 77174bb51305d..e6b60453b9577 100644
--- a/lib/internal/Magento/Framework/Module/Dir.php
+++ b/lib/internal/Magento/Framework/Module/Dir.php
@@ -9,7 +9,6 @@
use Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrarInterface;
-use Magento\Framework\Filesystem;
class Dir
{
diff --git a/lib/internal/Magento/Framework/Module/FullModuleList.php b/lib/internal/Magento/Framework/Module/FullModuleList.php
index 5ad5b05a413ef..c6e403dee0898 100644
--- a/lib/internal/Magento/Framework/Module/FullModuleList.php
+++ b/lib/internal/Magento/Framework/Module/FullModuleList.php
@@ -55,7 +55,7 @@ public function getAll()
public function getOne($name)
{
$data = $this->getAll();
- return isset($data[$name]) ? $data[$name] : null;
+ return $data[$name] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Module/ModuleList.php b/lib/internal/Magento/Framework/Module/ModuleList.php
index 406aa9efd31a0..6ee061cffb3d0 100644
--- a/lib/internal/Magento/Framework/Module/ModuleList.php
+++ b/lib/internal/Magento/Framework/Module/ModuleList.php
@@ -90,7 +90,7 @@ public function getAll()
public function getOne($name)
{
$enabled = $this->getAll();
- return isset($enabled[$name]) ? $enabled[$name] : null;
+ return $enabled[$name] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Module/ModuleResource.php b/lib/internal/Magento/Framework/Module/ModuleResource.php
index 427f8a6f8e959..b453ea4cba095 100644
--- a/lib/internal/Magento/Framework/Module/ModuleResource.php
+++ b/lib/internal/Magento/Framework/Module/ModuleResource.php
@@ -87,7 +87,7 @@ public function getDbVersion($moduleName)
return false;
}
$this->_loadVersion('db');
- return isset(self::$schemaVersions[$moduleName]) ? self::$schemaVersions[$moduleName] : false;
+ return self::$schemaVersions[$moduleName] ?? false;
}
/**
@@ -119,7 +119,7 @@ public function getDataVersion($moduleName)
return false;
}
$this->_loadVersion('data');
- return isset(self::$dataVersions[$moduleName]) ? self::$dataVersions[$moduleName] : false;
+ return self::$dataVersions[$moduleName] ?? false;
}
/**
diff --git a/lib/internal/Magento/Framework/Module/PackageInfo.php b/lib/internal/Magento/Framework/Module/PackageInfo.php
index 7edb0c04ebf98..0dce507ba26f4 100644
--- a/lib/internal/Magento/Framework/Module/PackageInfo.php
+++ b/lib/internal/Magento/Framework/Module/PackageInfo.php
@@ -283,6 +283,6 @@ public function getConflict($moduleName)
public function getVersion($moduleName)
{
$this->load();
- return isset($this->modulePackageVersionMap[$moduleName]) ? $this->modulePackageVersionMap[$moduleName] : '';
+ return $this->modulePackageVersionMap[$moduleName] ?? '';
}
}
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php
index f41f9bbd0d239..59249e3b92ae9 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/Dir/ReaderTest.php
@@ -11,7 +11,6 @@
namespace Magento\Framework\Module\Test\Unit\Dir;
use Magento\Framework\Config\FileIteratorFactory;
-use Magento\Framework\Filesystem;
use Magento\Framework\Module\Dir;
class ReaderTest extends \PHPUnit\Framework\TestCase
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
index 12ddfea8c83d1..255f5783dbc60 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Module\Test\Unit;
-use Magento\Framework\Module\Plugin\DbStatusValidator;
-
class ManagerTest extends \PHPUnit\Framework\TestCase
{
/**
diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php
index 55b2f1da21cb9..5c33ac150d00a 100644
--- a/lib/internal/Magento/Framework/Mview/Config/Converter.php
+++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php
@@ -5,7 +5,6 @@
*/
namespace Magento\Framework\Mview\Config;
-use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Mview\View\SubscriptionInterface;
class Converter implements \Magento\Framework\Config\ConverterInterface
diff --git a/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php b/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php
index 7cafc35ba1451..7eeea70ffe337 100644
--- a/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php
+++ b/lib/internal/Magento/Framework/Mview/Config/SchemaLocator.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Mview\Config;
-use Magento\Framework\App\Filesystem\DirectoryList;
-
class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
{
/**
diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php
index ea8b7cfc068ac..4830c5e140917 100644
--- a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php
+++ b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/ReaderTest.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\Mview\Test\Unit\Config;
-use Magento\Framework\App\Filesystem\DirectoryList;
-
class ReaderTest extends \PHPUnit\Framework\TestCase
{
/**
diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php
index 0f441b7728fce..4fb06ce3f06fd 100644
--- a/lib/internal/Magento/Framework/Mview/View/Changelog.php
+++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Mview\View;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Phrase;
class Changelog implements ChangelogInterface
diff --git a/lib/internal/Magento/Framework/Notification/MessageList.php b/lib/internal/Magento/Framework/Notification/MessageList.php
index 8fb91890b2ff0..ac753b48c8944 100644
--- a/lib/internal/Magento/Framework/Notification/MessageList.php
+++ b/lib/internal/Magento/Framework/Notification/MessageList.php
@@ -72,7 +72,7 @@ protected function _loadMessages()
public function getMessageByIdentity($identity)
{
$this->_loadMessages();
- return isset($this->_messages[$identity]) ? $this->_messages[$identity] : null;
+ return $this->_messages[$identity] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php b/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php
index e4e82fc1ac7b3..492af22815311 100644
--- a/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php
+++ b/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php
@@ -6,10 +6,7 @@
namespace Magento\Framework\ObjectManager;
use Magento\Framework\Filesystem\DriverInterface;
-use Magento\Framework\Interception\Code\Generator as InterceptionGenerator;
use Magento\Framework\ObjectManager\Definition\Runtime;
-use Magento\Framework\ObjectManager\Profiler\Code\Generator as ProfilerGenerator;
-use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\Code\Generator\Autoloader;
/**
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 1ca755b1281ec..72eccbc5e7dea 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
@@ -6,7 +6,6 @@
namespace Magento\Framework\ObjectManager\Test\Unit\Code\Generator;
use Magento\Framework\Api\Test\Unit\Code\Generator\EntityChildTestAbstract;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
/**
* Class RepositoryTest
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/Fixture/Polymorphous.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/Fixture/Polymorphous.php
index ebb7d76dcb63c..0c1a2128560f8 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/Fixture/Polymorphous.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/Fixture/Polymorphous.php
@@ -26,6 +26,6 @@ public function __construct()
*/
public function getArg($key)
{
- return isset($this->args[$key]) ? $this->args[$key] : null;
+ return $this->args[$key] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Helper/CompositeTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Helper/CompositeTest.php
index 14a40c76bc470..8e3681cab611f 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Helper/CompositeTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Helper/CompositeTest.php
@@ -9,7 +9,6 @@
use \Magento\Framework\ObjectManager\Helper\Composite;
use Magento\Framework\ObjectManager\Helper\Composite as CompositeHelper;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
class CompositeTest extends \PHPUnit\Framework\TestCase
{
diff --git a/lib/internal/Magento/Framework/Pricing/Amount/Base.php b/lib/internal/Magento/Framework/Pricing/Amount/Base.php
index 2664ccc54944c..d055819a4a126 100644
--- a/lib/internal/Magento/Framework/Pricing/Amount/Base.php
+++ b/lib/internal/Magento/Framework/Pricing/Amount/Base.php
@@ -105,9 +105,7 @@ public function getBaseAmount()
*/
public function getAdjustmentAmount($adjustmentCode)
{
- return isset($this->adjustmentAmounts[$adjustmentCode])
- ? $this->adjustmentAmounts[$adjustmentCode]
- : false;
+ return $this->adjustmentAmounts[$adjustmentCode] ?? false;
}
/**
diff --git a/lib/internal/Magento/Framework/Pricing/Price/Pool.php b/lib/internal/Magento/Framework/Pricing/Price/Pool.php
index b460113fc32c8..dfdd0c52681e1 100644
--- a/lib/internal/Magento/Framework/Pricing/Price/Pool.php
+++ b/lib/internal/Magento/Framework/Pricing/Price/Pool.php
@@ -141,6 +141,6 @@ public function offsetUnset($offset)
*/
public function offsetGet($offset)
{
- return isset($this->prices[$offset]) ? $this->prices[$offset] : null;
+ return $this->prices[$offset] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/Reflection/CustomAttributesProcessor.php b/lib/internal/Magento/Framework/Reflection/CustomAttributesProcessor.php
index 4fd3a17fb6c6a..18308724c0226 100644
--- a/lib/internal/Magento/Framework/Reflection/CustomAttributesProcessor.php
+++ b/lib/internal/Magento/Framework/Reflection/CustomAttributesProcessor.php
@@ -6,11 +6,8 @@
namespace Magento\Framework\Reflection;
-use Magento\Framework\Phrase;
use Magento\Framework\Api\AttributeInterface;
use Magento\Framework\Api\AttributeValue;
-use Magento\Framework\Api\SimpleDataObjectConverter;
-use Zend\Code\Reflection\MethodReflection;
use Magento\Framework\Api\CustomAttributesDataInterface;
use Magento\Framework\Api\AttributeTypeResolverInterface;
diff --git a/lib/internal/Magento/Framework/Reflection/ExtensionAttributesProcessor.php b/lib/internal/Magento/Framework/Reflection/ExtensionAttributesProcessor.php
index 3e9eef4fd7b15..aa978e7f337cc 100644
--- a/lib/internal/Magento/Framework/Reflection/ExtensionAttributesProcessor.php
+++ b/lib/internal/Magento/Framework/Reflection/ExtensionAttributesProcessor.php
@@ -11,7 +11,6 @@
use Magento\Framework\AuthorizationInterface;
use Magento\Framework\Phrase;
use Magento\Framework\Api\ExtensionAttributesInterface;
-use Magento\Framework\Reflection\MethodsMap;
use Zend\Code\Reflection\MethodReflection;
/**
diff --git a/lib/internal/Magento/Framework/Reflection/FieldNamer.php b/lib/internal/Magento/Framework/Reflection/FieldNamer.php
index 8e4d077c52e08..a208764352f58 100644
--- a/lib/internal/Magento/Framework/Reflection/FieldNamer.php
+++ b/lib/internal/Magento/Framework/Reflection/FieldNamer.php
@@ -6,12 +6,7 @@
namespace Magento\Framework\Reflection;
-use Magento\Framework\Phrase;
-use Magento\Framework\Api\AttributeValue;
-use Magento\Framework\Api\CustomAttributesDataInterface;
use Magento\Framework\Api\SimpleDataObjectConverter;
-use Zend\Code\Reflection\ClassReflection;
-use Zend\Code\Reflection\MethodReflection;
/**
* Determines the name to use for fields in a data output array given method metadata.
diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/NameFinderTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/NameFinderTest.php
index a467c4b7b5aad..e4c0294c0cfb5 100644
--- a/lib/internal/Magento/Framework/Reflection/Test/Unit/NameFinderTest.php
+++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/NameFinderTest.php
@@ -7,7 +7,6 @@
namespace Magento\Framework\Reflection\Test\Unit;
use Zend\Code\Reflection\ClassReflection;
-use Magento\Framework\Exception\SerializationException;
/**
* NameFinder Unit Test
diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Adapter.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Adapter.php
index 098782b4e814e..11bd746eb71e5 100644
--- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Adapter.php
+++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Adapter.php
@@ -7,7 +7,6 @@
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Ddl\Table;
-use Magento\Framework\DB\Select;
use Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder as AggregationBuilder;
use Magento\Framework\Search\AdapterInterface;
use Magento\Framework\Search\RequestInterface;
@@ -70,7 +69,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
* @throws \LogicException
*/
public function query(RequestInterface $request)
diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Aggregation/Builder/Term.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Aggregation/Builder/Term.php
index ed3018756cdd6..78ff7b04fd39c 100644
--- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Aggregation/Builder/Term.php
+++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Aggregation/Builder/Term.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder;
use Magento\Framework\DB\Ddl\Table;
-use Magento\Framework\DB\Select;
use Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderInterface;
use Magento\Framework\Search\Request\BucketInterface as RequestBucketInterface;
diff --git a/lib/internal/Magento/Framework/Search/Request/IndexScopeResolverInterface.php b/lib/internal/Magento/Framework/Search/Request/IndexScopeResolverInterface.php
index d9412cb8517fa..9e907883bb2b9 100644
--- a/lib/internal/Magento/Framework/Search/Request/IndexScopeResolverInterface.php
+++ b/lib/internal/Magento/Framework/Search/Request/IndexScopeResolverInterface.php
@@ -6,8 +6,8 @@
namespace Magento\Framework\Search\Request;
/**
- * Interface \Magento\Framework\Search\Request\IndexScopeResolverInterface
- *
+ * Resolve table name by provided dimensions. Scope Resolver must accept all dimensions that potentially can be used to
+ * resolve table name, but certain implementation can filter them if needed
*/
interface IndexScopeResolverInterface
{
diff --git a/lib/internal/Magento/Framework/Search/Response/Aggregation.php b/lib/internal/Magento/Framework/Search/Response/Aggregation.php
index 9cb7a364ff21c..ea72597c53034 100644
--- a/lib/internal/Magento/Framework/Search/Response/Aggregation.php
+++ b/lib/internal/Magento/Framework/Search/Response/Aggregation.php
@@ -47,7 +47,7 @@ public function getIterator()
*/
public function getBucket($bucketName)
{
- return isset($this->buckets[$bucketName]) ? $this->buckets[$bucketName] : null;
+ return $this->buckets[$bucketName] ?? null;
}
/**
diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/AdapterTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/AdapterTest.php
index ef4a4d62322ed..55d26493ca379 100644
--- a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/AdapterTest.php
+++ b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/AdapterTest.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Search\Test\Unit\Adapter\Mysql;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Search\Request\BucketInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
diff --git a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
index 1f8e7cf9d0bc3..aac25400cec85 100644
--- a/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
+++ b/lib/internal/Magento/Framework/Serialize/Test/Unit/Serializer/SerializeTest.php
@@ -7,7 +7,6 @@
use Magento\Framework\Serialize\Serializer\Serialize;
use Magento\Framework\Serialize\Signer;
-use Psr\Log\LoggerInterface;
use Magento\Framework\Serialize\InvalidSignatureException;
class SerializeTest extends \PHPUnit\Framework\TestCase
diff --git a/lib/internal/Magento/Framework/Session/SaveHandler/DbTable.php b/lib/internal/Magento/Framework/Session/SaveHandler/DbTable.php
index 6f5937e08455d..cf3449a8c3fcf 100644
--- a/lib/internal/Magento/Framework/Session/SaveHandler/DbTable.php
+++ b/lib/internal/Magento/Framework/Session/SaveHandler/DbTable.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Session\SaveHandler;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Exception\SessionException;
use Magento\Framework\Phrase;
diff --git a/lib/internal/Magento/Framework/Session/SaveHandler/Redis.php b/lib/internal/Magento/Framework/Session/SaveHandler/Redis.php
index 53af1847d1012..cd1cef5da6ddd 100644
--- a/lib/internal/Magento/Framework/Session/SaveHandler/Redis.php
+++ b/lib/internal/Magento/Framework/Session/SaveHandler/Redis.php
@@ -14,13 +14,28 @@
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;
-class Redis extends \Cm\RedisSession\Handler
+class Redis implements \SessionHandlerInterface
{
+ /**
+ * @var ConfigInterface
+ */
+ private $config;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
/**
* @var Filesystem
*/
private $filesystem;
+ /**
+ * @var \Cm\RedisSession\Handler[]
+ */
+ private $connection;
+
/**
* @param ConfigInterface $config
* @param LoggerInterface $logger
@@ -29,23 +44,117 @@ class Redis extends \Cm\RedisSession\Handler
*/
public function __construct(ConfigInterface $config, LoggerInterface $logger, Filesystem $filesystem)
{
+ $this->config = $config;
+ $this->logger = $logger;
$this->filesystem = $filesystem;
- try {
- parent::__construct($config, $logger);
- } catch (ConnectionFailedException $e) {
- throw new SessionException(new Phrase($e->getMessage()));
+ }
+
+ /**
+ * Get connection
+ *
+ * @return \Cm\RedisSession\Handler
+ * @throws SessionException
+ */
+ private function getConnection()
+ {
+ $pid = getmypid();
+ if (!isset($this->connection[$pid])) {
+ try {
+ $this->connection[$pid] = new \Cm\RedisSession\Handler($this->config, $this->logger);
+ } catch (ConnectionFailedException $e) {
+ throw new SessionException(new Phrase($e->getMessage()));
+ }
}
+ return $this->connection[$pid];
}
/**
- * {@inheritdoc}
+ * Open session
+ *
+ * @param string $savePath ignored
+ * @param string $sessionName ignored
+ * @return bool
+ * @throws SessionException
+ */
+ public function open($savePath, $sessionName)
+ {
+ return $this->getConnection()->open($savePath, $sessionName);
+ }
+
+ /**
+ * Fetch session data
+ *
+ * @param string $sessionId
+ * @return string
+ * @throws ConcurrentConnectionsExceededException
+ * @throws SessionException
*/
public function read($sessionId)
{
try {
- return parent::read($sessionId);
+ return $this->getConnection()->read($sessionId);
} catch (ConcurrentConnectionsExceededException $e) {
require $this->filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/503.php');
}
}
+
+ /**
+ * Update session
+ *
+ * @param string $sessionId
+ * @param string $sessionData
+ * @return boolean
+ * @throws SessionException
+ */
+ public function write($sessionId, $sessionData)
+ {
+ return $this->getConnection()->write($sessionId, $sessionData);
+ }
+
+ /**
+ * Destroy session
+ *
+ * @param string $sessionId
+ * @return boolean
+ * @throws SessionException
+ */
+ public function destroy($sessionId)
+ {
+ return $this->getConnection()->destroy($sessionId);
+ }
+
+ /**
+ * Overridden to prevent calling getLifeTime at shutdown
+ *
+ * @return bool
+ * @throws SessionException
+ */
+ public function close()
+ {
+ return $this->getConnection()->close();
+ }
+
+ /**
+ * Garbage collection
+ *
+ * @param int $maxLifeTime ignored
+ * @return boolean
+ * @throws SessionException
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ */
+ public function gc($maxLifeTime)
+ {
+ return $this->getConnection()->gc($maxLifeTime);
+ }
+
+ /**
+ * Get the number of failed lock attempts
+ *
+ * @return int
+ * @throws SessionException
+ */
+ public function getFailedLockAttempts()
+ {
+ return $this->getConnection()->getFailedLockAttempts();
+ }
}
diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php
index e4130147a5da0..662173ad4a09a 100644
--- a/lib/internal/Magento/Framework/Session/SessionManager.php
+++ b/lib/internal/Magento/Framework/Session/SessionManager.php
@@ -473,7 +473,7 @@ protected function _addHost()
*/
protected function _getHosts()
{
- return isset($_SESSION[self::HOST_KEY]) ? $_SESSION[self::HOST_KEY] : [];
+ return $_SESSION[self::HOST_KEY] ?? [];
}
/**
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 4594a471e008d..a604178bc36cc 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
@@ -6,7 +6,6 @@
namespace Magento\Framework\Session\Test\Unit\SaveHandler\Redis;
use Cm\RedisSession\Handler\LoggerInterface;
-use Magento\Framework\Session\SaveHandler\Redis\Logger;
class LoggerTest extends \PHPUnit\Framework\TestCase
{
diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/_files/setcookie_mock.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/_files/setcookie_mock.php
index e97dfab795c59..f89144f9753db 100644
--- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/_files/setcookie_mock.php
+++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/_files/setcookie_mock.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Stdlib\Cookie;
-use \Magento\Framework\Stdlib\Cookie\PhpCookieManager;
use \Magento\Framework\Stdlib\Test\Unit\Cookie\PhpCookieManagerTest;
/**
diff --git a/lib/internal/Magento/Framework/System/Dirs.php b/lib/internal/Magento/Framework/System/Dirs.php
index 1bab4c90b3bec..6328921d40bb0 100644
--- a/lib/internal/Magento/Framework/System/Dirs.php
+++ b/lib/internal/Magento/Framework/System/Dirs.php
@@ -5,8 +5,6 @@
*/
namespace Magento\Framework\System;
-use Magento\Framework\Filesystem\DriverInterface;
-
class Dirs
{
/**
diff --git a/lib/internal/Magento/Framework/System/Ftp.php b/lib/internal/Magento/Framework/System/Ftp.php
index 827e524a62464..8bf898965cbc3 100644
--- a/lib/internal/Magento/Framework/System/Ftp.php
+++ b/lib/internal/Magento/Framework/System/Ftp.php
@@ -6,8 +6,6 @@
namespace Magento\Framework\System;
-use Magento\Framework\Filesystem\DriverInterface;
-
/**
* Class to work with remote FTP server
*/
diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php
index 11f828370d441..11aeb1c0c79b8 100644
--- a/lib/internal/Magento/Framework/Url.php
+++ b/lib/internal/Magento/Framework/Url.php
@@ -1074,7 +1074,7 @@ function ($match) {
if ($match[1] == '?') {
return isset($match[3]) ? '?' : '';
} elseif ($match[1] == '&' || $match[1] == '&') {
- return isset($match[3]) ? $match[3] : '';
+ return $match[3] ?? '';
}
}
},
diff --git a/lib/internal/Magento/Framework/Validator/Exception.php b/lib/internal/Magento/Framework/Validator/Exception.php
index c70ecfabb52af..370f66c424b01 100644
--- a/lib/internal/Magento/Framework/Validator/Exception.php
+++ b/lib/internal/Magento/Framework/Validator/Exception.php
@@ -84,6 +84,6 @@ public function getMessages($type = '')
}
return $allMessages;
}
- return isset($this->messages[$type]) ? $this->messages[$type] : [];
+ return $this->messages[$type] ?? [];
}
}
diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php
index 38f2b220dee6f..7016bbdb08ab2 100644
--- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php
+++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php
@@ -5,7 +5,6 @@
*/
namespace Magento\Framework\View\Asset\PreProcessor;
-use Magento\Framework\Filesystem;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\View\Asset\File\FallbackContext;
use Magento\Framework\View\Asset\LockerProcessInterface;
diff --git a/lib/internal/Magento/Framework/View/Asset/PropertyGroup.php b/lib/internal/Magento/Framework/View/Asset/PropertyGroup.php
index ad86dfca47a25..4fe8f48d6b723 100644
--- a/lib/internal/Magento/Framework/View/Asset/PropertyGroup.php
+++ b/lib/internal/Magento/Framework/View/Asset/PropertyGroup.php
@@ -45,6 +45,6 @@ public function getProperties()
*/
public function getProperty($name)
{
- return isset($this->properties[$name]) ? $this->properties[$name] : null;
+ return $this->properties[$name] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/View/BlockPool.php b/lib/internal/Magento/Framework/View/BlockPool.php
index c50af9d5bbc5f..dff280057fdaf 100644
--- a/lib/internal/Magento/Framework/View/BlockPool.php
+++ b/lib/internal/Magento/Framework/View/BlockPool.php
@@ -72,6 +72,6 @@ public function get($name = null)
return $this->blocks;
}
- return isset($this->blocks[$name]) ? $this->blocks[$name] : null;
+ return $this->blocks[$name] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/View/DataSourcePool.php b/lib/internal/Magento/Framework/View/DataSourcePool.php
index 24bdb6639981b..94f4f1dceae97 100644
--- a/lib/internal/Magento/Framework/View/DataSourcePool.php
+++ b/lib/internal/Magento/Framework/View/DataSourcePool.php
@@ -80,7 +80,7 @@ public function get($name = null)
return $this->dataSources;
}
- return isset($this->dataSources[$name]) ? $this->dataSources[$name] : null;
+ return $this->dataSources[$name] ?? null;
}
/**
@@ -107,6 +107,6 @@ public function assign($dataName, $namespace, $alias)
*/
public function getNamespaceData($namespace)
{
- return isset($this->assignments[$namespace]) ? $this->assignments[$namespace] : [];
+ return $this->assignments[$namespace] ?? [];
}
}
diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Validator.php b/lib/internal/Magento/Framework/View/Design/Theme/Validator.php
index 06c78e7125040..04e775d730b56 100644
--- a/lib/internal/Magento/Framework/View/Design/Theme/Validator.php
+++ b/lib/internal/Magento/Framework/View/Design/Theme/Validator.php
@@ -118,7 +118,7 @@ public function addDataValidators($dataKey, $validators)
public function getErrorMessages($dataKey = null)
{
if ($dataKey) {
- return isset($this->_errorMessages[$dataKey]) ? $this->_errorMessages[$dataKey] : [];
+ return $this->_errorMessages[$dataKey] ?? [];
}
return $this->_errorMessages;
}
diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php
index 0ffa9dce7f730..b2f857bf29f45 100644
--- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php
+++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php
@@ -1074,7 +1074,7 @@ protected function getCacheLifetime()
$cacheLifetime = $this->getData('cache_lifetime');
if (false === $cacheLifetime || null === $cacheLifetime) {
- return $cacheLifetime;
+ return null;
}
return (int)$cacheLifetime;
diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php
index 73f125be77c79..48a66b429ebd5 100644
--- a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php
+++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php
@@ -213,7 +213,7 @@ public function getFiltersParams()
public function getFilterParam($key, $defaultValue = null)
{
$filter = $this->getFiltersParams();
- return isset($filter[$key]) ? $filter[$key] : $defaultValue;
+ return $filter[$key] ?? $defaultValue;
}
/**
diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProvider.php b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProvider.php
index b2288a47f8f83..baa4e94eed978 100644
--- a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProvider.php
+++ b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProvider.php
@@ -181,7 +181,7 @@ public function getMeta()
*/
public function getFieldSetMetaInfo($fieldSetName)
{
- return isset($this->meta[$fieldSetName]) ? $this->meta[$fieldSetName] : [];
+ return $this->meta[$fieldSetName] ?? [];
}
/**
@@ -190,7 +190,7 @@ public function getFieldSetMetaInfo($fieldSetName)
*/
public function getFieldsMetaInfo($fieldSetName)
{
- return isset($this->meta[$fieldSetName]['children']) ? $this->meta[$fieldSetName]['children'] : [];
+ return $this->meta[$fieldSetName]['children'] ?? [];
}
/**
@@ -200,9 +200,7 @@ public function getFieldsMetaInfo($fieldSetName)
*/
public function getFieldMetaInfo($fieldSetName, $fieldName)
{
- return isset($this->meta[$fieldSetName]['children'][$fieldName])
- ? $this->meta[$fieldSetName]['children'][$fieldName]
- : [];
+ return $this->meta[$fieldSetName]['children'][$fieldName] ?? [];
}
/**
@@ -291,7 +289,7 @@ public function getData()
*/
public function getConfigData()
{
- return isset($this->data['config']) ? $this->data['config'] : [];
+ return $this->data['config'] ?? [];
}
/**
diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php
index bd94491537efe..5cd7591098207 100755
--- a/lib/internal/Magento/Framework/View/Layout.php
+++ b/lib/internal/Magento/Framework/View/Layout.php
@@ -13,7 +13,6 @@
use Magento\Framework\Message\ManagerInterface as MessageManagerInterface;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\View\Layout\Element;
-use Magento\Framework\View\Layout\ScheduledStructure;
use Psr\Log\LoggerInterface as Logger;
/**
diff --git a/lib/internal/Magento/Framework/View/Layout/Generic.php b/lib/internal/Magento/Framework/View/Layout/Generic.php
index b83545ff3c439..b527d1a817a96 100644
--- a/lib/internal/Magento/Framework/View/Layout/Generic.php
+++ b/lib/internal/Magento/Framework/View/Layout/Generic.php
@@ -200,6 +200,6 @@ protected function createChildFormComponent(UiComponentInterface $childComponent
*/
protected function getConfig($name)
{
- return isset($this->data['config'][$name]) ? $this->data['config'][$name] : null;
+ return $this->data['config'][$name] ?? null;
}
}
diff --git a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure.php b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure.php
index 25a04845a0728..3193e10282fd4 100644
--- a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure.php
+++ b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure.php
@@ -146,7 +146,7 @@ public function unsetElementToSort($elementName)
*/
public function getElementToSort($elementName, array $default = [])
{
- return isset($this->elementsToSort[$elementName]) ? $this->elementsToSort[$elementName] : $default;
+ return $this->elementsToSort[$elementName] ?? $default;
}
/**
@@ -257,7 +257,7 @@ public function unsetElement($elementName)
*/
public function getElementToMove($elementName, $default = null)
{
- return isset($this->scheduledMoves[$elementName]) ? $this->scheduledMoves[$elementName] : $default;
+ return $this->scheduledMoves[$elementName] ?? $default;
}
/**
@@ -370,7 +370,7 @@ public function unsetStructureElement($elementName)
*/
public function getStructureElementData($elementName, $default = null)
{
- return isset($this->scheduledData[$elementName]) ? $this->scheduledData[$elementName] : $default;
+ return $this->scheduledData[$elementName] ?? $default;
}
/**
@@ -524,6 +524,6 @@ public function populateWithArray(array $data)
*/
private function getArrayValueByKey($key, array $array)
{
- return isset($array[$key]) ? $array[$key] : [];
+ return $array[$key] ?? [];
}
}
diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php
index d42d30e35cc5b..1a21e61f867d8 100644
--- a/lib/internal/Magento/Framework/View/Page/Config.php
+++ b/lib/internal/Magento/Framework/View/Page/Config.php
@@ -508,7 +508,7 @@ public function setElementAttribute($elementType, $attribute, $value)
public function getElementAttribute($elementType, $attribute)
{
$this->build();
- return isset($this->elements[$elementType][$attribute]) ? $this->elements[$elementType][$attribute] : null;
+ return $this->elements[$elementType][$attribute] ?? null;
}
/**
@@ -518,7 +518,7 @@ public function getElementAttribute($elementType, $attribute)
public function getElementAttributes($elementType)
{
$this->build();
- return isset($this->elements[$elementType]) ? $this->elements[$elementType] : [];
+ return $this->elements[$elementType] ?? [];
}
/**
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php
index 70233c0196dc5..5f7508438a6ed 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php
@@ -290,9 +290,9 @@ public function getCacheLifetimeDataProvider()
'dataFromCache' => 'dataFromCache',
'dataForSaveCache' => '',
'expectsDispatchEvent' => $this->exactly(2),
- 'expectsCacheLoad' => $this->once(),
+ 'expectsCacheLoad' => $this->never(),
'expectsCacheSave' => $this->never(),
- 'expectedResult' => 'dataFromCache',
+ 'expectedResult' => '',
],
[
'cacheLifetime' => 120,
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css
index d7ce9e81258db..420083613705f 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css
@@ -2,8 +2,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-body {background: url(body.gif);}
@import url(../recursive.css);
-p {background: url(1.gif?param);}
@import url("deep/recursive.css");
+body {background: url(body.gif);}
+p {background: url(1.gif?param);}
h1 {background: url('../h1.gif#param');} h2 {background: url(../images/h2.gif?test);}
diff --git a/lib/internal/Magento/Framework/Webapi/ServiceOutputProcessor.php b/lib/internal/Magento/Framework/Webapi/ServiceOutputProcessor.php
index d8e1a3de3670a..cdb6ed799aade 100644
--- a/lib/internal/Magento/Framework/Webapi/ServiceOutputProcessor.php
+++ b/lib/internal/Magento/Framework/Webapi/ServiceOutputProcessor.php
@@ -9,7 +9,6 @@
use Magento\Framework\Api\ExtensibleDataObjectConverter;
use Magento\Framework\Reflection\DataObjectProcessor;
use Magento\Framework\Reflection\MethodsMap;
-use Magento\Framework\Webapi\ServicePayloadConverterInterface;
/**
* Data object converter
diff --git a/lib/internal/Magento/Framework/Xml/Generator.php b/lib/internal/Magento/Framework/Xml/Generator.php
index 975073e443d0e..f165793c2e2a4 100644
--- a/lib/internal/Magento/Framework/Xml/Generator.php
+++ b/lib/internal/Magento/Framework/Xml/Generator.php
@@ -146,8 +146,6 @@ public function setIndexedArrayItemName($name)
*/
protected function _getIndexedArrayItemName()
{
- return isset($this->_defaultIndexedArrayItemName)
- ? $this->_defaultIndexedArrayItemName
- : self::DEFAULT_ENTITY_ITEM_NAME;
+ return $this->_defaultIndexedArrayItemName ?? self::DEFAULT_ENTITY_ITEM_NAME;
}
}
diff --git a/lib/internal/Magento/Framework/Xml/Security.php b/lib/internal/Magento/Framework/Xml/Security.php
index e502429e4511a..ec901a63ea862 100644
--- a/lib/internal/Magento/Framework/Xml/Security.php
+++ b/lib/internal/Magento/Framework/Xml/Security.php
@@ -6,7 +6,6 @@
namespace Magento\Framework\Xml;
use DOMDocument;
-use Magento\Framework\Phrase;
/**
* Class Security
diff --git a/lib/web/css/docs/actions-toolbar.html b/lib/web/css/docs/actions-toolbar.html
index 4a3fbe515ca95..0c2186bf0458c 100644
--- a/lib/web/css/docs/actions-toolbar.html
+++ b/lib/web/css/docs/actions-toolbar.html
@@ -301,4 +301,4 @@
.example-actions-toolbar-12 {
.lib-actions-toolbar-clear-floats();
}
-}
+} |