diff --git a/.htaccess b/.htaccess index 365054378918f76b0da55fcdcb256e7f6f9fb822..f1ef8719ba1a8421e3d58aeceee851da731e4f77 100644 --- a/.htaccess +++ b/.htaccess @@ -32,7 +32,7 @@ ## adjust memory limit # php_value memory_limit 64M - php_value memory_limit 2048M + php_value memory_limit 768M php_value max_execution_time 18000 ############################################ @@ -47,7 +47,7 @@ #php_flag zlib.output_compression on ########################################### -# disable user agent verification to not break multiple image upload +## disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off @@ -55,12 +55,19 @@ <IfModule mod_security.c> ########################################### -# disable POST processing to not break multiple image upload +## disable POST processing to not break multiple image upload SecFilterEngine Off SecFilterScanPOST Off </IfModule> +<IfModule mod_headers.c> +############################################ +## prevent clickjacking + + Header set X-Frame-Options SAMEORIGIN +</IfModule> + <IfModule mod_deflate.c> ############################################ @@ -173,11 +180,11 @@ ## Deny access to release notes to prevent disclosure of the installed Magento version <Files RELEASE_NOTES.txt> - order allow,deny - deny from all + Order allow,deny + Deny from all </Files> ############################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags - #FileETag none \ No newline at end of file + #FileETag none diff --git a/.htaccess.sample b/.htaccess.sample index cf7ae187b7e7ae2b86cd54368fe1d650fb83b98b..ed07a267d1f764c0cb750ac33920404a8ac3e316 100644 --- a/.htaccess.sample +++ b/.htaccess.sample @@ -31,7 +31,6 @@ ############################################ ## adjust memory limit -# php_value memory_limit 64M php_value memory_limit 128M php_value max_execution_time 18000 @@ -47,7 +46,7 @@ #php_flag zlib.output_compression on ########################################### -# disable user agent verification to not break multiple image upload +## disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off @@ -55,12 +54,19 @@ <IfModule mod_security.c> ########################################### -# disable POST processing to not break multiple image upload +## disable POST processing to not break multiple image upload SecFilterEngine Off SecFilterScanPOST Off </IfModule> +<IfModule mod_headers.c> +############################################ +## prevent clickjacking + + Header set X-Frame-Options SAMEORIGIN +</IfModule> + <IfModule mod_deflate.c> ############################################ @@ -118,6 +124,12 @@ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +############################################ +## TRACE and TRACK HTTP methods disabled to prevent XSS attacks + + RewriteCond %{REQUEST_METHOD} ^TRAC[EK] + RewriteRule .* - [L,R=405] + ############################################ ## always send 404 on missing files in these folders @@ -161,6 +173,14 @@ Order allow,deny Allow from all +########################################### +## Deny access to release notes to prevent disclosure of the installed Magento version + + <Files RELEASE_NOTES.txt> + Order allow,deny + Deny from all + </Files> + ############################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags diff --git a/CHANGELOG.md b/CHANGELOG.md index 7abbad3509e7aad1e119371cb317cd914fee6cd3..43082e21c24c1a6add35796c63fd2adcc7082bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,60 @@ +2.0.0.0-dev74 +============= +* Pricing Improvements: + * Added price calculation component to library + * Eliminated price calculation from blocks and templates and implemented new calculation models for the following product types: + * Bundle + * Simple/Virtual + * Grouped + * Downloadable + * Resolved price calculation dependencies on the Tax and Weee modules +* Themes update: + * Updated the look&feel of the Admin theme +* Fixed bugs: + * Fixed an issue with the inability to save product with grouped price when Price Scope = Website + * Fixed an issue with fatal error on attempt to edit product from wishlist in stores with multiple store views + * Fixed an issue where it was impossible to add to a wishlist a product with custom quantity + * Fixed an issue where JS validation was skipped during CMS page creation + * Fixed an issue with the New Customer Address Attribute page and the New Customer Attribute page having the same title + * Fixed an issue where a form was submitted two times during CMS page creation + * Fixed an issue where a fatal error appeared when trying to edit product in a wishlist in stores with multiple store views + * Fixed an issue with inability to change page layout for categories + * Fixed an issue where the Quantity drop-down list box was disabled for bundle products + * Fixed an issue where inactive Related Products rules were applied + * Fixed a clickjacking vulnerability + * Fixed bugs and added improvements in the Blank theme + * Fixed an issue where the Flat Rate shipping method was not enabled by default + * Fixed an issue with incorrect order of products on the Add Product split button + * Fixed an issue with saving the tier price attribute value + * Fixed an issue with creating integration from config file + * Fixed an issue where the Cookie Restriction Mode = Yes configuration was not applied + * Fixed an issue where it was impossible to perform ajax actions from backend grids in Internet Explorer + * Fixed the improper usage of DIRECTORY_SEPARATOR + * Fixed an issue where it was impossible to add new address on customer's account page if default address had been already set + * Fixed an issue where setting memory_limit to -1 caused installation failure + * Fixed an issue where the configuration of Admin Session Lifetime was not applied correctly + * Fixed an issue where Scheduled Export was not performed if exporting to remote FTP server + * Fixed the wrong default value for PHP memory_limit + * Fixed an issue where frontend messages were not displayed when FPC was turned off + * Fixed the position of page action buttons on the Categories page in the backend + * Improved backend grids UI +* Framework Improvements: + * Simplified Search related Data Objects + * Moved lib/Magento/* to lib/Magento/Framework/* + * Moved lib/Magento/App to lib/Magento/Framework/App +* Refactored the following modules to use Customer service: + * PayPalRecurringPayment + * RecurringPayment + * Multishipping + * Paypal +* Customer Service usage: + * Implemented Service Context Provider + * Restructured webapi.xml + * Renamed createAccount to createCustomer in CustomerAccountService + * Implemented Caching strategy for the Customer service +* GitHub requests: + * [#488] (https://github.com/magento/magento2/issues/488) -- Converted several grids from Magento\Sales module to new layout XML config format + 2.0.0.0-dev73 ============= * Framework Improvements: diff --git a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php index d22b424f66d1a1432f1275d398ae416da89fd8d2..89e023d2c5bf0458f09fb09e3b2e4081f07eb6c0 100644 --- a/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php +++ b/app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php @@ -54,20 +54,20 @@ class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstrac */ public function render(\Magento\Object $row) { - $readDetailsHtml = $row->getUrl() ? '<a target="_blank" href="' . $row->getUrl() . '">' . __( + $readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __( 'Read Details' - ) . '</a> | ' : ''; + ) . '</a>' : ''; - $markAsReadHtml = !$row->getIsRead() ? '<a href="' . $this->getUrl( + $markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl( '*/*/markAsRead/', array('_current' => true, 'id' => $row->getId()) ) . '">' . __( 'Mark as Read' - ) . '</a> | ' : ''; + ) . '</a>' : ''; $encodedUrl = $this->_urlHelper->getEncodedUrl(); return sprintf( - '%s%s<a href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>', + '%s%s<a class="action-delete" href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>', $readDetailsHtml, $markAsReadHtml, $this->getUrl( @@ -75,7 +75,7 @@ class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstrac array( '_current' => true, 'id' => $row->getId(), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl ) ), __('Are you sure?'), diff --git a/app/code/Magento/AdminNotification/Helper/Data.php b/app/code/Magento/AdminNotification/Helper/Data.php index b49459a58bc28bda7510c0781917059e4d355c0e..e2d7c82a9ee5ebbed4d7d9a6d2fd73ba5400799a 100644 --- a/app/code/Magento/AdminNotification/Helper/Data.php +++ b/app/code/Magento/AdminNotification/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\AdminNotification\Helper; * @package Magento_AdminNotification * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_POPUP_URL = 'system/adminnotification/popup_url'; @@ -65,7 +65,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_unreadNoticeCounts; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -75,13 +75,13 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_inboxFactory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\AdminNotification\Model\InboxFactory $inboxFactory ) { parent::__construct($context); diff --git a/app/code/Magento/AdminNotification/Model/Survey.php b/app/code/Magento/AdminNotification/Model/Survey.php index f2c12c5b43feccef75068db9e1f1404f381eaf26..3ea56c4a49146ab9227bb638b434a1afb383d4ec 100644 --- a/app/code/Magento/AdminNotification/Model/Survey.php +++ b/app/code/Magento/AdminNotification/Model/Survey.php @@ -54,15 +54,15 @@ class Survey protected $_flagFactory; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** * @param \Magento\FlagFactory $flagFactory - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ - public function __construct(\Magento\FlagFactory $flagFactory, \Magento\App\RequestInterface $request) + public function __construct(\Magento\FlagFactory $flagFactory, \Magento\Framework\App\RequestInterface $request) { $this->_request = $request; $this->_flagFactory = $flagFactory; diff --git a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php index 9e8974a816f4f86c5ecdcf543a5e06cc54cd2ed0..91ad984970a8d9898ef120ab079b308586eb5463 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php @@ -31,7 +31,7 @@ class Baseurl implements \Magento\AdminNotification\Model\System\MessageInterfac protected $_urlBuilder; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -41,21 +41,21 @@ class Baseurl implements \Magento\AdminNotification\Model\System\MessageInterfac protected $_storeManager; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $urlBuilder, - \Magento\App\Config\ValueFactory $configValueFactory + \Magento\Framework\App\Config\ValueFactory $configValueFactory ) { $this->_urlBuilder = $urlBuilder; $this->_config = $config; @@ -84,7 +84,7 @@ class Baseurl implements \Magento\AdminNotification\Model\System\MessageInterfac $dataCollection = $this->_configValueFactory->create()->getCollection(); $dataCollection->addValueFilter(\Magento\Store\Model\Store::BASE_URL_PLACEHOLDER); - /** @var $data \Magento\App\Config\ValueInterface */ + /** @var $data \Magento\Framework\App\Config\ValueInterface */ foreach ($dataCollection as $data) { if ($data->getScope() == 'stores') { $code = $this->_storeManager->getStore($data->getScopeId())->getCode(); diff --git a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php index 58beb5d6bf49ca049a29bba5202edba3b1ba879e..1a71a7752122b9aed5a9e3d79bd12f6cb3653376 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php @@ -36,19 +36,19 @@ class CacheOutdated implements \Magento\AdminNotification\Model\System\MessageIn protected $_authorization; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\AuthorizationInterface $authorization * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ public function __construct( \Magento\AuthorizationInterface $authorization, \Magento\UrlInterface $urlBuilder, - \Magento\App\Cache\TypeListInterface $cacheTypeList + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList ) { $this->_authorization = $authorization; $this->_urlBuilder = $urlBuilder; diff --git a/app/code/Magento/AdminNotification/Model/System/Message/Security.php b/app/code/Magento/AdminNotification/Model/System/Message/Security.php index 0b4b6861b3408b760837d6db1ad17cf935c883a0..646c622d901dc8dae1c07ba03fc5cb314949fdba 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/Security.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/Security.php @@ -44,7 +44,7 @@ class Security implements \Magento\AdminNotification\Model\System\MessageInterfa private $_verificationTimeOut = 2; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -54,7 +54,7 @@ class Security implements \Magento\AdminNotification\Model\System\MessageInterfa protected $_backendConfig; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -64,15 +64,15 @@ class Security implements \Magento\AdminNotification\Model\System\MessageInterfa protected $_curlFactory; /** - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Backend\App\ConfigInterface $backendConfig - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\HTTP\Adapter\CurlFactory $curlFactory */ public function __construct( - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Backend\App\ConfigInterface $backendConfig, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\HTTP\Adapter\CurlFactory $curlFactory ) { $this->_cache = $cache; diff --git a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml index fbda21df203ce45d0b8a47639a23ec7a0f938f4b..48ee703a10ef9b8a0bc67e2c320d7679464ce768 100644 --- a/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml +++ b/app/code/Magento/AdminNotification/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_AdminNotification" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml index 205c455ee4496626b35220ebe48ab7d1d41c50e3..15c9289ba82bc0214562f039777f8da3ce517156 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml @@ -40,7 +40,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="severity"> <arguments> <argument name="header" xsi:type="string" translate="true">Severity</argument> - <argument name="width" xsi:type="string">60px</argument> <argument name="index" xsi:type="string">severity</argument> <argument name="renderer" xsi:type="string">Magento\AdminNotification\Block\Grid\Renderer\Severity</argument> </arguments> @@ -50,8 +49,9 @@ <argument name="header" xsi:type="string" translate="true">Date Added</argument> <argument name="id" xsi:type="string">date_added</argument> <argument name="index" xsi:type="string">date_added</argument> - <argument name="width" xsi:type="string">150px</argument> <argument name="type" xsi:type="string">datetime</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="title"> @@ -64,7 +64,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="actions"> <arguments> <argument name="header" xsi:type="string" translate="true">Actions</argument> - <argument name="width" xsi:type="string">250px</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="renderer" xsi:type="string">Magento\AdminNotification\Block\Grid\Renderer\Actions</argument> </arguments> diff --git a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php index c367ba997df92ba9221c34eaed576e733cf4ec8a..2908cd736e3e5f67a067b0ed5a7c13c287d12392 100644 --- a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment.php @@ -25,7 +25,7 @@ */ namespace Magento\Authorizenet\Controller\Authorizenet; -class Payment extends \Magento\App\Action\Action +class Payment extends \Magento\Framework\App\Action\Action { /** * Checkout session @@ -35,10 +35,10 @@ class Payment extends \Magento\App\Action\Action protected $_session; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Checkout\Model\Session $session */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Checkout\Model\Session $session) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $session) { $this->_session = $session; parent::__construct($context); diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php index 485331289dc177d450b6111f1ac6debd608e085b..cd5def51762e24dd58e51ff3a38978b01be64429 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php @@ -30,7 +30,7 @@ namespace Magento\Authorizenet\Controller\Directpost; * * @author Magento Core Team <core@magentocommerce.com> */ -class Payment extends \Magento\App\Action\Action +class Payment extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -40,10 +40,10 @@ class Payment extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Registry $coreRegistry) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Authorizenet/Helper/Backend.php b/app/code/Magento/Authorizenet/Helper/Backend.php index 4909cc32432257d2f94a7362a2d6e779ced770d4..c1f0be73c59618a09075d7a5ab56da896132c488 100644 --- a/app/code/Magento/Authorizenet/Helper/Backend.php +++ b/app/code/Magento/Authorizenet/Helper/Backend.php @@ -31,13 +31,13 @@ namespace Magento\Authorizenet\Helper; class Backend extends Data { /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Backend\Model\UrlInterface $backendUrl */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Backend\Model\UrlInterface $backendUrl diff --git a/app/code/Magento/Authorizenet/Helper/Data.php b/app/code/Magento/Authorizenet/Helper/Data.php index 9b7fb737ccd8f52b3998e8929703e7edc704ac2d..3e355a41082978e13d56ebd94a9e2fdf496eb934 100644 --- a/app/code/Magento/Authorizenet/Helper/Data.php +++ b/app/code/Magento/Authorizenet/Helper/Data.php @@ -28,7 +28,7 @@ namespace Magento\Authorizenet\Helper; /** * Authorize.net Data Helper */ -class Data extends \Magento\App\Helper\AbstractHelper implements HelperInterface +class Data extends \Magento\Framework\App\Helper\AbstractHelper implements HelperInterface { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -41,12 +41,12 @@ class Data extends \Magento\App\Helper\AbstractHelper implements HelperInterface protected $_orderFactory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\OrderFactory $orderFactory */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\OrderFactory $orderFactory ) { @@ -314,10 +314,10 @@ class Data extends \Magento\App\Helper\AbstractHelper implements HelperInterface /** * Get payment method step html * - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view * @return string */ - public function getPaymentMethodsHtml(\Magento\App\ViewInterface $view) + public function getPaymentMethodsHtml(\Magento\Framework\App\ViewInterface $view) { $layout = $view->getLayout(); $update = $layout->getUpdate(); diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet.php b/app/code/Magento/Authorizenet/Model/Authorizenet.php index 4dea7bf1e30409ef51dba9aad2d69c939067822d..0385f47a5e5cdc1bfe159e0525e2533ccd338cdb 100644 --- a/app/code/Magento/Authorizenet/Model/Authorizenet.php +++ b/app/code/Magento/Authorizenet/Model/Authorizenet.php @@ -314,7 +314,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -333,7 +333,7 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index 3b4c40502256f90371615f278ef4d2f330cd281f..b2a35abe9ec9a2817167eb06be8203207a21fd5f 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -93,7 +93,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -117,7 +117,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Session.php b/app/code/Magento/Authorizenet/Model/Directpost/Session.php index 59d0884644c79763655619d171b4e9d9d72ae82e..6eed4fc8d5947d8e55db227516961397a1bb513b 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Session.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Session.php @@ -31,7 +31,7 @@ namespace Magento\Authorizenet\Model\Directpost; class Session extends \Magento\Session\SessionManager { /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -41,7 +41,7 @@ class Session extends \Magento\Session\SessionManager * @internal param array $data */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, diff --git a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml index 2c0b347f6c0c894a2e5bd12040984938ffe03c52..9cae74bde80d624bbcc8c86b8bac3ed43d6824b9 100644 --- a/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml +++ b/app/code/Magento/Authorizenet/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Authorizenet" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Authorizenet/etc/frontend/routes.xml b/app/code/Magento/Authorizenet/etc/frontend/routes.xml index 404e5e4ca55aae4c3058a88816393ce8419f62e4..7b00185f2c1e6795745d9d278c5c8c8a70362886 100644 --- a/app/code/Magento/Authorizenet/etc/frontend/routes.xml +++ b/app/code/Magento/Authorizenet/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="authorizenet" frontName="authorizenet"> <module name="Magento_Authorizenet" /> diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index 4b88183ee989fb163aa8c6514a19d5c20364d755..c68f927bc4b6ca77a10e064509ecc390ad4e7943 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -30,7 +30,7 @@ namespace Magento\Backend\App; * * @SuppressWarnings(PHPMD.NumberOfChildren) */ -abstract class AbstractAction extends \Magento\App\Action\Action +abstract class AbstractAction extends \Magento\Framework\App\Action\Action { /** * Name of "is URLs checked" flag @@ -97,7 +97,7 @@ abstract class AbstractAction extends \Magento\App\Action\Action protected $_formKeyValidator; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_title; @@ -219,10 +219,10 @@ abstract class AbstractAction extends \Magento\App\Action\Action } /** - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ - public function dispatch(\Magento\App\RequestInterface $request) + public function dispatch(\Magento\Framework\App\RequestInterface $request) { if (!$this->_processUrlKeys()) { return parent::dispatch($request); @@ -351,7 +351,7 @@ abstract class AbstractAction extends \Magento\App\Action\Action * * @param string $path * @param array $arguments - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ protected function _redirect($path, $arguments = array()) { diff --git a/app/code/Magento/Backend/App/Action/Context.php b/app/code/Magento/Backend/App/Action/Context.php index d7d986c5bceaeb65264e5942c6bc4994a7734fd6..fad7d173587e1a11be2db517e0caffda49054d45 100644 --- a/app/code/Magento/Backend/App/Action/Context.php +++ b/app/code/Magento/Backend/App/Action/Context.php @@ -28,7 +28,7 @@ namespace Magento\Backend\App\Action; /** * Backend Controller context */ -class Context extends \Magento\App\Action\Context +class Context extends \Magento\Framework\App\Action\Context { /** * @var \Magento\AuthorizationInterface @@ -56,7 +56,7 @@ class Context extends \Magento\App\Action\Context protected $_formKeyValidator; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_title; @@ -76,14 +76,14 @@ class Context extends \Magento\App\Action\Context protected $_localeResolver; /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\ObjectManager $objectManager * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $url - * @param \Magento\App\Response\RedirectInterface $redirect - * @param \Magento\App\ActionFlag $actionFlag - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\Response\RedirectInterface $redirect + * @param \Magento\Framework\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\Backend\Model\Session $session * @param \Magento\AuthorizationInterface $authorization @@ -91,19 +91,19 @@ class Context extends \Magento\App\Action\Context * @param \Magento\Backend\Helper\Data $helper * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator - * @param \Magento\App\Action\Title $title + * @param \Magento\Framework\App\Action\Title $title * @param \Magento\Locale\ResolverInterface $localeResolver * @param bool $canUseBaseUrl */ public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\ResponseInterface $response, \Magento\ObjectManager $objectManager, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $url, - \Magento\App\Response\RedirectInterface $redirect, - \Magento\App\ActionFlag $actionFlag, - \Magento\App\ViewInterface $view, + \Magento\Framework\App\Response\RedirectInterface $redirect, + \Magento\Framework\App\ActionFlag $actionFlag, + \Magento\Framework\App\ViewInterface $view, \Magento\Message\ManagerInterface $messageManager, \Magento\Backend\Model\Session $session, \Magento\AuthorizationInterface $authorization, @@ -111,7 +111,7 @@ class Context extends \Magento\App\Action\Context \Magento\Backend\Helper\Data $helper, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, - \Magento\App\Action\Title $title, + \Magento\Framework\App\Action\Title $title, \Magento\Locale\ResolverInterface $localeResolver, $canUseBaseUrl = false ) { @@ -195,7 +195,7 @@ class Context extends \Magento\App\Action\Context } /** - * @return \Magento\App\Action\Title + * @return \Magento\Framework\App\Action\Title */ public function getTitle() { diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 55c6ce9eec17cd6f2516d5e7e1ea0ea305f4de56..ad396056c6d5dc657eb7473ad905799fa17ad064 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -48,12 +48,12 @@ class Authentication protected $_url; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; @@ -65,15 +65,15 @@ class Authentication /** * @param \Magento\Backend\Model\Auth $auth * @param \Magento\Backend\Model\UrlInterface $url - * @param \Magento\App\ResponseInterface $response - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ResponseInterface $response + * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( \Magento\Backend\Model\Auth $auth, \Magento\Backend\Model\UrlInterface $url, - \Magento\App\ResponseInterface $response, - \Magento\App\ActionFlag $actionFlag, + \Magento\Framework\App\ResponseInterface $response, + \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Message\ManagerInterface $messageManager ) { $this->_auth = $auth; @@ -86,7 +86,7 @@ class Authentication /** * @param \Magento\Backend\App\AbstractAction $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -94,7 +94,7 @@ class Authentication public function aroundDispatch( \Magento\Backend\App\AbstractAction $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $requestedActionName = $request->getActionName(); if (in_array($requestedActionName, $this->_openActions)) { @@ -105,6 +105,8 @@ class Authentication } if (!$this->_auth->isLoggedIn()) { $this->_processNotLoggedInUser($request); + } else { + $this->_auth->getAuthStorage()->prolong(); } } $this->_auth->getAuthStorage()->refreshAcl(); @@ -114,10 +116,10 @@ class Authentication /** * Process not logged in user data * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return void */ - protected function _processNotLoggedInUser(\Magento\App\RequestInterface $request) + protected function _processNotLoggedInUser(\Magento\Framework\App\RequestInterface $request) { $isRedirectNeeded = false; if ($request->getPost('login') && $this->_performLogin($request)) { @@ -170,10 +172,10 @@ class Authentication /** * Performs login, if user submitted login form * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - protected function _performLogin(\Magento\App\RequestInterface $request) + protected function _performLogin(\Magento\Framework\App\RequestInterface $request) { $outputValue = true; $postLogin = $request->getPost('login'); @@ -196,10 +198,10 @@ class Authentication /** * Checks, whether Magento requires redirection after successful admin login, and redirects user, if needed * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - protected function _redirectIfNeededAfterLogin(\Magento\App\RequestInterface $request) + protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInterface $request) { $requestUri = null; @@ -215,7 +217,7 @@ class Authentication } $this->_response->setRedirect($requestUri); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); return true; } } diff --git a/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php b/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php index 099073c21d83eece82cc28bd1ba6b6f65ffced56..6a84f418f6bc4480c0f62067dd38ce18aebf15ed 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php +++ b/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php @@ -32,7 +32,7 @@ class MassactionKey * * @param \Magento\Backend\App\AbstractAction $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -40,7 +40,7 @@ class MassactionKey public function aroundDispatch( \Magento\Backend\App\AbstractAction $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $key = $request->getPost('massaction_prepare_key'); if ($key) { diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index ec422b6de2a3bdc4a7c2f9217a2841c234212046..6befd8b275d956f3795c55e7eededeca741731e3 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\App\Area; -class FrontNameResolver implements \Magento\App\Area\FrontNameResolverInterface +class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolverInterface { const XML_PATH_USE_CUSTOM_ADMIN_PATH = 'admin/url/use_custom_path'; diff --git a/app/code/Magento/Backend/App/Config.php b/app/code/Magento/Backend/App/Config.php index 65946410642405e828bd34f381e07e5124ad6dea..7890c2e78c3578c1388103f5fc1da20cc5456d26 100644 --- a/app/code/Magento/Backend/App/Config.php +++ b/app/code/Magento/Backend/App/Config.php @@ -31,14 +31,14 @@ namespace Magento\Backend\App; class Config implements ConfigInterface { /** - * @var \Magento\App\Config\ScopePool + * @var \Magento\Framework\App\Config\ScopePool */ protected $_scopePool; /** - * @param \Magento\App\Config\ScopePool $scopePool + * @param \Magento\Framework\App\Config\ScopePool $scopePool */ - public function __construct(\Magento\App\Config\ScopePool $scopePool) + public function __construct(\Magento\Framework\App\Config\ScopePool $scopePool) { $this->_scopePool = $scopePool; } @@ -51,7 +51,7 @@ class Config implements ConfigInterface */ public function getValue($path) { - return $this->_scopePool->getScope(\Magento\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); + return $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); } /** @@ -63,7 +63,7 @@ class Config implements ConfigInterface */ public function setValue($path, $value) { - $this->_scopePool->getScope(\Magento\App\ScopeInterface::SCOPE_DEFAULT, null)->setValue($path, $value); + $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->setValue($path, $value); } /** @@ -74,6 +74,6 @@ class Config implements ConfigInterface */ public function isSetFlag($path) { - return !!$this->_scopePool->getScope(\Magento\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); + return !!$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); } } diff --git a/app/code/Magento/Backend/App/DefaultPath.php b/app/code/Magento/Backend/App/DefaultPath.php index 5c5eca971034ab054e3827b452e0228e5a699526..5786328f758a731fcfae3e6942cb9be7a37f928e 100644 --- a/app/code/Magento/Backend/App/DefaultPath.php +++ b/app/code/Magento/Backend/App/DefaultPath.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\App; -class DefaultPath implements \Magento\App\DefaultPathInterface +class DefaultPath implements \Magento\Framework\App\DefaultPathInterface { /** * @var array diff --git a/app/code/Magento/Backend/App/Request/PathInfoProcessor.php b/app/code/Magento/Backend/App/Request/PathInfoProcessor.php index 27760b6527729e19f5bcade67bef2603baa269e0..726d166393900e981a0b748fd82273e9a504b1b2 100644 --- a/app/code/Magento/Backend/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Backend/App/Request/PathInfoProcessor.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\App\Request; -class PathInfoProcessor implements \Magento\App\Request\PathInfoProcessorInterface +class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface { /** * @var \Magento\Backend\Helper\Data @@ -52,11 +52,11 @@ class PathInfoProcessor implements \Magento\App\Request\PathInfoProcessorInterfa /** * Process path info * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $pathInfo * @return string */ - public function process(\Magento\App\RequestInterface $request, $pathInfo) + public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo) { $pathParts = explode('/', ltrim($pathInfo, '/'), 2); $storeCode = $pathParts[0]; diff --git a/app/code/Magento/Backend/App/Response/Http/FileFactory.php b/app/code/Magento/Backend/App/Response/Http/FileFactory.php index baa2495d4f8540eca0bb9bcbcd4a0635bb2b174f..4fc7c89976549b58c3aaa6676a51c15c43ca7874 100644 --- a/app/code/Magento/Backend/App/Response/Http/FileFactory.php +++ b/app/code/Magento/Backend/App/Response/Http/FileFactory.php @@ -23,7 +23,7 @@ */ namespace Magento\Backend\App\Response\Http; -class FileFactory extends \Magento\App\Response\Http\FileFactory +class FileFactory extends \Magento\Framework\App\Response\Http\FileFactory { /** * @var \Magento\Backend\Model\Auth @@ -36,7 +36,7 @@ class FileFactory extends \Magento\App\Response\Http\FileFactory protected $_backendUrl; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; @@ -46,7 +46,7 @@ class FileFactory extends \Magento\App\Response\Http\FileFactory protected $_session; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_flag; @@ -56,21 +56,21 @@ class FileFactory extends \Magento\App\Response\Http\FileFactory protected $_helper; /** - * @param \Magento\App\ResponseInterface $response - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\ResponseInterface $response + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Backend\Model\Auth $auth * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Backend\Model\Session $session - * @param \Magento\App\ActionFlag $flag + * @param \Magento\Framework\App\ActionFlag $flag * @param \Magento\Backend\Helper\Data $helper */ public function __construct( - \Magento\App\ResponseInterface $response, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\ResponseInterface $response, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Backend\Model\Auth $auth, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Backend\Model\Session $session, - \Magento\App\ActionFlag $flag, + \Magento\Framework\App\ActionFlag $flag, \Magento\Backend\Helper\Data $helper ) { $this->_auth = $auth; @@ -86,7 +86,7 @@ class FileFactory extends \Magento\App\Response\Http\FileFactory * * @param string $path * @param array $arguments - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @TODO move method */ protected function _redirect($path, $arguments = array()) @@ -107,12 +107,12 @@ class FileFactory extends \Magento\App\Response\Http\FileFactory * @param string $baseDir * @param string $contentType * @param int $contentLength explicit content length, if strlen($content) isn't applicable - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function create( $fileName, $content, - $baseDir = \Magento\App\Filesystem::ROOT_DIR, + $baseDir = \Magento\Framework\App\Filesystem::ROOT_DIR, $contentType = 'application/octet-stream', $contentLength = null ) { diff --git a/app/code/Magento/Backend/App/Router/DefaultRouter.php b/app/code/Magento/Backend/App/Router/DefaultRouter.php index ba6ca3306d7e3fe59f82e221953b53d908d88940..fa9a5be75d5d056d79e795d925f273e7d828047f 100644 --- a/app/code/Magento/Backend/App/Router/DefaultRouter.php +++ b/app/code/Magento/Backend/App/Router/DefaultRouter.php @@ -39,7 +39,7 @@ class DefaultRouter extends \Magento\Core\App\Router\Base protected $_url; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -52,35 +52,35 @@ class DefaultRouter extends \Magento\Core\App\Router\Base protected $_requiredParams = array('areaFrontName', 'moduleFrontName', 'controllerName', 'actionName'); /** - * @param \Magento\App\ActionFactory $actionFactory - * @param \Magento\App\DefaultPathInterface $defaultPath - * @param \Magento\App\ResponseFactory $responseFactory - * @param \Magento\App\Route\ConfigInterface $routeConfig - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\ActionFactory $actionFactory + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\ResponseFactory $responseFactory + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\State $appState * @param \Magento\UrlInterface $url * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param string $routerId - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Backend\App\ConfigInterface $backendConfig * @param \Magento\Code\NameBuilder $nameBuilder * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\ActionFactory $actionFactory, - \Magento\App\DefaultPathInterface $defaultPath, - \Magento\App\ResponseFactory $responseFactory, - \Magento\App\Route\ConfigInterface $routeConfig, - \Magento\App\State $appState, + \Magento\Framework\App\ActionFactory $actionFactory, + \Magento\Framework\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\ResponseFactory $responseFactory, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\State $appState, \Magento\UrlInterface $url, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, \Magento\Code\NameBuilder $nameBuilder, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Backend\App\ConfigInterface $backendConfig ) { parent::__construct( @@ -146,7 +146,7 @@ class DefaultRouter extends \Magento\Core\App\Router\Base /** * Retrieve current secure url * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return string */ protected function _getCurrentSecureUrl($request) diff --git a/app/code/Magento/Backend/App/Router/NoRouteHandler.php b/app/code/Magento/Backend/App/Router/NoRouteHandler.php index 026c5095de1b9a94d87e74f479d91a4b8f42d004..5146e9931134c7dec22403be1f54658086078661 100644 --- a/app/code/Magento/Backend/App/Router/NoRouteHandler.php +++ b/app/code/Magento/Backend/App/Router/NoRouteHandler.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\App\Router; -class NoRouteHandler implements \Magento\App\Router\NoRouteHandlerInterface +class NoRouteHandler implements \Magento\Framework\App\Router\NoRouteHandlerInterface { /** * @var \Magento\Backend\Helper\Data @@ -33,17 +33,17 @@ class NoRouteHandler implements \Magento\App\Router\NoRouteHandlerInterface protected $_helper; /** - * @var \Magento\App\Route\ConfigInterface + * @var \Magento\Framework\App\Route\ConfigInterface */ protected $_routeConfig; /** * @param \Magento\Backend\Helper\Data $helper - * @param \Magento\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig */ public function __construct( \Magento\Backend\Helper\Data $helper, - \Magento\App\Route\ConfigInterface $routeConfig + \Magento\Framework\App\Route\ConfigInterface $routeConfig ) { $this->_helper = $helper; $this->_routeConfig = $routeConfig; @@ -52,10 +52,10 @@ class NoRouteHandler implements \Magento\App\Router\NoRouteHandlerInterface /** * Check and process no route request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - public function process(\Magento\App\RequestInterface $request) + public function process(\Magento\Framework\App\RequestInterface $request) { $requestPathParams = explode('/', trim($request->getPathInfo(), '/')); $areaFrontName = array_shift($requestPathParams); diff --git a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php index 9d30968ee929caf12560078038057339a524fa87..0f289733752d69de7b5e20110afbb6ff4511eb1b 100644 --- a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php +++ b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php @@ -28,18 +28,18 @@ namespace Magento\Backend\Block\Cache\Grid\Column; class Statuses extends \Magento\Backend\Block\Widget\Grid\Column { /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, array $data = array() ) { parent::__construct($context, $data); diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index e2d11aae32e4cc7b913ac3fedac090703e651f97..ccf5ec6db0857db6b92a240c205e863c51594d84 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -38,19 +38,19 @@ class Context extends \Magento\View\Element\Context protected $_authorization; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder * @param \Magento\TranslateInterface $translator - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager @@ -61,19 +61,19 @@ class Context extends \Magento\View\Element\Context * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, \Magento\TranslateInterface $translator, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Session\SessionManagerInterface $session, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, diff --git a/app/code/Magento/Backend/Block/Page/Head.php b/app/code/Magento/Backend/Block/Page/Head.php index 73be3e9f7852389f8b5237a7dbea5debef46356e..5771f46803ae728a8e2ee24273e3d0b6d8a90880 100644 --- a/app/code/Magento/Backend/Block/Page/Head.php +++ b/app/code/Magento/Backend/Block/Page/Head.php @@ -54,7 +54,7 @@ class Head extends \Magento\Theme\Block\Html\Head * @param \Magento\View\Asset\MinifyService $assetMinifyService * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Translation\Block\Js $jsTranslation - * @param \Magento\App\Action\Title $titles + * @param \Magento\Framework\App\Action\Title $titles * @param \Magento\Data\Form\FormKey $formKey * @param array $data */ @@ -67,7 +67,7 @@ class Head extends \Magento\Theme\Block\Html\Head \Magento\View\Asset\MinifyService $assetMinifyService, \Magento\Locale\ResolverInterface $localeResolver, \Magento\Translation\Block\Js $jsTranslation, - \Magento\App\Action\Title $titles, + \Magento\Framework\App\Action\Title $titles, \Magento\Data\Form\FormKey $formKey, array $data = array() ) { diff --git a/app/code/Magento/Backend/Block/Page/Locale.php b/app/code/Magento/Backend/Block/Page/Locale.php index 41d5165c51b11dc236d1323c802d50c73718c936..e26e20c51eda6cb4166b744785d92ad19d613045 100644 --- a/app/code/Magento/Backend/Block/Page/Locale.php +++ b/app/code/Magento/Backend/Block/Page/Locale.php @@ -86,7 +86,7 @@ class Locale extends \Magento\Backend\Block\Template */ public function getUrlForReferer() { - return \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED . '/' . $this->_urlHelper->getEncodedUrl(); + return \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED . '/' . $this->_urlHelper->getEncodedUrl(); } /** diff --git a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php index 344549318551708de9485d8a626eb70f58f5f4d5..1b42a94a9a6d246fcf0dd2415059582a67b20ca7 100644 --- a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php +++ b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php @@ -69,7 +69,7 @@ class Reset extends \Magento\Backend\Block\System\Config\Form\Field public function getRobotsDefaultCustomInstructions() { return trim((string)$this->_scopeConfig->getValue( - self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, \Magento\App\ScopeInterface::SCOPE_DEFAULT + self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )); } diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index 6d979e3b9cc7d56cef9a0fe738023c3cc03426eb..5f97ae868cf836d85847b2fcc987b6f3da441a20 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -55,28 +55,28 @@ class Context extends \Magento\View\Element\Template\Context protected $nameBuilder; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder * @param \Magento\TranslateInterface $translator - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Session\Generic $session * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Translate\Inline\StateInterface $inlineTranslation - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\TemplateEnginePool $enginePool - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Backend\Model\Session $backendSession @@ -87,28 +87,28 @@ class Context extends \Magento\View\Element\Template\Context * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, \Magento\TranslateInterface $translator, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Session\Generic $session, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Translate\Inline\StateInterface $inlineTranslation, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem, \Magento\View\TemplateEnginePool $enginePool, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\AuthorizationInterface $authorization, \Magento\Backend\Model\Session $backendSession, diff --git a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php index 7d8b9fbfb7a1e5f802d7cb048e56a7592448744c..ba559cede41c1f7e1290377de27ac051b456ea1e 100644 --- a/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/Magento/Backend/Block/Urlrewrite/Catalog/Category/Tree.php @@ -82,9 +82,9 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Registry $registry, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Backend\Helper\Data $adminhtmlData, array $data = array() ) { @@ -92,7 +92,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($context, $categoryTree, $registry, $data); + parent::__construct($context, $categoryTree, $registry, $categoryFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid.php b/app/code/Magento/Backend/Block/Widget/Grid.php index d23b146915d4382e91877a8fe19a432acc634391..e73b006ecb2030ccfcd149ab48b2602be0c2a61e 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid.php +++ b/app/code/Magento/Backend/Block/Widget/Grid.php @@ -97,7 +97,7 @@ class Grid extends \Magento\Backend\Block\Widget * * @var string|null */ - protected $_emptyTextCss = 'a-center'; + protected $_emptyTextCss = 'empty-text'; /** * Pager visibility @@ -469,7 +469,7 @@ class Grid extends \Magento\Backend\Block\Widget $this->getLayout()->createBlock( 'Magento\Backend\Block\Widget\Button' )->setData( - array('label' => __('Reset Filter'), 'onclick' => $this->getJsObjectName() . '.resetFilter()') + array('label' => __('Reset Filter'), 'onclick' => $this->getJsObjectName() . '.resetFilter()', 'class' => 'action-reset') ) ); $this->setChild( diff --git a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php index 1422059384bce5a39b7cfe6875230e76c3932f3d..34375844d704837dbb929630b23043d202159b0d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php @@ -65,7 +65,7 @@ class ColumnSet extends \Magento\View\Element\Template * * @var string */ - protected $_emptyTextCss = 'a-center'; + protected $_emptyTextCss = 'empty-text'; /** * Label for empty cell diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Export.php b/app/code/Magento/Backend/Block/Widget/Grid/Export.php index ce384d8e0a1b7db0699df265ccb7b727e45dbe9b..a511216eddb81f17800a5cb31a8c045d78a95904 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Export.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Export.php @@ -97,7 +97,7 @@ class Export extends \Magento\Backend\Block\Widget implements \Magento\Backend\B $this->addExportType($type['urlPath'], $type['label']); } } - $this->_directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->_directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php index 790b2299ead1bf1c362fae4ff85eb682258ba8b0..f12c70339fddf147a1db942b643abb15555e75b2 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php @@ -146,7 +146,7 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba * * @var string|null */ - protected $_emptyTextCss = 'a-center'; + protected $_emptyTextCss = 'empty-text'; /** * @var bool @@ -192,7 +192,7 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba parent::_construct(); $this->_emptyText = __('We couldn\'t find any records.'); - $this->_directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->_directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php index 9711e112625b5e0ba420541bc630f495ac7de97f..e1fc10e5ef12a8392c17b15e605b4ee412138d57 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php @@ -31,31 +31,31 @@ use Magento\Model\Exception; class Cache extends Action { /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ private $_cacheTypeList; /** - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ private $_cacheState; /** - * @var \Magento\App\Cache\Frontend\Pool + * @var \Magento\Framework\App\Cache\Frontend\Pool */ private $_cacheFrontendPool; /** * @param Action\Context $context - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList - * @param \Magento\App\Cache\StateInterface $cacheState - * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool */ public function __construct( Action\Context $context, - \Magento\App\Cache\TypeListInterface $cacheTypeList, - \Magento\App\Cache\StateInterface $cacheState, - \Magento\App\Cache\Frontend\Pool $cacheFrontendPool + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool ) { parent::__construct($context); $this->_cacheTypeList = $cacheTypeList; diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Index.php b/app/code/Magento/Backend/Controller/Adminhtml/Index.php index 47f251cee745d4f86ad419ec1a3fa79f7afb05a3..b3a32bcccfb39853a79f059446da732926ad6147 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Index.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Controller\Adminhtml; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; use Magento\Backend\App\AbstractAction; /** diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php b/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php index 6cad3b139c14f0c4e9ec451e838c5dde8fc63668..a111e5e320e1fa3634c391063f93dee96bec1ac7 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/AbstractConfig.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; abstract class AbstractConfig extends \Magento\Backend\App\AbstractAction { @@ -53,10 +53,10 @@ abstract class AbstractConfig extends \Magento\Backend\App\AbstractAction /** * Check if current section is found and is allowed * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ - public function dispatch(\Magento\App\RequestInterface $request) + public function dispatch(\Magento\Framework\App\RequestInterface $request) { $section = null; if (!$request->getParam('section')) { diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php index 6da10497e8319865ff7ce82a93a12954b8967656..007897ca0ab6b4b35dfbc04cabc4db5e88ce6468 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Controller\Adminhtml\System; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * System Configuration controller @@ -33,7 +33,7 @@ use Magento\App\ResponseInterface; class Config extends AbstractConfig { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -45,13 +45,13 @@ class Config extends AbstractConfig /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; @@ -72,7 +72,7 @@ class Config extends AbstractConfig /** * Edit configuration section * - * @return \Magento\App\ResponseInterface|void + * @return \Magento\Framework\App\ResponseInterface|void */ public function editAction() { diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index a81106f3b54e0fe424479322d0dce3b09ba42833..a032cce0a3519e9ce8e9158d166485c8b8db923d 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -563,9 +563,9 @@ class Store extends Action 'db' )->setPath( $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ) . '/backups' ); diff --git a/app/code/Magento/Backend/Helper/Dashboard/Data.php b/app/code/Magento/Backend/Helper/Dashboard/Data.php index 43df1c3fa9f2e01b7037263a72590131ac580bea..16c234bdb6c5f29b73394b01ec8743868972bdd9 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Data.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Data.php @@ -41,22 +41,31 @@ class Data extends \Magento\Core\Helper\Data protected $_installDate; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param string $installDate * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, $installDate, $dbCompatibleMode = true ) { - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); $this->_installDate = $installDate; } diff --git a/app/code/Magento/Backend/Helper/Dashboard/Order.php b/app/code/Magento/Backend/Helper/Dashboard/Order.php index 43c528ea6f67761d98d4c286e188476baf7886ab..699b25ce756993638405dcff67e5a408ce7de222 100644 --- a/app/code/Magento/Backend/Helper/Dashboard/Order.php +++ b/app/code/Magento/Backend/Helper/Dashboard/Order.php @@ -36,23 +36,32 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard protected $_orderCollection; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\Reports\Model\Resource\Order\Collection $orderCollection * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Reports\Model\Resource\Order\Collection $orderCollection, $dbCompatibleMode = true ) { $this->_orderCollection = $orderCollection; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** @@ -78,9 +87,6 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard array('eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()) ); } - - - $this->_collection->load(); } } diff --git a/app/code/Magento/Backend/Helper/Data.php b/app/code/Magento/Backend/Helper/Data.php index 5c01cfe3eaa745fd9f413758fa34a4361f776f55..4582bdd9fc406484c81b9c78476f2bdb9a875c0b 100644 --- a/app/code/Magento/Backend/Helper/Data.php +++ b/app/code/Magento/Backend/Helper/Data.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Helper; -use Magento\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\AbstractHelper; /** * @SuppressWarnings(PHPMD.LongVariable) @@ -40,7 +40,7 @@ class Data extends AbstractHelper protected $_pageHelpUrl; /** - * @var \Magento\App\Route\Config + * @var \Magento\Framework\App\Route\Config */ protected $_routeConfig; @@ -70,8 +70,8 @@ class Data extends AbstractHelper protected $mathRandom; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Route\Config $routeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Route\Config $routeConfig * @param \Magento\Locale\ResolverInterface $locale * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Backend\Model\Auth $auth @@ -79,8 +79,8 @@ class Data extends AbstractHelper * @param \Magento\Math\Random $mathRandom */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Route\Config $routeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Route\Config $routeConfig, \Magento\Locale\ResolverInterface $locale, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Backend\Model\Auth $auth, diff --git a/app/code/Magento/Backend/Model/Auth.php b/app/code/Magento/Backend/Model/Auth.php index 2f6418115d937cd5f29dce63070c9717d0c3c920..31a663295dfc88d9a716321be7897bb2623f8efd 100644 --- a/app/code/Magento/Backend/Model/Auth.php +++ b/app/code/Magento/Backend/Model/Auth.php @@ -55,7 +55,7 @@ class Auth protected $_eventManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -69,7 +69,7 @@ class Auth * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\Backend\Model\Auth\StorageInterface $authStorage * @param \Magento\Backend\Model\Auth\Credential\StorageInterface $credentialStorage - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Core\Model\Factory $modelFactory */ public function __construct( @@ -77,7 +77,7 @@ class Auth \Magento\Backend\Helper\Data $backendData, \Magento\Backend\Model\Auth\StorageInterface $authStorage, \Magento\Backend\Model\Auth\Credential\StorageInterface $credentialStorage, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Core\Model\Factory $modelFactory ) { $this->_eventManager = $eventManager; diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index fc8100b24e2761f1fe441ce6b9ec30387d52d48c..8996c26f3c9146c22def3fbb0b721d336f687a08 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -40,6 +40,9 @@ namespace Magento\Backend\Model\Auth; */ class Session extends \Magento\Session\SessionManager implements \Magento\Backend\Model\Auth\StorageInterface { + /** + * Admin session lifetime config path + */ const XML_PATH_SESSION_LIFETIME = 'admin/security/session_lifetime'; /** @@ -67,7 +70,12 @@ class Session extends \Magento\Session\SessionManager implements \Magento\Backen protected $_config; /** - * @param \Magento\App\Request\Http $request + * @var \Magento\Stdlib\Cookie + */ + protected $_cookie; + + /** + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -76,9 +84,10 @@ class Session extends \Magento\Session\SessionManager implements \Magento\Backen * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Backend\App\ConfigInterface $config + * @param \Magento\Stdlib\Cookie $cookie */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, @@ -86,11 +95,13 @@ class Session extends \Magento\Session\SessionManager implements \Magento\Backen \Magento\Session\StorageInterface $storage, \Magento\Acl\Builder $aclBuilder, \Magento\Backend\Model\UrlInterface $backendUrl, - \Magento\Backend\App\ConfigInterface $config + \Magento\Backend\App\ConfigInterface $config, + \Magento\Stdlib\Cookie $cookie ) { $this->_config = $config; $this->_aclBuilder = $aclBuilder; $this->_backendUrl = $backendUrl; + $this->_cookie = $cookie; parent::__construct($request, $sidResolver, $sessionConfig, $saveHandler, $validator, $storage); $this->start(); } @@ -162,12 +173,36 @@ class Session extends \Magento\Session\SessionManager implements \Magento\Backen } if ($this->getUser() && $this->getUser()->getId()) { - $this->setUpdatedAt($currentTime); return true; } return false; } + /** + * Set session UpdatedAt to current time and update cookie expiration time + * + * @return void + */ + public function prolong() + { + $lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME); + $currentTime = time(); + + $this->setUpdatedAt($currentTime); + $cookieValue = $this->_cookie->get($this->getName()); + if ($cookieValue) { + $this->_cookie->set( + $this->getName(), + $cookieValue, + $lifetime, + $this->sessionConfig->getCookiePath(), + $this->sessionConfig->getCookieDomain(), + $this->sessionConfig->getCookieSecure(), + $this->sessionConfig->getCookieHttpOnly() + ); + } + } + /** * Check if it is the first page after successfull login * diff --git a/app/code/Magento/Backend/Model/Auth/StorageInterface.php b/app/code/Magento/Backend/Model/Auth/StorageInterface.php index e0c69cd560727c58000373d2ff469ef662d0cf14..2fc78088a66a87cbe3db16ee3119e9ee7c48362c 100644 --- a/app/code/Magento/Backend/Model/Auth/StorageInterface.php +++ b/app/code/Magento/Backend/Model/Auth/StorageInterface.php @@ -45,4 +45,20 @@ interface StorageInterface * @abstract */ public function processLogout(); + + /** + * Check if user is logged in + * + * @return bool + * @abstract + */ + public function isLoggedIn(); + + /** + * Prolong storage lifetime + * + * @return void + * @abstract + */ + public function prolong(); } diff --git a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php index a8cfcb8769139d015c5f5f7e7daa7f7275adcb3e..d0143b872ebcc50a3012da541525134c68e8e741 100644 --- a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php +++ b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php @@ -28,17 +28,17 @@ namespace Magento\Backend\Model\Cache\Resource\Grid; class Collection extends \Magento\Data\Collection { /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\App\Cache\TypeListInterface $cacheTypeList + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList ) { $this->_cacheTypeList = $cacheTypeList; parent::__construct($entityFactory); diff --git a/app/code/Magento/Backend/Model/Config.php b/app/code/Magento/Backend/Model/Config.php index c1db716e7aee8096f3c9e8581500d0db72d26206..08482c061eab6268c5f16047caec50ab48766f94 100644 --- a/app/code/Magento/Backend/Model/Config.php +++ b/app/code/Magento/Backend/Model/Config.php @@ -59,14 +59,14 @@ class Config extends \Magento\Object /** * Application config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_appConfig; /** * Global factory * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_objectFactory; @@ -87,7 +87,7 @@ class Config extends \Magento\Object /** * Config data factory * - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; @@ -97,22 +97,22 @@ class Config extends \Magento\Object protected $_storeManager; /** - * @param \Magento\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\DB\TransactionFactory $transactionFactory * @param \Magento\Backend\Model\Config\Loader $configLoader - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( - \Magento\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Event\ManagerInterface $eventManager, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\DB\TransactionFactory $transactionFactory, \Magento\Backend\Model\Config\Loader $configLoader, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data = array() ) { @@ -255,7 +255,7 @@ class Config extends \Magento\Object /** @var $field \Magento\Backend\Model\Config\Structure\Element\Field */ $field = $this->_configStructure->getElement($groupPath . '/' . $originalFieldId); - /** @var \Magento\App\Config\ValueInterface $backendModel */ + /** @var \Magento\Framework\App\Config\ValueInterface $backendModel */ $backendModel = $field->hasBackendModel() ? $field ->getBackendModel() : $this ->_configValueFactory @@ -423,7 +423,7 @@ class Config extends \Magento\Object * Set correct scope if isSingleStoreMode = true * * @param \Magento\Backend\Model\Config\Structure\Element\Field $fieldConfig - * @param \Magento\App\Config\ValueInterface $dataObject + * @param \Magento\Framework\App\Config\ValueInterface $dataObject * @return void */ protected function _checkSingleStoreMode( diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php index 68a9c4314545437a7ab5b0a91a81c03ee5c1b567..f83884dfd81ab1403aeec6a2d4cb45df95ec59b6 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custom.php @@ -34,7 +34,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin; -class Custom extends \Magento\App\Config\Value +class Custom extends \Magento\Framework\App\Config\Value { const CONFIG_SCOPE = 'stores'; @@ -51,15 +51,15 @@ class Custom extends \Magento\App\Config\Value /** * Writer of configuration storage * - * @var \Magento\App\Config\Storage\WriterInterface + * @var \Magento\Framework\App\Config\Storage\WriterInterface */ protected $_configWriter; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\Storage\WriterInterface $configWriter + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\Storage\WriterInterface $configWriter * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -67,8 +67,8 @@ class Custom extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\Storage\WriterInterface $configWriter, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\Storage\WriterInterface $configWriter, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custompath.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custompath.php index 2ea5d4766e42cb48097a977f9b7f6f8648e8c4e1..13b7fc9639571ee19f9f96a62d7bf73d5f3d9a57 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Custompath.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Custompath.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin; -class Custompath extends \Magento\App\Config\Value +class Custompath extends \Magento\Framework\App\Config\Value { /** * Check whether redirect should be set diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php index ce3528710cd355e58488323a4c217e9294b35d37..6f3551c42b6d2c0d0d897f2cbc92420c380ff7aa 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php @@ -47,7 +47,7 @@ class Observer protected $_authSession; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; @@ -60,14 +60,14 @@ class Observer * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\Registry $coreRegistry * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\Store\Model\StoreManagerInterfac $storeManager */ public function __construct( \Magento\Backend\Helper\Data $backendData, \Magento\Registry $coreRegistry, \Magento\Backend\Model\Auth\Session $authSession, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\ResponseInterface $response, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_backendData = $backendData; diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Password/Link/Expirationperiod.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Password/Link/Expirationperiod.php index ab1a3f1754217740777d5d5e421c05cc781dd17b..8869e98b6010992db345bd91c0df7f059330897e 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Password/Link/Expirationperiod.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Password/Link/Expirationperiod.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin\Password\Link; -class Expirationperiod extends \Magento\App\Config\Value +class Expirationperiod extends \Magento\Framework\App\Config\Value { /** * Validate expiration period value before saving diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php index 59ef6fda5603ea03f7f0f388d9614925cab5f25d..4dffff142c82e8730d9eafaa282a90faaf5c0b23 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Robots.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin; -class Robots extends \Magento\App\Config\Value +class Robots extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Filesystem\Directory\Write @@ -44,8 +44,8 @@ class Robots extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -53,14 +53,14 @@ class Robots extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_file = 'robots.txt'; } diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php index 2f7dad4121453bd4a7dd62092772e3704a0aabda..007e588d5a22af12ba2561234e9c25cc0f30926d 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usecustom.php @@ -30,20 +30,20 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin; -class Usecustom extends \Magento\App\Config\Value +class Usecustom extends \Magento\Framework\App\Config\Value { /** * Writer of configuration storage * - * @var \Magento\App\Config\Storage\WriterInterface + * @var \Magento\Framework\App\Config\Storage\WriterInterface */ protected $_configWriter; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\Storage\WriterInterface $configWriter + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\Storage\WriterInterface $configWriter * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -51,8 +51,8 @@ class Usecustom extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\Storage\WriterInterface $configWriter, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\Storage\WriterInterface $configWriter, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php index 870582b3a65757f0eb3305e16cd04e74bcd6b433..bb3e582f65acd67fae20c534a87af5e43ded8d12 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Usesecretkey.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Admin; -class Usesecretkey extends \Magento\App\Config\Value +class Usesecretkey extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Backend\Model\UrlInterface @@ -39,7 +39,7 @@ class Usesecretkey extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -48,7 +48,7 @@ class Usesecretkey extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php index 080f735488453a840282a395a16e1efc94423f40..5f164d76e3f9435b01a7d3f61695790415950ace 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php @@ -23,7 +23,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Baseurl extends \Magento\App\Config\Value +class Baseurl extends \Magento\Framework\App\Config\Value { /** * @var \Magento\View\Asset\MergeService @@ -33,7 +33,7 @@ class Baseurl extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\View\Asset\MergeService $mergeService * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -42,7 +42,7 @@ class Baseurl extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\View\Asset\MergeService $mergeService, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Cache.php b/app/code/Magento/Backend/Model/Config/Backend/Cache.php index b6aaccd2ce9c4dd2eae3a2fcc2203af7546f1e37..184f5dd361ce30ee47d1aa7fa9f832c2e843cf1e 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Cache.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Cache.php @@ -30,7 +30,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Cache extends \Magento\App\Config\Value +class Cache extends \Magento\Framework\App\Config\Value { /** * Cache tags to clean diff --git a/app/code/Magento/Backend/Model/Config/Backend/Cookie.php b/app/code/Magento/Backend/Model/Config/Backend/Cookie.php index 09a3bfea8d084456edadd430f17bd97470714a64..2055499306f80a0b6298a7b8d5b412fc00955eb4 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Cookie.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Cookie.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Cookie extends \Magento\App\Config\Value +class Cookie extends \Magento\Framework\App\Config\Value { /** * @var string diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php index 6e27e8f20888dd5e6c31e27af23ae91ff9a2734e..0a9ab9120bb31115d4dbc62b288368ae8de97fe5 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/AbstractCurrency.php @@ -36,12 +36,12 @@ */ namespace Magento\Backend\Model\Config\Backend\Currency; -abstract class AbstractCurrency extends \Magento\App\Config\Value +abstract class AbstractCurrency extends \Magento\Framework\App\Config\Value { /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -50,8 +50,8 @@ abstract class AbstractCurrency extends \Magento\App\Config\Value * * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -59,8 +59,8 @@ abstract class AbstractCurrency extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php index 199030889a6a3ba28e87a5695042d2c43ba35acd..2ecbdf14c36ebbd56a0c1b7d16510e3050505bee 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Allow.php @@ -40,8 +40,8 @@ class Allow extends AbstractCurrency /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Locale\CurrencyInterface $localeCurrency * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -50,8 +50,8 @@ class Allow extends AbstractCurrency public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Locale\CurrencyInterface $localeCurrency, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php index c63633bda0a83864eab2a88047689a93ab5879f3..7ae6a3d6cb5da0ed04ee5f08e4af3a54e7a69df6 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Currency/Cron.php @@ -29,20 +29,20 @@ */ namespace Magento\Backend\Model\Config\Backend\Currency; -class Cron extends \Magento\App\Config\Value +class Cron extends \Magento\Framework\App\Config\Value { const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr'; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -50,8 +50,8 @@ class Cron extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -83,7 +83,7 @@ class Cron extends \Magento\App\Config\Value $cronExprString = join(' ', $cronExprArray); try { - /** @var $configValue \Magento\App\Config\ValueInterface */ + /** @var $configValue \Magento\Framework\App\Config\ValueInterface */ $configValue = $this->_configValueFactory->create(); $configValue->load(self::CRON_STRING_PATH, 'path'); $configValue->setValue($cronExprString)->setPath(self::CRON_STRING_PATH)->save(); diff --git a/app/code/Magento/Backend/Model/Config/Backend/Datashare.php b/app/code/Magento/Backend/Model/Config/Backend/Datashare.php index 39e175a515060b1a16f3930912b884f33f9e3148..51a42e0f9d8c77564b25b4d170cc25478114bf91 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Datashare.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Datashare.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Datashare extends \Magento\App\Config\Value +class Datashare extends \Magento\Framework\App\Config\Value { /** * @return void diff --git a/app/code/Magento/Backend/Model/Config/Backend/Email/Address.php b/app/code/Magento/Backend/Model/Config/Backend/Email/Address.php index 786a085aba1c3ae777672bf26e27d49ed9e75fad..e52b353da0e08b5c8ee8ce17e5fb2574b6294be0 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Email/Address.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Email/Address.php @@ -31,7 +31,7 @@ namespace Magento\Backend\Model\Config\Backend\Email; use Magento\Model\Exception; -class Address extends \Magento\App\Config\Value +class Address extends \Magento\Framework\App\Config\Value { /** * @return $this diff --git a/app/code/Magento/Backend/Model/Config/Backend/Email/Sender.php b/app/code/Magento/Backend/Model/Config/Backend/Email/Sender.php index a6806f6ba1ed113d4f48881a305c72114cc1a002..de79f86728d1d7160969c733d4710170ddc34d0a 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Email/Sender.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Email/Sender.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Email; -class Sender extends \Magento\App\Config\Value +class Sender extends \Magento\Framework\App\Config\Value { /** * Check sender name validity diff --git a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php index 0bebdca2f0f52965a78374a5b8504327edaa5a9f..efee9e34e480133d0f29b88fb25ac02b274ae4e6 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Encrypted.php @@ -27,7 +27,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Encrypted extends \Magento\App\Config\Value implements \Magento\App\Config\Data\ProcessorInterface +class Encrypted extends \Magento\Framework\App\Config\Value implements \Magento\Framework\App\Config\Data\ProcessorInterface { /** * @var \Magento\Encryption\EncryptorInterface @@ -37,7 +37,7 @@ class Encrypted extends \Magento\App\Config\Value implements \Magento\App\Config /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -46,7 +46,7 @@ class Encrypted extends \Magento\App\Config\Value implements \Magento\App\Config public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -75,7 +75,7 @@ class Encrypted extends \Magento\App\Config\Value implements \Magento\App\Config public function __wakeup() { parent::__wakeup(); - $this->_encryptor = \Magento\App\ObjectManager::getInstance()->get('Magento\Encryption\EncryptorInterface'); + $this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Encryption\EncryptorInterface'); } /** diff --git a/app/code/Magento/Backend/Model/Config/Backend/File.php b/app/code/Magento/Backend/Model/Config/Backend/File.php index 63270e104efcd39f350dfd191dbb5cfd658df8d7..bae9c948e0ede8a62298ef98b4c0aa81256a875a 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/File.php +++ b/app/code/Magento/Backend/Model/Config/Backend/File.php @@ -30,7 +30,7 @@ namespace Magento\Backend\Model\Config\Backend; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class File extends \Magento\App\Config\Value +class File extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface @@ -45,7 +45,7 @@ class File extends \Magento\App\Config\Value protected $_maxFileSize = 0; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -62,10 +62,10 @@ class File extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -73,10 +73,10 @@ class File extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -84,7 +84,7 @@ class File extends \Magento\App\Config\Value $this->_uploaderFactory = $uploaderFactory; $this->_requestData = $requestData; $this->_filesystem = $filesystem; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); } @@ -145,7 +145,7 @@ class File extends \Magento\App\Config\Value */ public function validateMaxSize($filePath) { - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::SYS_TMP_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); if ($this->_maxFileSize > 0 && $directory->stat( $directory->getRelativePath($filePath) )['size'] > $this->_maxFileSize * 1024 @@ -211,7 +211,7 @@ class File extends \Magento\App\Config\Value protected function _prependScopeInfo($path) { $scopeInfo = $this->getScope(); - if (\Magento\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { + if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { $scopeInfo .= '/' . $this->getScopeId(); } return $scopeInfo . '/' . $path; @@ -228,7 +228,7 @@ class File extends \Magento\App\Config\Value protected function _appendScopeInfo($path) { $path .= '/' . $this->getScope(); - if (\Magento\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { + if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { $path .= '/' . $this->getScopeId(); } return $path; diff --git a/app/code/Magento/Backend/Model/Config/Backend/Filename.php b/app/code/Magento/Backend/Model/Config/Backend/Filename.php index 30a194964479eca90ef7bf4c81eea70d0a76764e..4b0d5ab7d6ef73922a3ca45775a4825265c6f60e 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Filename.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Filename.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Filename extends \Magento\App\Config\Value +class Filename extends \Magento\Framework\App\Config\Value { /** * @return $this diff --git a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php index 8e52f2bce56752559c3f2892c162251ff3da751e..0d6a63b55dcb1c65cc6c71c8fc9836117f6c2956 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Image/Adapter.php @@ -34,7 +34,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Image; -class Adapter extends \Magento\App\Config\Value +class Adapter extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Image\AdapterFactory @@ -44,7 +44,7 @@ class Adapter extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Image\AdapterFactory $imageFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -53,7 +53,7 @@ class Adapter extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Image\AdapterFactory $imageFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Locale.php b/app/code/Magento/Backend/Model/Config/Backend/Locale.php index 3bc53f0bf23b7606928b0f7e76429a193e57532a..9e15ea3dd2832bbd0eb58661bf80c706721d2143 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Locale.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Locale.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Locale extends \Magento\App\Config\Value +class Locale extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Core\Model\Resource\Config\Data\CollectionFactory @@ -54,7 +54,7 @@ class Locale extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory * @param \Magento\Store\Model\Website\Factory $websiteFactory * @param \Magento\Store\Model\StoreFactory $storeFactory @@ -68,7 +68,7 @@ class Locale extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Core\Model\Resource\Config\Data\CollectionFactory $configsFactory, \Magento\Store\Model\Website\Factory $websiteFactory, \Magento\Store\Model\StoreFactory $storeFactory, @@ -111,7 +111,7 @@ class Locale extends \Magento\App\Config\Value } switch ($data->getScope()) { - case \Magento\App\ScopeInterface::SCOPE_DEFAULT: + case \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT: $scopeName = __('Default scope'); break; diff --git a/app/code/Magento/Backend/Model/Config/Backend/Locale/Timezone.php b/app/code/Magento/Backend/Model/Config/Backend/Locale/Timezone.php index 2ac4ccc21183bc3c843fa6ed7700e7714080fa37..8d93f530794da946406dd5b033d97c93c26b46cf 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Locale/Timezone.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Locale/Timezone.php @@ -31,7 +31,7 @@ namespace Magento\Backend\Model\Config\Backend\Locale; use Magento\Model\Exception; -class Timezone extends \Magento\App\Config\Value +class Timezone extends \Magento\Framework\App\Config\Value { /** * @return $this diff --git a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php index b1d1d8cfb9b704cc68e340155b8f19ee5d33087e..4e131e7aaa777517f45194df2dee785db222a02d 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Log/Cron.php @@ -29,14 +29,14 @@ */ namespace Magento\Backend\Model\Config\Backend\Log; -class Cron extends \Magento\App\Config\Value +class Cron extends \Magento\Framework\App\Config\Value { const CRON_STRING_PATH = 'crontab/default/jobs/log_clean/schedule/cron_expr'; const CRON_MODEL_PATH = 'crontab/default/jobs/log_clean/run/model'; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; @@ -48,8 +48,8 @@ class Cron extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath @@ -58,8 +58,8 @@ class Cron extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', @@ -99,12 +99,12 @@ class Cron extends \Magento\App\Config\Value } try { - /** @var $configValue \Magento\App\Config\ValueInterface */ + /** @var $configValue \Magento\Framework\App\Config\ValueInterface */ $configValue = $this->_configValueFactory->create(); $configValue->load(self::CRON_STRING_PATH, 'path'); $configValue->setValue($cronExprString)->setPath(self::CRON_STRING_PATH)->save(); - /** @var $configValue \Magento\App\Config\ValueInterface */ + /** @var $configValue \Magento\Framework\App\Config\ValueInterface */ $configValue = $this->_configValueFactory->create(); $configValue->load(self::CRON_MODEL_PATH, 'path'); $configValue->setValue($this->_runModelPath)->setPath(self::CRON_MODEL_PATH)->save(); diff --git a/app/code/Magento/Backend/Model/Config/Backend/Secure.php b/app/code/Magento/Backend/Model/Config/Backend/Secure.php index af421cc31fef508dbbc91f45dec699065c286e93..aa42936db9f6e149eb47dc139cab48973ad5b2f5 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Secure.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Secure.php @@ -23,7 +23,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Secure extends \Magento\App\Config\Value +class Secure extends \Magento\Framework\App\Config\Value { /** * @var \Magento\View\Asset\MergeService @@ -33,7 +33,7 @@ class Secure extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\View\Asset\MergeService $mergeService * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -42,7 +42,7 @@ class Secure extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\View\Asset\MergeService $mergeService, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Serialized.php b/app/code/Magento/Backend/Model/Config/Backend/Serialized.php index c96625163efbbad0bf912c1f248eb09538dc7ea5..c4bb63ae2c457ecc974fecedb6d285376c06775f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Serialized.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Serialized.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Serialized extends \Magento\App\Config\Value +class Serialized extends \Magento\Framework\App\Config\Value { /** * @return void diff --git a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php index 875493c5809ba284cc11ec2c4ea07901444dffd4..9bd9c85cb81bdca34f9be9757a4f372245836342 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php @@ -25,7 +25,7 @@ */ namespace Magento\Backend\Model\Config\Backend\Storage\Media; -class Database extends \Magento\App\Config\Value +class Database extends \Magento\Framework\App\Config\Value { /** * Core file storage @@ -37,7 +37,7 @@ class Database extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -46,7 +46,7 @@ class Database extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Store.php b/app/code/Magento/Backend/Model/Config/Backend/Store.php index f8b8586c15acf972077b85cec5871ee9b3bdf780..6d809179d4c475825d59c0ee18402f69471e6769 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Store.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Store.php @@ -29,18 +29,18 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Store extends \Magento\App\Config\Value +class Store extends \Magento\Framework\App\Config\Value { /** - * @var \Magento\App\Config\MutableScopeConfigInterface + * @var \Magento\Framework\App\Config\MutableScopeConfigInterface */ protected $_mutableConfig; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\MutableScopeConfigInterface $mutableConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -48,8 +48,8 @@ class Store extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\MutableScopeConfigInterface $mutableConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Translate.php b/app/code/Magento/Backend/Model/Config/Backend/Translate.php index 5a3f9101d45b024693694cc3afaaf39d6ad6c762..961b3df29cf7e0ecdb9e82283009db4a85cabbb1 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Translate.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Translate.php @@ -29,10 +29,10 @@ */ namespace Magento\Backend\Model\Config\Backend; -class Translate extends \Magento\App\Config\Value +class Translate extends \Magento\Framework\App\Config\Value { /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -46,7 +46,7 @@ class Translate extends \Magento\App\Config\Value /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -55,9 +55,9 @@ class Translate extends \Magento\App\Config\Value * * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -65,9 +65,9 @@ class Translate extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/BackendFactory.php b/app/code/Magento/Backend/Model/Config/BackendFactory.php index bce8dad440363e315f83971d822feacd39777c7c..075391592f2924712ba82dd6e21bbae9bcf60545 100644 --- a/app/code/Magento/Backend/Model/Config/BackendFactory.php +++ b/app/code/Magento/Backend/Model/Config/BackendFactory.php @@ -46,13 +46,13 @@ class BackendFactory * Create backend model by name * * @param string $modelName - * @return \Magento\App\Config\ValueInterface + * @return \Magento\Framework\App\Config\ValueInterface * @throws \InvalidArgumentException */ public function create($modelName) { $model = $this->_objectManager->create($modelName); - if (!$model instanceof \Magento\App\Config\ValueInterface) { + if (!$model instanceof \Magento\Framework\App\Config\ValueInterface) { throw new \InvalidArgumentException('Invalid config field backend model: ' . $modelName); } return $model; diff --git a/app/code/Magento/Backend/Model/Config/Loader.php b/app/code/Magento/Backend/Model/Config/Loader.php index 9babd351ccc8fad4a0dfca93eb0f51bc6f294fe5..f128454304bd5c9ab382eb577eab63ae22f8082a 100644 --- a/app/code/Magento/Backend/Model/Config/Loader.php +++ b/app/code/Magento/Backend/Model/Config/Loader.php @@ -34,14 +34,14 @@ class Loader /** * Config data factory * - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; /** - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory */ - public function __construct(\Magento\App\Config\ValueFactory $configValueFactory) + public function __construct(\Magento\Framework\App\Config\ValueFactory $configValueFactory) { $this->_configValueFactory = $configValueFactory; } diff --git a/app/code/Magento/Backend/Model/Config/ScopeDefiner.php b/app/code/Magento/Backend/Model/Config/ScopeDefiner.php index e0ddf6d21207ee0b48e669fe4a4a35d66665b092..5e29d703634451dc262867b4614d7bd3d5450640 100644 --- a/app/code/Magento/Backend/Model/Config/ScopeDefiner.php +++ b/app/code/Magento/Backend/Model/Config/ScopeDefiner.php @@ -34,14 +34,14 @@ class ScopeDefiner /** * Request object * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ - public function __construct(\Magento\App\RequestInterface $request) + public function __construct(\Magento\Framework\App\RequestInterface $request) { $this->_request = $request; } @@ -57,6 +57,6 @@ class ScopeDefiner 'store' ) ? \Magento\Store\Model\ScopeInterface::SCOPE_STORE : ($this->_request->getParam( 'website' - ) ? \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE : \Magento\App\ScopeInterface::SCOPE_DEFAULT); + ) ? \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE : \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); } } diff --git a/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php b/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php index 3a117fc498220adea65bfc2a2b087df53cd4e990..7a4298e710ef10ceb8d8629fa60d771760dbe5c3 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php +++ b/app/code/Magento/Backend/Model/Config/Source/Dev/Dbautoup.php @@ -33,9 +33,9 @@ class Dbautoup implements \Magento\Option\ArrayInterface public function toOptionArray() { return array( - array('value' => \Magento\App\Resource::AUTO_UPDATE_ALWAYS, 'label' => __('Always (during development)')), - array('value' => \Magento\App\Resource::AUTO_UPDATE_ONCE, 'label' => __('Only Once (version upgrade)')), - array('value' => \Magento\App\Resource::AUTO_UPDATE_NEVER, 'label' => __('Never (production)')) + array('value' => \Magento\Framework\App\Resource::AUTO_UPDATE_ALWAYS, 'label' => __('Always (during development)')), + array('value' => \Magento\Framework\App\Resource::AUTO_UPDATE_ONCE, 'label' => __('Only Once (version upgrade)')), + array('value' => \Magento\Framework\App\Resource::AUTO_UPDATE_NEVER, 'label' => __('Never (production)')) ); } } diff --git a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php index 7760080de623b727234278b10e0cbcfa535ea02f..7e0456c48ed89cf456c0fd8eb2988a9df15a6432 100644 --- a/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Source/Storage/Media/Database.php @@ -29,7 +29,7 @@ */ namespace Magento\Backend\Model\Config\Source\Storage\Media; -use Magento\App\Arguments; +use Magento\Framework\App\Arguments; class Database implements \Magento\Option\ArrayInterface { diff --git a/app/code/Magento/Backend/Model/Config/Structure/AbstractElement.php b/app/code/Magento/Backend/Model/Config/Structure/AbstractElement.php index ed48faa5515b310df779594f5020a34a1a502068..39e0356bd987fc89946c2b34582847e8b1c333ef 100644 --- a/app/code/Magento/Backend/Model/Config/Structure/AbstractElement.php +++ b/app/code/Magento/Backend/Model/Config/Structure/AbstractElement.php @@ -156,7 +156,7 @@ abstract class AbstractElement implements ElementInterface $showInScope = array( \Magento\Store\Model\ScopeInterface::SCOPE_STORE => $this->_hasVisibilityValue('showInStore'), \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE => $this->_hasVisibilityValue('showInWebsite'), - \Magento\App\ScopeInterface::SCOPE_DEFAULT => $this->_hasVisibilityValue('showInDefault') + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT => $this->_hasVisibilityValue('showInDefault') ); if ($this->_storeManager->isSingleStoreMode()) { diff --git a/app/code/Magento/Backend/Model/Config/Structure/Element/Dependency/Mapper.php b/app/code/Magento/Backend/Model/Config/Structure/Element/Dependency/Mapper.php index c86eb30c0afb8757d04031dcc1bd8c2288e32252..e6661032fbe88f08ba97bf4577a23c3b70d0d059 100644 --- a/app/code/Magento/Backend/Model/Config/Structure/Element/Dependency/Mapper.php +++ b/app/code/Magento/Backend/Model/Config/Structure/Element/Dependency/Mapper.php @@ -42,19 +42,19 @@ class Mapper protected $_fieldFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Backend\Model\Config\Structure\SearchInterface $fieldLocator * @param FieldFactory $fieldFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\Backend\Model\Config\Structure\SearchInterface $fieldLocator, FieldFactory $fieldFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_fieldLocator = $fieldLocator; diff --git a/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php b/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php index 26a68fa2d331b4841e731a56816e628120b93497..c40d7970f34791e635030ecea61c939f62d3a0aa 100644 --- a/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php +++ b/app/code/Magento/Backend/Model/Config/Structure/Element/Field.php @@ -232,7 +232,7 @@ class Field extends \Magento\Backend\Model\Config\Structure\AbstractElement /** * Retrieve backend model * - * @return \Magento\App\Config\ValueInterface + * @return \Magento\Framework\App\Config\ValueInterface */ public function getBackendModel() { diff --git a/app/code/Magento/Backend/Model/Locale/Resolver.php b/app/code/Magento/Backend/Model/Locale/Resolver.php index 77fe314a42508e97d644ef2ee673b0e38e334a5f..07d6c516f9c7e61f6ba8e4820a8586f653fdb08b 100644 --- a/app/code/Magento/Backend/Model/Locale/Resolver.php +++ b/app/code/Magento/Backend/Model/Locale/Resolver.php @@ -41,7 +41,7 @@ class Resolver extends \Magento\Locale\Resolver protected $_localeManager; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -51,26 +51,26 @@ class Resolver extends \Magento\Locale\Resolver protected $_localeValidator; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\LocaleFactory $localeFactory * @param string $defaultLocalePath * @param string $scopeType * @param \Magento\Backend\Model\Session $session * @param Manager $localeManager - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Locale\Validator $localeValidator * @param null $locale */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\CacheInterface $cache, \Magento\LocaleFactory $localeFactory, $defaultLocalePath, $scopeType, \Magento\Backend\Model\Session $session, \Magento\Backend\Model\Locale\Manager $localeManager, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Locale\Validator $localeValidator, $locale = null ) { diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index deed8f64c9020f46cfcd4f095c3f308219d9bcd6..5f3d4ca85d007bce6ecda27affb6f8b615d25ee7 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -32,7 +32,7 @@ class Config const CACHE_MENU_OBJECT = 'backend_menu_object'; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -64,7 +64,7 @@ class Config protected $_configReader; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -74,7 +74,7 @@ class Config protected $_director; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -83,22 +83,22 @@ class Config * @param \Magento\Backend\Model\Menu\AbstractDirector $menuDirector * @param \Magento\Backend\Model\MenuFactory $menuFactory * @param \Magento\Backend\Model\Menu\Config\Reader $configReader - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Logger $logger - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\State $appState */ public function __construct( \Magento\Backend\Model\Menu\Builder $menuBuilder, \Magento\Backend\Model\Menu\AbstractDirector $menuDirector, \Magento\Backend\Model\MenuFactory $menuFactory, \Magento\Backend\Model\Menu\Config\Reader $configReader, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Event\ManagerInterface $eventManager, \Magento\Logger $logger, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\State $appState + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\State $appState ) { $this->_menuBuilder = $menuBuilder; $this->_director = $menuDirector; diff --git a/app/code/Magento/Backend/Model/Menu/Item.php b/app/code/Magento/Backend/Model/Menu/Item.php index 60ea56d4279aaf9a7b9b6698f8368b502c6c85ed..8505f6a1f15a9022bfe29e597ef4376c46ec2d3d 100644 --- a/app/code/Magento/Backend/Model/Menu/Item.php +++ b/app/code/Magento/Backend/Model/Menu/Item.php @@ -134,7 +134,7 @@ class Item protected $_urlModel; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -165,7 +165,7 @@ class Item /** * @param Item\Validator $validator * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Backend\Model\MenuFactory $menuFactory * @param \Magento\Backend\Model\UrlInterface $urlModel * @param \Magento\Module\ModuleListInterface $moduleList @@ -175,7 +175,7 @@ class Item public function __construct( \Magento\Backend\Model\Menu\Item\Validator $validator, \Magento\AuthorizationInterface $authorization, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Backend\Model\MenuFactory $menuFactory, \Magento\Backend\Model\UrlInterface $urlModel, \Magento\Module\ModuleListInterface $moduleList, @@ -490,11 +490,11 @@ class Item */ public function __wakeup() { - $objectManager = \Magento\App\ObjectManager::getInstance(); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $this->_moduleManager = $objectManager->get('Magento\Module\Manager'); $this->_validator = $objectManager->get('Magento\Backend\Model\Menu\Item\Validator'); $this->_acl = $objectManager->get('Magento\AuthorizationInterface'); - $this->_scopeConfig = $objectManager->get('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_menuFactory = $objectManager->get('Magento\Backend\Model\MenuFactory'); $this->_urlModel = $objectManager->get('Magento\Backend\Model\UrlInterface'); $this->_moduleList = $objectManager->get('Magento\Module\ModuleListInterface'); diff --git a/app/code/Magento/Backend/Model/Observer.php b/app/code/Magento/Backend/Model/Observer.php index 7c46ee84ff1aafd3efb90b9a458c40f1246c07ba..3ad90e28d8bbd0bce02d2b7a9fbd41142fe689b2 100644 --- a/app/code/Magento/Backend/Model/Observer.php +++ b/app/code/Magento/Backend/Model/Observer.php @@ -36,24 +36,24 @@ class Observer protected $_backendSession; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $cache; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** * @param Session $backendSession - * @param \Magento\App\CacheInterface $cache - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\CacheInterface $cache + * @param \Magento\Framework\App\RequestInterface $request */ public function __construct( \Magento\Backend\Model\Session $backendSession, - \Magento\App\CacheInterface $cache, - \Magento\App\RequestInterface $request + \Magento\Framework\App\CacheInterface $cache, + \Magento\Framework\App\RequestInterface $request ) { $this->_backendSession = $backendSession; $this->cache = $cache; diff --git a/app/code/Magento/Backend/Model/Search/Customer.php b/app/code/Magento/Backend/Model/Search/Customer.php index e6ae918c7cd7822bb3475838939b95bd0b5a4dee..24dba6d45dbc2eb0c201c65498eca0e184112974 100644 --- a/app/code/Magento/Backend/Model/Search/Customer.php +++ b/app/code/Magento/Backend/Model/Search/Customer.php @@ -28,9 +28,17 @@ namespace Magento\Backend\Model\Search; /** * Search Customer Model * - * @category Magento - * @package Magento_Backend - * @author Magento Core Team <core@magentocommerce.com> + * @method Customer setQuery(string $query) + * @method string|null getQuery() + * @method bool hasQuery() + * @method Customer setStart(int $startPosition) + * @method int|null getStart() + * @method bool hasStart() + * @method Customer setLimit(int $limit) + * @method int|null getLimit() + * @method bool hasLimit() + * @method Customer setResults(array $results) + * @method array getResults() */ class Customer extends \Magento\Object { @@ -42,20 +50,46 @@ class Customer extends \Magento\Object protected $_adminhtmlData = null; /** - * @var \Magento\Customer\Model\Resource\Customer\CollectionFactory + * @var \Magento\Customer\Service\V1\CustomerAccountService + */ + protected $_customerService; + + /** + * @var \Magento\Service\V1\Data\SearchCriteriaBuilder + */ + protected $_searchCriteriaBuilder; + + /** + * @var \Magento\Service\V1\Data\FilterBuilder */ - protected $_collectionFactory; + protected $_filterBuilder; /** - * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $collectionFactory + * @var \Magento\Customer\Helper\View + */ + protected $_customerViewHelper; + + /** + * Initialize dependencies. + * * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Customer\Service\V1\CustomerAccountService $customerService + * @param \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Service\V1\Data\FilterBuilder $filterBuilder + * @param \Magento\Customer\Helper\View $customerViewHelper */ public function __construct( - \Magento\Customer\Model\Resource\Customer\CollectionFactory $collectionFactory, - \Magento\Backend\Helper\Data $adminhtmlData + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Customer\Service\V1\CustomerAccountService $customerService, + \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder, + \Magento\Service\V1\Data\FilterBuilder $filterBuilder, + \Magento\Customer\Helper\View $customerViewHelper ) { - $this->_collectionFactory = $collectionFactory; $this->_adminhtmlData = $adminhtmlData; + $this->_customerService = $customerService; + $this->_searchCriteriaBuilder = $searchCriteriaBuilder; + $this->_filterBuilder = $filterBuilder; + $this->_customerViewHelper = $customerViewHelper; } /** @@ -65,41 +99,48 @@ class Customer extends \Magento\Object */ public function load() { - $result = array(); + $result = []; if (!$this->hasStart() || !$this->hasLimit() || !$this->hasQuery()) { $this->setResults($result); return $this; } - $collection = $this->_collectionFactory->create()->addNameToSelect()->joinAttribute( - 'company', - 'customer_address/company', - 'default_billing', - null, - 'left' - )->addAttributeToFilter( - array( - array('attribute' => 'firstname', 'like' => $this->getQuery() . '%'), - array('attribute' => 'lastname', 'like' => $this->getQuery() . '%'), - array('attribute' => 'company', 'like' => $this->getQuery() . '%') - ) - )->setPage( - 1, - 10 - )->load(); + $this->_searchCriteriaBuilder->setCurrentPage($this->getStart()); + $this->_searchCriteriaBuilder->setPageSize($this->getLimit()); + $searchFields = ['firstname', 'lastname', 'company']; + $filters = []; + foreach ($searchFields as $field) { + $filters[] = $this->_filterBuilder + ->setField($field) + ->setConditionType('like') + ->setValue($this->getQuery() . '%') + ->create(); + } + $this->_searchCriteriaBuilder->addFilter($filters); + $searchCriteria = $this->_searchCriteriaBuilder->create(); + $searchResults = $this->_customerService->searchCustomers($searchCriteria); - foreach ($collection->getItems() as $customer) { + /** @var \Magento\Customer\Service\V1\Data\CustomerDetails $customerDetails */ + foreach ($searchResults->getItems() as $customerDetails) { + $customerData = $customerDetails->getCustomer(); + $customerAddresses = $customerDetails->getAddresses(); + /** Look for a company name defined in default billing address */ + $company = null; + foreach ($customerAddresses as $customerAddress) { + if ($customerAddress->isDefaultBilling()) { + $company = $customerAddress->getCompany(); + break; + } + } $result[] = array( - 'id' => 'customer/1/' . $customer->getId(), + 'id' => 'customer/1/' . $customerData->getId(), 'type' => __('Customer'), - 'name' => $customer->getName(), - 'description' => $customer->getCompany(), - 'url' => $this->_adminhtmlData->getUrl('customer/index/edit', array('id' => $customer->getId())) + 'name' => $this->_customerViewHelper->getCustomerName($customerData), + 'description' => $company, + 'url' => $this->_adminhtmlData->getUrl('customer/index/edit', array('id' => $customerData->getId())) ); } - $this->setResults($result); - return $this; } } diff --git a/app/code/Magento/Backend/Model/Session.php b/app/code/Magento/Backend/Model/Session.php index 50a6f81c60bf10b194b4b645469d515dcdd585e6..f906ad754f30d1f27310f78a60401619d1da2ef1 100644 --- a/app/code/Magento/Backend/Model/Session.php +++ b/app/code/Magento/Backend/Model/Session.php @@ -28,7 +28,7 @@ namespace Magento\Backend\Model; class Session extends \Magento\Session\SessionManager { /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -36,7 +36,7 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\Session\StorageInterface $storage */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php index d6048515270aa1060060529607b1f00235384f23..ce1b1c7aa806b3bee8093829d4f7e5c4eaa7f98f 100644 --- a/app/code/Magento/Backend/Model/Session/Quote.php +++ b/app/code/Magento/Backend/Model/Session/Quote.php @@ -27,6 +27,18 @@ namespace Magento\Backend\Model\Session; /** * Adminhtml quote session + * + * @method Quote setCustomerId($id) + * @method int getCustomerId() + * @method bool hasCustomerId() + * @method Quote setStoreId($storeId) + * @method int getStoreId() + * @method Quote setQuoteId($quoteId) + * @method int getQuoteId() + * @method Quote setCurrencyId($currencyId) + * @method int getCurrencyId() + * @method Quote setOrderId($orderId) + * @method int getOrderId() */ class Quote extends \Magento\Session\SessionManager { @@ -39,13 +51,6 @@ class Quote extends \Magento\Session\SessionManager */ protected $_quote = null; - /** - * Customer mofrl object - * - * @var \Magento\Customer\Model\Customer - */ - protected $_customer = null; - /** * Store model object * @@ -66,9 +71,9 @@ class Quote extends \Magento\Session\SessionManager protected $_orderFactory; /** - * @var \Magento\Customer\Model\CustomerFactory + * @var \Magento\Customer\Service\V1\CustomerAccountServiceInterface */ - protected $_customerFactory; + protected $_customerService; /** * @var \Magento\Sales\Model\QuoteFactory @@ -81,38 +86,38 @@ class Quote extends \Magento\Session\SessionManager protected $_storeManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler * @param \Magento\Session\ValidatorInterface $validator * @param \Magento\Session\StorageInterface $storage * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerService * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, \Magento\Session\ValidatorInterface $validator, \Magento\Session\StorageInterface $storage, \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerService, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_quoteFactory = $quoteFactory; - $this->_customerFactory = $customerFactory; + $this->_customerService = $customerService; $this->_orderFactory = $orderFactory; $this->_storeManager = $storeManager; $this->_scopeConfig = $scopeConfig; @@ -135,18 +140,21 @@ class Quote extends \Magento\Session\SessionManager if ($this->getStoreId() && $this->getQuoteId()) { $this->_quote->setStoreId($this->getStoreId())->load($this->getQuoteId()); } elseif ($this->getStoreId() && $this->hasCustomerId()) { - $this->_quote->setStoreId( - $this->getStoreId() - )->setCustomerGroupId( - $this->_scopeConfig->getValue( - self::XML_PATH_DEFAULT_CREATEACCOUNT_GROUP, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->assignCustomer( - $this->getCustomer() - )->setIsActive( - false - )->save(); + try { + $customerData = $this->_customerService->getCustomer($this->getCustomerId()); + $this->_quote->assignCustomer($customerData); + } catch (\Magento\Exception\NoSuchEntityException $e) { + /** Customer does not exist */ + } + $customerGroupId = $this->_scopeConfig->getValue( + self::XML_PATH_DEFAULT_CREATEACCOUNT_GROUP, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); + $this->_quote + ->setStoreId($this->getStoreId()) + ->setCustomerGroupId($customerGroupId) + ->setIsActive(false) + ->save(); $this->setQuoteId($this->_quote->getId()); } $this->_quote->setIgnoreOldQty(true); @@ -155,41 +163,6 @@ class Quote extends \Magento\Session\SessionManager return $this->_quote; } - /** - * Set customer model object - * To enable quick switch of preconfigured customer - * - * @param \Magento\Customer\Model\Customer $customer - * @return $this - */ - public function setCustomer(\Magento\Customer\Model\Customer $customer) - { - $this->_customer = $customer; - return $this; - } - - /** - * Retrieve customer model object - * - * @param bool $forceReload - * @param bool $useSetStore - * @return \Magento\Customer\Model\Customer - */ - public function getCustomer($forceReload = false, $useSetStore = false) - { - if (is_null($this->_customer) || $forceReload) { - $this->_customer = $this->_customerFactory->create(); - if ($useSetStore && $this->getStore()->getId()) { - $this->_customer->setStore($this->getStore()); - } - $customerId = $this->getCustomerId(); - if ($customerId) { - $this->_customer->load($customerId); - } - } - return $this->_customer; - } - /** * Retrieve store model object * diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index 8ab29b9965465824338a2835fbd037ddff90eabd..b38bb29676779a5f092ce07d9fd3413cc559c313 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -67,7 +67,7 @@ class Url extends \Magento\Url implements \Magento\Backend\Model\UrlInterface protected $_menuConfig; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -92,18 +92,18 @@ class Url extends \Magento\Url implements \Magento\Backend\Model\UrlInterface protected $_scope; /** - * @param \Magento\App\Route\ConfigInterface $routeConfig - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param \Magento\Backend\Model\Url\ScopeResolver $scopeResolver * @param \Magento\Session\Generic $session * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Url\RouteParamsResolverFactory $routeParamsResolver * @param \Magento\Url\QueryParamsResolverInterface $queryParamsResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Backend\Helper\Data $backendHelper * @param Menu\Config $menuConfig - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param Auth\Session $authSession * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Store\Model\StoreFactory $storeFactory @@ -114,18 +114,18 @@ class Url extends \Magento\Url implements \Magento\Backend\Model\UrlInterface * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Route\ConfigInterface $routeConfig, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\RequestInterface $request, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Backend\Model\Url\ScopeResolver $scopeResolver, \Magento\Session\Generic $session, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Url\RouteParamsResolverFactory $routeParamsResolver, \Magento\Url\QueryParamsResolverInterface $queryParamsResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Backend\Helper\Data $backendHelper, \Magento\Backend\Model\Menu\Config $menuConfig, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Store\Model\StoreFactory $storeFactory, diff --git a/app/code/Magento/Backend/Model/View.php b/app/code/Magento/Backend/Model/View.php index cded557c95df8d069a355952293e83013f45c32f..d8bc1e8704c8d4812d9ad6b5009d4ea3fbceb8db 100644 --- a/app/code/Magento/Backend/Model/View.php +++ b/app/code/Magento/Backend/Model/View.php @@ -23,7 +23,7 @@ */ namespace Magento\Backend\Model; -class View extends \Magento\App\View +class View extends \Magento\Framework\App\View { /** * @var Layout\Filter\Acl @@ -32,22 +32,22 @@ class View extends \Magento\App\View /** * @param \Magento\View\LayoutInterface $layout - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\Config\ScopeInterface $configScope * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Translate\InlineInterface $translateInline - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ActionFlag $actionFlag * @param Layout\Filter\Acl $aclFilter */ public function __construct( \Magento\View\LayoutInterface $layout, - \Magento\App\RequestInterface $request, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\ResponseInterface $response, \Magento\Config\ScopeInterface $configScope, \Magento\Event\ManagerInterface $eventManager, \Magento\Translate\InlineInterface $translateInline, - \Magento\App\ActionFlag $actionFlag, + \Magento\Framework\App\ActionFlag $actionFlag, Layout\Filter\Acl $aclFilter ) { $this->_aclFilter = $aclFilter; diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index 4a59ee7af1cb588fcd78843e8216be558b08578c..dd81198be2c7481894aef5af33aba12670c115db 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -26,15 +26,15 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Authorization\RoleLocator" type="Magento\Backend\Model\Authorization\RoleLocator" /> <preference for="Magento\Locale\ResolverInterface" type="Magento\Backend\Model\Locale\Resolver" /> - <preference for="Magento\App\Action\Context" type="Magento\Backend\App\Action\Context" /> + <preference for="Magento\Framework\App\Action\Context" type="Magento\Backend\App\Action\Context" /> <preference for="Magento\UrlInterface" type="Magento\Backend\Model\UrlInterface" /> <preference for="Magento\Backend\Model\Auth\StorageInterface" type="Magento\Backend\Model\Auth\Session" /> <preference for="Magento\Backend\Model\Config\Structure\SearchInterface" type="Magento\Backend\Model\Config\Structure" /> <preference for="Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Backend\Model\Config\Backend\File\RequestData" /> - <preference for="Magento\App\DefaultPathInterface" type="Magento\Backend\App\DefaultPath" /> + <preference for="Magento\Framework\App\DefaultPathInterface" type="Magento\Backend\App\DefaultPath" /> <preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" /> - <preference for="Magento\App\Response\Http\FileFactory" type="Magento\Backend\App\Response\Http\FileFactory" /> - <preference for="Magento\App\View" type="Magento\Backend\Model\View" /> + <preference for="Magento\Framework\App\Response\Http\FileFactory" type="Magento\Backend\App\Response\Http\FileFactory" /> + <preference for="Magento\Framework\App\View" type="Magento\Backend\Model\View" /> <preference for="Magento\Model\ActionValidator\RemoveAction" type="Magento\Model\ActionValidator\RemoveAction\Allowed" /> <type name="Magento\Backend\App\Action\Context"> <arguments> @@ -90,7 +90,7 @@ <argument name="area" xsi:type="string">adminhtml</argument> </arguments> </type> - <type name="Magento\App\RouterList"> + <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> <item name="admin" xsi:type="array"> @@ -99,7 +99,7 @@ <item name="sortOrder" xsi:type="string">10</item> </item> <item name="default" xsi:type="array"> - <item name="class" xsi:type="string">Magento\App\Router\DefaultRouter</item> + <item name="class" xsi:type="string">Magento\Framework\App\Router\DefaultRouter</item> <item name="disable" xsi:type="boolean">false</item> <item name="sortOrder" xsi:type="string">100</item> </item> @@ -115,7 +115,7 @@ <argument name="canUseSessionIdInParam" xsi:type="boolean">false</argument> </arguments> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="storeCheck" disabled="true" /> </type> <type name="Magento\Message\Manager"> @@ -125,8 +125,13 @@ </type> <type name="Magento\Translate"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Translate</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Translate</argument> <argument name="locale" xsi:type="object">Magento\Backend\Model\Locale\Resolver\Proxy</argument> </arguments> </type> + <type name="Magento\Core\Model\Session\Config"> + <arguments> + <argument name="lifetimePath" xsi:type="const">Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Backend/etc/adminhtml/routes.xml b/app/code/Magento/Backend/etc/adminhtml/routes.xml index c8ecfe23c48abda560cc0e0332bf4e415f13e924..721e1d290f479647e0d49f3b29cd82e4a74be29c 100644 --- a/app/code/Magento/Backend/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backend/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml" frontName="admin"> <module name="Magento_Backend" /> diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index e0f0f94a0a655baf62447f1b6487f59661b8062d..3390f86758674883ac81b6e090260d106b6f6f4b 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -24,8 +24,8 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <preference for="Magento\App\Config\Storage\WriterInterface" type="Magento\App\Config\Storage\Writer" /> - <preference for="Magento\App\Request\PathInfoProcessorInterface" type="Magento\Backend\App\Request\PathInfoProcessor" /> + <preference for="Magento\Framework\App\Config\Storage\WriterInterface" type="Magento\Framework\App\Config\Storage\Writer" /> + <preference for="Magento\Framework\App\Request\PathInfoProcessorInterface" type="Magento\Backend\App\Request\PathInfoProcessor" /> <preference for="Magento\Backend\Model\Auth\StorageInterface" type="Magento\Backend\Model\Auth\Session" /> <preference for="Magento\Backend\Model\Config\Structure\SearchInterface" type="Magento\Backend\Model\Config\Structure" /> <preference for="Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Backend\Model\Config\Backend\File\RequestData" /> @@ -33,7 +33,7 @@ <preference for="Magento\Adminhtml\Helper\Data" type="Magento\Backend\Helper\Data" /> <preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" /> <preference for="Magento\Backend\Model\UrlInterface" type="Magento\Backend\Model\Url" /> - <type name="Magento\App\AreaList"> + <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> <item name="adminhtml" xsi:type="array"> @@ -50,7 +50,7 @@ </type> <type name="Magento\Backend\Controller\Adminhtml\System\Config\Save"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Layout</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument> </arguments> </type> <type name="Magento\Backend\Model\Menu\Config"> @@ -70,7 +70,7 @@ <argument name="locale" xsi:type="object">Magento\Backend\Model\Locale\Resolver\Proxy</argument> </arguments> </type> - <type name="Magento\App\Router\NoRouteHandlerList"> + <type name="Magento\Framework\App\Router\NoRouteHandlerList"> <arguments> <argument name="handlerClassesList" xsi:type="array"> <item name="backend" xsi:type="array"> @@ -104,7 +104,7 @@ </type> <type name="Magento\Backend\Helper\Dashboard\Data"> <arguments> - <argument name="installDate" xsi:type="init_parameter">Magento\App\State::PARAM_INSTALL_DATE</argument> + <argument name="installDate" xsi:type="init_parameter">Magento\Framework\App\State::PARAM_INSTALL_DATE</argument> </arguments> </type> <preference for="Magento\Authorization\RoleLocator" type="Magento\Backend\Model\Authorization\RoleLocator" /> diff --git a/app/code/Magento/Backend/view/adminhtml/dashboard/grid.phtml b/app/code/Magento/Backend/view/adminhtml/dashboard/grid.phtml index 06ffee92c2de70a2311e39d2ac9c1715c0bdd334..e1881a700af236ff4fb6c95a4fe7cb9c9f5f081b 100644 --- a/app/code/Magento/Backend/view/adminhtml/dashboard/grid.phtml +++ b/app/code/Magento/Backend/view/adminhtml/dashboard/grid.phtml @@ -58,7 +58,7 @@ $numColumns = sizeof($this->getColumns()); <?php endforeach; ?> <?php elseif ($this->getEmptyText()): ?> <tr> - <td class="empty-text <?php echo $this->getEmptyTextClass() ?>" colspan="100"><?php echo $this->getEmptyText() ?></td> + <td class="<?php echo $this->getEmptyTextClass() ?>" colspan="100"><?php echo $this->getEmptyText() ?></td> </tr> <?php endif; ?> </tbody> diff --git a/app/code/Magento/Backend/view/adminhtml/email/order/items.phtml b/app/code/Magento/Backend/view/adminhtml/email/order/items.phtml index 871291ebe000972d459320c41ae30958eb48ea2c..8e931c9cd088fdca37349e2f7a1440ee0d395438 100644 --- a/app/code/Magento/Backend/view/adminhtml/email/order/items.phtml +++ b/app/code/Magento/Backend/view/adminhtml/email/order/items.phtml @@ -44,7 +44,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -52,17 +52,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -70,7 +70,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -83,24 +83,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -108,7 +108,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml index 2471a6978a2d1cc25986322836e65eb1eb5bdcd4..cfc3999a2da1d27bf5a40bea61615cb1200e5ae5 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_variable_grid_block.xml @@ -44,8 +44,9 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="variable_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Variable ID</argument> - <argument name="width" xsi:type="string">1px</argument> <argument name="index" xsi:type="string">variable_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="code"> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml index d710505fa24ad6a163d42cb13f70b51d4d7a1faa..b262bef8777ee509f778af8a285006ac8610f23f 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_urlrewrite_index.xml @@ -44,16 +44,16 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="url_rewrite_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">text</argument> <argument name="id" xsi:type="string">url_rewrite_id</argument> <argument name="index" xsi:type="string">url_rewrite_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="store_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Store View</argument> - <argument name="width" xsi:type="string">200px</argument> <argument name="type" xsi:type="string">store</argument> <argument name="id" xsi:type="string">store_id</argument> <argument name="index" xsi:type="string">store_id</argument> @@ -63,7 +63,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="is_system"> <arguments> <argument name="header" xsi:type="string" translate="true">Type</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">options</argument> <argument name="id" xsi:type="string">is_system</argument> <argument name="index" xsi:type="string">is_system</argument> @@ -82,7 +81,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="id_path"> <arguments> <argument name="header" xsi:type="string" translate="true">ID Path</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">text</argument> <argument name="id" xsi:type="string">id_path</argument> <argument name="index" xsi:type="string">id_path</argument> @@ -91,7 +89,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="request_path"> <arguments> <argument name="header" xsi:type="string" translate="true">Request Path</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">text</argument> <argument name="id" xsi:type="string">request_path</argument> <argument name="index" xsi:type="string">request_path</argument> @@ -100,7 +97,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="target_path"> <arguments> <argument name="header" xsi:type="string" translate="true">Target Path</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">text</argument> <argument name="id" xsi:type="string">target_path</argument> <argument name="index" xsi:type="string">target_path</argument> @@ -109,7 +105,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="options"> <arguments> <argument name="header" xsi:type="string" translate="true">Options</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="type" xsi:type="string">text</argument> <argument name="id" xsi:type="string">options</argument> <argument name="index" xsi:type="string">options</argument> @@ -120,7 +115,6 @@ <argument name="header" xsi:type="string" translate="true">Action</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="filter" xsi:type="string">0</argument> - <argument name="width" xsi:type="string">15px</argument> <argument name="type" xsi:type="string">action</argument> <argument name="id" xsi:type="string">actions</argument> <argument name="index" xsi:type="string">url_rewrite_id</argument> diff --git a/app/code/Magento/Backend/view/adminhtml/page/footer.phtml b/app/code/Magento/Backend/view/adminhtml/page/footer.phtml index 4d176481d18f67993b9ccd3acacbca3eb20435af..b4ca88feeba3a881154b3969818a95ab87afb906 100644 --- a/app/code/Magento/Backend/view/adminhtml/page/footer.phtml +++ b/app/code/Magento/Backend/view/adminhtml/page/footer.phtml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<small class="magento-version"><?php echo __('Magento ver. %1', \Magento\AppInterface::VERSION) ?></small> +<small class="magento-version"><?php echo __('Magento ver. %1', \Magento\Framework\AppInterface::VERSION) ?></small> <?php if ($this->getBugreportUrl()): ?> <a class="link-report" href="<?php echo $this->getBugreportUrl(); ?>" id="footer_bug_tracking"><?php echo __('Help Us Keep Magento Healthy - Report All Bugs') ?></a> <?php endif; ?> diff --git a/app/code/Magento/Backend/view/adminhtml/store/switcher.phtml b/app/code/Magento/Backend/view/adminhtml/store/switcher.phtml index f2e31892703748a7697567831acf03d5b7f2d836..b1ef3cf8f91e8804c6b6a5b8ec0abd29d4a0bd1e 100644 --- a/app/code/Magento/Backend/view/adminhtml/store/switcher.phtml +++ b/app/code/Magento/Backend/view/adminhtml/store/switcher.phtml @@ -129,14 +129,15 @@ function switchScope(obj) { var switcher = jQuery(obj); var scopeId = switcher.val(); - var scopeParams = switcher.data('param') + '/' + scopeId + '/'; + var scopeParams = ''; + if (scopeId) { + scopeParams = switcher.data('param') + '/' + scopeId + '/'; + } if (obj.switchParams) { scopeParams += obj.switchParams; } - var url = '<?php echo $this->getSwitchUrl() ?>' + scopeParams; - if ((typeof scopeSwitcherHandler) != 'undefined') { var switcherParams = { scopeId: scopeId, @@ -145,15 +146,16 @@ }; scopeSwitcherHandler(switcherParams); } else { - <?php if ($this->getUseConfirm()): ?> + var url = '<?php echo $this->getSwitchUrl() ?>' + scopeParams; + <?php if ($this->getUseConfirm()): ?> if (confirm("<?php echo __('Please confirm scope switching. All data that hasn\'t been saved will be lost.') ?>")) { setLocation(url); } else { obj.value = '<?php echo $this->getStoreId() ?>'; } - <?php else: ?> + <?php else: ?> setLocation(url); - <?php endif; ?> + <?php endif; ?> } } </script> diff --git a/app/code/Magento/Backend/view/adminhtml/system/config/form/field/array.phtml b/app/code/Magento/Backend/view/adminhtml/system/config/form/field/array.phtml index a75a1ad8165bacd3b584d38bd9e519b868e5725a..2f0ce511ea169796dea2c1e415c33d35bdbc53b7 100644 --- a/app/code/Magento/Backend/view/adminhtml/system/config/form/field/array.phtml +++ b/app/code/Magento/Backend/view/adminhtml/system/config/form/field/array.phtml @@ -42,7 +42,7 @@ $_colspan = $this->isAddAfter() ? 2 : 1; </thead> <tfoot> <tr> - <td colspan="<?php echo count($this->getColumns())+$_colspan; ?>"> + <td colspan="<?php echo count($this->getColumns())+$_colspan; ?>" class="col-actions-add"> <button id="addToEndBtn<?php echo $_htmlId; ?>" class="action- add" title="<?php echo __('Add'); ?>" type="button"> <span><?php echo $this->getAddButtonLabel(); ?><?php echo __('Add'); ?></span> </button> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml index e5fffc500596e8862b0961c76ce2be5594d31d21..b41272d9de9b5411822c2e9621a4fbbfc5d992ac 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml @@ -46,99 +46,69 @@ $numColumns = sizeof($this->getColumns()); <h1 class="title"><?php echo $this->getGridHeader(); ?></h1> </div> </div> - <?php endif ?> + <?php endif ?> - <div id="<?php echo $this->getId() ?>"> - <?php else: ?> - <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> + <div id="<?php echo $this->getId() ?>"> + <?php else: ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <?php endif; ?> - <?php if ($this->getPagerVisibility() || $this->getExportTypes() || $this->getChildBlock('grid.columnSet')->getFilterVisibility()): ?> - <div class="grid-actions"> - <?php if ($this->getChildBlock('grid.export')): ?> - <div class="export"> - <?php echo $this->getChildHtml('grid.export');?> - </div> - <?php endif; ?> - <div class="filter-actions"> - <?php echo $this->getMainButtonsHtml() ?> - </div> - <?php if ($this->getPagerVisibility()): ?> - <div class="pager"> - <label> - <?php echo __('Page') ?> - - <?php $_curPage = $this->getCollection()->getCurPage() ?> - <?php $_lastPage = $this->getCollection()->getLastPageNumber() ?> - - <?php if ($_curPage > 1): ?> - <a href="#" title="<?php echo __('Previous page') ?>" class="action-previous" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage - 1) ?>');return false;"><?php echo __('Previous page') ?></a> - <?php else: ?> - <span class="action-previous disabled"><?php echo __('Previous page') ?></span> - <?php endif; ?> - - <input type="text" name="<?php echo $this->getVarNamePage() ?>" value="<?php echo $_curPage ?>" - class="input-text page" - onkeypress="<?php echo $this->getJsObjectName() ?>.inputPage(event, '<?php echo $_lastPage ?>')" <?php echo $this->getUiId('current-page') ?>/> - </label> - - <?php if ($_curPage < $_lastPage): ?> - <a href="#" title="<?php echo __('Next page') ?>" class="action-next" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage + 1) ?>');return false;"><?php echo __('Next page') ?></a> - <?php else: ?> - <span class="action-next disabled"><?php echo __('Next page') ?></span> - <?php endif; ?> - - <?php echo __('of %1 pages', $this->getCollection()->getLastPageNumber()) ?> - <span class="separator">|</span> - <label> - <?php echo __('View') ?> - <select name="<?php echo $this->getVarNameLimit() ?>" - onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this)" <?php echo $this->getUiId('per-page') ?>> - <option value="20"<?php if ($this->getCollection()->getPageSize() == 20): ?> - selected="selected"<?php endif; ?>>20 - </option> - <option value="30"<?php if ($this->getCollection()->getPageSize() == 30): ?> - selected="selected"<?php endif; ?>>30 - </option> - <option value="50"<?php if ($this->getCollection()->getPageSize() == 50): ?> - selected="selected"<?php endif; ?>>50 - </option> - <option value="100"<?php if ($this->getCollection()->getPageSize() == 100): ?> - selected="selected"<?php endif; ?>>100 - </option> - <option value="200"<?php if ($this->getCollection()->getPageSize() == 200): ?> - selected="selected"<?php endif; ?>>200 - </option> - </select> - </label> - <?php echo __('per page') ?> - <span class="separator">|</span> - <?php $countRecords = $this->getCollection()->getSize(); ?> - <?php echo __('Total %1 records found', $countRecords) ?> - <span id="<?php echo $this->getHtmlId() ?>-total-count" - class="total-count no-display"<?php echo $this->getUiId('total-count') ?>><?php echo $countRecords ?></span> - <?php if ($this->getRssLists()): ?> - <?php foreach ($this->getRssLists() as $_rss): ?> - <span class="separator">|</span> - <a href="<?php echo $_rss->getUrl() ?>" class="link-feed"><?php echo $_rss->getLabel() ?></a> - <?php endforeach ?> + <?php if ($this->getPagerVisibility() || $this->getExportTypes() || $this->getChildBlock('grid.columnSet')->getFilterVisibility()): ?> + <div class="grid-actions"> + <?php if ($this->getChildBlock('grid.export')): ?> + <div class="export"> + <?php echo $this->getChildHtml('grid.export'); ?> + </div> <?php endif; ?> + <div class="filter-actions"> + <?php echo $this->getMainButtonsHtml() ?> + </div> + <?php if ($this->getPagerVisibility()): ?> + <div class="pager"> + <?php $countRecords = $this->getCollection()->getSize(); ?> + <span class="pages-total-found"><?php echo __('Total %1 records found', $countRecords) ?></span> + <span id="<?php echo $this->getHtmlId() ?>-total-count" + class="total-count no-display"<?php echo $this->getUiId('total-count') ?>> + <?php echo $countRecords ?> + </span> + <label class="view-pages"> + <?php echo __('View') ?> + <select name="<?php echo $this->getVarNameLimit() ?>" + onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this)" <?php echo $this->getUiId('per-page') ?> + class="select"> + <option value="20"<?php if ($this->getCollection()->getPageSize() == 20): ?> + selected="selected"<?php endif; ?>>20 + </option> + <option value="30"<?php if ($this->getCollection()->getPageSize() == 30): ?> + selected="selected"<?php endif; ?>>30 + </option> + <option value="50"<?php if ($this->getCollection()->getPageSize() == 50): ?> + selected="selected"<?php endif; ?>>50 + </option> + <option value="100"<?php if ($this->getCollection()->getPageSize() == 100): ?> + selected="selected"<?php endif; ?>>100 + </option> + <option value="200"<?php if ($this->getCollection()->getPageSize() == 200): ?> + selected="selected"<?php endif; ?>>200 + </option> + </select> + <?php echo __('per page') ?> + </label> + </div> + <?php endif ?> </div> - <?php endif ?> - </div> <?php endif; ?> - <?php if ($this->getChildBlock('grid.massaction') && $this->getChildBlock('grid.massaction')->isAvailable()): ?> - <?php echo $this->getChildHtml('grid.massaction') ?> - <?php endif ?> + <?php if ($this->getChildBlock('grid.massaction') && $this->getChildBlock('grid.massaction')->isAvailable()): ?> + <?php echo $this->getChildHtml('grid.massaction') ?> + <?php endif ?> - <?php if ($this->getGridCssClass()): ?> - <div class="grid-container"> - <table class="<?php echo $this->getGridCssClass() ?>" id="<?php echo $this->getId() ?>_table"> - <!-- Rendering column set --> - <?php echo $this->getChildHtml('grid.columnSet'); ?> - </table> - </div> - <?php else: ?> - <div class="grid"> + <?php if ($this->getGridCssClass()): ?> + <div class="grid-container"> + <table class="<?php echo $this->getGridCssClass() ?>" id="<?php echo $this->getId() ?>_table"> + <!-- Rendering column set --> + <?php echo $this->getChildHtml('grid.columnSet'); ?> + </table> + </div> + <?php else: ?> <div class="grid"> <div class="hor-scroll"> <table class="data" id="<?php echo $this->getId() ?>_table"> @@ -146,13 +116,48 @@ $numColumns = sizeof($this->getColumns()); <?php echo $this->getChildHtml('grid.columnSet'); ?> </table> </div> + <?php if ($this->getPagerVisibility()): ?> + <div class="pager"> + <label class="page"><?php echo __('Page') ?></label> + + <?php $_curPage = $this->getCollection()->getCurPage() ?> + <?php $_lastPage = $this->getCollection()->getLastPageNumber() ?> + + <?php if ($_curPage > 1): ?> + <a href="#" title="<?php echo __('Previous page') ?>" class="action-previous" + onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo($_curPage - 1) ?>');return false;"><span><?php echo __('Previous page') ?></span></a> + <?php else: ?> + <span class="action-previous disabled"><span><?php echo __('Previous page') ?></span></span> + <?php endif; ?> + + <input type="text" name="<?php echo $this->getVarNamePage() ?>" value="<?php echo $_curPage ?>" + class="input-text page" + onkeypress="<?php echo $this->getJsObjectName() ?>.inputPage(event, '<?php echo $_lastPage ?>')" <?php echo $this->getUiId('current-page') ?> /> + + <span class="pages-total"> + <?php echo __('of %1', $this->getCollection()->getLastPageNumber()) ?></span> + </span> + + <?php if ($_curPage < $_lastPage): ?> + <a href="#" title="<?php echo __('Next page') ?>" class="action-next" + onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo($_curPage + 1) ?>');return false;"><span><?php echo __('Next page') ?></span></a> + <?php else: ?> + <span class="action-next disabled"><span><?php echo __('Next page') ?></span></span> + <?php endif; ?> + <?php if ($this->getRssLists()): ?> + <?php foreach ($this->getRssLists() as $_rss): ?> + <a href="<?php echo $_rss->getUrl() ?>" + class="link-feed"><?php echo $_rss->getLabel() ?></a> + <?php endforeach ?> + <?php endif; ?> + </div> + <?php endif ?> </div> - </div> - <?php endif ?> - <?php if ($this->canDisplayContainer()): ?> -</div> -<script type="text/javascript"> - <?php echo $this->getJsObjectName() ?>= new varienGrid('<?php echo $this->getId() ?>', '<?php echo $this->getGridUrl() ?>', '<?php echo $this->getVarNamePage() ?>', '<?php echo $this->getVarNameSort() ?>', '<?php echo $this->getVarNameDir() ?>', '<?php echo $this->getVarNameFilter() ?>'); + <?php endif ?> + <?php if ($this->canDisplayContainer()): ?> + </div> + <script type="text/javascript"> + <?php echo $this->getJsObjectName() ?> = new varienGrid('<?php echo $this->getId() ?>', '<?php echo $this->getGridUrl() ?>', '<?php echo $this->getVarNamePage() ?>', '<?php echo $this->getVarNameSort() ?>', '<?php echo $this->getVarNameDir() ?>', '<?php echo $this->getVarNameFilter() ?>'); <?php echo $this->getJsObjectName() ?>.useAjax = <?php echo $this->getUseAjax() ? 'true' : 'false' ?>; <?php if ($this->getRowClickCallback()): ?> <?php echo $this->getJsObjectName() ?>.rowClickCallback = <?php echo $this->getRowClickCallback() ?>; @@ -172,9 +177,9 @@ $numColumns = sizeof($this->getColumns()); <?php echo $this->getChildBlock('grid.massaction')->getJavaScript() ?> <?php endif ?> <?php echo $this->getAdditionalJavaScript(); ?> -</script> - <?php endif; ?> -<?php if ($this->getChildBlock('grid.js')): ?> - <?php echo $this->getChildHtml('grid.js'); ?> + </script> +<?php endif; ?> + <?php if ($this->getChildBlock('grid.js')): ?> + <?php echo $this->getChildHtml('grid.js'); ?> <?php endif; ?> <?php endif ?> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/column_set.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/column_set.phtml index a273ce27868836194b4eb98564500412b7c2d400..5da1f27c5ee61519a2be3dffdd87a11219a5161d 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/column_set.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/column_set.phtml @@ -140,7 +140,7 @@ $numColumns = sizeof($this->getColumns()); <?php endforeach; ?> <?php elseif ($this->getEmptyText()): ?> <tr data-role="row"> - <td class="empty-text <?php echo $this->getEmptyTextClass() ?>" + <td class="<?php echo $this->getEmptyTextClass() ?>" colspan="<?php echo $numColumns ?>" ><?php echo $this->getEmptyText() ?></td> </tr> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/export.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/export.phtml index 4dd1db4cd6f377067dc07c9200bc395491355b97..2be3d4e422a72e6a93e46ded81de6a39c0004404 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/export.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/export.phtml @@ -25,12 +25,12 @@ */ ?> -<label> +<label for="<?php echo $this->getId() ?>_export" class="label"> <?php echo __('Export to:') ?> - <select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" style="width:8em;"> - <?php foreach ($this->getExportTypes() as $_type): ?> - <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option> - <?php endforeach; ?> - </select> </label> +<select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" class="select"> + <?php foreach ($this->getExportTypes() as $_type): ?> + <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option> + <?php endforeach; ?> +</select> <?php echo $this->getExportButtonHtml() ?> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml index ae4fb53385bbbcdde9a8a8cdef53760230ec7f75..98c6d3cc8d60e6f3b6bc3d30fcaf1ff064995998 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml @@ -41,216 +41,230 @@ $numColumns = sizeof($this->getColumns()); */ ?> <?php if ($this->getCollection()): ?> -<?php if ($this->canDisplayContainer()): ?> + <?php if ($this->canDisplayContainer()): ?> <?php if ($this->getGridHeader()): ?> <div class="page-title"> <div class="page-title-inner"> <h1 class="title"><?php echo $this->getGridHeader(); ?></h1> </div> </div> - <?php endif ?> + <?php endif ?> - <div id="<?php echo $this->getId() ?>"> + <div id="<?php echo $this->getId() ?>"> <?php else: ?> <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> - <?php endif; ?> + <?php endif; ?> <?php if ($this->getPagerVisibility() || $this->getExportTypes() || $this->getFilterVisibility()): ?> <div class="grid-actions"> - <div class="filter-actions"> - <?php echo $this->getMainButtonsHtml() ?> - </div> <?php if ($this->getExportTypes()): ?> - <div class="export"> - <label><?php echo __('Export to:') ?> + <div class="export"> + <label for="<?php echo $this->getId() ?>_export" + class="label"><?php echo __('Export to:') ?></label> <select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" - style="width:8em;"> + class="select"> <?php foreach ($this->getExportTypes() as $_type): ?> - <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option> + <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option> <?php endforeach; ?> </select> - </label> - <?php echo $this->getExportButtonHtml() ?> - </div> + <?php echo $this->getExportButtonHtml() ?> + </div> <?php endif; ?> + <div class="filter-actions"> + <?php echo $this->getMainButtonsHtml() ?> + </div> <?php if ($this->getPagerVisibility()): ?> - <div class="pager"> - <label> - <?php echo __('Page') ?> - - <?php $_curPage = $this->getCollection()->getCurPage() ?> - <?php $_lastPage = $this->getCollection()->getLastPageNumber() ?> - - <?php if ($_curPage > 1): ?> - <a href="#" title="<?php echo __('Previous page') ?>" class="action-previous" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage - 1) ?>');return false;"><?php echo __('Previous page') ?></a> - <?php else: ?> - <span class="action-previous disabled"><?php echo __('Previous page') ?></span> - <?php endif; ?> - - <input type="text" name="<?php echo $this->getVarNamePage() ?>" value="<?php echo $_curPage ?>" - class="input-text page" - onkeypress="<?php echo $this->getJsObjectName() ?>.inputPage(event, '<?php echo $_lastPage ?>')"/> - - <?php if ($_curPage < $_lastPage): ?> - <a href="#" title="<?php echo __('Next page') ?>" class="action-next" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage + 1) ?>');return false;"><?php echo __('Next page') ?></a> - <?php else: ?> - <span class="action-next disabled"><?php echo __('Next page') ?></span> - <?php endif; ?> - - <?php echo __('of %1 pages', $this->getCollection()->getLastPageNumber()) ?> - </label> - <span class="separator">|</span> - <label> - <?php echo __('View') ?> - <select name="<?php echo $this->getVarNameLimit() ?>" - onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this)"> - <option value="20"<?php if ($this->getCollection()->getPageSize() == 20): ?> + <div class="pager"> + <span class="pages-total-found"> + <?php echo __('Total %1 records found', $this->getCollection()->getSize()) ?> + </span> + <span id="<?php echo $this->getHtmlId() ?>-total-count" + class="no-display"><?php echo $this->getCollection()->getSize() ?></span> + <label class="view-pages"> + <?php echo __('View') ?> + <select name="<?php echo $this->getVarNameLimit() ?>" + onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this)" class="select"> + <option value="20"<?php if ($this->getCollection()->getPageSize() == 20): ?> selected="selected"<?php endif; ?>>20 - </option> - <option value="30"<?php if ($this->getCollection()->getPageSize() == 30): ?> + </option> + <option value="30"<?php if ($this->getCollection()->getPageSize() == 30): ?> selected="selected"<?php endif; ?>>30 - </option> - <option value="50"<?php if ($this->getCollection()->getPageSize() == 50): ?> + </option> + <option value="50"<?php if ($this->getCollection()->getPageSize() == 50): ?> selected="selected"<?php endif; ?>>50 - </option> - <option value="100"<?php if ($this->getCollection()->getPageSize() == 100): ?> + </option> + <option value="100"<?php if ($this->getCollection()->getPageSize() == 100): ?> selected="selected"<?php endif; ?>>100 - </option> - <option value="200"<?php if ($this->getCollection()->getPageSize() == 200): ?> + </option> + <option value="200"<?php if ($this->getCollection()->getPageSize() == 200): ?> selected="selected"<?php endif; ?>>200 - </option> - </select> - <?php echo __('per page') ?> - </label> - <span class="separator">|</span> - <?php echo __('Total %1 records found', $this->getCollection()->getSize()) ?> - <span id="<?php echo $this->getHtmlId() ?>-total-count" - class="no-display"><?php echo $this->getCollection()->getSize() ?></span> - <?php if ($this->getRssLists()): ?> - <?php foreach ($this->getRssLists() as $_rss): ?> - <span class="separator">|</span> - <a href="<?php echo $_rss->getUrl() ?>" class="link-feed"><?php echo $_rss->getLabel() ?></a> - <?php endforeach ?> - <?php endif; ?> - </div> + </option> + </select> + <?php echo __('per page') ?> + </label> + </div> <?php endif ?> </div> - <?php endif; ?> + <?php endif; ?> <?php if ($this->getMassactionBlock() && $this->getMassactionBlock()->isAvailable()): ?> <?php echo $this->getMassactionBlockHtml() ?> - <?php endif ?> + <?php endif ?> <div class="grid"> - <table cellspacing="0" class="data" id="<?php echo $this->getId() ?>_table"> - <?php - /* This part is commented to remove all <col> tags from the code. */ - /* foreach ($this->getColumns() as $_column): ?> - <col <?php echo $_column->getHtmlProperty() ?> /> - <?php endforeach; */ ?> - <?php if ($this->getHeadersVisibility() || $this->getFilterVisibility()): ?> - <thead> - <?php if ($this->getHeadersVisibility()): ?> - <tr class="headings"> - <?php foreach ($this->getColumns() as $_column): ?> - <th<?php echo $_column->getHeaderHtmlProperty() ?>> - <span><?php echo $_column->getHeaderHtml() ?></span> - </th> - <?php endforeach; ?> - </tr> + <div class="hor-scroll"> + <table class="data" id="<?php echo $this->getId() ?>_table"> + <?php + /* This part is commented to remove all <col> tags from the code. */ + /* foreach ($this->getColumns() as $_column): ?> + <col <?php echo $_column->getHtmlProperty() ?> /> + <?php endforeach; */ + ?> + <?php if ($this->getHeadersVisibility() || $this->getFilterVisibility()): ?> + <thead> + <?php if ($this->getHeadersVisibility()): ?> + <tr class="headings"> + <?php foreach ($this->getColumns() as $_column): ?> + <th<?php echo $_column->getHeaderHtmlProperty() ?>> + <span><?php echo $_column->getHeaderHtml() ?></span> + </th> + <?php endforeach; ?> + </tr> + <?php endif; ?> + <?php if ($this->getFilterVisibility()): ?> + <tr class="filter"> + <?php $i = 0; + foreach ($this->getColumns() as $_column): ?> + <th<?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getFilterHtml() ?></th> + <?php endforeach; ?> + </tr> + <?php endif ?> + </thead> + <?php endif; ?> + <?php if ($this->getCountTotals()): ?> + <tfoot> + <tr class="totals"> + <?php foreach ($this->getColumns() as $_column): ?> + <th class="<?php echo $_column->getCssProperty() ?>"> + <?php echo ($_column->hasTotalsLabel()) ? $_column->getTotalsLabel() : $_column->getRowField($_column->getGrid()->getTotals()) ?> + </th> + <?php endforeach; ?> + </tr> + </tfoot> <?php endif; ?> - <?php if ($this->getFilterVisibility()): ?> - <tr class="filter"> - <?php $i = 0;foreach ($this->getColumns() as $_column): ?> - <th<?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getFilterHtml() ?></th> - <?php endforeach; ?> - </tr> - <?php endif ?> - </thead> - <?php endif; ?> - <?php if ($this->getCountTotals()): ?> - <tfoot> - <tr class="totals"> - <?php foreach ($this->getColumns() as $_column): ?> - <th class="<?php echo $_column->getCssProperty() ?>"><?php echo ($_column->hasTotalsLabel()) ? $_column->getTotalsLabel() : $_column->getRowField($_column->getGrid()->getTotals()) ?> - </th> - <?php endforeach; ?> - </tr> - </tfoot> - <?php endif; ?> - <tbody> + <tbody> <?php if (($this->getCollection()->getSize() > 0) && (!$this->getIsCollapsed())): ?> - <?php foreach ($this->getCollection() as $_index => $_item): ?> - <tr title="<?php echo $this->getRowUrl($_item) ?>"<?php if ($_class = $this->getRowClass($_item)): ?> - class="<?php echo $_class; ?>"<?php endif;?> ><?php - $i = 0; - foreach ($this->getColumns() as $_column): - if ($this->shouldRenderCell($_item, $_column)): - $_rowspan = $this->getRowspan($_item, $_column); - ?><td <?php echo ($_rowspan ? 'rowspan="' . $_rowspan . '" ' : '') ?>class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"> - <?php echo (($_html = $_column->getRowField($_item)) != '' ? $_html : ' ') ?> - </td><?php - if ($this->shouldRenderEmptyCell($_item, $_column)): - ?><td colspan="<?php echo $this->getEmptyCellColspan($_item)?>" - class="last"><?php echo $this->getEmptyCellLabel()?></td><?php - endif; - endif; - endforeach; ?> - </tr> - <?php if ($_multipleRows = $this->getMultipleRows($_item)): ?> - <?php foreach ($_multipleRows as $_i): ?> - <tr> - <?php $i = 0;foreach ($this->getMultipleRowColumns($_i) as $_column): ?> - <td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns - 1 ? 'last' : '' ?>"> - <?php echo (($_html = $_column->getRowField($_i)) != '' ? $_html : ' ') ?> - </td> - <?php endforeach; ?> + <?php foreach ($this->getCollection() as $_index => $_item): ?> + <tr title="<?php echo $this->getRowUrl($_item) ?>"<?php if ($_class = $this->getRowClass($_item)): ?> + class="<?php echo $_class; ?>"<?php endif; ?> ><?php + $i = 0; + foreach ($this->getColumns() as $_column): + if ($this->shouldRenderCell($_item, $_column)): + $_rowspan = $this->getRowspan($_item, $_column); + ?> + <td <?php echo($_rowspan ? 'rowspan="' . $_rowspan . '" ' : '') ?>class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"> + <?php echo(($_html = $_column->getRowField($_item)) != '' ? $_html : ' ') ?> + </td><?php + if ($this->shouldRenderEmptyCell($_item, $_column)): + ?> + <td colspan="<?php echo $this->getEmptyCellColspan($_item) ?>" + class="last"><?php echo $this->getEmptyCellLabel() ?></td><?php + endif; + endif; + endforeach; ?> </tr> + <?php if ($_multipleRows = $this->getMultipleRows($_item)): ?> + <?php foreach ($_multipleRows as $_i): ?> + <tr> + <?php $i = 0; + foreach ($this->getMultipleRowColumns($_i) as $_column): ?> + <td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns - 1 ? 'last' : '' ?>"> + <?php echo(($_html = $_column->getRowField($_i)) != '' ? $_html : ' ') ?> + </td> + <?php endforeach; ?> + </tr> <?php endforeach; ?> <?php endif; ?> - <?php if ($this->shouldRenderSubTotal($_item)): ?> - <tr class="subtotals"> - <?php $i = 0; foreach ($this->getSubTotalColumns() as $_column): ?> - <td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"> - <?php echo ($_column->hasSubtotalsLabel() ? $_column->getSubtotalsLabel() : - $_column->getRowField($this->getSubTotalItem($_item)) - ); - ?> - </td> - <?php endforeach; ?> - </tr> + <?php if ($this->shouldRenderSubTotal($_item)): ?> + <tr class="subtotals"> + <?php $i = 0; + foreach ($this->getSubTotalColumns() as $_column): ?> + <td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i == $numColumns ? 'last' : '' ?>"> + <?php echo($_column->hasSubtotalsLabel() ? $_column->getSubtotalsLabel() : + $_column->getRowField($this->getSubTotalItem($_item)) + ); + ?> + </td> + <?php endforeach; ?> + </tr> <?php endif; ?> <?php endforeach; ?> <?php elseif ($this->getEmptyText()): ?> - <tr> - <td class="empty-text <?php echo $this->getEmptyTextClass() ?>" - colspan="<?php echo $numColumns ?>"><?php echo $this->getEmptyText() ?></td> - </tr> + <tr> + <td class="<?php echo $this->getEmptyTextClass() ?>" + colspan="<?php echo $numColumns ?>"><?php echo $this->getEmptyText() ?></td> + </tr> + <?php endif; ?> + </tbody> + </table> + </div> + <?php if ($this->getPagerVisibility()): ?> + <div class="pager"> + <label class="page"><?php echo __('Page') ?></label> + + <?php $_curPage = $this->getCollection()->getCurPage() ?> + <?php $_lastPage = $this->getCollection()->getLastPageNumber() ?> + + <?php if ($_curPage > 1): ?> + <a href="#" title="<?php echo __('Previous page') ?>" class="action-previous" + onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo($_curPage - 1) ?>');return false;"><span><?php echo __('Previous page') ?></span></a> + <?php else: ?> + <span class="action-previous disabled"><span><?php echo __('Previous page') ?></span></span> <?php endif; ?> - </tbody> - </table> + <input type="text" name="<?php echo $this->getVarNamePage() ?>" value="<?php echo $_curPage ?>" + class="input-text page" + onkeypress="<?php echo $this->getJsObjectName() ?>.inputPage(event, '<?php echo $_lastPage ?>')"/> + + <span class="pages-total"> + <?php echo __('of %1', $this->getCollection()->getLastPageNumber()) ?> + </span> + + <?php if ($_curPage < $_lastPage): ?> + <a href="#" title="<?php echo __('Next page') ?>" class="action-next" + onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo($_curPage + 1) ?>');return false;"><span><?php echo __('Next page') ?></span></a> + <?php else: ?> + <span class="action-next disabled"><span><?php echo __('Next page') ?></span></span> + <?php endif; ?> + <?php if ($this->getRssLists()): ?> + <?php foreach ($this->getRssLists() as $_rss): ?> + <a href="<?php echo $_rss->getUrl() ?>" + class="link-feed"><?php echo $_rss->getLabel() ?></a> + <?php endforeach ?> + <?php endif; ?> + </div> + <?php endif ?> </div> <?php if ($this->canDisplayContainer()): ?> </div> <script type="text/javascript"> //<![CDATA[ - <?php echo $this->getJsObjectName() ?> = new varienGrid('<?php echo $this->getId() ?>', '<?php echo $this->getGridUrl() ?>', '<?php echo $this->getVarNamePage() ?>', '<?php echo $this->getVarNameSort() ?>', '<?php echo $this->getVarNameDir() ?>', '<?php echo $this->getVarNameFilter() ?>'); - <?php echo $this->getJsObjectName() ?>.useAjax = '<?php echo $this->getUseAjax() ?>'; - <?php if ($this->getRowClickCallback()): ?> - <?php echo $this->getJsObjectName() ?>.rowClickCallback = <?php echo $this->getRowClickCallback() ?>; - <?php endif; ?> - <?php if ($this->getCheckboxCheckCallback()): ?> - <?php echo $this->getJsObjectName() ?>.checkboxCheckCallback = <?php echo $this->getCheckboxCheckCallback() ?>; - <?php endif; ?> - <?php if ($this->getRowInitCallback()): ?> - <?php echo $this->getJsObjectName() ?>.initRowCallback = <?php echo $this->getRowInitCallback() ?>; - <?php echo $this->getJsObjectName() ?>.initGridRows(); - <?php endif; ?> - <?php if ($this->getMassactionBlock() && $this->getMassactionBlock()->isAvailable()): ?> - <?php echo $this->getMassactionBlock()->getJavaScript() ?> - <?php endif ?> - <?php echo $this->getAdditionalJavaScript(); ?> + <?php echo $this->getJsObjectName() ?> = new varienGrid('<?php echo $this->getId() ?>', '<?php echo $this->getGridUrl() ?>', '<?php echo $this->getVarNamePage() ?>', '<?php echo $this->getVarNameSort() ?>', '<?php echo $this->getVarNameDir() ?>', '<?php echo $this->getVarNameFilter() ?>'); + <?php echo $this->getJsObjectName() ?>.useAjax = '<?php echo $this->getUseAjax() ?>'; + <?php if ($this->getRowClickCallback()): ?> + <?php echo $this->getJsObjectName() ?>.rowClickCallback = <?php echo $this->getRowClickCallback() ?>; + <?php endif; ?> + <?php if ($this->getCheckboxCheckCallback()): ?> + <?php echo $this->getJsObjectName() ?>.checkboxCheckCallback = <?php echo $this->getCheckboxCheckCallback() ?>; + <?php endif; ?> + <?php if ($this->getRowInitCallback()): ?> + <?php echo $this->getJsObjectName() ?>.initRowCallback = <?php echo $this->getRowInitCallback() ?>; + <?php echo $this->getJsObjectName() ?>.initGridRows(); + <?php endif; ?> + <?php if ($this->getMassactionBlock() && $this->getMassactionBlock()->isAvailable()): ?> + <?php echo $this->getMassactionBlock()->getJavaScript() ?> + <?php endif ?> + <?php echo $this->getAdditionalJavaScript(); ?> //]]> </script> - <?php endif; ?> +<?php endif; ?> <?php endif ?> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction.phtml index f69940ba4466b185503b51353403f31e0931334c..cfb61306f4306b6de832251565347c29b70cc155 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction.phtml @@ -28,28 +28,25 @@ <div class="massaction"> <div class="entry-edit"> <?php if ($this->getHideFormElement() !== true):?> - <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> + <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> <?php endif ?> <?php echo $this->getBlockHtml('formkey')?> - <fieldset> <span class="field-row"> - <label><?php echo __('Actions') ?> + <label class="label"><?php echo __('Actions') ?></label> <select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation"<?php echo $this->getUiId('select') ?>> <option value=""></option> <?php foreach ($this->getItems() as $_item):?> <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option> <?php endforeach; ?> </select> - </label> </span> <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span> <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span> <span class="field-row"> <?php echo $this->getApplyButtonHtml() ?> </span> - </fieldset> <?php if ($this->getHideFormElement() !== true):?> - </form> + </form> <?php endif ?> <div class="no-display"> <?php foreach ($this->getItems() as $_item): ?> @@ -61,26 +58,55 @@ <?php endforeach; ?> </div> </div> - <ul> - <?php if ($this->getUseSelectAll()):?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectAll()"<?php echo $this->getUiId('select','all','link') ?>><?php echo __('Select All') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectAll()"<?php echo $this->getUiId('unselect','all','link') ?>><?php echo __('Unselect All') ?></a> - </li> - <?php endif; ?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectVisible()"<?php echo $this->getUiId('select','visible','link') ?>><?php echo __('Select Visible') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectVisible()"<?php echo $this->getUiId('unselect','visible','link') ?>><?php echo __('Unselect Visible') ?></a> - </li> - <li> + <div class="entry-select"> + <select id="massaction-select" class="select"> + <option value=""> + <?php echo __('Mass Actions')?> + </option> + <?php if ($this->getUseSelectAll()):?> + <option value="selectAll"> + <?php echo __('Select All') ?> + </option> + <option value="unselectAll"> + <?php echo __('Unselect All') ?> + </option> + <?php endif; ?> + <option value="selectVisible"> + <?php echo __('Select Visible') ?> + </option> + <option value="unselectVisible"> + <?php echo __('Unselect Visible') ?> + </option> + </select> + <span class="items"> <strong id="<?php echo $this->getHtmlId() ?>-count">0</strong> <?php echo __('items selected') ?> - </li> - </ul> + </span> + </div> </div> +<script type="text/javascript"> + (function($) { + 'use strict'; + $('#massaction-select').change(function () { + var massAction = $('option:selected', this).val(); + switch (massAction) { + <?php if ($this->getUseSelectAll()):?> + case 'selectAll': + return <?php echo $this->getJsObjectName() ?>.selectAll() + break + case 'unselectAll': + return <?php echo $this->getJsObjectName() ?>.unselectAll() + break + <?php endif; ?> + case 'selectVisible': + return <?php echo $this->getJsObjectName() ?>.selectVisible() + break + case 'unselectVisible': + return <?php echo $this->getJsObjectName() ?>.unselectVisible() + break + } + }); + })(window.jQuery); +</script> <?php if (!$this->getParentBlock()->canDisplayContainer()): ?> <script type="text/javascript"> <?php echo $this->getJsObjectName() ?>.setGridIds('<?php echo $this->getGridIdsJson() ?>'); diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction_extended.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction_extended.phtml index d0088179dd4147bd166c3c56ddb48fdd564022cb..1d546bd14417aa8afa68906350f47975686842d3 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction_extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/massaction_extended.phtml @@ -32,26 +32,23 @@ <div class="entry-edit"> <?php if ($this->getHideFormElement() !== true):?> <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> - <?php endif ?> + <?php endif ?> <?php echo $this->getBlockHtml('formkey')?> - <fieldset> - <span class="field-row"> - <label><?php echo __('Actions') ?> - <select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation"> - <option value=""></option> - <?php foreach ($this->getItems() as $_item): ?> - <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option> - <?php endforeach; ?> - </select> - </label> - </span> - <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span> - <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span> - <span class="field-row"> - <?php echo $this->getApplyButtonHtml() ?> - </span> - </fieldset> - <?php if ($this->getHideFormElement() !== true):?> + <span class="field-row"> + <label class="label"><?php echo __('Actions') ?></label> + <select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation"> + <option value=""></option> + <?php foreach ($this->getItems() as $_item): ?> + <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option> + <?php endforeach; ?> + </select> + </span> + <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span> + <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span> + <span class="field-row"> + <?php echo $this->getApplyButtonHtml() ?> + </span> + <?php if ($this->getHideFormElement() !== true):?> </form> <?php endif ?> <div class="no-display"> @@ -62,26 +59,55 @@ <?php endforeach; ?> </div> </div> - <ul> - <?php if ($this->getUseSelectAll()):?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectAll()"><?php echo __('Select All') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectAll()"><?php echo __('Unselect All') ?></a> - </li> - <?php endif; ?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectVisible()"><?php echo __('Select Visible') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectVisible()"><?php echo __('Unselect Visible') ?></a> - </li> - <li> + <div class="entry-select"> + <select id="massaction-select" class="select"> + <option value=""> + <?php echo __('Mass Actions')?> + </option> + <?php if ($this->getUseSelectAll()):?> + <option value="selectAll"> + <?php echo __('Select All') ?> + </option> + <option value="unselectAll"> + <?php echo __('Unselect All') ?> + </option> + <?php endif; ?> + <option value="selectVisible"> + <?php echo __('Select Visible') ?> + </option> + <option value="unselectVisible"> + <?php echo __('Unselect Visible') ?> + </option> + </select> + <span class="items"> <strong id="<?php echo $this->getHtmlId() ?>-count">0</strong> <?php echo __('items selected') ?> - </li> - </ul> + </span> + </div> </div> +<script type="text/javascript"> + (function($) { + 'use strict'; + $('#massaction-select').change(function () { + var massAction = $('option:selected', this).val(); + switch (massAction) { + <?php if ($this->getUseSelectAll()):?> + case 'selectAll': + return <?php echo $this->getJsObjectName() ?>.selectAll() + break + case 'unselectAll': + return <?php echo $this->getJsObjectName() ?>.unselectAll() + break + <?php endif; ?> + case 'selectVisible': + return <?php echo $this->getJsObjectName() ?>.selectVisible() + break + case 'unselectVisible': + return <?php echo $this->getJsObjectName() ?>.unselectVisible() + break + } + }); + })(window.jQuery); +</script> <?php if (!$this->getParentBlock()->canDisplayContainer()): ?> <script type="text/javascript"> <?php echo $this->getJsObjectName() ?>.setGridIds('<?php echo $this->getGridIdsJson() ?>'); diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index.php b/app/code/Magento/Backup/Controller/Adminhtml/Index.php index b7642ff930f3f0917511e30248a7dcd21abe44c8..60c25780299f110cb10c096f4cd8a18dfe917a3e 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index.php @@ -45,7 +45,7 @@ class Index extends \Magento\Backend\App\Action protected $_backupFactory; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -58,14 +58,14 @@ class Index extends \Magento\Backend\App\Action * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Registry $coreRegistry * @param \Magento\Backup\Factory $backupFactory - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Backup\Model\BackupFactory $backupModelFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Registry $coreRegistry, \Magento\Backup\Factory $backupFactory, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Backup\Model\BackupFactory $backupModelFactory ) { $this->_coreRegistry = $coreRegistry; @@ -175,7 +175,7 @@ class Index extends \Magento\Backend\App\Action if ($type != \Magento\Backup\Factory::TYPE_DB) { $backupManager->setRootDir( - $this->_objectManager->get('Magento\App\Filesystem')->getPath() + $this->_objectManager->get('Magento\Framework\App\Filesystem')->getPath() )->addIgnorePaths( $helper->getBackupIgnorePaths() ); @@ -232,7 +232,7 @@ class Index extends \Magento\Backend\App\Action $response = $this->_fileFactory->create( $fileName, null, - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/octet-stream', $backup->getSize() ); @@ -332,7 +332,7 @@ class Index extends \Magento\Backend\App\Action if ($type != \Magento\Backup\Factory::TYPE_DB) { $backupManager->setRootDir( - $this->_objectManager->get('Magento\App\Filesystem')->getPath() + $this->_objectManager->get('Magento\Framework\App\Filesystem')->getPath() )->addIgnorePaths( $helper->getRollbackIgnorePaths() ); diff --git a/app/code/Magento/Backup/Helper/Data.php b/app/code/Magento/Backup/Helper/Data.php index e510ae7ae5b3d53463bc41437462b60f278615f3..b59239a9c43d0ef76600da5ab606638f2ee8206b 100644 --- a/app/code/Magento/Backup/Helper/Data.php +++ b/app/code/Magento/Backup/Helper/Data.php @@ -26,10 +26,10 @@ namespace Magento\Backup\Helper; /** * Backup data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -39,7 +39,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_authorization; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -53,17 +53,17 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Construct * - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\AuthorizationInterface $authorization - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Filesystem $filesystem, \Magento\AuthorizationInterface $authorization, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Index\Model\Resource\Process\CollectionFactory $processFactory ) { parent::__construct($context); @@ -120,7 +120,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getBackupsDir() { - return $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/backups'; + return $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/backups'; } /** @@ -192,12 +192,12 @@ class Data extends \Magento\App\Helper\AbstractHelper '.git', '.svn', 'maintenance.flag', - $this->_filesystem->getPath(\Magento\App\Filesystem::SESSION_DIR), - $this->_filesystem->getPath(\Magento\App\Filesystem::CACHE_DIR), - $this->_filesystem->getPath(\Magento\App\Filesystem::LOG_DIR), - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/full_page_cache', - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/locks', - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/report' + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::SESSION_DIR), + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::CACHE_DIR), + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::LOG_DIR), + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/full_page_cache', + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/locks', + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/report' ); } @@ -212,12 +212,12 @@ class Data extends \Magento\App\Helper\AbstractHelper '.svn', '.git', 'maintenance.flag', - $this->_filesystem->getPath(\Magento\App\Filesystem::SESSION_DIR), - $this->_filesystem->getPath(\Magento\App\Filesystem::LOG_DIR), - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/locks', - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/report', - $this->_filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR) . '/errors', - $this->_filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR) . '/index.php' + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::SESSION_DIR), + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::LOG_DIR), + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/locks', + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/report', + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR) . '/errors', + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR) . '/index.php' ); } @@ -230,7 +230,7 @@ class Data extends \Magento\App\Helper\AbstractHelper { $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); $result = $this->_filesystem->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->writeFile( $maintenanceFlagFile, 'maintenance' @@ -247,7 +247,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function turnOffMaintenanceMode() { $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR)->delete($maintenanceFlagFile); + $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR)->delete($maintenanceFlagFile); } /** diff --git a/app/code/Magento/Backup/Model/Backup.php b/app/code/Magento/Backup/Model/Backup.php index 73fe25448847a04c7dd4421a6939c57ba9d04dca..da082d25d32d683ec7713fb881fda8614aa2cc72 100644 --- a/app/code/Magento/Backup/Model/Backup.php +++ b/app/code/Magento/Backup/Model/Backup.php @@ -53,7 +53,7 @@ class Backup extends \Magento\Object implements \Magento\Backup\Db\BackupInterfa protected $_stream = null; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -91,7 +91,7 @@ class Backup extends \Magento\Object implements \Magento\Backup\Db\BackupInterfa * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\Encryption\EncryptorInterface $encryptor - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $data */ public function __construct( @@ -99,14 +99,14 @@ class Backup extends \Magento\Object implements \Magento\Backup\Db\BackupInterfa \Magento\Locale\ResolverInterface $localeResolver, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Encryption\EncryptorInterface $encryptor, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $data = array() ) { $this->_encryptor = $encryptor; parent::__construct($data); $this->_filesystem = $filesystem; - $this->varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->_helper = $helper; $this->_localeResolver = $localeResolver; $this->_backendAuthSession = $authSession; @@ -309,11 +309,11 @@ class Backup extends \Magento\Object implements \Magento\Backup\Db\BackupInterfa try { /** @var \Magento\Filesystem\Directory\WriteInterface $varDirectory */ - $varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->_stream = $varDirectory->openFile( $this->_getFilePath(), $mode, - \Magento\App\Filesystem::WRAPPER_CONTENT_ZLIB + \Magento\Framework\App\Filesystem::WRAPPER_CONTENT_ZLIB ); } catch (\Magento\Filesystem\FilesystemException $e) { throw new \Magento\Backup\Exception\NotEnoughPermissions( @@ -404,7 +404,7 @@ class Backup extends \Magento\Object implements \Magento\Backup\Db\BackupInterfa } /** @var \Magento\Filesystem\Directory\ReadInterface $directory */ - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $directory = $directory->readFile($this->_getFilePath()); echo $directory; diff --git a/app/code/Magento/Backup/Model/Config/Backend/Cron.php b/app/code/Magento/Backup/Model/Config/Backend/Cron.php index 82717345b53f4c0ac74279098cb63d33daf2be1c..04bacac01969df320b35a86efaed8ce20564cfe1 100644 --- a/app/code/Magento/Backup/Model/Config/Backend/Cron.php +++ b/app/code/Magento/Backup/Model/Config/Backend/Cron.php @@ -26,7 +26,7 @@ namespace Magento\Backup\Model\Config\Backend; /** * Backup by cron backend model */ -class Cron extends \Magento\App\Config\Value +class Cron extends \Magento\Framework\App\Config\Value { const CRON_STRING_PATH = 'crontab/default/jobs/system_backup/schedule/cron_expr'; @@ -41,7 +41,7 @@ class Cron extends \Magento\App\Config\Value /** * Config value factory * - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; @@ -53,8 +53,8 @@ class Cron extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath @@ -63,8 +63,8 @@ class Cron extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', diff --git a/app/code/Magento/Backup/Model/Db.php b/app/code/Magento/Backup/Model/Db.php index a997d41c1d374775eeb215260c2dfc8a87d53463..9705bbc11593fb2834cf1aff486494a90da09ee4 100644 --- a/app/code/Magento/Backup/Model/Db.php +++ b/app/code/Magento/Backup/Model/Db.php @@ -48,15 +48,15 @@ class Db implements \Magento\Backup\Db\BackupDbInterface /** * Core resource model * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource = null; /** * @param \Magento\Backup\Model\Resource\Db $resourceDb - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\Backup\Model\Resource\Db $resourceDb, \Magento\App\Resource $resource) + public function __construct(\Magento\Backup\Model\Resource\Db $resourceDb, \Magento\Framework\App\Resource $resource) { $this->_resourceDb = $resourceDb; $this->_resource = $resource; diff --git a/app/code/Magento/Backup/Model/Fs/Collection.php b/app/code/Magento/Backup/Model/Fs/Collection.php index b0aa26da70b3eedbd628bfaf45a6a142e929ed2f..7dd8d3ece034a43f00b092861dc7529feabd2792 100644 --- a/app/code/Magento/Backup/Model/Fs/Collection.php +++ b/app/code/Magento/Backup/Model/Fs/Collection.php @@ -57,13 +57,13 @@ class Collection extends \Magento\Data\Collection\Filesystem /** * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Backup\Helper\Data $backupData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Backup\Model\Backup $backup */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Backup\Helper\Data $backupData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Backup\Model\Backup $backup ) { $this->_backupData = $backupData; @@ -71,7 +71,7 @@ class Collection extends \Magento\Data\Collection\Filesystem $this->_filesystem = $filesystem; $this->_backup = $backup; - $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->_hideBackupsForApache(); diff --git a/app/code/Magento/Backup/Model/Observer.php b/app/code/Magento/Backup/Model/Observer.php index 159b241f2521b5490d6798590da2ce6b446a450e..342c95c9c0c06a36810df356b25a155e683cd0f4 100644 --- a/app/code/Magento/Backup/Model/Observer.php +++ b/app/code/Magento/Backup/Model/Observer.php @@ -70,14 +70,14 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -90,16 +90,16 @@ class Observer * @param \Magento\Backup\Helper\Data $backupData * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Backup\Factory $backupFactory */ public function __construct( \Magento\Backup\Helper\Data $backupData, \Magento\Registry $coreRegistry, \Magento\Logger $logger, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Backup\Factory $backupFactory ) { $this->_backupData = $backupData; @@ -143,7 +143,7 @@ class Observer if ($type != \Magento\Backup\Factory::TYPE_DB) { $backupManager->setRootDir( - $this->_filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR) + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR) )->addIgnorePaths( $this->_backupData->getBackupIgnorePaths() ); diff --git a/app/code/Magento/Backup/Model/Resource/Db.php b/app/code/Magento/Backup/Model/Resource/Db.php index d78bce2796cc2436888e1974c38814a9f41271ee..bd1d86a3e24969fea0f0da6421e26fd6c2d291c5 100644 --- a/app/code/Magento/Backup/Model/Resource/Db.php +++ b/app/code/Magento/Backup/Model/Resource/Db.php @@ -54,11 +54,11 @@ class Db * Initialize Backup DB resource model * * @param \Magento\Backup\Model\Resource\HelperFactory $resHelperFactory - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Backup\Model\Resource\HelperFactory $resHelperFactory, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_resourceHelper = $resHelperFactory->create(); $this->_write = $resource->getConnection('backup_write'); diff --git a/app/code/Magento/Backup/Model/Resource/Helper.php b/app/code/Magento/Backup/Model/Resource/Helper.php index 515962267f00d2be02735ce5c7086845a8b560b4..8ed07055b668a5f84703f638ef74e08fc39c0400 100644 --- a/app/code/Magento/Backup/Model/Resource/Helper.php +++ b/app/code/Magento/Backup/Model/Resource/Helper.php @@ -43,12 +43,12 @@ class Helper extends \Magento\DB\Helper protected $_coreDate; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix * @param \Magento\Stdlib\DateTime\DateTime $coreDate */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, $modulePrefix, \Magento\Stdlib\DateTime\DateTime $coreDate ) { diff --git a/app/code/Magento/Backup/etc/adminhtml/routes.xml b/app/code/Magento/Backup/etc/adminhtml/routes.xml index 97f979ca21ff8aad6b01bda223f5c419f8bfd00e..6d2680abc8be76f95d2314031eb9a9059d4105fc 100644 --- a/app/code/Magento/Backup/etc/adminhtml/routes.xml +++ b/app/code/Magento/Backup/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="backup" frontName="backup"> <module name="Magento_Backup_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml index dc5f70c0b2433263e980544adfdeef4918690c86..fa30ef1c8cd79a4fefbd5550b7de8dad9a0798ec 100644 --- a/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml +++ b/app/code/Magento/Backup/view/adminhtml/layout/backup_index_block.xml @@ -55,7 +55,8 @@ <argument name="header" xsi:type="string" translate="true">Time</argument> <argument name="index" xsi:type="string">date_object</argument> <argument name="type" xsi:type="string">datetime</argument> - <argument name="width" xsi:type="string">200px</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="display_name"> @@ -64,7 +65,8 @@ <argument name="index" xsi:type="string">display_name</argument> <argument name="filter" xsi:type="string">0</argument> <argument name="sortable" xsi:type="string">1</argument> - <argument name="width" xsi:type="string">350px</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="size"> @@ -82,7 +84,6 @@ <argument name="index" xsi:type="string">type</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Backup\Model\Grid\Options"/> - <argument name="width" xsi:type="string">300px</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="download"> @@ -99,7 +100,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Action</argument> <argument name="index" xsi:type="string">type</argument> - <argument name="width" xsi:type="string">80px</argument> <argument name="filter" xsi:type="string">0</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="type" xsi:type="string">action</argument> diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php index a13bbea62a29979a611c3d178e3281d5cbcad6fd..f04cf8e0aa8113e25be27060b1a707238a2d59a5 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php @@ -24,15 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab; + /** * Bundle product attributes tab - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab; - class Attributes extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes { /** @@ -44,15 +40,25 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attri { parent::_prepareForm(); - $special_price = $this->getForm()->getElement('special_price'); - if ($special_price) { - $special_price->setRenderer( + $specialPrice = $this->getForm()->getElement('special_price'); + if ($specialPrice) { + $specialPrice->setRenderer( $this->getLayout()->createBlock( 'Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Special' )->setDisableChild( false ) ); + $specialPrice->addClass( + implode( + ' ', + [ + 'validate-greater-than-zero', + 'validate-number-range', + 'number-range-0.00-100.00' + ] + ) + ); } $sku = $this->getForm()->getElement('sku'); diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php index a9f49b4bba7f7b57fdeeb0963ff58bde706688fd..cc2a65a87e5bb00fee272e855c12d20ee78eff13 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php @@ -39,19 +39,12 @@ class Special extends \Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset\El */ public function getElementHtml() { - $html = '<input id="' . - $this->getElement()->getHtmlId() . - '" name="' . - $this->getElement()->getName() . - '" value="' . - $this->getElement()->getEscapedValue() . - '" ' . - $this->getElement()->serialize($this->getElement()->getHtmlAttributes()) . - '/>' . - "\n" . - '<label class="addafter" for="' . - $this->getElement()->getHtmlId() . - '"><strong>[%]</strong></label>'; + $html = '<input id="' . $this->getElement()->getHtmlId() + . '" name="' . $this->getElement()->getName() + . '" value="' . $this->getElement()->getEscapedValue() . '" ' + . $this->getElement()->serialize($this->getElement()->getHtmlAttributes()) . '/>' + . "\n" . '<label class="addafter" for="' . $this->getElement()->getHtmlId() + . '"><strong>[%]</strong></label>'; return $html; } } diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index ddecf225600212e99fdbe8e85b9bbb4ec3dabe11..4f9555284e0ea280ae09c6435882d65b0c515d70 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Bundle * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -27,13 +25,6 @@ namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle; use Magento\Data\Form\Element\AbstractElement; -/** - * Bundle option renderer - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> - */ class Option extends \Magento\Backend\Block\Widget { /** @@ -43,22 +34,6 @@ class Option extends \Magento\Backend\Block\Widget */ protected $_element = null; - /** - * List of customer groups - * - * @var array|null - * @deprecated since 1.7.0.0 - */ - protected $_customerGroups = null; - - /** - * List of websites - * - * @var array|null - * @deprecated since 1.7.0.0 - */ - protected $_websites = null; - /** * List of bundle product options * diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View.php b/app/code/Magento/Bundle/Block/Catalog/Product/View.php index 328e1bf8c1957380d0c271d73a17703d35623ae0..917f0382cf58bf8acf57324558d3bc26cf0cb506 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View.php @@ -23,14 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Bundle\Block\Catalog\Product; /** * Product View block (to modify getTierPrices method) - * - * @category Magento - * @package Magento_Bundle - * @module Catalog */ class View extends \Magento\Catalog\Block\Product\View { @@ -39,6 +36,7 @@ class View extends \Magento\Catalog\Block\Product\View * * @param \Magento\Catalog\Model\Product|null $product * @return array + * @deprecated */ public function getTierPrices($product = null) { @@ -51,7 +49,6 @@ class View extends \Magento\Catalog\Block\Product\View $prices = $product->getFormatedTierPrice(); if (is_array($prices)) { $store = $this->_storeManager->getStore(); - $helper = $this->_taxData; $specialPrice = $product->getSpecialPrice(); $defaultDiscount = max($product->getGroupPrice(), $specialPrice ? 100 - $specialPrice : 0); foreach ($prices as $price) { @@ -59,10 +56,10 @@ class View extends \Magento\Catalog\Block\Product\View $price['price_qty'] += 0; $price['savePercent'] = ceil(100 - $price['price']); - $priceExclTax = $helper->getPrice($product, $price['website_price']); + $priceExclTax = $this->_taxData->getPrice($product, $price['website_price']); $price['formated_price'] = $store->formatPrice($store->convertPrice($priceExclTax)); - $priceInclTax = $helper->getPrice($product, $price['website_price'], true); + $priceInclTax = $this->_taxData->getPrice($product, $price['website_price'], true); $price['formated_price_incl_tax'] = $store->formatPrice($store->convertPrice($priceInclTax)); $res[] = $price; diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 38700b9497ba2f09f5260faed4e86934d2a22f10..e074979d4627db17ef08a6b22277332e3483938b 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -154,6 +154,7 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView */ public function getJsonConfig() { + /** @var \Magento\Bundle\Model\Option[] $optionsArray */ $optionsArray = $this->getOptions(); $options = array(); $selected = array(); @@ -166,6 +167,7 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $defaultValues = array(); } + $position = 0; foreach ($optionsArray as $_option) { /* @var $_option \Magento\Bundle\Model\Option */ @@ -189,37 +191,58 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $_qty = !($_selection->getSelectionQty() * 1) ? '1' : $_selection->getSelectionQty() * 1; // recalculate currency $tierPrices = $_selection->getTierPrice(); + foreach ($tierPrices as &$tierPriceInfo) { + $tierPriceAmount = $_selection->getPriceInfo()->getPrice('regular_price') + ->getCustomAmount($tierPriceInfo['price']); $tierPriceInfo['price'] = $this->coreData->currency($tierPriceInfo['price'], false, false); + $tierPriceInfo['inclTaxPrice'] = $this->coreData->currency( + $tierPriceAmount->getValue(), + false, + false + ); + $tierPriceInfo['exclTaxPrice'] = $this->coreData->currency( + $tierPriceAmount->getBaseAmount(), + false, + false + ); } - unset($tierPriceInfo); + // unset($tierPriceInfo); // break the reference with the last element - $itemPrice = $bundlePriceModel->getSelectionFinalTotalPrice( - $currentProduct, - $_selection, - $currentProduct->getQty(), - $_selection->getQty(), - false, - false - ); - $canApplyMAP = false; - $_priceInclTax = $this->_taxData->getPrice($_selection, $itemPrice, true); - $_priceExclTax = $this->_taxData->getPrice($_selection, $itemPrice); - - if ($currentProduct->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { - $_priceInclTax = $this->_taxData->getPrice($currentProduct, $itemPrice, true); - $_priceExclTax = $this->_taxData->getPrice($currentProduct, $itemPrice); - } + $bundleOptionPriceAmount = $currentProduct->getPriceInfo()->getPrice('bundle_option') + ->getOptionSelectionAmount($_selection); + $_priceInclTax = $bundleOptionPriceAmount->getValue(); + $_priceExclTax = $bundleOptionPriceAmount->getBaseAmount(); + + //if ($currentProduct->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { + // $_priceInclTax = $this->_taxData->getPrice($currentProduct, $itemPrice, true); + // $_priceExclTax = $this->_taxData->getPrice($currentProduct, $itemPrice); + //} + //$itemPrice = $bundlePriceModel->getSelectionFinalTotalPrice( + // $currentProduct, + // $_selection, + // $currentProduct->getQty(), + // $_selection->getQty(), + // false, + // false + //); $selection = array( 'qty' => $_qty, 'customQty' => $_selection->getSelectionCanChangeQty(), - 'price' => $this->coreData->currency($_selection->getFinalPrice(), false, false), - 'priceInclTax' => $this->coreData->currency($_priceInclTax, false, false), - 'priceExclTax' => $this->coreData->currency($_priceExclTax, false, false), + 'inclTaxPrice' => $this->coreData->currency( + $_priceInclTax, + false, + false + ), + 'exclTaxPrice' => $this->coreData->currency( + $_priceExclTax, + false, + false + ), 'priceValue' => $this->coreData->currency($_selection->getSelectionPriceValue(), false, false), 'priceType' => $_selection->getSelectionPriceType(), 'tierPrice' => $tierPrices, @@ -229,6 +252,10 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView 'canApplyMAP' => $canApplyMAP ); + $selection['price'] = $this->_taxData->displayPriceIncludingTax() + ? $selection['inclTaxPrice'] + : $selection['exclTaxPrice']; + $responseObject = new \Magento\Object(); $args = array('response_object' => $responseObject, 'selection' => $_selection); $this->_eventManager->dispatch('bundle_product_view_config', $args); @@ -240,7 +267,7 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $option['selections'][$selectionId] = $selection; if (($_selection->getIsDefault() || - $selectionCount == 1 && $_option->getRequired()) && $_selection->isSalable() + $selectionCount == 1 && $_option->getRequired()) && $_selection->isSalable() ) { $selected[$optionId][] = $selectionId; } @@ -263,6 +290,13 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView 'bundleId' => $currentProduct->getId(), 'priceFormat' => $this->_localeFormat->getPriceFormat(), 'basePrice' => $this->coreData->currency($currentProduct->getPrice(), false, false), + 'showIncludeTax' => $this->_taxData->displayPriceIncludingTax(), + 'finalBasePriceInclTax' => $this->coreData->currency( + $this->_taxData->getPrice($currentProduct, $currentProduct->getFinalPrice(), true), + false, + false + ), + 'finalBasePriceExclTax' => $this->coreData->currency($currentProduct->getFinalPrice(), false, false), 'priceType' => $currentProduct->getPriceType(), 'specialPrice' => $currentProduct->getSpecialPrice(), 'includeTax' => $this->_taxData->priceIncludesTax() ? 'true' : 'false', @@ -270,6 +304,10 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView 'isMAPAppliedDirectly' => $this->_catalogData->canApplyMsrp($this->getProduct(), null, false) ); + $config['finalPrice'] = $this->_taxData->displayPriceIncludingTax() + ? $config['finalBasePriceInclTax'] + : $config['finalBasePriceExclTax']; + if ($preConfiguredFlag && !empty($defaultValues)) { $config['defaultValues'] = $defaultValues; } diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 3c5a65eed2c8ef6fde7cd6d0a55c78384419fb8d..4685fe46c75de0b05f84ad34bf621f193ee22457 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -226,7 +226,7 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price } /** - * @param mixed $_selection + * @param \Magento\Catalog\Model\Product $_selection * @param bool $includeContainer * @return string */ @@ -237,7 +237,7 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price $priceTitle = $_selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($_selection->getName()); $priceTitle .= ' ' . ($includeContainer ? '<span class="price-notice">' : '') . '+' . - $this->formatPriceString($price, $includeContainer) . ($includeContainer ? '</span>' : ''); + $this->renderPriceString($_selection, $includeContainer) . ($includeContainer ? '</span>' : ''); return $priceTitle; } @@ -274,11 +274,9 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price */ public function getSelectionTitlePrice($_selection, $includeContainer = true) { - $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection, 1); - $this->setFormatProduct($_selection); $priceTitle = $this->escapeHtml($_selection->getName()); $priceTitle .= ' ' . ($includeContainer ? '<span class="price-notice">' : '') . '+' . - $this->formatPriceString($price, $includeContainer) . ($includeContainer ? '</span>' : ''); + $this->renderPriceString($_selection, $includeContainer) . ($includeContainer ? '</span>' : ''); return $priceTitle; } @@ -300,6 +298,7 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price * @param float $price * @param bool $includeContainer * @return string + * @deprecated */ public function formatPriceString($price, $includeContainer = true) { @@ -343,4 +342,29 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price $this->_selectedOptions = null; return parent::setOption($option); } + + /** + * Format price string + * + * @param \Magento\Catalog\Model\Product $selection + * @param bool $includeContainer + * @return string + */ + public function renderPriceString($selection, $includeContainer = true) + { + /** @var \Magento\Bundle\Pricing\Price\BundleOptionPrice $price */ + $price = $this->getProduct()->getPriceInfo()->getPrice('bundle_option'); + $amount = $price->getOptionSelectionAmount($selection); + + $priceHtml = $this->getLayout()->getBlock('product.price.render.default')->renderAmount( + $amount, + $price, + $selection, + [ + 'include_container' => $includeContainer + ] + ); + + return $priceHtml; + } } diff --git a/app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php b/app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php index 419e8cf0eedce01683ec48b1d6d033e05f359725..7d7f050d9c1b5e8d35f13fac0234a5f495099815 100644 --- a/app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php +++ b/app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php @@ -26,14 +26,14 @@ namespace Magento\Bundle\Controller\Adminhtml\Product\Initialization\Helper\Plug class Bundle { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ - public function __construct(\Magento\App\RequestInterface $request) + public function __construct(\Magento\Framework\App\RequestInterface $request) { $this->request = $request; } diff --git a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php index 36ad88d01893e7ca06366c719ee66247b8ab5589..229cb2a5de9fc11d5467adce8d81d8a3f51498c3 100644 --- a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php @@ -34,7 +34,7 @@ use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; * @package Magento_Bundle * @author Magento Core Team <core@magentocommerce.com> */ -class Configuration extends \Magento\App\Helper\AbstractHelper implements +class Configuration extends \Magento\Framework\App\Helper\AbstractHelper implements \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface { /** @@ -57,13 +57,13 @@ class Configuration extends \Magento\App\Helper\AbstractHelper implements protected $_escaper; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Escaper $escaper */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur, \Magento\Core\Helper\Data $coreData, \Magento\Escaper $escaper diff --git a/app/code/Magento/Bundle/Helper/Data.php b/app/code/Magento/Bundle/Helper/Data.php index 616451746448f77137641e08ef5e594548502be7..e0d8d79537b56621fbf96244d6966232e87a21fc 100644 --- a/app/code/Magento/Bundle/Helper/Data.php +++ b/app/code/Magento/Bundle/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\Bundle\Helper; * @package Magento_Bundle * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Catalog\Model\ProductTypes\ConfigInterface @@ -40,11 +40,11 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_config; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config ) { $this->_config = $config; diff --git a/app/code/Magento/Bundle/Model/Option.php b/app/code/Magento/Bundle/Model/Option.php index 5464b305366454c43f0fa95949c3803962d0247d..7cb3bcd07f3e9011d77f816deb6ff31443305055 100644 --- a/app/code/Magento/Bundle/Model/Option.php +++ b/app/code/Magento/Bundle/Model/Option.php @@ -28,8 +28,6 @@ namespace Magento\Bundle\Model; /** * Bundle Option Model * - * @method \Magento\Bundle\Model\Resource\Option _getResource() - * @method \Magento\Bundle\Model\Resource\Option getResource() * @method int getParentId() * @method \Magento\Bundle\Model\Option setParentId(int $value) * @method int getRequired() @@ -38,10 +36,7 @@ namespace Magento\Bundle\Model; * @method \Magento\Bundle\Model\Option setPosition(int $value) * @method string getType() * @method \Magento\Bundle\Model\Option setType(string $value) - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> + * @method \Magento\Catalog\Model\Product[] getSelections() */ class Option extends \Magento\Model\AbstractModel { @@ -94,7 +89,7 @@ class Option extends \Magento\Model\AbstractModel $saleable++; } } - return (bool)$saleable; + return (bool) $saleable; } else { return false; } @@ -152,12 +147,11 @@ class Option extends \Magento\Model\AbstractModel */ public function getSelectionById($selectionId) { - $selections = $this->getSelections(); - $i = count($selections); - - while ($i-- && $selections[$i]->getSelectionId() != $selectionId) { + foreach ($this->getSelections() as $option) { + if ($option->getSelectionId() == $selectionId) { + return $option; + } } - - return $i == -1 ? false : $selections[$i]; + return false; } } diff --git a/app/code/Magento/Bundle/Model/Price/Index.php b/app/code/Magento/Bundle/Model/Price/Index.php deleted file mode 100644 index 011bb203d9153e2ce53dd5f50128511e04a82d9b..0000000000000000000000000000000000000000 --- a/app/code/Magento/Bundle/Model/Price/Index.php +++ /dev/null @@ -1,197 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Bundle - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Bundle\Model\Price; - -/** - * Bundle Product Price Index - * - * @method \Magento\Bundle\Model\Resource\Price\Index getResource() - * @method \Magento\Bundle\Model\Price\Index setEntityId(int $value) - * @method int getWebsiteId() - * @method \Magento\Bundle\Model\Price\Index setWebsiteId(int $value) - * @method int getCustomerGroupId() - * @method \Magento\Bundle\Model\Price\Index setCustomerGroupId(int $value) - * @method float getMinPrice() - * @method \Magento\Bundle\Model\Price\Index setMinPrice(float $value) - * @method float getMaxPrice() - * @method \Magento\Bundle\Model\Price\Index setMaxPrice(float $value) - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> - */ -class Index extends \Magento\Model\AbstractModel -{ - /** - * @var \Magento\Customer\Model\Session - */ - protected $_customerSession; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Model\Context $context - * @param \Magento\Registry $registry - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Model\Resource\AbstractResource $resource - * @param \Magento\Data\Collection\Db $resourceCollection - * @param array $data - */ - public function __construct( - \Magento\Model\Context $context, - \Magento\Registry $registry, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Customer\Model\Session $customerSession, - \Magento\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null, - array $data = array() - ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - $this->_customerSession = $customerSession; - $this->_storeManager = $storeManager; - } - - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init('Magento\Bundle\Model\Resource\Price\Index'); - } - - /** - * Retrieve resource instance wrapper - * - * @return \Magento\Bundle\Model\Resource\Price\Index - */ - protected function _getResource() - { - return parent::_getResource(); - } - - /** - * Reindex Product price - * - * @param int $productId - * @param int $priceType - * @return $this - */ - protected function _reindexProduct($productId, $priceType) - { - $this->_getResource()->reindexProduct($productId, $priceType); - return $this; - } - - /** - * Reindex Bundle product Price Index - * - * @param \Magento\Catalog\Model\Product|\Magento\Catalog\Model\Product\Condition\ConditionInterface|array|int $products - * @return $this - */ - public function reindex($products = null) - { - $this->_getResource()->reindex($products); - return $this; - } - - /** - * Add bundle price range index to Product collection - * - * @param \Magento\Catalog\Model\Resource\Product\Collection $collection - * @return $this - */ - public function addPriceIndexToCollection($collection) - { - $productObjects = array(); - $productIds = array(); - foreach ($collection->getItems() as $product) { - /* @var $product \Magento\Catalog\Model\Product */ - if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { - $productIds[] = $product->getEntityId(); - $productObjects[$product->getEntityId()] = $product; - } - } - $websiteId = $this->_storeManager->getStore($collection->getStoreId())->getWebsiteId(); - $groupId = $this->_customerSession->getCustomerGroupId(); - - $addOptionsToResult = false; - $prices = $this->_getResource()->loadPriceIndex($productIds, $websiteId, $groupId); - foreach ($productIds as $productId) { - if (isset($prices[$productId])) { - $productObjects[$productId]->setData( - '_price_index', - true - )->setData( - '_price_index_min_price', - $prices[$productId]['min_price'] - )->setData( - '_price_index_max_price', - $prices[$productId]['max_price'] - ); - } else { - $addOptionsToResult = true; - } - } - - if ($addOptionsToResult) { - $collection->addOptionsToResult(); - } - - return $this; - } - - /** - * Add price index to bundle product after load - * - * @param \Magento\Catalog\Model\Product $product - * @return $this - */ - public function addPriceIndexToProduct($product) - { - $websiteId = $product->getStore()->getWebsiteId(); - $groupId = $this->_customerSession->getCustomerGroupId(); - $prices = $this->_getResource()->loadPriceIndex($product->getId(), $websiteId, $groupId); - if (isset($prices[$product->getId()])) { - $product->setData( - '_price_index', - true - )->setData( - '_price_index_min_price', - $prices[$product->getId()]['min_price'] - )->setData( - '_price_index_max_price', - $prices[$product->getId()]['max_price'] - ); - } - return $this; - } -} diff --git a/app/code/Magento/Bundle/Model/Product/Price.php b/app/code/Magento/Bundle/Model/Product/Price.php index b47fbd330c6e75307f0bc98c2ecbde8e4c3a656d..0937325af64ade6981728a06b0c37a463b6d3b72 100644 --- a/app/code/Magento/Bundle/Model/Product/Price.php +++ b/app/code/Magento/Bundle/Model/Product/Price.php @@ -18,24 +18,27 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Bundle * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Bundle\Model\Product; +use Magento\Customer\Service\V1\CustomerGroupServiceInterface; + /** * Bundle Price Model - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> */ class Price extends \Magento\Catalog\Model\Product\Type\Price { + /** + * Fixed bundle price type + */ const PRICE_TYPE_FIXED = 1; + /** + * Dynamic bundle price type + */ const PRICE_TYPE_DYNAMIC = 0; /** @@ -92,6 +95,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * * @param \Magento\Catalog\Model\Product $product * @return float + * @deprecated */ public function getPrice($product) { @@ -303,7 +307,6 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price } $multiTypes = array( - //Magento_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN, \Magento\Catalog\Model\Product\Option::OPTION_TYPE_CHECKBOX, \Magento\Catalog\Model\Product\Option::OPTION_TYPE_MULTIPLE ); @@ -429,6 +432,9 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price $multiplyQty = true, $takeTierPrice = true ) { + if (null === $bundleQty) { + $bundleQty = 1.; + } if (is_null($selectionQty)) { $selectionQty = $selectionProduct->getSelectionQty(); } @@ -552,7 +558,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price */ public function getTierPrice($qty, $product) { - $allGroups = \Magento\Customer\Model\Group::CUST_GROUP_ALL; + $allGroups = CustomerGroupServiceInterface::CUST_GROUP_ALL; $prices = $product->getData('tier_price'); if (is_null($prices)) { diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index 80e62a4061f490dd9e740f56278d6f010be24a00..542ecd329588b3ce972f957452d129fb3bb5e048 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -149,7 +149,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\Catalog\Helper\Product $catalogProduct @@ -173,7 +173,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Catalog\Helper\Product $catalogProduct, diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 63ee5c199784bb00b2a68b109082f7d1045e49ec..99fc4f5114979f200066965daa97faeec114f6a2 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -40,11 +40,11 @@ class Bundle extends \Magento\Model\Resource\Db\AbstractDb protected $_productRelation; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Model\Resource\Product\Relation $productRelation ) { parent::__construct($resource); diff --git a/app/code/Magento/Bundle/Model/Resource/Option/Collection.php b/app/code/Magento/Bundle/Model/Resource/Option/Collection.php index 899f4041136ddbb15f7b16a16d2e43af944c80f3..c368ca351dadc7b378a1075192b29d6c8e3c7761 100644 --- a/app/code/Magento/Bundle/Model/Resource/Option/Collection.php +++ b/app/code/Magento/Bundle/Model/Resource/Option/Collection.php @@ -27,10 +27,6 @@ namespace Magento\Bundle\Model\Resource\Option; /** * Bundle Options Resource Collection - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> */ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollection { @@ -42,7 +38,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio protected $_itemIds; /** - * True when selections a + * True when selections appended * * @var bool */ @@ -134,11 +130,12 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio } if (!$this->_selectionsAppended) { - foreach ($selectionsCollection->getItems() as $key => $_selection) { - if ($_option = $this->getItemById($_selection->getOptionId())) { - if ($appendAll || $_selection->isSalable() && !$_selection->getRequiredOptions()) { - $_selection->setOption($_option); - $_option->addSelection($_selection); + foreach ($selectionsCollection->getItems() as $key => $selection) { + $option = $this->getItemById($selection->getOptionId()); + if ($option) { + if ($appendAll || $selection->isSalable() && !$selection->getRequiredOptions()) { + $selection->setOption($option); + $option->addSelection($selection); } else { $selectionsCollection->removeItemByKey($key); } diff --git a/app/code/Magento/Bundle/Model/Resource/Price/Index.php b/app/code/Magento/Bundle/Model/Resource/Price/Index.php deleted file mode 100644 index 11129d59d2e275f5b1e06d2cad4b48645fa7106a..0000000000000000000000000000000000000000 --- a/app/code/Magento/Bundle/Model/Resource/Price/Index.php +++ /dev/null @@ -1,897 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Bundle - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Bundle\Model\Resource\Price; - -use Magento\Store\Model\Website; - -/** - * Bundle Product Price Index Resource model - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> - */ -class Index extends \Magento\Model\Resource\Db\AbstractDb -{ - /** - * EAV attributes cache - * - * @var array - */ - protected $_attributes = array(); - - /** - * Websites cache - * - * @var Website[] - */ - protected $_websites; - - /** - * Customer Groups cache - * - * @var array - */ - protected $_customerGroups; - - /** - * Core event manager proxy - * - * @var \Magento\Event\ManagerInterface - */ - protected $_eventManager = null; - - /** - * @var \Magento\Catalog\Model\Config - */ - protected $_config; - - /** - * @var \Magento\Customer\Model\GroupFactory - */ - protected $_customerGroup; - - /** - * @var \Magento\CatalogRule\Model\Resource\RuleFactory - */ - protected $_catalogRuleFactory; - - /** - * @var \Magento\Stdlib\DateTime\TimezoneInterface - */ - protected $_localeDate; - - /** - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\App\Resource $resource - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\CatalogRule\Model\Resource\RuleFactory $catalogRuleFactory - * @param \Magento\Customer\Model\GroupFactory $customerGroup - * @param \Magento\Catalog\Model\Config $config - * @param \Magento\Event\ManagerInterface $eventManager - */ - public function __construct( - \Magento\App\Resource $resource, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\CatalogRule\Model\Resource\RuleFactory $catalogRuleFactory, - \Magento\Customer\Model\GroupFactory $customerGroup, - \Magento\Catalog\Model\Config $config, - \Magento\Event\ManagerInterface $eventManager - ) { - $this->_eventManager = $eventManager; - parent::__construct($resource); - $this->_config = $config; - $this->_customerGroup = $customerGroup; - $this->_catalogRuleFactory = $catalogRuleFactory; - $this->_localeDate = $localeDate; - $this->_storeManager = $storeManager; - } - - /** - * Initialize connection and define main table - * - * @return void - */ - protected function _construct() - { - $this->_init('catalog_product_bundle_price_index', 'entity_id'); - } - - /** - * Retrieve attribute object - * - * @param string $attributeCode - * @return \Magento\Catalog\Model\Resource\Eav\Attribute - */ - protected function _getAttribute($attributeCode) - { - if (!isset($this->_attributes[$attributeCode])) { - $this->_attributes[$attributeCode] = $this->_config->getAttribute( - \Magento\Catalog\Model\Product::ENTITY, - $attributeCode - ); - } - return $this->_attributes[$attributeCode]; - } - - /** - * Retrieve websites collection array - * - * @return Website[] - */ - protected function _getWebsites() - { - if (is_null($this->_websites)) { - $this->_websites = $this->_storeManager->getWebsites(false); - } - return $this->_websites; - } - - /** - * Retrieve customer groups collection array - * - * @return array - */ - protected function _getCustomerGroups() - { - if (is_null($this->_customerGroups)) { - $this->_customerGroups = array(); - foreach ($this->_customerGroup->create()->getCollection() as $group) { - $this->_customerGroups[$group->getId()] = $group; - } - } - return $this->_customerGroups; - } - - /** - * Retrieve product ids array by product condition - * - * @param \Magento\Catalog\Model\Product|\Magento\Catalog\Model\Product\Condition\ConditionInterface|array|int $product - * @param int $lastEntityId - * @param int $limit - * @return array - */ - public function getProducts($product = null, $lastEntityId = 0, $limit = 100) - { - - $select = $this->_getReadAdapter()->select()->from( - array('e' => $this->getTable('catalog_product_entity')), - array('entity_id') - )->where( - 'e.type_id=?', - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - ); - if ($product instanceof \Magento\Catalog\Model\Product) { - $select->where('e.entity_id=?', $product->getId()); - } elseif ($product instanceof \Magento\Catalog\Model\Product\Condition\ConditionInterface) { - $value = new \Zend_Db_Expr($product->getIdsSelect($this->_getReadAdapter())); - $select->where('e.entity_id IN(?)', $value); - } elseif (is_numeric($product) || is_array($product)) { - $select->where('e.entity_id IN(?)', $product); - } - - $priceType = $this->_getAttribute('price_type'); - $priceTypeAlias = 't_' . $priceType->getAttributeCode(); - $joinConds = array( - $priceTypeAlias . '.attribute_id=:attribute_id', - $priceTypeAlias . '.store_id=0', - $priceTypeAlias . '.entity_id=e.entity_id' - ); - - $select->joinLeft( - array($priceTypeAlias => $priceType->getBackend()->getTable()), - join(' AND ', $joinConds), - array('price_type' => $priceTypeAlias . '.value') - ); - - $select->where('e.entity_id>:last_entity_id', $lastEntityId)->order('e.entity_id')->limit($limit); - $bind = array('attribute_id' => $priceType->getAttributeId(), 'last_entity_id' => $lastEntityId); - return $this->_getReadAdapter()->fetchPairs($select, $bind); - } - - /** - * Reindex Bundle product Price Index - * - * @param \Magento\Catalog\Model\Product|\Magento\Catalog\Model\Product\Condition\ConditionInterface|array|int $products - * @return $this - */ - public function reindex($products = null) - { - $lastEntityId = 0; - while (true) { - $productsData = $this->getProducts($products, $lastEntityId); - if (!$productsData) { - break; - } - - foreach ($productsData as $productId => $priceType) { - $this->_reindexProduct($productId, $priceType); - $lastEntityId = $productId; - } - } - - return $this; - } - - /** - * Reindex product price - * - * @param int $productId - * @param int $priceType - * @return $this - */ - protected function _reindexProduct($productId, $priceType) - { - $options = $this->getSelections($productId); - $selectionProducts = array(); - foreach ($options as $option) { - foreach ($option['selections'] as $selection) { - $selectionProducts[$selection['product_id']] = $selection['product_id']; - } - } - - $priceIndex = array(); - - foreach ($this->_getWebsites() as $website) { - if (!$website->getDefaultStore()) { - continue; - } - $salableStatus = $this->getProductsSalableStatus($selectionProducts, $website); - $priceData = $this->getProductsPriceData($productId, $website); - $priceData = $priceData[$productId]; - - /* @var $website Website */ - foreach ($this->_getCustomerGroups() as $group) { - /* @var $group \Magento\Customer\Model\Group */ - if ($priceType == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { - $basePrice = $this->_getBasePrice($productId, $priceData, $website, $group); - $customOptions = $this->getCustomOptions($productId, $website); - } elseif ($priceType == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC) { - $basePrice = 0; - } - - list($minPrice, $maxPrice) = $this->_calculateBundleSelections( - $options, - $salableStatus, - $productId, - $priceType, - $basePrice, - $priceData, - $priceIndex, - $website, - $group - ); - - if ($priceType == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { - list($minPrice, $maxPrice) = $this->_calculateCustomOptions( - $customOptions, - $basePrice, - $minPrice, - $maxPrice - ); - } - - $this->_savePriceIndex($productId, $website->getId(), $group->getId(), $minPrice, $maxPrice); - } - } - - return $this; - } - - /** - * Save price index - * - * @param int $productId - * @param int $websiteId - * @param int $groupId - * @param float $minPrice - * @param float $maxPrice - * @return $this - */ - protected function _savePriceIndex($productId, $websiteId, $groupId, $minPrice, $maxPrice) - { - $adapter = $this->_getWriteAdapter(); - $adapter->beginTransaction(); - $bind = array($productId, $websiteId, $groupId, $minPrice, $maxPrice); - $adapter->insertOnDuplicate($this->getMainTable(), $bind, array('min_price', 'max_price')); - $adapter->commit(); - - return $this; - } - - /** - * Retrieve bundle options with selections and prices by product - * - * @param int $productId - * @return array - */ - public function getSelections($productId) - { - $options = array(); - $read = $this->_getReadAdapter(); - $select = $read->select()->from( - array('option_table' => $this->getTable('catalog_product_bundle_option')), - array('option_id', 'required', 'type') - )->join( - array('selection_table' => $this->getTable('catalog_product_bundle_selection')), - 'selection_table.option_id=option_table.option_id', - array( - 'selection_id', - 'product_id', - 'selection_price_type', - 'selection_price_value', - 'selection_qty', - 'selection_can_change_qty' - ) - )->join( - array('e' => $this->getTable('catalog_product_entity')), - 'e.entity_id=selection_table.product_id AND e.required_options=0', - array() - )->where( - 'option_table.parent_id=:product_id' - ); - - $query = $read->query($select, array('product_id' => $productId)); - while ($row = $query->fetch()) { - if (!isset($options[$row['option_id']])) { - $options[$row['option_id']] = array( - 'option_id' => $row['option_id'], - 'required' => $row['required'], - 'type' => $row['type'], - 'selections' => array() - ); - } - $options[$row['option_id']]['selections'][$row['selection_id']] = array( - 'selection_id' => $row['selection_id'], - 'product_id' => $row['product_id'], - 'price_type' => $row['selection_price_type'], - 'price_value' => $row['selection_price_value'], - 'qty' => $row['selection_qty'], - 'can_change_qty' => $row['selection_can_change_qty'] - ); - } - - return $options; - } - - /** - * Retrieve salable product statuses - * - * @param int|array $products - * @param Website $website - * @return array - */ - public function getProductsSalableStatus($products, Website $website) - { - $read = $this->_getReadAdapter(); - $productsData = array(); - $select = $read->select()->from( - array('e' => $this->getTable('catalog_product_entity')), - 'entity_id' - )->where( - 'e.entity_id IN(?)', - $products - ); - // add belong to website - $select->joinLeft( - array('pw' => $this->getTable('catalog_product_website')), - 'e.entity_id=pw.product_id AND pw.website_id=:website_id', - array('pw.website_id') - ); - - $store = $website->getDefaultStore(); - - // add product status - $status = $this->_getAttribute('status'); - if ($status->isScopeGlobal()) { - $select->join( - array('t_status' => $status->getBackend()->getTable()), - 'e.entity_id=t_status.entity_id' . - ' AND t_status.attribute_id=:status_attribute_id' . - ' AND t_status.store_id=0', - array('status' => 't_status.value') - ); - } else { - - $statusField = $read->getCheckSql('t2_status.value_id > 0', 't2_status.value', 't1_status.value'); - - $statusTable = $status->getBackend()->getTable(); - $select->join( - array('t1_status' => $statusTable), - 'e.entity_id=t1_status.entity_id' . - ' AND t1_status.attribute_id=:status_attribute_id' . - ' AND t1_status.store_id=0', - array('status' => $statusField) - )->joinLeft( - array('t2_status' => $statusTable), - 't1_status.entity_id = t2_status.entity_id' . - ' AND t1_status.attribute_id = t2_status.attribute_id' . - ' AND t2_status.store_id=:store_id', - array() - ); - } - - $bind = array( - 'status_attribute_id' => $status->getAttributeId(), - 'website_id' => $website->getId(), - 'store_id' => $store->getId() - ); - - $this->_eventManager->dispatch( - 'catalog_product_prepare_index_select', - array('website' => $website, 'select' => $select, 'bind' => $bind) - ); - - $query = $read->query($select, $bind); - while ($row = $query->fetch()) { - $salable = isset($row['salable']) ? $row['salable'] : true; - $website = $row['website_id'] > 0 ? true : false; - $status = $row['status']; - - $productsData[$row['entity_id']] = $salable && $status && $website; - } - - return $productsData; - } - - /** - * Retrieve product(s) price data - * - * @param int|array $products - * @param Website $website - * @return array - */ - public function getProductsPriceData($products, Website $website) - { - $productsData = array(); - $read = $this->_getReadAdapter(); - $select = $read->select()->from( - array('e' => $this->getTable('catalog_product_entity')), - 'entity_id' - )->where( - 'e.entity_id IN(?)', - $products - ); - - $this->_addAttributeDataToSelect($select, 'price', $website); - $this->_addAttributeDataToSelect($select, 'special_price', $website); - $this->_addAttributeDataToSelect($select, 'special_from_date', $website); - $this->_addAttributeDataToSelect($select, 'special_to_date', $website); - - $query = $read->query($select); - while ($row = $query->fetch()) { - $productsData[$row['entity_id']] = array( - 'price' => $row['price'], - 'special_price' => $row['special_price'], - 'special_from_date' => $row['special_from_date'], - 'special_to_date' => $row['special_to_date'] - ); - } - - return $productsData; - } - - /** - * Add attribute data to select - * - * @param \Magento\DB\Select $select - * @param string $attributeCode - * @param Website $website - * @return $this - */ - protected function _addAttributeDataToSelect(\Magento\DB\Select $select, $attributeCode, Website $website) - { - $attribute = $this->_getAttribute($attributeCode); - $store = $website->getDefaultStore(); - if ($attribute->isScopeGlobal()) { - $table = 't_' . $attribute->getAttributeCode(); - $select->joinLeft( - array($table => $attribute->getBackend()->getTable()), - "e.entity_id={$table}.entity_id" . - " AND {$table}.attribute_id={$attribute->getAttributeId()}" . - " AND {$table}.store_id=0", - array($attribute->getAttributeCode() => $table . '.value') - ); - } else { - $tableName = $attribute->getBackend()->getTable(); - $tableGlobal = 't1_' . $attribute->getAttributeCode(); - $tableStore = 't2_' . $attribute->getAttributeCode(); - - $attributeCond = $this->getReadConnection()->getCheckSql( - $tableStore . '.value_id > 0', - $tableStore . '.value', - $tableGlobal . '.value' - ); - $select->joinLeft( - array($tableGlobal => $tableName), - "e.entity_id = {$tableGlobal}.entity_id" . - " AND {$tableGlobal}.attribute_id = {$attribute->getAttributeId()}" . - " AND {$tableGlobal}.store_id = 0", - array($attribute->getAttributeCode() => $attributeCond) - )->joinLeft( - array($tableStore => $tableName), - "{$tableGlobal}.entity_id = {$tableStore}.entity_id" . - " AND {$tableGlobal}.attribute_id = {$tableStore}.attribute_id" . - " AND {$tableStore}.store_id = " . - $store->getId(), - array() - ); - } - return $this; - } - - /** - * Retrieve fixed bundle base price (with special price and rules) - * - * @param int $productId - * @param array $priceData - * @param Website $website - * @param \Magento\Customer\Model\Group $customerGroup - * @return float - */ - protected function _getBasePrice($productId, array $priceData, $website, $customerGroup) - { - $store = $website->getDefaultStore(); - $storeTimeStamp = $this->_localeDate->scopeTimeStamp($store); - $finalPrice = $this->_calculateSpecialPrice($priceData['price'], $priceData, $website); - - $rulePrice = $this->_catalogRuleFactory->create()->getRulePrice( - $storeTimeStamp, - $website->getId(), - $customerGroup->getId(), - $productId - ); - - if ($rulePrice !== null && $rulePrice !== false) { - $finalPrice = min($finalPrice, $rulePrice); - } - - return $finalPrice; - } - - /** - * Retrieve custom options for product - * - * @param int $productId - * @param Website $website - * @return array - */ - public function getCustomOptions($productId, Website $website) - { - $options = array(); - $store = $website->getDefaultStore(); - $price = $this->_getAttribute('price'); - $adapter = $this->_getReadAdapter(); - - $bind = array(':product_id' => $productId, ':store_id' => $store->getId()); - $select = $adapter->select()->from( - array('option_table' => $this->getTable('catalog_product_option')), - array('option_id', 'is_require', 'type') - )->where( - 'option_table.product_id=:product_id' - ); - - if ($price->isScopeGlobal()) { - $select->join( - array('price_table' => $this->getTable('catalog_product_option_price')), - 'option_table.option_id = price_table.option_id' . ' AND price_table.store_id = 0', - array('value_id' => 'option_price_id', 'price', 'price_type') - ); - } else { - $valueIdCond = $adapter->getCheckSql( - 'price_store_table.option_price_id IS NOT NULL', - 'price_store_table.option_price_id', - 'price_global_table.option_price_id' - ); - $priceCond = $adapter->getCheckSql( - 'price_store_table.price IS NOT NULL', - 'price_store_table.price', - 'price_global_table.price' - ); - $priceTypeCond = $adapter->getCheckSql( - 'price_store_table.price_type IS NOT NULL', - 'price_store_table.price_type', - 'price_global_table.price_type' - ); - - $select->join( - array('price_global_table' => $this->getTable('catalog_product_option_price')), - 'option_table.option_id=price_global_table.option_id' . ' AND price_global_table.store_id=0', - array('value_id' => $valueIdCond, 'price' => $priceCond, 'price_type' => $priceTypeCond) - )->joinLeft( - array('price_store_table' => $this->getTable('catalog_product_option_price')), - 'option_table.option_id = price_store_table.option_id' . ' AND price_store_table.store_id=:store_id', - array() - ); - } - - $query = $adapter->query($select, $bind); - while ($row = $query->fetch()) { - if (!isset($options[$row['option_id']])) { - $options[$row['option_id']] = array( - 'option_id' => $row['option_id'], - 'is_require' => $row['is_require'], - 'type' => $row['type'], - 'values' => array() - ); - } - $options[$row['option_id']]['values'][$row['value_id']] = array( - 'price_type' => $row['price_type'], - 'price_value' => $row['price'] - ); - } - - $select = $adapter->select()->from( - array('option_table' => $this->getTable('catalog_product_option')), - array('option_id', 'is_require', 'type') - )->join( - array('type_table' => $this->getTable('catalog_product_option_type_value')), - 'option_table.option_id=type_table.option_id', - array() - )->where( - 'option_table.product_id=:product_id' - ); - - if ($price->isScopeGlobal()) { - $select->join( - array('price_table' => $this->getTable('catalog_product_option_type_price')), - 'type_table.option_type_id=price_table.option_type_id' . ' AND price_table.store_id=0', - array('value_id' => 'option_type_id', 'price', 'price_type') - ); - } else { - $select->join( - array('price_global_table' => $this->getTable('catalog_product_option_type_price')), - 'type_table.option_type_id=price_global_table.option_type_id' . ' AND price_global_table.store_id=0', - array('value_id' => $valueIdCond, 'price' => $priceCond, 'price_type' => $priceTypeCond) - )->joinLeft( - array('price_store_table' => $this->getTable('catalog_product_option_type_price')), - 'type_table.option_type_id=price_store_table.option_type_id' . - ' AND price_store_table.store_id=:store_id', - array() - ); - } - - $query = $adapter->query($select, $bind); - while ($row = $query->fetch()) { - if (!isset($options[$row['option_id']])) { - $options[$row['option_id']] = array( - 'option_id' => $row['option_id'], - 'is_require' => $row['is_require'], - 'type' => $row['type'], - 'values' => array() - ); - } - $options[$row['option_id']]['values'][$row['value_id']] = array( - 'price_type' => $row['price_type'], - 'price_value' => $row['price'] - ); - } - - return $options; - } - - /** - * Calculate custom options price - * Return array with indexes(0 -> min_price, 1 -> max_price) - * - * @param array $options - * @param float $basePrice - * @param float $minPrice - * @param float $maxPrice - * @return array - */ - public function _calculateCustomOptions(array $options, $basePrice, $minPrice, $maxPrice) - { - foreach ($options as $option) { - $optionPrices = array(); - foreach ($option['values'] as $value) { - if ($value['price_type'] == 'percent') { - $valuePrice = $basePrice * $value['price_value'] / 100; - } else { - $valuePrice = $value['price_value']; - } - $optionPrices[] = $valuePrice; - } - if ($option['is_require']) { - $minPrice += min($optionPrices); - } - $multiTypes = array( - \Magento\Catalog\Model\Product\Option::OPTION_TYPE_DROP_DOWN, - \Magento\Catalog\Model\Product\Option::OPTION_TYPE_CHECKBOX, - \Magento\Catalog\Model\Product\Option::OPTION_TYPE_MULTIPLE - ); - if ($optionPrices) { - if (in_array($option['type'], $multiTypes)) { - $maxPrice += array_sum($optionPrices); - } else { - $maxPrice += max($optionPrices); - } - } - } - - return array($minPrice, $maxPrice); - } - - /** - * Calculate minimal and maximal price for bundle selections - * Return array with prices (0 -> min_price, 1 -> max_price) - * - * @param array $options - * @param array $salableStatus - * @param int $productId - * @param int $priceType - * @param float $basePrice - * @param array $priceData - * @param array $priceIndex - * @param Website $website - * @param \Magento\Customer\Model\Group $group - * @return array - */ - public function _calculateBundleSelections( - array $options, - array $salableStatus, - $productId, - $priceType, - $basePrice, - $priceData, - $priceIndex, - $website, - $group - ) { - $minPrice = $maxPrice = $basePrice; - $optPrice = 0; - - foreach ($options as $option) { - $optionPrices = array(); - foreach ($option['selections'] as $selection) { - if (!$selection['product_id']) { - continue; - } - - if (!$salableStatus[$selection['product_id']]) { - continue; - } - - if ($priceType == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { - $basePrice = $this->_getBasePrice($productId, $priceData, $website, $group); - } - - // calculate selection price - if ($priceType == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC) { - $priceIndexKey = join('-', array($selection['product_id'], $website->getId(), $group->getId())); - - $selectionPrice = isset($priceIndex[$priceIndexKey]) ? $priceIndex[$priceIndexKey] : 0; - $selectionPrice = $this->_calculateSpecialPrice($selectionPrice, $priceData, $website); - } else { - if ($selection['price_type']) { - // percent - $selectionPrice = $basePrice * $selection['price_value'] / 100; - } else { - $selectionPrice = $this->_calculateSpecialPrice( - $selection['price_value'], - $priceData, - $website - ); - } - } - - // calculate selection qty - if ($selection['can_change_qty'] && $option['type'] != 'multi' && $option['type'] != 'checkbox') { - $qty = 1; - } else { - $qty = $selection['qty']; - } - - $selectionPrice = $selectionPrice * $qty; - $optionPrices[$selection['selection_id']] = $selectionPrice; - } - - if ($optionPrices) { - if ($option['required']) { - $minPrice += min($optionPrices); - } else { - $optPrice = $optPrice && $optPrice < min($optionPrices) ? $optPrice : min($optionPrices); - } - if (in_array($option['type'], array('multi', 'checkbox'))) { - $maxPrice += array_sum($optionPrices); - } else { - $maxPrice += max($optionPrices); - } - } - } - - if ($minPrice == 0) { - $minPrice = $optPrice; - } - return array($minPrice, $maxPrice); - } - - /** - * Apply special price - * - * @param float $finalPrice - * @param array $priceData - * @param Website $website - * @return float - */ - public function _calculateSpecialPrice($finalPrice, array $priceData, Website $website) - { - $store = $website->getDefaultStore(); - $specialPrice = $priceData['special_price']; - - if (!is_null($specialPrice) && $specialPrice != false) { - if ($this->_localeDate->isScopeDateInInterval( - $store, - $priceData['special_from_date'], - $priceData['special_to_date'] - ) - ) { - $specialPrice = $finalPrice * $specialPrice / 100; - $finalPrice = min($finalPrice, $specialPrice); - } - } - - return $finalPrice; - } - - /** - * Retrieve price index for products - * - * @param int|array $productIds - * @param int $websiteId - * @param int $groupId - * @return array - */ - public function loadPriceIndex($productIds, $websiteId, $groupId) - { - $prices = array(); - $adapter = $this->_getReadAdapter(); - $select = $adapter->select()->from( - array('pi' => $this->getMainTable()), - array('entity_id', 'min_price', 'max_price') - )->where( - 'entity_id IN(?)', - $productIds - )->where( - 'website_id=:website_id' - )->where( - 'customer_group_id=:group_id' - ); - $bind = array('website_id' => $websiteId, 'group_id' => $groupId); - $query = $adapter->query($select, $bind); - while ($row = $query->fetch()) { - $prices[$row['entity_id']] = array('min_price' => $row['min_price'], 'max_price' => $row['max_price']); - } - - return $prices; - } -} diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 63c0394f724d0940713036609f338df472c89e96..6611fa089557a0860373996dc86e560a19b55643 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -41,7 +41,7 @@ class Creditmemo extends AbstractItems * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $string * @param \Magento\Model\Resource\AbstractResource $resource @@ -52,7 +52,7 @@ class Creditmemo extends AbstractItems \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $string, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index b90de45336f9e3bb19517057e91a5b30af01805a..a6681b47759d6ad2bfe02e5cb8039d3d8a797c25 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -39,7 +39,7 @@ class Invoice extends AbstractItems * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $coreString * @param \Magento\Model\Resource\AbstractResource $resource @@ -50,7 +50,7 @@ class Invoice extends AbstractItems \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $coreString, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index cf251864bd01ae0515b509be6b9ac5aad8707fec..aee4fd7efbe8c6dd87975fd536cfd12addd809f8 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -39,7 +39,7 @@ class Shipment extends AbstractItems * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $string * @param \Magento\Model\Resource\AbstractResource $resource @@ -50,7 +50,7 @@ class Shipment extends AbstractItems \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $string, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index 8bd37643bbe1e73478cf4f262ec72c97161f44ba..b64722d575462efe98101300592e3b0db27b8c52 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -28,8 +28,6 @@ namespace Magento\Bundle\Model; /** * Bundle Selection Model * - * @method \Magento\Bundle\Model\Resource\Selection _getResource() - * @method \Magento\Bundle\Model\Resource\Selection getResource() * @method int getOptionId() * @method \Magento\Bundle\Model\Selection setOptionId(int $value) * @method int getParentProductId() @@ -48,10 +46,6 @@ namespace Magento\Bundle\Model; * @method \Magento\Bundle\Model\Selection setSelectionQty(float $value) * @method int getSelectionCanChangeQty() * @method \Magento\Bundle\Model\Selection setSelectionCanChangeQty(int $value) - * - * @category Magento - * @package Magento_Bundle - * @author Magento Core Team <core@magentocommerce.com> */ class Selection extends \Magento\Model\AbstractModel { @@ -60,7 +54,7 @@ class Selection extends \Magento\Model\AbstractModel * * @var \Magento\Catalog\Helper\Data */ - protected $_catalogData = null; + protected $_catalogData; /** * @param \Magento\Model\Context $context diff --git a/app/code/Magento/Bundle/Pricing/Adjustment/BundleCalculatorInterface.php b/app/code/Magento/Bundle/Pricing/Adjustment/BundleCalculatorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..9c061ac0e532d5946bddaac694c9bad064db3ef9 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Adjustment/BundleCalculatorInterface.php @@ -0,0 +1,44 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Adjustment; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Adjustment\CalculatorInterface; + +/** + * Bundle calculator interface + */ +interface BundleCalculatorInterface extends CalculatorInterface +{ + /** + * @param float|string $amount + * @param SaleableInterface $saleableItem + * @param null|bool $exclude + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMaxAmount($amount, SaleableInterface $saleableItem, $exclude = null); +} diff --git a/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php new file mode 100644 index 0000000000000000000000000000000000000000..15c8b40c3d178c97e0c646c9de44d71fd8486e35 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php @@ -0,0 +1,225 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Adjustment; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Amount\AmountFactory; +use Magento\Pricing\Adjustment\Calculator as CalculatorBase; +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Pricing\Price\BundleOptionPriceInterface; +use Magento\Bundle\Pricing\Price\BundleSelectionFactory; +use Magento\Bundle\Pricing\Price\BundleOptionPrice; + +/** + * Bundle price calculator + */ +class Calculator implements BundleCalculatorInterface +{ + /** + * @var CalculatorBase + */ + protected $calculator; + + /** + * @var AmountFactory + */ + protected $amountFactory; + + /** + * @var BundleSelectionFactory + */ + protected $selectionFactory; + + /** + * @param CalculatorBase $calculator + * @param AmountFactory $amountFactory + * @param BundleSelectionFactory $bundleSelectionFactory + */ + public function __construct( + CalculatorBase $calculator, + AmountFactory $amountFactory, + BundleSelectionFactory $bundleSelectionFactory + ) { + $this->calculator = $calculator; + $this->amountFactory = $amountFactory; + $this->selectionFactory = $bundleSelectionFactory; + } + + /** + * Get amount for current product which is included price of existing options with minimal price + * + * @param float|string $amount + * @param SaleableInterface $saleableItem + * @param null|string $exclude + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getAmount($amount, SaleableInterface $saleableItem, $exclude = null) + { + return $this->getOptionsAmount($amount, $saleableItem, $exclude, true); + } + + /** + * Get amount for current product which is included price of existing options with maximal price + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @param null $exclude + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMaxAmount($amount, SaleableInterface $saleableItem, $exclude = null) + { + return $this->getOptionsAmount($amount, $saleableItem, $exclude, false); + } + + /** + * Base calculation of amount for saleable item + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @param null|string $exclude + * @param bool $searchMin + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function getOptionsAmount($amount, SaleableInterface $saleableItem, $exclude = null, $searchMin = true) + { + $fullAmount = 0.; + $adjustments = []; + // Get amount for bundle product + $amountList[] = $this->calculator->getAmount($amount, $saleableItem); + + $minOptionAmount = null; + /* @var $option \Magento\Bundle\Model\Option */ + foreach ($this->getBundleOptionPrice($saleableItem)->getOptions() as $option) { + if (!$option->getSelections()) { + continue; + } + // Add amounts for custom options + $optionsAmounts = $this->processOptions($option, $saleableItem, $searchMin); + if ($searchMin + && ($minOptionAmount === null || end($optionsAmounts)->getValue() < $minOptionAmount->getValue()) + ) { + $minOptionAmount = end($optionsAmounts); + } elseif (!$searchMin) { + $amountList = array_merge($amountList, $optionsAmounts); + } + } + + if ($searchMin && $minOptionAmount) { + $amountList[] = $minOptionAmount; + } + + /** @var \Magento\Pricing\Amount\AmountInterface $itemAmount */ + foreach ($amountList as $itemAmount) { + $fullAmount += $itemAmount->getValue(); + foreach ($itemAmount->getAdjustmentAmounts() as $code => $adjustment) { + if ($exclude === null || $exclude !== $code) { + $adjustments[$code] = isset($adjustments[$code]) ? $adjustments[$code] + $adjustment : $adjustment; + } + } + } + return $this->amountFactory->create($fullAmount, $adjustments); + } + + /** + * @param SaleableInterface $saleableItem + * @return BundleOptionPrice + */ + protected function getBundleOptionPrice(SaleableInterface $saleableItem) + { + return $saleableItem->getPriceInfo()->getPrice(BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION); + } + + /** + * @param \Magento\Bundle\Model\Option $option + * @param SaleableInterface $saleableItem + * @param bool $searchMin + * @return \Magento\Pricing\Amount\AmountInterface[] + */ + protected function processOptions($option, $saleableItem, $searchMin = true) + { + $result = []; + foreach ($option->getSelections() as $selection) { + /* @var $selection \Magento\Bundle\Model\Selection|\Magento\Catalog\Model\Product */ + if (!$selection->isSalable()/* || ($searchMin && !$option->getRequired())*/) { + // @todo CatalogInventory Show out of stock Products + continue; + } + $current = $this->getSelection($selection, $saleableItem); + if (empty($result)) { + $result = [$current]; + continue; + } + if ($searchMin && end($result)->getValue() > $current->getValue()) { + $result = [$current]; + } elseif (!$searchMin && $option->isMultiSelection()) { + $result[] = $current; + } elseif (!$searchMin && !$option->isMultiSelection() && end($result)->getValue() < $current->getValue()) { + $result = [$current]; + } + } + return $result; + } + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @param SaleableInterface $saleableItem + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function getSelection($selection, $saleableItem) + { + if ($saleableItem->getPriceType() == Price::PRICE_TYPE_FIXED) { + return $this->createFixedAmount($selection, $saleableItem); + } else { + return $this->createDynamicAmount($selection, $saleableItem); + } + } + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @param SaleableInterface $saleableItem + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function createDynamicAmount($selection, $saleableItem) + { + /** @var \Magento\Bundle\Pricing\Price\BundleSelectionPrice $price */ + $price = $this->selectionFactory->create($saleableItem, $selection, $selection->getSelectionQty()); + return $price->getAmount(); + } + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @param SaleableInterface $saleableItem + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function createFixedAmount($selection, $saleableItem) + { + $selectionPrice = $this->selectionFactory + ->create($saleableItem, $selection, $selection->getSelectionQty()) + ->getValue(); + return $this->calculator->getAmount($selectionPrice, $saleableItem); + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/BasePrice.php b/app/code/Magento/Bundle/Pricing/Price/BasePrice.php new file mode 100644 index 0000000000000000000000000000000000000000..bcef83dff1f1344936291b9cd11028f9422b70da --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/BasePrice.php @@ -0,0 +1,73 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Catalog\Pricing\Price as CatalogPrice; + +/** + * Bundle Base Price model + */ +class BasePrice extends CatalogPrice\BasePrice +{ + /** + * Get Base Price Value + * + * @return float|bool + */ + public function getValue() + { + if ($this->value === null) { + $this->value = $this->applyDiscount(parent::getValue()); + } + return $this->value; + } + + /** + * Apply discount type prices + * + * @param float $price + * @return float + */ + public function applyDiscount($price) + { + $discount = [ + 0, + $this->priceInfo + ->getPrice(CatalogPrice\TierPriceInterface::PRICE_TYPE_TIER, $this->quantity) + ->getValue(), + $this->priceInfo + ->getPrice(CatalogPrice\GroupPriceInterface::PRICE_TYPE_GROUP, $this->quantity) + ->getValue(), + $this->priceInfo + ->getPrice(CatalogPrice\SpecialPriceInterface::PRICE_TYPE_SPECIAL, $this->quantity) + ->getValue() + ]; + $discount = max($discount); + if ($discount) { + $price = $price - $price * ($discount / 100); + } + return $price; + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..3237f75c8a9e072a40bef21a724384c089e5db2c --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php @@ -0,0 +1,198 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Price; + +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface; + +/** + * Bundle option price model + */ +class BundleOptionPrice extends RegularPrice implements BundleOptionPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_BUNDLE_OPTION; + + /** + * @var array + */ + protected $priceOptions; + + /** + * @var BundleSelectionFactory + */ + protected $selectionFactory; + + /** + * @var float|bool|null + */ + protected $maximalPrice; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param BundleCalculatorInterface $calculator + * @param BundleSelectionFactory $bundleSelectionFactory + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + BundleCalculatorInterface $calculator, + BundleSelectionFactory $bundleSelectionFactory + ) { + $this->selectionFactory = $bundleSelectionFactory; + parent::__construct($salableItem, $quantity, $calculator); + $this->salableItem->setQty($this->quantity); + } + + /** + * {@inheritdoc} + */ + public function getValue() + { + if (null === $this->value) { + $this->value = $this->calculateOptions(); + } + return $this->value; + } + + /** + * Get Options with attached Selections collection + * + * @return \Magento\Bundle\Model\Resource\Option\Collection + */ + public function getOptions() + { + if (null !== $this->priceOptions) { + return $this->priceOptions; + } + $this->salableItem->getTypeInstance()->setStoreFilter($this->salableItem->getStoreId(), $this->salableItem); + + $optionCollection = $this->salableItem->getTypeInstance()->getOptionsCollection($this->salableItem); + + $selectionCollection = $this->salableItem->getTypeInstance()->getSelectionsCollection( + $this->salableItem->getTypeInstance()->getOptionsIds($this->salableItem), + $this->salableItem + ); + + $this->priceOptions = $optionCollection->appendSelections($selectionCollection, false, false); + return $this->priceOptions; + } + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getOptionSelectionAmount($selection) + { + return $this->createSelection($selection)->getAmount(); + } + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @return \Magento\Bundle\Pricing\Price\BundleSelectionPriceInterface + */ + protected function createSelection($selection) + { + return $this->selectionFactory->create($this->salableItem, $selection, $selection->getSelectionQty()); + } + + /** + * @param bool $searchMin + * @return bool|float + */ + protected function calculateOptions($searchMin = true) + { + $price = false; + $amountList = []; + /* @var $option \Magento\Bundle\Model\Option */ + foreach ($this->getOptions() as $option) { + if (!$option->getSelections()) { + continue; + } + $amountList = array_merge($amountList, $this->processOptions($option, $searchMin)); + } + if (!empty($amountList)) { + $price = 0.; + foreach ($amountList as $itemAmount) { + $price += $itemAmount->getValue(); + } + } + return $price; + } + + /** + * @param \Magento\Bundle\Model\Option $option + * @param bool $searchMin + * @return \Magento\Pricing\Amount\AmountInterface[] + */ + protected function processOptions($option, $searchMin = true) + { + $result = []; + foreach ($option->getSelections() as $selection) { + /* @var $selection \Magento\Bundle\Model\Selection */ + if (!$selection->isSalable() || ($searchMin && !$option->getRequired())) { + // @todo CatalogInventory Show out of stock Products + continue; + } + $current = $this->createSelection($selection); + if (empty($result)) { + $result = [$current]; + continue; + } + if ($searchMin && end($result)->getValue() > $current->getValue()) { + $result = [$current]; + } elseif (!$searchMin && $option->isMultiSelection()) { + $result[] = $current; + } elseif (!$searchMin && !$option->isMultiSelection() && end($result)->getValue() < $current->getValue()) { + $result = [$current]; + } + } + return $result; + } + + /** + * Getter for maximal price of options + * + * @return bool|float + */ + public function getMaxValue() + { + if (null === $this->maximalPrice) { + $this->maximalPrice = $this->calculateOptions(false); + } + return $this->maximalPrice; + } + + /** + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getAmount() + { + return $this->calculator->getAmount(0, $this->salableItem); + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPriceInterface.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..350ecd38ab7935e7418ca9e11db656d712bab381 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPriceInterface.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Price; + +/** + * Option price interface + */ +interface BundleOptionPriceInterface +{ + /** + * Price model code + */ + const PRICE_TYPE_BUNDLE_OPTION = 'bundle_option'; + + /** + * Return calculated options + * + * @return array + */ + public function getOptions(); + + /** + * @param \Magento\Bundle\Model\Selection $selection + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getOptionSelectionAmount($selection); +} diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..fa77dafa99173a8418c460021a3144dc2ac9b6f2 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * Bundle selection price factory + */ +class BundleSelectionFactory +{ + /** + * Default selection class + */ + const SELECTION_CLASS_DEFAULT = 'Magento\Bundle\Pricing\Price\BundleSelectionPriceInterface'; + + /** + * Object Manager + * + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * Construct + * + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create Price object for particular product + * + * @param SaleableInterface $bundleProduct + * @param SaleableInterface $selection + * @param float $quantity + * @param array $arguments + * @throws \InvalidArgumentException + * @return BundleSelectionPriceInterface + */ + public function create( + SaleableInterface $bundleProduct, + SaleableInterface $selection, + $quantity, + array $arguments = [] + ) { + $arguments['bundleProduct'] = $bundleProduct; + $arguments['salableItem'] = $selection; + $arguments['quantity'] = $quantity ? floatval($quantity) : 1.; + $selectionPrice = $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments); + if (!$selectionPrice instanceof BundleSelectionPriceInterface) { + throw new \InvalidArgumentException( + get_class($selectionPrice) . ' doesn\'t implement BundleSelectionPriceInterface' + ); + } + return $selectionPrice; + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..81fe26544f87c76ef83a68e3849d498033fba292 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php @@ -0,0 +1,112 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Price; + +use Magento\Catalog\Pricing\Price as CatalogPrice; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Bundle\Model\Product\Price; +use Magento\Catalog\Pricing\Price\FinalPriceInterface; +use Magento\Pricing\Adjustment\CalculatorInterface; + +/** + * Bundle option price + */ +class BundleSelectionPrice extends CatalogPrice\RegularPrice implements BundleSelectionPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_BUNDLE_SELECTION; + + /** + * @var \Magento\Catalog\Model\Product + */ + protected $bundleProduct; + + /** + * Event manager + * + * @var \Magento\Event\ManagerInterface + */ + protected $eventManager; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + * @param \Magento\Catalog\Model\Product $bundleProduct + * @param \Magento\Event\ManagerInterface $eventManager + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator, + \Magento\Catalog\Model\Product $bundleProduct, + \Magento\Event\ManagerInterface $eventManager + ) { + $this->bundleProduct = $bundleProduct; + $this->eventManager = $eventManager; + parent::__construct($salableItem, $quantity, $calculator); + } + + /** + * @return bool|float + */ + public function getValue() + { + if (null !== $this->value) { + return $this->value; + } + + if ($this->bundleProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC) { + $value = $this->priceInfo + ->getPrice(FinalPriceInterface::PRICE_TYPE_FINAL, $this->quantity) + ->getValue(); + } else { + if ($this->salableItem->getSelectionPriceType()) { + // calculate price for selection type percent + // @todo get rid of final price data manipulation that should fire event to apply catalog rules + $product = clone $this->bundleProduct; + $price = $product->getPriceInfo() + ->getPrice(CatalogPrice\RegularPrice::PRICE_TYPE_PRICE_DEFAULT, $this->quantity) + ->getValue(); + $product->setFinalPrice($price); + $this->eventManager->dispatch( + 'catalog_product_get_final_price', + array('product' => $product, 'qty' => $this->bundleProduct->getQty()) + ); + $value = $product->getData('final_price') * ($this->salableItem->getSelectionPriceValue() / 100); + } else { + // calculate price for selection type fixed + $value = $this->salableItem->getSelectionPriceValue() * $this->quantity; + } + } + $this->value = $this->bundleProduct->getPriceInfo() + ->getPrice(CatalogPrice\BasePrice::PRICE_TYPE_BASE_PRICE, $this->quantity) + ->applyDiscount($value); + return $this->value; + } +} diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/AndGroupBuilder.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPriceInterface.php similarity index 81% rename from app/code/Magento/Customer/Service/V1/Data/Search/AndGroupBuilder.php rename to app/code/Magento/Bundle/Pricing/Price/BundleSelectionPriceInterface.php index 64da6cb4c691c4c4bcaf64fd075a6cc0bdb1bcfe..020f94061f210202d2f6924f15f895a5aa201811 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Search/AndGroupBuilder.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPriceInterface.php @@ -21,11 +21,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Customer\Service\V1\Data\Search; +namespace Magento\Bundle\Pricing\Price; /** - * Builder for AndGroup Data Object. + * Bundle selection price interface */ -class AndGroupBuilder extends AbstractFilterGroupBuilder +interface BundleSelectionPriceInterface { + /** + * Price model code + */ + const PRICE_TYPE_BUNDLE_SELECTION = 'bundle_selection'; } diff --git a/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php b/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..bb5f7a40636f01067a34c2f2f780ed4aae4e1429 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php @@ -0,0 +1,95 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface; + +/** + * Final price model + */ +class FinalPrice extends \Magento\Catalog\Pricing\Price\FinalPrice +{ + /** + * @var BundleCalculatorInterface + */ + protected $calculator; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param BundleCalculatorInterface $calculator + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + BundleCalculatorInterface $calculator + ) { + parent::__construct($salableItem, $quantity, $calculator); + } + + /** + * @return float + */ + public function getValue() + { + return parent::getValue() + $this->basePrice->applyDiscount($this->getBundleOptionPrice()->getValue()); + } + + /** + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMaximalPrice() + { + return $this->calculator->getMaxAmount($this->basePrice->getValue(), $this->salableItem); + } + + /** + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMinimalPrice() + { + return $this->getAmount(); + } + + + /** + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getAmount() + { + return $this->calculator->getAmount(parent::getValue(), $this->salableItem); + } + + /** + * @return \Magento\Bundle\Pricing\Price\BundleOptionPrice + */ + protected function getBundleOptionPrice() + { + return $this->priceInfo->getPrice(BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION, $this->quantity); + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/GroupPrice.php b/app/code/Magento/Bundle/Pricing/Price/GroupPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..5ea82cde8ceb3511c003b491e6db9306089f72d2 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/GroupPrice.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Customer\Model\Session; + +/** + * Bundle droup price model + */ +class GroupPrice extends \Magento\Catalog\Pricing\Price\GroupPrice +{ + /** + * @return float|bool + */ + public function getValue() + { + if ($this->value !== null) { + return $this->value; + } + + $groupPrice = parent::getValue(); + if ($groupPrice) { + $basePrice = $this->getBasePrice(); + $this->value = $basePrice - $basePrice * ($groupPrice / 100); + } else { + $this->value = false; + } + return $this->value; + } + + /** + * @param null|float $qty + * @return bool|float + */ + protected function getBasePrice($qty = null) + { + return $this->priceInfo + ->getPrice(\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE, $qty) + ->getValue(); + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/SpecialPrice.php b/app/code/Magento/Bundle/Pricing/Price/SpecialPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..71632bc0a7eed2f827d21dea6944a96ecf63c153 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/SpecialPrice.php @@ -0,0 +1,63 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +/** + * Special price model + */ +class SpecialPrice extends \Magento\Catalog\Pricing\Price\SpecialPrice +{ + /** + * @return bool|float + */ + public function getValue() + { + if ($this->value !== null) { + return $this->value; + } + + $specialPrice = parent::getValue(); + if ($specialPrice) { + $basePrice = $this->getBasePrice(); + $this->value = $basePrice - $basePrice * ($specialPrice / 100); + } else { + $this->value = false; + } + return $this->value; + } + + /** + * @param null|float $qty + * @return bool|float + */ + protected function getBasePrice($qty = null) + { + return $this->priceInfo + ->getPrice(\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE, $qty) + ->getValue(); + } +} diff --git a/app/code/Magento/Bundle/Pricing/Price/TierPrice.php b/app/code/Magento/Bundle/Pricing/Price/TierPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..28b3bca19e310e3aff96d79b92fe2e7adc9e41bd --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Price/TierPrice.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +/** + * Bundle tire prices model + */ +class TierPrice extends \Magento\Catalog\Pricing\Price\TierPrice +{ + /** + * @var bool + */ + protected $filterByBasePrice = false; + + /** + * Returns true if first price is better + * + * Method filters tiers price values, higher discount value is better + * + * @param float $firstPrice + * @param float $secondPrice + * @return bool + */ + protected function isFirstPriceBetter($firstPrice, $secondPrice) + { + return $firstPrice > $secondPrice; + } +} diff --git a/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php b/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php new file mode 100644 index 0000000000000000000000000000000000000000..3cfe54abfd80423d65d57347edc5320f01b8d322 --- /dev/null +++ b/app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Render; + +use Magento\Catalog\Pricing\Render as CatalogRender; +use Magento\Bundle\Pricing\Price; + +/** + * Class for final_price rendering + */ +class FinalPriceBox extends CatalogRender\FinalPriceBox +{ + /** + * Check if bundle product has one more custom option with different prices + * + * @return bool + */ + public function showRangePrice() + { + /** @var Price\BundleOptionPrice $optionPrice */ + $optionPrice = $this->getPriceType(Price\BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION); + return $optionPrice->getValue() !== $optionPrice->getMaxValue(); + } +} diff --git a/app/code/Magento/Bundle/etc/adminhtml/routes.xml b/app/code/Magento/Bundle/etc/adminhtml/routes.xml index 27aa8c3b5add91ae9598d00a13f9cce2e1ced0d5..0d5063e93bf0af30e1cb153b9fd5cef3c344f3c2 100644 --- a/app/code/Magento/Bundle/etc/adminhtml/routes.xml +++ b/app/code/Magento/Bundle/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Bundle" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Bundle/etc/di.xml b/app/code/Magento/Bundle/etc/di.xml index dc619c493827c44057994bdd6ea33522cb137684..07c611982974ef4beefc556887c2069520ea0103 100644 --- a/app/code/Magento/Bundle/etc/di.xml +++ b/app/code/Magento/Bundle/etc/di.xml @@ -48,4 +48,69 @@ </argument> </arguments> </type> + <type name="Magento\Pricing\PriceInfo\Factory"> + <arguments> + <argument name="types" xsi:type="array"> + <item name="bundle" xsi:type="string">Magento\Bundle\Pricing\PriceInfo</item> + </argument> + </arguments> + </type> + <virtualType name="Magento\Bundle\Pricing\PriceInfo" type="Magento\Pricing\PriceInfo\Base"> + <arguments> + <argument name="prices" xsi:type="object">Magento\Bundle\Pricing\PriceComposite</argument> + <argument name="adjustmentCollection" xsi:type="object">Magento\Bundle\Pricing\Adjustment\Collection</argument> + </arguments> + </virtualType> + <virtualType name="Magento\Bundle\Pricing\PriceComposite" type="Magento\Pricing\PriceComposite"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="regular_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\RegularPrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + <item name="final_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Bundle\Pricing\Price\FinalPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="tier_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Bundle\Pricing\Price\TierPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="group_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\GroupPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="special_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\SpecialPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="msrp_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\MsrpPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="base_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Bundle\Pricing\Price\BasePrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="custom_option" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\OptionPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="bundle_option" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Bundle\Pricing\Price\BundleOptionPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + </argument> + </arguments> + </virtualType> + <virtualType name="Magento\Bundle\Pricing\Adjustment\Collection" type="Magento\Pricing\Adjustment\Collection"> + <arguments> + <argument name="adjustments" xsi:type="array"> + <item name="tax" xsi:type="const">Magento\Tax\Pricing\Adjustment::CODE</item> + <item name="weee" xsi:type="const">Magento\Weee\Pricing\Adjustment::CODE</item> + </argument> + </arguments> + </virtualType> + <preference for="Magento\Bundle\Pricing\Price\BundleSelectionPriceInterface" type="Magento\Bundle\Pricing\Price\BundleSelectionPrice" /> + <preference for="Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface" type="Magento\Bundle\Pricing\Adjustment\Calculator" /> </config> diff --git a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php index dc8610316f70c2121b57e4ccf86a2a60cb7ef85b..c0778c2a87b6d211a8a4b4e5b05d27b7df90c60c 100644 --- a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -31,7 +31,7 @@ $installer = $this; $installFile = __DIR__ . '/upgrade-1.6.0.0-1.6.0.0.1.php'; /** @var \Magento\Filesystem\Directory\Read $modulesDirectory */ -$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); +$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); if ($modulesDirectory->isExist($modulesDirectory->getRelativePath($installFile))) { include $installFile; diff --git a/app/code/Magento/Bundle/view/adminhtml/css/bundle-product.css b/app/code/Magento/Bundle/view/adminhtml/css/bundle-product.css index 2372b5fe84fdadea810b5cefe69165045dd9a668..bbba5c5824bec49b1f4e7f588104cfafc952de1a 100644 --- a/app/code/Magento/Bundle/view/adminhtml/css/bundle-product.css +++ b/app/code/Magento/Bundle/view/adminhtml/css/bundle-product.css @@ -36,7 +36,29 @@ } #bundle_product_container .col-name { - width: 25%; + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; +} + +#bundle_product_container .col-sku { + max-width: 170px; + overflow: hidden; + text-overflow: ellipsis; +} + +#bundle_product_container .col-draggable { + width: 10px; +} + +#bundle_product_container .col-actions { + width: 40px; +} + +#bundle_product_container .col-qty, +#bundle_product_container .col-uqty, +#bundle_product_container .col-default { + width: 70px; } #bundle_product_container .field-option-req .control { @@ -77,7 +99,6 @@ .field-price .addon > .price + .select { width: 96px; float: left; - border-radius: 4px; } .field-weight .weight { @@ -88,4 +109,4 @@ .field-weight .weight .field:first-child { width: 100%; -} \ No newline at end of file +} diff --git a/app/code/Magento/Bundle/view/adminhtml/product/stock/disabler.phtml b/app/code/Magento/Bundle/view/adminhtml/product/stock/disabler.phtml index 0d2880514dd58deeb93bb4b4065ef0b69c3b7244..cf245c03770fe6fbb373febc889c9076f6c74ff6 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/stock/disabler.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/stock/disabler.phtml @@ -23,12 +23,11 @@ */ ?> <script type="text/javascript"> -jQuery(function($) { +(function($) { $('#product_info_tabs_product-details_content').on('stockbeforedisable', function(e) { if (e.productType === 'bundle') { - e.stopImmediatePropagation(); return false; } }); - }); +})(jQuery); </script> diff --git a/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml index a0c03252fabf863d8ac5972c830184ef3002ca16..9145779422af9059bd0c269c4e4bd4e4b4f3ae69 100644 --- a/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml @@ -82,7 +82,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -96,17 +96,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -114,7 +114,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -137,7 +137,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -145,17 +145,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -163,7 +163,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -253,7 +253,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -266,17 +266,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -284,7 +284,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -306,7 +306,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -316,17 +316,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -334,7 +334,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml index 31b5315eb4af058efe714dcb4602314387defbb5..8457ffbceb9b7cf695f55b65ad33b422c7cd6246 100644 --- a/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml @@ -80,7 +80,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -94,17 +94,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -112,7 +112,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -135,7 +135,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -143,17 +143,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -161,7 +161,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -187,7 +187,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -199,17 +199,17 @@ <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -217,7 +217,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -239,7 +239,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -247,17 +247,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -265,7 +265,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml index d106ff2a48cf6f204c9b99cfc9ebd782c1053bcc..51d8e7a073eb5779e0e78528c3cd9fc676dbb7be 100644 --- a/app/code/Magento/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml @@ -83,7 +83,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -97,17 +97,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -115,7 +115,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -138,7 +138,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -146,17 +146,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -164,7 +164,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -243,7 +243,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -256,17 +256,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -274,7 +274,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -296,7 +296,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -306,17 +306,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -324,7 +324,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml index d3aebbbb1e821c766c4e5c2297c3f3ae2b719b3f..8f091d5e2f5b24178c6b0e08fe0caa371057b1e0 100644 --- a/app/code/Magento/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml @@ -81,7 +81,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -95,17 +95,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -113,7 +113,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -136,7 +136,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -144,17 +144,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -162,7 +162,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -188,7 +188,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -201,17 +201,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -219,7 +219,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -241,7 +241,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -251,17 +251,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -269,7 +269,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml b/app/code/Magento/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml index 4f29a16cf00878e28a8f89e39ec7aecb2c6a8190..0d4269754d4b59dcb279a9e650dae25bb6c9fc47 100644 --- a/app/code/Magento/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml @@ -101,7 +101,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -115,17 +115,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -133,7 +133,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -156,7 +156,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -164,17 +164,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -182,7 +182,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -250,7 +250,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -263,17 +263,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -281,7 +281,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -303,7 +303,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -313,17 +313,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -331,7 +331,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/bundle.js b/app/code/Magento/Bundle/view/frontend/bundle.js index 322990c2dfac58c5601284d259e9fb014c2fbf37..7c061ff6b16d210fcb4344c258121ad9f990d6f3 100644 --- a/app/code/Magento/Bundle/view/frontend/bundle.js +++ b/app/code/Magento/Bundle/view/frontend/bundle.js @@ -89,7 +89,7 @@ _this.options.bundleConfig.options[parts[2]].selections[value] && _this.options.optionConfig.options[parts[2]].selections[_elem.val()] && _this.options.optionConfig.options[parts[2]] - ) { + ) { _this.options.bundleConfig.options[parts[2]].selections[value].qty = parseInt(quantity, 10); _this.options.optionConfig.options[parts[2]].selections[_elem.val()].qty = parseInt(quantity, 10); } @@ -181,13 +181,13 @@ reloadPrice: function() { if (this.options.bundleConfig) { var optionPrice = { - excludeTax: 0, - includeTax: 0, - price: 0, - update: function(price, excludeTax, includeTax) { + exclTaxPrice: this.options.bundleConfig.finalBasePriceExclTax, + inclTaxPrice: this.options.bundleConfig.finalBasePriceInclTax, + price: this.options.bundleConfig.finalPrice, + update: function(price, exclTaxPrice, inclTaxPrice) { this.price += price; - this.excludeTax += excludeTax; - this.includeTax += includeTax; + this.exclTaxPrice += exclTaxPrice; + this.inclTaxPrice += inclTaxPrice; } }; $.each(this.options.bundleConfig.selected, $.proxy(function(index, value) { @@ -197,11 +197,17 @@ if ($.isArray(element)) { $.each(element, $.proxy(function(k, e) { var prices = this.selectionPrice(index, e); - optionPrice.update(prices[0], prices[1], prices[2]); + optionPrice.update( + prices[0], + prices[1], + prices[2]); }, this)); } else { var prices = this.selectionPrice(index, element); - optionPrice.update(prices[0], prices[1], prices[2]); + optionPrice.update( + prices[0], + prices[1], + prices[2]); } } }, this)); @@ -219,9 +225,9 @@ if (priceElement.length === 1) { var price = 0; if (value.indexOf('price-including-tax-') >= 0) { - price = optionPrice.priceInclTax; + price = optionPrice.inclTaxPrice; } else if (value.indexOf('price-excluding-tax-') >= 0) { - price = optionPrice.priceExclTax; + price = optionPrice.exclTaxPrice; } else if (value.indexOf('product-price-') >= 0) { price = optionPrice.price; } @@ -254,39 +260,24 @@ qty = configOption.selections[selectionId].qty; } - var price, tierPrice, - selection = configOption.selections[selectionId]; + var selection = configOption.selections[selectionId]; + + var price = selection.price; + var inclTaxPrice = selection.inclTaxPrice; + var exclTaxPrice = selection.exclTaxPrice; + var tierPrice = selection.tierPrice; + if (config.priceType === '0') { - price = configOption.selections[selectionId].price; - tierPrice = configOption.selections[selectionId].tierPrice; $.each(tierPrice, function(k, e) { if (e.price_qty <= qty && e.price <= price) { price = e.price; + inclTaxPrice = e.inclTaxPrice; + exclTaxPrice = e.exclTaxPrice; } }); - } else { - if (selection.priceType === '0') { - price = selection.priceValue; - } else { - price = (config.basePrice * selection.priceValue) / 100; - } - } - - var disposition = configOption.selections[selectionId].plusDisposition + - configOption.selections[selectionId].minusDisposition; - if (config.specialPrice) { - price = Math.min((Math.round(price * config.specialPrice) / 100), price); - } - - var priceInclTax; - if (selection.priceInclTax !== undefined) { - priceInclTax = selection.priceInclTax; - price = selection.priceExclTax !== undefined ? selection.priceExclTax : selection.price; - } else { - priceInclTax = price; } - return [price * qty, disposition * qty, priceInclTax * qty]; + return [price * qty, exclTaxPrice * qty, inclTaxPrice * qty]; }, populateQty: function(optionId, selectionId) { diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/price.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/price.phtml index a4c350439d2b3b9b234012f7516770cf896ae6ed..49234a35756de0b9243760b43c3dfd7506a501af 100644 --- a/app/code/Magento/Bundle/view/frontend/catalog/product/price.phtml +++ b/app/code/Magento/Bundle/view/frontend/catalog/product/price.phtml @@ -33,22 +33,23 @@ <?php $weeeHelper = $this->helper('Magento\Weee\Helper\Data'); ?> <?php -if ($_product->getPriceType() == 1) { +$isFixed = $_product->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED; +if ($_product->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { $_weeeTaxAmount = $weeeHelper->getAmount($_product); $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; if ($weeeHelper->isTaxable()) { $_attributes = $weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true); $_weeeTaxAmountInclTaxes = $weeeHelper->getAmountInclTaxes($_attributes); } - if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(array(0, 1, 4))) { $_minimalPriceTax += $_weeeTaxAmount; $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } - if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)) { + if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)) { $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } - if ($weeeHelper->typeOfDisplay($_product, array(1, 2, 4))) { + if ($weeeHelper->typeOfDisplay(array(1, 2, 4))) { $_weeeTaxAttributes = $weeeHelper->getProductWeeeAttributesForDisplay($_product); } } @@ -63,10 +64,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -84,10 +85,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -99,7 +100,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($weeeHelper->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($weeeHelper->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> @@ -113,10 +114,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -134,10 +135,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -149,18 +150,18 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($weeeHelper->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($weeeHelper->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> </p> <?php - if ($_product->getPriceType() == 1) { - if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + if ($isFixed) { + if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(array(0, 1, 4))) { $_maximalPriceTax += $_weeeTaxAmount; $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } - if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)) { + if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)) { $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } } @@ -172,10 +173,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -193,10 +194,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -208,7 +209,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($weeeHelper->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($weeeHelper->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> @@ -219,10 +220,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -240,10 +241,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $weeeHelper->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $isFixed && $weeeHelper->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($weeeHelper->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($weeeHelper->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -255,7 +256,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($weeeHelper->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($weeeHelper->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/price.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/price.phtml index 4bb5f637be10f3d54399f26ed55117d02913a246..f06db442949de8f674e6a4d73184e904f4d7901d 100644 --- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/price.phtml +++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/price.phtml @@ -29,7 +29,7 @@ <?php if ($_product->getPriceType() == 1) { $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmount($_product); - if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1,2,4))) { + if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1,2,4))) { $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); } } @@ -52,10 +52,10 @@ $canApplyMAP = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_pro <?php endif ?> </span> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -82,10 +82,10 @@ $canApplyMAP = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_pro <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice,true,false) ?> <?php endif ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> diff --git a/app/code/Magento/Bundle/view/frontend/email/order/items/creditmemo/default.phtml b/app/code/Magento/Bundle/view/frontend/email/order/items/creditmemo/default.phtml index 8c17553c24918a9cfc0bc3b30bcabb48a814942e..d26f52df6dc797d34cea227251e913134c0f3c70 100644 --- a/app/code/Magento/Bundle/view/frontend/email/order/items/creditmemo/default.phtml +++ b/app/code/Magento/Bundle/view/frontend/email/order/items/creditmemo/default.phtml @@ -71,7 +71,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -80,17 +80,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -98,7 +98,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -111,24 +111,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -136,7 +136,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/email/order/items/invoice/default.phtml b/app/code/Magento/Bundle/view/frontend/email/order/items/invoice/default.phtml index a35c9eed37f83fc8008835dc80a9c60a85285c8a..6972582d2673dd8a3ab51b0f452affacfa51bede 100644 --- a/app/code/Magento/Bundle/view/frontend/email/order/items/invoice/default.phtml +++ b/app/code/Magento/Bundle/view/frontend/email/order/items/invoice/default.phtml @@ -72,7 +72,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -81,17 +81,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -99,7 +99,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -112,24 +112,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -137,7 +137,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/email/order/items/order/default.phtml b/app/code/Magento/Bundle/view/frontend/email/order/items/order/default.phtml index a974ecd5ddc89db914c66093f976649c79aceb8d..c09c133e5e3e03554fd2e49aacba10a81d46c375 100644 --- a/app/code/Magento/Bundle/view/frontend/email/order/items/order/default.phtml +++ b/app/code/Magento/Bundle/view/frontend/email/order/items/order/default.phtml @@ -72,7 +72,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -81,17 +81,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -99,7 +99,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -112,24 +112,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -137,7 +137,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_prices.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_prices.xml new file mode 100644 index 0000000000000000000000000000000000000000..394956881f61ea92df27f3032099873f9b454b15 --- /dev/null +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_prices.xml @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="render.product.prices"> + <arguments> + <argument name="bundle" xsi:type="array"> + <item name="prices" xsi:type="array"> + <item name="tier_price" xsi:type="array"> + <item name="render_template" xsi:type="string">Magento_Bundle::product/price/tier_prices.phtml</item> + </item> + <item name="final_price" xsi:type="array"> + <item name="render_class" xsi:type="string">Magento\Bundle\Pricing\Render\FinalPriceBox</item> + <item name="render_template" xsi:type="string">Magento_Bundle::product/price/final_price.phtml</item> + </item> + <item name="bundle_option" xsi:type="array"> + <item name="amount_render_template" xsi:type="string">Magento_Bundle::product/price/selection/amount.phtml</item> + </item> + </item> + </argument> + </arguments> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml index 7a0f899dc976a47230f55b76f2cfbda23d964e54..8066d67661cb63afa1f57e53dd56f8d9611b0be4 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -61,9 +61,8 @@ <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox" name="product.info.bundle.options.checkbox" as="checkbox"/> </block> </referenceBlock> + <move element="product.price.tier" destination="product.info.options.wrapper.bottom" before="-" /> <referenceBlock name="product.info.options.wrapper.bottom"> - <remove name="product.tierprices"/> - <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.tierprices" as="tierprices" before="-" template="Magento_Bundle::catalog/product/view/tierprices.phtml"/> <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.qtyincrements" before="-" template="qtyincrements.phtml"/> <block class="Magento\Bundle\Block\Catalog\Product\View" name="bundle.back.button" as="backButton" after="-" template="catalog/product/view/backbutton.phtml"/> <action method="unsetChild"> diff --git a/app/code/Magento/Bundle/view/frontend/product/price/final_price.phtml b/app/code/Magento/Bundle/view/frontend/product/price/final_price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..cf1c4291df141a672d54aff9141bcb177f39795c --- /dev/null +++ b/app/code/Magento/Bundle/view/frontend/product/price/final_price.phtml @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var \Magento\Bundle\Pricing\Render\FinalPriceBox $this */ +$productId = $this->getSaleableItem()->getId(); +/** @var \Magento\Bundle\Pricing\Price\FinalPrice $finalPriceModel */ +$finalPriceModel = $this->getPrice(); +?> +<?php +if (isset($_GET['showmeprice'])) { + echo 'Regular Price :' . $this->getPriceType('regular_price')->getValue() . "<br />"; + echo 'Special Price :' . $this->getPriceType('special_price')->getValue(). "<br />"; + echo 'Group Price :' . $this->getPriceType('group_price')->getValue(). "<br />"; + echo 'Catalog Rule Price :' . $this->getPriceType('catalog_rule_price')->getValue(). "<br />"; + echo 'Tier Price :' . $this->getPriceType('tier_price')->getValue(). "<br />"; + echo 'Base Price :' . $this->getPriceType('base_price')->getValue(). "<br />"; + echo 'Final Price :' . $finalPriceModel->getValue(). "<br />"; + echo "<br />"; +} +?> +<?php if ($this->getSaleableItem()->getPriceView()): ?> + <p class="minimal-price"> + <?php echo $this->renderAmount($finalPriceModel->getAmount(), [ + 'display_label' => __('As low as'), + 'price_id' => $this->getPriceId('from-'), + 'include_container' => true + ]); ?> + </p> +<?php else: ?> + <?php if ($this->showRangePrice()): ?> + <p class="price-from"> + <?php echo $this->renderAmount($finalPriceModel->getAmount(), [ + 'display_label' => __('From:'), + 'price_id' => $this->getPriceId('from-'), + 'include_container' => true + ]); ?> + </p> + <p class="price-to"> + <?php echo $this->renderAmount($finalPriceModel->getMaximalPrice(), [ + 'display_label' => __('To:'), + 'price_id' => $this->getPriceId('to-'), + 'include_container' => true + ]); ?> + </p> + <?php else: ?> + <?php echo $this->renderAmount($finalPriceModel->getAmount(), [ + 'price_id' => $this->getPriceId('product-price-'), + 'include_container' => true + ]); ?> + <?php endif ?> +<?php endif ?> diff --git a/app/code/Magento/Cms/view/adminhtml/js/tiny_mce_form_submit.js b/app/code/Magento/Bundle/view/frontend/product/price/selection/amount.phtml similarity index 77% rename from app/code/Magento/Cms/view/adminhtml/js/tiny_mce_form_submit.js rename to app/code/Magento/Bundle/view/frontend/product/price/selection/amount.phtml index 31cee45a0e85f8843787f6b660f03d95360af8b5..36fae4d5bb3632eb62ecfc91c5f9e996a508f658 100644 --- a/app/code/Magento/Cms/view/adminhtml/js/tiny_mce_form_submit.js +++ b/app/code/Magento/Bundle/view/frontend/product/price/selection/amount.phtml @@ -1,3 +1,4 @@ +<?php /** * Magento * @@ -17,19 +18,11 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Cms * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +?> -/** - * Fix for issue MAGETWO-8415 - */ -(function($) { - $(document).ready(function() { - $(document).on("beforeSubmit", function(event) { - return event.target.submit(); - }); - }); -})( jQuery ); +<?php /** @var \Magento\Pricing\Render\Amount $this */ ?> + +<?php echo $this->convertAndFormatCurrency($this->getDisplayValue(), (bool) $this->getIncludeContainer()) ?> diff --git a/app/code/Magento/Bundle/view/frontend/product/price/tier_prices.phtml b/app/code/Magento/Bundle/view/frontend/product/price/tier_prices.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a5976ae1742f7108e91484b4a19b15adddf84bb5 --- /dev/null +++ b/app/code/Magento/Bundle/view/frontend/product/price/tier_prices.phtml @@ -0,0 +1,45 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var \Magento\Pricing\Render\PriceBox $this */ + +/** @var \Magento\Bundle\Pricing\Price\TierPrice $tierPriceModel */ +$tierPriceModel = $this->getPrice(); +$tierPrices = $tierPriceModel->getTierPriceList(); +?> +<?php if (count($tierPrices)) : ?> + <ul class="<?php echo ($this->hasListClass() ? $this->getListClass() : 'prices tier items'); ?>"> + <?php foreach ($tierPrices as $index => $price) : ?> + <li class="item"> + <?php echo __( + 'Buy %1 with %2 discount each', + $price['price_qty'], + '<strong class="benefit">' . $price['price']->getBaseAmount() . '%</strong>' + ); ?> + </li> + <?php endforeach; ?> + </ul> +<?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml index 78db0fa8dab85a53db893a25b1fda515141b60d6..209d6a4c6a3fffcef492788d34ca75eda95567cc 100644 --- a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml +++ b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml @@ -47,15 +47,15 @@ $_priceModel = $_product->getPriceModel() <?php if ($_product->getPriceType() == 1) { $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmount($_product); - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(0, 1, 4))) { + if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))) { $_minimalPriceTax += $_weeeTaxAmount; $_minimalPriceInclTax += $_weeeTaxAmount; } - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)) { + if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)) { $_minimalPriceInclTax += $_weeeTaxAmount; } - if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1,2,4))) { + if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1,2,4))) { $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); } } @@ -70,10 +70,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -91,10 +91,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -106,7 +106,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> @@ -120,10 +120,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -141,10 +141,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -156,7 +156,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> @@ -165,11 +165,11 @@ if ($_product->getPriceType() == 1) { <?php $_maximalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_maximalPrice, true); ?> <?php if ($_product->getPriceType() == 1) { - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(0, 1, 4))) { + if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))) { $_maximalPriceTax += $_weeeTaxAmount; $_maximalPriceInclTax += $_weeeTaxAmount; } - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)) { + if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)) { $_maximalPriceInclTax += $_weeeTaxAmount; } } @@ -181,10 +181,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -202,10 +202,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -217,7 +217,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> @@ -228,10 +228,10 @@ if ($_product->getPriceType() == 1) { <span class="label"><?php echo __('Excl. Tax:') ?></span> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -249,10 +249,10 @@ if ($_product->getPriceType() == 1) { </span> <?php else: ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> <span class="weee">(<small> <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(2, 4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> <?php else: ?> <?php $amount = $_weeeTaxAttribute->getAmount(); ?> @@ -264,7 +264,7 @@ if ($_product->getPriceType() == 1) { <?php endforeach; ?> </small>)</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2) && $_weeeTaxAmount): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml b/app/code/Magento/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml index 4c250cd3cf9f42171156d84c5f2b4c5755f0bd37..228452c8d6ec8fc0d82fc3b807e9c143171bba35 100644 --- a/app/code/Magento/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml @@ -62,22 +62,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -87,17 +87,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -106,7 +106,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -119,23 +119,23 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -144,17 +144,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -163,7 +163,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total Incl. Tax'); ?>:<br/> <?php echo $this->getOrder()->formatPrice($_incl + $this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -188,21 +188,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -212,19 +212,19 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> </small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -233,7 +233,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -246,11 +246,11 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php echo $this->getOrder()->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> @@ -289,10 +289,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> diff --git a/app/code/Magento/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml b/app/code/Magento/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml index 23e98f802b6811db53d3d485137731b33ec0fee2..ed7cabf377b814f633132a4e7e4cf26da18def13 100644 --- a/app/code/Magento/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml @@ -61,21 +61,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -85,17 +85,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -104,7 +104,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -117,23 +117,23 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -142,17 +142,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -161,7 +161,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -186,21 +186,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -209,17 +209,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -228,7 +228,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -241,22 +241,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -265,17 +265,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -284,7 +284,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> @@ -309,10 +309,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> diff --git a/app/code/Magento/Bundle/view/frontend/sales/order/items/renderer.phtml b/app/code/Magento/Bundle/view/frontend/sales/order/items/renderer.phtml index 434dccfdc634d829c44677d805dd97e3890792d9..cd209a7e22f3abc60e70c9f8578b239582cb82ca 100644 --- a/app/code/Magento/Bundle/view/frontend/sales/order/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/frontend/sales/order/items/renderer.phtml @@ -62,21 +62,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -86,17 +86,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -104,7 +104,7 @@ </small> <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -117,22 +117,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -142,17 +142,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -160,7 +160,7 @@ </small> <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -199,21 +199,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -223,17 +223,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -242,7 +242,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -255,22 +255,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -281,17 +281,17 @@ <span class="cart tax info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -300,7 +300,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total Incl. Tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> @@ -330,10 +330,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> diff --git a/app/code/Magento/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml b/app/code/Magento/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml index 06e586f9b6782e4befa5616d88b616eb4dfdf6ca..e46474d0e1cd5ba2dd23d8e6362d381857be8339 100644 --- a/app/code/Magento/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml +++ b/app/code/Magento/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml @@ -81,10 +81,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> diff --git a/app/code/Magento/Captcha/Controller/Refresh.php b/app/code/Magento/Captcha/Controller/Refresh.php index de4bd0e22b476c40704db1759c17474ff843cd77..e54f1102ee423f1e99835a14643231e1bcccaac7 100644 --- a/app/code/Magento/Captcha/Controller/Refresh.php +++ b/app/code/Magento/Captcha/Controller/Refresh.php @@ -30,7 +30,7 @@ namespace Magento\Captcha\Controller; * * @author Magento Core Team <core@magentocommerce.com> */ -class Refresh extends \Magento\App\Action\Action +class Refresh extends \Magento\Framework\App\Action\Action { /** * Refreshes captcha and returns JSON encoded URL to image (AJAX action) diff --git a/app/code/Magento/Captcha/Helper/Adminhtml/Data.php b/app/code/Magento/Captcha/Helper/Adminhtml/Data.php index 6fbe0ab7feebad13c6f02ebd173752bae2c4fcbc..a05107fe189a7865f2178de69a72ec11f0849344 100644 --- a/app/code/Magento/Captcha/Helper/Adminhtml/Data.php +++ b/app/code/Magento/Captcha/Helper/Adminhtml/Data.php @@ -41,18 +41,18 @@ class Data extends \Magento\Captcha\Helper\Data protected $_backendConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManager $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Captcha\Model\CaptchaFactory $factory * @param \Magento\Backend\App\ConfigInterface $backendConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManager $storeManager, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Captcha\Model\CaptchaFactory $factory, \Magento\Backend\App\ConfigInterface $backendConfig ) { @@ -65,7 +65,7 @@ class Data extends \Magento\Captcha\Helper\Data * * @param string $key The last part of XML_PATH_$area_CAPTCHA_ constant (case insensitive) * @param \Magento\Store\Model\Store $store - * @return \Magento\App\Config\Element + * @return \Magento\Framework\App\Config\Element */ public function getConfig($key, $store = null) { diff --git a/app/code/Magento/Captcha/Helper/Data.php b/app/code/Magento/Captcha/Helper/Data.php index 2d61edb054b999b78738f172f1fbc0070ad786a2..198d8ef02466b6c96039d75272555f1427c60e47 100644 --- a/app/code/Magento/Captcha/Helper/Data.php +++ b/app/code/Magento/Captcha/Helper/Data.php @@ -28,7 +28,7 @@ namespace Magento\Captcha\Helper; /** * Captcha image model */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Used for "name" attribute of captcha's input field @@ -62,12 +62,12 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_captcha = array(); /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -82,17 +82,17 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_factory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Captcha\Model\CaptchaFactory $factory */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Captcha\Model\CaptchaFactory $factory ) { $this->_storeManager = $storeManager; @@ -128,7 +128,7 @@ class Data extends \Magento\App\Helper\AbstractHelper * * @param string $key The last part of XML_PATH_$area_CAPTCHA_ constant (case insensitive) * @param \Magento\Store\Model\Store $store - * @return \Magento\App\Config\Element + * @return \Magento\Framework\App\Config\Element */ public function getConfig($key, $store = null) { @@ -152,7 +152,7 @@ class Data extends \Magento\App\Helper\AbstractHelper $fontsConfig = $this->_config->getValue(\Magento\Captcha\Helper\Data::XML_PATH_CAPTCHA_FONTS, 'default'); $fonts = array(); if ($fontsConfig) { - $libDir = $this->_filesystem->getPath(\Magento\App\Filesystem::LIB_DIR); + $libDir = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::LIB_DIR); foreach ($fontsConfig as $fontName => $fontConfig) { $fonts[$fontName] = array( 'label' => $fontConfig['label'], @@ -171,7 +171,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getImgDir($website = null) { - $mediaDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $mediaDir = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $captchaDir = '/captcha/' . $this->_getWebsiteCode($website); $mediaDir->create($captchaDir); $mediaDir->changePermissions($captchaDir, 0775); @@ -199,7 +199,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function getImgUrl($website = null) { return $this->_storeManager->getStore()->getBaseUrl( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ) . 'captcha' . '/' . $this->_getWebsiteCode( $website ) . '/'; diff --git a/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php b/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php index 3a9a82081a17b094896aa225772ea334c00e901a..85838a653109a53b765d4212f737804a0fa16a50 100644 --- a/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php +++ b/app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Model\Config\Form; -abstract class AbstractForm extends \Magento\App\Config\Value implements \Magento\Option\ArrayInterface +abstract class AbstractForm extends \Magento\Framework\App\Config\Value implements \Magento\Option\ArrayInterface { /** * @var string diff --git a/app/code/Magento/Captcha/Model/Cron.php b/app/code/Magento/Captcha/Model/Cron.php index c7074996c266ca8a91de3e51c86fc15a798cfa8c..df930c53575511034a6b132b8f4615fefd197862 100644 --- a/app/code/Magento/Captcha/Model/Cron.php +++ b/app/code/Magento/Captcha/Model/Cron.php @@ -63,20 +63,20 @@ class Cron * @param Resource\LogFactory $resLogFactory * @param \Magento\Captcha\Helper\Data $helper * @param \Magento\Captcha\Helper\Adminhtml\Data $adminHelper - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Store\Model\StoreManager $storeManager */ public function __construct( Resource\LogFactory $resLogFactory, \Magento\Captcha\Helper\Data $helper, \Magento\Captcha\Helper\Adminhtml\Data $adminHelper, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Store\Model\StoreManager $storeManager ) { $this->_resLogFactory = $resLogFactory; $this->_helper = $helper; $this->_adminHelper = $adminHelper; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Captcha/Model/Observer.php b/app/code/Magento/Captcha/Model/Observer.php index 3ede80442b71093737f8111967563319ef2b4a2a..49cf28dba83a84262ed94c3a3ad93fc7b8be583a 100644 --- a/app/code/Magento/Captcha/Model/Observer.php +++ b/app/code/Magento/Captcha/Model/Observer.php @@ -61,7 +61,7 @@ class Observer protected $_coreData; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -81,7 +81,7 @@ class Observer protected $_resLogFactory; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; @@ -91,7 +91,7 @@ class Observer protected $messageManager; /** - * @var \Magento\App\Response\RedirectInterface + * @var \Magento\Framework\App\Response\RedirectInterface */ protected $redirect; @@ -103,10 +103,10 @@ class Observer * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Captcha\Helper\Data $helper * @param \Magento\UrlInterface $urlManager - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\Message\ManagerInterface $messageManager - * @param \Magento\App\Response\RedirectInterface $redirect + * @param \Magento\Framework\App\Response\RedirectInterface $redirect * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -118,10 +118,10 @@ class Observer \Magento\Customer\Helper\Data $customerData, \Magento\Captcha\Helper\Data $helper, \Magento\UrlInterface $urlManager, - \Magento\App\RequestInterface $request, - \Magento\App\ActionFlag $actionFlag, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Message\ManagerInterface $messageManager, - \Magento\App\Response\RedirectInterface $redirect + \Magento\Framework\App\Response\RedirectInterface $redirect ) { $this->_resLogFactory = $resLogFactory; $this->_session = $session; @@ -147,11 +147,11 @@ class Observer $formId = 'user_forgotpassword'; $captchaModel = $this->_helper->getCaptcha($formId); if ($captchaModel->isRequired()) { - /** @var \Magento\App\Action\Action $controller */ + /** @var \Magento\Framework\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA')); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->redirect->redirect($controller->getResponse(), '*/*/forgotpassword'); } } @@ -169,11 +169,11 @@ class Observer $formId = 'contact_us'; $captcha = $this->_helper->getCaptcha($formId); if ($captcha->isRequired()) { - /** @var \Magento\App\Action\Action $controller */ + /** @var \Magento\Framework\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captcha->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA.')); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->redirect->redirect($controller->getResponse(), 'contact/index/index'); } } @@ -196,7 +196,7 @@ class Observer $word = $this->_getCaptchaString($controller->getRequest(), $formId); if (!$captchaModel->isCorrect($word)) { $this->messageManager->addError(__('Incorrect CAPTCHA')); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->setUsername($login); $beforeUrl = $this->_session->getBeforeAuthUrl(); $url = $beforeUrl ? $beforeUrl : $this->_customerData->getLoginUrl(); @@ -218,11 +218,11 @@ class Observer $formId = 'user_create'; $captchaModel = $this->_helper->getCaptcha($formId); if ($captchaModel->isRequired()) { - /** @var \Magento\App\Action\Action $controller */ + /** @var \Magento\Framework\App\Action\Action $controller */ $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->messageManager->addError(__('Incorrect CAPTCHA')); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_session->setCustomerFormData($controller->getRequest()->getPost()); $url = $this->_urlManager->getUrl('*/*/create', array('_nosecret' => true)); $controller->getResponse()->setRedirect($this->redirect->error($url)); @@ -246,7 +246,7 @@ class Observer if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $result = array('error' => 1, 'message' => __('Incorrect CAPTCHA')); $controller->getResponse()->setBody($this->_coreData->jsonEncode($result)); } @@ -270,7 +270,7 @@ class Observer if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $result = array('error' => 1, 'message' => __('Incorrect CAPTCHA')); $controller->getResponse()->setBody($this->_coreData->jsonEncode($result)); } @@ -319,7 +319,7 @@ class Observer if ($captchaModel->isRequired()) { if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { $this->_session->setEmail((string)$controller->getRequest()->getPost('email')); - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->messageManager->addError(__('Incorrect CAPTCHA')); $controller->getResponse()->setRedirect( $controller->getUrl('*/*/forgotpassword', array('_nosecret' => true)) @@ -355,11 +355,11 @@ class Observer /** * Get Captcha String * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $formId * @return string */ - protected function _getCaptchaString(\Magento\App\RequestInterface $request, $formId) + protected function _getCaptchaString(\Magento\Framework\App\RequestInterface $request, $formId) { $captchaParams = $request->getPost(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE); return isset($captchaParams[$formId]) ? $captchaParams[$formId] : ''; diff --git a/app/code/Magento/Captcha/Model/Resource/Log.php b/app/code/Magento/Captcha/Model/Resource/Log.php index b291cf70ec44013552d60324229b6ec910513ac3..1e82707006aab30e38d0cc129e0f66c04863ce8e 100644 --- a/app/code/Magento/Captcha/Model/Resource/Log.php +++ b/app/code/Magento/Captcha/Model/Resource/Log.php @@ -55,12 +55,12 @@ class Log extends \Magento\Model\Resource\Db\AbstractDb protected $_remoteAddress; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $coreDate * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $coreDate, \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress ) { diff --git a/app/code/Magento/Captcha/etc/adminhtml/routes.xml b/app/code/Magento/Captcha/etc/adminhtml/routes.xml index 31a933e7a48544a91e4e1bc4d4d9c10cb7a59bfb..087af2f92d145f50969cbcf46b31170e35596552 100644 --- a/app/code/Magento/Captcha/etc/adminhtml/routes.xml +++ b/app/code/Magento/Captcha/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Captcha" /> diff --git a/app/code/Magento/Captcha/etc/frontend/routes.xml b/app/code/Magento/Captcha/etc/frontend/routes.xml index 54c0f145ad648cf148ca831bcd28580d1f2a78c9..d655defad2e29967160c690cad4fe782b832c39a 100644 --- a/app/code/Magento/Captcha/etc/frontend/routes.xml +++ b/app/code/Magento/Captcha/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="captcha" frontName="captcha"> <module name="Magento_Captcha" /> diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index b8a174fff7da378cae49e34e2c1602716705bdb2..a667aaeaa6a2d6ca4b7d0195263eb8f7c650fe76 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -50,20 +50,34 @@ class AbstractCategory extends \Magento\Backend\Block\Template */ protected $_categoryTree; + /** + * @var \Magento\Catalog\Model\CategoryFactory + */ + protected $_categoryFactory; + + /** + * @var bool + */ + protected $_withProductCount; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree * @param \Magento\Registry $registry + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Registry $registry, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array() ) { $this->_categoryTree = $categoryTree; $this->_coreRegistry = $registry; + $this->_categoryFactory = $categoryFactory; + $this->_withProductCount = true; parent::__construct($context, $data); } @@ -171,6 +185,41 @@ class AbstractCategory extends \Magento\Backend\Block\Template return $root; } + /** + * @return int + */ + protected function _getDefaultStoreId() + { + return \Magento\Store\Model\Store::DEFAULT_STORE_ID; + } + + /** + * @return \Magento\Model\Resource\Db\Collection\AbstractCollection + */ + public function getCategoryCollection() + { + $storeId = $this->getRequest()->getParam('store', $this->_getDefaultStoreId()); + $collection = $this->getData('category_collection'); + if (is_null($collection)) { + $collection = $this->_categoryFactory->create()->getCollection(); + + $collection->addAttributeToSelect( + 'name' + )->addAttributeToSelect( + 'is_active' + )->setProductStoreId( + $storeId + )->setLoadProductCount( + $this->_withProductCount + )->setStoreId( + $storeId + ); + + $this->setData('category_collection', $collection); + } + return $collection; + } + /** * Get and register categories root by specified categories IDs * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php index ec14a87ebc6e511de05091c02ad695fdb4769156..154a99a826af725c51f96c62e45764c73ce11954 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php @@ -59,17 +59,19 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree * @param \Magento\Registry $registry + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory, * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Registry $registry, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Json\EncoderInterface $jsonEncoder, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; - parent::__construct($context, $categoryTree, $registry, $data); + parent::__construct($context, $categoryTree, $registry, $categoryFactory, $data); } /** @@ -95,11 +97,11 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory ); // Save button - if (!$category->isReadonly()) { - $this->addChild( - 'save_button', - 'Magento\Backend\Block\Widget\Button', + if (!$category->isReadonly() && $this->hasStoreRootCategory()) { + $this->addButton( + 'save', array( + 'id' => 'save', 'label' => __('Save Category'), 'onclick' => "categorySubmit('" . $this->getSaveUrl() . "', true)", 'class' => 'save primary save-category' @@ -108,11 +110,11 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory } // Delete button - if (!in_array($categoryId, $this->getRootIds()) && $category->isDeleteable()) { - $this->addChild( - 'delete_button', - 'Magento\Backend\Block\Widget\Button', + if ($categoryId && !in_array($categoryId, $this->getRootIds()) && $category->isDeleteable()) { + $this->addButton( + 'delete', array( + 'id' => 'delete', 'label' => __('Delete Category'), 'onclick' => "categoryDelete('" . $this->getUrl( 'catalog/*/delete', @@ -124,12 +126,12 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory } // Reset button - if (!$category->isReadonly()) { + if (!$category->isReadonly() && $this->hasStoreRootCategory()) { $resetPath = $categoryId ? 'catalog/*/edit' : 'catalog/*/add'; - $this->addChild( - 'reset_button', - 'Magento\Backend\Block\Widget\Button', + $this->addButton( + 'reset', array( + 'id' => 'reset', 'label' => __('Reset'), 'onclick' => "categoryReset('" . $this->getUrl($resetPath, array('_current' => true)) . "',true)", 'class' => 'reset' @@ -158,6 +160,7 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string + * @deprecated */ public function getDeleteButtonHtml() { @@ -166,6 +169,7 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string + * @deprecated */ public function getSaveButtonHtml() { @@ -177,6 +181,7 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory /** * @return string + * @deprecated */ public function getResetButtonHtml() { @@ -212,11 +217,16 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory if (isset($config['name'])) { $config['element_name'] = $config['name']; } - $this->setChild( - $alias . '_button', - $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->addData($config) - ); - $this->_additionalButtons[$alias] = $alias . '_button'; + if ($this->hasToolbarBlock()) { + $this->addButton($alias, $config); + } else { + $this->setChild( + $alias . '_button', + $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->addData($config) + ); + $this->_additionalButtons[$alias] = $alias . '_button'; + } + return $this; } @@ -307,4 +317,47 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory { return $this->_request->isXmlHttpRequest() || $this->_request->getParam('isAjax'); } + + /** + * Add button block as a child block or to global Page Toolbar block if available + * + * @param string $buttonId + * @param array $data + * @return $this + */ + protected function addButton($buttonId, array $data) + { + $childBlockId = $buttonId . '_button'; + $button = $this->getButtonChildBlock($childBlockId); + $button->setData($data); + $block = $this->getLayout()->getBlock('page.actions.toolbar'); + if ($block) { + $block->setChild($childBlockId, $button); + } else { + $this->setChild($childBlockId, $button); + } + } + + /** + * @return bool + */ + protected function hasToolbarBlock() + { + return $this->getLayout()->isBlock('page.actions.toolbar'); + } + + /** + * Adding child block with specified child's id. + * + * @param string $childId + * @param null|string $blockClassName + * @return \Magento\Backend\Block\Widget + */ + protected function getButtonChildBlock($childId, $blockClassName = null) + { + if (null === $blockClassName) { + $blockClassName = 'Magento\Backend\Block\Widget\Button'; + } + return $this->getLayout()->createBlock($blockClassName, $this->getNameInLayout() . '-' . $childId); + } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php index 17343d2db2dce97fd8ea068bffadfe0c162d1afe..8868d45b9cb6e110bb314bdc78b151f4bc9fd8cc 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php @@ -158,27 +158,32 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended $this->addColumn( 'in_category', array( - 'header_css_class' => 'a-center', 'type' => 'checkbox', 'name' => 'in_category', 'values' => $this->_getSelectedProducts(), - 'align' => 'center', - 'index' => 'entity_id' + 'index' => 'entity_id', + 'header_css_class' => 'col-select col-massaction', + 'column_css_class' => 'col-select col-massaction' ) ); } $this->addColumn( 'entity_id', - array('header' => __('ID'), 'sortable' => true, 'width' => '60', 'index' => 'entity_id') + array( + 'header' => __('ID'), + 'sortable' => true, + 'index' => 'entity_id', + 'header_css_class' => 'col-id', + 'column_css_class' => 'col-id' + ) ); $this->addColumn('name', array('header' => __('Name'), 'index' => 'name')); - $this->addColumn('sku', array('header' => __('SKU'), 'width' => '80', 'index' => 'sku')); + $this->addColumn('sku', array('header' => __('SKU'), 'index' => 'sku')); $this->addColumn( 'price', array( 'header' => __('Price'), 'type' => 'currency', - 'width' => '1', 'currency_code' => (string)$this->_scopeConfig->getValue( \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE @@ -190,7 +195,6 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended 'position', array( 'header' => __('Position'), - 'width' => '1', 'type' => 'number', 'index' => 'position', 'editable' => !$this->getCategory()->getProductsReadonly() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index dd9edacbb23ef52349e4d5ca4c9331945c34241c..011cc9215bbde122601d63d6e075c6b0750482d8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -39,21 +39,11 @@ use Magento\Data\Tree\Node; class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory { - /** - * @var bool - */ - protected $_withProductCount; - /** * @var string */ protected $_template = 'catalog/category/tree.phtml'; - /** - * @var \Magento\Catalog\Model\CategoryFactory - */ - protected $_categoryFactory; - /** * @var \Magento\Backend\Model\Auth\Session */ @@ -73,27 +63,26 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree * @param \Magento\Registry $registry + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\DB\Helper $resourceHelper * @param \Magento\Backend\Model\Auth\Session $backendSession - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, \Magento\Registry $registry, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Json\EncoderInterface $jsonEncoder, \Magento\DB\Helper $resourceHelper, \Magento\Backend\Model\Auth\Session $backendSession, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array() ) { $this->_jsonEncoder = $jsonEncoder; $this->_resourceHelper = $resourceHelper; $this->_backendSession = $backendSession; - $this->_categoryFactory = $categoryFactory; - parent::__construct($context, $categoryTree, $registry, $data); + parent::__construct($context, $categoryTree, $registry, $categoryFactory, $data); } /** @@ -102,8 +91,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory protected function _construct() { parent::_construct(); - $this->setUseAjax(true); - $this->_withProductCount = true; + $this->setUseAjax(0); } /** @@ -141,42 +129,6 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory return parent::_prepareLayout(); } - /** - * @return int - */ - protected function _getDefaultStoreId() - { - return \Magento\Store\Model\Store::DEFAULT_STORE_ID; - } - - /** - * @return Collection - */ - public function getCategoryCollection() - { - $storeId = $this->getRequest()->getParam('store', $this->_getDefaultStoreId()); - $collection = $this->getData('category_collection'); - if (is_null($collection)) { - $collection = $this->_categoryFactory->create()->getCollection(); - - /* @var $collection Collection */ - $collection->addAttributeToSelect( - 'name' - )->addAttributeToSelect( - 'is_active' - )->setProductStoreId( - $storeId - )->setLoadProductCount( - $this->_withProductCount - )->setStoreId( - $storeId - ); - - $this->setData('category_collection', $collection); - } - return $collection; - } - /** * Retrieve list of categories with name containing $namePart and their parents * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php index 361f2b5b028167e6bdeac5871ce27154f27d242e..95887f8fa8353a5cecd4fe1f0b4ce70bad572b31 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php @@ -240,7 +240,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'entity_id', array( 'header' => __('ID'), - 'width' => '50px', 'type' => 'number', 'index' => 'entity_id', 'header_css_class' => 'col-id', @@ -252,9 +251,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended array( 'header' => __('Name'), 'index' => 'name', - 'class' => 'xxx', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' + 'class' => 'xxx' ) ); @@ -275,12 +272,9 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'type', array( 'header' => __('Type'), - 'width' => '60px', 'index' => 'type_id', 'type' => 'options', - 'options' => $this->_type->getOptionArray(), - 'header_css_class' => 'col-type', - 'column_css_class' => 'col-type' + 'options' => $this->_type->getOptionArray() ) ); @@ -292,7 +286,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'set_name', array( 'header' => __('Attribute Set'), - 'width' => '100px', 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets, @@ -305,10 +298,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'sku', array( 'header' => __('SKU'), - 'width' => '80px', - 'index' => 'sku', - 'header_css_class' => 'col-sku', - 'column_css_class' => 'col-sku' + 'index' => 'sku' ) ); @@ -330,11 +320,8 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'qty', array( 'header' => __('Quantity'), - 'width' => '100px', 'type' => 'number', - 'index' => 'qty', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' + 'index' => 'qty' ) ); } @@ -343,7 +330,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'visibility', array( 'header' => __('Visibility'), - 'width' => '70px', 'index' => 'visibility', 'type' => 'options', 'options' => $this->_visibility->getOptionArray(), @@ -356,12 +342,9 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'status', array( 'header' => __('Status'), - 'width' => '70px', 'index' => 'status', 'type' => 'options', - 'options' => $this->_status->getOptionArray(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' + 'options' => $this->_status->getOptionArray() ) ); @@ -370,7 +353,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'websites', array( 'header' => __('Websites'), - 'width' => '100px', 'sortable' => false, 'index' => 'websites', 'type' => 'options', @@ -385,7 +367,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'edit', array( 'header' => __('Edit'), - 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array( diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php index 147dcff7913c9a77895d2abc9cf278adaea6f413..7f0c93a7bb50a5d6d293be899bdc1cf49e5d7f81 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php @@ -24,15 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Catalog\Block\Adminhtml\Product\Helper\Form; + /** * Product form price field helper - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Catalog\Block\Adminhtml\Product\Helper\Form; - class Price extends \Magento\Data\Form\Element\Text { /** @@ -40,7 +36,7 @@ class Price extends \Magento\Data\Form\Element\Text * * @var \Magento\Tax\Helper\Data */ - protected $_taxData = null; + protected $_taxData; /** * @var Magneto_Core_Model_StoreManager @@ -125,9 +121,8 @@ class Price extends \Magento\Data\Form\Element\Text */ protected function _getTaxObservingCode($attribute) { - $spanId = "dynamic-tax-{$attribute->getAttributeCode()}"; - - $html = "<script type='text/javascript'>if (dynamicTaxes == undefined) var dynamicTaxes = new Array(); dynamicTaxes[dynamicTaxes.length]='{$attribute->getAttributeCode()}'</script>"; + $html = "<script type='text/javascript'>if (dynamicTaxes == undefined) var dynamicTaxes = new Array();" + . " dynamicTaxes[dynamicTaxes.length]='{$attribute->getAttributeCode()}'</script>"; return $html; } diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 30db850df32a5b24c6c7e6c2c64bd58028dd6ac6..4d224e5e5975c97daf20d843187e86f1bf97252c 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -68,7 +68,7 @@ class Navigation extends \Magento\View\Element\Template implements \Magento\View /** * Customer session * - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -96,7 +96,7 @@ class Navigation extends \Magento\View\Element\Template implements \Magento\View * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Layer\Category $catalogLayer - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Category $catalogCategory * @param \Magento\Registry $registry * @param \Magento\Catalog\Model\Indexer\Category\Flat\State $flatState @@ -107,7 +107,7 @@ class Navigation extends \Magento\View\Element\Template implements \Magento\View \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Layer\Category $catalogLayer, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Registry $registry, \Magento\Catalog\Model\Indexer\Category\Flat\State $flatState, diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index f264d24d8261ae2de1462fcb86b6094014c8efde..d0802e56f2b6702c313af7990c22e88a4ecd6229 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -36,6 +36,9 @@ namespace Magento\Catalog\Block\Product; use Magento\View\Element\BlockInterface; +/** + * Class AbstractProduct + */ abstract class AbstractProduct extends \Magento\View\Element\Template { /** @@ -258,8 +261,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template { $stockItem = $product->getStockItem(); if ($stockItem) { - return $stockItem->getMinSaleQty() && - $stockItem->getMinSaleQty() > 0 ? $stockItem->getMinSaleQty() * 1 : null; + return $stockItem->getMinSaleQty() + && $stockItem->getMinSaleQty() > 0 ? $stockItem->getMinSaleQty() * 1 : null; } return null; } @@ -304,13 +307,9 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function _preparePriceRenderer($productType) { - return $this->_getPriceBlock( - $productType - )->setTemplate( - $this->_getPriceBlockTemplate($productType) - )->setUseLinkForAsLowAs( - $this->_useLinkForAsLowAs - ); + return $this->_getPriceBlock($productType) + ->setTemplate($this->_getPriceBlockTemplate($productType)) + ->setUseLinkForAsLowAs($this->_useLinkForAsLowAs); } /** @@ -320,34 +319,27 @@ abstract class AbstractProduct extends \Magento\View\Element\Template * @param boolean $displayMinimalPrice * @param string $idSuffix * @return string + * @deprecated */ public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '') { $type_id = $product->getTypeId(); if ($this->_catalogData->canApplyMsrp($product)) { - $realPriceHtml = $this->_preparePriceRenderer( - $type_id - )->setProduct( - $product - )->setDisplayMinimalPrice( - $displayMinimalPrice - )->setIdSuffix( - $idSuffix - )->toHtml(); + $realPriceHtml = $this->_preparePriceRenderer($type_id) + ->setProduct($product) + ->setDisplayMinimalPrice($displayMinimalPrice) + ->setIdSuffix($idSuffix) + ->toHtml(); $product->setAddToCartUrl($this->getAddToCartUrl($product)); $product->setRealPriceHtml($realPriceHtml); $type_id = $this->_mapRenderer; } - return $this->_preparePriceRenderer( - $type_id - )->setProduct( - $product - )->setDisplayMinimalPrice( - $displayMinimalPrice - )->setIdSuffix( - $idSuffix - )->toHtml(); + return $this->_preparePriceRenderer($type_id) + ->setProduct($product) + ->setDisplayMinimalPrice($displayMinimalPrice) + ->setIdSuffix($idSuffix) + ->toHtml(); } /** @@ -419,13 +411,10 @@ abstract class AbstractProduct extends \Magento\View\Element\Template if (is_null($product)) { $product = $this->getProduct(); } - return $this->_getPriceBlock( - $product->getTypeId() - )->setTemplate( - $this->getTierPriceTemplate() - )->setProduct( - $product - )->toHtml(); + return $this->_getPriceBlock($product->getTypeId()) + ->setTemplate($this->getTierPriceTemplate()) + ->setProduct($product) + ->toHtml(); } /** @@ -433,6 +422,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template * * @param \Magento\Catalog\Model\Product $product * @return array + * + * @deprecated see \Magento\Catalog\Pricing\Price\TierPrice */ public function getTierPrices($product = null) { @@ -446,19 +437,19 @@ abstract class AbstractProduct extends \Magento\View\Element\Template foreach ($prices as $price) { $price['price_qty'] = $price['price_qty'] * 1; - $_productPrice = $product->getPrice(); - if ($_productPrice != $product->getFinalPrice()) { - $_productPrice = $product->getFinalPrice(); + $productPrice = $product->getPrice(); + if ($productPrice != $product->getFinalPrice()) { + $productPrice = $product->getFinalPrice(); } // Group price must be used for percent calculation if it is lower $groupPrice = $product->getGroupPrice(); - if ($_productPrice > $groupPrice) { - $_productPrice = $groupPrice; + if ($productPrice > $groupPrice) { + $productPrice = $groupPrice; } - if ($price['price'] < $_productPrice) { - $price['savePercent'] = ceil(100 - 100 / $_productPrice * $price['price']); + if ($price['price'] < $productPrice) { + $price['savePercent'] = ceil(100 - ((100 / $productPrice) * $price['price'])); $tierPrice = $this->_storeManager->getStore()->convertPrice( $this->_taxData->getPrice($product, $price['website_price']) @@ -501,9 +492,12 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ protected function _addProductAttributesAndPrices(\Magento\Catalog\Model\Resource\Product\Collection $collection) { - return $collection->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addAttributeToSelect( - $this->_catalogConfig->getProductAttributes() - )->addUrlRewrite(); + return $collection + ->addMinimalPrice() + ->addFinalPrice() + ->addTaxPercents() + ->addAttributeToSelect($this->_catalogConfig->getProductAttributes()) + ->addUrlRewrite(); } /** @@ -583,7 +577,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template } } - return (int)$this->_getData('column_count'); + return (int) $this->_getData('column_count'); } /** @@ -659,7 +653,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template { $statusInfo = new \Magento\Object(array('display_status' => true)); $this->_eventManager->dispatch('catalog_block_product_status_display', array('status' => $statusInfo)); - return (bool)$statusInfo->getDisplayStatus(); + return (bool) $statusInfo->getDisplayStatus(); } /** @@ -690,7 +684,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getThumbnailUrl($product) { - return (string)$this->_imageHelper->init($product, 'thumbnail')->resize($this->getThumbnailSize()); + return (string) $this->_imageHelper->init($product, 'thumbnail') + ->resize($this->getThumbnailSize()); } /** @@ -711,7 +706,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getThumbnailSidebarUrl($product) { - return (string)$this->_imageHelper->init($product, 'thumbnail')->resize($this->getThumbnailSidebarSize()); + return (string) $this->_imageHelper->init($product, 'thumbnail') + ->resize($this->getThumbnailSidebarSize()); } /** @@ -732,7 +728,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getSmallImageUrl($product) { - return (string)$this->_imageHelper->init($product, 'small_image')->resize($this->getSmallImageSize()); + return (string) $this->_imageHelper->init($product, 'small_image') + ->resize($this->getSmallImageSize()); } /** @@ -753,7 +750,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getSmallImageSidebarUrl($product) { - return (string)$this->_imageHelper->init($product, 'small_image')->resize($this->getSmallImageSidebarSize()); + return (string) $this->_imageHelper->init($product, 'small_image') + ->resize($this->getSmallImageSidebarSize()); } /** @@ -774,7 +772,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getBaseImageUrl($product) { - return (string)$this->_imageHelper->init($product, 'image')->resize($this->getBaseImageSize()); + return (string) $this->_imageHelper->init($product, 'image') + ->resize($this->getBaseImageSize()); } /** @@ -795,7 +794,8 @@ abstract class AbstractProduct extends \Magento\View\Element\Template */ public function getBaseImageIconUrl($product) { - return (string)$this->_imageHelper->init($product, 'image')->resize($this->getBaseImageIconSize()); + return (string) $this->_imageHelper->init($product, 'image') + ->resize($this->getBaseImageIconSize()); } /** @@ -819,4 +819,52 @@ abstract class AbstractProduct extends \Magento\View\Element\Template { return $this->_mathRandom->getRandomString($length, $chars); } + + /** + * Return HTML block with price + * + * @param \Magento\Catalog\Model\Product $product + * @return string + */ + public function getProductPrice(\Magento\Catalog\Model\Product $product) + { + return $this->getProductPriceHtml( + $product, + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + \Magento\Pricing\Render::ZONE_ITEM_LIST + ); + } + + /** + * Return HTML block with tier price + * + * @param \Magento\Catalog\Model\Product $product + * @param string $priceType + * @param string $renderZone + * @param array $arguments + * @return string + */ + public function getProductPriceHtml( + \Magento\Catalog\Model\Product $product, + $priceType, + $renderZone = \Magento\Pricing\Render::ZONE_ITEM_LIST, + array $arguments = [] + ) { + if (!isset($arguments['zone'])) { + $arguments['zone'] = $renderZone; + } + + /** @var \Magento\Pricing\Render $priceRender */ + $priceRender = $this->getLayout()->getBlock('product.price.render.default'); + $price = ''; + + if ($priceRender) { + $price = $priceRender->render( + $priceType, + $product, + $arguments + ); + } + return $price; + } } diff --git a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php index 2889268e017200abe34684fe2ca812091544933f..40ba205477244ea51f7460c525bf265fc62d75ba 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php @@ -24,19 +24,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Catalog products compare block - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> - */ namespace Magento\Catalog\Block\Product\Compare; -use Magento\App\Action\Action; +use Magento\Framework\App\Action\Action; use Magento\Catalog\Model\Product; +/** + * Catalog products compare block + */ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare { /** @@ -75,7 +70,7 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare protected $_mapRenderer = 'msrp_noform'; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -116,7 +111,7 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory * @param Product\Visibility $catalogProductVisibility * @param \Magento\Log\Model\Visitor $logVisitor - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer * @param array $data * @param array $priceBlockTypes @@ -127,7 +122,7 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Log\Model\Visitor $logVisitor, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer, array $data = array(), array $priceBlockTypes = array() @@ -268,4 +263,31 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare $this->_customerId = $id; return $this; } + + /** + * Render price block + * + * @param Product $product + * @param string|null $idSuffix + * @return string + */ + public function getProductPrice(\Magento\Catalog\Model\Product $product, $idSuffix = '') + { + /** @var \Magento\Pricing\Render $priceRender */ + $priceRender = $this->getLayout()->getBlock('product.price.render.default'); + + $price = ''; + if ($priceRender) { + $price = $priceRender->render( + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + $product, + [ + 'price_id' => 'product-price-' . $product->getId() . $idSuffix, + 'display_minimal_price' => true, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_LIST + ] + ); + } + return $price; + } } diff --git a/app/code/Magento/Catalog/Block/Product/Context.php b/app/code/Magento/Catalog/Block/Product/Context.php index 449a29d06ed43afd5163c031aa6974124f75de2c..c590506755d19c845d0d8b47596d32e9befe497f 100644 --- a/app/code/Magento/Catalog/Block/Product/Context.php +++ b/app/code/Magento/Catalog/Block/Product/Context.php @@ -81,28 +81,28 @@ class Context extends \Magento\View\Element\Template\Context protected $reviewRenderer; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder * @param \Magento\TranslateInterface $translator - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\Config\ScopeConfigInterface|\Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface|\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Translate\Inline\StateInterface $inlineTranslation - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\TemplateEnginePool $enginePool - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Registry $registry @@ -119,28 +119,28 @@ class Context extends \Magento\View\Element\Template\Context * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, \Magento\TranslateInterface $translator, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Session\SessionManagerInterface $session, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Translate\Inline\StateInterface $inlineTranslation, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem, \Magento\View\TemplateEnginePool $enginePool, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Registry $registry, diff --git a/app/code/Magento/Catalog/Block/Product/Gallery.php b/app/code/Magento/Catalog/Block/Product/Gallery.php index 1c2254ecee6b21bb11cac0f56e384a308b657a2d..0be7c5f9ddd77ed38e97e47ab8a09aa22dbcc5c8 100644 --- a/app/code/Magento/Catalog/Block/Product/Gallery.php +++ b/app/code/Magento/Catalog/Block/Product/Gallery.php @@ -130,7 +130,7 @@ class Gallery extends \Magento\View\Element\Template { $file = $this->getCurrentImage()->getPath(); - if ($this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR)->isFile($file)) { + if ($this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR)->isFile($file)) { $size = getimagesize($file); if (isset($size[0])) { if ($size[0] > 600) { diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index f3455ebd192aacfb344d908b1eb9552789b3398f..aa69f052671b804a451d33fabfa9cfdbb1d04338 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -24,21 +24,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Product list - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> - */ namespace Magento\Catalog\Block\Product; use Magento\Eav\Model\Entity\Collection\AbstractCollection; -use Magento\View\Element\AbstractBlock; +use Magento\View\Block\IdentityInterface; -class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct implements - \Magento\View\Block\IdentityInterface +/** + * Product list + */ +class ListProduct extends AbstractProduct implements IdentityInterface { /** * Default toolbar block name @@ -72,7 +66,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct impleme * @var \Magento\Core\Helper\PostData */ protected $_postDataHelper; - + /** * @param Context $context * @param \Magento\Core\Helper\PostData $postDataHelper @@ -116,12 +110,9 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct impleme // if this is a product view page if ($this->_coreRegistry->registry('product')) { // get collection of categories this product is associated with - $categories = $this->_coreRegistry->registry( - 'product' - )->getCategoryCollection()->setPage( - 1, - 1 - )->load(); + $categories = $this->_coreRegistry->registry('product') + ->getCategoryCollection()->setPage(1, 1) + ->load(); // if the product is associated with any category if ($categories->count()) { // show products from this category @@ -273,7 +264,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct impleme } /** - * @param array|string|integer|\Magento\App\Config\Element $code + * @param array|string|integer|\Magento\Framework\App\Config\Element $code * @return $this */ public function addAttribute($code) @@ -352,8 +343,40 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct impleme $url = $this->getAddToCartUrl($product); $data = [ 'product' => $product->getEntityId(), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->_postDataHelper->getEncodedUrl($url) + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->_postDataHelper->getEncodedUrl($url) ]; return $this->_postDataHelper->getPostData($url, $data); } + + /** + * @param \Magento\Catalog\Model\Product $product + * @return string + */ + public function getProductPrice(\Magento\Catalog\Model\Product $product) + { + $priceRender = $this->getPriceRender(); + + $price = ''; + if ($priceRender) { + $price = $priceRender->render( + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + $product, + [ + 'include_container' => true, + 'display_minimal_price' => true, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_LIST + ] + ); + } + + return $price; + } + + /** + * @return \Magento\Pricing\Render + */ + protected function getPriceRender() + { + return $this->getLayout()->getBlock('product.price.render.default'); + } } diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index af43ca2166faa951570e5987e505884b1ba3e189..3af03d14ca2a5eae9ada024e286acb2717ce293e 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -46,7 +46,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct implemen protected $_productsCount; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -68,7 +68,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct implemen * @param Context $context * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data * @param array $priceBlockTypes */ @@ -76,7 +76,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct implemen \Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array(), array $priceBlockTypes = array() ) { diff --git a/app/code/Magento/Catalog/Block/Product/Price.php b/app/code/Magento/Catalog/Block/Product/Price.php index 723f8b301386b4d23d2ce9a12a391033f24f628f..301403ac51333ce66ceea7dfcbd1fbe7f91a8b96 100644 --- a/app/code/Magento/Catalog/Block/Product/Price.php +++ b/app/code/Magento/Catalog/Block/Product/Price.php @@ -163,6 +163,7 @@ class Price extends \Magento\View\Element\Template implements \Magento\View\Bloc * * @param \Magento\Catalog\Model\Product $product * @return array + * @deprecated */ public function getTierPrices($product = null) { diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index 87176446f3086b9d72bb307c8774bb1395155c62..6ae775ea809c7c76bea883fe07d8da3c696fd2ce 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -698,7 +698,7 @@ class Toolbar extends \Magento\View\Element\Template { $postData = $this->_postDataHelper->getPostData( $this->getPagerUrl(), - array(\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getPagerEncodedUrl()) + array(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getPagerEncodedUrl()) ); $options = array( 'modeCookie' => ToolbarModel::MODE_COOKIE_NAME, diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 32c3b020d4ffbf1b25baa5c390e1179cfabbeec6..237f6814b02f25d2f84cc95d36164965c6f9075f 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -28,12 +28,13 @@ namespace Magento\Catalog\Block\Product; /** * Product View block */ -class View extends \Magento\Catalog\Block\Product\AbstractProduct implements \Magento\View\Block\IdentityInterface +class View extends AbstractProduct implements \Magento\View\Block\IdentityInterface { /** * Default MAP renderer type * * @var string + * @deprecated */ protected $_mapRenderer = 'msrp_item'; @@ -156,13 +157,11 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct implements \Ma $headBlock->setDescription($this->string->substr($product->getDescription(), 0, 255)); } //@todo: move canonical link to separate block - if ($this->_productHelper->canUseCanonicalTag() && !$headBlock->getChildBlock( - 'magento-page-head-product-canonical-link' - ) - ) { + $childBlockName = 'magento-page-head-product-canonical-link'; + if ($this->_productHelper->canUseCanonicalTag() && !$headBlock->getChildBlock($childBlockName)) { $params = array('_ignore_category' => true); $headBlock->addChild( - 'magento-page-head-product-canonical-link', + $childBlockName, 'Magento\Theme\Block\Html\Head\Link', array( 'url' => $product->getUrlModel()->getUrl($product, $params), @@ -220,7 +219,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct implements \Ma $additional['wishlist_next'] = 1; } - $addUrlKey = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; + $addUrlKey = \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED; $addUrlValue = $this->_urlBuilder->getUrl('*/*/*', array('_use_rewrite' => true, '_current' => true)); $additional[$addUrlKey] = $this->_coreData->urlEncode($addUrlValue); @@ -250,10 +249,6 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct implements \Ma $_request->setProductClassId($product->getTaxClassId()); $currentTax = $this->_taxCalculation->getRate($_request); - $_regularPrice = $product->getPrice(); - $_finalPrice = $product->getFinalPrice(); - $_priceInclTax = $this->_taxData->getPrice($product, $_finalPrice, true); - $_priceExclTax = $this->_taxData->getPrice($product, $_finalPrice); $_tierPrices = array(); $_tierPricesInclTax = array(); foreach ($product->getTierPrice() as $tierPrice) { @@ -270,10 +265,26 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct implements \Ma 'includeTax' => $this->_taxData->priceIncludesTax() ? 'true' : 'false', 'showIncludeTax' => $this->_taxData->displayPriceIncludingTax(), 'showBothPrices' => $this->_taxData->displayBothPrices(), - 'productPrice' => $this->_coreData->currency($_finalPrice, false, false), - 'productOldPrice' => $this->_coreData->currency($_regularPrice, false, false), - 'priceInclTax' => $this->_coreData->currency($_priceInclTax, false, false), - 'priceExclTax' => $this->_coreData->currency($_priceExclTax, false, false), + 'productPrice' => $this->_coreData->currency( + $product->getPriceInfo()->getPrice('final_price')->getValue(), + false, + false + ), + 'productOldPrice' => $this->_coreData->currency( + $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getBaseAmount(), + false, + false + ), + 'inclTaxPrice' => $this->_coreData->currency( + $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(), + false, + false + ), + 'exclTaxPrice' => $this->_coreData->currency( + $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount(), + false, + false + ), 'defaultTax' => $defaultTax, 'currentTax' => $currentTax, 'idSuffix' => '_clone', diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index ac23001b7bdc4fad0dd2c7380b7e0c9e39f33449..26a4616518adf516e96d927b1f2972d1df015796 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -185,8 +185,8 @@ class Options extends \Magento\View\Element\Template $data['oldPrice'] = $this->_coreData->currency($option->getPrice(false), false, false); $data['priceValue'] = $option->getPrice(false); $data['type'] = $option->getPriceType(); - $data['excludeTax'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], false); - $data['includeTax'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], true); + $data['exclTaxPrice'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], false); + $data['inclTaxPrice'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], true); return $data; } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 4bcd6d19e58fb15d345852ec2099f6a21bef623a..f43e0dbe7c14b5d92681dde1fce55c84313eeb68 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -152,8 +152,6 @@ abstract class AbstractOptions extends \Magento\View\Element\Template return ''; } - $store = $this->getProduct()->getStore(); - $sign = '+'; if ($value['pricing_value'] < 0) { $sign = '-'; @@ -161,25 +159,14 @@ abstract class AbstractOptions extends \Magento\View\Element\Template } $priceStr = $sign; - $_priceInclTax = $this->getPrice($value['pricing_value'], true); - $_priceExclTax = $this->getPrice($value['pricing_value']); - if ($this->_taxData->displayPriceIncludingTax()) { - $priceStr .= $this->_coreHelper->currencyByStore($_priceInclTax, $store, true, $flag); - } elseif ($this->_taxData->displayPriceExcludingTax()) { - $priceStr .= $this->_coreHelper->currencyByStore($_priceExclTax, $store, true, $flag); - } elseif ($this->_taxData->displayBothPrices()) { - $priceStr .= $this->_coreHelper->currencyByStore($_priceExclTax, $store, true, $flag); - if ($_priceInclTax != $_priceExclTax) { - $priceStr .= ' (' . $sign . $this->_coreHelper->currencyByStore( - $_priceInclTax, - $store, - true, - $flag - ) . ' ' . __( - 'Incl. Tax' - ) . ')'; - } - } + + $customOptionPrice = $this->getProduct()->getPriceInfo()->getPrice('custom_option_price'); + $optionAmount = $customOptionPrice->getCustomAmount($value['pricing_value']); + $priceStr .= $this->getLayout()->getBlock('product.price.render.default')->renderAmount( + $optionAmount, + $customOptionPrice, + $this->getProduct() + ); if ($flag) { $priceStr = '<span class="price-notice">' . $priceStr . '</span>'; diff --git a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php index 9d77cf29fc4578d902712e9f1ab3a15b7a7d18f0..c78782c1c54a2063e3a9be02c49b860b7a429e72 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php @@ -27,18 +27,17 @@ namespace Magento\Catalog\Block\Product\Widget; /** * New products widget - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> */ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Magento\Widget\Block\BlockInterface { /** - * Display products type + * Display products type - all products */ const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products'; + /** + * Display products type - new products + */ const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products'; /** @@ -107,16 +106,11 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Ma $collection = $this->_productCollectionFactory->create(); $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds()); - $collection = $this->_addProductAttributesAndPrices( - $collection - )->addStoreFilter()->addAttributeToSort( - 'created_at', - 'desc' - )->setPageSize( - $this->getProductsCount() - )->setCurPage( - 1 - ); + $collection = $this->_addProductAttributesAndPrices($collection) + ->addStoreFilter() + ->addAttributeToSort('created_at', 'desc') + ->setPageSize($this->getProductsCount()) + ->setCurPage(1); return $collection; } @@ -203,21 +197,13 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Ma 'widget.new.product.list.pager' ); - $this->_pager->setUseContainer( - true - )->setShowAmounts( - true - )->setShowPerPage( - false - )->setPageVarName( - self::PAGE_VAR_NAME - )->setLimit( - $this->getProductsPerPage() - )->setTotalLimit( - $this->getProductsCount() - )->setCollection( - $this->getProductCollection() - ); + $this->_pager->setUseContainer(true) + ->setShowAmounts(true) + ->setShowPerPage(false) + ->setPageVarName(self::PAGE_VAR_NAME) + ->setLimit($this->getProductsPerPage()) + ->setTotalLimit($this->getProductsCount()) + ->setCollection($this->getProductCollection()); } if ($this->_pager instanceof \Magento\View\Element\AbstractBlock) { return $this->_pager->toHtml(); @@ -225,4 +211,49 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Ma } return ''; } + + /** + * Return HTML block with price + * + * @param \Magento\Catalog\Model\Product $product + * @param string $priceType + * @param string $renderZone + * @param array $arguments + * @return string + */ + public function getProductPriceHtml( + \Magento\Catalog\Model\Product $product, + $priceType = null, + $renderZone = \Magento\Pricing\Render::ZONE_ITEM_LIST, + array $arguments = [] + ) { + if (!isset($arguments['zone'])) { + $arguments['zone'] = $renderZone; + } + $arguments['zone'] = isset($arguments['zone']) + ? $arguments['zone'] + : $renderZone; + $arguments['price_id'] = isset($arguments['price_id']) + ? $arguments['price_id'] + : 'old-price-' . $product->getId() . '-' . $priceType; + $arguments['include_container'] = isset($arguments['include_container']) + ? $arguments['include_container'] + : true; + $arguments['display_minimal_price'] = isset($arguments['display_minimal_price']) + ? $arguments['display_minimal_price'] + : true; + + /** @var \Magento\Pricing\Render $priceRender */ + $priceRender = $this->getLayout()->getBlock('product.price.render.default'); + + $price = ''; + if ($priceRender) { + $price = $priceRender->render( + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + $product, + $arguments + ); + } + return $price; + } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php index 2c83c6c5e4a00cfe653a5730386ac4f767347518..6c522b660062d1eaef44726b94aa5a2fbb9ee704 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php @@ -30,10 +30,6 @@ use Magento\Catalog\Model\Product\Validator; /** * Catalog product controller - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> */ class Product extends \Magento\Backend\App\Action { @@ -54,7 +50,7 @@ class Product extends \Magento\Backend\App\Action * * @var \Magento\Registry */ - protected $registry = null; + protected $registry; /** * @var \Magento\Stdlib\DateTime\Filter\Date @@ -140,15 +136,11 @@ class Product extends \Magento\Backend\App\Action \Magento\Backend\Block\Widget\Grid $gridBlock, $productsArray ) { - return $this->_view->getLayout()->createBlock( - 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax\Serializer' - )->setGridBlock( - $gridBlock - )->setProducts( - $productsArray - )->setInputElementName( - $inputName - ); + return $this->_view->getLayout() + ->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax\Serializer') + ->setGridBlock($gridBlock) + ->setProducts($productsArray) + ->setInputElementName($inputName); } /** @@ -236,7 +228,7 @@ class Product extends \Magento\Backend\App\Action public function editAction() { $this->_title->add(__('Products')); - $productId = (int)$this->getRequest()->getParam('id'); + $productId = (int) $this->getRequest()->getParam('id'); $product = $this->productBuilder->build($this->getRequest()); if ($productId && !$product->getId()) { @@ -265,16 +257,14 @@ class Product extends \Magento\Backend\App\Action 'store_switcher' )) ) { - $switchBlock->setDefaultStoreName( - __('Default Values') - )->setWebsiteIds( - $product->getWebsiteIds() - )->setSwitchUrl( - $this->getUrl( - 'catalog/*/*', - array('_current' => true, 'active_tab' => null, 'tab' => null, 'store' => null) - ) - ); + $switchBlock->setDefaultStoreName(__('Default Values')) + ->setWebsiteIds($product->getWebsiteIds()) + ->setSwitchUrl( + $this->getUrl( + 'catalog/*/*', + array('_current' => true, 'active_tab' => null, 'tab' => null, 'store' => null) + ) + ); } $this->_view->getLayout()->getBlock('head')->setCanLoadExtJs(true); @@ -384,11 +374,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.related' - )->setProductsRelated( - $this->getRequest()->getPost('products_related', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.related') + ->setProductsRelated($this->getRequest()->getPost('products_related', null)); $this->_view->renderLayout(); } @@ -401,11 +388,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.upsell' - )->setProductsUpsell( - $this->getRequest()->getPost('products_upsell', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.upsell') + ->setProductsUpsell($this->getRequest()->getPost('products_upsell', null)); $this->_view->renderLayout(); } @@ -418,11 +402,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.crosssell' - )->setProductsCrossSell( - $this->getRequest()->getPost('products_crosssell', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.crosssell') + ->setProductsCrossSell($this->getRequest()->getPost('products_crosssell', null)); $this->_view->renderLayout(); } @@ -435,11 +416,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.related' - )->setProductsRelated( - $this->getRequest()->getPost('products_related', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.related') + ->setProductsRelated($this->getRequest()->getPost('products_related', null)); $this->_view->renderLayout(); } @@ -452,11 +430,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.upsell' - )->setProductsRelated( - $this->getRequest()->getPost('products_upsell', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.upsell') + ->setProductsRelated($this->getRequest()->getPost('products_upsell', null)); $this->_view->renderLayout(); } @@ -469,11 +444,8 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->_view->loadLayout(); - $this->_view->getLayout()->getBlock( - 'catalog.product.edit.tab.crosssell' - )->setProductsRelated( - $this->getRequest()->getPost('products_crosssell', null) - ); + $this->_view->getLayout()->getBlock('catalog.product.edit.tab.crosssell') + ->setProductsRelated($this->getRequest()->getPost('products_crosssell', null)); $this->_view->renderLayout(); } @@ -560,7 +532,6 @@ class Product extends \Magento\Backend\App\Action $storeId = $this->getRequest()->getParam('store'); $redirectBack = $this->getRequest()->getParam('back', false); $productId = $this->getRequest()->getParam('id'); - $isEdit = (int)($this->getRequest()->getParam('id') != null); $data = $this->getRequest()->getPost(); if ($data) { @@ -581,15 +552,11 @@ class Product extends \Magento\Backend\App\Action */ if (isset($data['copy_to_stores'])) { foreach ($data['copy_to_stores'] as $storeTo => $storeFrom) { - $this->_objectManager->create( - 'Magento\Catalog\Model\Product' - )->setStoreId( - $storeFrom - )->load( - $productId - )->setStoreId( - $storeTo - )->save(); + $this->_objectManager->create('Magento\Catalog\Model\Product') + ->setStoreId($storeFrom) + ->load($productId) + ->setStoreId($storeTo) + ->save(); } } @@ -690,21 +657,19 @@ class Product extends \Magento\Backend\App\Action public function massDeleteAction() { $productIds = $this->getRequest()->getParam('product'); - if (!is_array($productIds)) { + if (!is_array($productIds) || empty($productIds)) { $this->messageManager->addError(__('Please select product(s).')); } else { - if (!empty($productIds)) { - try { - foreach ($productIds as $productId) { - $product = $this->_objectManager->get('Magento\Catalog\Model\Product')->load($productId); - $product->delete(); - } - $this->messageManager->addSuccess( - __('A total of %1 record(s) have been deleted.', count($productIds)) - ); - } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + try { + foreach ($productIds as $productId) { + $product = $this->_objectManager->get('Magento\Catalog\Model\Product')->load($productId); + $product->delete(); } + $this->messageManager->addSuccess( + __('A total of %1 record(s) have been deleted.', count($productIds)) + ); + } catch (\Exception $e) { + $this->messageManager->addError($e->getMessage()); } } $this->_redirect('catalog/*/index'); @@ -717,22 +682,15 @@ class Product extends \Magento\Backend\App\Action */ public function massStatusAction() { - $productIds = (array)$this->getRequest()->getParam('product'); - $storeId = (int)$this->getRequest()->getParam('store', 0); - $status = (int)$this->getRequest()->getParam('status'); + $productIds = (array) $this->getRequest()->getParam('product'); + $storeId = (int) $this->getRequest()->getParam('store', 0); + $status = (int) $this->getRequest()->getParam('status'); try { $this->_validateMassStatus($productIds, $status); - $this->_objectManager->get( - 'Magento\Catalog\Model\Product\Action' - )->updateAttributes( - $productIds, - array('status' => $status), - $storeId - ); - + $this->_objectManager->get('Magento\Catalog\Model\Product\Action') + ->updateAttributes($productIds, array('status' => $status), $storeId); $this->messageManager->addSuccess(__('A total of %1 record(s) have been updated.', count($productIds))); - $this->_productPriceIndexerProcessor->reindexList($productIds); } catch (\Magento\Core\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); @@ -783,13 +741,11 @@ class Product extends \Magento\Backend\App\Action public function showUpdateResultAction() { $session = $this->_objectManager->get('Magento\Backend\Model\Session'); - if ($session->hasCompositeProductResult() && $session->getCompositeProductResult() instanceof \Magento\Object + if ($session->hasCompositeProductResult() + && $session->getCompositeProductResult() instanceof \Magento\Object ) { - $this->_objectManager->get( - 'Magento\Catalog\Helper\Product\Composite' - )->renderUpdateResult( - $session->getCompositeProductResult() - ); + $this->_objectManager->get('Magento\Catalog\Helper\Product\Composite') + ->renderUpdateResult($session->getCompositeProductResult()); $session->unsCompositeProductResult(); } else { $session->unsCompositeProductResult(); @@ -829,14 +785,9 @@ class Product extends \Magento\Backend\App\Action { $this->productBuilder->build($this->getRequest()); $this->getResponse()->setBody( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->jsonEncode( - $this->_view->getLayout()->createBlock( - 'Magento\Catalog\Block\Product\TemplateSelector' - )->getSuggestedTemplates( - $this->getRequest()->getParam('label_part') - ) + $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode( + $this->_view->getLayout()->createBlock('Magento\Catalog\Block\Product\TemplateSelector') + ->getSuggestedTemplates($this->getRequest()->getParam('label_part')) ) ); } @@ -849,9 +800,7 @@ class Product extends \Magento\Backend\App\Action public function suggestAttributesAction() { $this->getResponse()->setBody( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->jsonEncode( + $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode( $this->_view->getLayout()->createBlock( 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Search' )->getSuggestedAttributes( @@ -871,17 +820,11 @@ class Product extends \Magento\Backend\App\Action $request = $this->getRequest(); try { /** @var \Magento\Eav\Model\Entity\Attribute $attribute */ - $attribute = $this->_objectManager->create( - 'Magento\Eav\Model\Entity\Attribute' - )->load( - $request->getParam('attribute_id') - ); + $attribute = $this->_objectManager->create('Magento\Eav\Model\Entity\Attribute') + ->load($request->getParam('attribute_id')); - $attributeSet = $this->_objectManager->create( - 'Magento\Eav\Model\Entity\Attribute\Set' - )->load( - $request->getParam('template_id') - ); + $attributeSet = $this->_objectManager->create('Magento\Eav\Model\Entity\Attribute\Set') + ->load($request->getParam('template_id')); /** @var \Magento\Eav\Model\Resource\Entity\Attribute\Group\Collection $attributeGroupCollection */ $attributeGroupCollection = $this->_objectManager->get( @@ -895,15 +838,11 @@ class Product extends \Magento\Backend\App\Action $attribute->setAttributeSetId($attributeSet->getId())->loadEntityAttributeIdBySet(); - $attribute->setEntityTypeId( - $attributeSet->getEntityTypeId() - )->setAttributeSetId( - $request->getParam('template_id') - )->setAttributeGroupId( - $attributeGroup->getId() - )->setSortOrder( - '0' - )->save(); + $attribute->setEntityTypeId($attributeSet->getEntityTypeId()) + ->setAttributeSetId($request->getParam('template_id')) + ->setAttributeGroupId($attributeGroup->getId()) + ->setSortOrder('0') + ->save(); $this->getResponse()->setBody($attribute->toJson()); } catch (\Exception $e) { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index 8b02b69107e724dcc313f28fa2b622e25b1edaf2..1cbc557f9146519c7bdb090f39f487f2c59744a3 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -66,10 +66,10 @@ class Attribute extends \Magento\Backend\App\Action /** * Dispatch request * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ - public function dispatch(\Magento\App\RequestInterface $request) + public function dispatch(\Magento\Framework\App\RequestInterface $request) { $this->_entityTypeId = $this->_objectManager->create( 'Magento\Eav\Model\Entity' diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php index 929ce293d2262ae4a4d81c4d0da385a28eb340f6..dfc9cb0a6a69f477bf58e3fc6eeb98b341f07ac2 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php @@ -24,7 +24,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Catalog\Model\ProductFactory; use Magento\Cms\Model\Wysiwyg; use Magento\Registry; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php index 97e93c5b673ed3d7b67b7af90e8627c480a8fc83..0031baef075d6c3f7e4e54a5616aaf76c4620990 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery.php @@ -49,9 +49,9 @@ class Gallery extends \Magento\Backend\App\Action $uploader->setFilesDispersion(true); /** @var \Magento\Filesystem\Directory\Read $mediaDirectory */ $mediaDirectory = $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryRead( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $config = $this->_objectManager->get('Magento\Catalog\Model\Product\Media\Config'); $result = $uploader->save($mediaDirectory->getAbsolutePath($config->getBaseTmpMediaPath())); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php index 6dfd2b595a24e40e7fc51c4b23474134a1677672..ac0cfcd7a40bbe9a5f2e044dc396cb957e41fea5 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization; class Helper { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -46,13 +46,13 @@ class Helper protected $productLinks; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param StockDataFilter $stockFilter * @param Helper\ProductLinks $productLinks */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Store\Model\StoreManagerInterface $storeManager, StockDataFilter $stockFilter, Helper\ProductLinks $productLinks diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks.php index 93d82b0a3b80835c12b2268be6a427e336e0d70a..b5e7c7277e48bcf82a7b358c634273be8ffebc50 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper; class ProductLinks { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -36,10 +36,10 @@ class ProductLinks protected $jsHelper; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Backend\Helper\Js $jsHelper */ - public function __construct(\Magento\App\RequestInterface $request, \Magento\Backend\Helper\Js $jsHelper) + public function __construct(\Magento\Framework\App\RequestInterface $request, \Magento\Backend\Helper\Js $jsHelper) { $this->request = $request; $this->jsHelper = $jsHelper; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php index 1de77447d2cfe39319611d085cb191c2ee73a908..2af5fda1388b88cdcde41a0b19e495eedad144f7 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php @@ -31,14 +31,14 @@ class StockDataFilter const MAX_QTY_VALUE = 99999999.9999; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Catalog/Controller/Category.php b/app/code/Magento/Catalog/Controller/Category.php index 87194a8241b07423779d04a73853c838984fb15d..f9ef34f6327e8faf5fb068bd9a72c203e5b5fc16 100644 --- a/app/code/Magento/Catalog/Controller/Category.php +++ b/app/code/Magento/Catalog/Controller/Category.php @@ -32,7 +32,7 @@ namespace Magento\Catalog\Controller; * @package Magento_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Category extends \Magento\App\Action\Action +class Category extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -68,7 +68,7 @@ class Category extends \Magento\App\Action\Action protected $_storeManager; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Model\Session $catalogSession @@ -76,7 +76,7 @@ class Category extends \Magento\App\Action\Action * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Model\Session $catalogSession, @@ -135,7 +135,7 @@ class Category extends \Magento\App\Action\Action */ public function viewAction() { - if ($this->_request->getParam(\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED)) { + if ($this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED)) { $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); return; } @@ -164,6 +164,11 @@ class Category extends \Magento\App\Action\Action $this->_view->addPageLayoutHandles(array('type' => $parentType)); } $this->_view->addPageLayoutHandles(array('type' => $type, 'id' => $category->getId())); + + // apply custom layout (page) template once the blocks are generated + if ($settings->getPageLayout()) { + $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyHandle($settings->getPageLayout()); + } $this->_view->loadLayoutUpdates(); // apply custom layout update once layout is loaded @@ -176,10 +181,6 @@ class Category extends \Magento\App\Action\Action $this->_view->generateLayoutXml(); $this->_view->generateLayoutBlocks(); - // apply custom layout (page) template once the blocks are generated - if ($settings->getPageLayout()) { - $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyTemplate($settings->getPageLayout()); - } $root = $this->_view->getLayout()->getBlock('root'); if ($root) { diff --git a/app/code/Magento/Catalog/Controller/Index.php b/app/code/Magento/Catalog/Controller/Index.php index 11eb9d5fe60a031d2b1c147b12d0698c6c40b0c9..2f608add9e8942ef6ee3aec3e34bee7d188afad8 100644 --- a/app/code/Magento/Catalog/Controller/Index.php +++ b/app/code/Magento/Catalog/Controller/Index.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Controller; -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * Index action diff --git a/app/code/Magento/Catalog/Controller/Product.php b/app/code/Magento/Catalog/Controller/Product.php index 2121c09e01165d61dd895310e526c09da78fa113..b1b1cae7962ec3b8fd1efb195feaf2e8f0f9bfdb 100644 --- a/app/code/Magento/Catalog/Controller/Product.php +++ b/app/code/Magento/Catalog/Controller/Product.php @@ -27,7 +27,7 @@ namespace Magento\Catalog\Controller; use Magento\Catalog\Model\Product as ModelProduct; -class Product extends \Magento\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface +class Product extends \Magento\Framework\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface { /** * Initialize requested product object @@ -71,8 +71,8 @@ class Product extends \Magento\App\Action\Action implements \Magento\Catalog\Con public function viewAction() { // Get initial data from request - $categoryId = (int)$this->getRequest()->getParam('category', false); - $productId = (int)$this->getRequest()->getParam('id'); + $categoryId = (int) $this->getRequest()->getParam('category', false); + $productId = (int) $this->getRequest()->getParam('id'); $specifyOptions = $this->getRequest()->getParam('options'); if ($this->getRequest()->isPost() && $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED)) { diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index d1857c5055ff8219823cb1b6c9c62507fbed0d66..9985eba4dcdfd4f5711d132d9069d678841d7198 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -32,7 +32,7 @@ use Magento\Core\App\Action\FormKeyValidator; * * @SuppressWarnings(PHPMD.LongVariable) */ -class Compare extends \Magento\App\Action\Action +class Compare extends \Magento\Framework\App\Action\Action { /** * Customer id @@ -101,7 +101,7 @@ class Compare extends \Magento\App\Action\Action protected $_formKeyValidator; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory @@ -113,7 +113,7 @@ class Compare extends \Magento\App\Action\Action * @param FormKeyValidator $formKeyValidator */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, diff --git a/app/code/Magento/Catalog/Helper/Catalog.php b/app/code/Magento/Catalog/Helper/Catalog.php index d1b3362d0dc693934433c2ffc3b1062e5aeed046..cadbcfb9e6d5bf722344491985f0d37dc9560898 100644 --- a/app/code/Magento/Catalog/Helper/Catalog.php +++ b/app/code/Magento/Catalog/Helper/Catalog.php @@ -32,7 +32,7 @@ namespace Magento\Catalog\Helper; * @package Magento_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Catalog extends \Magento\App\Helper\AbstractHelper +class Catalog extends \Magento\Framework\App\Helper\AbstractHelper { /** * Config path to valid file paths @@ -61,19 +61,19 @@ class Catalog extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Helper/Category.php b/app/code/Magento/Catalog/Helper/Category.php index d03bc66737df677636ec462517f102985fb1493e..3c83e8d2d1fe9ad01a59d8330329df97d96a4b27 100644 --- a/app/code/Magento/Catalog/Helper/Category.php +++ b/app/code/Magento/Catalog/Helper/Category.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Helper; -use Magento\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\AbstractHelper; use Magento\Catalog\Model\Category as ModelCategory; use Magento\Store\Model\Store; @@ -59,7 +59,7 @@ class Category extends AbstractHelper /** * Scope config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -85,17 +85,17 @@ class Category extends AbstractHelper protected $_dataCollectionFactory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Data\CollectionFactory $dataCollectionFactory */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Data\CollectionFactory $dataCollectionFactory ) { $this->_categoryFactory = $categoryFactory; diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 2e53b8f5f730bc6559b6b4aa5c99092bf4e7f8e8..e5edc55953314cec6eb47c7ae5413c993be208fa 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -25,10 +25,12 @@ */ namespace Magento\Catalog\Helper; +use Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type; + /** * Catalog data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const PRICE_SCOPE_GLOBAL = 0; @@ -168,7 +170,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -178,13 +180,13 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param Category $catalogCategory * @param Product $catalogProduct * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory * @param \Magento\Escaper $escaper * @param string $templateFilterModel */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -194,7 +196,7 @@ class Data extends \Magento\App\Helper\AbstractHelper Category $catalogCategory, Product $catalogProduct, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory, \Magento\Escaper $escaper, $templateFilterModel @@ -467,7 +469,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function isMsrpApplyToAll() { - return (bool)$this->_scopeConfig->getValue( + return (bool) $this->_scopeConfig->getValue( self::XML_PATH_MSRP_APPLY_TO_ALL, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $this->_storeId @@ -537,7 +539,7 @@ class Data extends \Magento\App\Helper\AbstractHelper } $result = $product->getMsrpEnabled(); - if ($result == \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type\Enabled::MSRP_ENABLE_USE_CONFIG) { + if ($result == Type\Enabled::MSRP_ENABLE_USE_CONFIG) { $result = $this->isMsrpApplyToAll(); } @@ -547,16 +549,15 @@ class Data extends \Magento\App\Helper\AbstractHelper if ($result && $visibility !== null) { $productVisibility = $product->getMsrpDisplayActualPriceType(); - if ($productVisibility == \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type\Price::TYPE_USE_CONFIG - ) { + if ($productVisibility == Type\Price::TYPE_USE_CONFIG) { $productVisibility = $this->getMsrpDisplayActualPriceType(); } $result = $productVisibility == $visibility; } - if ($product->getTypeInstance()->isComposite( - $product - ) && $checkAssociatedItems && (!$result || $visibility !== null) + if ($product->getTypeInstance()->isComposite($product) + && $checkAssociatedItems + && (!$result || $visibility !== null) ) { $resultInOptions = $product->getTypeInstance()->isMapEnabledInOptions($product, $visibility); if ($resultInOptions !== null) { @@ -595,13 +596,9 @@ class Data extends \Magento\App\Helper\AbstractHelper public function getMsrpPriceMessage($product) { $message = ""; - if ($this->canApplyMsrp($product, \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type::TYPE_IN_CART)) { + if ($this->canApplyMsrp($product, Type::TYPE_IN_CART)) { $message = __('To see product price, add this item to your cart. You can always remove it later.'); - } elseif ($this->canApplyMsrp( - $product, - \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type::TYPE_BEFORE_ORDER_CONFIRM - ) - ) { + } elseif ($this->canApplyMsrp($product, Type::TYPE_BEFORE_ORDER_CONFIRM)) { $message = __('See price before order confirmation.'); } return $message; @@ -615,10 +612,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function isShowPriceOnGesture($product) { - return $this->canApplyMsrp( - $product, - \Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type::TYPE_ON_GESTURE - ); + return $this->canApplyMsrp($product, Type::TYPE_ON_GESTURE); } /** diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index ad0a9992b748bd9d9d69b887f645d596347e2c55..439ef8951fd1e060cbe6a6269386fccb17afe7bd 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Helper; -use Magento\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\AbstractHelper; /** * Catalog image helper @@ -117,7 +117,7 @@ class Image extends AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -129,16 +129,16 @@ class Image extends AbstractHelper protected $_productImageFactory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory * @param \Magento\View\Url $viewUrl - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\Product\ImageFactory $productImageFactory, \Magento\View\Url $viewUrl, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_productImageFactory = $productImageFactory; parent::__construct($context); diff --git a/app/code/Magento/Catalog/Helper/Output.php b/app/code/Magento/Catalog/Helper/Output.php index 7a857ff7be9a971f0aa23ab6a0e00083c4c7c45e..3f83dfd3e9a157e2625a8e48ec35e317048e3169 100644 --- a/app/code/Magento/Catalog/Helper/Output.php +++ b/app/code/Magento/Catalog/Helper/Output.php @@ -29,7 +29,7 @@ use Magento\Catalog\Model\Category as ModelCategory; use Magento\Catalog\Model\Product as ModelProduct; use Magento\Filter\Template; -class Output extends \Magento\App\Helper\AbstractHelper +class Output extends \Magento\Framework\App\Helper\AbstractHelper { /** * Array of existing handlers @@ -65,13 +65,13 @@ class Output extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param Data $catalogData * @param \Magento\Escaper $escaper */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Eav\Model\Config $eavConfig, Data $catalogData, \Magento\Escaper $escaper diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index ae4ed2e949b1aee1d46bc609829c2c941424df5e..522c06ab5897fb24e3513024d089c5aed11bd6cd 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -28,8 +28,6 @@ use Magento\Store\Model\Store; /** * Catalog category helper - * - * @SuppressWarnings(PHPMD.LongVariable) */ class Product extends \Magento\Core\Helper\Url { @@ -90,12 +88,12 @@ class Product extends \Magento\Core\Helper\Url /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -133,7 +131,7 @@ class Product extends \Magento\Core\Helper\Url protected $_reindexPriceIndexerData; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -141,13 +139,13 @@ class Product extends \Magento\Core\Helper\Url * @param \Magento\View\Url $viewUrl * @param \Magento\Registry $coreRegistry * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param string $typeSwitcherLabel * @param \Magento\Catalog\Model\CategoryFactory $reindexPriceIndexerData */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -155,8 +153,8 @@ class Product extends \Magento\Core\Helper\Url \Magento\View\Url $viewUrl, \Magento\Registry $coreRegistry, \Magento\Catalog\Model\Attribute\Config $attributeConfig, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, $typeSwitcherLabel, $reindexPriceIndexerData ) { @@ -182,7 +180,7 @@ class Product extends \Magento\Core\Helper\Url */ public function isDataForPriceIndexerWasChanged($data) { - if ($data instanceof \Magento\Catalog\Model\Product) { + if ($data instanceof ModelProduct) { foreach ($this->_reindexPriceIndexerData['byDataResult'] as $param) { if ($data->getData($param)) { return true; @@ -438,7 +436,7 @@ class Product extends \Magento\Core\Helper\Url * If empty (except FALSE) - will be guessed (e.g. from last visited) to load as current. * * @param int $productId - * @param \Magento\App\Action\Action $controller + * @param \Magento\Framework\App\Action\Action $controller * @param \Magento\Object $params * * @return false|ModelProduct diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php index 8f4d3af3c6e13c3487fcef36a9100ef7915f9660..7de9e952725e52416c47419fdfba001f71ff52d2 100644 --- a/app/code/Magento/Catalog/Helper/Product/Compare.php +++ b/app/code/Magento/Catalog/Helper/Product/Compare.php @@ -114,7 +114,7 @@ class Compare extends \Magento\Core\Helper\Url protected $_coreHelper; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility @@ -126,7 +126,7 @@ class Compare extends \Magento\Core\Helper\Url * @param \Magento\Core\Helper\PostData $coreHelper */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, @@ -162,7 +162,7 @@ class Compare extends \Magento\Core\Helper\Url $params = array( 'items' => implode(',', $itemIds), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ); return $this->_getUrl('catalog/product_compare', $params); @@ -200,7 +200,7 @@ class Compare extends \Magento\Core\Helper\Url $beforeCompareUrl = $this->_catalogSession->getBeforeCompareUrl(); $encodedUrl = array( - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) ); return $this->_wishlistHelper->getAddParams($product, $encodedUrl); @@ -217,7 +217,7 @@ class Compare extends \Magento\Core\Helper\Url $beforeCompareUrl = $this->_catalogSession->getBeforeCompareUrl(); $params = array( 'product' => $product->getId(), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl($beforeCompareUrl) ); return $this->_getUrl('checkout/cart/add', $params); @@ -243,7 +243,7 @@ class Compare extends \Magento\Core\Helper\Url { $listCleanUrl = $this->getEncodedUrl($this->_getUrl('catalog/product_compare')); $data = array( - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $listCleanUrl, + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $listCleanUrl, 'product' => $product->getId() ); return $this->_coreHelper->getPostData($this->getRemoveUrl(), $data); @@ -268,7 +268,7 @@ class Compare extends \Magento\Core\Helper\Url { $refererUrl = $this->_getRequest()->getServer('HTTP_REFERER'); $params = array( - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->urlEncode($refererUrl) + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->urlEncode($refererUrl) ); return $this->_coreHelper->getPostData($this->getClearListUrl(), $params); } diff --git a/app/code/Magento/Catalog/Helper/Product/Composite.php b/app/code/Magento/Catalog/Helper/Product/Composite.php index 0d21bd39163858c438391b1fb0605bb2dd238ce5..7747bb4178cc9cabfcd633e7994b0c8549bb100f 100644 --- a/app/code/Magento/Catalog/Helper/Product/Composite.php +++ b/app/code/Magento/Catalog/Helper/Product/Composite.php @@ -25,8 +25,8 @@ */ namespace Magento\Catalog\Helper\Product; -use Magento\App\Helper\Context; -use Magento\App\ViewInterface; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\App\ViewInterface; use Magento\Catalog\Helper\Product; use Magento\Catalog\Model\ProductFactory; use Magento\Store\Model\StoreManagerInterface; @@ -41,7 +41,7 @@ use Magento\Registry; * @package Magento_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Composite extends \Magento\App\Helper\AbstractHelper +class Composite extends \Magento\Framework\App\Helper\AbstractHelper { /** * Core registry @@ -78,7 +78,7 @@ class Composite extends \Magento\App\Helper\AbstractHelper protected $_converter; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param ProductFactory $productFactory * @param StoreManagerInterface $storeManager * @param Product $catalogProduct diff --git a/app/code/Magento/Catalog/Helper/Product/Configuration.php b/app/code/Magento/Catalog/Helper/Product/Configuration.php index 7a296142969ec52e911227bdcdd84aab6f59ff2a..0be7e9acc0d4a6baa4fffc216cc18189764cf764 100644 --- a/app/code/Magento/Catalog/Helper/Product/Configuration.php +++ b/app/code/Magento/Catalog/Helper/Product/Configuration.php @@ -30,7 +30,7 @@ namespace Magento\Catalog\Helper\Product; * * @SuppressWarnings(PHPMD.LongVariable) */ -class Configuration extends \Magento\App\Helper\AbstractHelper implements +class Configuration extends \Magento\Framework\App\Helper\AbstractHelper implements \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface { /** @@ -55,13 +55,13 @@ class Configuration extends \Magento\App\Helper\AbstractHelper implements protected $string; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Filter\FilterManager $filter * @param \Magento\Stdlib\String $string */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Filter\FilterManager $filter, \Magento\Stdlib\String $string diff --git a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php index b42d978f6f68b9f1313484869eee454bcb66650e..d056fd8fc9c7829f47ace67d42af83637928dac3 100644 --- a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php @@ -68,8 +68,8 @@ class Attribute extends \Magento\Backend\Helper\Data protected $_eavConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Route\Config $routeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Route\Config $routeConfig * @param \Magento\Locale\ResolverInterface $locale * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Backend\Model\Auth $auth @@ -80,8 +80,8 @@ class Attribute extends \Magento\Backend\Helper\Data * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productsFactory */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Route\Config $routeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Route\Config $routeConfig, \Magento\Locale\ResolverInterface $locale, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Backend\Model\Auth $auth, diff --git a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php index ede28e8eabd00947ccabb507aa6009197dbe34fe..acd47ae922a141670945413675ae4f81b5862358 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php @@ -31,7 +31,7 @@ namespace Magento\Catalog\Helper\Product\Flat; * @category Magento * @package Magento_Catalog */ -class Indexer extends \Magento\App\Helper\AbstractHelper +class Indexer extends \Magento\Framework\App\Helper\AbstractHelper { /** * Path to list of attributes used for flat indexer @@ -46,7 +46,7 @@ class Indexer extends \Magento\App\Helper\AbstractHelper /** * Resource instance * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -141,8 +141,8 @@ class Indexer extends \Magento\App\Helper\AbstractHelper protected $_changelog; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Catalog\Model\Resource\ConfigFactory $configFactory @@ -154,8 +154,8 @@ class Indexer extends \Magento\App\Helper\AbstractHelper * @param array $flatAttributeGroups */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Resource $resource, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Attribute\Config $attributeConfig, \Magento\Catalog\Model\Resource\ConfigFactory $configFactory, diff --git a/app/code/Magento/Catalog/Helper/Product/Options.php b/app/code/Magento/Catalog/Helper/Product/Options.php index 394bb2e6bebc6a14a2ffceced0810421bc8b85d2..5901d5f4c22372d4afe34831381381c461e75e67 100644 --- a/app/code/Magento/Catalog/Helper/Product/Options.php +++ b/app/code/Magento/Catalog/Helper/Product/Options.php @@ -32,7 +32,7 @@ namespace Magento\Catalog\Helper\Product; * @package Magento_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Options extends \Magento\App\Helper\AbstractHelper +class Options extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Filesystem\Directory\ReadInterface @@ -40,13 +40,13 @@ class Options extends \Magento\App\Helper\AbstractHelper protected $directory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\App\Helper\Context $context, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\App\Filesystem $filesystem) { parent::__construct($context); - $this->directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); } /** @@ -57,7 +57,7 @@ class Options extends \Magento\App\Helper\AbstractHelper * - 'size' - size of file * - 'title' - user-friendly name of file (usually - original name as uploaded in Magento) * - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response * @param string $filePath * @param array $info * @return bool diff --git a/app/code/Magento/Catalog/Helper/Product/Price.php b/app/code/Magento/Catalog/Helper/Product/Price.php index b47880ae5cc7e67b6719389db75e5448c73425e4..e6c63107266fb73144ffeb9e20b14abbc103b420 100644 --- a/app/code/Magento/Catalog/Helper/Product/Price.php +++ b/app/code/Magento/Catalog/Helper/Product/Price.php @@ -28,12 +28,8 @@ use Magento\Customer\Service\V1\Data\Customer; /** * Collection of tax module calls - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> */ -class Price extends \Magento\App\Helper\AbstractHelper +class Price extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Tax\Helper\Data @@ -101,7 +97,7 @@ class Price extends \Magento\App\Helper\AbstractHelper /** * Get customer data object * - * @return Customer CustomerDataObject + * @return Customer */ public function getCustomer() { diff --git a/app/code/Magento/Catalog/Helper/Product/ProductList.php b/app/code/Magento/Catalog/Helper/Product/ProductList.php index 50267b478e0e6bce298b5fd638617c538f83ab4a..d30a31c12cb7967163df3c7726ee364302a20f25 100644 --- a/app/code/Magento/Catalog/Helper/Product/ProductList.php +++ b/app/code/Magento/Catalog/Helper/Product/ProductList.php @@ -41,7 +41,7 @@ class ProductList const DEFAULT_SORT_DIRECTION = 'asc'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -53,10 +53,10 @@ class ProductList protected $_defaultAvailableLimit = array(10=>10,20=>20,50=>50); /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 9f4f3b803409fea185c840caf63c0035c73d2bd0..211f93d313828f729e9cc87fa08264f9a5cfc7f0 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Helper\Product; -class View extends \Magento\App\Helper\AbstractHelper +class View extends \Magento\Framework\App\Helper\AbstractHelper { // List of exceptions throwable during prepareAndRender() method public $ERR_NO_PRODUCT_LOADED = 1; @@ -83,7 +83,7 @@ class View extends \Magento\App\Helper\AbstractHelper protected $_catalogSession; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_view; @@ -93,24 +93,24 @@ class View extends \Magento\App\Helper\AbstractHelper protected $messageManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Theme\Helper\Layout $pageLayout * @param \Magento\Registry $coreRegistry - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\Message\ManagerInterface $messageManager * @param array $messageGroups */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Theme\Helper\Layout $pageLayout, \Magento\Registry $coreRegistry, - \Magento\App\ViewInterface $view, + \Magento\Framework\App\ViewInterface $view, \Magento\Message\ManagerInterface $messageManager, array $messageGroups = array() ) { @@ -129,7 +129,7 @@ class View extends \Magento\App\Helper\AbstractHelper * Inits layout for viewing product page * * @param \Magento\Catalog\Model\Product $product - * @param \Magento\App\Action\Action $controller + * @param \Magento\Framework\App\Action\Action $controller * @param null|\Magento\Object $params * * @return \Magento\Catalog\Helper\Product\View @@ -216,7 +216,7 @@ class View extends \Magento\App\Helper\AbstractHelper * - 'configure_mode' - boolean, whether we're in Configure-mode to edit product configuration * * @param int $productId - * @param \Magento\App\Action\Action $controller + * @param \Magento\Framework\App\Action\Action $controller * @param null|\Magento\Object $params * * @return \Magento\Catalog\Helper\Product\View diff --git a/app/code/Magento/Catalog/Model/App/Action/ContextPlugin.php b/app/code/Magento/Catalog/Model/App/Action/ContextPlugin.php index ab752b5ac3e6886723080e2668e5e09deabdf702..3eab4b5ef13ceef8df66b0df3da2ed9690078b9b 100644 --- a/app/code/Magento/Catalog/Model/App/Action/ContextPlugin.php +++ b/app/code/Magento/Catalog/Model/App/Action/ContextPlugin.php @@ -37,7 +37,7 @@ class ContextPlugin protected $toolbarModel; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -48,12 +48,12 @@ class ContextPlugin /** * @param \Magento\Catalog\Model\Product\ProductList\Toolbar $toolbarModel - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Product\ProductList $productListHelper */ public function __construct( \Magento\Catalog\Model\Product\ProductList\Toolbar $toolbarModel, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Product\ProductList $productListHelper ) { $this->toolbarModel = $toolbarModel; @@ -62,15 +62,15 @@ class ContextPlugin } /** - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return mixed */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->httpContext->setValue( Data::CONTEXT_CATALOG_SORT_DIRECTION, diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index bb47d8487dc21482d6c3e10707708e994669c79a..b1b450a9fa46935b381fce95990eca623974b7de 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -44,7 +44,7 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -59,12 +59,12 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend * Construct * * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory ) { $this->_filesystem = $filesystem; @@ -94,7 +94,7 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend } $path = $this->_filesystem->getDirectoryRead( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->getAbsolutePath( 'catalog/category/' ); diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php index 9305a193735674cead4f2a6841bef27086f36d2a..cf0ee30b0af8a3f2b61080a384cda1e13ee930c8 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -37,7 +37,7 @@ class Sortby extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -45,9 +45,9 @@ class Sortby extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend * Construct * * @param \Magento\Logger $logger - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\Logger $logger, \Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Logger $logger, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; parent::__construct($logger); diff --git a/app/code/Magento/Catalog/Model/Config.php b/app/code/Magento/Catalog/Model/Config.php index 572f690a22b4f8ca8b2aac2f62f0a73a46decb32..a592098e5ae6ff6c00dd39c75b4dac2be9a8917c 100644 --- a/app/code/Magento/Catalog/Model/Config.php +++ b/app/code/Magento/Catalog/Model/Config.php @@ -84,7 +84,7 @@ class Config extends \Magento\Eav\Model\Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -133,11 +133,11 @@ class Config extends \Magento\Eav\Model\Config /** * Constructor * - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Validator\UniversalFactory $universalFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Resource\ConfigFactory $configFactory * @param \Magento\Catalog\Model\Product\TypeFactory $productTypeFactory * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $groupCollectionFactory @@ -148,11 +148,11 @@ class Config extends \Magento\Eav\Model\Config * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Validator\UniversalFactory $universalFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Resource\ConfigFactory $configFactory, \Magento\Catalog\Model\Product\TypeFactory $productTypeFactory, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $groupCollectionFactory, diff --git a/app/code/Magento/Catalog/Model/Config/Backend/Category.php b/app/code/Magento/Catalog/Model/Config/Backend/Category.php index 5ce030cf7c6b07d41f3791a759aad87d802405a4..a9a5f4a945e86cd26aeba45f726877b99d50e54a 100644 --- a/app/code/Magento/Catalog/Model/Config/Backend/Category.php +++ b/app/code/Magento/Catalog/Model/Config/Backend/Category.php @@ -32,7 +32,7 @@ namespace Magento\Catalog\Model\Config\Backend; * @package Magento_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Category extends \Magento\App\Config\Value +class Category extends \Magento\Framework\App\Config\Value { /** * Catalog category @@ -46,7 +46,7 @@ class Category extends \Magento\App\Config\Value * * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -55,7 +55,7 @@ class Category extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Category $catalogCategory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Config/Backend/Seo/Product.php b/app/code/Magento/Catalog/Model/Config/Backend/Seo/Product.php index 852cfd334e8876577699aa9b05799f2b67e38665..0fdc02a561909362a0adb7e7f1a709db1fb7477c 100644 --- a/app/code/Magento/Catalog/Model/Config/Backend/Seo/Product.php +++ b/app/code/Magento/Catalog/Model/Config/Backend/Seo/Product.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Model\Config\Backend\Seo; -use Magento\App\Config\Value; +use Magento\Framework\App\Config\Value; class Product extends Value { diff --git a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php index 0b1fbf32d795b3e99759e684710f49d03bea0780..cc5fc7cc88ef1916b59caba84b284c892aa2d9a8 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php @@ -30,7 +30,7 @@ namespace Magento\Catalog\Model\Config\CatalogClone\Media; * * @SuppressWarnings(PHPMD.LongVariable) */ -class Image extends \Magento\App\Config\Value +class Image extends \Magento\Framework\App\Config\Value { /** * Eav config @@ -49,7 +49,7 @@ class Image extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Model\Resource\AbstractResource $resource @@ -59,7 +59,7 @@ class Image extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Eav\Model\Config $eavConfig, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Indexer/AbstractFlatState.php b/app/code/Magento/Catalog/Model/Indexer/AbstractFlatState.php index 89ff8710d11c49d60566c039e176304f09d32abe..0bd094093c3fc6c557ae4019c595c6bdd876d1a3 100644 --- a/app/code/Magento/Catalog/Model/Indexer/AbstractFlatState.php +++ b/app/code/Magento/Catalog/Model/Indexer/AbstractFlatState.php @@ -36,7 +36,7 @@ abstract class AbstractFlatState const INDEXER_ENABLED_XML_PATH = ''; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -51,12 +51,12 @@ abstract class AbstractFlatState protected $flatIndexer; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Indexer\Model\IndexerInterface $flatIndexer * @param bool $isAvailable */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Indexer\Model\IndexerInterface $flatIndexer, $isAvailable = false ) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php index 13d6d4cd513dd279ca75df26e2bef3fcabb2ec57..aebcee547fce16f24c8d950ad0ea39466aa68dce 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php @@ -38,7 +38,7 @@ class AbstractAction protected $attributeCodes; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; @@ -62,12 +62,12 @@ class AbstractAction protected $columns = array(); /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper ) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php index 5543d49dea248594034937858d537fdeac320cfc..132e06e149f889a3d35cd6b7c13896c3084854b2 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php @@ -31,13 +31,13 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Flat\AbstractAction protected $categoryFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Catalog\Model\CategoryFactory $categoryFactory diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php index f6ce0ede0bd16deb244d13d75cff56e0659033da..dd88c79d39d59f096085f14c0548bd148b2caef6 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/Mode.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Model\Indexer\Category\Flat\System\Config; /** * Flat category on/off backend */ -class Mode extends \Magento\App\Config\Value +class Mode extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Indexer\Model\IndexerInterface @@ -41,7 +41,7 @@ class Mode extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Indexer\Model\IndexerInterface $flatIndexer * @param \Magento\Indexer\Model\Indexer\State $indexerState * @param \Magento\Model\Resource\AbstractResource $resource @@ -51,7 +51,7 @@ class Mode extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Indexer\Model\IndexerInterface $flatIndexer, \Magento\Indexer\Model\Indexer\State $indexerState, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 924989a190dc0488ea9c1cb03687f0247de5d799..dc7a48ca9269e338c58fc7edf7b405e435753941 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -74,7 +74,7 @@ abstract class AbstractAction protected $categoryPath = array(); /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; @@ -96,12 +96,12 @@ abstract class AbstractAction protected $useTempTable = true; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $config */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $config ) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php index 20f987588fc47179a5a14d74d89d425df8672fa0..7da355aa9234e579a44b1da0ddb7fc766c4ab240 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/AbstractAction.php @@ -52,7 +52,7 @@ abstract class AbstractAction /** * Resource instance * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -71,7 +71,7 @@ abstract class AbstractAction /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -134,10 +134,10 @@ abstract class AbstractAction protected $_flatTableBuilder; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper * @param \Magento\Catalog\Model\Product\Type $productType * @param Processor $flatProductProcessor @@ -145,10 +145,10 @@ abstract class AbstractAction * @param FlatTableBuilder $flatTableBuilder */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper, \Magento\Catalog\Model\Product\Type $productType, \Magento\Catalog\Model\Indexer\Product\Flat\Processor $flatProductProcessor, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php index 3067bd99ca77c24e01c628b5a792fca8bfd01bc4..7149edc8cc04b777848b512adcd2bf2e78a5e292 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableData.php @@ -42,16 +42,16 @@ class TableData implements \Magento\Catalog\Model\Indexer\Product\Flat\TableData protected $_productIndexerHelper; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper ) { $this->_resource = $resource; diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php index f8fe29af7930e6704b81f2bb4b4948cb3575ab31..cb3ac2640f28558cd5205901186fb5cf14868287 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php @@ -42,7 +42,7 @@ class FlatTableBuilder protected $_connection; /** - * @var \Magento\App\Config\ScopeConfigInterface $config + * @var \Magento\Framework\App\Config\ScopeConfigInterface $config */ protected $_config; @@ -58,15 +58,15 @@ class FlatTableBuilder /** * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper - * @param \Magento\App\Resource $resource - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param TableDataInterface $tableData */ public function __construct( \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper, - \Magento\App\Resource $resource, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Indexer\Product\Flat\TableDataInterface $tableData ) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php index c96d52583b54d55aed8182e81afc4811d6d574a6..c1c8e0653fd5e6073111644fd4bc21fbe3a0daf3 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/State.php @@ -41,13 +41,13 @@ class State extends \Magento\Catalog\Model\Indexer\AbstractFlatState protected $_productFlatIndexerHelper; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Indexer\Model\IndexerInterface $flatIndexer * @param \Magento\Catalog\Helper\Product\Flat\Indexer $flatIndexerHelper * @param bool $isAvailable */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Indexer\Model\IndexerInterface $flatIndexer, \Magento\Catalog\Helper\Product\Flat\Indexer $flatIndexerHelper, $isAvailable = false diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php index e7d4a87403964df4488c1b703cf8d4e387a37437..9af73ff8f0409cd5b88c8850c50607f97ff6aa8f 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/Mode.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Model\Indexer\Product\Flat\System\Config; /** * Flat product on/off backend */ -class Mode extends \Magento\App\Config\Value +class Mode extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Catalog\Model\Indexer\Product\Flat\Processor @@ -41,7 +41,7 @@ class Mode extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor * @param \Magento\Indexer\Model\Indexer\State $indexerState * @param \Magento\Model\Resource\AbstractResource $resource @@ -51,7 +51,7 @@ class Mode extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor, \Magento\Indexer\Model\Indexer\State $indexerState, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php index 9a05fcc933d946e43314bb2aef66ec9c37709a9d..56deffd2de59132df4bbd614e2472d9047bb59b1 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php @@ -50,11 +50,11 @@ class TableBuilder /** * @param \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Catalog\Helper\Product\Flat\Indexer $productIndexerHelper, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_productIndexerHelper = $productIndexerHelper; $this->_connection = $resource->getConnection('write'); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php index 15f304214dab0fc45513dba3ce17bb5542839ba6..d99b40fd268f6c778254b1efdff831eb7751765f 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableData.php @@ -37,14 +37,14 @@ class TableData implements TableDataInterface protected $_connection; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->_resource = $resource; } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index d5ec3726c7f5928da644fa7bbdc7cde43f835e2d..f0e7d6c1124f73daba93c10b0577f7758f40d3b1 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -42,7 +42,7 @@ abstract class AbstractAction /** * Resource instance * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -54,7 +54,7 @@ abstract class AbstractAction /** * Core config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -105,8 +105,8 @@ abstract class AbstractAction protected $_useIdxTable = false; /** - * @param \Magento\App\Resource $resource - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -116,8 +116,8 @@ abstract class AbstractAction * @param string $defaultPriceIndexer */ public function __construct( - \Magento\App\Resource $resource, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/Observer.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/Observer.php index 252f25320e5689f32cf8d320f925998cca1cf44a..6eca7f1bba7f17e0982de409354d87e4d86bcf61 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/Observer.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/Observer.php @@ -33,7 +33,7 @@ class Observer protected $_storeManager; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -64,7 +64,7 @@ class Observer /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Eav\Model\Config $eavConfig @@ -72,7 +72,7 @@ class Observer */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScope.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScope.php index e38fb4c82d415ee04362249441a84864d48c5cd6..9caccb24802eded172e4ce48c7ff2d02c55041b8 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScope.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScope.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Model\Indexer\Product\Price\System\Config; /** * Price scope backend model */ -class PriceScope extends \Magento\App\Config\Value +class PriceScope extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Indexer\Model\IndexerInterface @@ -36,7 +36,7 @@ class PriceScope extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Indexer\Model\IndexerInterface $indexer * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -45,7 +45,7 @@ class PriceScope extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Indexer\Model\IndexerInterface $indexer, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Model/Indexer/Url.php b/app/code/Magento/Catalog/Model/Indexer/Url.php index 57ec21166d336e245e7d232c60362a15a41f5fc4..51da787ac958c213c743b774a50a09e524317320 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Url.php +++ b/app/code/Magento/Catalog/Model/Indexer/Url.php @@ -52,7 +52,7 @@ class Url extends \Magento\Index\Model\Indexer\AbstractIndexer \Magento\Catalog\Model\Category::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE), \Magento\Store\Model\Store::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE), \Magento\Store\Model\Group::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE), - \Magento\App\Config\ValueInterface::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE) + \Magento\Framework\App\Config\ValueInterface::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE) ); /** @@ -162,7 +162,7 @@ class Url extends \Magento\Index\Model\Indexer\AbstractIndexer $result = false; } } else { - if ($entity == \Magento\App\Config\ValueInterface::ENTITY) { + if ($entity == \Magento\Framework\App\Config\ValueInterface::ENTITY) { $configData = $event->getDataObject(); if ($configData && in_array($configData->getPath(), $this->_relatedConfigSettings)) { $result = $configData->isValueChanged(); @@ -201,7 +201,7 @@ class Url extends \Magento\Index\Model\Indexer\AbstractIndexer case \Magento\Store\Model\Store::ENTITY: case \Magento\Store\Model\Store::ENTITY: - case \Magento\App\Config\ValueInterface::ENTITY: + case \Magento\Framework\App\Config\ValueInterface::ENTITY: $process = $event->getProcess(); $process->changeStatus(\Magento\Index\Model\Process::STATUS_REQUIRE_REINDEX); break; diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php index 01e3f0dbfbeade3454a519822e3f15b176886844..b893391cdec77dc131d528811e56da63cef54baa 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php @@ -92,7 +92,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter protected $_customerSession; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -104,7 +104,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data */ public function __construct( @@ -115,7 +115,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = array() ) { $this->_resource = $filterPriceFactory->create(); diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 3c336590c5e272d84e2a3e925556f3ff9933df47..0d211c4e5f2c84d15dee5711504f816505fe17c7 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -25,11 +25,12 @@ */ namespace Magento\Catalog\Model; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Object\IdentityInterface; + /** * Catalog product model * - * @method Resource\Product getResource() - * @method Resource\Product _getResource() * @method \Magento\Catalog\Model\Product setHasError(bool $value) * @method null|bool getHasError() * @method \Magento\Catalog\Model\Product setTypeId(string $typeId) @@ -37,10 +38,11 @@ namespace Magento\Catalog\Model; * @method array getAssociatedProductIds() * @method \Magento\Catalog\Model\Product setNewVariationsAttributeSetId(int $value) * @method int getNewVariationsAttributeSetId() + * @method \Magento\Catalog\Model\Resource\Product\Collection getCollection() * * @SuppressWarnings(PHPMD.LongVariable) */ -class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\Object\IdentityInterface +class Product extends \Magento\Catalog\Model\AbstractModel implements IdentityInterface, SaleableInterface { /** * Entity code. @@ -48,6 +50,9 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O */ const ENTITY = 'catalog_product'; + /** + * Product cache tag + */ const CACHE_TAG = 'catalog_product'; const CACHE_CATEGORY_TAG = 'catalog_category_product'; @@ -233,7 +238,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -252,6 +257,11 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O */ protected $_productPriceIndexerProcessor; + /** + * @var \Magento\Pricing\PriceInfo\Base + */ + protected $_priceInfo; + /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry @@ -273,7 +283,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * @param Resource\Product $resource * @param Resource\Product\Collection $resourceCollection * @param \Magento\Data\CollectionFactory $collectionFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Indexer\Model\IndexerInterface $categoryIndexer * @param Indexer\Product\Flat\Processor $productFlatIndexerProcessor * @param Indexer\Product\Price\Processor $productPriceIndexerProcessor @@ -302,7 +312,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O Resource\Product $resource, Resource\Product\Collection $resourceCollection, \Magento\Data\CollectionFactory $collectionFactory, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Indexer\Model\IndexerInterface $categoryIndexer, \Magento\Catalog\Model\Indexer\Product\Flat\Processor $productFlatIndexerProcessor, \Magento\Catalog\Model\Indexer\Product\Price\Processor $productPriceIndexerProcessor, @@ -557,7 +567,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O } } - return (array)$this->_getData('category_ids'); + return (array) $this->_getData('category_ids'); } /** @@ -704,7 +714,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O public function canAffectOptions($value = null) { if (null !== $value) { - $this->_canAffectOptions = (bool)$value; + $this->_canAffectOptions = (bool) $value; } return $this->_canAffectOptions; } @@ -730,9 +740,23 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O $this->_indexIndexer->processEntityAction($this, self::ENTITY, \Magento\Index\Model\Event::TYPE_SAVE); $this->_getResource()->addCommitCallback(array($this, 'reindex')); + $this->reloadPriceInfo(); return $result; } + /** + * Set quantity for product + * + * @param float $qty + * @return $this + */ + public function setQty($qty) + { + $this->setData('qty', $qty); + $this->reloadPriceInfo(); + return $this; + } + /** * Callback for entity reindex * @@ -826,6 +850,19 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O return $this->_catalogProductType->priceFactory($this->getTypeId()); } + /** + * Get product Price Info object + * + * @return \Magento\Pricing\PriceInfo\Base + */ + public function getPriceInfo() + { + if (!$this->_priceInfo) { + $this->_priceInfo = $this->_catalogProductType->getPriceInfo($this); + } + return $this->_priceInfo; + } + /** * Get product group price * @@ -841,6 +878,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * * @param float $qty * @return float|array + * @deprecated */ public function getTierPrice($qty = null) { @@ -851,6 +889,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * Count how many tier prices we have for the product * * @return int + * @deprecated */ public function getTierPriceCount() { @@ -858,10 +897,11 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O } /** - * Get formated by currency tier price + * Get formatted by currency tier price * * @param float $qty * @return array || double + * @deprecated */ public function getFormatedTierPrice($qty = null) { @@ -869,7 +909,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O } /** - * Get formated by currency product price + * Get formatted by currency product price * * @return array || double */ @@ -933,6 +973,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * Returns special price * * @return float + * @deprecated see \Magento\Catalog\Pricing\Price\SpecialPrice */ public function getSpecialPrice() { @@ -943,6 +984,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * Returns starting date of the special price * * @return mixed + * @deprecated see \Magento\Catalog\Pricing\Price\SpecialPrice */ public function getSpecialFromDate() { @@ -953,6 +995,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * Returns end date of the special price * * @return mixed + * @deprecated see \Magento\Catalog\Pricing\Price\SpecialPrice */ public function getSpecialToDate() { @@ -1175,7 +1218,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O */ public function getMediaGalleryImages() { - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); if (!$this->hasData('media_gallery_images') && is_array($this->getMediaGallery('images'))) { $images = $this->_collectionFactory->create(); foreach ($this->getMediaGallery('images') as $image) { @@ -1478,7 +1521,8 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O public function toArray(array $arrAttributes = array()) { $data = parent::toArray($arrAttributes); - if ($stock = $this->getStockItem()) { + $stock = $this->getStockItem(); + if ($stock) { $data['stock_item'] = $stock->toArray(); } unset($data['stock_item']['product']); @@ -1916,7 +1960,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O * unload product options */ if (!empty($this->_options)) { - foreach ($this->_options as $key => $option) { + foreach ($this->_options as $option) { $option->setProduct(); $option->clearInstance(); } @@ -2020,4 +2064,17 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements \Magento\O } return $identities; } + + /** + * Reload PriceInfo object + * + * @return \Magento\Pricing\PriceInfo\Base + */ + public function reloadPriceInfo() + { + if ($this->_priceInfo) { + $this->_priceInfo = null; + return $this->getPriceInfo(); + } + } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php index 6db0ec5764b242dab4baed9168339c2b53a25514..83b287430eedbcaab59424f654f22e1d4c3ab789 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php @@ -44,7 +44,7 @@ class Groupprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Groupp * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice */ @@ -53,7 +53,7 @@ class Groupprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Groupp \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice ) { diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php index d7873cb3def2615659de967d62af3e9f7bd43135..1fa605d236473cb8c189772b697954fcf21ed3a3 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php @@ -58,7 +58,7 @@ abstract class AbstractGroupprice extends Price * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Product\Type $catalogProductType */ public function __construct( @@ -66,7 +66,7 @@ abstract class AbstractGroupprice extends Price \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Product\Type $catalogProductType ) { $this->_catalogProductType = $catalogProductType; @@ -176,16 +176,18 @@ abstract class AbstractGroupprice extends Price // add global group prices for duplicates find if (!$attribute->isScopeGlobal() && $object->getStoreId()) { $origGroupPrices = $object->getOrigData($attribute->getName()); - foreach ($origGroupPrices as $price) { - if ($price['website_id'] == 0) { - $compare = join( - '-', - array_merge( - array($price['website_id'], $price['cust_group']), - $this->_getAdditionalUniqueFields($price) - ) - ); - $duplicates[$compare] = true; + if ($origGroupPrices) { + foreach ($origGroupPrices as $price) { + if ($price['website_id'] == 0) { + $compare = join( + '-', + array_merge( + array($price['website_id'], $price['cust_group']), + $this->_getAdditionalUniqueFields($price) + ) + ); + $duplicates[$compare] = true; + } } } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php index c53584a94fb34e5ba0be634be2baed729d92a4dc..c4832af4b65e9ac2db4e639770d5cd223fda7635 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php @@ -96,7 +96,7 @@ class Media extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media $resourceProductAttribute */ public function __construct( @@ -106,7 +106,7 @@ class Media extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Product\Media\Config $mediaConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media $resourceProductAttribute ) { $this->_productFactory = $productFactory; @@ -115,7 +115,7 @@ class Media extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend $this->_coreData = $coreData; $this->_resourceModel = $resourceProductAttribute; $this->_mediaConfig = $mediaConfig; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_mediaDirectory->create($this->_mediaConfig->getBaseMediaPath()); $this->_mediaDirectory->create($this->_mediaConfig->getBaseTmpMediaPath()); diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Price.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Price.php index a255ce865fc69f1543fc56f05e6102bfffa333c1..bd4623ffddaaf144a9077966919631bbbc420ce9 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Price.php @@ -58,7 +58,7 @@ class Price extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend /** * Core config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -69,14 +69,14 @@ class Price extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( \Magento\Logger $logger, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php index 5507f113041daeb7408beed1d8d120ba4c40b95e..8b735c4b3ee6b3f7d6a9df16b18a2359b987edaf 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php @@ -48,7 +48,7 @@ class Tierprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Grouppr * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice */ @@ -57,7 +57,7 @@ class Tierprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Grouppr \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice $productAttributeTierprice ) { diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php index 18d6a073681b87cbe2a40834337281f7b2b4e2d6..980b5deea947b7425471a120bebe2dc1b6c12c41 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php @@ -36,7 +36,7 @@ namespace Magento\Catalog\Model\Product\Attribute\Source; class Countryofmanufacture extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -59,12 +59,12 @@ class Countryofmanufacture extends \Magento\Eav\Model\Entity\Attribute\Source\Ab * * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType */ public function __construct( \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Cache\Type\Config $configCacheType + \Magento\Framework\App\Cache\Type\Config $configCacheType ) { $this->_countryFactory = $countryFactory; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index 0b20783ec64e495be545b15a27e2ea451de685c1..e4bef13afcec749e040648b3b0b106d58a33d19e 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -163,7 +163,7 @@ class Image extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -187,11 +187,11 @@ class Image extends \Magento\Model\AbstractModel * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Image\Factory $imageFactory * @param \Magento\View\Url $viewUrl * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -202,11 +202,11 @@ class Image extends \Magento\Model\AbstractModel \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Image\Factory $imageFactory, \Magento\View\Url $viewUrl, \Magento\View\FileSystem $viewFileSystem, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -215,7 +215,7 @@ class Image extends \Magento\Model\AbstractModel $this->_catalogProductMediaConfig = $catalogProductMediaConfig; $this->_coreFileStorageDatabase = $coreFileStorageDatabase; parent::__construct($context, $registry, $resource, $resourceCollection, $data); - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_mediaDirectory->create($this->_catalogProductMediaConfig->getBaseMediaPath()); $this->_imageFactory = $imageFactory; $this->_viewUrl = $viewUrl; diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index ae31863b036edaca45ce11a5044154bd911583f1..a3f3f5ebea83a0bf5502acc9ec33f44c947a2d7c 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -27,6 +27,7 @@ namespace Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Resource\Product\Option\Value\Collection; +use Magento\Catalog\Pricing\Price\BasePrice; use Magento\Model\Exception; use Magento\Model\AbstractModel; @@ -430,7 +431,7 @@ class Option extends AbstractModel public function getPrice($flag = false) { if ($flag && $this->getPriceType() == 'percent') { - $basePrice = $this->getProduct()->getFinalPrice(); + $basePrice = $this->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_TYPE_BASE_PRICE)->getValue(); $price = $basePrice * ($this->_getData('price') / 100); return $price; } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php index 6f11f851272154341bb24deec92e5efa29ee6995..e9e615fc5249cc4d43282dee9140c1961af998c7 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php @@ -46,13 +46,13 @@ class Date extends \Magento\Catalog\Model\Product\Option\Type\DefaultType /** * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, array $data = array() ) { diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php index cccd40c2a807fd1d79da209b180d0b767ad6cebd..fb2020913af2381835aa1dc9f566daf839bb13e4 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php @@ -60,7 +60,7 @@ class DefaultType extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -75,12 +75,12 @@ class DefaultType extends \Magento\Object * Construct * * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = array() ) { $this->_checkoutSession = $checkoutSession; diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php index cbe1f6ad0742fdde419e4c8fe1672f66e9f1495c..6c1e2868ec7dc001cf980a1a7ee6d58da25b5d84 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File.php @@ -48,7 +48,7 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType protected $_formattedOptionValue = null; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -116,23 +116,23 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType /** * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Item\OptionFactory $itemOptionFactory * @param \Magento\Catalog\Model\Product\Option\UrlBuilder $urlBuilder * @param \Magento\Escaper $escaper * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\File\Size $fileSize * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Item\OptionFactory $itemOptionFactory, \Magento\Catalog\Model\Product\Option\UrlBuilder $urlBuilder, \Magento\Escaper $escaper, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\File\Size $fileSize, array $data = array() ) { @@ -141,8 +141,8 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType $this->_escaper = $escaper; $this->_coreFileStorageDatabase = $coreFileStorageDatabase; $this->_filesystem = $filesystem; - $this->_rootDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); - $this->_mediaDirectory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_rootDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); + $this->_mediaDirectory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_fileSize = $fileSize; $this->_data = $data; parent::__construct($checkoutSession, $scopeConfig, $data); @@ -366,7 +366,7 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType $filePath = $dispersion; - $tmpDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::SYS_TMP_DIR); + $tmpDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); $fileHash = md5($tmpDirectory->readFile($tmpDirectory->getRelativePath($fileInfo['tmp_name']))); $filePath .= '/' . $fileHash . '.' . $extension; $fileFullPath = $this->_mediaDirectory->getAbsolutePath($this->_quotePath . $filePath); @@ -393,7 +393,7 @@ class File extends \Magento\Catalog\Model\Product\Option\Type\DefaultType $_height = $_imageSize[1]; } } - $uri = $this->_filesystem->getUri(\Magento\App\Filesystem::MEDIA_DIR); + $uri = $this->_filesystem->getUri(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->setUserValue( array( 'type' => $fileInfo['type'], diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php index c0211c1fb064a68c52d216c7395bad8e83641da2..c9e531c3cd47075e89d39a7197485f6b30ca4f3c 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php @@ -51,14 +51,14 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType /** * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Stdlib\String $string * @param \Magento\Escaper $escaper * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Stdlib\String $string, \Magento\Escaper $escaper, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php index c1941fc397d4fd35c4b48162139a8e9f34658f86..b33976f4e014514e1751c3cfeb8cab3b319b8831 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Text.php @@ -46,14 +46,14 @@ class Text extends \Magento\Catalog\Model\Product\Option\Type\DefaultType /** * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Escaper $escaper * @param \Magento\Stdlib\String $string * @param array $data */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Escaper $escaper, \Magento\Stdlib\String $string, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index 3a1992c8c58b1882cb9557b64c1decc4e0c13b5e..b49a23f98bf455d69c1e16566576203085379d52 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -44,6 +44,11 @@ use Magento\Catalog\Model\Product\Option; */ class Value extends \Magento\Model\AbstractModel { + /** + * Option type percent + */ + const TYPE_PERCENT = 'percent'; + /** * @var array */ @@ -226,7 +231,7 @@ class Value extends \Magento\Model\AbstractModel */ public function getPrice($flag = false) { - if ($flag && $this->getPriceType() == 'percent') { + if ($flag && $this->getPriceType() == self::TYPE_PERCENT) { $basePrice = $this->getOption()->getProduct()->getFinalPrice(); $price = $basePrice * ($this->_getData('price') / 100); return $price; diff --git a/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php index 1f1f7d8078d156ab2a453f973a41419c29054767..1df19467afdf4838900fe70dcf25a232f90fedf7 100644 --- a/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php @@ -64,17 +64,17 @@ class Toolbar /** * Request * - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $request; /** * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request */ public function __construct( \Magento\Stdlib\Cookie $cookie, - \Magento\App\Request\Http $request + \Magento\Framework\App\Request\Http $request ) { $this->cookie = $cookie; $this->request = $request; diff --git a/app/code/Magento/Catalog/Model/Product/Type.php b/app/code/Magento/Catalog/Model/Product/Type.php index bc7beb87b8986435c3a5cbb4f3d53b0bce1f3dc5..39bf320e2de0242f4fd39980ef8bb5918486fe1d 100644 --- a/app/code/Magento/Catalog/Model/Product/Type.php +++ b/app/code/Magento/Catalog/Model/Product/Type.php @@ -29,6 +29,9 @@ */ namespace Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product; +use Magento\Pricing\Object\SaleableInterface; + class Type { /**#@+ @@ -39,7 +42,6 @@ class Type const TYPE_BUNDLE = 'bundle'; const TYPE_VIRTUAL = 'virtual'; - /**#@-*/ /** @@ -104,21 +106,29 @@ class Type */ protected $_priceFactory; + /** + * @var \Magento\Pricing\PriceInfo\Factory + */ + protected $_priceInfoFactory; + /** * Construct * * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config * @param \Magento\Catalog\Model\Product\Type\Pool $productTypePool * @param \Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory + * @param \Magento\Pricing\PriceInfo\Factory $priceInfoFactory */ public function __construct( \Magento\Catalog\Model\ProductTypes\ConfigInterface $config, \Magento\Catalog\Model\Product\Type\Pool $productTypePool, - \Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory + \Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory, + \Magento\Pricing\PriceInfo\Factory $priceInfoFactory ) { $this->_config = $config; $this->_productTypePool = $productTypePool; $this->_priceFactory = $priceFactory; + $this->_priceInfoFactory = $priceInfoFactory; } /** @@ -168,6 +178,17 @@ class Type return $this->_priceModels[$productType]; } + /** + * Get Product Price Info object + * + * @param SaleableInterface $product + * @return \Magento\Pricing\PriceInfoInterface + */ + public function getPriceInfo(SaleableInterface $product) + { + return $this->_priceInfoFactory->create($product); + } + /** * Get product type labels array * diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 9b4a2518030ba9d6a9cdea68497e62423dfa312d..e6c71cfca1a8a283caf2d1bd20d1b7d659871dc0 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -109,7 +109,7 @@ abstract class AbstractType const OPTION_PREFIX = 'option_'; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -188,7 +188,7 @@ abstract class AbstractType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param array $data @@ -201,7 +201,7 @@ abstract class AbstractType \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Registry $coreRegistry, \Magento\Logger $logger, array $data = array() @@ -508,7 +508,7 @@ abstract class AbstractType $path = dirname($dst); try { - $rootDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $rootDir = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $rootDir->create($rootDir->getRelativePath($path)); } catch (\Magento\Filesystem\FilesystemException $e) { throw new \Magento\Model\Exception( diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index a87d9712fa669c673312783623d2ed3ee546bddf..f1f9bdb1692d70076f4b59354a02da7f8470d6ba 100755 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -24,20 +24,19 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Product type price model - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> - */ namespace Magento\Catalog\Model\Product\Type; use Magento\Catalog\Model\Product; use Magento\Store\Model\Store; +/** + * Product type price model + */ class Price { + /** + * Product price cache tag + */ const CACHE_TAG = 'PRODUCT_PRICE'; /** @@ -50,7 +49,7 @@ class Price * * @var \Magento\Event\ManagerInterface */ - protected $_eventManager = null; + protected $_eventManager; /** * Customer session @@ -122,7 +121,7 @@ class Price */ public function getBasePrice($product, $qty = null) { - $price = (double)$product->getPrice(); + $price = (float) $product->getPrice(); return min( $this->_applyGroupPrice($product, $price), $this->_applyTierPrice($product, $qty, $price), @@ -189,6 +188,7 @@ class Price * * @param Product $product * @return float + * @deprecated see \Magento\Catalog\Pricing\Price\GroupPrice */ public function getGroupPrice($product) { @@ -247,6 +247,7 @@ class Price * @param float $qty * @param Product $product * @return float|array + * @deprecated */ public function getTierPrice($qty, $product) { @@ -308,19 +309,19 @@ class Price return $prevPrice; } else { $qtyCache = array(); - foreach ($prices as $i => $price) { + foreach ($prices as $priceKey => $price) { if ($price['cust_group'] != $custGroup && $price['cust_group'] != $allGroups) { - unset($prices[$i]); - } else if (isset($qtyCache[$price['price_qty']])) { - $j = $qtyCache[$price['price_qty']]; - if ($prices[$j]['website_price'] > $price['website_price']) { - unset($prices[$j]); - $qtyCache[$price['price_qty']] = $i; + unset($prices[$priceKey]); + } elseif (isset($qtyCache[$price['price_qty']])) { + $priceQty = $qtyCache[$price['price_qty']]; + if ($prices[$priceQty]['website_price'] > $price['website_price']) { + unset($prices[$priceQty]); + $qtyCache[$price['price_qty']] = $priceKey; } else { - unset($prices[$i]); + unset($prices[$priceKey]); } } else { - $qtyCache[$price['price_qty']] = $i; + $qtyCache[$price['price_qty']] = $priceKey; } } } @@ -363,6 +364,7 @@ class Price * * @param Product $product * @return int + * @deprecated */ public function getTierPriceCount($product) { @@ -376,12 +378,13 @@ class Price * @param float $qty * @param Product $product * @return array|float + * @deprecated */ public function getFormatedTierPrice($qty, $product) { $price = $product->getTierPrice($qty); if (is_array($price)) { - foreach ($price as $index => $value) { + foreach (array_keys($price) as $index) { $price[$index]['formated_price'] = $this->_storeManager->getStore()->convertPrice( $price[$index]['website_price'], true @@ -412,22 +415,20 @@ class Price * @param int $qty * @param float $finalPrice * @return float + * @deprecated */ protected function _applyOptionsPrice($product, $qty, $finalPrice) { - if ($optionIds = $product->getCustomOption('option_ids')) { + $optionIds = $product->getCustomOption('option_ids'); + if ($optionIds) { $basePrice = $finalPrice; foreach (explode(',', $optionIds->getValue()) as $optionId) { if ($option = $product->getOptionById($optionId)) { $confItemOption = $product->getCustomOption('option_' . $option->getId()); - $group = $option->groupFactory( - $option->getType() - )->setOption( - $option - )->setConfigurationItemOption( - $confItemOption - ); + $group = $option->groupFactory($option->getType()) + ->setOption($option) + ->setConfigurationItemOption($confItemOption); $finalPrice += $group->getOptionPrice($confItemOption->getValue(), $basePrice); } } @@ -443,7 +444,7 @@ class Price * @param float $specialPrice * @param string $specialPriceFrom * @param string $specialPriceTo - * @param float|null|false $rulePrice + * @param bool|float|null $rulePrice * @param mixed|null $wId * @param mixed|null $gId * @param int|null $productId diff --git a/app/code/Magento/Catalog/Model/Product/Validator.php b/app/code/Magento/Catalog/Model/Product/Validator.php index 54a6b5a2eeec79b462ac1c7eb49fd21b47706755..902b783aef4c4ae4cd7737cf803da52820feba88 100644 --- a/app/code/Magento/Catalog/Model/Product/Validator.php +++ b/app/code/Magento/Catalog/Model/Product/Validator.php @@ -24,7 +24,7 @@ */ namespace Magento\Catalog\Model\Product; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Catalog\Model\Product; class Validator diff --git a/app/code/Magento/Catalog/Model/Resource/AbstractResource.php b/app/code/Magento/Catalog/Model/Resource/AbstractResource.php index bea13f09562abec4332da6b469d926e96377319f..eb99f490956ef0d63ab8f9b730e316e875743ece 100644 --- a/app/code/Magento/Catalog/Model/Resource/AbstractResource.php +++ b/app/code/Magento/Catalog/Model/Resource/AbstractResource.php @@ -25,12 +25,10 @@ */ namespace Magento\Catalog\Model\Resource; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; + /** * Catalog entity abstract model - * - * @category Magento - * @package Magento_Catalog - * @author Magento Core Team <core@magentocommerce.com> */ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity { @@ -58,7 +56,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -69,7 +67,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * @param array $data */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, @@ -81,11 +79,19 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity ) { $this->_storeManager = $storeManager; $this->_modelFactory = $modelFactory; - parent::__construct($resource, $eavConfig, $attrSetEntity, $localeFormat, $resourceHelper, $universalFactory); + parent::__construct( + $resource, + $eavConfig, + $attrSetEntity, + $localeFormat, + $resourceHelper, + $universalFactory, + $data + ); } /** - * Redeclare attribute model + * Re-declare attribute model * * @return string */ @@ -114,33 +120,25 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity protected function _isApplicableAttribute($object, $attribute) { $applyTo = $attribute->getApplyTo(); - return (count( - $applyTo - ) == 0 || in_array( - $object->getTypeId(), - $applyTo - )) && $attribute->isInSet( - $object->getAttributeSetId() - ); + return (count($applyTo) == 0 || in_array($object->getTypeId(), $applyTo)) + && $attribute->isInSet($object->getAttributeSetId()); } /** * Check whether attribute instance (attribute, backend, frontend or source) has method and applicable * - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute|\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend|\Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend|\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource $instance + * @param AbstractAttribute|\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend|\Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend|\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource $instance * @param string $method * @param array $args array of arguments * @return boolean */ protected function _isCallableAttributeInstance($instance, $method, $args) { - if ($instance instanceof \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend && - ($method == 'beforeSave' || - ($method = 'afterSave')) + if ($instance instanceof \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend + && ($method == 'beforeSave' || $method = 'afterSave') ) { $attributeCode = $instance->getAttribute()->getAttributeCode(); - if (isset($args[0]) && $args[0] instanceof \Magento\Object && $args[0]->getData($attributeCode) === false - ) { + if (isset($args[0]) && $args[0] instanceof \Magento\Object && $args[0]->getData($attributeCode) === false) { return false; } } @@ -164,9 +162,9 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * to single store mode. We should load correct values */ if ($this->_storeManager->hasSingleStore()) { - $storeId = (int)$this->_storeManager->getStore(true)->getId(); + $storeId = (int) $this->_storeManager->getStore(true)->getId(); } else { - $storeId = (int)$object->getStoreId(); + $storeId = (int) $object->getStoreId(); } $setId = $object->getAttributeSetId(); @@ -175,16 +173,12 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity $storeIds[] = $storeId; } - $select = $this->_getReadAdapter()->select()->from( - array('attr_table' => $table), - array() - )->where( - "attr_table.{$this->getEntityIdField()} = ?", - $object->getId() - )->where( - 'attr_table.store_id IN (?)', - $storeIds - ); + $select = $this->_getReadAdapter() + ->select() + ->from(array('attr_table' => $table), array()) + ->where("attr_table.{$this->getEntityIdField()} = ?", $object->getId()) + ->where('attr_table.store_id IN (?)', $storeIds); + if ($setId) { $select->join( array('set_table' => $this->getTable('eav_entity_attribute')), @@ -254,14 +248,14 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * Insert or Update attribute data * * @param \Magento\Catalog\Model\AbstractModel $object - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute + * @param AbstractAttribute $attribute * @param mixed $value * @return $this */ protected function _saveAttributeValue($object, $attribute, $value) { $write = $this->_getWriteAdapter(); - $storeId = (int)$this->_storeManager->getStore($object->getStoreId())->getId(); + $storeId = (int) $this->_storeManager->getStore($object->getStoreId())->getId(); $table = $attribute->getBackend()->getTable(); /** @@ -297,13 +291,13 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * Update attribute value for store */ $this->_attributeValuesToSave[$table][] = $bind; - } else if ($attribute->isScopeWebsite() && $storeId != $this->getDefaultStoreId()) { + } elseif ($attribute->isScopeWebsite() && $storeId != $this->getDefaultStoreId()) { /** * Update attribute value for website */ $storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true); foreach ($storeIds as $storeId) { - $bind['store_id'] = (int)$storeId; + $bind['store_id'] = (int) $storeId; $this->_attributeValuesToSave[$table][] = $bind; } } else { @@ -321,7 +315,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * Insert entity attribute value * * @param \Magento\Object $object - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute + * @param AbstractAttribute $attribute * @param mixed $value * @return $this */ @@ -330,25 +324,16 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity /** * save required attributes in global scope every time if store id different from default */ - $storeId = (int)$this->_storeManager->getStore($object->getStoreId())->getId(); + $storeId = (int) $this->_storeManager->getStore($object->getStoreId())->getId(); if ($attribute->getIsRequired() && $this->getDefaultStoreId() != $storeId) { $table = $attribute->getBackend()->getTable(); - $select = $this->_getReadAdapter()->select()->from( - $table - )->where( - 'entity_type_id = ?', - $attribute->getEntityTypeId() - )->where( - 'attribute_id = ?', - $attribute->getAttributeId() - )->where( - 'store_id = ?', - $this->getDefaultStoreId() - )->where( - 'entity_id = ?', - $object->getEntityId() - ); + $select = $this->_getReadAdapter()->select() + ->from($table) + ->where('entity_type_id = ?', $attribute->getEntityTypeId()) + ->where('attribute_id = ?', $attribute->getAttributeId()) + ->where('store_id = ?', $this->getDefaultStoreId()) + ->where('entity_id = ?', $object->getEntityId()); $row = $this->_getReadAdapter()->fetchOne($select); if (!$row) { @@ -373,7 +358,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * Update entity attribute value * * @param \Magento\Object $object - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute + * @param AbstractAttribute $attribute * @param mixed $valueId * @param mixed $value * @return $this @@ -397,18 +382,12 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity $adapter = $this->_getWriteAdapter(); $table = $attribute->getBackend()->getTable(); $entityIdField = $attribute->getBackend()->getEntityIdField(); - $select = $adapter->select()->from( - $table, - 'value_id' - )->where( - 'entity_type_id = :entity_type_id' - )->where( - "{$entityIdField} = :entity_field_id" - )->where( - 'store_id = :store_id' - )->where( - 'attribute_id = :attribute_id' - ); + $select = $adapter->select() + ->from($table, 'value_id') + ->where('entity_type_id = :entity_type_id') + ->where("$entityIdField = :entity_field_id") + ->where('store_id = :store_id') + ->where('attribute_id = :attribute_id'); $bind = array( 'entity_type_id' => $object->getEntityTypeId(), 'entity_field_id' => $object->getId(), @@ -421,16 +400,16 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity */ if ($valueId) { $bind = array('value' => $this->_prepareValueForSave($value, $attribute)); - $where = array('value_id = ?' => (int)$valueId); + $where = array('value_id = ?' => (int) $valueId); $adapter->update($table, $bind, $where); } else { $bind = array( - $entityIdField => (int)$object->getId(), - 'entity_type_id' => (int)$object->getEntityTypeId(), - 'attribute_id' => (int)$attribute->getId(), + $entityIdField => (int) $object->getId(), + 'entity_type_id' => (int) $object->getEntityTypeId(), + 'attribute_id' => (int) $attribute->getId(), 'value' => $this->_prepareValueForSave($value, $attribute), - 'store_id' => (int)$storeId + 'store_id' => (int) $storeId ); $adapter->insert($table, $bind); @@ -461,11 +440,11 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity foreach ($info as $itemData) { $attribute = $this->getAttribute($itemData['attribute_id']); if ($attribute->isScopeStore()) { - $storeAttributes[] = (int)$itemData['attribute_id']; + $storeAttributes[] = (int) $itemData['attribute_id']; } elseif ($attribute->isScopeWebsite()) { - $websiteAttributes[] = (int)$itemData['attribute_id']; + $websiteAttributes[] = (int) $itemData['attribute_id']; } elseif ($itemData['value_id'] !== null) { - $globalValues[] = (int)$itemData['value_id']; + $globalValues[] = (int) $itemData['value_id']; } } @@ -501,7 +480,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity if (!empty($storeAttributes)) { $delCondition = $condition; $delCondition['attribute_id IN(?)'] = $storeAttributes; - $delCondition['store_id = ?'] = (int)$object->getStoreId(); + $delCondition['store_id = ?'] = (int) $object->getStoreId(); $adapter->delete($table, $delCondition); } @@ -529,11 +508,11 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity /** * Check is attribute value empty * - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute + * @param AbstractAttribute $attribute * @param mixed $value * @return bool */ - protected function _isAttributeValueEmpty(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute, $value) + protected function _isAttributeValueEmpty(AbstractAttribute $attribute, $value) { return $value === false; } @@ -543,23 +522,20 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity * Checks also attribute's store scope: * We should insert on duplicate key update values if we unchecked 'STORE VIEW' checkbox in store view. * - * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute + * @param AbstractAttribute $attribute * @param mixed $value New value of the attribute. * @param array &$origData * @return bool */ - protected function _canUpdateAttribute( - \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute, - $value, - array &$origData - ) { + protected function _canUpdateAttribute(AbstractAttribute $attribute, $value, array &$origData) + { $result = parent::_canUpdateAttribute($attribute, $value, $origData); - if ($result && ($attribute->isScopeStore() || $attribute->isScopeWebsite()) && !$this->_isAttributeValueEmpty( - $attribute, - $value - ) && $value == $origData[$attribute->getAttributeCode()] && isset( - $origData['store_id'] - ) && $origData['store_id'] != $this->getDefaultStoreId() + if ($result + && ($attribute->isScopeStore() || $attribute->isScopeWebsite()) + && !$this->_isAttributeValueEmpty($attribute, $value) + && $value == $origData[$attribute->getAttributeCode()] + && isset($origData['store_id']) + && $origData['store_id'] != $this->getDefaultStoreId() ) { return false; } @@ -590,15 +566,15 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity $staticTable = null; $adapter = $this->_getReadAdapter(); - foreach ($attribute as $_attribute) { + foreach ($attribute as $item) { /* @var $attribute \Magento\Catalog\Model\Entity\Attribute */ - $_attribute = $this->getAttribute($_attribute); - if (!$_attribute) { + $item = $this->getAttribute($item); + if (!$item) { continue; } - $attributeCode = $_attribute->getAttributeCode(); - $attrTable = $_attribute->getBackend()->getTable(); - $isStatic = $_attribute->getBackend()->isStatic(); + $attributeCode = $item->getAttributeCode(); + $attrTable = $item->getBackend()->getTable(); + $isStatic = $item->getBackend()->isStatic(); if ($isStatic) { $staticAttributes[] = $attributeCode; @@ -607,7 +583,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity /** * That structure needed to avoid farther sql joins for getting attribute's code by id */ - $typedAttributes[$attrTable][$_attribute->getId()] = $attributeCode; + $typedAttributes[$attrTable][$item->getId()] = $attributeCode; } } @@ -631,23 +607,16 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity $store = $store->getId(); } - $store = (int)$store; + $store = (int) $store; if ($typedAttributes) { foreach ($typedAttributes as $table => $_attributes) { - $select = $adapter->select()->from( - array('default_value' => $table), - array('attribute_id') - )->where( - 'default_value.attribute_id IN (?)', - array_keys($_attributes) - )->where( - 'default_value.entity_type_id = :entity_type_id' - )->where( - 'default_value.entity_id = :entity_id' - )->where( - 'default_value.store_id = ?', - 0 - ); + $select = $adapter->select() + ->from(array('default_value' => $table), array('attribute_id')) + ->where('default_value.attribute_id IN (?)', array_keys($_attributes)) + ->where('default_value.entity_type_id = :entity_type_id') + ->where('default_value.entity_id = :entity_id') + ->where('default_value.store_id = ?', 0); + $bind = array('entity_type_id' => $this->getTypeId(), 'entity_id' => $entityId); if ($store != $this->getDefaultStoreId()) { diff --git a/app/code/Magento/Catalog/Model/Resource/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Attribute.php index 4fdf611c8274a608d0a091b41f9c0bedf9f0bb63..56944fea6ae7fe762ae65341845be2e98dafd1e9 100644 --- a/app/code/Magento/Catalog/Model/Resource/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Attribute.php @@ -49,14 +49,14 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute protected $attrLockValidator; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType * @param \Magento\Eav\Model\Config $eavConfig * @param LockValidatorInterface $lockValidator */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Entity\Type $eavEntityType, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Category.php b/app/code/Magento/Catalog/Model/Resource/Category.php index 39796dd0929c125cfe722de8e3514a1cd8929de8..583388a9f8205133efeebe8fe6e2f9868c732b83 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category.php +++ b/app/code/Magento/Catalog/Model/Resource/Category.php @@ -88,7 +88,7 @@ class Category extends AbstractResource /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -104,7 +104,7 @@ class Category extends AbstractResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 7ee17fbeca5b18742034ef80643a62bb01873239..711b89c8cd066f8b42be711fdc31d90cc52d1636 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -94,7 +94,7 @@ class Flat extends \Magento\Index\Model\Resource\AbstractResource protected $_categoryFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -102,7 +102,7 @@ class Flat extends \Magento\Index\Model\Resource\AbstractResource * @param \Magento\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Tree.php b/app/code/Magento/Catalog/Model/Resource/Category/Tree.php index 6edf7b8191fe056971bbf1342309c6ad767fe622..73f4c10f8b15b21f5cf682368d7f7322277a8d68 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Tree.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Tree.php @@ -84,7 +84,7 @@ class Tree extends \Magento\Data\Tree\Dbp protected $_storeId = null; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_coreResource; @@ -98,7 +98,7 @@ class Tree extends \Magento\Data\Tree\Dbp /** * Cache * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -113,18 +113,18 @@ class Tree extends \Magento\Data\Tree\Dbp * Construct * * @param \Magento\Catalog\Model\Resource\Category $catalogCategory - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Catalog\Model\Resource\Category\Collection\Factory $collectionFactory */ public function __construct( \Magento\Catalog\Model\Resource\Category $catalogCategory, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Attribute\Config $attributeConfig, \Magento\Catalog\Model\Resource\Category\Collection\Factory $collectionFactory diff --git a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php index b361dc0a5a54c99711dea7452039d5fe0e6ade66..f9d2b80827d1fd247a67e5baef3a4a03c390d730 100644 --- a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php @@ -55,7 +55,7 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory @@ -70,7 +70,7 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index 7e18d0a53ee44dbac24e02098ae2343d032d43fb..326ef93c3ff4b7d3717b679a464d1115521ceebd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -63,12 +63,12 @@ class Config extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig ) { diff --git a/app/code/Magento/Catalog/Model/Resource/Helper.php b/app/code/Magento/Catalog/Model/Resource/Helper.php index 8ddeda458a4e19f916d25cede32769fa5df8b913..ce0f1bcd94702ddb89840d12fcc5439f5eab7581 100644 --- a/app/code/Magento/Catalog/Model/Resource/Helper.php +++ b/app/code/Magento/Catalog/Model/Resource/Helper.php @@ -37,10 +37,10 @@ class Helper extends \Magento\Eav\Model\Resource\Helper /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix = 'Magento_Catalog') + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix = 'Magento_Catalog') { parent::__construct($resource, $modulePrefix); } diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index 5e8196ca77657eebf95750ff0a1cc6eb2ba5481b..16f47b3ea55c6647f00688f5a036e49c1a32cc97 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -47,10 +47,10 @@ class Price extends \Magento\Model\Resource\Db\AbstractDb protected $_eventManager = null; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Event\ManagerInterface $eventManager */ - public function __construct(\Magento\App\Resource $resource, \Magento\Event\ManagerInterface $eventManager) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Event\ManagerInterface $eventManager) { $this->_eventManager = $eventManager; parent::__construct($resource); diff --git a/app/code/Magento/Catalog/Model/Resource/Product.php b/app/code/Magento/Catalog/Model/Resource/Product.php index f8ea5c475eff15dfc9f9f59e2d8402be155746d6..c750956c9aa2279eead4433b51aaf0680fe079cc 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product.php +++ b/app/code/Magento/Catalog/Model/Resource/Product.php @@ -63,7 +63,7 @@ class Product extends AbstractResource /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -78,7 +78,7 @@ class Product extends AbstractResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php index 5690963628d0466a6b5cd3fa0e091844801f9076..2915c24604624033acecb6217050075bf93159d7 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Image.php @@ -39,7 +39,7 @@ class Image extends AbstractBackend /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -52,12 +52,12 @@ class Image extends AbstractBackend /** * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory ) { $this->_filesystem = $filesystem; @@ -91,7 +91,7 @@ class Image extends AbstractBackend return $this; } $path = $this->_filesystem->getDirectoryRead( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->getAbsolutePath( 'catalog/product/' ); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php index 0353f9c5bc46aac2504782d1b83fe12a84570a93..4ed91ec33096425c9739a88aa4501f48b02a75e6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php @@ -218,7 +218,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -266,14 +266,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -289,14 +289,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -582,7 +582,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl * Add attribute to entities in collection * If $attribute=='*' select all attributes * - * @param array|string|integer|\Magento\App\Config\Element $attribute + * @param array|string|integer|\Magento\Framework\App\Config\Element $attribute * @param bool|string $joinType * @return $this */ diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 03df6e6f556148f8349b2f76093bad70b92f8bb3..5684af1391b04d204d36f23d1c0d8d3c73befa99 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -76,14 +76,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -101,14 +101,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index 76210c7377570ef2fbccff4bb9fcf70423cece10..b835847747cdf225c31cf5d9a65525749e5acd2b 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -58,12 +58,12 @@ class Flat extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig ) { diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php index a904f3c7e9fbe4daf3f325b29aa0989389d6c43e..3e91650a7028992b79c3e0ec85c45de22b2cce76 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php @@ -44,10 +44,10 @@ abstract class AbstractIndexer extends \Magento\Index\Model\Resource\AbstractRes /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig */ - public function __construct(\Magento\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig) { $this->_eavConfig = $eavConfig; parent::__construct($resource); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php index 9ce0342ff060b3c8fd5db1a09ee747e130a5e835..dcec8844deb07195c1fb99b152f9dc84f3a049d9 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php @@ -56,13 +56,13 @@ class Eav extends AbstractIndexer protected $_eavDecimalFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory $eavDecimalFactory * @param \Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory $eavSourceFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory $eavDecimalFactory, \Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory $eavSourceFactory diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php index 53b201e90c6d9e25df2ecfff037f3743ae8e8f53..287c2b2b881c18323ac91d835c46b384f69e159d 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php @@ -44,12 +44,12 @@ abstract class AbstractEav extends \Magento\Catalog\Model\Resource\Product\Index /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Event\ManagerInterface $eventManager ) { diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index 08e6de301426bed36dd159f5cbaef48ab8e9115d..f63553580a9be4044dd5194f5886948033b8eb26 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -46,13 +46,13 @@ class Source extends AbstractEav /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php index 67c27dbf38323cfef526dabed4b13252cf0bbf5c..aee4071cf16848dd2bca3db005d515b55a72e706 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php @@ -64,13 +64,13 @@ class DefaultPrice extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr protected $_eventManager = null; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index ef919978887c14f91b18a53eda2da4216745db42..483eff59bff78f1b123285beab5eac4bb02e41ae 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -49,10 +49,10 @@ class Link extends \Magento\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param Relation $catalogProductRelation */ - public function __construct(\Magento\App\Resource $resource, Relation $catalogProductRelation) + public function __construct(\Magento\Framework\App\Resource $resource, Relation $catalogProductRelation) { $this->_catalogProductRelation = $catalogProductRelation; parent::__construct($resource); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index 706394823712e35881f1f60862d4ee17e08e9c2c..4eb583162787df3704030e7d74b7d77b67cbb7ea 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -51,23 +51,23 @@ class Option extends \Magento\Model\Resource\Db\AbstractDb /** * Core config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php index 490ffc219cafd55fe2b6dcaa5bbd866a3e5245f3..19c9432ae45c823243080287fbbf2dfd778e61ad 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php @@ -51,23 +51,23 @@ class Value extends \Magento\Model\Resource\Db\AbstractDb /** * Core config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index 4d7a06a99a05499388971e5a91f5440ff10f5a9d..59a1b191fa39dd90e898ea9bb33c85ef739586de 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -36,11 +36,11 @@ class Website extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Resource/Setup.php b/app/code/Magento/Catalog/Model/Resource/Setup.php index b55e39064d4b610f06116eecb9748163dd3bf076..8a925fbb615f99afab79e1d1546b72d7bb7fb2dd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Setup.php +++ b/app/code/Magento/Catalog/Model/Resource/Setup.php @@ -51,7 +51,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Index\Model\IndexerFactory $indexerFactory @@ -62,7 +62,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Index\Model\IndexerFactory $indexerFactory, diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index 3a166f31e9914b8beed2355a38c3cd34bff1ee45..b0bf4951678047e757969f62ad5db303ad48e0ba 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -108,7 +108,7 @@ class Url extends \Magento\Model\Resource\Db\AbstractDb protected $productResource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param Product $productResource @@ -116,7 +116,7 @@ class Url extends \Magento\Model\Resource\Db\AbstractDb * @param \Magento\Logger $logger */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, Product $productResource, diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index 00f25acfdad5b9bd10dab8b5244a2be7f35d7a35..7be7e9c0c25a3988fd4495794b7db8ae50077d01 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Model\System\Config\Backend\Catalog\Url\Rewrite; -class Suffix extends \Magento\App\Config\Value +class Suffix extends \Magento\Framework\App\Config\Value { /** * Core url rewrite @@ -41,7 +41,7 @@ class Suffix extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\UrlRewrite\Helper\UrlRewrite $coreUrlRewrite * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -50,7 +50,7 @@ class Suffix extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\UrlRewrite\Helper\UrlRewrite $coreUrlRewrite, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Catalog/Pricing/Price/BasePrice.php b/app/code/Magento/Catalog/Pricing/Price/BasePrice.php new file mode 100644 index 0000000000000000000000000000000000000000..51030def6a11df67e945ead9aa564c55fa74de3f --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/BasePrice.php @@ -0,0 +1,64 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Class BasePrice + */ +class BasePrice extends RegularPrice +{ + /** + * Price type identifier string + */ + const PRICE_TYPE_BASE_PRICE = 'base_price'; + + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_BASE_PRICE; + + /** + * @var bool|float|null + */ + protected $maxValue; + + /** + * Get Base Price Value + * + * @return float|bool + */ + public function getValue() + { + if ($this->value === null) { + $this->value = false; + foreach ($this->priceInfo->getPricesIncludedInBase() as $price) { + $this->value = min($price->getValue(), $this->value ?: $price->getValue()); + } + } + return $this->value; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/CustomOptionPrice.php b/app/code/Magento/Catalog/Pricing/Price/CustomOptionPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..f81e2e3aa8c103c0202b4838972ca19158ea8726 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/CustomOptionPrice.php @@ -0,0 +1,126 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Pricing\Price; + +use Magento\Catalog\Pricing\Price; +use Magento\Catalog\Model\Product\Option\Value; + +/** + * Class OptionPrice + * + * @package Magento\Catalog\Pricing\Price + */ +class CustomOptionPrice extends RegularPrice implements CustomOptionPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_CUSTOM_OPTION; + + /** + * @var array + */ + protected $priceOptions; + + /** + * Get Value + * + * @return bool|float + */ + public function getValue() + { + if (null !== $this->value) { + return $this->value; + } + $this->value = false; + $optionIds = $this->salableItem->getCustomOption('option_ids'); + if (!$optionIds) { + return $this->value; + } + $this->value = 0.; + + if ($optionIds) { + $values = explode(',', $optionIds->getValue()); + $values = array_filter($values); + if (!empty($values)) { + $this->value = $this->processOptions($values); + } + } + return $this->value; + } + + /** + * Process Product Options + * + * @param array $values + * @return float + */ + protected function processOptions(array $values) + { + $value = 0.; + foreach ($values as $optionId) { + $option = $this->salableItem->getOptionById($optionId); + if (!$option) { + continue; + } + $confItemOption = $this->salableItem->getCustomOption('option_' . $option->getId()); + + $group = $option->groupFactory($option->getType()) + ->setOption($option) + ->setConfigurationItemOption($confItemOption); + $value += $group->getOptionPrice($confItemOption->getValue(), $this->value); + } + return $value; + } + + /** + * Get Product Options + * + * @return array + */ + public function getOptions() + { + if (null !== $this->priceOptions) { + return $this->priceOptions; + } + $this->priceOptions = []; + $options = $this->salableItem->getOptions(); + if ($options) { + /** @var $optionItem \Magento\Catalog\Model\Product\Option */ + foreach ($options as $optionItem) { + /** @var $optionValue \Magento\Catalog\Model\Product\Option\Value */ + foreach ($optionItem->getValues() as $optionValue) { + $price = $optionValue->getPrice($optionValue->getPriceType() == Value::TYPE_PERCENT); + $this->priceOptions[$optionValue->getId()][$price] = [ + 'base_amount' => $price, + 'adjustment' => $this->getAmount()->getValue() + ]; + } + } + } + return $this->priceOptions; + } +} diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/OrGroup.php b/app/code/Magento/Catalog/Pricing/Price/CustomOptionPriceInterface.php similarity index 74% rename from app/code/Magento/Customer/Service/V1/Data/Search/OrGroup.php rename to app/code/Magento/Catalog/Pricing/Price/CustomOptionPriceInterface.php index 973d032221500d6c9811565516f36bd6e69bee22..5e897e8c0a9b620855b30c7a9357e3d7d8d0010b 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Search/OrGroup.php +++ b/app/code/Magento/Catalog/Pricing/Price/CustomOptionPriceInterface.php @@ -21,11 +21,22 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Customer\Service\V1\Data\Search; +namespace Magento\Catalog\Pricing\Price; /** - * Groups two or more filters together using logical OR. + * Option price interface */ -class OrGroup extends AbstractFilterGroup +interface CustomOptionPriceInterface { + /** + * Price model code + */ + const PRICE_TYPE_CUSTOM_OPTION = 'custom_option_price'; + + /** + * Return calculated options + * + * @return array + */ + public function getOptions(); } diff --git a/app/code/Magento/Catalog/Pricing/Price/FinalPrice.php b/app/code/Magento/Catalog/Pricing/Price/FinalPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..0483eb3c6799e63743937e2258e22cf11d13a753 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/FinalPrice.php @@ -0,0 +1,95 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Final price model + */ +class FinalPrice extends RegularPrice implements FinalPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_FINAL; + + /** + * @var BasePrice + */ + protected $basePrice; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->basePrice = $this->priceInfo->getPrice(BasePrice::PRICE_TYPE_BASE_PRICE); + $this->baseAmount = $this->getValue(); + } + + /** + * Get Value + * + * @return float|bool + */ + public function getValue() + { + return max(0, $this->basePrice->getValue()); // + custom options price + } + + /** + * Get Minimal Price Amount + * + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMinimalPrice() + { + $minimalPrice = $this->salableItem->getMinimalPrice(); + if ($minimalPrice === null) { + $minimalPrice = $this->getValue(); + } + return $this->calculator->getAmount($minimalPrice, $this->salableItem); + } + + /** + * Get Maximal Price Amount + * + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getMaximalPrice() + { + return $this->calculator->getAmount($this->getValue(), $this->salableItem); + } +} diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/OrGroupBuilder.php b/app/code/Magento/Catalog/Pricing/Price/FinalPriceInterface.php similarity index 79% rename from app/code/Magento/Customer/Service/V1/Data/Search/OrGroupBuilder.php rename to app/code/Magento/Catalog/Pricing/Price/FinalPriceInterface.php index 94a9cde28e1abebda33b48dcc6d39c6f28e76cec..8acd4439a9d9b58c63dc2cc277a67f30f045749e 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Search/OrGroupBuilder.php +++ b/app/code/Magento/Catalog/Pricing/Price/FinalPriceInterface.php @@ -18,14 +18,21 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * + * @category Magento + * @package Magento_Pricing * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Customer\Service\V1\Data\Search; + +namespace Magento\Catalog\Pricing\Price; /** - * Builder for OrGroup Data Object. + * Final price interface */ -class OrGroupBuilder extends AbstractFilterGroupBuilder +interface FinalPriceInterface { + /** + * Price type final + */ + const PRICE_TYPE_FINAL = 'final_price'; } diff --git a/app/code/Magento/Catalog/Pricing/Price/GroupPrice.php b/app/code/Magento/Catalog/Pricing/Price/GroupPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..a461e7ad65ac7279b555544f54e087a1a0b72359 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/GroupPrice.php @@ -0,0 +1,121 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Customer\Model\Session; + +/** + * Group price model + */ +class GroupPrice extends RegularPrice implements GroupPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_GROUP; + + /** + * @var Session + */ + protected $customerSession; + + /** + * @var array|null + */ + protected $storedGroupPrice; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + * @param Session $customerSession + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator, + Session $customerSession + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->customerSession = $customerSession; + } + + /** + * @return float|bool + */ + public function getValue() + { + if ($this->value === null) { + $this->value = false; + $customerGroup = $this->getCustomerGroupId(); + foreach ($this->getStoredGroupPrice() as $groupPrice) { + if ($groupPrice['cust_group'] == $customerGroup) { + $this->value = (float) $groupPrice['website_price']; + break; + } + } + } + return $this->value; + } + + /** + * @return int + */ + protected function getCustomerGroupId() + { + if ($this->salableItem->getCustomerGroupId()) { + return (int) $this->salableItem->getCustomerGroupId(); + } + return (int) $this->customerSession->getCustomerGroupId(); + } + + /** + * @return array + */ + public function getStoredGroupPrice() + { + if (null !== $this->storedGroupPrice) { + return $this->storedGroupPrice; + } + + $this->storedGroupPrice = $this->salableItem->getData('group_price'); + + if (null === $this->storedGroupPrice) { + $attribute = $this->salableItem->getResource()->getAttribute('group_price'); + if ($attribute) { + $attribute->getBackend()->afterLoad($this->salableItem); + $this->storedGroupPrice = $this->salableItem->getData('group_price'); + } + } + if (null === $this->storedGroupPrice || !is_array($this->storedGroupPrice)) { + $this->storedGroupPrice = []; + } + return $this->storedGroupPrice; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/GroupPriceInterface.php b/app/code/Magento/Catalog/Pricing/Price/GroupPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..cd20d1637636e1af97e412a5fcd6f8c2b3f5b65f --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/GroupPriceInterface.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Group price interface + */ +interface GroupPriceInterface +{ + /** + * Price type group + */ + const PRICE_TYPE_GROUP = 'group_price'; + + /** + * @return array + */ + public function getStoredGroupPrice(); +} diff --git a/app/code/Magento/Catalog/Pricing/Price/MsrpPrice.php b/app/code/Magento/Catalog/Pricing/Price/MsrpPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..feaa40b7d01812bade42f4dfe8b458d67b02ab95 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/MsrpPrice.php @@ -0,0 +1,104 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Catalog\Helper\Data; +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * MSRP price model + */ +class MsrpPrice extends FinalPrice implements MsrpPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_MSRP; + + /** + * @var \Magento\Catalog\Helper\Data + */ + protected $catalogDataHelper; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + * @param Data $catalogDataHelper + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator, + Data $catalogDataHelper + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->catalogDataHelper = $catalogDataHelper; + } + + /** + * Returns whether the MSRP should be shown on gesture + * + * @return bool + */ + public function isShowPriceOnGesture() + { + return $this->catalogDataHelper->isShowPriceOnGesture($this->salableItem); + } + + /** + * Get MAP message for price + * + * @return string + */ + public function getMsrpPriceMessage() + { + return $this->catalogDataHelper->getMsrpPriceMessage($this->salableItem); + } + + /** + * Returns true in case MSRP is enabled + * + * @return bool + */ + public function isMsrpEnabled() + { + return $this->catalogDataHelper->isMsrpEnabled(); + } + + /** + * Check if can apply Minimum Advertise price to product + * + * @param SaleableInterface $saleableItem + * @return bool + */ + public function canApplyMsrp(SaleableInterface $saleableItem) + { + return $this->catalogDataHelper->canApplyMsrp($saleableItem); + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/MsrpPriceInterface.php b/app/code/Magento/Catalog/Pricing/Price/MsrpPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..b27f37a8dc163b8d0b894cf05dfb887712085463 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/MsrpPriceInterface.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * MSRP price interface + */ +interface MsrpPriceInterface +{ + /** + * Price type MSRP + */ + const PRICE_TYPE_MSRP = 'msrp_price'; + + /** + * Check is product need gesture to show price + * + * @return bool + */ + public function isShowPriceOnGesture(); + + /** + * Get MAP message for price + * + * @return string + */ + public function getMsrpPriceMessage(); + + /** + * Returns true in case MSRP is enabled + * + * @return bool + */ + public function isMsrpEnabled(); + + /** + * Check if can apply Minimum Advertise price to product in specific visibility + * + * @param SaleableInterface $product + * @return bool + */ + public function canApplyMsrp(SaleableInterface $product); +} diff --git a/app/code/Magento/Catalog/Pricing/Price/RegularPrice.php b/app/code/Magento/Catalog/Pricing/Price/RegularPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..b1f36e5dcaad6ffb57c7eb687d301b0bdb224c6b --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/RegularPrice.php @@ -0,0 +1,143 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\PriceInfoInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Class RegularPrice + */ +class RegularPrice implements PriceInterface +{ + /** + * Default price type + */ + const PRICE_TYPE_PRICE_DEFAULT = 'regular_price'; + + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_PRICE_DEFAULT; + + /** + * @var SaleableInterface|\Magento\Catalog\Model\Product + */ + protected $salableItem; + + /** + * @var PriceInfoInterface + */ + protected $priceInfo; + + /** + * @var float + */ + protected $quantity; + + /** + * @var \Magento\Pricing\Adjustment\Calculator + */ + protected $calculator; + + /** + * @var bool|float + */ + protected $value; + + /** + * @var AmountInterface + */ + protected $amount; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator + ) { + $this->salableItem = $salableItem; + $this->quantity = $quantity; + $this->calculator = $calculator; + $this->priceInfo = $salableItem->getPriceInfo(); + } + + /** + * Get price value + * + * @return float|bool + */ + public function getValue() + { + if ($this->value === null) { + $price = $this->salableItem->getPrice(); + $this->value = $price ? floatval($price) : false; + } + return $this->value; + } + + /** + * Get Price Amount object + * + * @return AmountInterface + */ + public function getAmount() + { + if (null === $this->amount) { + $this->amount = $this->calculator->getAmount($this->getValue(), $this->salableItem); + } + return $this->amount; + } + + /** + * @param float $amount + * @param null|bool|string $exclude + * @return AmountInterface + */ + public function getCustomAmount($amount = null, $exclude = null) + { + if ($amount === null) { + $amount = $this->getValue(); + } + return $this->calculator->getAmount($amount, $this->salableItem, $exclude); + } + + /** + * Get price type code + * + * @return string + */ + public function getPriceType() + { + return $this->priceType; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php b/app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..3280e3815fafcd27351185232afb2a34acb41a58 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php @@ -0,0 +1,121 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Stdlib\DateTime\TimezoneInterface; + +/** + * Special price model + */ +class SpecialPrice extends RegularPrice implements SpecialPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_SPECIAL; + + /** + * @var TimezoneInterface + */ + protected $localeDate; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + * @param TimezoneInterface $localeDate + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator, + TimezoneInterface $localeDate + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->localeDate = $localeDate; + } + + /** + * @return bool|float + */ + public function getValue() + { + if (null === $this->value) { + $this->value = false; + $specialPrice = $this->getSpecialPrice(); + if (!is_null($specialPrice) && $specialPrice !== false && $this->isScopeDateInInterval()) { + $this->value = (float) $specialPrice; + } + } + + return $this->value; + } + + /** + * Returns special price + * + * @return float + */ + public function getSpecialPrice() + { + return $this->salableItem->getSpecialPrice(); + } + + /** + * Returns starting date of the special price + * + * @return mixed + */ + public function getSpecialFromDate() + { + return $this->salableItem->getSpecialFromDate(); + } + + /** + * Returns end date of the special price + * + * @return mixed + */ + public function getSpecialToDate() + { + return $this->salableItem->getSpecialToDate(); + } + + /** + * @return bool + */ + public function isScopeDateInInterval() + { + return $this->localeDate->isScopeDateInInterval( + $this->salableItem->getStore(), + $this->getSpecialFromDate(), + $this->getSpecialToDate() + ); + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/SpecialPriceInterface.php b/app/code/Magento/Catalog/Pricing/Price/SpecialPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..60a14e73ccd3113a71471bc05455989e1e0645f3 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/SpecialPriceInterface.php @@ -0,0 +1,64 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Special price interface + */ +interface SpecialPriceInterface +{ + /** + * Price type special + */ + const PRICE_TYPE_SPECIAL = 'special_price'; + + /** + * Returns special price + * + * @return float + */ + public function getSpecialPrice(); + + /** + * Returns starting date of the special price + * + * @return mixed + */ + public function getSpecialFromDate(); + + /** + * Returns end date of the special price + * + * @return mixed + */ + public function getSpecialToDate(); + + /** + * @return bool + */ + public function isScopeDateInInterval(); +} diff --git a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..170aa20311f4bf986c78b8b26a7504c5f66d67ef --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php @@ -0,0 +1,285 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\Adjustment\CalculatorInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Customer\Model\Group; +use Magento\Customer\Model\Session; +use Magento\Pricing\PriceInfoInterface; +use Magento\Pricing\Amount\AmountInterface; + +/** + * Tire prices model + */ +class TierPrice extends RegularPrice implements TierPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_TIER; + + /** + * @var Session + */ + protected $customerSession; + + /** + * @var int + */ + protected $customerGroup; + + /** + * Raw price list stored in DB + * + * @var array + */ + protected $rawPriceList; + + /** + * Applicable price list + * + * @var array + */ + protected $priceList; + + /** + * Should filter by base price or not + * + * @var bool + */ + protected $filterByBasePrice = true; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param CalculatorInterface $calculator + * @param Session $customerSession + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + CalculatorInterface $calculator, + Session $customerSession + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->customerSession = $customerSession; + if ($salableItem->hasCustomerGroupId()) { + $this->customerGroup = (int)$salableItem->getCustomerGroupId(); + } else { + $this->customerGroup = (int)$this->customerSession->getCustomerGroupId(); + } + } + + /** + * Get price value + * + * @return bool|float + */ + public function getValue() + { + if (null === $this->value) { + $prices = $this->getStoredTierPrices(); + $prevQty = PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT; + $this->value = $prevPrice = $tierPrice = false; + $priceGroup = Group::CUST_GROUP_ALL; + + foreach ($prices as $price) { + if (!$this->canApplyTierPrice($price, $priceGroup, $prevQty)) { + continue; + } + if (false === $prevPrice || $this->isFirstPriceBetter($price['website_price'], $prevPrice)) { + $tierPrice = $prevPrice = $price['website_price']; + $prevQty = $price['price_qty']; + $priceGroup = $price['cust_group']; + $this->value = (float)$tierPrice; + } + } + } + return $this->value; + } + + /** + * Returns true if first price is better + * + * Method filters tiers price values, lower tier price value is better + * + * @param float $firstPrice + * @param float $secondPrice + * @return bool + */ + protected function isFirstPriceBetter($firstPrice, $secondPrice) + { + return $firstPrice < $secondPrice; + } + + /** + * @return int + */ + public function getTierPriceCount() + { + return count($this->getTierPriceList()); + } + + /** + * @return array + */ + public function getTierPriceList() + { + if (null === $this->priceList) { + $priceList = $this->getStoredTierPrices(); + $this->priceList = $this->filterTierPrices($priceList); + array_walk( + $this->priceList, + function (&$priceData) { + /* convert string value to float */ + $priceData['price_qty'] = $priceData['price_qty'] * 1; + $priceData['price'] = $this->applyAdjustment($priceData['price']); + } + ); + } + return $this->priceList; + } + + /** + * @param array $priceList + * @return array + */ + protected function filterTierPrices(array $priceList) + { + $qtyCache = []; + foreach ($priceList as $priceKey => $price) { + /* filter price by customer group */ + if ($price['cust_group'] !== $this->customerGroup && $price['cust_group'] !== Group::CUST_GROUP_ALL) { + unset($priceList[$priceKey]); + continue; + } + /* select a lower price between Tier price and base price */ + if ($this->filterByBasePrice && $price['price'] > $this->getBasePrice()) { + unset($priceList[$priceKey]); + continue; + } + /* select a lower price for each quantity */ + if (isset($qtyCache[$price['price_qty']])) { + $priceQty = $qtyCache[$price['price_qty']]; + if ($this->isFirstPriceBetter($price['website_price'], $priceList[$priceQty]['website_price'])) { + unset($priceList[$priceQty]); + $qtyCache[$price['price_qty']] = $priceKey; + } else { + unset($priceList[$priceKey]); + } + } else { + $qtyCache[$price['price_qty']] = $priceKey; + } + } + return array_values($priceList); + } + + /** + * @return float + */ + protected function getBasePrice() + { + /** @var float $productPrice is a minimal available price */ + return $this->priceInfo->getPrice(BasePrice::PRICE_TYPE_BASE_PRICE)->getValue(); + } + + /** + * @param AmountInterface $amount + * @return float + */ + public function getSavePercent(AmountInterface $amount) + { + return ceil(100 - ((100 / $this->getBasePrice()) * $amount->getBaseAmount())); + } + + /** + * @param float|string $price + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function applyAdjustment($price) + { + return $this->calculator->getAmount($price, $this->salableItem); + } + + /** + * Can apply tier price + * + * @param array $currentTierPrice + * @param int $prevPriceGroup + * @param float|string $prevQty + * @return bool + */ + protected function canApplyTierPrice(array $currentTierPrice, $prevPriceGroup, $prevQty) + { + // Tier price can be applied, if: + // tier price is for current customer group or is for all groups + if ($currentTierPrice['cust_group'] !== $this->customerGroup + && $currentTierPrice['cust_group'] !== Group::CUST_GROUP_ALL + ) { + return false; + } + // and tier qty is lower than product qty + if ($this->quantity < $currentTierPrice['price_qty']) { + return false; + } + // and tier qty is bigger than previous qty + if ($currentTierPrice['price_qty'] < $prevQty) { + return false; + } + // and found tier qty is same as previous tier qty, but current tier group isn't ALL_GROUPS + if ($currentTierPrice['price_qty'] == $prevQty + && $prevPriceGroup !== Group::CUST_GROUP_ALL + && $currentTierPrice['cust_group'] === Group::CUST_GROUP_ALL + ) { + return false; + } + return true; + } + + /** + * Get clear tier price list stored in DB + * + * @return array + */ + protected function getStoredTierPrices() + { + if (null === $this->rawPriceList) { + $this->rawPriceList = $this->salableItem->getData(self::PRICE_TYPE_TIER); + if (null === $this->rawPriceList || !is_array($this->rawPriceList)) { + /** @var \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute */ + $attribute = $this->salableItem->getResource()->getAttribute(self::PRICE_TYPE_TIER); + if ($attribute) { + $attribute->getBackend()->afterLoad($this->salableItem); + $this->rawPriceList = $this->salableItem->getData(self::PRICE_TYPE_TIER); + } + } + if (null === $this->rawPriceList || !is_array($this->rawPriceList)) { + $this->rawPriceList = array(); + } + } + return $this->rawPriceList; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Price/TierPriceInterface.php b/app/code/Magento/Catalog/Pricing/Price/TierPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..5d5bd30c0cecdbc037a370f9658c611e3331abbf --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Price/TierPriceInterface.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Tier price interface + */ +interface TierPriceInterface +{ + /** + * Price type tier + */ + const PRICE_TYPE_TIER = 'tier_price'; + + /** + * @return array + */ + public function getTierPriceList(); + + /** + * @return int + */ + public function getTierPriceCount(); +} diff --git a/app/code/Magento/Catalog/Pricing/Render.php b/app/code/Magento/Catalog/Pricing/Render.php new file mode 100644 index 0000000000000000000000000000000000000000..cb94c0783ccdea7b968278a94be9e76a29823fe6 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Render.php @@ -0,0 +1,96 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\View\Element\Template; +use Magento\Registry; +use Magento\Pricing\Render as PricingRender; + +/** + * Catalog Price Render + * + * @method string getPriceRender() + * @method string getPriceTypeCode() + * @method string getDisplayMsrpHelpMessage() + */ +class Render extends Template +{ + /** + * @var \Magento\Registry + */ + protected $registry; + + /** + * Construct + * + * @param Template\Context $context + * @param Registry $registry + * @param array $data + */ + public function __construct( + Template\Context $context, + Registry $registry, + array $data = [] + ) { + $this->registry = $registry; + parent::__construct($context, $data); + } + + /** + * Produce and return block's html output + * + * @return string + */ + protected function _toHtml() + { + /** @var PricingRender $priceRender */ + $priceRender = $this->getLayout()->getBlock($this->getPriceRender()); + if ($priceRender instanceof PricingRender) { + $product = $this->getProduct(); + if ($product instanceof SaleableInterface) { + return $priceRender->render($this->getPriceTypeCode(), $product, $this->getData()); + } + } + return parent::_toHtml(); + } + + /** + * Returns saleable item instance + * + * @return SaleableInterface + */ + protected function getProduct() + { + $parentBlock = $this->getParentBlock(); + + $product = $parentBlock && $parentBlock->getProductItem() + ? $parentBlock->getProductItem() + : $this->registry->registry('product'); + return $product; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php b/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php new file mode 100644 index 0000000000000000000000000000000000000000..da449008ce55382807b8d54ba1771a54061088f1 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php @@ -0,0 +1,134 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Render; + +use Magento\Pricing\Render\PriceBox as BasePriceBox; +use Magento\Catalog\Pricing\Price\MsrpPrice; +use Magento\Pricing\Render; +use Magento\Catalog\Pricing\Price; +use Magento\Catalog\Pricing\Price\MsrpPriceInterface; + +/** + * Class for final_price rendering + * + * @method bool getUseLinkForAsLowAs() + * @method bool getDisplayMinimalPrice() + */ +class FinalPriceBox extends BasePriceBox +{ + /** + * @return string + */ + protected function _toHtml() + { + $result = parent::_toHtml(); + + try { + /** @var MsrpPrice $msrpPriceType */ + $msrpPriceType = $this->getSaleableItem()->getPriceInfo()->getPrice('msrp_price'); + } catch (\InvalidArgumentException $e) { + $this->_logger->logException($e); + return $this->wrapResult($result); + } + + //Renders MAP price in case it is enabled + if ($msrpPriceType->canApplyMsrp($this->getSaleableItem())) { + /** @var BasePriceBox $msrpBlock */ + $msrpBlock = $this->rendererPool->createPriceRender( + MsrpPriceInterface::PRICE_TYPE_MSRP, + $this->getSaleableItem(), + [ + 'real_price_html' => $result + ] + ); + $result = $msrpBlock->toHtml(); + } + + return $this->wrapResult($result); + } + + /** + * Wrap with standard required container + * + * @param string $html + * @return string + */ + protected function wrapResult($html) + { + return '<div class="price-box ' . $this->getData('css_classes') . '">' . $html . '</div>'; + } + + /** + * Render minimal amount + * + * @return string + */ + public function renderAmountMinimal() + { + //@TODO Implement 'minimal_price' final price is a minimum price + + $price = $this->getPriceType(\Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL); + $id = $this->getPriceId() ? $this->getPriceId() : 'product-minimal-price-' . $this->getSaleableItem()->getId(); + return $this->renderAmount( + $price->getMinimalPrice(), + [ + 'display_label' => __('As low as:'), + 'price_id' => $id, + 'include_container' => false, + 'skip_adjustments' => true + ] + ); + } + + /** + * Define if the special price should be shown + * + * @return bool + */ + public function hasSpecialPrice() + { + $displayRegularPrice = $this->getPriceType(Price\RegularPrice::PRICE_TYPE_PRICE_DEFAULT)->getAmount(); + $displayFinalPrice = $this->getPriceType(Price\FinalPriceInterface::PRICE_TYPE_FINAL)->getAmount(); + return $displayFinalPrice < $displayRegularPrice; + } + + /** + * Define if the minimal price should be shown + * + * @return bool + */ + public function showMinimalPrice() + { + /** @var Price\FinalPrice $finalPrice */ + $finalPrice = $this->getPriceType(Price\FinalPriceInterface::PRICE_TYPE_FINAL); + $finalPriceValue = $finalPrice->getAmount()->getValue(); + $minimalPriceAValue = $finalPrice->getMinimalPrice()->getValue(); + return $this->getDisplayMinimalPrice() + && $minimalPriceAValue + && $minimalPriceAValue < $finalPriceValue; + } +} diff --git a/app/code/Magento/Catalog/Pricing/Render/PriceBox.php b/app/code/Magento/Catalog/Pricing/Render/PriceBox.php new file mode 100644 index 0000000000000000000000000000000000000000..faf791f8e9b8000fca26a6b3690823bf1845d565 --- /dev/null +++ b/app/code/Magento/Catalog/Pricing/Render/PriceBox.php @@ -0,0 +1,117 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Pricing\Render; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\Render\PriceBox as PriceBoxRender; +use Magento\View\Element\Template\Context; +use Magento\Pricing\Render\RendererPool; +use Magento\Core\Helper\Data; +use Magento\Math\Random; + +/** + * Default catalog price box render + * + * @method string getPriceElementIdPrefix() + * @method string getIdSuffix() + * @method string getDisplayMsrpHelpMessage() + */ +class PriceBox extends PriceBoxRender +{ + /** + * @var \Magento\Core\Helper\Data + */ + protected $coreDataHelper; + + /** + * @var \Magento\Math\Random + */ + protected $mathRandom; + + /** + * @param Context $context + * @param SaleableInterface $saleableItem + * @param PriceInterface $price + * @param RendererPool $rendererPool + * @param Data $coreDataHelper + * @param Random $mathRandom + * @param array $data + */ + public function __construct( + Context $context, + SaleableInterface $saleableItem, + PriceInterface $price, + RendererPool $rendererPool, + Data $coreDataHelper, + Random $mathRandom, + array $data = array() + ) { + $this->coreDataHelper = $coreDataHelper; + $this->mathRandom = $mathRandom; + parent::__construct($context, $saleableItem, $price, $rendererPool); + } + + /** + * Encode the mixed $valueToEncode into the JSON format + * + * @param mixed $valueToEncode + * @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default + * @param array $options Additional options used during encoding + * @return string + */ + public function jsonEncode($valueToEncode, $cycleCheck = false, $options = []) + { + return $this->coreDataHelper->jsonEncode($valueToEncode, $cycleCheck, $options); + } + + /** + * Get random string + * + * @param int $length + * @param string|null $chars + * @return string + */ + public function getRandomString($length, $chars = null) + { + return $this->mathRandom->getRandomString($length, $chars); + } + + /** + * Check if quantity can be displayed for tier price with msrp + * + * @param SaleableInterface $product + * @return bool + */ + public function getCanDisplayQty(SaleableInterface $product) + { + //TODO Refactor - change to const similar to Model\Product\Type\Grouped::TYPE_CODE + if ($product->getTypeId() == 'grouped') { + return false; + } + return true; + } +} diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 7ef96e082082d0d3d01d714944c071edf713e658..479aa6efadc418f382f18decc9f36de2fed85aeb 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -27,7 +27,7 @@ <preference for="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\HandlerInterface" type="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Handler\Composite" /> <type name="Magento\Catalog\Controller\Adminhtml\Product\Attribute"> <arguments> - <argument name="attributeLabelCache" xsi:type="object">Magento\App\Cache\Type\Translate</argument> + <argument name="attributeLabelCache" xsi:type="object">Magento\Framework\App\Cache\Type\Translate</argument> </arguments> </type> <type name="Magento\Catalog\Model\Session"> diff --git a/app/code/Magento/Catalog/etc/adminhtml/routes.xml b/app/code/Magento/Catalog/etc/adminhtml/routes.xml index cde78dc43de888662250b81596229b5acc513386..6b5d0d4dfa07135055730956f7fda55864b116f6 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/routes.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="catalog" frontName="catalog"> <module name="Magento_Catalog_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 971c7021b9ce61e02a9437b9ac13dcb905a0f330..82ab18e7f865427ca8140a1071cc93256543ff8c 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -30,6 +30,9 @@ <preference for="Magento\Catalog\Model\Attribute\LockValidatorInterface" type="Magento\Catalog\Model\Attribute\LockValidatorComposite" /> <preference for="Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapperInterface" type="Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapper" /> <preference for="Magento\Catalog\Block\Product\ReviewRendererInterface" type="Magento\Catalog\Block\Product\ReviewRenderer\DefaultProvider" /> + <preference for="Magento\Pricing\PriceInfoInterface" type="Magento\Pricing\PriceInfo\Base" /> + <preference for="Magento\Pricing\PriceCurrencyInterface" type="Magento\Directory\Model\PriceCurrency" /> + <preference for="Magento\Pricing\Adjustment\CalculatorInterface" type="Magento\Pricing\Adjustment\Calculator" /> <type name="Magento\Log\Model\Resource\Log"> <plugin name="catalogLog" type="Magento\Catalog\Model\Plugin\Log" /> </type> @@ -260,13 +263,11 @@ <argument name="categoryIndexer" xsi:type="object" shared="false">Magento\Indexer\Model\IndexerInterface</argument> </arguments> </type> - <virtualType name="rowsFlatTableBuilder" type="Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder"> <arguments> <argument name="tableData" xsi:type="object">Magento\Catalog\Model\Indexer\Product\Flat\Action\Rows\TableData</argument> </arguments> </virtualType> - <type name="Magento\Catalog\Model\Indexer\Product\Flat\Action\Rows"> <arguments> <argument name="flatTableBuilder" xsi:type="object">rowsFlatTableBuilder</argument> @@ -319,6 +320,59 @@ </argument> </arguments> </type> + <type name="Magento\Pricing\PriceInfo\Factory"> + <arguments> + <argument name="types" xsi:type="array"> + <item name="simple" xsi:type="string">Magento\Pricing\PriceInfo\Base</item> + </argument> + </arguments> + </type> + <type name="Magento\Pricing\PriceComposite"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="regular_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\RegularPrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + <item name="final_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\FinalPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="tier_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\TierPrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + <item name="group_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\GroupPrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + <item name="special_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\SpecialPrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + <item name="msrp_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\MsrpPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="base_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\BasePrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + <item name="custom_option_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Catalog\Pricing\Price\CustomOptionPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + </argument> + </arguments> + </type> + <type name="Magento\Pricing\Adjustment\Collection"> + <arguments> + <argument name="adjustments" xsi:type="array"> + <item name="tax" xsi:type="const">Magento\Tax\Pricing\Adjustment::CODE</item> + <item name="weee" xsi:type="const">Magento\Weee\Pricing\Adjustment::CODE</item> + </argument> + </arguments> + </type> <type name="Magento\Catalog\Model\Product\ReservedAttributeList"> <arguments> <argument name="productModel" xsi:type="string">\Magento\Catalog\Model\Product</argument> diff --git a/app/code/Magento/Catalog/etc/frontend/di.xml b/app/code/Magento/Catalog/etc/frontend/di.xml index dd085abf4de55ea2dc6153043c98edfbc523a124..4e5489c5f83bd38004b4fd9a7d538f6f372824a8 100644 --- a/app/code/Magento/Catalog/etc/frontend/di.xml +++ b/app/code/Magento/Catalog/etc/frontend/di.xml @@ -58,7 +58,7 @@ <argument name="isAvailable" xsi:type="boolean">true</argument> </arguments> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="catalog-app-action-dispatchController-context-plugin" type="Magento\Catalog\Model\App\Action\ContextPlugin" sortOrder="10"/> </type> </config> diff --git a/app/code/Magento/Catalog/etc/frontend/routes.xml b/app/code/Magento/Catalog/etc/frontend/routes.xml index 6217d78cbb41fcd9cf71ad7532a8001d757e126b..3f9c81ced745f53eb082e063cb7e74e6aeed622d 100644 --- a/app/code/Magento/Catalog/etc/frontend/routes.xml +++ b/app/code/Magento/Catalog/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="catalog" frontName="catalog"> <module name="Magento_Catalog" /> diff --git a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php index 774e019fbad4eed6720318066171ac813312ddd7..21ae06d6c51782d16515f1a20ef42fb86a8834da 100644 --- a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php +++ b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -31,7 +31,7 @@ $installer = $this; $installFile = __DIR__ . '/upgrade-1.6.0.0.8-1.6.0.0.9.php'; /** @var \Magento\Filesystem\Directory\Read $modulesDirectory */ -$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); +$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); if ($modulesDirectory->isExist($modulesDirectory->getRelativePath($installFile))) { include $installFile; diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/category/tree.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/category/tree.phtml index 168203a6380a1ce9ac78faccb79eaea561fdc08d..3a05fa309dc3ee2c61ca4907c09cc2b3cfa936bb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/category/tree.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/category/tree.phtml @@ -189,6 +189,7 @@ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, { function reRenderTree(switcherParams) { // re-render tree by store switcher if (tree && switcherParams) { + var url; if (switcherParams.useConfirm) { if (!confirm("<?php echo __('Please confirm site switching. All data that hasn\'t been saved will be lost.') ?>")) { return false; @@ -203,26 +204,34 @@ function reRenderTree(switcherParams) { $('add_root_category_button').hide(); } } - // add form key - switcherParams.scopeParams.form_key = FORM_KEY; - - // retain current selected category id - var url = tree.switchTreeUrl + switcherParams.scopeParams + 'id/' + tree.currentNodeId + '/'; - - // load from cache - // load from ajax - new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), { - parameters:switcherParams.scopeParams, - method:'post', - onComplete:function (transport) { - var response = eval('(' + transport.responseText + ')'); - if (!response['parameters']) { - return false; - } - _renderNewTree(response, switcherParams.scopeParams); - } - }); + if (tree.useAjax) { + // retain current selected category id + url = tree.switchTreeUrl + switcherParams.scopeParams + 'id/' + tree.currentNodeId + '/'; + // load from cache + // load from ajax + // add form key + var params = { + form_key : FORM_KEY + }; + new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), { + parameters:params, + method:'post', + onComplete:function (transport) { + var response = eval('(' + transport.responseText + ')'); + if (!response['parameters']) { + return false; + } + + _renderNewTree(response, switcherParams.scopeParams); + } + }); + } else { + var baseUrl = '<?php echo $this->getEditUrl() ?>'; + var urlExt = switcherParams.scopeParams + 'id/' + tree.currentNodeId + '/'; + url = parseSidUrl(baseUrl, urlExt); + setLocation(url); + } } // render default tree else { @@ -258,7 +267,7 @@ function _renderNewTree(config, scopeParams) { url = url + 'id/' + config.parameters.category_id; } <?php endif;?> - updateContent(url); + //updateContent(url); //commented since ajax requests replaced with http ones to load a category } Ext.onReady(function () { @@ -435,9 +444,9 @@ function categoryMove(obj) { }; var failure = function (o) { - try { + if (window.console) { console.log(o.statusText); - } catch (e2) { + } else { alert(o.statusText); } location.reload(); diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/attribute/options.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/attribute/options.phtml index 26014d69f9de46ca3fd294323452d88b761f938c..15f1c0e9120a27f6352c4d20f7f7becb3d42ca2c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/attribute/options.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/attribute/options.phtml @@ -46,7 +46,7 @@ </thead> <tbody data-role="options-container"></tbody> <tfoot> - <th colspan="<?php echo $storetotal; ?>"> + <th colspan="<?php echo $storetotal; ?>" class="col-actions-add"> <?php if (!$this->getReadOnly() && !$this->canManageOptionDefaultOnly()):?> <button id="add_new_option_button" title="<?php echo __('Add Option'); ?>" type="button" class="action- scalable add"> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit.phtml index d727aa01f0bc31ab7a1242a3623d4cb44f71ef81..8c5362b9c0ab299554a7a083be02f710dfced1bc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit.phtml @@ -37,8 +37,8 @@ <span><?php echo $this->getAttributeSetName()?></span> </button> <ul class="dropdown-menu"> - <input type="text" id="product-template-suggest" class="search" - placeholder="start typing to search template"/> + <li><input type="text" id="product-template-suggest" class="search" + placeholder="start typing to search template"/></li> </ul> </div> </div> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/group.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/group.phtml index 5100cad157605b4652b3b665b45720f087eb74d7..0cf86cd08b695f3b930259b9d8ea99d680e625dc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/group.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/group.phtml @@ -55,7 +55,7 @@ $_showWebsite= $this->isMultiWebsites(); <tbody id="<?php echo $_htmlId; ?>_container"></tbody> <tfoot> <tr> - <td colspan="<?php if (!$_showWebsite): ?>5<?php else: ?>4<?php endif; ?>"><?php echo $this->getAddButtonHtml(); ?></td> + <td colspan="<?php if (!$_showWebsite): ?>5<?php else: ?>4<?php endif; ?>" class="col-actions-add"><?php echo $this->getAddButtonHtml(); ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/tier.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/tier.phtml index 6e5c3e7a1394cfaa4a481b738bcc3a43392463e7..1289d8baaea84f39befae9b6fbe7383ef9a318f5 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/tier.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/price/tier.phtml @@ -51,14 +51,14 @@ $element = $this->getElement(); <th class="col-websites" <?php if (!$_showWebsite): ?>style="display:none"<?php endif; ?>><?php echo __('Web Site') ?></th> <th class="col-customer-group"><?php echo __('Customer Group') ?></th> <th class="col-qty required"><?php echo __('Quantity') ?></th> - <th class="col-price required"><?php echo $this->getPriceColumnHeader(__('Price')) ?></th> + <th class="col-price required"><?php echo $this->getPriceColumnHeader(__('Item Price')) ?></th> <th class="col-delete"><?php echo __('Action') ?></th> </tr> </thead> <tbody id="<?php echo $_htmlId ?>_container"></tbody> <tfoot> <tr> - <td colspan="<?php if (!$_showWebsite): ?>4<?php else: ?>5<?php endif; ?>"><?php echo $this->getAddButtonHtml() ?></td> + <td colspan="<?php if (!$_showWebsite): ?>4<?php else: ?>5<?php endif; ?>" class="col-actions-add"><?php echo $this->getAddButtonHtml() ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/price.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/price.phtml index cd5994e4ee1b85e320c22b706fa3c2a668f6d926..455a01fa6527216d01fce891c7e78006a2dd9fbc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/price.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/price.phtml @@ -57,7 +57,7 @@ $_exclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax = true); ?> <?php $_weeeTaxAmount = $weeeHelper->getAmount($_product, $_website); ?> -<?php if ($weeeHelper->typeOfDisplay($_product, array(1,2,4))): ?> +<?php if ($weeeHelper->typeOfDisplay(array(1,2,4))): ?> <?php $_weeeTaxAmount = $weeeHelper->getAmount($_product, $_website); ?> <?php $_weeeTaxAttributes = $weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, $_website); ?> <?php endif; ?> @@ -70,7 +70,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php $_weeeDisplayType = $weeeHelper->getPriceDisplayType(); ?> <?php if ($_finalPrice == $_price): ?> <?php if ($priceHelper->displayBothPrices()): ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -83,7 +83,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> </span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -103,7 +103,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php endforeach; ?> )</span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -123,7 +123,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php endforeach; ?> )</span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -156,11 +156,11 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax </span> <?php endif; ?> <?php else: ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> </span> @@ -171,7 +171,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> </span> @@ -182,7 +182,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <span class="regular-price"><?php echo $_coreHelper->currencyByStore($_price, $_storeId, true, true) ?></span><br /> <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> <span class="weee"> @@ -201,7 +201,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php else: /* if ($_finalPrice == $_price): */ ?> <?php $_originalWeeeTaxAmount = $weeeHelper->getOriginalAmount($_product); ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -234,7 +234,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax </p> <?php endif; ?> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -264,7 +264,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax </span> </span> </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -294,7 +294,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax </span> </span> </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -361,7 +361,7 @@ $_inclTax = $priceHelper->getPrice($_product, $_minimalPriceValue, $includingTax <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice; ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, array(0, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(array(0, 1, 4))): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice+$_weeeTaxAmount; ?> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/adminhtml/product/grid/massaction_extended.phtml b/app/code/Magento/Catalog/view/adminhtml/product/grid/massaction_extended.phtml index 95ebcefc7ac5b88b37c3699ced8dcd379f46438f..aba150170643db644c2587bb41be4ecb008465c8 100644 --- a/app/code/Magento/Catalog/view/adminhtml/product/grid/massaction_extended.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/product/grid/massaction_extended.phtml @@ -32,26 +32,23 @@ <div class="entry-edit"> <?php if ($this->getHideFormElement() !== true):?> <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> - <?php endif ?> + <?php endif ?> <?php echo $this->getBlockHtml('formkey')?> - <fieldset> - <span class="field-row"> - <label><?php echo __('Select Product Actions') ?> - <select id="<?php echo $this->getHtmlId() ?>-select" class="select absolute-advice local-validation"> - <option value=""><?php echo __('-- Please select --')?></option> - <?php foreach ($this->getItems() as $_item): ?> - <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option> - <?php endforeach; ?> - </select> - </label> - </span> - <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span> - <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span> - <span class="field-row"> - <?php echo $this->getApplyButtonHtml() ?> - </span> - </fieldset> - <?php if ($this->getHideFormElement() !== true):?> + <span class="field-row"> + <label class="label"><?php echo __('Select Product Actions') ?></label> + <select id="<?php echo $this->getHtmlId() ?>-select" class="select absolute-advice local-validation"> + <option value=""><?php echo __('-- Please select --')?></option> + <?php foreach ($this->getItems() as $_item): ?> + <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option> + <?php endforeach; ?> + </select> + </span> + <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span> + <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span> + <span class="field-row"> + <?php echo $this->getApplyButtonHtml() ?> + </span> + <?php if ($this->getHideFormElement() !== true):?> </form> <?php endif ?> <div class="no-display"> @@ -62,26 +59,55 @@ <?php endforeach; ?> </div> </div> - <ul> - <?php if ($this->getUseSelectAll()):?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectAll()"><?php echo __('Select All') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectAll()"><?php echo __('Unselect All') ?></a> - </li> - <?php endif; ?> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectVisible()"><?php echo __('Select Visible') ?></a> - </li> - <li> - <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectVisible()"><?php echo __('Unselect Visible') ?></a> - </li> - <li> + <div class="entry-select"> + <select id="massaction-select" class="select"> + <option value=""> + <?php echo __('Mass Actions')?> + </option> + <?php if ($this->getUseSelectAll()):?> + <option value="selectAll"> + <?php echo __('Select All') ?> + </option> + <option value="unselectAll"> + <?php echo __('Unselect All') ?> + </option> + <?php endif; ?> + <option value="selectVisible"> + <?php echo __('Select Visible') ?> + </option> + <option value="unselectVisible"> + <?php echo __('Unselect Visible') ?> + </option> + </select> + <span class="items"> <strong id="<?php echo $this->getHtmlId() ?>-count">0</strong> <?php echo __('items selected') ?> - </li> - </ul> + </span> + </div> </div> +<script type="text/javascript"> + (function($) { + 'use strict'; + $('#massaction-select').change(function () { + var massAction = $('option:selected', this).val(); + switch (massAction) { + <?php if ($this->getUseSelectAll()):?> + case 'selectAll': + return <?php echo $this->getJsObjectName() ?>.selectAll() + break + case 'unselectAll': + return <?php echo $this->getJsObjectName() ?>.unselectAll() + break + <?php endif; ?> + case 'selectVisible': + return <?php echo $this->getJsObjectName() ?>.selectVisible() + break + case 'unselectVisible': + return <?php echo $this->getJsObjectName() ?>.unselectVisible() + break + } + }); + })(window.jQuery); +</script> <?php if (!$this->getParentBlock()->canDisplayContainer()): ?> <script type="text/javascript"> <?php echo $this->getJsObjectName() ?>.setGridIds('<?php echo $this->getGridIdsJson() ?>'); diff --git a/app/code/Magento/Catalog/view/adminhtml/product/product.css b/app/code/Magento/Catalog/view/adminhtml/product/product.css index 9751344b24caabe87ef16cd5f20d6ec41746a760..e852667e9375042864d1f798278240acb5a27fed 100644 --- a/app/code/Magento/Catalog/view/adminhtml/product/product.css +++ b/app/code/Magento/Catalog/view/adminhtml/product/product.css @@ -54,7 +54,7 @@ speak: none; font-weight: normal; -webkit-font-smoothing: antialiased; - content: '\e07d'; + content: '\e07d'; font-size: 16px; } @@ -64,11 +64,13 @@ overflow: hidden; text-indent: -999em; }*/ - +.product-actions { + padding: 5px 18px; +} .product-actions .switcher { display: inline-block; vertical-align: top; - margin: 6px 17px 6px 6px; + margin: 6px 0 6px 6px; } /* Image Management */ @@ -499,10 +501,6 @@ top: 30px; } -.field-tax_class_id .addon select { - border-radius: 4px; -} - /* Advanced Pricing tab -------------------------------------- */ @@ -566,7 +564,7 @@ width: 150px; } -.tiers_table .col-qty > input { +.tiers_table .col-qty > input[type="text"] { width: 40%; margin-right: 5px; } @@ -580,7 +578,7 @@ } .tiers_table .col-price { - width: 15%; + width: 16%; } .new-variation-set { diff --git a/app/code/Magento/Catalog/view/frontend/js/price-option.js b/app/code/Magento/Catalog/view/frontend/js/price-option.js index 3e133df658e7303f81a612e2c818e709b5b6aecd..edb3cdff4df47d037f61c39989d14761a420ae43 100644 --- a/app/code/Magento/Catalog/view/frontend/js/price-option.js +++ b/app/code/Magento/Catalog/view/frontend/js/price-option.js @@ -37,10 +37,10 @@ _create: function() { this.element.on('changePrice', $.proxy(function(e, data) { - this.changePrice(data.config, data.price); - }, this)).on('reloadPrice', $.proxy(function() { - this.reloadPrice(); - }, this)); + this.changePrice(data.config, data.price); + }, this)).on('reloadPrice', $.proxy(function() { + this.reloadPrice(); + }, this)); $(this.options.productCustomSelector).each( $.proxy(function(key, value) { @@ -88,12 +88,16 @@ }, _getOptionPrices: function() { var price = 0, - oldPrice = 0; + oldPrice = 0, + inclTaxPrice = 0, + exclTaxPrice = 0; $.each(this.options.prices, function(key, pair) { price += parseFloat(pair.price); oldPrice += parseFloat(pair.oldPrice); + inclTaxPrice += parseFloat(pair.inclTaxPrice); + exclTaxPrice += parseFloat(pair.exclTaxPrice); }); - var result = [price, oldPrice]; + var result = [price, oldPrice, inclTaxPrice, exclTaxPrice]; return result; }, reloadPrice: function() { @@ -102,20 +106,20 @@ priceSelectors = [ '#product-price-' + this.options.priceConfig.productId, '#bundle-price-' + this.options.priceConfig.productId, - '#price-including-tax-' + this.options.priceConfig.productId, - '#price-excluding-tax-' + this.options.priceConfig.productId, + '#price-including-tax-product-price-' + this.options.priceConfig.productId, + '#price-excluding-tax-product-price-' + this.options.priceConfig.productId, '#old-price-' + this.options.priceConfig.productId ], getOptionPrices = this._getOptionPrices(), optionPrice = { - excludeTax: 0, - includeTax: 0, + exclTaxPrice: 0, + inclTaxPrice: 0, oldPrice: 0, price: 0, - update: function(price, excludeTax, includeTax, oldPrice) { + update: function(price, exclTaxPrice, inclTaxPrice, oldPrice) { this.price += price; - this.excludeTax += excludeTax; - this.includeTax += includeTax; + this.exclTaxPrice += exclTaxPrice; + this.inclTaxPrice += inclTaxPrice; this.oldPrice += oldPrice; } }; @@ -135,9 +139,10 @@ if (element.is(":checkbox, :radio")) { if (element.is(":checked")) { if (configOptions[element.val()]) { - optionPrice.update(configOptions[element.val()].price, - configOptions[element.val()].excludeTax, - configOptions[element.val()].includeTax, + optionPrice.update( + configOptions[element.val()].price, + configOptions[element.val()].exclTaxPrice, + configOptions[element.val()].inclTaxPrice, configOptions[element.val()].oldPrice); } } @@ -149,37 +154,47 @@ } }); if (dateSelected) { - optionPrice.update(configOptions.price, configOptions.excludeTax, - configOptions.includeTax, configOptions.oldPrice); + optionPrice.update( + configOptions.price, + configOptions.exclTaxPrice, + configOptions.inclTaxPrice, + configOptions.oldPrice); skipIds[optionId] = optionId; } } else if (element.is('select')) { element.find(':selected').each(function() { if (configOptions[$(this).val()]) { - optionPrice.update(configOptions[$(this).val()].price, - configOptions[$(this).val()].excludeTax, - configOptions[$(this).val()].includeTax, + optionPrice.update( + configOptions[$(this).val()].price, + configOptions[$(this).val()].exclTaxPrice, + configOptions[$(this).val()].inclTaxPrice, configOptions[$(this).val()].oldPrice); } }); } else if (element.is('textarea,:text')) { if (element.val()) { - optionPrice.update(configOptions.price, configOptions.excludeTax, - configOptions.includeTax, configOptions.oldPrice); + optionPrice.update( + configOptions.price, + configOptions.exclTaxPrice, + configOptions.inclTaxPrice, + configOptions.oldPrice); } } else if (element.is(":file")) { var controlContainer = element.closest(this.options.controlContainer); if (element.val() || controlContainer.find('[id*="change-"]').length > 0) { - optionPrice.update(configOptions.price, configOptions.excludeTax, - configOptions.includeTax, configOptions.oldPrice); + optionPrice.update( + configOptions.price, + configOptions.exclTaxPrice, + configOptions.inclTaxPrice, + configOptions.oldPrice); } } } }, this)); var updatedPrice = { - priceExclTax: optionPrice.excludeTax + this.options.priceConfig.priceExclTax, - priceInclTax: optionPrice.includeTax + this.options.priceConfig.priceInclTax, + exclTaxPrice: optionPrice.exclTaxPrice + this.options.priceConfig.exclTaxPrice, + inclTaxPrice: optionPrice.inclTaxPrice + this.options.priceConfig.inclTaxPrice, productOldPrice: optionPrice.oldPrice + this.options.priceConfig.productOldPrice, productPrice: optionPrice.price + this.options.priceConfig.productPrice }; @@ -195,17 +210,21 @@ if (priceElement.length === 1) { var price = 0; if (value.indexOf('price-including-tax-') >= 0) { - price = updatedPrice.priceInclTax; + price = updatedPrice.inclTaxPrice; + price = price + getOptionPrices[2]; } else if (value.indexOf('price-excluding-tax-') >= 0) { - price = updatedPrice.priceExclTax; + price = updatedPrice.exclTaxPrice; + price = price + getOptionPrices[3]; } else if (value.indexOf('old-price-') >= 0) { price = updatedPrice.productOldPrice; + price = price + getOptionPrices[1]; } else { price = this.options.priceConfig.showIncludeTax ? - updatedPrice.priceInclTax : updatedPrice.priceExclTax; + updatedPrice.inclTaxPrice : updatedPrice.exclTaxPrice; + price = price + getOptionPrices[0]; } - price = price + getOptionPrices[0]; + var priceHtml = $.tmpl(this.options.priceTemplate, {'formattedPrice': this._formatCurrency(price, this.options.priceConfig.priceFormat)}); priceElement.html(priceHtml[0].outerHTML); // If clone exists, update clone price as well diff --git a/app/code/Magento/Catalog/view/frontend/js/tier-price.js b/app/code/Magento/Catalog/view/frontend/js/tier-price.js index ddfc4602b53c4227b1341dc540036ebf3a23aa90..215bcbca45e011f1427448c015bc44ae72444473 100644 --- a/app/code/Magento/Catalog/view/frontend/js/tier-price.js +++ b/app/code/Magento/Catalog/view/frontend/js/tier-price.js @@ -28,6 +28,7 @@ $.widget('mage.tierPrice', { options: { popupHeading: '#map-popup-heading', + productForm: '#product_addtocart_form', popupPrice: '#map-popup-price', popupMsrp: '#map-popup-msrp', popup: '#map-popup', @@ -53,7 +54,7 @@ $(this.options.popupCartButtonId).off('click'); $(this.options.popupCartButtonId).on('click', $.proxy(function() { this.element.find(this.options.inputQty).val(data.qty); - this.element.submit(); + this.element.find(this.options.productForm).submit(); }, this)); $(this.options.popupHeading).text(data.name); $(this.options.popupPrice).html($(data.price)).find('[id^="product-price-"]').attr('id', function() { @@ -63,7 +64,7 @@ $(this.options.popupMsrp).html(data.msrp); var width = $(this.options.popup).width(); var offsetX = e.pageX - (width / 2) + "px"; - $(this.options.popup).css({left: offsetX, top: e.pageY}).show(); + $(this.options.popup).css({left: offsetX, top: e.pageY}).addClass('active').show(); $(this.options.popupContent).show(); $(this.options.popupText).addClass(this.options.popupOnlyText).show(); $(this.options.popupTextWhatThis).hide(); diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_prices.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_prices.xml new file mode 100644 index 0000000000000000000000000000000000000000..9fb289bf875e986abaf6772b0e8964c07fb80e64 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_prices.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Pricing\Render\RendererPool" name="render.product.prices"> + <arguments> + <argument name="default" xsi:type="array"> + <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item> + <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item> + <item name="default_amount_render_class" xsi:type="string">Magento\Pricing\Render\Amount</item> + <item name="default_amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item> + <item name="prices" xsi:type="array"> + <item name="special_price" xsi:type="array"> + <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item> + </item> + <item name="group_price" xsi:type="array"> + <item name="render_template" xsi:type="string">Magento_Catalog::product/price/group_price.phtml</item> + </item> + <item name="tier_price" xsi:type="array"> + <item name="render_template" xsi:type="string">Magento_Catalog::product/price/tier_prices.phtml</item> + </item> + <item name="final_price" xsi:type="array"> + <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item> + <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item> + </item> + <item name="msrp_price" xsi:type="array"> + <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item> + <item name="render_template" xsi:type="string">Magento_Catalog::product/price/msrp_price.phtml</item> + </item> + <item name="custom_option_price" xsi:type="array"> + <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/option.phtml</item> + </item> + </item> + <!--<item name="adjustments" xsi:type="array"></item>--> + </argument> + </arguments> + </block> +</layout> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml index 44dda4c57793d02f008202836e57142a18e38b63..07cc51d36fa42c9277a7379d75a232b265889dcf 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml @@ -66,10 +66,25 @@ <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument> </arguments> </block> - <block class="Magento\Catalog\Block\Product\View" name="product.price" template="product/view/price.phtml" after="product.info.review"/> <block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="product/view/review.phtml" after="product.info.sku"/> + <block class="Magento\Catalog\Block\Product\View" name="product.info.rating" template="product/view/rating.phtml" after="product.info.sku"/> + <block class="Magento\Catalog\Pricing\Render" name="product.price.final" after="product.info.rating"> + <arguments> + <argument name="price_render" xsi:type="string">product.price.render.default</argument> + <argument name="price_type_code" xsi:type="string">final_price</argument> + <argument name="display_msrp_help_message" xsi:type="string">1</argument> + <argument name="zone" xsi:type="string">item_view</argument> + </arguments> + </block> + <block class="Magento\Catalog\Pricing\Render" name="product.price.tier" after="product.price.final"> + <arguments> + <argument name="price_render" xsi:type="string">product.price.render.default</argument> + <argument name="price_type_code" xsi:type="string">tier_price</argument> + <argument name="display_msrp_help_message" xsi:type="string">1</argument> + <argument name="zone" xsi:type="string">item_view</argument> + </arguments> + </block> <container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price"/> - <block class="Magento\Catalog\Block\Product\View" name="product.tierprices" template="product/view/tierprices.phtml" before="product.info"/> <block class="Magento\Catalog\Block\Product\View" name="product.info" template="product/view/form.phtml"> <container name="product.info.form.content" label="invisible" as="product_info_form_content"> <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/> diff --git a/app/code/Magento/Catalog/view/frontend/layout/default.xml b/app/code/Magento/Catalog/view/frontend/layout/default.xml index 54288080de4bd30b01ab3094b17ec4cdfcef1ff5..3e8d8ff9e6518c1a4ef96b73849e547044a69369 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/default.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/default.xml @@ -24,6 +24,9 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="top.links"> + <block class="Magento\Catalog\Block\Product\Compare\Link" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml"/> + </referenceBlock> <referenceContainer name="right"> <block class="Magento\Catalog\Block\Product\Compare\Sidebar" name="catalog.compare.sidebar" template="product/compare/sidebar.phtml"/> </referenceContainer> @@ -52,4 +55,11 @@ </arguments> </block> </referenceBlock> + <block class="Magento\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <argument name="use_link_for_as_low_as" xsi:type="boolean">true</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </layout> diff --git a/app/code/Magento/Catalog/view/frontend/product/compare/list.phtml b/app/code/Magento/Catalog/view/frontend/product/compare/list.phtml index 087cd078908372dfa20d66be3f285772d42535b9..307c63787cb4f4d74fbee64c71a24226483bd411 100644 --- a/app/code/Magento/Catalog/view/frontend/product/compare/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/compare/list.phtml @@ -23,7 +23,7 @@ */ /* @var $this \Magento\Catalog\Block\Product\Compare\ListCompare */ ?> -<?php $_total=$this->getItems()->getSize() ?> +<?php $_total = $this->getItems()->getSize() ?> <?php if($_total): ?> <a href="#" class="action print" title="<?php echo __('Print This Page') ?>"> <span><?php echo __('Print This Page') ?></span> @@ -54,6 +54,7 @@ <tr> <?php $_i = 0; ?> <?php $_helper = $this->helper('Magento\Catalog\Helper\Output'); ?> + <?php /** @var $_item \Magento\Catalog\Model\Product */ ?> <?php foreach($this->getItems() as $_item): ?> <?php if($_i++==0): ?> <th scope="row" class="cell label product"><?php echo __('Product') ?></th> @@ -69,7 +70,7 @@ </a> </strong> <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?> - <?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?> + <?php echo $this->getProductPrice($_item, '-compare-list-top') ?> <div class="product actions"> <div class="primary"> <?php if($_item->isSaleable()): ?> @@ -113,7 +114,12 @@ <div class="attibute value"> <?php switch ($_attribute->getAttributeCode()) { case "price": ?> - <?php echo $this->getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode()) ?> + <?php + echo $this->getProductPrice( + $_item, + '-compare-list-' . $_attribute->getCode() + ) + ?> <?php break; case "small_image": ?> <img src="<?php echo $this->getSmallImageUrl($_item); ?>" diff --git a/app/code/Magento/Catalog/view/frontend/product/list.phtml b/app/code/Magento/Catalog/view/frontend/product/list.phtml index ba8cd36f4259f2348aeca4b3f3e73dac94d98bc7..a2acfb3b73fcaf5e91a701e5eb3443d2d286f6e0 100644 --- a/app/code/Magento/Catalog/view/frontend/product/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/list.phtml @@ -79,7 +79,7 @@ $imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Im </a> </strong> <?php echo $this->getReviewsSummaryHtml($_product, $templateType); ?> - <?php echo $this->getPriceHtml($_product, true) ?> + <?php echo $this->getProductPrice($_product) ?> <div class="product actions"<?php echo strpos($pos, $viewMode . '-actions') ? $position : ''; ?>> <div class="primary"<?php echo strpos($pos, $viewMode . '-primary') ? $position: ''; ?>> <?php if ($_product->isSaleable()): ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/product/list/items.phtml index a7a8e684dbb5c4472139c9a8075034767c277ff7..893741ed4f56189c468fbddb9764f0320ea850b8 100644 --- a/app/code/Magento/Catalog/view/frontend/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/list/items.phtml @@ -209,7 +209,7 @@ switch($type = $this->getType()) { <?php echo $this->escapeHtml($_item->getName()) ?></a> </strong> - <?php echo $this->getPriceHtml($_item, true, '-' . $type) ?> + <?php echo $this->getProductPrice($_item); ?> <?php if ($templateType): ?> <?php echo $this->getReviewsSummaryHtml($_item, $templateType) ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price.phtml b/app/code/Magento/Catalog/view/frontend/product/price.phtml index 2787e9b4ffd13dea12b5e8ed310cc79c7058eda1..bc560c05fbfe3d526dda820103bda428de0a4202 100644 --- a/app/code/Magento/Catalog/view/frontend/product/price.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/price.phtml @@ -49,7 +49,7 @@ $_minimalPrice = $priceHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax); ?> <?php $_weeeTaxAmount = $weeeHelper->getAmountForDisplay($_product); ?> -<?php if ($weeeHelper->typeOfDisplay($_product, array(\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 4))): ?> +<?php if ($weeeHelper->typeOfDisplay(array(\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 4))): ?> <?php $_weeeTaxAmount = $weeeHelper->getAmount($_product); ?> <?php $_weeeTaxAttributes = $weeeHelper->getProductWeeeAttributesForDisplay($_product); ?> <?php endif; ?> @@ -67,7 +67,7 @@ <?php $_weeeDisplayType = $weeeHelper->getPriceDisplayType(); ?> <?php if ($_finalPrice >= $_price): ?> <?php if ($priceHelper->displayBothPrices()): ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -80,7 +80,7 @@ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?> </span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -100,7 +100,7 @@ <?php endforeach; ?> )</span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -120,7 +120,7 @@ <?php endforeach; ?> )</span> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -157,11 +157,11 @@ </span> <?php endif; ?> <?php else: ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?> </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?> </span> @@ -172,7 +172,7 @@ <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?> </span> @@ -183,7 +183,7 @@ <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <span class="regular-price"><?php echo $_coreHelper->currency($_price,true,true) ?></span><br /> <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> <span class="weee"> @@ -206,7 +206,7 @@ <?php else: /* if ($_finalPrice == $_price): */ ?> <?php $_originalWeeeTaxAmount = $weeeHelper->getOriginalAmount($_product); ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -239,7 +239,7 @@ </p> <?php endif; ?> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -269,7 +269,7 @@ </span> </span> </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -299,7 +299,7 @@ </span> </span> </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> @@ -365,7 +365,7 @@ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice; ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay($_product, array(0, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(array(0, 1, 4))): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice + $_weeeTaxAmount; ?> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price/amount/default.phtml b/app/code/Magento/Catalog/view/frontend/product/price/amount/default.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7cbb24afed1172b3c4af4ba75425438c6184bc3b --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/product/price/amount/default.phtml @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php /** @var \Magento\Pricing\Render\Amount $this */ ?> + +<?php if ($this->getDisplayLabel()): ?> + <span class="price-label"><?php echo $this->getDisplayLabel(); ?></span> +<?php endif; ?> +<span> + <?php if ($this->getPriceDisplayLabel()): ?> + <span class="price-label"><?php echo $this->getPriceDisplayLabel(); ?></span> + <?php endif; ?> + <span class="price <?php echo $this->getAdjustmentCssClasses() ?>" id="<?php echo $this->getPriceId() ?>"> + <?php echo $this->convertAndFormatCurrency($this->getDisplayValue(), (bool) $this->getIncludeContainer()) ?> + </span> +</span> +<?php if ($this->hasAdjustmentsHtml()): ?> +<?php if ($this->getZone() == \Magento\Pricing\Render::ZONE_ITEM_OPTION): ?> + (<small> + <?php echo $this->getAdjustmentsHtml() ?> + </small>) +<?php else: ?> + <?php echo $this->getAdjustmentsHtml() ?> +<?php endif; ?> +<?php endif; ?> diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/AndGroup.php b/app/code/Magento/Catalog/view/frontend/product/price/amount/option.phtml similarity index 59% rename from app/code/Magento/Customer/Service/V1/Data/Search/AndGroup.php rename to app/code/Magento/Catalog/view/frontend/product/price/amount/option.phtml index b2bd930fb3c67016c29a9ab7d61a54ba513f4653..0cfcad8d5e3d4492f3a6b5307a48ceb36686704e 100644 --- a/app/code/Magento/Customer/Service/V1/Data/Search/AndGroup.php +++ b/app/code/Magento/Catalog/view/frontend/product/price/amount/option.phtml @@ -4,10 +4,10 @@ * * NOTICE OF LICENSE * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php + * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. @@ -19,13 +19,10 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -namespace Magento\Customer\Service\V1\Data\Search; - -/** - * Groups two or more filters together using logical AND. - */ -class AndGroup extends AbstractFilterGroup -{ -} +?> +<?php +/** @var \Magento\Pricing\Render\Amount $this */ +?> +<?php echo $this->convertAndFormatCurrency($this->getDisplayValue(), (bool) $this->getIncludeContainer()) ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price/final_price.phtml b/app/code/Magento/Catalog/view/frontend/product/price/final_price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9c99b8f95c462fad096cb8a150177c1c67402419 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/product/price/final_price.phtml @@ -0,0 +1,84 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $this */ + +$productId = $this->getSaleableItem()->getId(); + +/** @var \Magento\Catalog\Pricing\Price\RegularPrice $priceModel */ +$priceModel = $this->getPriceType('regular_price'); + +/** @var \Magento\Catalog\Pricing\Price\FinalPrice $finalPriceModel */ +$finalPriceModel = $this->getPriceType('final_price'); +?> +<?php +if (isset($_GET['showmeprice'])) { + echo 'Regular Price :' . $this->getPriceType('regular_price')->getValue() . "<br />"; + echo 'Special Price :' . $this->getPriceType('special_price')->getValue(). "<br />"; + echo 'Group Price :' . $this->getPriceType('group_price')->getValue(). "<br />"; + echo 'Catalog Rule Price :' . $this->getPriceType('catalog_rule_price')->getValue(). "<br />"; + echo 'Tier Price :' . $this->getPriceType('tier_price')->getValue(). "<br />"; + echo 'Base Price :' . $this->getPriceType('base_price')->getValue(). "<br />"; + echo 'Final Price :' . $this->getPriceType('final_price')->getValue(). "<br />"; + echo "<br />"; +} +?> +<?php if ($this->hasSpecialPrice()): ?> + <p class="old-price"> + <?php echo $this->renderAmount($priceModel->getCustomAmount($priceModel->getValue(), true), [ + 'display_label' => __('Regular Price:'), + 'price_id' => $this->getPriceId('old-price-'), + 'include_container' => true, + 'skip_adjustments' => true + ]); ?> + </p> + <p class="special-price"> + <?php echo $this->renderAmount($finalPriceModel->getAmount(), [ + 'display_label' => __('Special Price:'), + 'price_id' => $this->getPriceId('product-price-'), + 'include_container' => false + ]); ?> + </p> +<?php else: ?> + <?php echo $this->renderAmount($finalPriceModel->getAmount(), [ + 'price_id' => $this->getPriceId('product-price-'), + 'include_container' => true + ]); ?> +<?php endif; ?> + +<?php if ($this->showMinimalPrice()): ?> + <?php if ($this->getUseLinkForAsLowAs()):?> + <a href="<?php echo $this->getSaleableItem()->getProductUrl(); ?>" class="minimal-price-link"> + <?php echo $this->renderAmountMinimal(); ?> + </a> + <?php else:?> + <span class="minimal-price-link"> + <?php echo $this->renderAmountMinimal(); ?> + </span> + <?php endif?> +<?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price/msrp_price.phtml b/app/code/Magento/Catalog/view/frontend/product/price/msrp_price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..11467d860d335b95bc99b803d87339321f257d72 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/product/price/msrp_price.phtml @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** + * Template for displaying product price at product view page, gift registry and wish-list + * + * @var $this \Magento\Catalog\Pricing\Render\PriceBox + */ +?> +<?php + +/** @var Magento\Catalog\Pricing\Price\MsrpPriceInterface $priceType */ +$priceType = $this->getPrice(); + +/** @var $product \Magento\Catalog\Model\Product|\Magento\Pricing\Object\SaleableInterface */ +$product = $this->getSaleableItem(); +$productId = $product->getId(); +// @todo: msrp works totally wrong, any excuses not accepted. will be refactored ASAP +$msrpPrice = $this->renderAmount($priceType->getCustomAmount($product->getMsrp()), + [ + 'price_id' => $this->getPriceId() ? $this->getPriceId() : 'old-price-' . $productId, + 'include_container' => false, + 'skip_adjustments' => true + ] +); +$priceElementIdPrefix = $this->getPriceElementIdPrefix() ? $this->getPriceElementIdPrefix() : 'product-price-'; +$addToCartUrl = ''; +if ($product->isSaleable()) { + $addToCartUrl = $this->helper('\Magento\Checkout\Helper\Cart') + ->getAddUrl($product); +} +?> + +<?php if ($product->getMsrp()): ?> + <span class="old-price"><?php echo $msrpPrice ?></span> +<?php endif; ?> + +<?php if ($priceType->isShowPriceOnGesture()): ?> + <?php $priceElementId = $priceElementIdPrefix . $productId . $this->getIdSuffix(); ?> + <span id="<?php echo $this->getPriceId() ? $this->getPriceId() : $priceElementId ?>" style="display:none"></span> + <?php $popupId = 'msrp-popup-' . $productId . $this->getRandomString(20); ?> + <a href="#" id="<?php echo($popupId);?>"><?php echo __('Click for price'); ?></a> +<?php else: ?> + <span class="msrp message"> + <?php echo $priceType->getMsrpPriceMessage() ?> + </span> +<?php endif; ?> + +<?php if ($this->getZone() == \Magento\Pricing\Render::ZONE_ITEM_VIEW): ?> + <?php $helpLinkId = 'msrp-help-' . $productId . $this->getRandomString(20); ?> + <a href="#" id="<?php echo $helpLinkId;?>" class="action show map"> + <span><?php echo __("What's this?"); ?></span> + </a> +<?php endif; ?> + +<script type="text/javascript"> + //<![CDATA[ + (function ($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/msrp.js') ?>", + function () { + <?php if ($priceType->isShowPriceOnGesture()): ?> + $('#<?php echo($popupId);?>').addToCart({ + cartForm: "#product_addtocart_form_from_popup", + popupId: "#<?php echo $popupId;?>", + productName: '<?php echo $product->getName() ?>', + realPrice: <?php echo $this->jsonEncode($this->getRealPriceHtml()) ?>, + msrpPrice: <?php echo $this->jsonEncode($msrpPrice) ?>, + priceElementId: '<?php echo $priceElementId ?>', + closeButtonId: '#map-popup-close', + popupCartButtonId: "#map-popup-button", + addToCartUrl: '<?php echo $addToCartUrl; ?>' + }); + <?php endif; ?> + <?php if ($this->getZone() == \Magento\Pricing\Render::ZONE_ITEM_VIEW): ?> + $("#<?php echo $helpLinkId;?>").addToCart({ + helpLinkId: "#<?php echo $helpLinkId;?>", + productName: '<?php echo $product->getName() ?>', + closeButtonId: '#map-popup-close' + }); + <?php endif; ?> + }); + })(jQuery); + //]]> +</script> diff --git a/app/code/Magento/Catalog/view/frontend/product/price/tier_prices.phtml b/app/code/Magento/Catalog/view/frontend/product/price/tier_prices.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3389f8a84ad2dfddb40586181c678404c34a5c34 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/product/price/tier_prices.phtml @@ -0,0 +1,112 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var \Magento\Catalog\Pricing\Render\PriceBox $this */ + +/** @var \Magento\Catalog\Pricing\Price\TierPrice $tierPriceModel */ +$tierPriceModel = $this->getPrice(); +$tierPrices = $tierPriceModel->getTierPriceList(); +$msrpShowOnGesture = $this->getPriceType('msrp_price')->isShowPriceOnGesture(); +$product = $this->getSaleableItem(); +?> +<?php if (count($tierPrices)) : ?> + <ul class="<?php echo ($this->hasListClass() ? $this->getListClass() : 'prices tier items'); ?>"> + <?php foreach ($tierPrices as $index => $price) : ?> + <li class="item"> + <?php + $popupId = 'msrp-popup-' . $product->getId() . $this->getRandomString(20); + if ($msrpShowOnGesture): + $addToCartUrl = ''; + if ($product->isSaleable()) { + $addToCartUrl = $this->helper('\Magento\Checkout\Helper\Cart') + ->getAddUrl($product, ['qty' => $price['price_qty']]); + } + $tierPriceData = [ + 'addToCartUrl' => $addToCartUrl, + 'name' => $product->getName(), + 'price' => $this->renderAmount( + $price['price'], + [ + 'price_id' => $index, + 'id_suffix' => '-' . $index, + 'include_container' => true + ] + ), + 'msrp' => $this->renderAmount( + $this->getPriceType('msrp_price')->getAmount(), + [ + 'price_id' => $index, + 'id_suffix' => '-' . $index, + 'include_container' => true + ] + ) + ]; + if ($this->getCanDisplayQty($product)) { + $tierPriceData['qty'] = $price['price_qty']; + } + ?> + <?php echo __('Buy %1 for: ', $price['price_qty']); ?> + <a href="#" id="<?php echo($popupId);?>" + data-tier-price="<?php echo $this->escapeHtml($this->jsonEncode($tierPriceData)); ?>"> + <?php echo __('Click for price'); ?></a> + <?php else: + echo __( + 'Buy %1 for %2', + $price['price_qty'], + $this->renderAmount( + $price['price'], + [ + 'price_id' => $index, + 'id_suffix' => '-' . $index, + 'include_container' => true, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_OPTION + ] + ) + ); + ?><?php echo __('each') ?> + <?php if ($this->getShowDetailedPrice() !== false): ?> + <?php echo __('and') ?> <strong class="benefit"> + <?php echo __('save')?> + <span class="percent tier-<?php echo $index ?>"><?php echo $tierPriceModel->getSavePercent($price['price']) ?></span>% + </strong> + <?php endif ?> + <?php endif; ?> + </li> + <?php endforeach; ?> + </ul> + <?php if ($msrpShowOnGesture):?> + <script type="text/javascript"> + (function($) { + head.js("<?php echo $this->getViewFileUrl('Magento_Catalog::js/tier-price.js') ?>", function () { + $('.product.info.main').tierPrice({ + inputQty: '#qty', + productForm: '#product_addtocart_form' + }); + }); + })(jQuery); + </script> + <?php endif;?> +<?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/price_msrp_item.phtml b/app/code/Magento/Catalog/view/frontend/product/price_msrp_item.phtml index 2fd6f90565e03fc5be60304320c1411f863ee8fc..81201c6eb1268a613e38d80e272df7970f981705 100644 --- a/app/code/Magento/Catalog/view/frontend/product/price_msrp_item.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/price_msrp_item.phtml @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + ?> <?php diff --git a/app/code/Magento/Catalog/view/frontend/product/view/price_clone.phtml b/app/code/Magento/Catalog/view/frontend/product/view/price_clone.phtml index 806e404a1209e947b4ef391707b3e5c5e1dedd92..d54dbad00029749a195aa4654d7228d5ce163f1f 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/price_clone.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/price_clone.phtml @@ -22,5 +22,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> +<?php /** @var \Magento\Catalog\Block\Product\AbstractProduct $this */ ?> <?php $_product = $this->getProduct() ?> -<?php echo $this->getPriceHtml($_product, false, '_clone') ?> +<?php echo $this->getProductPriceHtml( + $_product, + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + \Magento\Pricing\Render::ZONE_ITEM_VIEW, + [ + 'price_id_suffix' => '_clone' + ] +) ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml b/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml index d6bd53c9d3bdfc6c2ec396a11649f751baa950de..b77c6e618f4c9c49c112981c35025d04eff978bb 100644 --- a/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/view/tierprices.phtml @@ -35,7 +35,7 @@ $_finalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_produ $_catalogHelper = $this->helper('Magento\Catalog\Helper\Data'); $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmountForDisplay($_product); -if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1,2,4))) { +if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 2, 4))) { $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); } @@ -54,9 +54,9 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, <?php else: ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): ?> <?php echo __('Buy %1 for %2 (%3 incl. tax) each', $_price['price_qty'], $_price['formated_price_incl_weee_only'], $_price['formated_price_incl_weee']) ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -68,7 +68,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -80,7 +80,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -96,9 +96,9 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, <?php endif; ?> <?php else: ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayPriceIncludingTax()): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): ?> <?php echo __('Buy %1 for %2 each', $_price['price_qty'], $_price['formated_price_incl_weee']) ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -109,7 +109,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -120,7 +120,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_tax']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -135,9 +135,9 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, <?php echo __('Buy %1 for %2 each', $_price['price_qty'], $_price['formated_price_incl_tax']) ?> <?php endif; ?> <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): ?> <?php echo __('Buy %1 for %2 each', $_price['price_qty'], $_price['formated_price_incl_weee_only']) ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -148,7 +148,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> @@ -159,7 +159,7 @@ if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1, </small>) <?php endif; ?> <?php echo __('each') ?> - <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): ?> + <?php elseif($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): ?> <?php echo __('Buy %1 for %2', $_price['price_qty'], $_price['formated_price']); ?> <?php if ($_weeeTaxAttributes): ?> (<small> diff --git a/app/code/Magento/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml b/app/code/Magento/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml index 8212610e26a51ea8faeac98ee3dc4884d2469cce..976f2aafa2c6296b3eb5671bf161658e9372d95a 100644 --- a/app/code/Magento/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml @@ -47,7 +47,7 @@ <?php echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($_product, $_product->getName(), 'name') ?> </a> </strong> - <?php echo $this->getPriceHtml($_product, true, '-widget-new-'.$suffix) ?> + <?php echo $this->getProductPriceHtml($_product, '-widget-new-' . $suffix) ?> <div class="product actions"> <div class="primary"> <?php if($_product->isSaleable()): ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_grid.phtml b/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_grid.phtml index 5c96304341c676587df39f8fbfe64d7dd8ccc19a..23d2a45fb990634807010954c3c993343277afde 100644 --- a/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_grid.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_grid.phtml @@ -23,6 +23,11 @@ */ ?> <?php +/** + * Template for displaying new products widget + * + * @var $this \Magento\Catalog\Block\Product\Widget\NewWidget + */ if ($exist = ($this->getProductCollection() && $this->getProductCollection()->getSize())) { $type = 'widget-new-grid'; @@ -65,7 +70,9 @@ if ($exist = ($this->getProductCollection() && $this->getProductCollection()->ge <?php echo $this->escapeHtml($_item->getName()) ?> </a> </strong> - <?php echo $this->getPriceHtml($_item, true, '-' . $type) ?> + <?php + echo $this->getProductPriceHtml($_item, $type); + ?> <?php if ($templateType): ?> <?php echo $this->getReviewsSummaryHtml($_item, $templateType) ?> diff --git a/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_list.phtml b/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_list.phtml index e9a9210f7f8bc53f46eebea06815acbc99ea7aae..3e9725fc60b8e3524d6f4dd39c0009ed053f6e9f 100644 --- a/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/widget/new/content/new_list.phtml @@ -23,12 +23,17 @@ */ ?> <?php +/** + * Template for displaying new products widget + * + * @var $this \Magento\Catalog\Block\Product\Widget\NewWidget + */ if ($exist = ($this->getProductCollection() && $this->getProductCollection()->getSize())) { $type = 'widget-new-list'; $mode = 'list'; - $imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image'); + $imageBlock = $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image'); $image ='new_products_content_widget_list'; $title = __('New Products'); $items = $this->getProductCollection()->getItems(); @@ -65,7 +70,7 @@ if ($exist = ($this->getProductCollection() && $this->getProductCollection()->ge <?php echo $this->escapeHtml($_item->getName()) ?> </a> </strong> - <?php echo $this->getPriceHtml($_item, true, '-' . $type) ?> + <?php echo $this->getProductPriceHtml($_item, $type); ?> <?php if ($templateType): ?> <?php echo $this->getReviewsSummaryHtml($_item, $templateType) ?> diff --git a/app/code/Magento/Catalog/view/frontend/rss/product/price.phtml b/app/code/Magento/Catalog/view/frontend/rss/product/price.phtml index 70b71334477d621abb9f2e87677b763e87e8c0d0..35c7e81d42d525aa0d7cc8e9b86a9f20283194a9 100644 --- a/app/code/Magento/Catalog/view/frontend/rss/product/price.phtml +++ b/app/code/Magento/Catalog/view/frontend/rss/product/price.phtml @@ -42,7 +42,7 @@ <?php $_minimalPrice = $priceHelper->getPrice($_product, $_minimalPriceValue, $simplePricesTax) ?> <?php $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmountForDisplay($_product); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(1,2,4))): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1,2,4))): ?> <?php $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmount($_product); ?> <?php $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); ?> <?php endif; ?> @@ -55,7 +55,7 @@ <?php $_weeeDisplayType = $this->helper('Magento\Weee\Helper\Data')->getPriceDisplayType(); ?> <?php if ($_finalPrice == $_price): ?> <?php if ($priceHelper->displayBothPrices()): ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> @@ -64,7 +64,7 @@ <span class="label"><?php echo __('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> @@ -81,7 +81,7 @@ <?php endforeach; ?> </small>)</span> </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> @@ -98,7 +98,7 @@ <?php endforeach; ?> </small>)</span> </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> <span class="price-excluding-tax"> <span class="label"><?php echo __('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,false) ?></span> @@ -126,9 +126,9 @@ </span> <?php endif; ?> <?php else: ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> <br /> <span class="weee">(<small> @@ -138,7 +138,7 @@ <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> </small>)</span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> <br /> <span class="weee">(<small> @@ -148,7 +148,7 @@ <?php $_weeeSeparator = ' + '; ?> <?php endforeach; ?> </small>)</span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> <span class="regular-price"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,true) ?></span><br /> <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> <span class="weee"> @@ -166,7 +166,7 @@ <?php else: /* if ($_finalPrice == $_price): */ ?> <?php $_originalWeeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getOriginalAmount($_product); ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 0)): // including ?> + <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> @@ -191,7 +191,7 @@ </p> <?php endif; ?> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 1)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> @@ -216,7 +216,7 @@ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> </span> </p> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 4)): // incl. + weee ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> @@ -241,7 +241,7 @@ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> </span> </p> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, 2)): // excl. + weee + final ?> + <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> <p class="old-price"> <span class="price-label"><?php echo __('Regular Price:') ?></span> <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice,true,false) ?></span> @@ -297,7 +297,7 @@ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice; ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_product, array(0, 1, 4))): ?> + <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))): ?> <?php $_minimalPriceDisplayValue = $_minimalPrice+$_weeeTaxAmount; ?> <?php endif; ?> diff --git a/app/code/Magento/CatalogInventory/Helper/Data.php b/app/code/Magento/CatalogInventory/Helper/Data.php index 889fd0dae603dd4401bc32efcc9770de7402f73f..c3b3bf8c606f460c23369c32880841164b2f0747 100644 --- a/app/code/Magento/CatalogInventory/Helper/Data.php +++ b/app/code/Magento/CatalogInventory/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogInventory\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_SHOW_OUT_OF_STOCK = 'cataloginventory/options/show_out_of_stock'; @@ -62,18 +62,18 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config ) { $this->_config = $config; diff --git a/app/code/Magento/CatalogInventory/Helper/Minsaleqty.php b/app/code/Magento/CatalogInventory/Helper/Minsaleqty.php index a12cac9288775efc0c24b8343c1d58b610c74861..25f2c6d97d3e265420a6f7a160212125b77cc49b 100644 --- a/app/code/Magento/CatalogInventory/Helper/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Helper/Minsaleqty.php @@ -37,7 +37,7 @@ class Minsaleqty /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -47,11 +47,11 @@ class Minsaleqty protected $mathRandom; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Math\Random $mathRandom */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Math\Random $mathRandom ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php index 619ae537c4334e9ce17cfb658ea6802dcb079be1..8002b0d416d781ef91f6dbadbfc81c2737905427 100644 --- a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php +++ b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Model\Config\Backend; -class Managestock extends \Magento\App\Config\Value +class Managestock extends \Magento\Framework\App\Config\Value { /** * @var \Magento\CatalogInventory\Model\Stock\Status @@ -44,7 +44,7 @@ class Managestock extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -53,7 +53,7 @@ class Managestock extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\CatalogInventory\Model\Stock\Status $stockStatus, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php index 15efe80a85ce044b1dba0adf800b6dd9b1e008b4..d86084de7eb9b6e941f79ae1bb178de86a92b80a 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php @@ -63,7 +63,7 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer ), \Magento\Store\Model\Store::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE), \Magento\Store\Model\Group::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE), - \Magento\App\Config\ValueInterface::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE) + \Magento\Framework\App\Config\ValueInterface::ENTITY => array(\Magento\Index\Model\Event::TYPE_SAVE) ); /** @@ -185,7 +185,7 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer $result = false; } } else { - if ($entity == \Magento\App\Config\ValueInterface::ENTITY) { + if ($entity == \Magento\Framework\App\Config\ValueInterface::ENTITY) { $configData = $event->getDataObject(); if ($configData && in_array($configData->getPath(), $this->_relatedConfigSettings)) { $result = $configData->isValueChanged(); @@ -223,12 +223,12 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer case \Magento\Store\Model\Store::ENTITY: case \Magento\Store\Model\Group::ENTITY: - case \Magento\App\Config\ValueInterface::ENTITY: + case \Magento\Framework\App\Config\ValueInterface::ENTITY: $event->addNewData('cataloginventory_stock_skip_call_event_handler', true); $process = $event->getProcess(); $process->changeStatus(\Magento\Index\Model\Process::STATUS_REQUIRE_REINDEX); - if ($event->getEntity() == \Magento\App\Config\ValueInterface::ENTITY) { + if ($event->getEntity() == \Magento\Framework\App\Config\ValueInterface::ENTITY) { $configData = $event->getDataObject(); if ($configData->getPath() == \Magento\CatalogInventory\Helper\Data::XML_PATH_SHOW_OUT_OF_STOCK) { $this->_indexer->getProcessByCode( diff --git a/app/code/Magento/CatalogInventory/Model/Plugin/Layer.php b/app/code/Magento/CatalogInventory/Model/Plugin/Layer.php index de869582975b9a0a06b1fd57144e348dc88d8384..e7dd1c841b0ee3b6091cce4c598001a1b2058a2a 100644 --- a/app/code/Magento/CatalogInventory/Model/Plugin/Layer.php +++ b/app/code/Magento/CatalogInventory/Model/Plugin/Layer.php @@ -37,17 +37,17 @@ class Layer /** * Store config instance * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\CatalogInventory\Model\Stock\Status $stockStatus, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_stockStatus = $stockStatus; $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock.php index d99e97b17d2070294f477d8e37b524fd49dac4a0..afec0ec08177ae379e882530adb91e6c1bf7bb32 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -55,13 +55,13 @@ class Stock extends \Magento\Catalog\Model\Resource\Product\Indexer\AbstractInde protected $_productType; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param StockFactory $indexerFactory * @param \Magento\Catalog\Model\Product\Type $productType */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, StockFactory $indexerFactory, \Magento\Catalog\Model\Product\Type $productType diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php index 0e8dbba1668148c95506c9a9708d652e6f7b7ebe..006a87a15d3933c7951376c865194e3d8f50845a 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php @@ -53,21 +53,21 @@ class DefaultStock extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($resource, $eavConfig); diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php index 0484d7cea316e9c6be42cb7b08e76b2fb70419f4..6b5138c9faa08b37bdc2a3024eeed29eba4fec7c 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php @@ -89,7 +89,7 @@ class Stock extends \Magento\Model\Resource\Db\AbstractDb /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -108,16 +108,16 @@ class Stock extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\CatalogInventory\Model\StockFactory $stockFactory * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\CatalogInventory\Model\StockFactory $stockFactory, \Magento\Stdlib\DateTime $dateTime ) { diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index 42f487587d8b0fb78d200d15ca8f5946754b53ec..4ccf3b54d64cdccd794ea750365c71c1e7e8e7f9 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -39,17 +39,17 @@ class Item extends \Magento\Model\Resource\Db\AbstractDb /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Resource $resource - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Resource $resource, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($resource); diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index 6c77aa002c65bb82ac2cabaf48f26e3e1a1d0a32..0b6d67e7f44eb5df23718b91efc5fe1a9f03d229 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -48,13 +48,13 @@ class Status extends \Magento\Model\Resource\Db\AbstractDb protected $eavConfig; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Config $eavConfig diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Stock/Item.php index 0a588b62778d5e283a1d50306373818b0946b3e5..c48829e3259d6a4348fe749e39fc5054176e6d73 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Item.php @@ -162,7 +162,7 @@ class Item extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -211,7 +211,7 @@ class Item extends \Magento\Model\AbstractModel * @param Status $stockStatus * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Locale\FormatInterface $localeFormat * @param \Magento\Math\Division $mathDivision @@ -228,7 +228,7 @@ class Item extends \Magento\Model\AbstractModel Status $stockStatus, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Locale\FormatInterface $localeFormat, \Magento\Math\Division $mathDivision, diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minqty.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minqty.php index beca37d818599299ba3677705d76cff25586939d..5835241c56edf6539472b7caa875b08570f2cf9f 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minqty.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minqty.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogInventory\Model\System\Config\Backend; -class Minqty extends \Magento\App\Config\Value +class Minqty extends \Magento\Framework\App\Config\Value { /** * Validate minimum product qty value diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index fe8aab0628b8296c706c5678926c4aadf5110eb3..9652448d934c788387b5c4236833a24b25f43c0f 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -30,7 +30,7 @@ */ namespace Magento\CatalogInventory\Model\System\Config\Backend; -class Minsaleqty extends \Magento\App\Config\Value +class Minsaleqty extends \Magento\Framework\App\Config\Value { /** * Catalog inventory minsaleqty @@ -42,7 +42,7 @@ class Minsaleqty extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -51,7 +51,7 @@ class Minsaleqty extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php index 400e29b21101b6a5d0c907425a656e59fae5f25d..534891eec6ee0f1df810bbf10cfbd2bdc4e05bde 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php @@ -32,7 +32,7 @@ namespace Magento\CatalogInventory\Model\System\Config\Backend; use Magento\Model\Exception; -class Qtyincrements extends \Magento\App\Config\Value +class Qtyincrements extends \Magento\Framework\App\Config\Value { /** * Validate data before save diff --git a/app/code/Magento/CatalogRule/Helper/Data.php b/app/code/Magento/CatalogRule/Helper/Data.php index 6e81a2ffdb4d5c59fa0637851fdeae67ae489ef8..ec617e8938f8e6221dbfe30ffab5216e49f7b503 100644 --- a/app/code/Magento/CatalogRule/Helper/Data.php +++ b/app/code/Magento/CatalogRule/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogRule\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Algorithm for calculating price rule diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index 8aa56c26775bb1138998258275df18f055298494..d31862334342d9ddfc4734e513ee2d42f7674db1 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -109,7 +109,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\ConditionFactory $conditionFactory * @param \Magento\Stdlib\DateTime\DateTime $coreDate @@ -120,7 +120,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\ConditionFactory $conditionFactory, \Magento\Stdlib\DateTime\DateTime $coreDate, diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index 83bd31a07d3ab0cec627058af7fd21207a290ca3..3923f0dc995e392d0cfe9e2c07f2e2897ee0ac05 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -112,7 +112,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $_catalogRuleData; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypesList; @@ -180,7 +180,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\CatalogRule\Helper\Data $catalogRuleData - * @param \Magento\App\Cache\TypeListInterface $cacheTypesList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypesList * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -201,7 +201,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel \Magento\Index\Model\Indexer $indexer, \Magento\Customer\Model\Session $customerSession, \Magento\CatalogRule\Helper\Data $catalogRuleData, - \Magento\App\Cache\TypeListInterface $cacheTypesList, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypesList, \Magento\Stdlib\DateTime $dateTime, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php b/app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php new file mode 100644 index 0000000000000000000000000000000000000000..70779215b58d0362ffa68f89d8de9647c71cac3c --- /dev/null +++ b/app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php @@ -0,0 +1,116 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_CatalogRule + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogRule\Pricing\Price; + +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\Pricing\Adjustment\Calculator; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Stdlib\DateTime\TimezoneInterface; +use Magento\Store\Model\StoreManager; +use Magento\Customer\Model\Session; +use Magento\CatalogRule\Model\Resource\RuleFactory; + +/** + * Class CatalogRulePrice + */ +class CatalogRulePrice extends RegularPrice +{ + /** + * Price type identifier string + */ + const PRICE_TYPE = 'catalog_rule_price'; + + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE; + + /** + * @var \Magento\Stdlib\DateTime\TimezoneInterface + */ + protected $dateTime; + + /** + * @var \Magento\Store\Model\StoreManager + */ + protected $storeManager; + + /** + * @var \Magento\Customer\Model\Session + */ + protected $customerSession; + + /** + * @var \Magento\CatalogRule\Model\Resource\RuleFactory + */ + protected $resourceRuleFactory; + + /** + * @param SaleableInterface $salableItem + * @param float $quantity + * @param Calculator $calculator + * @param TimezoneInterface $dateTime + * @param StoreManager $storeManager + * @param Session $customerSession + * @param RuleFactory $catalogRuleResourceFactory + */ + public function __construct( + SaleableInterface $salableItem, + $quantity, + Calculator $calculator, + TimezoneInterface $dateTime, + StoreManager $storeManager, + Session $customerSession, + RuleFactory $catalogRuleResourceFactory + ) { + parent::__construct($salableItem, $quantity, $calculator); + $this->dateTime = $dateTime; + $this->storeManager = $storeManager; + $this->customerSession = $customerSession; + $this->resourceRuleFactory = $catalogRuleResourceFactory; + } + + /** + * Returns catalog rule value + * + * @return float|boolean + */ + public function getValue() + { + if (null === $this->value) { + $this->value = $this->resourceRuleFactory->create() + ->getRulePrice( + $this->dateTime->scopeTimeStamp($this->storeManager->getStore()->getId()), + $this->storeManager->getStore()->getWebsiteId(), + $this->customerSession->getCustomerGroupId(), + $this->salableItem->getId() + ); + $this->value = $this->value ? floatval($this->value) : false; + } + return $this->value; + } +} diff --git a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml index 523130c42fd6afb9f4b478ec162e7b6e0c823b6a..cf46cf087d04a6dfcf19eb1caf8d881c8fc11dc7 100644 --- a/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/CatalogRule/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="catalog_rule" frontName="catalog_rule"> <module name="Magento_CatalogRule_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/CatalogRule/etc/di.xml b/app/code/Magento/CatalogRule/etc/di.xml index d1ccf7c4934bed87498aca68d3ff7a0c40de28fd..b1f969637e729be8dc536955a03c5fd64043044f 100644 --- a/app/code/Magento/CatalogRule/etc/di.xml +++ b/app/code/Magento/CatalogRule/etc/di.xml @@ -51,4 +51,14 @@ </argument> </arguments> </type> + <type name="Magento\Pricing\PriceComposite"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="catalog_rule_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\CatalogRule\Pricing\Price\CatalogRulePrice</item> + <item name="include_in_base_price" xsi:type="boolean">true</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml index c1beb2651bc847c38ed2c5bd39629fc3a7add993..06309c2f1b17b04e55b321a6f40f72ad878bf8e0 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml @@ -46,15 +46,14 @@ <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="index" xsi:type="string">rule_id</argument> - <argument name="align" xsi:type="string">right</argument> - <argument name="width" xsi:type="string">50</argument> <argument name="type" xsi:type="string">text</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="name"> <arguments> <argument name="header" xsi:type="string" translate="true">Rule</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">name</argument> <argument name="type" xsi:type="string">text</argument> </arguments> @@ -62,27 +61,25 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="from_date"> <arguments> <argument name="header" xsi:type="string" translate="true">Start on</argument> - <argument name="align" xsi:type="string">left</argument> - <argument name="width" xsi:type="string">120</argument> <argument name="type" xsi:type="string">date</argument> <argument name="index" xsi:type="string">from_date</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="to_date"> <arguments> <argument name="header" xsi:type="string" translate="true">End on</argument> - <argument name="align" xsi:type="string">left</argument> - <argument name="width" xsi:type="string">120</argument> <argument name="type" xsi:type="string">date</argument> <argument name="default" xsi:type="string">--</argument> <argument name="index" xsi:type="string">to_date</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="is_active"> <arguments> <argument name="header" xsi:type="string" translate="true">Status</argument> - <argument name="align" xsi:type="string">left</argument> - <argument name="width" xsi:type="string">80</argument> <argument name="index" xsi:type="string">is_active</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="array"> @@ -100,11 +97,9 @@ <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="rule_website"> <arguments> <argument name="header" xsi:type="string" translate="true">Web Site</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">website_ids</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="type" xsi:type="string">options</argument> - <argument name="width" xsi:type="string">200</argument> <argument name="options" xsi:type="options" model="Magento\Backend\Model\Config\Source\Website\OptionHash"/> </arguments> </block> diff --git a/app/code/Magento/CatalogSearch/Controller/Advanced.php b/app/code/Magento/CatalogSearch/Controller/Advanced.php index fa73fa5990163e45bd20bf1289013d0cb88337b7..8c30dedba9d3e30f15440491512573688c015776 100644 --- a/app/code/Magento/CatalogSearch/Controller/Advanced.php +++ b/app/code/Magento/CatalogSearch/Controller/Advanced.php @@ -33,12 +33,12 @@ */ namespace Magento\CatalogSearch\Controller; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Context; use Magento\CatalogSearch\Model\Advanced as ModelAdvanced; use Magento\Session\Generic; use Magento\UrlFactory; -class Advanced extends \Magento\App\Action\Action +class Advanced extends \Magento\Framework\App\Action\Action { /** * Url factory diff --git a/app/code/Magento/CatalogSearch/Controller/Ajax.php b/app/code/Magento/CatalogSearch/Controller/Ajax.php index 9803843e2960410e63c2c1eb2d4fb73583af1fc0..af8c8779b4aa168e67a10cb285e140ba221c1198 100644 --- a/app/code/Magento/CatalogSearch/Controller/Ajax.php +++ b/app/code/Magento/CatalogSearch/Controller/Ajax.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Controller; -use Magento\App\Action\Action; +use Magento\Framework\App\Action\Action; class Ajax extends Action { diff --git a/app/code/Magento/CatalogSearch/Controller/Result.php b/app/code/Magento/CatalogSearch/Controller/Result.php index 8fd854ec4d5ab701aea0284a023d5e7c430059ba..98c39f991ae3912a53220c768d03886f491f4603 100644 --- a/app/code/Magento/CatalogSearch/Controller/Result.php +++ b/app/code/Magento/CatalogSearch/Controller/Result.php @@ -25,8 +25,8 @@ */ namespace Magento\CatalogSearch\Controller; -use Magento\App\Action\Action; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Action; +use Magento\Framework\App\Action\Context; use Magento\Catalog\Model\Session; use Magento\Store\Model\StoreManagerInterface; diff --git a/app/code/Magento/CatalogSearch/Controller/Term.php b/app/code/Magento/CatalogSearch/Controller/Term.php index 1c5e0f34030919bbb5abb36493a3e036548970e7..f7eab8e323bb77c0d50adbcbce6bbe377b7cb2c3 100644 --- a/app/code/Magento/CatalogSearch/Controller/Term.php +++ b/app/code/Magento/CatalogSearch/Controller/Term.php @@ -25,10 +25,10 @@ */ namespace Magento\CatalogSearch\Controller; -use Magento\App\Action\Action; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\Action\Action; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; class Term extends Action { @@ -40,7 +40,7 @@ class Term extends Action */ public function dispatch(RequestInterface $request) { - if (!$this->_objectManager->get('Magento\App\Config\ScopeConfigInterface')->getValue('catalog/seo/search_terms', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { + if (!$this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('catalog/seo/search_terms', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { $this->_redirect('noroute'); $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); } diff --git a/app/code/Magento/CatalogSearch/Helper/Data.php b/app/code/Magento/CatalogSearch/Helper/Data.php index be00a67bafad44b171ab89093b8b21753a476527..e4332dac0e0d225b07fdec3f5f0a2aff3ce18be8 100644 --- a/app/code/Magento/CatalogSearch/Helper/Data.php +++ b/app/code/Magento/CatalogSearch/Helper/Data.php @@ -25,14 +25,14 @@ */ namespace Magento\CatalogSearch\Helper; -use Magento\App\Helper\AbstractHelper; -use Magento\App\Helper\Context; +use Magento\Framework\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\Context; use Magento\CatalogSearch\Model\Fulltext; use Magento\CatalogSearch\Model\Query; use Magento\CatalogSearch\Model\QueryFactory; use Magento\CatalogSearch\Model\Resource\Fulltext\Engine; use Magento\CatalogSearch\Model\Resource\Query\Collection; -use Magento\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Escaper; use Magento\Filter\FilterManager; use Magento\Stdlib\String; diff --git a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php index b8ee73fc44925dd55f8cf8e0a241ad7891842fe9..6dc3c26848bb1efaecf57285ee63ae049ff4cace 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php @@ -34,9 +34,9 @@ */ namespace Magento\CatalogSearch\Model\Config\Backend\Search; -use Magento\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\CatalogSearch\Model\Fulltext; -use Magento\App\Config\Value; +use Magento\Framework\App\Config\Value; use Magento\Model\Context; use Magento\Registry; use Magento\Model\Resource\AbstractResource; diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Fulltext.php index 6c9faeed68d3aca6b7d4bcaef667b2b792023828..297f71e729565723d4de29e6cd3713fb21d5c906 100644 --- a/app/code/Magento/CatalogSearch/Model/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Fulltext.php @@ -25,7 +25,7 @@ */ namespace Magento\CatalogSearch\Model; -use Magento\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\CatalogSearch\Helper\Data; use Magento\CatalogSearch\Model\Query; use Magento\Model\AbstractModel; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index 9060333a42b6923ad68218c0f94ac5ea7596571b..b60fe2e38feca6a84407057109a86177cb4cc0df 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -30,7 +30,7 @@ */ namespace Magento\CatalogSearch\Model\Indexer; -use Magento\App\Config\ValueInterface; +use Magento\Framework\App\Config\ValueInterface; use Magento\Catalog\Model\Category; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ProductFactory; diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/Plugin.php b/app/code/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/Plugin.php index 7a862eff9d872ebe47ef32f64adf8704a93258c3..42eeb7d04d1c33f8792d9746d9700f32f1a5c9c2 100644 --- a/app/code/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/Plugin.php +++ b/app/code/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/Plugin.php @@ -31,7 +31,7 @@ class Plugin const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -41,11 +41,11 @@ class Plugin protected $engineProvider; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param EngineProvider $engineProvider */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, EngineProvider $engineProvider ) { $this->scopeConfig = $scopeConfig; diff --git a/app/code/Magento/CatalogSearch/Model/Query.php b/app/code/Magento/CatalogSearch/Model/Query.php index b3012dda51eef327cd21c4fe684171236772cfd4..b36c6e890a341d9a5fb5b934a3c9a1422fb31c00 100644 --- a/app/code/Magento/CatalogSearch/Model/Query.php +++ b/app/code/Magento/CatalogSearch/Model/Query.php @@ -33,7 +33,7 @@ use Magento\Model\AbstractModel; use Magento\Model\Context; use Magento\Registry; use Magento\Model\Resource\AbstractResource; -use Magento\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Data\Collection\Db; use Magento\Eav\Model\Entity\Collection\AbstractCollection; diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php index 119e7ba3b05daa4d6dc19603c736880b7e9eec69..3b3bf3dc722e6aa58f2ba99a6bbd23bde2486da6 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php @@ -51,12 +51,12 @@ class Advanced extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Event\ManagerInterface $eventManager ) { diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php index 208661c59809f99ae462443f4e300cb2c78a1efc..e75f66344fdb5c42f3258e647b184f332d75cfe3 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -49,14 +49,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -73,14 +73,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php b/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php index 98077c51115af4d8a4cd26ef09005c7554391a0e..6c484da68371ac16f9221ef030fdaae181e3969c 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/EngineProvider.php @@ -42,17 +42,17 @@ class EngineProvider protected $_engineFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\CatalogSearch\Model\Resource\EngineFactory $engineFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\CatalogSearch\Model\Resource\EngineFactory $engineFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_engineFactory = $engineFactory; $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index 3ea19a0c9d110bbb8b236f0707d85131387a7322..d6d936207d9b8d74b0e8255371489eafcd37342b 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -115,7 +115,7 @@ class Fulltext extends \Magento\Model\Resource\Db\AbstractDb /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -154,7 +154,7 @@ class Fulltext extends \Magento\Model\Resource\Db\AbstractDb protected $_localeDate; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus @@ -163,7 +163,7 @@ class Fulltext extends \Magento\Model\Resource\Db\AbstractDb * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Filter\FilterManager $filter * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime @@ -171,7 +171,7 @@ class Fulltext extends \Magento\Model\Resource\Db\AbstractDb * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Model\Product\Type $catalogProductType, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus, @@ -180,7 +180,7 @@ class Fulltext extends \Magento\Model\Resource\Db\AbstractDb \Magento\Event\ManagerInterface $eventManager, \Magento\Filter\FilterManager $filter, \Magento\CatalogSearch\Helper\Data $catalogSearchData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 971c8b1cffd4950b0a226c45cd05c6700ca5f43c..05b62e0c42906af5e34ae5616ad607b7d405ad9a 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -54,14 +54,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -79,14 +79,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php index 9b74c9b54f76981b28c916b4b93ee34ad76e3579..a5fc0c315d64db9870c7f5aa0e0d57c914dcb766 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Engine.php @@ -83,7 +83,7 @@ class Engine extends \Magento\Model\Resource\Db\AbstractDb implements /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\CatalogSearch\Model\Resource\Advanced\CollectionFactory $catalogSearchAdvancedCollectionFactory * @param \Magento\CatalogSearch\Model\Resource\Fulltext\CollectionFactory $catalogSearchFulltextCollectionFactory * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility @@ -93,7 +93,7 @@ class Engine extends \Magento\Model\Resource\Db\AbstractDb implements * @param \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\CatalogSearch\Model\Resource\Advanced\CollectionFactory $catalogSearchAdvancedCollectionFactory, \Magento\CatalogSearch\Model\Resource\Fulltext\CollectionFactory $catalogSearchFulltextCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Helper.php b/app/code/Magento/CatalogSearch/Model/Resource/Helper.php index d0e6cd5909a69c6a78786020de697f9b109124ba..34b47627af782505a3a35ab18edf99042881bc93 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Helper.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Helper.php @@ -35,10 +35,10 @@ namespace Magento\CatalogSearch\Model\Resource; class Helper extends \Magento\Eav\Model\Resource\Helper { /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix = 'Magento_CatalogSearch') + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix = 'Magento_CatalogSearch') { parent::__construct($resource, $modulePrefix); } diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Query.php b/app/code/Magento/CatalogSearch/Model/Resource/Query.php index e046ff13a9e50051a443a24529c6ffb91ffa4f24..e96c3a930a3a9717a299e9c15416f7cf30997dc2 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Query.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Query.php @@ -49,12 +49,12 @@ class Query extends AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Stdlib\DateTime $dateTime ) { diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php index 4d25a5dc1acb1f569a02a2f971a51e5531366414..6e104f996963f54f9910a4c0de77eca9d9eaeb9a 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php @@ -61,14 +61,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -85,14 +85,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml index abda27a7edf45e8f8e651eb9fcc7c8cc0fb0bee4..1022a0266126c261c21f4a07957bd8dbc3a4b108 100644 --- a/app/code/Magento/CatalogSearch/etc/frontend/routes.xml +++ b/app/code/Magento/CatalogSearch/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="catalogsearch" frontName="catalogsearch"> <module name="Magento_CatalogSearch" /> diff --git a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml index a73cc22ea836687aa633cde90ac1c98094ff9857..f0ae3c276b7b6df6a5d728a952fad675cee0efdd 100644 --- a/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml +++ b/app/code/Magento/CatalogSearch/view/adminhtml/layout/catalog_search_grid_block.xml @@ -90,16 +90,12 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Synonym</argument> <argument name="index" xsi:type="string">synonym_for</argument> - <argument name="align" xsi:type="string">left</argument> - <argument name="width" xsi:type="string">160px</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="redirect"> <arguments> <argument name="header" xsi:type="string" translate="true">Redirect URL</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">redirect</argument> - <argument name="width" xsi:type="string">200px</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="display_in_terms"> @@ -107,8 +103,6 @@ <argument name="header" xsi:type="string" translate="true">Suggested Terms</argument> <argument name="sortable" xsi:type="string">1</argument> <argument name="index" xsi:type="string">display_in_terms</argument> - <argument name="width" xsi:type="string">100px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="array"> <item name="yes" xsi:type="array"> @@ -126,7 +120,6 @@ <arguments> <argument name="type" xsi:type="string">action</argument> <argument name="header" xsi:type="string" translate="true">Action</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="filter" xsi:type="string">0</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="index" xsi:type="string">query_id</argument> diff --git a/app/code/Magento/CatalogSearch/view/frontend/form-mini.js b/app/code/Magento/CatalogSearch/view/frontend/form-mini.js index fe9f63cac6969e3b1c75693777bd3a36f32ec8aa..f0baa022b3290e3dec5bdcfa37f466c95529704b 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/form-mini.js +++ b/app/code/Magento/CatalogSearch/view/frontend/form-mini.js @@ -162,9 +162,9 @@ _onPropertyChange: function() { var searchField = this.element, clonePosition = { - position: 'absolute', - left: searchField.offset().left, - top: searchField.offset().top + searchField.outerHeight(), + //position: 'absolute', + //left: searchField.offset().left, + //top: searchField.offset().top + searchField.outerHeight(), width: searchField.outerWidth() }; if (searchField.val().length >= parseInt(this.options.minSearchLength, 10)) { diff --git a/app/code/Magento/Centinel/Controller/Index.php b/app/code/Magento/Centinel/Controller/Index.php index ee19d1c3f7f303cab019d0068e2910ba19d64420..c5b7d3adacf9ff881e9950344183ebd911c5d55f 100644 --- a/app/code/Magento/Centinel/Controller/Index.php +++ b/app/code/Magento/Centinel/Controller/Index.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Controller; -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -40,10 +40,10 @@ class Index extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Registry $coreRegistry) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Centinel/Helper/Data.php b/app/code/Magento/Centinel/Helper/Data.php index 1c029449d5fbbcea280f0d9d612db7510d875583..3c32074fc2d06a01a4083e79939dcfd07c3d972f 100644 --- a/app/code/Magento/Centinel/Helper/Data.php +++ b/app/code/Magento/Centinel/Helper/Data.php @@ -31,7 +31,7 @@ */ namespace Magento\Centinel\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Layout factory @@ -41,10 +41,10 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_layout; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\View\LayoutInterface $layout */ - public function __construct(\Magento\App\Helper\Context $context, \Magento\View\LayoutInterface $layout) + public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\View\LayoutInterface $layout) { $this->_layout = $layout; parent::__construct($context); diff --git a/app/code/Magento/Centinel/Model/Config.php b/app/code/Magento/Centinel/Model/Config.php index 5c44d884098a6059d258c716ffbdeb72e7f04968..f8a1a4a23d1aed413a6d20110332e50922917396 100644 --- a/app/code/Magento/Centinel/Model/Config.php +++ b/app/code/Magento/Centinel/Model/Config.php @@ -48,14 +48,14 @@ class Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * Core config interface * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -67,13 +67,13 @@ class Config protected $_encryptor; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Encryption\EncryptorInterface $encryptor */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Encryption\EncryptorInterface $encryptor ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Centinel/etc/adminhtml/routes.xml b/app/code/Magento/Centinel/etc/adminhtml/routes.xml index 1a020a675336657d06b952f32dd993ccd2f59c78..5867e3f06de3f32f5d2f409eaefd01476f9b20a5 100644 --- a/app/code/Magento/Centinel/etc/adminhtml/routes.xml +++ b/app/code/Magento/Centinel/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Centinel" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Centinel/etc/frontend/routes.xml b/app/code/Magento/Centinel/etc/frontend/routes.xml index f88f9262c1bda666958c05b0ef87ed0a05705849..18399c6a533d3c8bf88e8f123e7f46f02d94ef51 100644 --- a/app/code/Magento/Centinel/etc/frontend/routes.xml +++ b/app/code/Magento/Centinel/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="centinel" frontName="centinel"> <module name="Magento_Centinel" /> diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 6d4d8077dbcb6d9405755f59cfa91c3f20da9451..c3f3c8ea77dc0885661acc6c25c8f8f4de75ec90 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -34,7 +34,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart protected $_catalogUrlBuilder; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -50,7 +50,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Catalog\Model\Resource\Url $catalogUrlBuilder * @param \Magento\Checkout\Helper\Cart $cartHelper - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -60,7 +60,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Model\Resource\Url $catalogUrlBuilder, \Magento\Checkout\Helper\Cart $cartHelper, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_cartHelper = $cartHelper; diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index a200f789ddeb35a6afd4f9447225a6c2eccac79e..a184f666f55f79fef2ee35454c3f8fa8a758fe4f 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -340,7 +340,7 @@ class Renderer extends \Magento\View\Element\Template implements \Magento\View\B $encodedUrl = $this->_urlHelper->getEncodedUrl(); return $this->getUrl( 'checkout/cart/delete', - array('id' => $this->getItem()->getId(), \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl) + array('id' => $this->getItem()->getId(), \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $encodedUrl) ); } @@ -429,7 +429,7 @@ class Renderer extends \Magento\View\Element\Template implements \Magento\View\B $helper = $this->_productConfig; $params = array( 'max_length' => 55, - 'cut_replacer' => ' <a href="#" class="dots" onclick="return false">...</a>' + 'cut_replacer' => ' <a href="#" class="dots tooltip toggle" onclick="return false">...</a>' ); return $helper->getFormattedOptionValue($optionValue, $params); } diff --git a/app/code/Magento/Checkout/Block/Onepage.php b/app/code/Magento/Checkout/Block/Onepage.php index b31bffade9c94af919a6dcc995816c734e284376..6096611d2a9c95b6a4aa26041d316358b020743e 100644 --- a/app/code/Magento/Checkout/Block/Onepage.php +++ b/app/code/Magento/Checkout/Block/Onepage.php @@ -35,7 +35,7 @@ class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -43,13 +43,13 @@ class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -57,7 +57,7 @@ class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { parent::__construct( diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index a52561ed075b29865d1452946f185b7c968d1dd5..54e6714354fcb03c68da8cf46c8129ca5bca28bd 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -37,7 +37,7 @@ use Magento\Sales\Model\Quote; abstract class AbstractOnepage extends \Magento\View\Element\Template { /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -102,14 +102,14 @@ abstract class AbstractOnepage extends \Magento\View\Element\Template private $_addressConfig; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -117,13 +117,13 @@ abstract class AbstractOnepage extends \Magento\View\Element\Template * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -131,7 +131,7 @@ abstract class AbstractOnepage extends \Magento\View\Element\Template CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_coreData = $coreData; diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index 7d00a457801b1aa5c84e93d133d573298110b511..3817e5886cc5b00c77a8f846a8841f61e31df1dc 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -54,7 +54,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -62,14 +62,14 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -77,7 +77,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Sales\Model\Quote\AddressFactory $addressFactory, array $data = array() ) { diff --git a/app/code/Magento/Checkout/Block/Onepage/Login.php b/app/code/Magento/Checkout/Block/Onepage/Login.php index d022d1a2cedd5d0177d7f9ac5467c0225f139cb0..ffb1982bf025d8aa833f00c96e813b2da8d2ea51 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Login.php +++ b/app/code/Magento/Checkout/Block/Onepage/Login.php @@ -48,7 +48,7 @@ class Login extends AbstractOnepage /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -56,7 +56,7 @@ class Login extends AbstractOnepage * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Checkout\Helper\Data $checkoutData * @param \Magento\Message\ManagerInterface $messageManager * @param array $data @@ -64,7 +64,7 @@ class Login extends AbstractOnepage public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -72,7 +72,7 @@ class Login extends AbstractOnepage CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Message\ManagerInterface $messageManager, array $data = array() diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index a8a61766c74435eec3d67e13b4111794e1116d54..6326d3740a94c2eee45c4d98d7d5e81d06632eb5 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -47,7 +47,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -55,14 +55,14 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -70,7 +70,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Sales\Model\Quote\AddressFactory $addressFactory, array $data = array() ) { diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php index a6cad8e5416e872338cb161025c567ea4b6c07e6..a78621a8f45c5886d56d78d8898e13c4d1f824e0 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -53,7 +53,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $resourceSession * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory @@ -61,14 +61,14 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param CustomerAccountService $customerAccountService * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $resourceSession, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, @@ -76,7 +76,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage CustomerAccountService $customerAccountService, CustomerAddressService $customerAddressService, AddressConfig $addressConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Tax\Helper\Data $taxData, array $data = array() ) { diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index 04de805e8154c0403a600817e96782ab70bd67c5..1f2f6f9f4cf2795a3718241294fcd03c51a82771 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -49,7 +49,7 @@ class Success extends \Magento\View\Element\Template protected $_orderConfig; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -59,7 +59,7 @@ class Success extends \Magento\View\Element\Template * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Order\Config $orderConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -68,7 +68,7 @@ class Success extends \Magento\View\Element\Template \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Order\Config $orderConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { parent::__construct($context, $data); diff --git a/app/code/Magento/Checkout/Controller/Action.php b/app/code/Magento/Checkout/Controller/Action.php index 4e861de57717730a9b35d0487376c2829657b549..96b38041da4edf85c39f912dcb5d80462d332df4 100644 --- a/app/code/Magento/Checkout/Controller/Action.php +++ b/app/code/Magento/Checkout/Controller/Action.php @@ -30,7 +30,7 @@ use Magento\Exception\NoSuchEntityException; /** * Controller for onepage checkouts */ -abstract class Action extends \Magento\App\Action\Action +abstract class Action extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Customer\Model\Session @@ -48,13 +48,13 @@ abstract class Action extends \Magento\App\Action\Action protected $_customerMetadataService; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param CustomerAccountService $customerAccountService * @param CustomerMetadataService $customerMetadataService */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, CustomerAccountService $customerAccountService, CustomerMetadataService $customerMetadataService diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index 3d9c1a1e9ddeb56e74b88d1f2054e51fece67283..21a7cc53619258b93ce53d22c42fe26e6de46289 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -30,10 +30,10 @@ use Magento\Checkout\Model\Cart as CustomerCart; /** * Shopping cart controller */ -class Cart extends \Magento\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface +class Cart extends \Magento\Framework\App\Action\Action implements \Magento\Catalog\Controller\Product\View\ViewInterface { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -58,16 +58,16 @@ class Cart extends \Magento\App\Action\Action implements \Magento\Catalog\Contro protected $cart; /** - * @param \Magento\App\Action\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Action\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param CustomerCart $cart */ public function __construct( - \Magento\App\Action\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Action\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, diff --git a/app/code/Magento/Checkout/Controller/Express/RedirectLoginInterface.php b/app/code/Magento/Checkout/Controller/Express/RedirectLoginInterface.php index 320de3eed767f6e9e2f88b854a8fbcab5ed62338..1cf6a1d8f76e583261d33a7e14db7005179b4bb5 100644 --- a/app/code/Magento/Checkout/Controller/Express/RedirectLoginInterface.php +++ b/app/code/Magento/Checkout/Controller/Express/RedirectLoginInterface.php @@ -52,7 +52,7 @@ interface RedirectLoginInterface /** * Retrieve response object * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function getResponse(); } diff --git a/app/code/Magento/Checkout/Controller/Index.php b/app/code/Magento/Checkout/Controller/Index.php index b57a80d0c5280c9043ff882d041da4488d57565c..48b0fc737a7a595df86f477697fa5f4686e84c2f 100644 --- a/app/code/Magento/Checkout/Controller/Index.php +++ b/app/code/Magento/Checkout/Controller/Index.php @@ -25,7 +25,7 @@ */ namespace Magento\Checkout\Controller; -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * @return void diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index b2125a86640b19f039770808ec6c8182ca7901d6..c60c83994a5e7a1bcd1649c72e20ad0a93bc0a9e 100755 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -25,8 +25,8 @@ */ namespace Magento\Checkout\Controller; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccountService; use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadataService; @@ -64,7 +64,7 @@ class Onepage extends Action protected $_formKeyValidator; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param CustomerAccountService $customerAccountService * @param CustomerMetadataService $customerMetadataService @@ -73,7 +73,7 @@ class Onepage extends Action * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, CustomerAccountService $customerAccountService, CustomerMetadataService $customerMetadataService, @@ -91,8 +91,8 @@ class Onepage extends Action * Dispatch request * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface - * @throws \Magento\App\Action\NotFoundException + * @return \Magento\Framework\App\ResponseInterface + * @throws \Magento\Framework\App\Action\NotFoundException */ public function dispatch(RequestInterface $request) { @@ -233,12 +233,12 @@ class Onepage extends Action } if (!$quote->validateMinimumAmount()) { $error = $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->getValue( 'sales/minimum_order/error_message', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) ? $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->getValue( 'sales/minimum_order/error_message', \Magento\Store\Model\ScopeInterface::SCOPE_STORE diff --git a/app/code/Magento/Checkout/Helper/Cart.php b/app/code/Magento/Checkout/Helper/Cart.php index 63238a5a22cebeab9ff66d3d4f008f3c02c72889..60b605b4029680183b15fe68d1eec27693c2d0fb 100644 --- a/app/code/Magento/Checkout/Helper/Cart.php +++ b/app/code/Magento/Checkout/Helper/Cart.php @@ -49,7 +49,7 @@ class Cart extends \Magento\Core\Helper\Url /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -64,18 +64,18 @@ class Cart extends \Magento\Core\Helper\Url protected $_checkoutSession; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Checkout\Model\Cart $checkoutCart * @param \Magento\Checkout\Model\Session $checkoutSession */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Checkout\Model\Cart $checkoutCart, \Magento\Checkout\Model\Session $checkoutSession ) { @@ -106,7 +106,7 @@ class Cart extends \Magento\Core\Helper\Url public function getAddUrl($product, $additional = array()) { $continueUrl = $this->_coreData->urlEncode($this->_urlBuilder->getCurrentUrl()); - $urlParamName = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; + $urlParamName = \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED; $routeParams = array($urlParamName => $continueUrl, 'product' => $product->getEntityId()); @@ -137,7 +137,7 @@ class Cart extends \Magento\Core\Helper\Url { $params = array( 'id' => $item->getId(), - \Magento\App\Action\Action::PARAM_NAME_BASE64_URL => $this->getCurrentBase64Url() + \Magento\Framework\App\Action\Action::PARAM_NAME_BASE64_URL => $this->getCurrentBase64Url() ); return $this->_getUrl('checkout/cart/delete', $params); } diff --git a/app/code/Magento/Checkout/Helper/Data.php b/app/code/Magento/Checkout/Helper/Data.php index 35802afde64894081076c03f262ffc868ba1f339..52bb1382f91a4f05a38d4bdfa04e54266c40d74e 100644 --- a/app/code/Magento/Checkout/Helper/Data.php +++ b/app/code/Magento/Checkout/Helper/Data.php @@ -33,7 +33,7 @@ use Magento\Sales\Model\Quote\Item\AbstractItem; * * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout'; @@ -47,7 +47,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -82,8 +82,8 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $inlineTranslation; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -92,8 +92,8 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Translate\Inline\StateInterface $inlineTranslation */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Checkout/Helper/ExpressRedirect.php b/app/code/Magento/Checkout/Helper/ExpressRedirect.php index 9c487d83e68ea5103ef35818a3189240fa2f2288..6a5ab396fabb3a704d9031e4adeabbda97815c0e 100644 --- a/app/code/Magento/Checkout/Helper/ExpressRedirect.php +++ b/app/code/Magento/Checkout/Helper/ExpressRedirect.php @@ -25,10 +25,10 @@ namespace Magento\Checkout\Helper; use Magento\Checkout\Controller\Express\RedirectLoginInterface; -class ExpressRedirect extends \Magento\App\Helper\AbstractHelper +class ExpressRedirect extends \Magento\Framework\App\Helper\AbstractHelper { /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; @@ -45,16 +45,16 @@ class ExpressRedirect extends \Magento\App\Helper\AbstractHelper protected $_customerSession; /** - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\ObjectManager $objectManager * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context */ public function __construct( - \Magento\App\ActionFlag $actionFlag, + \Magento\Framework\App\ActionFlag $actionFlag, \Magento\ObjectManager $objectManager, \Magento\Customer\Model\Session $customerSession, - \Magento\App\Helper\Context $context + \Magento\Framework\App\Helper\Context $context ) { $this->_actionFlag = $actionFlag; $this->_objectManager = $objectManager; diff --git a/app/code/Magento/Checkout/Model/Cart.php b/app/code/Magento/Checkout/Model/Cart.php index 5c00b0024f622be398699f0910201759859a5156..90b6032fee899944f831cd9d9f1e173d5878248c 100644 --- a/app/code/Magento/Checkout/Model/Cart.php +++ b/app/code/Magento/Checkout/Model/Cart.php @@ -60,7 +60,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -96,7 +96,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI /** * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Checkout\Model\Resource\Cart $resourceCart @@ -107,7 +107,7 @@ class Cart extends \Magento\Object implements \Magento\Checkout\Model\Cart\CartI */ public function __construct( \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Resource\Cart $resourceCart, diff --git a/app/code/Magento/Checkout/Model/Layout/DepersonalizePlugin.php b/app/code/Magento/Checkout/Model/Layout/DepersonalizePlugin.php index afd3b47660783d29b7d1fb66bc51d492e6174269..50e294d7c84a00ee44383d96b52d32baa170099b 100644 --- a/app/code/Magento/Checkout/Model/Layout/DepersonalizePlugin.php +++ b/app/code/Magento/Checkout/Model/Layout/DepersonalizePlugin.php @@ -42,7 +42,7 @@ class DepersonalizePlugin protected $moduleManager; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -54,13 +54,13 @@ class DepersonalizePlugin /** * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Module\Manager $moduleManager - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\PageCache\Model\Config $cacheConfig */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Module\Manager $moduleManager, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\PageCache\Model\Config $cacheConfig ) { $this->checkoutSession = $checkoutSession; diff --git a/app/code/Magento/Checkout/Model/Resource/Agreement.php b/app/code/Magento/Checkout/Model/Resource/Agreement.php index b81de86d77bcd7477f36cd5868c0efd437b9555d..169ba97c006ea467f4e770291afa9f3ed002d2ec 100644 --- a/app/code/Magento/Checkout/Model/Resource/Agreement.php +++ b/app/code/Magento/Checkout/Model/Resource/Agreement.php @@ -40,10 +40,10 @@ class Agreement extends \Magento\Model\Resource\Db\AbstractDb protected $filterManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Filter\FilterManager $filterManager */ - public function __construct(\Magento\App\Resource $resource, \Magento\Filter\FilterManager $filterManager) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Filter\FilterManager $filterManager) { $this->filterManager = $filterManager; parent::__construct($resource); diff --git a/app/code/Magento/Checkout/Model/Resource/Setup.php b/app/code/Magento/Checkout/Model/Resource/Setup.php index d4889fa3426b111c198a6252c0ae4a7fb4a034d2..c1def877fb71832365535d2382cb30df2320db80 100644 --- a/app/code/Magento/Checkout/Model/Resource/Setup.php +++ b/app/code/Magento/Checkout/Model/Resource/Setup.php @@ -35,7 +35,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory * @param \Magento\Customer\Helper\Address $customerAddress * @param string $moduleName @@ -44,7 +44,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, \Magento\Customer\Helper\Address $customerAddress, $moduleName = 'Magento_Checkout', diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index 5f382b5da2e90e5bc66cd7cf07e98e9d8b4dcd60..bf7f952efc724f3338890f206a3c6ff9093c3278 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -50,13 +50,6 @@ class Session extends \Magento\Session\SessionManager */ protected $_customer; - /** - * Customer Data Object builder - * - * @var CustomerBuilder - */ - protected $_customerBuilder; - /** * Whether load only active quote * @@ -102,7 +95,7 @@ class Session extends \Magento\Session\SessionManager protected $_storeManager; /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -114,11 +107,10 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param CustomerBuilder $customerBuilder * @param null $sessionName */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, @@ -130,7 +122,6 @@ class Session extends \Magento\Session\SessionManager \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, \Magento\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, - CustomerBuilder $customerBuilder, $sessionName = null ) { $this->_orderFactory = $orderFactory; @@ -139,32 +130,10 @@ class Session extends \Magento\Session\SessionManager $this->_remoteAddress = $remoteAddress; $this->_eventManager = $eventManager; $this->_storeManager = $storeManager; - $this->_customerBuilder = $customerBuilder; parent::__construct($request, $sidResolver, $sessionConfig, $saveHandler, $validator, $storage); $this->start($sessionName); } - /** - * Set customer instance - * - * TODO: Remove after elimination of dependencies from \Magento\Persistent\Model\Observer - * - * @param \Magento\Customer\Model\Customer|null $customer - * @return $this - * @deprecated Use \Magento\Checkout\Model\Session::setCustomerData() instead - */ - public function setCustomer($customer) - { - if ($customer instanceof \Magento\Customer\Model\Customer) { - $this->_customerBuilder->populateWithArray($customer->getData()); - $this->_customerBuilder->setId($customer->getId()); - $this->_customer = $this->_customerBuilder->create(); - } else { - $this->_customer = $customer; - } - return $this; - } - /** * Set customer data. * diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 23c620aa383e5afec436b6575b4e9e2691b86c83..8f1431674cb88dee9e87b9ee52dfea887d8d520e 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -93,7 +93,7 @@ class Onepage protected $_storeManager; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -158,7 +158,7 @@ class Onepage * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Customer\Model\AddressFactory $customrAddrFactory * @param \Magento\Customer\Model\FormFactory $customerFormFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -182,7 +182,7 @@ class Onepage \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Customer\Model\AddressFactory $customrAddrFactory, \Magento\Customer\Model\FormFactory $customerFormFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, diff --git a/app/code/Magento/Checkout/etc/adminhtml/routes.xml b/app/code/Magento/Checkout/etc/adminhtml/routes.xml index 5f096ba209eec568dd3346e304b37a7f220e3f03..bb00aca381c7c800f9d6851f292e7b5bbe7dc84d 100644 --- a/app/code/Magento/Checkout/etc/adminhtml/routes.xml +++ b/app/code/Magento/Checkout/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="checkout" frontName="checkout"> <module name="Magento_Checkout_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Checkout/etc/frontend/routes.xml b/app/code/Magento/Checkout/etc/frontend/routes.xml index 7cef2244d58b38dc3e284930e0e215c1fb9a1da6..6feba4e8efe57b2a44958871fa1f570f131583eb 100644 --- a/app/code/Magento/Checkout/etc/frontend/routes.xml +++ b/app/code/Magento/Checkout/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="checkout" frontName="checkout"> <module name="Magento_Checkout" /> diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml index 68bda30467ae9c46d241b47de208e0c90b053fb4..1139cd4e9530752feed73e99497e4f5bea6336ca 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml @@ -50,9 +50,10 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated full value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -104,12 +105,12 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price excl tax" data-th="<?php echo __('Unit Price Excl. Tax'); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> @@ -119,22 +120,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> </div> @@ -147,13 +148,13 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price incl tax" data-th="<?php echo __('Unit Price Incl. Tax'); ?>"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> @@ -163,22 +164,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> </div> @@ -196,7 +197,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite </td> <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> <td class="col subtotal excl tax" data-th="<?php echo __('Subtotal Excl. Tax'); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> @@ -205,7 +206,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($canApplyMsrp): ?> <span class="cart msrp subtotal">--</span> <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> @@ -216,22 +217,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> </div> @@ -243,7 +244,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> <td class="col subtotal incl tax" data-th="<?php echo __('Subtotal Incl. Tax'); ?>"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> @@ -252,7 +253,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($canApplyMsrp): ?> <span class="cart msrp subtotal">--</span> <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -265,22 +266,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> </div> diff --git a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml index 870561bd643387bbb26e06b9a5276881a5ee2dda..0ea29f8b681750218bb76282a06d6bf497c4bf24 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml @@ -30,7 +30,7 @@ <?php else: ?> <div data-block="minicart" class="minicart wrapper"> <?php endif; ?> -<?php $_cartQty = $this->getSummaryCount() ?> +<?php $_cartQty = (float) $this->getSummaryCount() ?> <?php if (!$this->getIsLinkMode() || !$this->getIsNeedToDisplaySideBar()): ?> <a <?php if ($this->getIsNeedToDisplaySideBar()): ?>data-toggle="dropdown"<?php endif ?> class="action showcart" href="<?php echo $this->getUrl('checkout/cart'); ?>"> <span class="text"><?php echo __('My Cart'); ?></span> diff --git a/app/code/Magento/Checkout/view/frontend/cart/shipping.phtml b/app/code/Magento/Checkout/view/frontend/cart/shipping.phtml index f435bed6b1e13104ba1cd5724e2d66968280c1a9..c55aab2cde491d46e5ca07c577b2d69c96cbf226 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/shipping.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/shipping.phtml @@ -61,8 +61,10 @@ <input class="input-text validate-postcode<?php if ($this->isZipCodeRequired()):?> required-entry<?php endif;?>" type="text" id="postcode" name="estimate_postcode" value="<?php echo $this->escapeHtml($this->getEstimatePostcode()) ?>" /> </div> </div> - <div class="actions"> - <button type="submit" class="action quote"><span><?php echo __('Get a Quote') ?></span></button> + <div class="actions toolbar"> + <div class="primary"> + <button type="submit" class="action quote"><span><?php echo __('Get a Quote') ?></span></button> + </div> </div> </fieldset> </form> diff --git a/app/code/Magento/Checkout/view/frontend/cart/sidebar/default.phtml b/app/code/Magento/Checkout/view/frontend/cart/sidebar/default.phtml index 439521b57f3820e37ae16ac62481c7db41f62f56..f0b0123e31916661faddb22fd710b1f4677961a7 100644 --- a/app/code/Magento/Checkout/view/frontend/cart/sidebar/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/cart/sidebar/default.phtml @@ -51,15 +51,15 @@ <?php if ($_options = $this->getOptionList()):?> - <div class="product options wrapper"> - <span class="more"><?php echo __('View Details') ?></span> + <div class="product options wrapper tooltip box"> + <span class="more tooltip toggle"><?php echo __('View Details') ?></span> - <div class="product options details"> - <strong class="title"><?php echo __('Options Details'); ?></strong> + <div class="product options details tooltip content"> + <strong class="subtitle"><?php echo __('Options Details'); ?></strong> <dl class="product options list"> <?php foreach ($_options as $_option) : ?> - <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd> + <dt class="label"><?php echo $this->escapeHtml($_option['label']) ?></dt> + <dd class="values"> <?php if (is_array($_option['value'])): ?> <?php echo nl2br(implode("\n", $_option['value'])) ?> <?php else: ?> @@ -92,7 +92,7 @@ <?php else: ?> <span class="label display"><?php echo __('Price'); ?></span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <span class="value excl tax"> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> </span> @@ -104,7 +104,7 @@ </div> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> @@ -113,14 +113,14 @@ </div> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> <span class="label weee"><?php echo $tax['title']; ?></span> <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> </div> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> @@ -130,7 +130,7 @@ <?php endforeach; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <div class="rate weee total"> <span class="label weee"><?php echo __('Total:'); ?></span> <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> @@ -147,7 +147,7 @@ <?php else: ?> <span class="label display"><?php echo __('Price'); ?></span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <span class="value tax incl"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php else: ?> <span class="value display"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?></span> @@ -155,21 +155,21 @@ </div> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> <span class="label weee"><?php echo $tax['title']; ?></span> <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> </div> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> <span class="label weee"><?php echo $tax['title']; ?></span> <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> </div> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <div class="rate weee"> <span class="label weee"><?php echo $tax['title']; ?></span> @@ -177,7 +177,7 @@ </div> <?php endforeach; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <div class="rate weee total"> <span class="label weee tax incl"><?php echo __('Total incl. tax'); ?></span> <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> diff --git a/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml b/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml index 8d4bc5fc7c883bb36aa8f1039334b45391897708..d50869f77e0df294708cefcae4ab565e2552c3d9 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/billing.phtml @@ -36,7 +36,7 @@ <fieldset class="fieldset address" id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>> <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" /> - <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?> + <?php echo $this->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomerData())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?> <?php if (!$this->isCustomerLoggedIn()): ?> <div class="field required email"> diff --git a/app/code/Magento/Checkout/view/frontend/onepage/review/item.phtml b/app/code/Magento/Checkout/view/frontend/onepage/review/item.phtml index f4e616a17f455ec984f320c5983a890efaa959b8..d2ce40a0d7109f0c162089591aafda0196da4cb8 100644 --- a/app/code/Magento/Checkout/view/frontend/onepage/review/item.phtml +++ b/app/code/Magento/Checkout/view/frontend/onepage/review/item.phtml @@ -34,9 +34,10 @@ $_item = $this->getItem() <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated full value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -53,13 +54,13 @@ $_item = $this->getItem() </td> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price excl tax"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> @@ -71,22 +72,22 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?><br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> </div> @@ -97,13 +98,13 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price incl tax"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> @@ -113,22 +114,22 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?>></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> </div> @@ -139,13 +140,13 @@ $_item = $this->getItem() <td class="col qty"><span class="qty"><?php echo $_item->getQty() ?></span></td> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col subtotal excl tax"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> @@ -155,22 +156,22 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> </div> @@ -181,13 +182,13 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col subtotal incl tax"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -199,22 +200,22 @@ $_item = $this->getItem() <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> </div> diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php index 0f42b37ecd3421c2a7753d9070e96fc7bae7cd77..7e43cae64b04ad6cbf0e5bc7de0355dafdc0cf4d 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php @@ -106,9 +106,9 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { $baseUrl = $this->getUrl(); - $this->addColumn('title', array('header' => __('Title'), 'align' => 'left', 'index' => 'title')); + $this->addColumn('title', array('header' => __('Title'), 'index' => 'title')); - $this->addColumn('identifier', array('header' => __('URL Key'), 'align' => 'left', 'index' => 'identifier')); + $this->addColumn('identifier', array('header' => __('URL Key'), 'index' => 'identifier')); $this->addColumn( 'root_template', @@ -150,22 +150,35 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended $this->addColumn( 'creation_time', - array('header' => __('Created'), 'index' => 'creation_time', 'type' => 'datetime') + array( + 'header' => __('Created'), + 'index' => 'creation_time', + 'type' => 'datetime', + 'header_css_class' => 'col-date', + 'column_css_class' => 'col-date' + ) ); $this->addColumn( 'update_time', - array('header' => __('Modified'), 'index' => 'update_time', 'type' => 'datetime') + array( + 'header' => __('Modified'), + 'index' => 'update_time', + 'type' => 'datetime', + 'header_css_class' => 'col-date', + 'column_css_class' => 'col-date' + ) ); $this->addColumn( 'page_actions', array( 'header' => __('Action'), - 'width' => 10, 'sortable' => false, 'filter' => false, - 'renderer' => 'Magento\Cms\Block\Adminhtml\Page\Grid\Renderer\Action' + 'renderer' => 'Magento\Cms\Block\Adminhtml\Page\Grid\Renderer\Action', + 'header_css_class' => 'col-action', + 'column_css_class' => 'col-action' ) ); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php index cab2c94310a0d60bf4a0d48c20fa45e900621ff6..17d8e25c9ff9e3d1d880c4e0aa23d626c4490aaa 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php @@ -174,9 +174,9 @@ class Images extends \Magento\Backend\App\Action $path = $this->getStorage()->getSession()->getCurrentPath(); foreach ($files as $file) { $file = $helper->idDecode($file); - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $this->_objectManager->get('Magento\App\Filesystem'); - $dir = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $this->_objectManager->get('Magento\Framework\App\Filesystem'); + $dir = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); $filePath = $path . '/' . $file; if ($dir->isFile($dir->getRelativePath($filePath))) { $this->getStorage()->deleteFile($filePath); diff --git a/app/code/Magento/Cms/Controller/Index.php b/app/code/Magento/Cms/Controller/Index.php index 05f9b02d635aca7dd1fc51cd925f682292b12753..7ab8f81addcf02d77a2f344999d54f9203fcd9e3 100644 --- a/app/code/Magento/Cms/Controller/Index.php +++ b/app/code/Magento/Cms/Controller/Index.php @@ -32,7 +32,7 @@ namespace Magento\Cms\Controller; * @package Magento_Cms * @author Magento Core Team <core@magentocommerce.com> */ -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * Renders CMS Home page @@ -43,7 +43,7 @@ class Index extends \Magento\App\Action\Action public function indexAction($coreRoute = null) { $pageId = $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->getValue( \Magento\Cms\Helper\Page::XML_PATH_HOME_PAGE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE @@ -91,7 +91,7 @@ class Index extends \Magento\App\Action\Action public function noCookiesAction() { $pageId = $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface', + 'Magento\Framework\App\Config\ScopeConfigInterface', \Magento\Store\Model\ScopeInterface::SCOPE_STORE )->getValue( \Magento\Cms\Helper\Page::XML_PATH_NO_COOKIES_PAGE, diff --git a/app/code/Magento/Cms/Controller/Noroute.php b/app/code/Magento/Cms/Controller/Noroute.php index c1878e36834c805930b262e2ddce5f50ef164ad2..0a0abd31b6a580e11a381efb9628479fa20ebfa3 100644 --- a/app/code/Magento/Cms/Controller/Noroute.php +++ b/app/code/Magento/Cms/Controller/Noroute.php @@ -24,7 +24,7 @@ */ namespace Magento\Cms\Controller; -class Noroute extends \Magento\App\Action\Action +class Noroute extends \Magento\Framework\App\Action\Action { /** * Render CMS 404 Not found page @@ -37,7 +37,7 @@ class Noroute extends \Magento\App\Action\Action $this->getResponse()->setHeader('Status', '404 File not found'); $pageId = $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface', + 'Magento\Framework\App\Config\ScopeConfigInterface', \Magento\Store\Model\ScopeInterface::SCOPE_STORE )->getValue( \Magento\Cms\Helper\Page::XML_PATH_NO_ROUTE_PAGE, diff --git a/app/code/Magento/Cms/Controller/Page.php b/app/code/Magento/Cms/Controller/Page.php index 5346d242cbef8ce056ac8fc106ead349d17949d1..169bb9e18378d4400468a14353606cc23807b6e7 100644 --- a/app/code/Magento/Cms/Controller/Page.php +++ b/app/code/Magento/Cms/Controller/Page.php @@ -32,7 +32,7 @@ namespace Magento\Cms\Controller; * @package Magento_Cms * @author Magento Core Team <core@magentocommerce.com> */ -class Page extends \Magento\App\Action\Action +class Page extends \Magento\Framework\App\Action\Action { /** * View CMS page action diff --git a/app/code/Magento/Cms/Controller/Router.php b/app/code/Magento/Cms/Controller/Router.php index 6764f03ccbdf837f57cb197ffb347f4d0e7c5ae2..87d9f44869a82041b59a8f5cc8c20606f2735aa2 100644 --- a/app/code/Magento/Cms/Controller/Router.php +++ b/app/code/Magento/Cms/Controller/Router.php @@ -32,7 +32,7 @@ namespace Magento\Cms\Controller; * @package Magento_Cms * @author Magento Core Team <core@magentocommerce.com> */ -class Router extends \Magento\App\Router\AbstractRouter +class Router extends \Magento\Framework\App\Router\AbstractRouter { /** * Event manager @@ -58,7 +58,7 @@ class Router extends \Magento\App\Router\AbstractRouter /** * Config primary * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -72,29 +72,29 @@ class Router extends \Magento\App\Router\AbstractRouter /** * Response * - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; /** * Construct * - * @param \Magento\App\ActionFactory $actionFactory + * @param \Magento\Framework\App\ActionFactory $actionFactory * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $url - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Cms\Model\PageFactory $pageFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response */ public function __construct( - \Magento\App\ActionFactory $actionFactory, + \Magento\Framework\App\ActionFactory $actionFactory, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $url, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\ResponseInterface $response + \Magento\Framework\App\ResponseInterface $response ) { parent::__construct($actionFactory); $this->_eventManager = $eventManager; @@ -108,12 +108,12 @@ class Router extends \Magento\App\Router\AbstractRouter /** * Validate and Match Cms Page and modify request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool * * @SuppressWarnings(PHPMD.ExitExpression) */ - public function match(\Magento\App\RequestInterface $request) + public function match(\Magento\Framework\App\RequestInterface $request) { if (!$this->_appState->isInstalled()) { $this->_response->setRedirect($this->_url->getUrl('install'))->sendResponse(); @@ -133,7 +133,7 @@ class Router extends \Magento\App\Router\AbstractRouter $this->_response->setRedirect($condition->getRedirectUrl()); $request->setDispatched(true); return $this->_actionFactory->createController( - 'Magento\App\Action\Redirect', + 'Magento\Framework\App\Action\Redirect', array('request' => $request) ); } @@ -152,6 +152,9 @@ class Router extends \Magento\App\Router\AbstractRouter $request->setModuleName('cms')->setControllerName('page')->setActionName('view')->setParam('page_id', $pageId); $request->setAlias(\Magento\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier); - return $this->_actionFactory->createController('Magento\App\Action\Forward', array('request' => $request)); + return $this->_actionFactory->createController( + 'Magento\Framework\App\Action\Forward', + array('request' => $request) + ); } } diff --git a/app/code/Magento/Cms/Helper/Data.php b/app/code/Magento/Cms/Helper/Data.php index 00d7af638369c32dfe18f8b3fe5570f9fbd96896..38fb127971ede3e96066e7b1681ab29b0fb3a908 100644 --- a/app/code/Magento/Cms/Helper/Data.php +++ b/app/code/Magento/Cms/Helper/Data.php @@ -25,6 +25,6 @@ */ namespace Magento\Cms\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Cms/Helper/Page.php b/app/code/Magento/Cms/Helper/Page.php index 8bbb2a8178bbae63053f6e4c58db0eb06d0817e6..04785de89d8c3025f74eab8f8248431d4e84e560 100644 --- a/app/code/Magento/Cms/Helper/Page.php +++ b/app/code/Magento/Cms/Helper/Page.php @@ -25,21 +25,26 @@ */ namespace Magento\Cms\Helper; -use Magento\App\Action\Action; +use Magento\Framework\App\Action\Action; /** * CMS Page Helper - * - * @category Magento - * @package Magento_Cms - * @author Magento Core Team <core@magentocommerce.com> */ -class Page extends \Magento\App\Helper\AbstractHelper +class Page extends \Magento\Framework\App\Helper\AbstractHelper { + /** + * CMS no-route config path + */ const XML_PATH_NO_ROUTE_PAGE = 'web/default/cms_no_route'; + /** + * CMS no cookies config path + */ const XML_PATH_NO_COOKIES_PAGE = 'web/default/cms_no_cookies'; + /** + * CMS home page config path + */ const XML_PATH_HOME_PAGE = 'web/default/cms_home_page'; /** @@ -91,12 +96,12 @@ class Page extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_view; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\Cms\Model\Page $page * @param \Magento\Theme\Helper\Layout $pageLayout @@ -105,10 +110,10 @@ class Page extends \Magento\App\Helper\AbstractHelper * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Escaper $escaper - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Message\ManagerInterface $messageManager, \Magento\Cms\Model\Page $page, \Magento\Theme\Helper\Layout $pageLayout, @@ -117,7 +122,7 @@ class Page extends \Magento\App\Helper\AbstractHelper \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Escaper $escaper, - \Magento\App\ViewInterface $view + \Magento\Framework\App\ViewInterface $view ) { $this->messageManager = $messageManager; $this->_view = $view; @@ -188,9 +193,14 @@ class Page extends \Magento\App\Helper\AbstractHelper $this->_view->addActionLayoutHandles(); if ($this->_page->getRootTemplate()) { - $handle = $this->_page->getCustomRootTemplate() && - $this->_page->getCustomRootTemplate() != 'empty' && - $inRange ? $this->_page->getCustomRootTemplate() : $this->_page->getRootTemplate(); + if ($this->_page->getCustomRootTemplate() + && $this->_page->getCustomRootTemplate() != 'empty' + && $inRange + ) { + $handle = $this->_page->getCustomRootTemplate(); + } else { + $handle = $this->_page->getRootTemplate(); + } $this->_pageLayout->applyHandle($handle); } @@ -200,8 +210,11 @@ class Page extends \Magento\App\Helper\AbstractHelper ); $this->_view->loadLayoutUpdates(); - $layoutUpdate = $this->_page->getCustomLayoutUpdateXml() && - $inRange ? $this->_page->getCustomLayoutUpdateXml() : $this->_page->getLayoutUpdateXml(); + if ($this->_page->getCustomLayoutUpdateXml() && $inRange) { + $layoutUpdate = $this->_page->getCustomLayoutUpdateXml(); + } else { + $layoutUpdate = $this->_page->getLayoutUpdateXml(); + } if (!empty($layoutUpdate)) { $this->_view->getLayout()->getUpdate()->addUpdate($layoutUpdate); } diff --git a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php index a84842cf2a205913c177357ef58e9cc5b69f4b88..dd4990fae0c5e263378661e31393acafee77b531 100644 --- a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php @@ -28,7 +28,7 @@ namespace Magento\Cms\Helper\Wysiwyg; /** * Wysiwyg Images Helper */ -class Images extends \Magento\App\Helper\AbstractHelper +class Images extends \Magento\Framework\App\Helper\AbstractHelper { /** * Current directory path @@ -78,17 +78,17 @@ class Images extends \Magento\App\Helper\AbstractHelper /** * Construct * - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Backend\Helper\Data $backendData, \Magento\Core\Helper\Data $coreData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Store\Model\StoreManagerInterface $storeManager ) { parent::__construct($context); @@ -96,7 +96,7 @@ class Images extends \Magento\App\Helper\AbstractHelper $this->_coreData = $coreData; $this->_storeManager = $storeManager; - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_directory->create(\Magento\Cms\Model\Wysiwyg\Config::IMAGE_DIRECTORY); } diff --git a/app/code/Magento/Cms/Model/Observer.php b/app/code/Magento/Cms/Model/Observer.php index 9742ae62036c856e006a32732df830abd433e3f2..3a62784a8f38653d825deab41c570309a1d48daf 100644 --- a/app/code/Magento/Cms/Model/Observer.php +++ b/app/code/Magento/Cms/Model/Observer.php @@ -40,17 +40,17 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Cms\Helper\Page $cmsPage - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\Cms\Helper\Page $cmsPage, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_cmsPage = $cmsPage; $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index ce303c18fa8232bac57b3a3ddebeccc084fc838c..e20200745817562a7a9ebf1e6977cce6d5092504 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -45,12 +45,12 @@ class Block extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager ) { diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index d2a2abb6931679a60c19ad6f82b2f1a410cd5730..d98f06afa0355c4a31d19ee7ba5f551b8d8629e8 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -62,14 +62,14 @@ class Page extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Filter\FilterManager $filter */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Config.php b/app/code/Magento/Cms/Model/Wysiwyg/Config.php index ebbfc78c52410ec39677b4a455ff45365afe66d9..860640d6a35b9c6ac77c56fe53a29063488c4fa8 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Config.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Config.php @@ -81,7 +81,7 @@ class Config extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -103,7 +103,7 @@ class Config extends \Magento\Object * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Variable\Config $variableConfig * @param \Magento\Widget\Model\Widget\Config $widgetConfig - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $windowSize * @param array $data */ @@ -115,7 +115,7 @@ class Config extends \Magento\Object \Magento\View\Url $viewUrl, \Magento\Core\Model\Variable\Config $variableConfig, \Magento\Widget\Model\Widget\Config $widgetConfig, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $windowSize = array(), array $data = array() ) { diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index d05054aa378dc0d712f9718929eca7e4bafeb9ed..4d07b0b7c903be968e862424b2153954528556eb 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -43,7 +43,7 @@ class Storage extends \Magento\Object /** * Config object * - * @var \Magento\App\Config\Element + * @var \Magento\Framework\App\Config\Element */ protected $_config; @@ -150,7 +150,7 @@ class Storage extends \Magento\Object * @param \Magento\Backend\Model\UrlInterface $backendUrl * @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Image\AdapterFactory $imageFactory * @param \Magento\View\Url $viewUrl * @param \Magento\Cms\Model\Wysiwyg\Images\Storage\CollectionFactory $storageCollectionFactory @@ -170,7 +170,7 @@ class Storage extends \Magento\Object \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Image\AdapterFactory $imageFactory, \Magento\View\Url $viewUrl, \Magento\Cms\Model\Wysiwyg\Images\Storage\CollectionFactory $storageCollectionFactory, @@ -187,7 +187,7 @@ class Storage extends \Magento\Object $this->_backendUrl = $backendUrl; $this->_cmsWysiwygImages = $cmsWysiwygImages; $this->_coreFileStorageDb = $coreFileStorageDb; - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_imageFactory = $imageFactory; $this->_viewUrl = $viewUrl; $this->_storageCollectionFactory = $storageCollectionFactory; diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 90db668dff5c9b981f42c2ae56712b58fff75d63..837f3a894002ac47dc1d3bdd6e9225206e38b181 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -31,15 +31,15 @@ namespace Magento\Cms\Model\Wysiwyg\Images\Storage; class Collection extends \Magento\Data\Collection\Filesystem { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\Framework\App\Filesystem $filesystem) { $this->_filesystem = $filesystem; parent::__construct($entityFactory); @@ -54,7 +54,7 @@ class Collection extends \Magento\Data\Collection\Filesystem protected function _generateRow($filename) { $filename = preg_replace('~[/\\\]+~', '/', $filename); - $path = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $path = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); return array( 'filename' => $filename, 'basename' => basename($filename), diff --git a/app/code/Magento/Cms/etc/adminhtml/routes.xml b/app/code/Magento/Cms/etc/adminhtml/routes.xml index ae6d45d2ecd61e407938f23bbeac576ccf9b53bb..f8f3fe4933581564c2e469ca0c36998445dbfb3b 100644 --- a/app/code/Magento/Cms/etc/adminhtml/routes.xml +++ b/app/code/Magento/Cms/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="cms" frontName="cms"> <module name="Magento_Cms_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Cms/etc/frontend/di.xml b/app/code/Magento/Cms/etc/frontend/di.xml index 59cdf039bb243003bd5dd83bf602a87eabf87ab8..99775d74e35d43b3d1a1ee6f488733b7dc435167 100644 --- a/app/code/Magento/Cms/etc/frontend/di.xml +++ b/app/code/Magento/Cms/etc/frontend/di.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\RouterList"> + <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> <item name="cms" xsi:type="array"> diff --git a/app/code/Magento/Cms/etc/frontend/routes.xml b/app/code/Magento/Cms/etc/frontend/routes.xml index fe18b72114d6e7c1ca0a31c07d5b6d01efd23171..30d1b51130648cbe7ccfd2a910d6635aa57fa730 100644 --- a/app/code/Magento/Cms/etc/frontend/routes.xml +++ b/app/code/Magento/Cms/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="cms" frontName="cms"> <module name="Magento_Cms" /> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml index c47ea8c8187e6a1283e83b32a2da0e2faa37376a..ba39fb8c8798acf58e2896385b8c0d2a485dd811 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_index.xml @@ -89,6 +89,8 @@ <argument name="header" xsi:type="string" translate="true">Created</argument> <argument name="type" xsi:type="string">datetime</argument> <argument name="index" xsi:type="string">creation_time</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="update_time"> @@ -96,6 +98,8 @@ <argument name="header" xsi:type="string" translate="true">Modified</argument> <argument name="type" xsi:type="string">datetime</argument> <argument name="index" xsi:type="string">update_time</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml index 23d8977dbdb32a60e2dc39314667157b09771585..4197f3db4e774ce265cb50290a6f6e602c4960bb 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml @@ -55,11 +55,6 @@ <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> </block> - <block class="Magento\Theme\Block\Html\Head\Script" name="magento-cms-js-tiny-mce-form-submit-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Cms::js/tiny_mce_form_submit.js</argument> - </arguments> - </block> </referenceBlock> <update handle="editor"/> <referenceContainer name="content"> diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index 57077d22a1995c8401a2a48aa103c83dc5df43e2..6207e5e437cd9e9943f93d971d1e4cce8ad8eaa1 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -51,7 +51,7 @@ class Matrix extends \Magento\Backend\Block\Template protected $_productFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_applicationConfig; diff --git a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php index 07112dbe5bfb7942c8f98972801a1b39d360231b..5c4911e0f30e2ffb12ffbed67f4bbdec9ebd1e0f 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php @@ -76,23 +76,13 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView protected $priceModifier; /** - * @param \Magento\View\Element\Template\Context $context - * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Math\Random $mathRandom - * @param \Magento\Checkout\Helper\Cart $cartHelper - * @param \Magento\Wishlist\Helper\Data $wishlistHelper - * @param \Magento\Catalog\Helper\Product\Compare $compareProduct - * @param \Magento\Theme\Helper\Layout $layoutHelper - * @param \Magento\Catalog\Helper\Image $imageHelper + * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Catalog\Helper\Product\Price $priceHelper - * @param \Magento\Catalog\Model\Product\PriceModifierInterface $priceModifier * @param CustomerAccountService $customerAccountService + * @param \Magento\Catalog\Model\Product\PriceModifierInterface $priceModifier * @param array $data * @param array $priceBlockTypes * @@ -207,6 +197,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView $store = $this->getCurrentStore(); $taxHelper = $this->_taxData; $currentProduct = $this->getProduct(); + $baseImageUrl = (string)$this->_imageHelper->init($currentProduct, 'image'); $preConfiguredValues = null; $preConfiguredFlag = $currentProduct->hasPreconfiguredValues(); @@ -217,7 +208,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView foreach ($this->getAllowProducts() as $product) { $productId = $product->getId(); - $image = $this->_imageHelper->init($product, 'image'); + $this->_imageHelper->init($product, 'image'); foreach ($this->getAllowAttributes() as $attribute) { $productAttribute = $attribute->getProductAttribute(); @@ -231,10 +222,12 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView $options[$productAttributeId][$attributeValue] = array(); } $options[$productAttributeId][$attributeValue][] = $productId; - !$product->getImage() || - $product->getImage() === - 'no_selection' ? $options['images'][$productAttributeId][$attributeValue][$productId] = null : - ($options['images'][$productAttributeId][$attributeValue][$productId] = (string)$image); + + if (!$product->getImage() || $product->getImage() === 'no_selection') { + $options['images'][$productAttributeId][$attributeValue][$productId] = $baseImageUrl; + } else { + $options['images'][$productAttributeId][$attributeValue][$productId] = (string)$this->_imageHelper; + } } } @@ -272,16 +265,24 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView $productsIndex = array(); } + // @todo resolve issue with weee specifics $info['options'][] = array( 'id' => $value['value_index'], 'label' => $value['label'], 'price' => $configurablePrice, 'oldPrice' => $this->_prepareOldPrice($value['pricing_value'], $value['is_percent']), + 'inclTaxPrice' => $currentProduct + ->getPriceInfo() + ->getPrice('final_price') + ->getCustomAmount($configurablePrice, 'weee') + ->getValue(), + 'exclTaxPrice' => $configurablePrice, 'products' => $productsIndex ); $optionPrices[] = $configurablePrice; } } + /** * Prepare formatted values for options choose */ diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/Plugin.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/Plugin.php index 8d7b0496843ef553ae6f6995074cca34487da1a1..0a86b955948898a8e8b6575636176c2f51199b3a 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/Plugin.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/Plugin.php @@ -52,7 +52,7 @@ class Plugin /** * @param \Magento\Catalog\Controller\Adminhtml\Product\Builder $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return \Magento\Catalog\Model\Product * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -61,7 +61,7 @@ class Plugin public function aroundBuild( \Magento\Catalog\Controller\Adminhtml\Product\Builder $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $product = $proceed($request); diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php index a0f7e89763214c9c146030783efc6eb9d68883cc..2b92c3199c95108f94552cbe13941134d807b1c1 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php @@ -29,11 +29,11 @@ class Configurable { /** * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ public function __construct( \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->productType = $productType; $this->request = $request; diff --git a/app/code/Magento/ConfigurableProduct/Model/Attribute/LockValidator.php b/app/code/Magento/ConfigurableProduct/Model/Attribute/LockValidator.php index fcbac59d429a598e7c2c77f1ec28a2fa57ea161d..23e9fac6599df53043e33962a2e723f54ab9c0f3 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Attribute/LockValidator.php +++ b/app/code/Magento/ConfigurableProduct/Model/Attribute/LockValidator.php @@ -28,14 +28,14 @@ use Magento\Catalog\Model\Attribute\LockValidatorInterface; class LockValidator implements LockValidatorInterface { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->resource = $resource; } diff --git a/app/code/Magento/ConfigurableProduct/Model/Import/Entity/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Import/Entity/Product/Type/Configurable.php index 4fb578c9be4c97c0579625f4fa6d0696dfbcb59f..b1ec11bc371826e34adb3bceb94120048df81190 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Import/Entity/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Import/Entity/Product/Type/Configurable.php @@ -138,7 +138,7 @@ class Configurable extends \Magento\ImportExport\Model\Import\Entity\Product\Typ protected $_resourceHelper; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -153,7 +153,7 @@ class Configurable extends \Magento\ImportExport\Model\Import\Entity\Product\Typ * @param array $params * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypesConfig * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $_productColFac */ public function __construct( @@ -162,7 +162,7 @@ class Configurable extends \Magento\ImportExport\Model\Import\Entity\Product\Typ array $params, \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypesConfig, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Model\Resource\Product\CollectionFactory $_productColFac ) { $this->_productTypesConfig = $productTypesConfig; diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php index 476c2d534290bd75beb895e83aed516b7eb2db7e..de5d4aadff320c72d13e4a46181005f766509f3a 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php @@ -93,7 +93,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType protected $_canConfigure = true; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -165,7 +165,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory @@ -176,7 +176,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Product\CollectionFactory $productCollectionFactory * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -189,7 +189,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory, @@ -200,7 +200,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Product\CollectionFactory $productCollectionFactory, \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable $catalogProductTypeConfigurable, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = array() ) { $this->_typeConfigurableFactory = $typeConfigurableFactory; diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/Configurable.php index 8ec1e7bb0b570956bef0ec8df2e5961483f7f0f0..bae1718875025dbd25224672f0693f377bd2a75e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/Configurable.php @@ -26,14 +26,14 @@ namespace Magento\ConfigurableProduct\Model\Product\TypeTransitionManager\Plugin; use Closure; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; class Configurable { /** * Request instance * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Validator/Plugin.php b/app/code/Magento/ConfigurableProduct/Model/Product/Validator/Plugin.php index 630b0c785e07d5c8532b6f5e8871eb42a85bb011..c8eb8686c8ec9cd3226308395170f85058149858 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Validator/Plugin.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Validator/Plugin.php @@ -24,7 +24,7 @@ namespace Magento\ConfigurableProduct\Model\Product\Validator; use Closure; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ProductFactory; use Magento\Event\Manager; @@ -77,7 +77,7 @@ class Plugin \Magento\Catalog\Model\Product\Validator $subject, Closure $proceed, \Magento\Catalog\Model\Product $product, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Object $response ) { $result = $proceed($product, $request, $response); diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php index 353ceaba472f9f5cff7dcf9651f10de59c01a666..274c11076f6b1a0daa475953669f844f1450a517 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php @@ -61,14 +61,14 @@ class AssociatedProduct extends \Magento\Catalog\Model\Resource\Product\Collecti * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -87,14 +87,14 @@ class AssociatedProduct extends \Magento\Catalog\Model\Resource\Product\Collecti \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index 266748ff6aa93b2b090f382e2c2008769f204e2a..5107b8bdb2de4efb43511c4cd93246d93e38620e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -35,11 +35,11 @@ class Configurable extends \Magento\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php index d1b5025c2e8e46e643bb943abdb955086e64bb1c..d4d0bacb3173f09b71190a4452fd7ba90d529aab 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php @@ -56,12 +56,12 @@ class Attribute extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData ) { diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml index bd9fdec1984895aba95ff59de245448fe0eee99a..6106e52830d91af0f0be2a55dc8d156455d9349c 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="catalog" frontName="catalog"> <module name="Magento_ConfigurableProduct" /> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml index 1a040012b7230351c8b308356b08b4eac3fbfb1d..3313de686609e9f5c84e4ea72b3cdeebe23fd956 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml @@ -138,7 +138,7 @@ </tbody> <tfoot> <tr> - <td colspan="4"><?php echo $this->getChildHtml('add_option'); ?></td> + <td colspan="4" class="col-actions-add"><?php echo $this->getChildHtml('add_option'); ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-template.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-template.phtml index 22cceedd69877850fed936790080748ac76db1f9..34199d92a74c103fd87321b9200de2d1d98f6876 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-template.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/catalog/product/edit/super/attribute-template.phtml @@ -175,7 +175,7 @@ $id = $this->escapeHtml($attribute['attribute_id']); </tbody> <tfoot> <tr> - <td colspan="4"><?php echo $this->getChildHtml('add_option'); ?></td> + <td colspan="4" class="col-actions-add"><?php echo $this->getChildHtml('add_option'); ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/css/configurable-product.css b/app/code/Magento/ConfigurableProduct/view/adminhtml/css/configurable-product.css new file mode 100644 index 0000000000000000000000000000000000000000..96d3309923c92a0923e564465cdd3ccedf3a8085 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/css/configurable-product.css @@ -0,0 +1,28 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +#configurable-attributes-container .col-name { + max-width: 400px; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml index 904215ea3a970df7fa275091dfad9dd9a267efcc..a632971d08dc2d145100837495d9e4cf5721d160 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_configurable.xml @@ -25,6 +25,13 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="catalog_product_superconfig_config"/> + <referenceBlock name="head"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-grouped-product-css-grouped-product-css"> + <arguments> + <argument name="file" xsi:type="string">Magento_ConfigurableProduct::css/configurable-product.css</argument> + </arguments> + </block> + </referenceBlock> <referenceBlock name="product_tabs"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" name="admin.product.edit.tab.super.config.grid.container"> <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config" template="Magento_ConfigurableProduct::catalog/product/edit/super/generator.phtml" name="product-variations-generator" as="generator"> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/product/configurable/stock/disabler.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/product/configurable/stock/disabler.phtml index 3aa73044427add0be458e61a999458be88f8226f..57738a3cb063288af9a587ae0469dec6fd8b72e1 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/product/configurable/stock/disabler.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/product/configurable/stock/disabler.phtml @@ -23,12 +23,11 @@ */ ?> <script type="text/javascript"> -jQuery(function($) { +(function($) { $('#product_info_tabs_product-details_content').on('stockbeforedisable', function(e) { - if (e.productType === 'configurable' && $('[data-panel=product-variations]').is('.opened')) { - e.stopImmediatePropagation(); + if ($('[data-panel=product-variations]').is('.opened')) { return false; } }); - }); +})(jQuery); </script> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/product/product.css b/app/code/Magento/ConfigurableProduct/view/adminhtml/product/product.css index c8130fb80f35cce04ec63bb262af45c1c3e2e082..213e7b4b5ef1a1c45690100c895d7caffaab742f 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/product/product.css +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/product/product.css @@ -95,6 +95,7 @@ } #product-variations-matrix img.variation { + display: block; position: relative; border: 0; width: 32px; @@ -177,7 +178,7 @@ #product-variations-matrix .action-choose[disabled] { color: #b8b3a7; float: right; - margin: 6px 0 0 5px; + margin: 2px 0 0 5px; } #product-variations-matrix .action-choose:hover { @@ -193,6 +194,11 @@ content: '\e03f'; /* user icon */ } +#product-variations-matrix .col-name > a { + display: inline-block; + margin-top: 5px; +} + #product-variations-matrix .col-name > a + .action-choose:before { content: '\e040'; /* user icon */ color: #a09a8c; diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.js index 659e2976ba6c114b81628ef125f8b8964f5d754e..04bec6b59b1ee5dc94e21014c1fd51124b5a1a2e 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.js @@ -426,15 +426,27 @@ return true; } var price = 0, - oldPrice = 0; + oldPrice = 0, + inclTaxPrice = 0, + exclTaxPrice = 0; for (var i = this.options.settings.length - 1; i >= 0; i--) { var selected = this.options.settings[i].options[this.options.settings[i].selectedIndex]; if (selected && selected.config) { price += parseFloat(selected.config.price); oldPrice += parseFloat(selected.config.oldPrice); + inclTaxPrice += parseFloat(selected.config.inclTaxPrice); + exclTaxPrice += parseFloat(selected.config.exclTaxPrice); } } - this.element.trigger('changePrice', {'config': 'config', 'price': {'price': price, 'oldPrice': oldPrice} }).trigger('reloadPrice'); + this.element.trigger('changePrice', { + 'config': 'config', + 'price': { + 'price': price, + 'oldPrice': oldPrice, + 'inclTaxPrice': inclTaxPrice, + 'exclTaxPrice': exclTaxPrice + } + }).trigger('reloadPrice'); return price; } }); diff --git a/app/code/Magento/Connect/Helper/Data.php b/app/code/Magento/Connect/Helper/Data.php index b88e9b5c27945132101a598ef9ed211fd91233a1..8d09f37a032c554cecd8c157e71365e1244aa31f 100644 --- a/app/code/Magento/Connect/Helper/Data.php +++ b/app/code/Magento/Connect/Helper/Data.php @@ -31,7 +31,7 @@ namespace Magento\Connect\Helper; class Data extends \Magento\Core\Helper\Data { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -46,27 +46,36 @@ class Data extends \Magento\Core\Helper\Data protected $readDirectory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Convert\Xml $xmlConverter * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Convert\Xml $xmlConverter, $dbCompatibleMode = true ) { $this->filesystem = $filesystem; - $this->readDirectory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::VAR_DIR); + $this->readDirectory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::VAR_DIR); $this->_xmlConverter = $xmlConverter; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** diff --git a/app/code/Magento/Connect/Model/Extension.php b/app/code/Magento/Connect/Model/Extension.php index 182f244818c9f633c7e65e4085e36a32328c66b7..664f85f64bbefdcf4aa66eb516aee1c72c7b0281 100644 --- a/app/code/Magento/Connect/Model/Extension.php +++ b/app/code/Magento/Connect/Model/Extension.php @@ -45,7 +45,7 @@ class Extension extends \Magento\Object protected $_package; /** - * @var \Magento\App\Filesystem $filesystem + * @var \Magento\Framework\App\Filesystem $filesystem */ protected $filesystem; @@ -75,14 +75,14 @@ class Extension extends \Magento\Object * Constructor * * @param \Magento\Convert\ConvertArray $convertArray - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param Session $session * @param \Magento\Logger $logger * @param array $data */ public function __construct( \Magento\Convert\ConvertArray $convertArray, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Connect\Model\Session $session, \Magento\Logger $logger, array $data = array() @@ -90,7 +90,7 @@ class Extension extends \Magento\Object $this->_convertArray = $convertArray; $this->_session = $session; $this->filesystem = $filesystem; - $this->writeDirectory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->writeDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->logger = $logger; parent::__construct($data); } diff --git a/app/code/Magento/Connect/Model/Extension/Collection.php b/app/code/Magento/Connect/Model/Extension/Collection.php index 4e97103bb5b63da4f188d2025b5823c74b4d936c..b574c98308173d2dbc8ccdd00676e1dc78e6a19e 100644 --- a/app/code/Magento/Connect/Model/Extension/Collection.php +++ b/app/code/Magento/Connect/Model/Extension/Collection.php @@ -52,7 +52,7 @@ class Collection extends \Magento\Data\Collection\Filesystem protected $_disallowedFilesMask = '/^package\.xml$/i'; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -65,13 +65,13 @@ class Collection extends \Magento\Data\Collection\Filesystem * Set base dir * * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\Framework\App\Filesystem $filesystem) { parent::__construct($entityFactory); $this->filesystem = $filesystem; - $this->connectDirectory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->connectDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->connectDirectory->create('connect'); $this->addTargetDir($this->connectDirectory->getAbsolutePath('connect')); } diff --git a/app/code/Magento/Connect/Model/Session.php b/app/code/Magento/Connect/Model/Session.php index b3b74e27985fddcd47e40b6889980fffabb50779..0ef25152ca22a57ab22c886fc7de05217dd00f5a 100644 --- a/app/code/Magento/Connect/Model/Session.php +++ b/app/code/Magento/Connect/Model/Session.php @@ -38,7 +38,7 @@ class Session extends \Magento\Session\SessionManager protected $_connectData; /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -47,7 +47,7 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\Connect\Helper\Data $connectData */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, diff --git a/app/code/Magento/Connect/etc/adminhtml/routes.xml b/app/code/Magento/Connect/etc/adminhtml/routes.xml index 1e153a8518ee6089a703dc836bdb19e506211dbf..35fad955f78a20ea11cbfe8daaa8f6a1908e8ecc 100644 --- a/app/code/Magento/Connect/etc/adminhtml/routes.xml +++ b/app/code/Magento/Connect/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Connect" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml b/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml index 8ad8a9fd7c64930adbda5875982a2d83a7417192..1ea7afe3761e21752847b43395544922f23bb1a9 100644 --- a/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml +++ b/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml @@ -70,7 +70,7 @@ function addAuthor(data) </thead> <tfoot> <tr> - <td colspan="4"><?php echo $this->getAddAuthorButtonHtml() ?></td> + <td colspan="4" class="col-actions-add"><?php echo $this->getAddAuthorButtonHtml() ?></td> </tr> </tfoot> <tbody id="authors_container"> diff --git a/app/code/Magento/Connect/view/adminhtml/extension/custom/contents.phtml b/app/code/Magento/Connect/view/adminhtml/extension/custom/contents.phtml index e3a079db9b23765a1cdcadd4f3a00e0913b38a27..e5e5fd827ec4a29bc0f4185343f4fd44b0c92bb1 100644 --- a/app/code/Magento/Connect/view/adminhtml/extension/custom/contents.phtml +++ b/app/code/Magento/Connect/view/adminhtml/extension/custom/contents.phtml @@ -84,7 +84,7 @@ </tbody> <tfoot> <tr> - <td colspan="6"><?php echo $this->getAddRowButtonHtml('contents_container', 'contents_template', __('Add Contents Path')) ?></td> + <td colspan="6" class="col-actions-add"><?php echo $this->getAddRowButtonHtml('contents_container', 'contents_template', __('Add Contents Path')) ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/Connect/view/adminhtml/extension/custom/depends.phtml b/app/code/Magento/Connect/view/adminhtml/extension/custom/depends.phtml index a5c192ad476aa959ab0f70b658b61022963f674c..af8bf3ac2eb41b770665049ac981282a17e15bda 100644 --- a/app/code/Magento/Connect/view/adminhtml/extension/custom/depends.phtml +++ b/app/code/Magento/Connect/view/adminhtml/extension/custom/depends.phtml @@ -79,7 +79,7 @@ </tbody> <tfoot> <tr> - <td colspan="8"><?php echo $this->getAddRowButtonHtml('depends_packages_container', 'depends_packages_template', __('Add Package dependency')) ?></td> + <td colspan="8" class="col-actions-add"><?php echo $this->getAddRowButtonHtml('depends_packages_container', 'depends_packages_template', __('Add Package dependency')) ?></td> </tr> </tfoot> </table> @@ -129,7 +129,7 @@ </tbody> <tfoot> <tr> - <td colspan="7"><?php echo $this->getAddRowButtonHtml('depends_extensions_container', 'depends_extensions_template', __('Add PHP Extension dependency')) ?></td> + <td colspan="7" class="col-actions-add"><?php echo $this->getAddRowButtonHtml('depends_extensions_container', 'depends_extensions_template', __('Add PHP Extension dependency')) ?></td> </tr> </tfoot> </table> diff --git a/app/code/Magento/Connect/view/adminhtml/extension/custom/load.phtml b/app/code/Magento/Connect/view/adminhtml/extension/custom/load.phtml index 6ec1074b0105b827d3688044506aebf679318761..47d323cdfb6bf934103ea18fc90f17b5b17aeb99 100644 --- a/app/code/Magento/Connect/view/adminhtml/extension/custom/load.phtml +++ b/app/code/Magento/Connect/view/adminhtml/extension/custom/load.phtml @@ -25,7 +25,7 @@ */ ?> -<div class="message notice"> +<div class="message info"> <div><?php echo __("Caution: All unsaved form data will be lost as soon as you you click on the row and the package data loads.") ?></div> </div> <?php echo $this->getPackageGridHtml() ?> diff --git a/app/code/Magento/Contact/Controller/Index.php b/app/code/Magento/Contact/Controller/Index.php index 0ea8142e10a2c35629fe1364b49f84f822d2fad7..709f2f282652e57fd8e95e1778005f710330e2b3 100644 --- a/app/code/Magento/Contact/Controller/Index.php +++ b/app/code/Magento/Contact/Controller/Index.php @@ -23,13 +23,13 @@ */ namespace Magento\Contact\Controller; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; /** * Contact index controller */ -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { const XML_PATH_EMAIL_RECIPIENT = 'contact/email/recipient_email'; @@ -50,12 +50,12 @@ class Index extends \Magento\App\Action\Action protected $inlineTranslation; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Translate\Inline\StateInterface $inlineTranslation */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Translate\Inline\StateInterface $inlineTranslation ) { @@ -68,13 +68,13 @@ class Index extends \Magento\App\Action\Action * Dispatch request * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface - * @throws \Magento\App\Action\NotFoundException + * @return \Magento\Framework\App\ResponseInterface + * @throws \Magento\Framework\App\Action\NotFoundException */ public function dispatch(RequestInterface $request) { if (!$this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->isSetFlag( self::XML_PATH_ENABLED, \Magento\Store\Model\ScopeInterface::SCOPE_STORE @@ -144,7 +144,7 @@ class Index extends \Magento\App\Action\Action throw new \Exception(); } - $scopeConfig = $this->_objectManager->get('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $storeManager = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface'); $transport = $this->_transportBuilder->setTemplateIdentifier( $scopeConfig->getValue( diff --git a/app/code/Magento/Contact/Helper/Data.php b/app/code/Magento/Contact/Helper/Data.php index 324360785309baaadeceb5d674840024d1950a43..1dcf3c8ed8939dc35964ea5b8fe2248357ea9ff1 100644 --- a/app/code/Magento/Contact/Helper/Data.php +++ b/app/code/Magento/Contact/Helper/Data.php @@ -21,19 +21,23 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Contact\Helper; +use Magento\Customer\Service\V1\Data\Customer; +use Magento\Customer\Helper\View as CustomerViewHelper; + /** * Contact base helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_ENABLED = 'contact/contact/enabled'; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -45,17 +49,25 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_customerSession; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @var \Magento\Customer\Helper\View + */ + protected $_customerViewHelper; + + /** + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Model\Session $customerSession + * @param CustomerViewHelper $customerViewHelper */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Customer\Model\Session $customerSession + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Customer\Model\Session $customerSession, + CustomerViewHelper $customerViewHelper ) { $this->_scopeConfig = $scopeConfig; $this->_customerSession = $customerSession; + $this->_customerViewHelper = $customerViewHelper; parent::__construct($context); } @@ -79,8 +91,11 @@ class Data extends \Magento\App\Helper\AbstractHelper if (!$this->_customerSession->isLoggedIn()) { return ''; } - $customer = $this->_customerSession->getCustomer(); - return trim($customer->getName()); + /** + * @var Customer $customer + */ + $customer = $this->_customerSession->getCustomerDataObject(); + return trim($this->_customerViewHelper->getCustomerName($customer)); } /** @@ -93,7 +108,10 @@ class Data extends \Magento\App\Helper\AbstractHelper if (!$this->_customerSession->isLoggedIn()) { return ''; } - $customer = $this->_customerSession->getCustomer(); + /** + * @var Customer $customer + */ + $customer = $this->_customerSession->getCustomerDataObject(); return $customer->getEmail(); } } diff --git a/app/code/Magento/Contact/etc/frontend/routes.xml b/app/code/Magento/Contact/etc/frontend/routes.xml index 07dc1ef76958f5124ead60692de138aafd378a37..2e9f7152a10d5b86f91c2d9af50e8bcfc29df498 100644 --- a/app/code/Magento/Contact/etc/frontend/routes.xml +++ b/app/code/Magento/Contact/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="contact" frontName="contact"> <module name="Magento_Contact" /> diff --git a/app/code/Magento/Core/App/Action/FormKeyValidator.php b/app/code/Magento/Core/App/Action/FormKeyValidator.php index 10c539effb4a9f0c5b873f4f37cad60df3c24081..137bf3a6eb4fcea4027b7047f7bef7e0d354f619 100644 --- a/app/code/Magento/Core/App/Action/FormKeyValidator.php +++ b/app/code/Magento/Core/App/Action/FormKeyValidator.php @@ -41,10 +41,10 @@ class FormKeyValidator /** * Validate form key * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - public function validate(\Magento\App\RequestInterface $request) + public function validate(\Magento\Framework\App\RequestInterface $request) { $formKey = $request->getParam('form_key', null); if (!$formKey || $formKey !== $this->_formKey->getFormKey()) { diff --git a/app/code/Magento/Core/App/Action/Plugin/Design.php b/app/code/Magento/Core/App/Action/Plugin/Design.php index 6901433a89fc79f604e2a01c929d54cc90980e1d..ea7c31cb215a4e0b081e2959a1c9f9ec0dd2ec1f 100644 --- a/app/code/Magento/Core/App/Action/Plugin/Design.php +++ b/app/code/Magento/Core/App/Action/Plugin/Design.php @@ -41,17 +41,17 @@ class Design /** * Initialize design * - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->_designLoader->load(); return $proceed($request); diff --git a/app/code/Magento/Core/App/Action/Plugin/LastUrl.php b/app/code/Magento/Core/App/Action/Plugin/LastUrl.php index d95ee3fe1c2b27afffcc5ba2b1606bb92b765d81..90a50b1f5de7e87a3b297fa09d67dc1e569a6995 100644 --- a/app/code/Magento/Core/App/Action/Plugin/LastUrl.php +++ b/app/code/Magento/Core/App/Action/Plugin/LastUrl.php @@ -64,17 +64,17 @@ class LastUrl /** * Process request * - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $result = $proceed($request); $this->_session->setLastUrl($this->_url->getUrl('*/*/*', array('_current' => true))); diff --git a/app/code/Magento/Core/App/Media.php b/app/code/Magento/Core/App/Media.php index 8cc95c6d5176b71e20f21d581e9743b1671d350c..77e27cbb63e840ee5f707421ee25301a65751191 100644 --- a/app/code/Magento/Core/App/Media.php +++ b/app/code/Magento/Core/App/Media.php @@ -25,8 +25,8 @@ */ namespace Magento\Core\App; -use Magento\App\State; -use Magento\AppInterface; +use Magento\Framework\App\State; +use Magento\Framework\AppInterface; use Magento\ObjectManager; use Magento\Core\Model\File\Storage\Request; use Magento\Core\Model\File\Storage\Response; @@ -34,7 +34,7 @@ use Magento\Core\Model\File\Storage\Response; class Media implements AppInterface { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_applicationState; @@ -89,7 +89,7 @@ class Media implements AppInterface protected $_response; /** - * @var \Magento\App\Filesystem $filesystem + * @var \Magento\Framework\App\Filesystem $filesystem */ protected $filesystem; @@ -108,7 +108,7 @@ class Media implements AppInterface * @param string $mediaDirectory * @param string $configCacheFile * @param string $relativeFileName - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( State $applicationState, @@ -120,7 +120,7 @@ class Media implements AppInterface $mediaDirectory, $configCacheFile, $relativeFileName, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_applicationState = $applicationState; $this->_objectManager = $objectManager; @@ -132,13 +132,13 @@ class Media implements AppInterface $this->_configCacheFile = $configCacheFile; $this->_relativeFileName = $relativeFileName; $this->filesystem = $filesystem; - $this->directory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + $this->directory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); } /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { diff --git a/app/code/Magento/Core/App/Router/Base.php b/app/code/Magento/Core/App/Router/Base.php index 9cb27f0a25e117445b887c08984947dd0f76c6c0..eda79092aafc96445086640b5afb191a2c840373 100644 --- a/app/code/Magento/Core/App/Router/Base.php +++ b/app/code/Magento/Core/App/Router/Base.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\App\Router; -class Base extends \Magento\App\Router\AbstractRouter +class Base extends \Magento\Framework\App\Router\AbstractRouter { /** * @var array @@ -45,7 +45,7 @@ class Base extends \Magento\App\Router\AbstractRouter protected $_requiredParams = array('moduleFrontName', 'controllerName', 'actionName'); /** - * @var \Magento\App\Route\ConfigInterface + * @var \Magento\Framework\App\Route\ConfigInterface */ protected $_routeConfig; @@ -59,7 +59,7 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -74,17 +74,17 @@ class Base extends \Magento\App\Router\AbstractRouter protected $_storeManager; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\ResponseFactory + * @var \Magento\Framework\App\ResponseFactory */ protected $_responseFactory; /** - * @var \Magento\App\DefaultPathInterface + * @var \Magento\Framework\App\DefaultPathInterface */ protected $_defaultPath; @@ -94,28 +94,28 @@ class Base extends \Magento\App\Router\AbstractRouter protected $nameBuilder; /** - * @param \Magento\App\ActionFactory $actionFactory - * @param \Magento\App\DefaultPathInterface $defaultPath - * @param \Magento\App\ResponseFactory $responseFactory - * @param \Magento\App\Route\ConfigInterface $routeConfig - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\ActionFactory $actionFactory + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\ResponseFactory $responseFactory + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\State $appState * @param \Magento\UrlInterface $url * @param \Magento\Store\Model\StoreManagerInterface|\Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param string $routerId * @param \Magento\Code\NameBuilder $nameBuilder * @throws \InvalidArgumentException */ public function __construct( - \Magento\App\ActionFactory $actionFactory, - \Magento\App\DefaultPathInterface $defaultPath, - \Magento\App\ResponseFactory $responseFactory, - \Magento\App\Route\ConfigInterface $routeConfig, - \Magento\App\State $appState, + \Magento\Framework\App\ActionFactory $actionFactory, + \Magento\Framework\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\ResponseFactory $responseFactory, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\State $appState, \Magento\UrlInterface $url, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, \Magento\Code\NameBuilder $nameBuilder @@ -135,10 +135,10 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Match provided request and if matched - return corresponding controller * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\Action\Action|null + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\Action\Action|null */ - public function match(\Magento\App\RequestInterface $request) + public function match(\Magento\Framework\App\RequestInterface $request) { $params = $this->_parseRequest($request); @@ -148,10 +148,10 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Parse request URL params * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return array */ - protected function _parseRequest(\Magento\App\RequestInterface $request) + protected function _parseRequest(\Magento\Framework\App\RequestInterface $request) { $output = array(); @@ -171,11 +171,11 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Match module front name * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $param * @return string|null */ - protected function _matchModuleFrontName(\Magento\App\RequestInterface $request, $param) + protected function _matchModuleFrontName(\Magento\Framework\App\RequestInterface $request, $param) { // get module name if ($request->getModuleName()) { @@ -195,11 +195,11 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Match controller name * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $param * @return string */ - protected function _matchControllerName(\Magento\App\RequestInterface $request, $param) + protected function _matchControllerName(\Magento\Framework\App\RequestInterface $request, $param) { if ($request->getControllerName()) { $controller = $request->getControllerName(); @@ -215,11 +215,11 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Match controller name * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $param * @return string */ - protected function _matchActionName(\Magento\App\RequestInterface $request, $param) + protected function _matchActionName(\Magento\Framework\App\RequestInterface $request, $param) { if ($request->getActionName()) { $action = $request->getActionName(); @@ -236,10 +236,10 @@ class Base extends \Magento\App\Router\AbstractRouter * Get not found controller instance * * @param string $currentModuleName - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\Action\Action|null + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\Action\Action|null */ - protected function _getNotFoundControllerInstance($currentModuleName, \Magento\App\RequestInterface $request) + protected function _getNotFoundControllerInstance($currentModuleName, \Magento\Framework\App\RequestInterface $request) { if (!$this->_noRouteShouldBeApplied()) { return null; @@ -257,11 +257,11 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Create matched controller instance * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param array $params - * @return \Magento\App\Action\Action|null + * @return \Magento\Framework\App\Action\Action|null */ - protected function _matchController(\Magento\App\RequestInterface $request, array $params) + protected function _matchController(\Magento\Framework\App\RequestInterface $request, array $params) { $moduleFrontName = $this->_matchModuleFrontName($request, $params['moduleFrontName']); if (empty($moduleFrontName)) { @@ -360,11 +360,11 @@ class Base extends \Magento\App\Router\AbstractRouter * Check that request uses https protocol if it should. * Function redirects user to correct URL if needed. * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $path * @return void */ - protected function _checkShouldBeSecure(\Magento\App\RequestInterface $request, $path = '') + protected function _checkShouldBeSecure(\Magento\Framework\App\RequestInterface $request, $path = '') { if (!$this->_appState->isInstalled() || $request->getPost()) { return; @@ -394,7 +394,7 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Retrieve secure url for current request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return string */ protected function _getCurrentSecureUrl($request) diff --git a/app/code/Magento/Core/App/Router/NoRouteHandler.php b/app/code/Magento/Core/App/Router/NoRouteHandler.php index a727207e3607b709e2ad4039376a9713612c2693..9b2d942388cbd4e3eaeae53850f69a05ae1282d8 100644 --- a/app/code/Magento/Core/App/Router/NoRouteHandler.php +++ b/app/code/Magento/Core/App/Router/NoRouteHandler.php @@ -25,17 +25,17 @@ */ namespace Magento\Core\App\Router; -class NoRouteHandler implements \Magento\App\Router\NoRouteHandlerInterface +class NoRouteHandler implements \Magento\Framework\App\Router\NoRouteHandlerInterface { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $config) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config) { $this->_config = $config; } @@ -43,11 +43,11 @@ class NoRouteHandler implements \Magento\App\Router\NoRouteHandlerInterface /** * Check and process no route request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool * @SuppressWarnings(PHPMD.NPathComplexity) */ - public function process(\Magento\App\RequestInterface $request) + public function process(\Magento\Framework\App\RequestInterface $request) { $noRoutePath = $this->_config->getValue('web/default/no_route', 'default'); diff --git a/app/code/Magento/Core/Controller/Index.php b/app/code/Magento/Core/Controller/Index.php index 855116b041542da8c8e794a8dfd3109d9dd233ae..1300a688eaf42f9507b9ba423c3d12c73f9de9f7 100644 --- a/app/code/Magento/Core/Controller/Index.php +++ b/app/code/Magento/Core/Controller/Index.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\Controller; -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * @return void diff --git a/app/code/Magento/Core/Controller/Noroute.php b/app/code/Magento/Core/Controller/Noroute.php index a1c76ae799088a1fa0df34a9e52921f3a6632ab1..1aa1e9c150da73c0c4076886af40aed93c278d70 100644 --- a/app/code/Magento/Core/Controller/Noroute.php +++ b/app/code/Magento/Core/Controller/Noroute.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\Controller; -use Magento\App\Action\Action; +use Magento\Framework\App\Action\Action; class Noroute extends Action { diff --git a/app/code/Magento/Core/Helper/Data.php b/app/code/Magento/Core/Helper/Data.php index 7a2036d3767487ead2789fcaea6702ff2dd70fbf..69f8d2e901278a40199ea3483d02cc210175f29e 100644 --- a/app/code/Magento/Core/Helper/Data.php +++ b/app/code/Magento/Core/Helper/Data.php @@ -25,10 +25,12 @@ */ namespace Magento\Core\Helper; +use Magento\Pricing\PriceCurrencyInterface; + /** * Core data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Currency cache context @@ -73,7 +75,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -83,7 +85,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -93,17 +95,24 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_dbCompatibleMode; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @var PriceCurrencyInterface + */ + protected $_priceCurrency; + + /** + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param PriceCurrencyInterface $priceCurrency * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + PriceCurrencyInterface $priceCurrency, $dbCompatibleMode = true ) { parent::__construct($context); @@ -111,6 +120,7 @@ class Data extends \Magento\App\Helper\AbstractHelper $this->_storeManager = $storeManager; $this->_appState = $appState; $this->_dbCompatibleMode = $dbCompatibleMode; + $this->_priceCurrency = $priceCurrency; } /** @@ -123,7 +133,9 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function currency($value, $format = true, $includeContainer = true) { - return $this->currencyByStore($value, null, $format, $includeContainer); + return $format + ? $this->_priceCurrency->convertAndFormat($value, $includeContainer) + : $this->_priceCurrency->convert($value); } /** @@ -137,14 +149,15 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function currencyByStore($value, $store = null, $format = true, $includeContainer = true) { - try { - if (!$store instanceof \Magento\Store\Model\Store) { - $store = $this->_storeManager->getStore($store); - } - - $value = $store->convertPrice($value, $format, $includeContainer); - } catch (\Exception $e) { - $value = $e->getMessage(); + if ($format) { + $value = $this->_priceCurrency->convertAndFormat( + $value, + $includeContainer, + PriceCurrencyInterface::DEFAULT_PRECISION, + $store + ); + } else { + $value = $this->_priceCurrency->convert($value, $store); } return $value; @@ -159,7 +172,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function formatCurrency($value, $includeContainer = true) { - return $this->currency($value, true, $includeContainer); + return $this->_priceCurrency->convertAndFormat($value, $includeContainer); } /** @@ -171,7 +184,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function formatPrice($price, $includeContainer = true) { - return $this->_storeManager->getStore()->formatPrice($price, $includeContainer); + return $this->_priceCurrency->format($price, $includeContainer); } /** @@ -190,13 +203,8 @@ class Data extends \Magento\App\Helper\AbstractHelper $remoteAddr = $this->_remoteAddress->getRemoteAddress(); if (!empty($allowedIps) && !empty($remoteAddr)) { $allowedIps = preg_split('#\s*,\s*#', $allowedIps, null, PREG_SPLIT_NO_EMPTY); - if (array_search( - $remoteAddr, - $allowedIps - ) === false && array_search( - $this->_httpHeader->getHttpHost(), - $allowedIps - ) === false + if (array_search($remoteAddr, $allowedIps) === false + && array_search($this->_httpHeader->getHttpHost(), $allowedIps) === false ) { $allow = false; } diff --git a/app/code/Magento/Core/Helper/File/Media.php b/app/code/Magento/Core/Helper/File/Media.php index ac82cbec2115e67585da70024df86ff7729f53e2..6497517f8e2534568776652741ee3f8c4c4ac2d1 100644 --- a/app/code/Magento/Core/Helper/File/Media.php +++ b/app/code/Magento/Core/Helper/File/Media.php @@ -28,7 +28,7 @@ namespace Magento\Core\Helper\File; /** * Class Media */ -class Media extends \Magento\App\Helper\AbstractHelper +class Media extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Stdlib\DateTime\DateTime @@ -36,21 +36,21 @@ class Media extends \Magento\App\Helper\AbstractHelper protected $_date; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; /** * Constructor * - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Stdlib\DateTime\DateTime $date - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Stdlib\DateTime\DateTime $date, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { parent::__construct($context); $this->_date = $date; @@ -76,7 +76,7 @@ class Media extends \Magento\App\Helper\AbstractHelper $path = ltrim($path, '\\/'); $fullPath = $mediaDirectory . '/' . $path; - $dir = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + $dir = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); $relativePath = $dir->getRelativePath($fullPath); if (!$dir->isFile($relativePath)) { throw new \Magento\Model\Exception(__('File %1 does not exist', $fullPath)); diff --git a/app/code/Magento/Core/Helper/File/Storage.php b/app/code/Magento/Core/Helper/File/Storage.php index 0eb2a3d13e5f910971b7c4f0103d8125c2510cd8..2ca2a9de93fef089c1bc392384a024a0f443d655 100644 --- a/app/code/Magento/Core/Helper/File/Storage.php +++ b/app/code/Magento/Core/Helper/File/Storage.php @@ -33,7 +33,7 @@ */ namespace Magento\Core\Helper\File; -class Storage extends \Magento\App\Helper\AbstractHelper +class Storage extends \Magento\Framework\App\Helper\AbstractHelper { /** * Current storage code @@ -69,23 +69,23 @@ class Storage extends \Magento\App\Helper\AbstractHelper protected $_filesystemStorage; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\File\Storage $storage * @param \Magento\Core\Model\File\Storage\File $filesystemStorage - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\File\Storage $storage, \Magento\Core\Model\File\Storage\File $filesystemStorage, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_filesystemStorage = $filesystemStorage; $this->_coreFileStorageDb = $coreFileStorageDb; diff --git a/app/code/Magento/Core/Helper/File/Storage/Database.php b/app/code/Magento/Core/Helper/File/Storage/Database.php index fd58a7dcd13c4d3486862f6a143eb81bdf6f1eff..89979484a54fde7b0f896b6ab4145833633e97e8 100644 --- a/app/code/Magento/Core/Helper/File/Storage/Database.php +++ b/app/code/Magento/Core/Helper/File/Storage/Database.php @@ -33,7 +33,7 @@ */ namespace Magento\Core\Helper\File\Storage; -class Database extends \Magento\App\Helper\AbstractHelper +class Database extends \Magento\Framework\App\Helper\AbstractHelper { /** * Database storage model @@ -62,7 +62,7 @@ class Database extends \Magento\App\Helper\AbstractHelper protected $_mediaBaseDirectory; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -77,23 +77,23 @@ class Database extends \Magento\App\Helper\AbstractHelper protected $_fileStorage; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Model\File\Storage\DatabaseFactory $dbStorageFactory * @param \Magento\Core\Model\File\Storage\File $fileStorage - * @param \Magento\App\Filesystem $filesystem - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Model\File\Storage\DatabaseFactory $dbStorageFactory, \Magento\Core\Model\File\Storage\File $fileStorage, - \Magento\App\Filesystem $filesystem, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_filesystem = $filesystem; $this->_dbStorageFactory = $dbStorageFactory; @@ -323,7 +323,7 @@ class Database extends \Magento\App\Helper\AbstractHelper $uniqueResultFile = $this->getUniqueFilename($path, $file); if ($uniqueResultFile !== $file) { - $dirWrite = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $dirWrite = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $dirWrite->renameFile($path . $file, $path . $uniqueResultFile); } $this->saveFile($path . $uniqueResultFile); @@ -354,7 +354,7 @@ class Database extends \Magento\App\Helper\AbstractHelper public function getMediaBaseDir() { if (null === $this->_mediaBaseDirectory) { - $mediaDir = $this->_filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR); + $mediaDir = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_mediaBaseDirectory = rtrim($mediaDir, '\\/'); } return $this->_mediaBaseDirectory; diff --git a/app/code/Magento/Core/Helper/PostData.php b/app/code/Magento/Core/Helper/PostData.php index 38a9659f677946f034793b448d3070429dd7a1f6..e5bca48fd8479e248f0ed2a236921f017c9a7319 100644 --- a/app/code/Magento/Core/Helper/PostData.php +++ b/app/code/Magento/Core/Helper/PostData.php @@ -29,7 +29,7 @@ */ namespace Magento\Core\Helper; -class PostData extends \Magento\App\Helper\AbstractHelper +class PostData extends \Magento\Framework\App\Helper\AbstractHelper { /** * get data for post by javascript in format acceptable to $.mage.dataPost widget @@ -40,8 +40,8 @@ class PostData extends \Magento\App\Helper\AbstractHelper */ public function getPostData($url, array $data = array()) { - if (!isset($data[\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED])) { - $data[\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED] = $this->getEncodedUrl(); + if (!isset($data[\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED])) { + $data[\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED] = $this->getEncodedUrl(); } return json_encode(array('action' => $url, 'data' => $data)); } diff --git a/app/code/Magento/Core/Helper/Theme.php b/app/code/Magento/Core/Helper/Theme.php index bc451f09da2266ecbac718ab6aaa6ff7b667bd3c..f3a7446a6ed69685e01113948ea2133a3cae69dc 100644 --- a/app/code/Magento/Core/Helper/Theme.php +++ b/app/code/Magento/Core/Helper/Theme.php @@ -29,12 +29,12 @@ */ namespace Magento\Core\Helper; -class Theme extends \Magento\App\Helper\AbstractHelper +class Theme extends \Magento\Framework\App\Helper\AbstractHelper { /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -58,15 +58,15 @@ class Theme extends \Magento\App\Helper\AbstractHelper protected $_viewFileSystem; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory * @param \Magento\Core\Model\Resource\Theme\Collection $themeCollection * @param \Magento\View\FileSystem $viewFileSystem */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, \Magento\Core\Model\Resource\Theme\Collection $themeCollection, \Magento\View\FileSystem $viewFileSystem @@ -114,7 +114,7 @@ class Theme extends \Magento\App\Helper\AbstractHelper $params = array('area' => $theme->getArea(), 'themeModel' => $theme, 'skipProxy' => true); - $rootDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $rootDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $files = array(); foreach ($elements as $fileId) { $fileId = (string)$fileId; @@ -138,9 +138,9 @@ class Theme extends \Magento\App\Helper\AbstractHelper */ public function getGroupedCssFiles($theme) { - $jsDir = $this->_filesystem->getPath(\Magento\App\Filesystem::PUB_LIB_DIR); - $codeDir = $this->_filesystem->getPath(\Magento\App\Filesystem::MODULES_DIR); - $designDir = $this->_filesystem->getPath(\Magento\App\Filesystem::THEMES_DIR); + $jsDir = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_LIB_DIR); + $codeDir = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::MODULES_DIR); + $designDir = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR); $groups = array(); $themes = array(); diff --git a/app/code/Magento/Core/Helper/Url.php b/app/code/Magento/Core/Helper/Url.php index 5e607b34b4cb205908cdcf1ee5a0c6e5bf517995..5d848dbd291253942e0cb3075fbcc5ee1d30bf4e 100644 --- a/app/code/Magento/Core/Helper/Url.php +++ b/app/code/Magento/Core/Helper/Url.php @@ -33,7 +33,7 @@ */ namespace Magento\Core\Helper; -class Url extends \Magento\App\Helper\AbstractHelper +class Url extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -41,11 +41,11 @@ class Url extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager ) { parent::__construct($context); diff --git a/app/code/Magento/Core/Model/App/Action/ContextPlugin.php b/app/code/Magento/Core/Model/App/Action/ContextPlugin.php index 924f595da88a38a152ed50604822d87196d0d089..c6990228e7f7c33a4ece0388e4e5a18465009b57 100644 --- a/app/code/Magento/Core/Model/App/Action/ContextPlugin.php +++ b/app/code/Magento/Core/Model/App/Action/ContextPlugin.php @@ -35,12 +35,12 @@ class ContextPlugin protected $session; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $httpRequest; @@ -51,14 +51,14 @@ class ContextPlugin /** * @param \Magento\Session\SessionManagerInterface $session - * @param \Magento\App\Http\Context $httpContext - * @param \Magento\App\Request\Http $httpRequest + * @param \Magento\Framework\App\Http\Context $httpContext + * @param \Magento\Framework\App\Request\Http $httpRequest * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Session\SessionManagerInterface $session, - \Magento\App\Http\Context $httpContext, - \Magento\App\Request\Http $httpRequest, + \Magento\Framework\App\Http\Context $httpContext, + \Magento\Framework\App\Request\Http $httpRequest, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->session = $session; @@ -68,15 +68,15 @@ class ContextPlugin } /** - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return mixed */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->httpContext->setValue( \Magento\Core\Helper\Data::CONTEXT_CURRENCY, diff --git a/app/code/Magento/Core/Model/App/Area.php b/app/code/Magento/Core/Model/App/Area.php index ddfe510387f0c1a063ca92f6f6a2d65ffe8ffffa..4b3e66090806fd26712ce847f96260521455a0b2 100644 --- a/app/code/Magento/Core/Model/App/Area.php +++ b/app/code/Magento/Core/Model/App/Area.php @@ -31,7 +31,7 @@ */ namespace Magento\Core\Model\App; -class Area implements \Magento\App\AreaInterface +class Area implements \Magento\Framework\App\AreaInterface { const AREA_GLOBAL = 'global'; @@ -75,7 +75,7 @@ class Area implements \Magento\App\AreaInterface /** * Application config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -87,14 +87,14 @@ class Area implements \Magento\App\AreaInterface protected $_objectManager; /** - * @var \Magento\App\ObjectManager\ConfigLoader + * @var \Magento\Framework\App\ObjectManager\ConfigLoader */ protected $_diConfigLoader; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -124,10 +124,10 @@ class Area implements \Magento\App\AreaInterface * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\TranslateInterface $translator - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\ObjectManager\ConfigLoader $diConfigLoader - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\ObjectManager\ConfigLoader $diConfigLoader + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Model\Design $design * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Area\DesignExceptions $designExceptions @@ -137,10 +137,10 @@ class Area implements \Magento\App\AreaInterface \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventManager, \Magento\TranslateInterface $translator, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\ObjectManager $objectManager, - \Magento\App\ObjectManager\ConfigLoader $diConfigLoader, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\ObjectManager\ConfigLoader $diConfigLoader, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Model\Design $design, \Magento\Store\Model\StoreManagerInterface $storeManager, Area\DesignExceptions $designExceptions, @@ -178,7 +178,7 @@ class Area implements \Magento\App\AreaInterface /** * Detect and apply design for the area * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return void */ public function detectDesign($request = null) @@ -198,7 +198,7 @@ class Area implements \Magento\App\AreaInterface /** * Analyze user-agent information to override custom design settings * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ protected function _applyUserAgentDesignException($request) diff --git a/app/code/Magento/Core/Model/App/Area/CacheIdentifierPlugin.php b/app/code/Magento/Core/Model/App/Area/CacheIdentifierPlugin.php index 49354fd09f1fb2f58060f0e432276ab3eeac5806..8ba3b7a402ac48d83044c058dc8855836031d476 100644 --- a/app/code/Magento/Core/Model/App/Area/CacheIdentifierPlugin.php +++ b/app/code/Magento/Core/Model/App/Area/CacheIdentifierPlugin.php @@ -36,12 +36,12 @@ class CacheIdentifierPlugin * Constructor * * @param DesignExceptions $designExceptions - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\PageCache\Model\Config $config */ public function __construct( \Magento\Core\Model\App\Area\DesignExceptions $designExceptions, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\PageCache\Model\Config $config ) { $this->designExceptions = $designExceptions; @@ -52,11 +52,11 @@ class CacheIdentifierPlugin /** * Adds a theme key to identifier for a built-in cache if user-agent theme rule is actual * - * @param \Magento\App\PageCache\Identifier $identifier + * @param \Magento\Framework\App\PageCache\Identifier $identifier * @param string $result * @return string */ - public function afterGetValue(\Magento\App\PageCache\Identifier $identifier, $result) + public function afterGetValue(\Magento\Framework\App\PageCache\Identifier $identifier, $result) { if ($this->config->getType() == \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) { $ruleDesignException = $this->designExceptions->getThemeForUserAgent($this->request); diff --git a/app/code/Magento/Core/Model/App/Area/DesignExceptions.php b/app/code/Magento/Core/Model/App/Area/DesignExceptions.php index 8f27b1d5ec97b798654ab15341124bb49e8705f2..c4abf199e0548fa918e075921d82ad5fc2dbb502 100644 --- a/app/code/Magento/Core/Model/App/Area/DesignExceptions.php +++ b/app/code/Magento/Core/Model/App/Area/DesignExceptions.php @@ -39,14 +39,14 @@ class DesignExceptions /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->scopeConfig = $scopeConfig; } @@ -54,10 +54,10 @@ class DesignExceptions /** * Get theme that should be applied for current user-agent according to design exceptions configuration * - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @return string|bool */ - public function getThemeForUserAgent(\Magento\App\Request\Http $request) + public function getThemeForUserAgent(\Magento\Framework\App\Request\Http $request) { $userAgent = $request->getServer('HTTP_USER_AGENT'); if (empty($userAgent)) { diff --git a/app/code/Magento/Core/Model/App/Emulation.php b/app/code/Magento/Core/Model/App/Emulation.php index aa4ec7c1498641a3b1531b9661860d72081efa66..d637f5f0c8b25f7375020e121ff42902933b3158 100644 --- a/app/code/Magento/Core/Model/App/Emulation.php +++ b/app/code/Magento/Core/Model/App/Emulation.php @@ -50,7 +50,7 @@ class Emulation extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -79,7 +79,7 @@ class Emulation extends \Magento\Object * @param \Magento\View\DesignInterface $viewDesign * @param \Magento\Core\Model\Design $design * @param \Magento\TranslateInterface $translate - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param ConfigInterface $inlineConfig * @param \Magento\Translate\Inline\StateInterface $inlineTranslation * @param \Magento\Locale\ResolverInterface $localeResolver @@ -90,7 +90,7 @@ class Emulation extends \Magento\Object \Magento\View\DesignInterface $viewDesign, \Magento\Core\Model\Design $design, \Magento\TranslateInterface $translate, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, ConfigInterface $inlineConfig, \Magento\Translate\Inline\StateInterface $inlineTranslation, \Magento\Locale\ResolverInterface $localeResolver, diff --git a/app/code/Magento/Core/Model/Asset/Config.php b/app/code/Magento/Core/Model/Asset/Config.php index 6b668bb058718d68ced295bb883c92a7517c28df..5a179a83129d2174b1931c94283f3e6ae29ee8f7 100644 --- a/app/code/Magento/Core/Model/Asset/Config.php +++ b/app/code/Magento/Core/Model/Asset/Config.php @@ -51,14 +51,14 @@ class Config implements \Magento\View\Asset\ConfigInterface const XML_PATH_MINIFICATION_ADAPTER = 'dev/%s/minify_adapter'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php b/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php index bf287a499802f4ae847161ad3dd5f973c0e356b5..31b17cff72d9b7bad0efcef809c93424c8198e05 100644 --- a/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php +++ b/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php @@ -31,17 +31,17 @@ class CleanMergedJsCss protected $database; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; /** * @param \Magento\Core\Helper\File\Storage\Database $database - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Core\Helper\File\Storage\Database $database, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->database = $database; $this->filesystem = $filesystem; @@ -61,7 +61,7 @@ class CleanMergedJsCss $proceed(); /** @var \Magento\Filesystem\Directory\ReadInterface $pubCacheDirectory */ - $pubCacheDirectory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR); + $pubCacheDirectory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR); $mergedDir = $pubCacheDirectory->getAbsolutePath() . '/' . \Magento\View\Asset\Merged::PUBLIC_MERGE_DIR; $this->database->deleteFolder($mergedDir); } diff --git a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php index 4ac800a744f3f7e868127347a561d36dfe4278d6..c7eb980038246c3801e3e42c602a109d458358a0 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php +++ b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php @@ -37,7 +37,7 @@ class Exceptions extends \Magento\Backend\Model\Config\Backend\Serialized\ArrayS /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\View\DesignInterface $design * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -46,7 +46,7 @@ class Exceptions extends \Magento\Backend\Model\Config\Backend\Serialized\ArrayS public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\View\DesignInterface $design, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/Design/Backend/Theme.php b/app/code/Magento/Core/Model/Design/Backend/Theme.php index 50a31701b3b5053ba825ce96ed09375a6ee1b0f0..b277c9b337d5107b9070b1937b5fa4c738ac5132 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Theme.php +++ b/app/code/Magento/Core/Model/Design/Backend/Theme.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\Model\Design\Backend; -class Theme extends \Magento\App\Config\Value +class Theme extends \Magento\Framework\App\Config\Value { /** * Design package instance @@ -37,7 +37,7 @@ class Theme extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\View\DesignInterface $design * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -46,7 +46,7 @@ class Theme extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\View\DesignInterface $design, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/File/Storage.php b/app/code/Magento/Core/Model/File/Storage.php index 27fdb9f1b910568bb523cb770fd5eff9a4e787dd..ff22bec77c7ce66ff65de3b07300ccb5f57a8692 100644 --- a/app/code/Magento/Core/Model/File/Storage.php +++ b/app/code/Magento/Core/Model/File/Storage.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\Model\File; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Model\AbstractModel; /** @@ -68,12 +68,12 @@ class Storage extends AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -99,7 +99,7 @@ class Storage extends AbstractModel /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -107,12 +107,12 @@ class Storage extends AbstractModel * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage $coreFileStorage - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Core\Model\File\Storage\Flag $fileFlag * @param \Magento\Core\Model\File\Storage\FileFactory $fileFactory * @param \Magento\Core\Model\File\Storage\DatabaseFactory $databaseFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -121,12 +121,12 @@ class Storage extends AbstractModel \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Core\Helper\File\Storage $coreFileStorage, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Core\Model\File\Storage\Flag $fileFlag, \Magento\Core\Model\File\Storage\FileFactory $fileFactory, \Magento\Core\Model\File\Storage\DatabaseFactory $databaseFactory, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Core/Model/File/Storage/Config.php b/app/code/Magento/Core/Model/File/Storage/Config.php index d2ef9b195c98ebdc7eb43e9eb22899f4f6d3e7f0..ed6101caa4eca8f9c03a09c6621f2d9be7160081 100644 --- a/app/code/Magento/Core/Model/File/Storage/Config.php +++ b/app/code/Magento/Core/Model/File/Storage/Config.php @@ -52,16 +52,16 @@ class Config /** * @param \Magento\Core\Model\File\Storage $storage - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $cacheFile */ public function __construct( \Magento\Core\Model\File\Storage $storage, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $cacheFile ) { $this->config = $storage->getScriptConfig(); - $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_DIR); + $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_DIR); $this->cacheFilePath = $cacheFile; } diff --git a/app/code/Magento/Core/Model/File/Storage/Database.php b/app/code/Magento/Core/Model/File/Storage/Database.php index e37b5befd4cf2af33d1780080a323ca80b7d63b9..64a704cea9f101042bcd8ad33d3207366bc80bf2 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Database.php @@ -66,7 +66,7 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Stdlib\DateTime\DateTime $dateModel - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Core\Helper\File\Media $mediaHelper * @param \Magento\Core\Model\Resource\File\Storage\Database $resource * @param Directory\DatabaseFactory $directoryFactory @@ -79,7 +79,7 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Stdlib\DateTime\DateTime $dateModel, - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Core\Helper\File\Media $mediaHelper, \Magento\Core\Model\Resource\File\Storage\Database $resource, \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory, diff --git a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php index ff21e4aeffcb8904d69afde41a914e9797c6c77d..2e1485ab36356bf79dcd917aa440b415f7ef377b 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php @@ -52,7 +52,7 @@ abstract class AbstractDatabase extends \Magento\Model\AbstractModel protected $_date; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_configuration; @@ -61,7 +61,7 @@ abstract class AbstractDatabase extends \Magento\Model\AbstractModel * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Stdlib\DateTime\DateTime $dateModel - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string|null $connectionName @@ -72,7 +72,7 @@ abstract class AbstractDatabase extends \Magento\Model\AbstractModel \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Stdlib\DateTime\DateTime $dateModel, - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $connectionName = null, diff --git a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php index 6fe64d67f3a8fd212932b3347c49b6c40db0767f..ddb45464ce27191be11e321d75431bed4b2f15b9 100644 --- a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php @@ -54,7 +54,7 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas * @param \Magento\Registry $registry * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Stdlib\DateTime\DateTime $dateModel - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param DatabaseFactory $directoryFactory * @param \Magento\Core\Model\Resource\File\Storage\Directory\Database $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -66,7 +66,7 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas \Magento\Registry $registry, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Stdlib\DateTime\DateTime $dateModel, - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory, \Magento\Core\Model\Resource\File\Storage\Directory\Database $resource, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Core/Model/File/Storage/Response.php b/app/code/Magento/Core/Model/File/Storage/Response.php index b00836645208cf7605ccc60cd96e17ba3c64e6d4..a31c380b8a949b384833c461d46f81f5d6000580 100644 --- a/app/code/Magento/Core/Model/File/Storage/Response.php +++ b/app/code/Magento/Core/Model/File/Storage/Response.php @@ -23,7 +23,7 @@ */ namespace Magento\Core\Model\File\Storage; -use Magento\App\Response\Http; +use Magento\Framework\App\Response\Http; class Response extends Http { @@ -43,12 +43,12 @@ class Response extends Http * Constructor * * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Http\Context $context + * @param \Magento\Framework\App\Http\Context $context * @param \Magento\File\Transfer\Adapter\Http $transferAdapter */ public function __construct( \Magento\Stdlib\Cookie $cookie, - \Magento\App\Http\Context $context, + \Magento\Framework\App\Http\Context $context, \Magento\File\Transfer\Adapter\Http $transferAdapter ) { parent::__construct($cookie, $context); diff --git a/app/code/Magento/Core/Model/File/Storage/Synchronization.php b/app/code/Magento/Core/Model/File/Storage/Synchronization.php index 825d8d535a2a288bf80938285a7024c77ff17450..f8a91840364b759df60fffcf2e75865149a899be 100644 --- a/app/code/Magento/Core/Model/File/Storage/Synchronization.php +++ b/app/code/Magento/Core/Model/File/Storage/Synchronization.php @@ -48,14 +48,14 @@ class Synchronization /** * @param \Magento\Core\Model\File\Storage\DatabaseFactory $storageFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Core\Model\File\Storage\DatabaseFactory $storageFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->storageFactory = $storageFactory; - $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_DIR); + $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_DIR); } /** diff --git a/app/code/Magento/Core/Model/File/Validator/NotProtectedExtension.php b/app/code/Magento/Core/Model/File/Validator/NotProtectedExtension.php index d0a21713705291af15c4524a894c96485de415ff..296874d497039f480f680a6ab5e10c8d0aa756a1 100644 --- a/app/code/Magento/Core/Model/File/Validator/NotProtectedExtension.php +++ b/app/code/Magento/Core/Model/File/Validator/NotProtectedExtension.php @@ -57,16 +57,16 @@ class NotProtectedExtension extends \Zend_Validate_Abstract /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * Init validator * - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; $this->_initMessageTemplates(); diff --git a/app/code/Magento/Core/Model/Layout/DepersonalizePlugin.php b/app/code/Magento/Core/Model/Layout/DepersonalizePlugin.php index 1f4285748d43773000123cf5027b7cfeae595fc1..412f8340844339b95d03ed4da490f3c97da029ee 100644 --- a/app/code/Magento/Core/Model/Layout/DepersonalizePlugin.php +++ b/app/code/Magento/Core/Model/Layout/DepersonalizePlugin.php @@ -32,7 +32,7 @@ namespace Magento\Core\Model\Layout; class DepersonalizePlugin { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -57,14 +57,14 @@ class DepersonalizePlugin protected $messageSession; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Module\Manager $moduleManager * @param \Magento\Event\Manager $eventManager * @param \Magento\PageCache\Model\Config $cacheConfig * @param \Magento\Message\Session $messageSession */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Module\Manager $moduleManager, \Magento\Event\Manager $eventManager, \Magento\PageCache\Model\Config $cacheConfig, diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index eadca388746b8c86c6931781181adbb61dd80743..6d0bb2d078de386ed5f45e3a1d580b900b9df1ff 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -110,7 +110,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface private $_resource; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ private $_appState; @@ -130,7 +130,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface protected $_logger; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -141,11 +141,11 @@ class Merge implements \Magento\View\Layout\ProcessorInterface * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\View\Layout\File\SourceInterface $fileSource * @param \Magento\Core\Model\Resource\Layout\Update $resource - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Cache\FrontendInterface $cache * @param \Magento\Core\Model\Layout\Update\Validator $validator * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Design\ThemeInterface $theme Non-injectable theme instance */ public function __construct( @@ -153,11 +153,11 @@ class Merge implements \Magento\View\Layout\ProcessorInterface \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\View\Layout\File\SourceInterface $fileSource, \Magento\Core\Model\Resource\Layout\Update $resource, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Cache\FrontendInterface $cache, \Magento\Core\Model\Layout\Update\Validator $validator, \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Design\ThemeInterface $theme = null ) { $this->_theme = $theme ?: $design->getDesignTheme(); @@ -386,7 +386,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface $layout = $this->asString(); $layoutStr = '<handle id="handle">' . $layout . '</handle>'; - if ($this->_appState->getMode() === \Magento\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { if (!$this->_layoutValidator->isValid( $layoutStr, \Magento\Core\Model\Layout\Update\Validator::LAYOUT_SCHEMA_MERGED, @@ -613,7 +613,7 @@ class Merge implements \Magento\View\Layout\ProcessorInterface $layoutStr = ''; $theme = $this->_getPhysicalTheme($this->_theme); $updateFiles = $this->_fileSource->getFiles($theme); - $dir = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $dir = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $useErrors = libxml_use_internal_errors(true); foreach ($updateFiles as $file) { $filename = $dir->getRelativePath($file->getFilename()); diff --git a/app/code/Magento/Core/Model/Observer.php b/app/code/Magento/Core/Model/Observer.php index 2fc56254ad7eb853f21c288c036cbb3d3df1b258..802f4d5404ed3f19253ae2b5f81240e2e3529a04 100644 --- a/app/code/Magento/Core/Model/Observer.php +++ b/app/code/Magento/Core/Model/Observer.php @@ -33,7 +33,7 @@ namespace Magento\Core\Model; class Observer { /** - * @var \Magento\App\Cache\Frontend\Pool + * @var \Magento\Framework\App\Cache\Frontend\Pool */ private $_cacheFrontendPool; @@ -48,7 +48,7 @@ class Observer private $_pageAssets; /** - * @var \Magento\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\App\Config\ReinitableConfigInterface */ protected $_config; @@ -68,19 +68,19 @@ class Observer protected $_logger; /** - * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool * @param \Magento\View\DesignInterface $design * @param \Magento\View\Asset\GroupedCollection $assets - * @param \Magento\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config * @param \Magento\View\Asset\PublicFileFactory $assetFileFactory * @param Theme\Registration $registration * @param \Magento\Logger $logger */ public function __construct( - \Magento\App\Cache\Frontend\Pool $cacheFrontendPool, + \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool, \Magento\View\DesignInterface $design, \Magento\View\Asset\GroupedCollection $assets, - \Magento\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\View\Asset\PublicFileFactory $assetFileFactory, \Magento\Core\Model\Theme\Registration $registration, \Magento\Logger $logger diff --git a/app/code/Magento/Core/Model/Resource/Config.php b/app/code/Magento/Core/Model/Resource/Config.php index 20288967ad029d42651d6c610ac22dc986d6c58b..a8c78185e0df8ff93f58f1666fffa8d3f69702fb 100644 --- a/app/code/Magento/Core/Model/Resource/Config.php +++ b/app/code/Magento/Core/Model/Resource/Config.php @@ -32,7 +32,7 @@ namespace Magento\Core\Model\Resource; * @package Magento_Core * @author Magento Core Team <core@magentocommerce.com> */ -class Config extends \Magento\Model\Resource\Db\AbstractDb implements \Magento\App\Config\Resource\ConfigInterface +class Config extends \Magento\Model\Resource\Db\AbstractDb implements \Magento\Framework\App\Config\Resource\ConfigInterface { /** * Define main table diff --git a/app/code/Magento/Core/Model/Resource/Config/Data/Collection.php b/app/code/Magento/Core/Model/Resource/Config/Data/Collection.php index 33e55895a84c65d8de99226c6f0aa0a4cd727223..896f5d1fd5fa0fa1a4077b0b73f88973cadf8942 100644 --- a/app/code/Magento/Core/Model/Resource/Config/Data/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Config/Data/Collection.php @@ -41,7 +41,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio */ protected function _construct() { - $this->_init('Magento\App\Config\Value', 'Magento\Core\Model\Resource\Config\Data'); + $this->_init('Magento\Framework\App\Config\Value', 'Magento\Core\Model\Resource\Config\Data'); } /** diff --git a/app/code/Magento/Core/Model/Resource/Design.php b/app/code/Magento/Core/Model/Resource/Design.php index d9743f6d3d10e986520f25323ca04829467bb101..a1b0b2e233783a5ed99cc067a0ece950c1344a8c 100644 --- a/app/code/Magento/Core/Model/Resource/Design.php +++ b/app/code/Magento/Core/Model/Resource/Design.php @@ -42,10 +42,10 @@ class Design extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php index 0093393f18510541e28a394b1a8b0e6a492ab263..fd9c4daf65bbcaa1ad029c2f6ef29ef5deceaba5 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php @@ -36,10 +36,10 @@ class Database extends \Magento\Core\Model\Resource\File\Storage\AbstractStorage protected $_resourceHelper; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\DB\Helper $resourceHelper */ - public function __construct(\Magento\App\Resource $resource, \Magento\DB\Helper $resourceHelper) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\DB\Helper $resourceHelper) { parent::__construct($resource); $this->_resourceHelper = $resourceHelper; diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/File.php b/app/code/Magento/Core/Model/Resource/File/Storage/File.php index f697778093631c6f1168fec7ab610b2ca5b2f46e..8594958d16f25f07d9b9ce4561d0046688213a85 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/File.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/File.php @@ -31,7 +31,7 @@ namespace Magento\Core\Model\Resource\File\Storage; class File { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -41,10 +41,10 @@ class File protected $_logger; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Logger $log */ - public function __construct(\Magento\App\Filesystem $filesystem, \Magento\Logger $log) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, \Magento\Logger $log) { $this->_logger = $log; $this->_filesystem = $filesystem; @@ -60,7 +60,7 @@ class File { $files = array(); $directories = array(); - $directoryInstance = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + $directoryInstance = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); if ($directoryInstance->isDirectory($dir)) { foreach ($directoryInstance->readRecursively($dir) as $path) { $itemName = basename($path); @@ -89,7 +89,7 @@ class File */ public function clear($dir = '') { - $directoryInstance = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $directoryInstance = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); if ($directoryInstance->isDirectory($dir)) { foreach ($directoryInstance->read($dir) as $path) { $directoryInstance->delete($path); @@ -115,11 +115,11 @@ class File $path = strlen($dir['path']) ? $dir['path'] . '/' . $dir['name'] : $dir['name']; try { - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR)->create($path); + $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR)->create($path); } catch (\Exception $e) { $this->_logger->log($e->getMessage()); throw new \Magento\Model\Exception( - __('Unable to create directory: %1', \Magento\App\Filesystem::MEDIA_DIR . '/' . $path) + __('Unable to create directory: %1', \Magento\Framework\App\Filesystem::MEDIA_DIR . '/' . $path) ); } @@ -138,7 +138,7 @@ class File public function saveFile($filePath, $content, $overwrite = false) { try { - $directoryInstance = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $directoryInstance = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); if (!$directoryInstance->isFile($filePath) || $overwrite && $directoryInstance->delete($filePath)) { $directoryInstance->writeFile($filePath, $content); return true; diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update.php b/app/code/Magento/Core/Model/Resource/Layout/Update.php index d739dc53799a06fb75989c6edc7006c869c736ad..096b96211180f03bde7e1f050d43f4bf49e1387e 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update.php @@ -36,10 +36,10 @@ class Update extends \Magento\Model\Resource\Db\AbstractDb private $_cache; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Cache\FrontendInterface $cache */ - public function __construct(\Magento\App\Resource $resource, \Magento\Cache\FrontendInterface $cache) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Cache\FrontendInterface $cache) { parent::__construct($resource); $this->_cache = $cache; diff --git a/app/code/Magento/Core/Model/TemplateEngine/Plugin/DebugHints.php b/app/code/Magento/Core/Model/TemplateEngine/Plugin/DebugHints.php index 8b1655a457734165f0f1412dd960f76b882d2324..d46ce7a15682883018b77b917b639435bee22c76 100644 --- a/app/code/Magento/Core/Model/TemplateEngine/Plugin/DebugHints.php +++ b/app/code/Magento/Core/Model/TemplateEngine/Plugin/DebugHints.php @@ -42,7 +42,7 @@ class DebugHints private $_objectManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ private $_scopeConfig; @@ -53,12 +53,12 @@ class DebugHints /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Helper\Data $coreData */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Helper\Data $coreData ) { $this->_objectManager = $objectManager; diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php index de5099d2c4cfcdcb302eaecd9fd2cad3802f8f76..eca16fbd1f9b770d0d5c60e9aef0b12b651447e5 100644 --- a/app/code/Magento/Core/Model/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Theme/Collection.php @@ -58,7 +58,7 @@ class Collection extends \Magento\Data\Collection implements \Magento\View\Desig public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\Filesystem $filesystem) { parent::__construct($entityFactory); - $this->_directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::THEMES_DIR); + $this->_directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::THEMES_DIR); } /** diff --git a/app/code/Magento/Core/Model/Theme/Customization/Config.php b/app/code/Magento/Core/Model/Theme/Customization/Config.php index b3e5b8b37a37e91157018413d79ffac552f5dd7b..7dc79904e7eb7f77fbf8be361dc959f2729c7945 100644 --- a/app/code/Magento/Core/Model/Theme/Customization/Config.php +++ b/app/code/Magento/Core/Model/Theme/Customization/Config.php @@ -37,14 +37,14 @@ class Config implements \Magento\View\Design\Theme\Customization\ConfigInterface const XML_PATH_CUSTOM_FILES = 'theme/customization'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $config) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config) { $this->config = $config; } diff --git a/app/code/Magento/Core/Model/Theme/Image/Path.php b/app/code/Magento/Core/Model/Theme/Image/Path.php index eb3eff4c2745bc5a75030972477ab695c4c48cdd..11831cc10655f4add5a6e0090cf6bf549e23187c 100644 --- a/app/code/Magento/Core/Model/Theme/Image/Path.php +++ b/app/code/Magento/Core/Model/Theme/Image/Path.php @@ -37,7 +37,7 @@ class Path implements \Magento\View\Design\Theme\Image\PathInterface /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -54,12 +54,12 @@ class Path implements \Magento\View\Design\Theme\Image\PathInterface /** * Initialize dependencies * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Url $viewUrl * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Url $viewUrl, \Magento\Store\Model\StoreManagerInterface $storeManager ) { @@ -97,7 +97,8 @@ class Path implements \Magento\View\Design\Theme\Image\PathInterface */ public function getImagePreviewDirectory() { - return $this->filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR) . '/' . self::PREVIEW_DIRECTORY_PATH; + return $this->filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR) + . '/' . self::PREVIEW_DIRECTORY_PATH; } /** @@ -107,6 +108,6 @@ class Path implements \Magento\View\Design\Theme\Image\PathInterface */ public function getTemporaryDirectory() { - return $this->filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR) . '/theme/origin'; + return $this->filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR) . '/theme/origin'; } } diff --git a/app/code/Magento/Core/Model/Theme/Registration.php b/app/code/Magento/Core/Model/Theme/Registration.php index 1694638d5cc760152dee7c89fdec908f6e8bf252..e7db6f31cdbaa0d0461c2e97c001bd4705a54333 100644 --- a/app/code/Magento/Core/Model/Theme/Registration.php +++ b/app/code/Magento/Core/Model/Theme/Registration.php @@ -25,7 +25,7 @@ */ namespace Magento\Core\Model\Theme; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Model\Exception; use Magento\View\Design\ThemeInterface; diff --git a/app/code/Magento/Core/Model/Theme/Resolver.php b/app/code/Magento/Core/Model/Theme/Resolver.php index 446e4b48ac91f046e56ab07c13ad0aeecfbd48a6..c70935e66dab3c9bf73a24189556243616143493 100644 --- a/app/code/Magento/Core/Model/Theme/Resolver.php +++ b/app/code/Magento/Core/Model/Theme/Resolver.php @@ -39,17 +39,17 @@ class Resolver implements \Magento\View\Design\Theme\ResolverInterface protected $themeFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; /** - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themeFactory */ public function __construct( - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\View\DesignInterface $design, \Magento\Core\Model\Resource\Theme\CollectionFactory $themeFactory ) { diff --git a/app/code/Magento/Core/Model/Url/RouteParamsResolver.php b/app/code/Magento/Core/Model/Url/RouteParamsResolver.php index 2db8bd4ed6b28920a42884737da261d8d6e64f41..20b70e1f415058e7d30a09d3e952f265ac2e038d 100644 --- a/app/code/Magento/Core/Model/Url/RouteParamsResolver.php +++ b/app/code/Magento/Core/Model/Url/RouteParamsResolver.php @@ -26,12 +26,12 @@ namespace Magento\Core\Model\Url; class RouteParamsResolver extends \Magento\Object implements \Magento\Url\RouteParamsResolverInterface { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -46,15 +46,15 @@ class RouteParamsResolver extends \Magento\Object implements \Magento\Url\RouteP protected $_queryParamsResolver; /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Url\QueryParamsResolverInterface $queryParamsResolver * @param array $data */ public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Url\QueryParamsResolverInterface $queryParamsResolver, array $data = array() @@ -125,13 +125,14 @@ class RouteParamsResolver extends \Magento\Object implements \Magento\Url\RouteP } if (isset($data['_scope_to_url']) && (bool)$data['_scope_to_url'] === true) { + $store = $this->getScope() ? : $this->_storeManager->getStore(); if (!$this->_scopeConfig->getValue( \Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $this->getScope() ) && !$this->_storeManager->hasSingleStore() ) { - $this->_queryParamsResolver->setQueryParam('___store', $this->getScope()->getCode()); + $this->_queryParamsResolver->setQueryParam('___store', $store->getCode()); } } unset($data['_scope_to_url']); diff --git a/app/code/Magento/Core/Model/Url/SecurityInfo.php b/app/code/Magento/Core/Model/Url/SecurityInfo.php index 5f179368c313f92a00f11e5c68f6d78d870312c7..6a28a74fa4bc6adc167ecb3abfe4be6b73b6cc80 100644 --- a/app/code/Magento/Core/Model/Url/SecurityInfo.php +++ b/app/code/Magento/Core/Model/Url/SecurityInfo.php @@ -28,7 +28,7 @@ namespace Magento\Core\Model\Url; class SecurityInfo implements \Magento\Url\SecurityInfoInterface { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -47,11 +47,13 @@ class SecurityInfo implements \Magento\Url\SecurityInfoInterface protected $_secureUrlCache = array(); /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $secureUrlList */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig, array $secureUrlList = array()) - { + public function __construct( + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + array $secureUrlList = array() + ) { $this->_scopeConfig = $scopeConfig; $this->_secureUrlList = $secureUrlList; } diff --git a/app/code/Magento/Core/Model/View/Design.php b/app/code/Magento/Core/Model/View/Design.php index ee35b8b9c7e3ad6d4484c77f9215f409e6616aa9..7629be62e3f621c9ae2d86551ef0e6357410d030 100644 --- a/app/code/Magento/Core/Model/View/Design.php +++ b/app/code/Magento/Core/Model/View/Design.php @@ -71,7 +71,7 @@ class Design implements \Magento\View\DesignInterface protected $_themeFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ private $_scopeConfig; @@ -81,26 +81,26 @@ class Design implements \Magento\View\DesignInterface protected $_locale; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\View\Design\Theme\FlyweightFactory $flyweightFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Model\ThemeFactory $themeFactory * @param \Magento\Locale\ResolverInterface $locale - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param array $themes */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\View\Design\Theme\FlyweightFactory $flyweightFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Model\ThemeFactory $themeFactory, \Magento\Locale\ResolverInterface $locale, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, array $themes ) { $this->_storeManager = $storeManager; @@ -181,7 +181,7 @@ class Design implements \Magento\View\DesignInterface if ($this->_isThemePerStoveView($area)) { $theme = $this->_storeManager->isSingleStoreMode() ? $this->_scopeConfig->getValue( self::XML_PATH_THEME_ID, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ) : (string)$this->_scopeConfig->getValue( self::XML_PATH_THEME_ID, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, diff --git a/app/code/Magento/Core/Model/View/Url/Config.php b/app/code/Magento/Core/Model/View/Url/Config.php index c0e6bcc622851d9bdb46853efa2bf8faf2713f0c..d5c0261fed66c8850f20dc3a6ca7e19ed519b71b 100644 --- a/app/code/Magento/Core/Model/View/Url/Config.php +++ b/app/code/Magento/Core/Model/View/Url/Config.php @@ -28,16 +28,16 @@ namespace Magento\Core\Model\View\Url; class Config implements \Magento\View\Url\ConfigInterface { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * View url config model * - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Core/etc/cache.xml b/app/code/Magento/Core/etc/cache.xml index 33231b882fb842bf951874464e57051f108a7f03..d1dba4dc0622f304ff3fca99c6876bf572df32d7 100644 --- a/app/code/Magento/Core/etc/cache.xml +++ b/app/code/Magento/Core/etc/cache.xml @@ -24,19 +24,19 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Cache/etc/cache.xsd"> - <type name="config" translate="label,description" instance="Magento\App\Cache\Type\Config"> + <type name="config" translate="label,description" instance="Magento\Framework\App\Cache\Type\Config"> <label>Configuration</label> <description>System(config.xml, local.xml) and modules configuration files(config.xml).</description> </type> - <type name="layout" translate="label,description" instance="Magento\App\Cache\Type\Layout"> + <type name="layout" translate="label,description" instance="Magento\Framework\App\Cache\Type\Layout"> <label>Layouts</label> <description>Layout building instructions.</description> </type> - <type name="block_html" translate="label,description" instance="Magento\App\Cache\Type\Block"> + <type name="block_html" translate="label,description" instance="Magento\Framework\App\Cache\Type\Block"> <label>Blocks HTML output</label> <description>Page blocks HTML.</description> </type> - <type name="collections" translate="label,description" instance="Magento\App\Cache\Type\Collection"> + <type name="collections" translate="label,description" instance="Magento\Framework\App\Cache\Type\Collection"> <label>Collections Data</label> <description>Collection data files.</description> </type> diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index c72d6272ad9d872ff372c037d82323647cffd474..d55e7309a4cfb8693b22e512205a6ed82682c47b 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -25,7 +25,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Acl\CacheInterface" type="Magento\Acl\Cache" /> - <preference for="Magento\App\AreaInterface" type="Magento\Core\Model\App\Area" /> + <preference for="Magento\Framework\App\AreaInterface" type="Magento\Core\Model\App\Area" /> <preference for="Magento\Module\Updater\SetupInterface" type="Magento\Module\Setup" /> <preference for="Magento\Module\ResourceResolverInterface" type="Magento\Module\ResourceResolver" /> <preference for="Magento\AuthorizationInterface" type="Magento\Authorization" /> @@ -33,14 +33,14 @@ <preference for="Magento\Authorization\RoleLocator" type="Magento\Authorization\RoleLocator\DefaultRoleLocator" /> <preference for="Magento\Session\SessionManagerInterface" type="Magento\Session\Generic" /> <preference for="Magento\Core\Model\DataService\ConfigInterface" type="Magento\Core\Model\DataService\Config" /> - <preference for="Magento\App\Config\ScopeConfigInterface" type="Magento\App\Config" /> - <preference for="Magento\App\Config\ReinitableConfigInterface" type="Magento\App\ReinitableConfig" /> - <preference for="Magento\App\Config\MutableScopeConfigInterface" type="Magento\App\MutableScopeConfig" /> - <preference for="Magento\App\Config\Storage\WriterInterface" type="Magento\App\Config\Storage\Writer" /> + <preference for="Magento\Framework\App\Config\ScopeConfigInterface" type="Magento\Framework\App\Config" /> + <preference for="Magento\Framework\App\Config\ReinitableConfigInterface" type="Magento\Framework\App\ReinitableConfig" /> + <preference for="Magento\Framework\App\Config\MutableScopeConfigInterface" type="Magento\Framework\App\MutableScopeConfig" /> + <preference for="Magento\Framework\App\Config\Storage\WriterInterface" type="Magento\Framework\App\Config\Storage\Writer" /> <preference for="Magento\View\Design\Theme\FileInterface" type="Magento\Core\Model\Theme\File" /> <preference for="Magento\Config\ConverterInterface" type="Magento\Config\Converter\Dom"/> <preference for="Magento\Core\Model\Url\SecurityInfoInterface" type="Magento\Core\Model\Url\SecurityInfo\Proxy" /> - <preference for="Magento\App\DefaultPathInterface" type="Magento\App\DefaultPath\DefaultPath" /> + <preference for="Magento\Framework\App\DefaultPathInterface" type="Magento\Framework\App\DefaultPath\DefaultPath" /> <preference for="Magento\Encryption\EncryptorInterface" type="Magento\Encryption\Encryptor" /> <preference for="Magento\Filter\Encrypt\AdapterInterface" type="Magento\Filter\Encrypt\Basic" /> <preference for="Magento\Cache\ConfigInterface" type="Magento\Cache\Config" /> @@ -49,9 +49,9 @@ <preference for="Magento\View\Design\Theme\Customization\ConfigInterface" type="Magento\Core\Model\Theme\Customization\Config" /> <preference for="Magento\View\Asset\ConfigInterface" type="Magento\Core\Model\Asset\Config" /> <preference for="Magento\View\Asset\MergeStrategyInterface" type="Magento\View\Asset\MergeStrategy\Direct" /> - <preference for="Magento\App\ViewInterface" type="Magento\App\View" /> + <preference for="Magento\Framework\App\ViewInterface" type="Magento\Framework\App\View" /> <preference for="Magento\TranslateInterface" type="Magento\Translate" /> - <preference for="Magento\App\Response\RedirectInterface" type="Magento\Store\App\Response\Redirect" /> + <preference for="Magento\Framework\App\Response\RedirectInterface" type="Magento\Store\App\Response\Redirect" /> <preference for="Magento\Data\Collection\EntityFactoryInterface" type="Magento\Core\Model\EntityFactory" /> <preference for="Magento\Translate\InlineInterface" type="Magento\Translate\Inline" /> <preference for="Magento\Translate\Inline\ConfigInterface" type="Magento\Translation\Model\Inline\Config" /> @@ -67,7 +67,6 @@ <preference for="Magento\Mview\ProcessorInterface" type="Magento\Mview\Processor" /> <preference for="Magento\Mview\View\CollectionInterface" type="Magento\Mview\View\Collection" /> <preference for="Magento\Mview\View\SubscriptionInterface" type="Magento\Mview\View\Subscription" /> - <preference for="Magento\Mview\View\ChangelogInterface" type="Magento\Mview\View\Changelog" /> <preference for="Magento\Css\PreProcessor\AdapterInterface" type="Magento\Css\PreProcessor\Adapter\Oyejorge" /> <preference for="Magento\Translate\ResourceInterface" type="Magento\Translation\Model\Resource\Translate" /> <preference for="Magento\LocaleInterface" type="Magento\Locale" /> @@ -79,8 +78,9 @@ <preference for="Magento\Stdlib\DateTime\DateInterface" type="Magento\Stdlib\DateTime\Date" /> <preference for="Magento\Less\PreProcessor\ErrorHandlerInterface" type="Magento\Less\PreProcessor\ErrorHandler" /> <preference for="Magento\Module\ResourceInterface" type="Magento\Install\Model\Resource\Resource" /> - <preference for="Magento\App\Config\Resource\ConfigInterface" type="Magento\Core\Model\Resource\Config" /> - <type name="Magento\App\DefaultPath\DefaultPath"> + <preference for="Magento\Framework\App\Config\Resource\ConfigInterface" type="Magento\Core\Model\Resource\Config" /> + <preference for="Magento\Pricing\Amount\AmountInterface" type="Magento\Pricing\Amount\Base" /> + <type name="Magento\Framework\App\DefaultPath\DefaultPath"> <arguments> <argument name="parts" xsi:type="array"> <item name="module" xsi:type="string">core</item> @@ -89,7 +89,7 @@ </argument> </arguments> </type> - <type name="Magento\App\AreaList"> + <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> <item name="frontend" xsi:type="array"> @@ -103,7 +103,7 @@ <type name="Magento\Data\Structure" shared="false" /> <type name="Magento\Data\Collection\Db\FetchStrategy\Cache"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Collection</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument> <argument name="cacheIdPrefix" xsi:type="string">collection_</argument> <argument name="cacheLifetime" xsi:type="string">86400</argument> </arguments> @@ -118,12 +118,12 @@ <type name="Magento\Core\Model\Layout\Merge"> <arguments> <argument name="fileSource" xsi:type="object">Magento\View\Layout\File\Source\Aggregated</argument> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Layout</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument> </arguments> </type> <type name="Magento\Core\Model\Resource\Layout\Update"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Layout</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument> </arguments> </type> <virtualType name="layoutFileSourceBaseFiltered" type="Magento\View\Layout\File\Source\Decorator\ModuleOutput"> @@ -179,19 +179,19 @@ <argument name="uploader" xsi:type="object">Magento\View\Design\Theme\Image\Uploader\Proxy</argument> </arguments> </type> - <type name="Magento\App\Config\ScopePool"> + <type name="Magento\Framework\App\Config\ScopePool"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> </arguments> </type> - <type name="Magento\App\Config\Initial\SchemaLocator"> + <type name="Magento\Framework\App\Config\Initial\SchemaLocator"> <arguments> <argument name="moduleName" xsi:type="string">Magento_Core</argument> </arguments> </type> - <type name="Magento\App\Config\Initial\Reader"> + <type name="Magento\Framework\App\Config\Initial\Reader"> <arguments> - <argument name="converter" xsi:type="object">Magento\App\Config\Initial\Converter</argument> + <argument name="converter" xsi:type="object">Magento\Framework\App\Config\Initial\Converter</argument> </arguments> </type> <type name="Magento\Core\App\Router\Base"> @@ -199,7 +199,7 @@ <argument name="routerId" xsi:type="string">standard</argument> </arguments> </type> - <type name="Magento\App\Router\NoRouteHandlerList"> + <type name="Magento\Framework\App\Router\NoRouteHandlerList"> <arguments> <argument name="handlerClassesList" xsi:type="array"> <item name="default" xsi:type="array"> @@ -307,10 +307,10 @@ <argument name="saveMethod" xsi:type="init_parameter">Magento\Session\Config::PARAM_SESSION_SAVE_METHOD</argument> </arguments> </type> - <type name="Magento\App\Helper\Context"> + <type name="Magento\Framework\App\Helper\Context"> <arguments> <argument name="urlBuilder" xsi:type="object">Magento\UrlInterface\Proxy</argument> - <argument name="httpRequest" xsi:type="object">Magento\App\Request\Http\Proxy</argument> + <argument name="httpRequest" xsi:type="object">Magento\Framework\App\Request\Http\Proxy</argument> </arguments> </type> <type name="Magento\Core\Helper\File\Storage"> @@ -361,12 +361,10 @@ <argument name="design" xsi:type="object">Magento\Core\Model\Design\Proxy</argument> </arguments> </type> - <type name="Magento\App\FrontController"> + <type name="Magento\Framework\App\FrontController"> <plugin name="install" type="Magento\Module\FrontController\Plugin\Install" sortOrder="40"/> - <plugin name="clickjacking" type="Magento\App\FrontController\Plugin\Clickjacking" sortOrder="0"/> - <plugin name="messageBox" type="Magento\Core\App\FrontController\Plugin\MessageBox" sortOrder="0"/> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck" sortOrder="10"/> <plugin name="designLoader" type="Magento\Core\App\Action\Plugin\Design" sortOrder="30"/> </type> @@ -432,7 +430,7 @@ </argument> </arguments> </type> - <type name="Magento\App\Config\Initial\Converter"> + <type name="Magento\Framework\App\Config\Initial\Converter"> <arguments> <argument name="nodeMap" xsi:type="array"> <item name="default" xsi:type="string">/config/default</item> @@ -459,7 +457,7 @@ <argument name="scopeType" xsi:type="const">Magento\Store\Model\ScopeInterface::SCOPE_STORE</argument> </arguments> </type> - <type name="Magento\App\ScopeResolverPool"> + <type name="Magento\Framework\App\ScopeResolverPool"> <arguments> <argument name="scopeResolvers" xsi:type="array"> <item name="store" xsi:type="object">Magento\Store\Model\Resolver\Store</item> @@ -478,7 +476,7 @@ </argument> </arguments> </type> - <type name="Magento\App\PageCache\Identifier"> + <type name="Magento\Framework\App\PageCache\Identifier"> <plugin name="core-app-area-design-exception-plugin" type="Magento\Core\Model\App\Area\CacheIdentifierPlugin" sortOrder="10"/> </type> @@ -505,7 +503,7 @@ <argument name="connectionName" xsi:type="string">Magento\Module\Updater::DEFAULT_SETUP_CONNECTION</argument> </arguments> </type> - <type name="Magento\App\Config\Value"> + <type name="Magento\Framework\App\Config\Value"> <arguments> <argument name="resource" xsi:type="object">Magento\Core\Model\Resource\Config\Data</argument> <argument name="resourceCollection" xsi:type="object">Magento\Core\Model\Resource\Config\Data\Collection\Proxy</argument> diff --git a/app/code/Magento/Core/etc/frontend/di.xml b/app/code/Magento/Core/etc/frontend/di.xml index dabd05bff61667dcb34b82871d3d8998e838e4a7..8eafe6b238c4e356b1e65fe8d648614ac71212c8 100644 --- a/app/code/Magento/Core/etc/frontend/di.xml +++ b/app/code/Magento/Core/etc/frontend/di.xml @@ -33,14 +33,14 @@ <plugin name="core-session-depersonalize" type="Magento\Core\Model\Layout\DepersonalizePlugin" sortOrder="1"/> </type> - <type name="Magento\App\FrontController"> + <type name="Magento\Framework\App\FrontController"> <plugin name="requestPreprocessor" type="Magento\Core\App\FrontController\Plugin\RequestPreprocessor" sortOrder="50"/> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="core-app-action-dispatchController-context-plugin" type="Magento\Core\Model\App\Action\ContextPlugin" sortOrder="10"/> <plugin name="lastUrl" type="Magento\Core\App\Action\Plugin\LastUrl" sortOrder="70"/> </type> - <type name="Magento\App\RouterList" shared="true"> + <type name="Magento\Framework\App\RouterList" shared="true"> <arguments> <argument name="routerList" xsi:type="array"> <item name="standard" xsi:type="array"> @@ -49,7 +49,7 @@ <item name="sortOrder" xsi:type="string">20</item> </item> <item name="default" xsi:type="array"> - <item name="class" xsi:type="string">Magento\App\Router\DefaultRouter</item> + <item name="class" xsi:type="string">Magento\Framework\App\Router\DefaultRouter</item> <item name="disable" xsi:type="boolean">false</item> <item name="sortOrder" xsi:type="string">100</item> </item> diff --git a/app/code/Magento/Core/etc/frontend/routes.xml b/app/code/Magento/Core/etc/frontend/routes.xml index 62db82e56ffdca2a66a35c3c6a940935b5304ba2..ada8932c1f2c3ed2c2eb3a93911a726ef9c53e8f 100644 --- a/app/code/Magento/Core/etc/frontend/routes.xml +++ b/app/code/Magento/Core/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="core" frontName="core"> <module name="Magento_Core" /> diff --git a/app/code/Magento/Core/etc/resources.xml b/app/code/Magento/Core/etc/resources.xml index aadb20a90407afae38a85b2fc763af6e76a9a77a..2eeba71dc6c7df0058d8fa54fb742e8a7f2d0cf3 100644 --- a/app/code/Magento/Core/etc/resources.xml +++ b/app/code/Magento/Core/etc/resources.xml @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Framework/App/etc/resources.xsd"> <resource name="core_setup" extends="default_setup" /> </config> diff --git a/app/code/Magento/Cron/App/Cron/Plugin/ApplicationInitializer.php b/app/code/Magento/Cron/App/Cron/Plugin/ApplicationInitializer.php index 5e4b8665cd17591ea730c0d0a2ba24866c83d30f..8a1139413d41ec5fcf7a6a1424b1bfdf8069ecfe 100644 --- a/app/code/Magento/Cron/App/Cron/Plugin/ApplicationInitializer.php +++ b/app/code/Magento/Cron/App/Cron/Plugin/ApplicationInitializer.php @@ -25,7 +25,7 @@ */ namespace Magento\Cron\App\Cron\Plugin; -use \Magento\App\State; +use \Magento\Framework\App\State; class ApplicationInitializer { @@ -52,13 +52,13 @@ class ApplicationInitializer /** * Perform required checks before cron run * - * @param \Magento\App\Cron $subject + * @param \Magento\Framework\App\Cron $subject * * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @throws \Magento\Exception */ - public function beforeLaunch(\Magento\App\Cron $subject) + public function beforeLaunch(\Magento\Framework\App\Cron $subject) { $this->_sidResolver->setUseSessionInUrl(false); if (false == $this->_appState->isInstalled()) { diff --git a/app/code/Magento/Cron/Helper/Data.php b/app/code/Magento/Cron/Helper/Data.php index 36488e9276b89d49592137a38db6a2841a5dd056..a230de4843d072ef122e5eca1daffd115d880d67 100644 --- a/app/code/Magento/Cron/Helper/Data.php +++ b/app/code/Magento/Cron/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Cron\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php index 5bc8a8a6e220dae803ce9fd574ca704921becb40..d24c8317f8890e5c31037d1dfe9bde742a3aa329 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php @@ -33,7 +33,7 @@ */ namespace Magento\Cron\Model\Config\Backend\Product; -class Alert extends \Magento\App\Config\Value +class Alert extends \Magento\Framework\App\Config\Value { /** * Cron string path @@ -46,7 +46,7 @@ class Alert extends \Magento\App\Config\Value const CRON_MODEL_PATH = 'crontab/default/jobs/catalog_product_alert/run/model'; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; @@ -58,8 +58,8 @@ class Alert extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath @@ -68,8 +68,8 @@ class Alert extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', diff --git a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php index 8b641ccb7eca7945399fed3905150846e6581bc4..cb02189397fa401e4bbd9732cef693421357e5cc 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php @@ -33,7 +33,7 @@ */ namespace Magento\Cron\Model\Config\Backend; -class Sitemap extends \Magento\App\Config\Value +class Sitemap extends \Magento\Framework\App\Config\Value { /** * Cron string path @@ -46,7 +46,7 @@ class Sitemap extends \Magento\App\Config\Value const CRON_MODEL_PATH = 'crontab/default/jobs/sitemap_generate/run/model'; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; @@ -58,8 +58,8 @@ class Sitemap extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath @@ -68,8 +68,8 @@ class Sitemap extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', diff --git a/app/code/Magento/Cron/Model/Config/Reader/Db.php b/app/code/Magento/Cron/Model/Config/Reader/Db.php index 6efdd0dcba608e4dec56872c1c0e0a0bb3875b17..2d5fd8ba722a0576da4af75b33fe74d65a5e76f5 100644 --- a/app/code/Magento/Cron/Model/Config/Reader/Db.php +++ b/app/code/Magento/Cron/Model/Config/Reader/Db.php @@ -38,18 +38,18 @@ class Db protected $_converter; /** - * @var \Magento\App\Config\Scope\ReaderInterface + * @var \Magento\Framework\App\Config\Scope\ReaderInterface */ protected $_reader; /** * Initialize parameters * - * @param \Magento\App\Config\Scope\ReaderInterface $defaultReader + * @param \Magento\Framework\App\Config\Scope\ReaderInterface $defaultReader * @param \Magento\Cron\Model\Config\Converter\Db $converter */ public function __construct( - \Magento\App\Config\Scope\ReaderInterface $defaultReader, + \Magento\Framework\App\Config\Scope\ReaderInterface $defaultReader, \Magento\Cron\Model\Config\Converter\Db $converter ) { $this->_reader = $defaultReader; diff --git a/app/code/Magento/Cron/Model/Observer.php b/app/code/Magento/Cron/Model/Observer.php index d6cee7b45cc17662dee4f3f1dec748f505b19776..1375c1f4484fece2c23cdf0f5b5ab04de06c39e6 100644 --- a/app/code/Magento/Cron/Model/Observer.php +++ b/app/code/Magento/Cron/Model/Observer.php @@ -73,17 +73,17 @@ class Observer protected $_config; /** - * @var \Magento\App\ObjectManager + * @var \Magento\Framework\App\ObjectManager */ protected $_objectManager; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -93,7 +93,7 @@ class Observer protected $_scheduleFactory; /** - * @var \Magento\App\Console\Request + * @var \Magento\Framework\App\Console\Request */ protected $_request; @@ -105,19 +105,19 @@ class Observer /** * @param \Magento\ObjectManager $objectManager * @param ScheduleFactory $scheduleFactory - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param ConfigInterface $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Console\Request $request + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Console\Request $request * @param \Magento\ShellInterface $shell */ public function __construct( \Magento\ObjectManager $objectManager, \Magento\Cron\Model\ScheduleFactory $scheduleFactory, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Cron\Model\ConfigInterface $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Console\Request $request, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Console\Request $request, \Magento\ShellInterface $shell ) { $this->_objectManager = $objectManager; @@ -155,7 +155,7 @@ class Observer '%s -f %s -- --group=%s', array( PHP_BINARY, - BP . DIRECTORY_SEPARATOR . \Magento\App\Filesystem::PUB_DIR . DIRECTORY_SEPARATOR . 'cron.php', + BP . '/' . \Magento\Framework\App\Filesystem::PUB_DIR . '/cron.php', $groupId ) ); diff --git a/app/code/Magento/Cron/Model/System/Config/Initial/Converter.php b/app/code/Magento/Cron/Model/System/Config/Initial/Converter.php index 0498c0364961ec5b2ccbc26a23389e5ff07c35f6..6539ed419eb07a6f3a45181c94c38bd64fa09b14 100644 --- a/app/code/Magento/Cron/Model/System/Config/Initial/Converter.php +++ b/app/code/Magento/Cron/Model/System/Config/Initial/Converter.php @@ -43,13 +43,13 @@ class Converter /** * Modify global configuration for cron * - * @param \Magento\App\Config\Initial\Converter $subject + * @param \Magento\Framework\App\Config\Initial\Converter $subject * @param array $result * * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterConvert(\Magento\App\Config\Initial\Converter $subject, array $result) + public function afterConvert(\Magento\Framework\App\Config\Initial\Converter $subject, array $result) { if (isset($result['data']['default']['system'])) { $result['data']['default']['system']['cron'] = $this->groupsConfig->get(); diff --git a/app/code/Magento/Cron/etc/di.xml b/app/code/Magento/Cron/etc/di.xml index e0ec113086763d814bca36392e4a68503d82813b..0f96a840ae5b3ada0f8e5fe917d606aa8efbf200 100644 --- a/app/code/Magento/Cron/etc/di.xml +++ b/app/code/Magento/Cron/etc/di.xml @@ -31,13 +31,13 @@ <argument name="defaultReader" xsi:type="object">Magento\Store\Model\Config\Reader\DefaultReader</argument> </arguments> </type> - <type name="Magento\App\Cron"> + <type name="Magento\Framework\App\Cron"> <plugin name="application_initializer" type="Magento\Cron\App\Cron\Plugin\ApplicationInitializer" sortOrder="10"/> </type> <type name="Magento\Backend\Model\Config\Structure\Converter"> <plugin name="cron_backend_config_structure_converter_plugin" type="Magento\Cron\Model\Backend\Config\Structure\Converter" /> </type> - <type name="Magento\App\Config\Initial\Converter"> + <type name="Magento\Framework\App\Config\Initial\Converter"> <plugin name="cron_system_config_initial_converter_plugin" type="Magento\Cron\Model\System\Config\Initial\Converter" /> </type> <virtualType name="shellBackground" type="Magento\Shell"> diff --git a/app/code/Magento/CurrencySymbol/Helper/Data.php b/app/code/Magento/CurrencySymbol/Helper/Data.php index 40c34526d56d9afdf12b462c7d1215c75be1c0c2..73bfa272b8d780e5a3681adbbdbaea84b6b111e3 100644 --- a/app/code/Magento/CurrencySymbol/Helper/Data.php +++ b/app/code/Magento/CurrencySymbol/Helper/Data.php @@ -41,23 +41,32 @@ class Data extends \Magento\Core\Helper\Data protected $_symbolFactory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory, $dbCompatibleMode = true ) { $this->_symbolFactory = $symbolFactory; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** diff --git a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php index dea344335dd69bef0e76e3c0fced1a0946e738ed..bee5a82fda2839c687d0f83a24798a6beaaba565 100644 --- a/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php @@ -62,9 +62,9 @@ class Currencysymbol * @var array */ protected $_cacheTypes = array( - \Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER, - \Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, \Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER ); @@ -93,7 +93,7 @@ class Currencysymbol protected $_eventManager; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -118,32 +118,32 @@ class Currencysymbol protected $_locale; /** - * @var \Magento\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\App\Config\ReinitableConfigInterface */ protected $_coreConfig; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ReinitableConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ReinitableConfigInterface $coreConfig * @param \Magento\Backend\Model\Config\Factory $configFactory - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Store\Model\System\Store $systemStore * @param \Magento\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ReinitableConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ReinitableConfigInterface $coreConfig, \Magento\Backend\Model\Config\Factory $configFactory, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Locale\ResolverInterface $localeResolver, \Magento\Store\Model\System\Store $systemStore, diff --git a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml index 66fb686d0051edf1903f604b3cc04b4d277fac93..c0f3cd88fd37d5b1ea93debda476279113c5e61c 100644 --- a/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml +++ b/app/code/Magento/CurrencySymbol/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_CurrencySymbol" /> diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/matrix.phtml b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/matrix.phtml index 817b454746466f1dbc4d5dffeab755ef200091bc..e7d7805b0b9688104353fef06f512f1a3ab7cb7f 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/matrix.phtml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/matrix.phtml @@ -37,40 +37,42 @@ $_rates = ( $_newRates ) ? $_newRates : $_oldRates; <form name="rateForm" id="rate-form" method="post" action="<?php echo $this->getRatesFormAction(); ?>"> <?php echo $this->getBlockHtml('formkey')?> <div class="grid"> - <table cellspacing="0"> - <thead> - <tr class="headings"> - <th class="a-right"> </th> - <?php $_i = 0; foreach( $this->getAllowedCurrencies() as $_currencyCode ): ?> - <th class="<?php echo (( ++$_i == (sizeof($this->getAllowedCurrencies())) ) ? 'last' : '' ) ?> a-right"><span><?php echo $_currencyCode ?></span></th> - <?php endforeach; ?> - </tr> - </thead> - <?php $_j = 0; foreach( $this->getDefaultCurrencies() as $_currencyCode ): ?> - <tr> - <?php if( isset($_rates[$_currencyCode]) && is_array($_rates[$_currencyCode])): ?> - <?php foreach( $_rates[$_currencyCode] as $_rate => $_value ): ?> - <?php if( ++$_j == 1 ): ?> - <td class="a-right"><strong><?php echo $_currencyCode ?></strong></td> - <td class="a-right"> - <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> - <?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> - <br /><span class="old-rate"><?php echo __('Old rate:') ?> <?php echo $_oldRates[$_currencyCode][$_rate] ?></span> - <?php endif; ?> - </td> - <?php else: ?> - <td class="a-right"> - <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> - <?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> - <br /><span class="old-rate"><?php echo __('Old rate:') ?> <?php echo $_oldRates[$_currencyCode][$_rate] ?></span> + <div class="hor-scroll"> + <table cellspacing="0"> + <thead> + <tr class="headings"> + <th> </th> + <?php $_i = 0; foreach( $this->getAllowedCurrencies() as $_currencyCode ): ?> + <th class="<?php echo (( ++$_i == (sizeof($this->getAllowedCurrencies())) ) ? 'last' : '' ) ?> a-right"><span><?php echo $_currencyCode ?></span></th> + <?php endforeach; ?> + </tr> + </thead> + <?php $_j = 0; foreach( $this->getDefaultCurrencies() as $_currencyCode ): ?> + <tr> + <?php if( isset($_rates[$_currencyCode]) && is_array($_rates[$_currencyCode])): ?> + <?php foreach( $_rates[$_currencyCode] as $_rate => $_value ): ?> + <?php if( ++$_j == 1 ): ?> + <td class="col-base-currency"><?php echo $_currencyCode ?></td> + <td class="col-currency-edit-rate"> + <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> + <?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> + <span class="old-rate"><?php echo __('Old rate:') ?> <b><?php echo $_oldRates[$_currencyCode][$_rate] ?></b></span> + <?php endif; ?> + </td> + <?php else: ?> + <td class="col-currency-edit-rate"> + <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> + <?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> + <span class="old-rate"><?php echo __('Old rate:') ?> <b><?php echo $_oldRates[$_currencyCode][$_rate] ?></b></span> + <?php endif; ?> + </td> <?php endif; ?> - </td> + <?php endforeach; $_j = 0; ?> <?php endif; ?> - <?php endforeach; $_j = 0; ?> - <?php endif; ?> - </tr> - <?php endforeach; ?> - </table> + </tr> + <?php endforeach; ?> + </table> + </div> </div> </form> <script type="text/javascript"> diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/services.phtml b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/services.phtml index 73685c578c3be0bf32c9ce23b8954b876754d837..00d1be8d1e0c1d34eb7297d54052067e6c65ea30 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/services.phtml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rate/services.phtml @@ -29,5 +29,5 @@ * @var $this \Magento\CurrencySymbol\Block\Adminhtml\System\Currency\Rate\Services */ ?> -<strong><?php echo __('Import Service') ?></strong> +<label class="label"><?php echo __('Import Service') ?></label> <?php echo $this->getChildHtml('import_services') ?> diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rates.phtml b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rates.phtml index e4cff008dd185acc3758041eb5cb9818b90032f3..6e45f708e7d6e3a7f60b56043dfc3beeaac8ab00 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rates.phtml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/system/currency/rates.phtml @@ -29,11 +29,13 @@ * @var $this \Magento\CurrencySymbol\Block\Adminhtml\System\Currency */ ?> -<div class="page-actions clearfix"> +<div class="grid-actions"> <form action="<?php echo $this->getImportFormAction() ?>" method="post" class="import-service"> <?php echo $this->getBlockHtml('formkey')?> - <?php echo $this->getServicesHtml() ?> - <?php echo $this->getImportButtonHtml() ?> + <dix class="import"> + <?php echo $this->getServicesHtml() ?> + <?php echo $this->getImportButtonHtml() ?> + </dix> </form> <?php echo $this->getResetButtonHtml() ?> <?php echo $this->getSaveButtonHtml() ?> diff --git a/app/code/Magento/Customer/Block/Account/AuthorizationLink.php b/app/code/Magento/Customer/Block/Account/AuthorizationLink.php index 0bebef5e1ae5ab35f20585b0b3c9b0df14204d3a..ffcf17b0279ef54e1e05d865c487326f202a133b 100644 --- a/app/code/Magento/Customer/Block/Account/AuthorizationLink.php +++ b/app/code/Magento/Customer/Block/Account/AuthorizationLink.php @@ -31,7 +31,7 @@ class AuthorizationLink extends \Magento\View\Element\Html\Link /** * Customer session * - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -47,14 +47,14 @@ class AuthorizationLink extends \Magento\View\Element\Html\Link /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Customer\Helper\Data $customerHelper * @param \Magento\Core\Helper\PostData $postDataHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Helper\Data $customerHelper, \Magento\Core\Helper\PostData $postDataHelper, array $data = array() diff --git a/app/code/Magento/Customer/Block/Account/Customer.php b/app/code/Magento/Customer/Block/Account/Customer.php index 1802dcdde82faa0c2fcd94b3e81e2019a28084a1..5950f0d5a014dda229673470c6e17ca81fdec72f 100644 --- a/app/code/Magento/Customer/Block/Account/Customer.php +++ b/app/code/Magento/Customer/Block/Account/Customer.php @@ -34,7 +34,7 @@ class Customer extends \Magento\View\Element\Template protected $_viewHelper; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -47,7 +47,7 @@ class Customer extends \Magento\View\Element\Template * @param \Magento\View\Element\Template\Context $context * @param CustomerAccountServiceInterface $customerAccountService * @param \Magento\Customer\Helper\View $viewHelper - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer * @param array $data */ @@ -55,7 +55,7 @@ class Customer extends \Magento\View\Element\Template \Magento\View\Element\Template\Context $context, CustomerAccountServiceInterface $customerAccountService, \Magento\Customer\Helper\View $viewHelper, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer, array $data = array() ) { diff --git a/app/code/Magento/Customer/Block/Account/RegisterLink.php b/app/code/Magento/Customer/Block/Account/RegisterLink.php index bf022d9d513fa79cf4f9d185c364ae9ac9a269c8..b9221398f28aa14f95c75b57da7c87d75a01be6d 100644 --- a/app/code/Magento/Customer/Block/Account/RegisterLink.php +++ b/app/code/Magento/Customer/Block/Account/RegisterLink.php @@ -31,7 +31,7 @@ class RegisterLink extends \Magento\View\Element\Html\Link /** * Customer session * - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -42,13 +42,13 @@ class RegisterLink extends \Magento\View\Element\Html\Link /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Customer\Helper\Data $customerHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Helper\Data $customerHelper, array $data = array() ) { diff --git a/app/code/Magento/Customer/Block/Address/Edit.php b/app/code/Magento/Customer/Block/Address/Edit.php index a105b9e380acedb4bf45a8b2b2dac4dfd1824040..3566c620c0b99562934388c7123917e7b69be327 100644 --- a/app/code/Magento/Customer/Block/Address/Edit.php +++ b/app/code/Magento/Customer/Block/Address/Edit.php @@ -66,7 +66,7 @@ class Edit extends \Magento\Directory\Block\Data * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory * @param \Magento\Customer\Model\Session $customerSession @@ -81,7 +81,7 @@ class Edit extends \Magento\Directory\Block\Data \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index f0ad21feca214769fd11636ff5268ba724e0b6b0..12a97e8385718895f01f78bdd407edb0adce5f84 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -47,7 +47,7 @@ class Register extends \Magento\Directory\Block\Data * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory * @param \Magento\Module\Manager $moduleManager @@ -61,7 +61,7 @@ class Register extends \Magento\Directory\Block\Data \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, \Magento\Module\Manager $moduleManager, diff --git a/app/code/Magento/Customer/Block/Widget/Name.php b/app/code/Magento/Customer/Block/Widget/Name.php index 1586e8f86092f60ff0b38c02b463be585d9dda5f..70ca92064e50a3d43125f87ba7fba93fdbedb7f9 100644 --- a/app/code/Magento/Customer/Block/Widget/Name.php +++ b/app/code/Magento/Customer/Block/Widget/Name.php @@ -34,8 +34,8 @@ use Magento\Customer\Helper\Data as CustomerHelper; /** * Widget for showing customer name. * - * @method Customer|\Magento\Customer\Model\Customer|\Magento\Sales\Model\Quote\Address getObject() - * @method Name setObject($object) + * @method Customer getObject() + * @method Name setObject(Customer $customer) */ class Name extends AbstractWidget { @@ -213,10 +213,7 @@ class Name extends AbstractWidget */ protected function _getAttribute($attributeCode) { - if ($this->getForceUseCustomerAttributes() - || $this->getObject() instanceof \Magento\Customer\Model\Customer - || $this->getObject() instanceof Customer - ) { + if ($this->getForceUseCustomerAttributes() || $this->getObject() instanceof Customer) { return parent::_getAttribute($attributeCode); } diff --git a/app/code/Magento/Customer/Controller/Account.php b/app/code/Magento/Customer/Controller/Account.php index eaf05a5c04ae5f73d35f9c908e8dc0100cdd757f..fabbdde8fb3da46c2604f3a6216461dd3c5bdaae 100644 --- a/app/code/Magento/Customer/Controller/Account.php +++ b/app/code/Magento/Customer/Controller/Account.php @@ -23,7 +23,7 @@ */ namespace Magento\Customer\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Customer\Service\V1\CustomerGroupServiceInterface; use Magento\Customer\Service\V1\Data\Customer; @@ -40,7 +40,7 @@ use Magento\Exception\StateException; * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Account extends \Magento\App\Action\Action +class Account extends \Magento\Framework\App\Action\Action { /** * List of actions that are allowed for not authorized users @@ -89,7 +89,7 @@ class Account extends \Magento\App\Action\Action /** @var \Magento\Store\Model\StoreManagerInterface */ protected $_storeManager; - /** @var \Magento\App\Config\ScopeConfigInterface */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** @var \Magento\Core\Helper\Data */ @@ -98,7 +98,7 @@ class Account extends \Magento\App\Action\Action /** @var \Magento\Escaper */ protected $escaper; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $appState; /** @var CustomerGroupServiceInterface */ @@ -120,7 +120,7 @@ class Account extends \Magento\App\Action\Action protected $_customerDetailsBuilder; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Helper\Address $addressHelper * @param \Magento\Customer\Helper\Data $customerHelperData @@ -130,10 +130,10 @@ class Account extends \Magento\App\Action\Action * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Helper\Data $coreHelperData * @param \Magento\Escaper $escaper - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $customerGroupService * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService * @param \Magento\Customer\Service\V1\Data\RegionBuilder $regionBuilder @@ -144,7 +144,7 @@ class Account extends \Magento\App\Action\Action * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Helper\Address $addressHelper, \Magento\Customer\Helper\Data $customerHelperData, @@ -154,10 +154,10 @@ class Account extends \Magento\App\Action\Action \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Helper\Data $coreHelperData, \Magento\Escaper $escaper, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, CustomerGroupServiceInterface $customerGroupService, CustomerAccountServiceInterface $customerAccountService, \Magento\Customer\Service\V1\Data\RegionBuilder $regionBuilder, @@ -211,7 +211,7 @@ class Account extends \Magento\App\Action\Action * Dispatch request * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { @@ -445,7 +445,7 @@ class Account extends \Magento\App\Action\Action ->setCustomer($customer) ->setAddresses($addresses) ->create(); - $customer = $this->_customerAccountService->createAccount($customerDetails, $password, null, $redirectUrl); + $customer = $this->_customerAccountService->createCustomer($customerDetails, $password, null, $redirectUrl); if ($this->getRequest()->getParam('is_subscribed', false)) { $this->_subscriberFactory->create()->subscribeCustomerById($customer->getId()); @@ -788,7 +788,6 @@ class Account extends \Magento\App\Action\Action try { $this->_customerAccountService->initiatePasswordReset( $email, - $this->_storeManager->getStore()->getWebsiteId(), CustomerAccountServiceInterface::EMAIL_RESET ); } catch (NoSuchEntityException $e) { diff --git a/app/code/Magento/Customer/Controller/Address.php b/app/code/Magento/Customer/Controller/Address.php index 21035d1d702f71b8e2c3900b92631b68a122ae66..7a77d91730118dd79a08a71108ff14520f42e837 100644 --- a/app/code/Magento/Customer/Controller/Address.php +++ b/app/code/Magento/Customer/Controller/Address.php @@ -23,7 +23,7 @@ */ namespace Magento\Customer\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Exception\InputException; /** @@ -31,7 +31,7 @@ use Magento\Exception\InputException; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Address extends \Magento\App\Action\Action +class Address extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Customer\Model\Session @@ -64,7 +64,7 @@ class Address extends \Magento\App\Action\Action protected $_addressBuilder; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService @@ -76,7 +76,7 @@ class Address extends \Magento\App\Action\Action * @internal param \Magento\Customer\Model\Address\FormFactory $addressFormFactory */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, \Magento\Customer\Service\V1\CustomerAddressServiceInterface $addressService, @@ -107,7 +107,7 @@ class Address extends \Magento\App\Action\Action * Check customer authentication * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index.php b/app/code/Magento/Customer/Controller/Adminhtml/Index.php index 7030d55dfd6e38175b822189217c107616554ac3..f3c791c778b76694c3fe33e1369082a7d3f34803 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index.php @@ -23,7 +23,7 @@ */ namespace Magento\Customer\Controller\Adminhtml; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; use Magento\Customer\Controller\RegistryConstants; use Magento\Customer\Service\V1\Data\Customer; use Magento\Customer\Service\V1\Data\CustomerBuilder; @@ -58,7 +58,7 @@ class Index extends \Magento\Backend\App\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -109,7 +109,7 @@ class Index extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Customer\Model\AddressFactory $addressFactory * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory @@ -128,7 +128,7 @@ class Index extends \Magento\Backend\App\Action public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Customer\Model\AddressFactory $addressFactory, \Magento\Customer\Model\Metadata\FormFactory $formFactory, @@ -419,7 +419,7 @@ class Index extends \Magento\Backend\App\Action if ($isExistingCustomer) { $this->_customerAccountService->updateCustomer($customerDetails); } else { - $customer = $this->_customerAccountService->createAccount($customerDetails); + $customer = $this->_customerAccountService->createCustomer($customerDetails); $customerId = $customer->getId(); } @@ -479,7 +479,7 @@ class Index extends \Magento\Backend\App\Action /** * Reset password handler * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function resetPasswordAction() { @@ -492,8 +492,8 @@ class Index extends \Magento\Backend\App\Action $customer = $this->_customerAccountService->getCustomer($customerId); $this->_customerAccountService->initiatePasswordReset( $customer->getEmail(), - $customer->getWebsiteId(), - CustomerAccountServiceInterface::EMAIL_REMINDER + CustomerAccountServiceInterface::EMAIL_REMINDER, + $customer->getWebsiteId() ); $this->messageManager->addSuccess(__('Customer will receive an email with a link to reset password.')); } catch (NoSuchEntityException $exception) { @@ -621,7 +621,7 @@ class Index extends \Magento\Backend\App\Action /** * Export customer grid to CSV format * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function exportCsvAction() { @@ -629,13 +629,17 @@ class Index extends \Magento\Backend\App\Action $fileName = 'customers.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('admin.block.customer.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** * Export customer grid to XML format * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function exportXmlAction() { @@ -644,7 +648,7 @@ class Index extends \Magento\Backend\App\Action /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('admin.block.customer.grid', 'grid.export'); $content = $exportBlock->getExcelFile($fileName); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -980,7 +984,10 @@ class Index extends \Magento\Backend\App\Action $customer = $this->_customerAccountService->getCustomer($customerId); $this->_customerBuilder->populate($customer); $customer = $this->_customerBuilder->setGroupId($this->getRequest()->getParam('group'))->create(); - $this->_customerAccountService->saveCustomer($customer); + $customerDetails = $this->_customerDetailsBuilder + ->setCustomer($customer) + ->create(); + $this->_customerAccountService->updateCustomer($customerDetails); }, $customerIds ); @@ -1044,9 +1051,9 @@ class Index extends \Magento\Backend\App\Action throw new NotFoundException(); } - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $this->_objectManager->get('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $this->_objectManager->get('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); $fileName = 'customer' . '/' . ltrim($file, '/'); $path = $directory->getAbsolutePath($fileName); if (!$directory->isFile($fileName) @@ -1094,7 +1101,7 @@ class Index extends \Magento\Backend\App\Action $this->_fileFactory->create( $name, array('type' => 'filename', 'value' => $fileName), - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->sendResponse(); } diff --git a/app/code/Magento/Customer/Controller/Review.php b/app/code/Magento/Customer/Controller/Review.php index 62253f134f68815b5a0d52dd92dc0b87700a39cf..741b202718d21fadb3c0851e8e9a85adf6a35784 100644 --- a/app/code/Magento/Customer/Controller/Review.php +++ b/app/code/Magento/Customer/Controller/Review.php @@ -32,7 +32,7 @@ namespace Magento\Customer\Controller; * @package Magento_Customer * @author Magento Core Team <core@magentocommerce.com> */ -class Review extends \Magento\App\Action\Action +class Review extends \Magento\Framework\App\Action\Action { /** * @return void diff --git a/app/code/Magento/Customer/Helper/Address.php b/app/code/Magento/Customer/Helper/Address.php index 9b3ce17608e58cbfecb94f4dc1ac36e891424397..1d416132b6e239852e38a30d0076fad459d0a36c 100755 --- a/app/code/Magento/Customer/Helper/Address.php +++ b/app/code/Magento/Customer/Helper/Address.php @@ -33,7 +33,7 @@ use Magento\Customer\Service\V1\Data\Eav\AttributeMetadata; * * @author Magento Core Team <core@magentocommerce.com> */ -class Address extends \Magento\App\Helper\AbstractHelper +class Address extends \Magento\Framework\App\Helper\AbstractHelper { /** * VAT Validation parameters XML paths @@ -87,7 +87,7 @@ class Address extends \Magento\App\Helper\AbstractHelper /** @var \Magento\Store\Model\StoreManagerInterface */ protected $_storeManager; - /** @var \Magento\App\Config\ScopeConfigInterface */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface */ @@ -97,18 +97,18 @@ class Address extends \Magento\App\Helper\AbstractHelper protected $_addressConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\View\Element\BlockFactory $blockFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService * @param \Magento\Customer\Model\Address\Config $addressConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\View\Element\BlockFactory $blockFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService, \Magento\Customer\Model\Address\Config $addressConfig ) { diff --git a/app/code/Magento/Customer/Helper/Data.php b/app/code/Magento/Customer/Helper/Data.php index 40cc7fd42f8abcd2f161c1ec5a3570e2273b6b62..204bc716d4f30df7ad85c3d9a63d932be5dfaf68 100644 --- a/app/code/Magento/Customer/Helper/Data.php +++ b/app/code/Magento/Customer/Helper/Data.php @@ -31,7 +31,7 @@ namespace Magento\Customer\Helper; * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Customer group cache context @@ -131,7 +131,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_customerAddress = null; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -161,10 +161,10 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $mathRandom; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param Address $customerAddress * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory @@ -174,10 +174,10 @@ class Data extends \Magento\App\Helper\AbstractHelper * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, Address $customerAddress, \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Customer\Model\Metadata\FormFactory $formFactory, @@ -475,7 +475,7 @@ class Data extends \Magento\App\Helper\AbstractHelper { return (int)$this->_scopeConfig->getValue( self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); } @@ -658,7 +658,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Perform customer data filtration based on form code and form object * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $formCode The code of EAV form to take the list of attributes from * @param string $entityType entity type for the form * @param string[] $additionalAttributes The list of attribute codes to skip filtration for @@ -667,7 +667,7 @@ class Data extends \Magento\App\Helper\AbstractHelper * @return array Filtered customer data */ public function extractCustomerData( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, $formCode, $entityType, $additionalAttributes = array(), diff --git a/app/code/Magento/Customer/Helper/View.php b/app/code/Magento/Customer/Helper/View.php index 4a6c3daea90132f2788d5f96f6da981e167e86eb..cff259e17cba50bec2b5c611bbe0365ff0edb231 100644 --- a/app/code/Magento/Customer/Helper/View.php +++ b/app/code/Magento/Customer/Helper/View.php @@ -26,7 +26,7 @@ namespace Magento\Customer\Helper; /** * Customer helper for view. */ -class View extends \Magento\App\Helper\AbstractHelper +class View extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface @@ -36,11 +36,11 @@ class View extends \Magento\App\Helper\AbstractHelper /** * Initialize dependencies. * - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $customerMetadataService ) { $this->_customerMetadataService = $customerMetadataService; diff --git a/app/code/Magento/Customer/Model/Address/Config.php b/app/code/Magento/Customer/Model/Address/Config.php index 62033b2537965360445a70c87852ca53d76c4948..2665e0751a87ae7a89d30930b70481c465a964d8 100644 --- a/app/code/Magento/Customer/Model/Address/Config.php +++ b/app/code/Magento/Customer/Model/Address/Config.php @@ -73,7 +73,7 @@ class Config extends \Magento\Config\Data protected $_addressHelper; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -82,7 +82,7 @@ class Config extends \Magento\Config\Data * @param \Magento\Config\CacheInterface $cache * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Helper\Address $addressHelper - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $cacheId */ public function __construct( @@ -90,7 +90,7 @@ class Config extends \Magento\Config\Data \Magento\Config\CacheInterface $cache, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Helper\Address $addressHelper, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $cacheId = 'address_format' ) { parent::__construct($reader, $cache, $cacheId); diff --git a/app/code/Magento/Customer/Model/AddressRegistry.php b/app/code/Magento/Customer/Model/AddressRegistry.php new file mode 100644 index 0000000000000000000000000000000000000000..ecfdcd27dbc53365ce32fa13b594dcc29c35b9b8 --- /dev/null +++ b/app/code/Magento/Customer/Model/AddressRegistry.php @@ -0,0 +1,84 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +use Magento\Exception\NoSuchEntityException; +use Magento\Customer\Model\AddressFactory; + +/** + * Registry for Address models + */ +class AddressRegistry +{ + /** + * @var Address[] + */ + protected $registry = []; + + /** + * @var AddressFactory + */ + protected $addressFactory; + + /** + * @param AddressFactory $addressFactory + */ + public function __construct(AddressFactory $addressFactory) + { + $this->addressFactory = $addressFactory; + } + + /** + * Get instance of the Address Model identified by id + * + * @param int $addressId + * @return Address + * @throws NoSuchEntityException + */ + public function retrieve($addressId) + { + if (isset($this->registry[$addressId])) { + return $this->registry[$addressId]; + } + $address = $this->addressFactory->create(); + $address->load($addressId); + if (!$address->getId()) { + throw new NoSuchEntityException('addressId', $addressId); + } + $this->registry[$addressId] = $address; + return $address; + } + + /** + * Remove an instance of the Address Model from the registry + * + * @param int $addressId + * @return void + */ + public function remove($addressId) + { + unset($this->registry[$addressId]); + } +} diff --git a/app/code/Magento/Customer/Model/App/Action/ContextPlugin.php b/app/code/Magento/Customer/Model/App/Action/ContextPlugin.php index a6ea016444bc7332158d84c82243ef74b43a8a49..a335118b15850dcdefd88bb3115e5d257617e56c 100644 --- a/app/code/Magento/Customer/Model/App/Action/ContextPlugin.php +++ b/app/code/Magento/Customer/Model/App/Action/ContextPlugin.php @@ -35,32 +35,32 @@ class ContextPlugin protected $customerSession; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext */ public function __construct( \Magento\Customer\Model\Session $customerSession, - \Magento\App\Http\Context $httpContext + \Magento\Framework\App\Http\Context $httpContext ) { $this->customerSession = $customerSession; $this->httpContext = $httpContext; } /** - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return mixed */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->httpContext->setValue( \Magento\Customer\Helper\Data::CONTEXT_GROUP, diff --git a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php index 26fbc9c2a83c77ee1af93ccbbf34b4b5fa781fa8..26ac7c61bfad99d5ef086782d59d9a05be54e707 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php @@ -30,7 +30,7 @@ namespace Magento\Customer\Model\Config\Backend\Address; * * @method string getWebsiteCode */ -class Street extends \Magento\App\Config\Value +class Street extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Eav\Model\Config @@ -53,7 +53,7 @@ class Street extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Model\Resource\AbstractResource $resource = null, @@ -84,7 +84,7 @@ class Street extends \Magento\App\Config\Value } break; - case \Magento\App\ScopeInterface::SCOPE_DEFAULT: + case \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT: $attribute->setData('multiline_count', $value); break; } diff --git a/app/code/Magento/Customer/Model/Config/Backend/Password/Link/Expirationperiod.php b/app/code/Magento/Customer/Model/Config/Backend/Password/Link/Expirationperiod.php index 0555df0da0e99ff2680c28bdedb8cc536fba2837..ca98c0308fb41ccd21468b2ed6a980982ad19ce7 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Password/Link/Expirationperiod.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Password/Link/Expirationperiod.php @@ -32,7 +32,7 @@ namespace Magento\Customer\Model\Config\Backend\Password\Link; * @package Magento_Customer * @author Magento Core Team <core@magentocommerce.com> */ -class Expirationperiod extends \Magento\App\Config\Value +class Expirationperiod extends \Magento\Framework\App\Config\Value { /** * Validate expiration period value before saving diff --git a/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php b/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php index 96eb01c5b304839a0cca04e71d4c8367aa95b169..182944e05ecb6fad844d92de8eb0f1cee0a73b6b 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Show/Customer.php @@ -34,7 +34,7 @@ use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; * @package Magento_Customer * @author Magento Core Team <core@magentocommerce.com> */ -class Customer extends \Magento\App\Config\Value +class Customer extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Eav\Model\Config @@ -47,7 +47,7 @@ class Customer extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Model\Resource\AbstractResource $resource @@ -57,7 +57,7 @@ class Customer extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Customer/Model/Config/Share.php b/app/code/Magento/Customer/Model/Config/Share.php index 30f798338f31cf95e2b7c70c765b9a8ae0377730..6c8c6958e76ab1fa94886cec535e90842a98503f 100644 --- a/app/code/Magento/Customer/Model/Config/Share.php +++ b/app/code/Magento/Customer/Model/Config/Share.php @@ -32,7 +32,7 @@ namespace Magento\Customer\Model\Config; * @package Magento_Customer * @author Magento Core Team <core@magentocommerce.com> */ -class Share extends \Magento\App\Config\Value implements \Magento\Option\ArrayInterface +class Share extends \Magento\Framework\App\Config\Value implements \Magento\Option\ArrayInterface { /** * Xml config path to customers sharing scope value @@ -61,7 +61,7 @@ class Share extends \Magento\App\Config\Value implements \Magento\Option\ArrayIn * * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Resource\Customer $customerResource * @param \Magento\Model\Resource\AbstractResource $resource @@ -71,7 +71,7 @@ class Share extends \Magento\App\Config\Value implements \Magento\Option\ArrayIn public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Resource\Customer $customerResource, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Customer/Model/Converter.php b/app/code/Magento/Customer/Model/Converter.php index 7964ad9baae2851114c88305daafd629f7f7535d..67aa6ddfc4c2c53693f2889ea263a4b768c5853a 100644 --- a/app/code/Magento/Customer/Model/Converter.php +++ b/app/code/Magento/Customer/Model/Converter.php @@ -81,7 +81,6 @@ class Converter public function getCustomerModel($customerId) { $customer = $this->_customerFactory->create()->load($customerId); - if (!$customer->getId()) { // customer does not exist throw new NoSuchEntityException('customerId', $customerId); @@ -113,9 +112,11 @@ class Converter public function getCustomerModelByEmail($customerEmail, $websiteId = null) { $customer = $this->_customerFactory->create(); - if (isset($websiteId)) { - $customer->setWebsiteId($websiteId); + if (!isset($websiteId)) { + $websiteId = $this->_storeManager->getWebsiteId(); } + $customer->setWebsiteId($websiteId); + $customer->loadByEmail($customerEmail); if (!$customer->getId()) { throw new NoSuchEntityException('email', $customerEmail); diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index c4c5e325befee01d3385f7c9b4b1b0e1ac745a34..876cff188fe67581c309961a945e9a4a48a29d16 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -156,7 +156,7 @@ class Customer extends \Magento\Model\AbstractModel protected $_customerData = null; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -216,7 +216,7 @@ class Customer extends \Magento\Model\AbstractModel * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Resource\Customer $resource * @param Config\Share $configShare * @param AddressFactory $addressFactory @@ -237,7 +237,7 @@ class Customer extends \Magento\Model\AbstractModel \Magento\Customer\Helper\Data $customerData, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Resource\Customer $resource, \Magento\Customer\Model\Config\Share $configShare, \Magento\Customer\Model\AddressFactory $addressFactory, diff --git a/app/code/Magento/Customer/Model/CustomerRegistry.php b/app/code/Magento/Customer/Model/CustomerRegistry.php new file mode 100644 index 0000000000000000000000000000000000000000..bfeae7250b27906ab3a484b0a07efe2a5f604f76 --- /dev/null +++ b/app/code/Magento/Customer/Model/CustomerRegistry.php @@ -0,0 +1,150 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +use Magento\Customer\Model\CustomerFactory; +use Magento\Exception\NoSuchEntityException; + +/** + * Registry for \Magento\Customer\Model\Customer + */ +class CustomerRegistry +{ + /** + * @var CustomerFactory + */ + private $customerFactory; + + /** + * @var array + */ + private $customerRegistryById = []; + + /** + * @var array + */ + private $customerRegistryByEmail = []; + + /** + * Constructor + * + * @param CustomerFactory $customerFactory + */ + public function __construct(CustomerFactory $customerFactory) + { + $this->customerFactory = $customerFactory; + } + + /** + * Retrieve Customer Model from registry given an id + * + * @param string $customerId + * @return Customer + * @throws NoSuchEntityException + */ + public function retrieve($customerId) + { + if (isset($this->customerRegistryById[$customerId])) { + return $this->customerRegistryById[$customerId]; + } + /** @var Customer $customer */ + $customer = $this->customerFactory->create()->load($customerId); + if (!$customer->getId()) { + // customer does not exist + throw new NoSuchEntityException('customerId', $customerId); + } else { + $this->customerRegistryById[$customerId] = $customer; + $this->customerRegistryByEmail[$customer->getEmail() . $customer->getWebsiteId()] = $customer; + return $customer; + } + } + + /** + * Retrieve Customer Model from registry given an email + * + * @param string $customerEmail + * @param string $websiteId + * @return Customer + * @throws NoSuchEntityException + */ + public function retrieveByEmail($customerEmail, $websiteId) + { + $emailKey = $customerEmail . $websiteId; + if (isset($this->customerRegistryByEmail[$emailKey])) { + return $this->customerRegistryByEmail[$emailKey]; + } + + /** @var Customer $customer */ + $customer = $this->customerFactory->create(); + + if (isset($websiteId)) { + $customer->setWebsiteId($websiteId); + } + + $customer->loadByEmail($customerEmail); + if (!$customer->getEmail()) { + // customer does not exist + throw (new NoSuchEntityException('email', $customerEmail))->addField('websiteId', $websiteId); + } else { + $this->customerRegistryById[$customer->getId()] = $customer; + $this->customerRegistryByEmail[$emailKey] = $customer; + return $customer; + } + } + + /** + * Remove instance of the Customer Model from registry given an id + * + * @param int $customerId + * @return void + */ + public function remove($customerId) + { + if (isset($this->customerRegistryById[$customerId])) { + /** @var Customer $customer */ + $customer = $this->customerRegistryById[$customerId]; + unset($this->customerRegistryByEmail[$customer->getEmail() . $customer->getWebsiteId()]); + unset($this->customerRegistryById[$customerId]); + } + } + + /** + * Remove instance of the Customer Model from registry given an email + * + * @param string $customerEmail + * @param string $websiteId + * @return void + */ + public function removeByEmail($customerEmail, $websiteId) + { + $emailKey = $customerEmail . $websiteId; + if ($emailKey) { + /** @var Customer $customer */ + $customer = $this->customerRegistryByEmail[$emailKey]; + unset($this->customerRegistryByEmail[$emailKey]); + unset($this->customerRegistryById[$customer->getId()]); + } + } +} diff --git a/app/code/Magento/Customer/Model/GroupRegistry.php b/app/code/Magento/Customer/Model/GroupRegistry.php new file mode 100644 index 0000000000000000000000000000000000000000..c44beade39f519f14bdad5d9a59a3767ab1c71ee --- /dev/null +++ b/app/code/Magento/Customer/Model/GroupRegistry.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +use Magento\Exception\NoSuchEntityException; +use Magento\Customer\Model\GroupFactory; +use Magento\Customer\Model\Group; + +/** + * Registry for Customer Group models + */ +class GroupRegistry +{ + /** + * @var array + */ + protected $registry = []; + + /** + * @var GroupFactory + */ + protected $groupFactory; + + /** + * @param GroupFactory $groupFactory + */ + public function __construct(GroupFactory $groupFactory) + { + $this->groupFactory = $groupFactory; + } + + /** + * Get instance of the Group Model identified by an id + * + * @param int $groupId + * @return Group + * @throws NoSuchEntityException + */ + public function retrieve($groupId) + { + if (isset($this->registry[$groupId])) { + return $this->registry[$groupId]; + } + $group = $this->groupFactory->create(); + $group->load($groupId); + if (is_null($group->getId())) { + throw new NoSuchEntityException('groupId', $groupId); + } + $this->registry[$groupId] = $group; + return $group; + } + + /** + * Remove an instance of the Group Model from the registry + * + * @param int $groupId + * @return void + */ + public function remove($groupId) + { + unset($this->registry[$groupId]); + } +} diff --git a/app/code/Magento/Customer/Model/Layout/DepersonalizePlugin.php b/app/code/Magento/Customer/Model/Layout/DepersonalizePlugin.php index de213a71ce000027d55089e06f4b97acca37cde6..5f9e53a6ed073005168be587f4fab5e8fd69ea8f 100644 --- a/app/code/Magento/Customer/Model/Layout/DepersonalizePlugin.php +++ b/app/code/Magento/Customer/Model/Layout/DepersonalizePlugin.php @@ -48,7 +48,7 @@ class DepersonalizePlugin protected $customer; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -81,7 +81,7 @@ class DepersonalizePlugin * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Module\Manager $moduleManager * @param \Magento\Log\Model\Visitor $visitor * @param \Magento\PageCache\Model\Config $cacheConfig @@ -90,7 +90,7 @@ class DepersonalizePlugin \Magento\Session\SessionManagerInterface $session, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Module\Manager $moduleManager, \Magento\Log\Model\Visitor $visitor, \Magento\PageCache\Model\Config $cacheConfig diff --git a/app/code/Magento/Customer/Model/Metadata/Form.php b/app/code/Magento/Customer/Model/Metadata/Form.php index d7b11fdf16107ff1657e99356bc7a0df1a518fe4..549005a2aac6fe7a8b6cc3a91cdaf2303925876b 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form.php +++ b/app/code/Magento/Customer/Model/Metadata/Form.php @@ -77,7 +77,7 @@ class Form protected $_attributeValues = array(); /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_httpRequest; @@ -104,7 +104,7 @@ class Form /** * @param \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $eavMetadataService * @param ElementFactory $elementFactory - * @param \Magento\App\RequestInterface $httpRequest + * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\Validator\ConfigFactory $validatorConfigFactory * @param string $entityType @@ -119,7 +119,7 @@ class Form public function __construct( \Magento\Customer\Service\V1\CustomerMetadataServiceInterface $eavMetadataService, ElementFactory $elementFactory, - \Magento\App\RequestInterface $httpRequest, + \Magento\Framework\App\RequestInterface $httpRequest, \Magento\Module\Dir\Reader $modulesReader, \Magento\Validator\ConfigFactory $validatorConfigFactory, $entityType, @@ -225,12 +225,12 @@ class Form /** * Extract data from request and return associative data array * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $scope the request scope * @param boolean $scopeOnly search value only in scope or search value in global too * @return array */ - public function extractData(\Magento\App\RequestInterface $request, $scope = null, $scopeOnly = true) + public function extractData(\Magento\Framework\App\RequestInterface $request, $scope = null, $scopeOnly = true) { $data = array(); foreach ($this->getAllowedAttributes() as $attribute) { @@ -306,7 +306,7 @@ class Form * Prepare request with data and returns it * * @param array $data - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function prepareRequest(array $data) { diff --git a/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php b/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php index 34b773df49e0b9efd728ab8e82ccd6135a4db512..399e2c2cb1172dfc5b70446268283b3f032a08a3 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php @@ -457,10 +457,10 @@ abstract class AbstractData /** * Return Original Attribute value from Request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return mixed */ - protected function _getRequestValue(\Magento\App\RequestInterface $request) + protected function _getRequestValue(\Magento\Framework\App\RequestInterface $request) { $attrCode = $this->getAttribute()->getAttributeCode(); if ($this->_requestScope) { @@ -496,10 +496,10 @@ abstract class AbstractData /** * Extract data from request and return value * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return array|string */ - abstract public function extractValue(\Magento\App\RequestInterface $request); + abstract public function extractValue(\Magento\Framework\App\RequestInterface $request); /** * Validate data diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Date.php b/app/code/Magento/Customer/Model/Metadata/Form/Date.php index cb7c885fae290e7be1938d126a46a47286c6f069..767a54422928c4a983192fbf1997412cb6e5901a 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Date.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Date.php @@ -30,7 +30,7 @@ class Date extends AbstractData /** * {@inheritdoc} */ - public function extractValue(\Magento\App\RequestInterface $request) + public function extractValue(\Magento\Framework\App\RequestInterface $request) { $value = $this->_getRequestValue($request); return $this->_applyInputFilter($value); diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index ae9bfa350bd5314a84f5ad0e3f269ad76dacebe0..ca7a570d21ad6ec782a5770113efd8050cdafd0f 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -47,7 +47,7 @@ class File extends AbstractData protected $_fileValidator; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_fileSystem; @@ -61,7 +61,7 @@ class File extends AbstractData * @param bool $isAjax * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator - * @param \Magento\App\Filesystem $fileSystem + * @param \Magento\Framework\App\Filesystem $fileSystem */ public function __construct( \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -73,7 +73,7 @@ class File extends AbstractData $isAjax, \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator, - \Magento\App\Filesystem $fileSystem + \Magento\Framework\App\Filesystem $fileSystem ) { parent::__construct($localeDate, $logger, $attribute, $localeResolver, $value, $entityTypeCode, $isAjax); $this->_coreData = $coreData; @@ -84,7 +84,7 @@ class File extends AbstractData /** * {@inheritdoc} */ - public function extractValue(\Magento\App\RequestInterface $request) + public function extractValue(\Magento\Framework\App\RequestInterface $request) { if ($this->getIsAjaxRequest()) { return false; @@ -252,7 +252,7 @@ class File extends AbstractData } } - $path = $this->_fileSystem->getPath(\Magento\App\Filesystem::MEDIA_DIR) . '/' . $this->_entityTypeCode; + $path = $this->_fileSystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR) . '/' . $this->_entityTypeCode; $result = $original; // unlink entity file diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php b/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php index 8faa0aa013c4ee096fa556a79f8cae0f6fc27781..4995c6533da1d0623b71ba7884e6f5a732397461 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Multiline.php @@ -32,7 +32,7 @@ class Multiline extends Text /** * {@inheritdoc} */ - public function extractValue(\Magento\App\RequestInterface $request) + public function extractValue(\Magento\Framework\App\RequestInterface $request) { $value = $this->_getRequestValue($request); if (!is_array($value)) { diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php b/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php index a5e4e5dd9ad3001b99eb40a1a519c161c45223a6..af789047434a20a4e7efe37bf881ec60e4be14d8 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Multiselect.php @@ -25,7 +25,7 @@ */ namespace Magento\Customer\Model\Metadata\Form; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Customer\Model\Metadata\ElementFactory; class Multiselect extends Select diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Select.php b/app/code/Magento/Customer/Model/Metadata/Form/Select.php index bd89b381e9bf967e7664b5ea66762e33019fb7dd..537d3ca54d9b23b09b7862d509c84c7b4bda6077 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Select.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Select.php @@ -25,7 +25,7 @@ */ namespace Magento\Customer\Model\Metadata\Form; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Customer\Model\Metadata\ElementFactory; class Select extends AbstractData diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Text.php b/app/code/Magento/Customer/Model/Metadata/Form/Text.php index f28d3df1c3cc101156b1fe34d7e86c7108d3cf0f..0cce233f5c41ead98b125cc1ebe429f0f8cb3bd0 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Text.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Text.php @@ -59,7 +59,7 @@ class Text extends AbstractData /** * {@inheritdoc} */ - public function extractValue(\Magento\App\RequestInterface $request) + public function extractValue(\Magento\Framework\App\RequestInterface $request) { return $this->_applyInputFilter($this->_getRequestValue($request)); } diff --git a/app/code/Magento/Customer/Model/Resource/AbstractServiceCollection.php b/app/code/Magento/Customer/Model/Resource/AbstractServiceCollection.php index 2fe891b26ff960f791b912c555a57d50d91c9e54..e0c8912162711b9c42e5cae8fa53d7b1f155334f 100644 --- a/app/code/Magento/Customer/Model/Resource/AbstractServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/AbstractServiceCollection.php @@ -26,8 +26,8 @@ namespace Magento\Customer\Model\Resource; use Magento\Core\Model\EntityFactory; use Magento\Service\V1\Data\Filter; use Magento\Service\V1\Data\FilterBuilder; -use Magento\Customer\Service\V1\Data\SearchCriteria; -use Magento\Customer\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Service\V1\Data\SearchCriteria; +use Magento\Service\V1\Data\SearchCriteriaBuilder; use Magento\Exception; /** @@ -134,20 +134,18 @@ abstract class AbstractServiceCollection extends \Magento\Data\Collection protected function getSearchCriteria() { foreach ($this->fieldFilters as $filter) { + // array of fields, put filters in array to use 'or' group + /** @var Filter[] $filterGroup */ + $filterGroup = array(); if (!is_array($filter['field'])) { // just one field - $this->searchCriteriaBuilder->addFilter( - $this->createFilterData($filter['field'], $filter['condition']) - ); + $filterGroup = [$this->createFilterData($filter['field'], $filter['condition'])]; } else { - // array of fields, put filters in array to use 'or' group - /** @var Filter[] $orGroupFilters */ - $orGroupFilters = array(); foreach ($filter['field'] as $index => $field) { - $orGroupFilters[] = $this->createFilterData($field, $filter['condition'][$index]); + $filterGroup[] = $this->createFilterData($field, $filter['condition'][$index]); } - $this->searchCriteriaBuilder->addOrGroup($orGroupFilters); } + $this->searchCriteriaBuilder->addFilter($filterGroup); } foreach ($this->_orders as $field => $direction) { $this->searchCriteriaBuilder->addSortOrder( diff --git a/app/code/Magento/Customer/Model/Resource/Address.php b/app/code/Magento/Customer/Model/Resource/Address.php index ffab3b0b65132f6a66c798284ad97674e734c4ef..ec67ac0a3cee36adc42c441715639472469b7f7e 100644 --- a/app/code/Magento/Customer/Model/Resource/Address.php +++ b/app/code/Magento/Customer/Model/Resource/Address.php @@ -38,7 +38,7 @@ class Address extends \Magento\Eav\Model\Entity\AbstractEntity protected $_customerFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -49,7 +49,7 @@ class Address extends \Magento\Eav\Model\Entity\AbstractEntity * @param array $data */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, diff --git a/app/code/Magento/Customer/Model/Resource/Customer.php b/app/code/Magento/Customer/Model/Resource/Customer.php index 8c03b9de2cdd9f1c394d984c0e87571f5fc5d710..f3ff796f2d6121dca4f459bfe17f2def07f25e06 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer.php +++ b/app/code/Magento/Customer/Model/Resource/Customer.php @@ -36,7 +36,7 @@ class Customer extends \Magento\Eav\Model\Entity\AbstractEntity /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -46,25 +46,25 @@ class Customer extends \Magento\Eav\Model\Entity\AbstractEntity protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Model\Validator\Factory $validatorFactory * @param \Magento\Stdlib\DateTime $dateTime * @param array $data */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Model\Validator\Factory $validatorFactory, \Magento\Stdlib\DateTime $dateTime, $data = array() diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php index 61dcb2f175667c0792bb6c72a5bad10cd35fde9e..d4c72eb4d1d244e09c1682da00e77381319e2609 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php @@ -55,7 +55,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory @@ -71,7 +71,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php b/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php index cb85cc3b394b827abc757d9375189b3018ed5f68..2cd00bdbc79669aeada8dc10607b435bbea65d27 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Grid/ServiceCollection.php @@ -29,7 +29,7 @@ use Magento\Customer\Model\Resource\AbstractServiceCollection; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Customer\Service\V1\Data\CustomerDetails; use Magento\Service\V1\Data\FilterBuilder; -use Magento\Customer\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Service\V1\Data\SearchCriteriaBuilder; /** * Customer Grid Collection backed by Services diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index 61e6fe27b0cf9ac559fc56a7b7473dd7cd235d7c..b8742c1df3784c57c509dd744d0ace4576931dae 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -47,12 +47,12 @@ class Group extends \Magento\Model\Resource\Db\AbstractDb protected $_customersFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Customer\Helper\Data $customerData, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory ) { diff --git a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php index 3e42049c7fcfc8a558c8a2ac01f953ad6a84c6c9..24b14755123bd056d863d028bc5146c40da5611f 100644 --- a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php @@ -28,7 +28,7 @@ use Magento\Customer\Model\Resource\AbstractServiceCollection; use Magento\Customer\Service\V1\CustomerGroupServiceInterface; use Magento\Customer\Service\V1\Data\CustomerGroup; use Magento\Service\V1\Data\FilterBuilder; -use Magento\Customer\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Service\V1\Data\SearchCriteriaBuilder; /** * Customer group collection backed by services diff --git a/app/code/Magento/Customer/Model/Resource/Setup.php b/app/code/Magento/Customer/Model/Resource/Setup.php index a71a2f9db0aa661730ad722ff42c8caf3f0878f7..55659a37ab431746db78a7384b1f6fe83a0378c4 100644 --- a/app/code/Magento/Customer/Model/Resource/Setup.php +++ b/app/code/Magento/Customer/Model/Resource/Setup.php @@ -35,7 +35,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory * @param \Magento\Eav\Model\Config $eavConfig * @param string $moduleName @@ -44,7 +44,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, \Magento\Eav\Model\Config $eavConfig, $moduleName = 'Magento_Customer', diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index 52eb63cd23d8f4a01d844c9a132de7962cd446a3..7a8027486650e34cb1ae36210600f02a12d88af7 100755 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -99,7 +99,7 @@ class Session extends \Magento\Session\SessionManager protected $_eventManager; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_httpContext; @@ -109,7 +109,7 @@ class Session extends \Magento\Session\SessionManager protected $_converter; /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Session\SaveHandlerInterface $saveHandler @@ -123,13 +123,13 @@ class Session extends \Magento\Session\SessionManager * @param \Magento\UrlFactory $urlFactory * @param \Magento\Session\Generic $session * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param Converter $converter * @param CustomerAccountServiceInterface $customerAccountService * @param null $sessionName */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Session\SaveHandlerInterface $saveHandler, @@ -143,7 +143,7 @@ class Session extends \Magento\Session\SessionManager \Magento\UrlFactory $urlFactory, \Magento\Session\Generic $session, \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Model\Converter $converter, CustomerAccountServiceInterface $customerAccountService, $sessionName = null @@ -465,11 +465,11 @@ class Session extends \Magento\Session\SessionManager /** * Authenticate controller action by login customer * - * @param \Magento\App\Action\Action $action + * @param \Magento\Framework\App\Action\Action $action * @param bool|null $loginUrl * @return bool */ - public function authenticate(\Magento\App\Action\Action $action, $loginUrl = null) + public function authenticate(\Magento\Framework\App\Action\Action $action, $loginUrl = null) { if ($this->isLoggedIn()) { return true; diff --git a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php index 6622f324c85dd8d11df156c9f8fdd7fa08c49f73..e07cdeb784bc65f8c561af25bcd3e0c8ca1886c4 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAccountService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAccountService.php @@ -21,14 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1; use Magento\Store\Model\StoreManagerInterface; use Magento\Customer\Model\Converter; use Magento\Customer\Model\Customer as CustomerModel; use Magento\Customer\Model\CustomerFactory; +use Magento\Customer\Model\CustomerRegistry; use Magento\Customer\Model\Metadata\Validator; use Magento\Customer\Model\Resource\Customer\Collection; +use Magento\Service\V1\Data\Search\FilterGroup; use Magento\Event\ManagerInterface; use Magento\Exception\InputException; use Magento\Exception\AuthenticationException; @@ -36,10 +39,12 @@ use Magento\Exception\NoSuchEntityException; use Magento\Exception\StateException; use Magento\Mail\Exception as MailException; use Magento\Math\Random; +use Magento\Service\V1\Data\SearchCriteria; use Magento\UrlInterface; use Magento\Logger; use Magento\Encryption\EncryptorInterface as Encryptor; use Magento\Customer\Model\Config\Share as ConfigShare; +use Magento\Customer\Model\AddressRegistry; use Magento\Service\V1\Data\Filter; /** @@ -47,86 +52,96 @@ use Magento\Service\V1\Data\Filter; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class CustomerAccountService implements CustomerAccountServiceInterface { /** * @var CustomerFactory */ - private $_customerFactory; - - /** @var Data\CustomerBuilder */ - private $_customerBuilder; + private $customerFactory; - /** @var Data\CustomerDetailsBuilder */ - private $_customerDetailsBuilder; + /** + * @var Data\CustomerBuilder + */ + private $customerBuilder; - /** @var Data\SearchResultsBuilder */ - private $_searchResultsBuilder; + /** + * @var Data\CustomerDetailsBuilder + */ + private $customerDetailsBuilder; - /** @var Data\CustomerValidationResultsBuilder */ - private $_customerValidationResultsBuilder; + /** + * @var Data\SearchResultsBuilder + */ + private $searchResultsBuilder; /** - * Core event manager proxy - * * @var ManagerInterface */ - private $_eventManager; + private $eventManager; /** * @var StoreManagerInterface */ - private $_storeManager; + private $storeManager; /** * @var Random */ - private $_mathRandom; + private $mathRandom; /** * @var Converter */ - private $_converter; + private $converter; /** * @var Validator */ - private $_validator; + private $validator; /** * @var CustomerAddressServiceInterface */ - private $_customerAddressService; + private $customerAddressService; /** * @var CustomerMetadataServiceInterface */ - private $_customerMetadataService; + private $customerMetadataService; /** * @var UrlInterface */ - private $_url; + private $url; /** * @var Logger */ - protected $_logger; + protected $logger; /** * @var Encryptor */ - private $_encryptor; + private $encryptor; + + /** + * @var CustomerRegistry + */ + private $customerRegistry; + + /** + * @var AddressRegistry + */ + private $addressRegistry; /** * @var ConfigShare */ - private $_configShare; + private $configShare; /** - * Constructor - * * @param CustomerFactory $customerFactory * @param ManagerInterface $eventManager * @param StoreManagerInterface $storeManager @@ -139,10 +154,13 @@ class CustomerAccountService implements CustomerAccountServiceInterface * @param Data\CustomerValidationResultsBuilder $customerValidationResultsBuilder * @param CustomerAddressServiceInterface $customerAddressService * @param CustomerMetadataServiceInterface $customerMetadataService + * @param CustomerRegistry $customerRegistry + * @param AddressRegistry $addressRegistry * @param UrlInterface $url * @param Logger $logger * @param Encryptor $encryptor * @param ConfigShare $configShare + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -158,27 +176,31 @@ class CustomerAccountService implements CustomerAccountServiceInterface Data\CustomerValidationResultsBuilder $customerValidationResultsBuilder, CustomerAddressServiceInterface $customerAddressService, CustomerMetadataServiceInterface $customerMetadataService, + CustomerRegistry $customerRegistry, + AddressRegistry $addressRegistry, UrlInterface $url, Logger $logger, Encryptor $encryptor, ConfigShare $configShare ) { - $this->_customerFactory = $customerFactory; - $this->_eventManager = $eventManager; - $this->_storeManager = $storeManager; - $this->_mathRandom = $mathRandom; - $this->_converter = $converter; - $this->_validator = $validator; - $this->_customerBuilder = $customerBuilder; - $this->_customerDetailsBuilder = $customerDetailsBuilder; - $this->_searchResultsBuilder = $searchResultsBuilder; - $this->_customerValidationResultsBuilder = $customerValidationResultsBuilder; - $this->_customerAddressService = $customerAddressService; - $this->_customerMetadataService = $customerMetadataService; - $this->_url = $url; - $this->_logger = $logger; - $this->_encryptor = $encryptor; - $this->_configShare = $configShare; + $this->customerFactory = $customerFactory; + $this->eventManager = $eventManager; + $this->storeManager = $storeManager; + $this->mathRandom = $mathRandom; + $this->converter = $converter; + $this->validator = $validator; + $this->customerBuilder = $customerBuilder; + $this->customerDetailsBuilder = $customerDetailsBuilder; + $this->searchResultsBuilder = $searchResultsBuilder; + $this->customerValidationResultsBuilder = $customerValidationResultsBuilder; + $this->customerAddressService = $customerAddressService; + $this->customerMetadataService = $customerMetadataService; + $this->customerRegistry = $customerRegistry; + $this->addressRegistry = $addressRegistry; + $this->url = $url; + $this->logger = $logger; + $this->encryptor = $encryptor; + $this->configShare = $configShare; } /** @@ -186,25 +208,21 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function resendConfirmation($email, $websiteId, $redirectUrl = '') { - $customer = $this->_customerFactory->create(); - $customer->setWebsiteId($websiteId)->loadByEmail($email); - if (!$customer->getId()) { - throw (new NoSuchEntityException('email', $email))->addField('websiteId', $websiteId); - } - if ($customer->getConfirmation()) { - try { - $customer->sendNewAccountEmail( - self::NEW_ACCOUNT_EMAIL_CONFIRMATION, - $redirectUrl, - $this->_storeManager->getStore()->getId() - ); - } catch (MailException $e) { - // If we are not able to send a new account email, this should be ignored - $this->_logger->logException($e); - } - } else { + $customer = $this->customerRegistry->retrieveByEmail($email, $websiteId); + if (!$customer->getConfirmation()) { throw new StateException('No confirmation needed.', StateException::INVALID_STATE); } + + try { + $customer->sendNewAccountEmail( + self::NEW_ACCOUNT_EMAIL_CONFIRMATION, + $redirectUrl, + $this->storeManager->getStore()->getId() + ); + } catch (MailException $e) { + // If we are not able to send a new account email, this should be ignored + $this->logger->logException($e); + } } /** @@ -213,22 +231,21 @@ class CustomerAccountService implements CustomerAccountServiceInterface public function activateCustomer($customerId, $confirmationKey) { // load customer by id - $customer = $this->_converter->getCustomerModel($customerId); + $customer = $this->customerRegistry->retrieve($customerId); // check if customer is inactive - if ($customer->getConfirmation()) { - if ($customer->getConfirmation() !== $confirmationKey) { - throw new StateException('Invalid confirmation token', StateException::INPUT_MISMATCH); - } - // activate customer - $customer->setConfirmation(null); - $customer->save(); - $customer->sendNewAccountEmail('confirmed', '', $this->_storeManager->getStore()->getId()); - } else { + if (!$customer->getConfirmation()) { throw new StateException('Account already active', StateException::INVALID_STATE); } - return $this->_converter->createCustomerFromModel($customer); + if ($customer->getConfirmation() !== $confirmationKey) { + throw new StateException('Invalid confirmation token', StateException::INPUT_MISMATCH); + } + // activate customer + $customer->setConfirmation(null); + $customer->save(); + $customer->sendNewAccountEmail('confirmed', '', $this->storeManager->getStore()->getId()); + return $this->converter->createCustomerFromModel($customer); } /** @@ -236,8 +253,8 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function authenticate($username, $password) { - $customerModel = $this->_customerFactory->create(); - $customerModel->setWebsiteId($this->_storeManager->getStore()->getWebsiteId()); + $customerModel = $this->customerFactory->create(); + $customerModel->setWebsiteId($this->storeManager->getStore()->getWebsiteId()); try { $customerModel->authenticate($username, $password); } catch (\Magento\Model\Exception $e) { @@ -254,10 +271,10 @@ class CustomerAccountService implements CustomerAccountServiceInterface throw new AuthenticationException($e->getMessage(), $code, $e); } - $this->_eventManager->dispatch('customer_login', array('customer' => $customerModel)); + $this->eventManager->dispatch('customer_login', array('customer' => $customerModel)); - $customerDto = $this->_converter->createCustomerFromModel($customerModel); - $this->_eventManager->dispatch('customer_data_object_login', array('customer' => $customerDto)); + $customerDto = $this->converter->createCustomerFromModel($customerModel); + $this->eventManager->dispatch('customer_data_object_login', array('customer' => $customerDto)); return $customerDto; } @@ -267,27 +284,28 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken) { - $this->_validateResetPasswordToken($customerId, $resetPasswordLinkToken); + $this->validateResetPasswordToken($customerId, $resetPasswordLinkToken); } /** * {@inheritdoc} */ - public function initiatePasswordReset($email, $websiteId, $template) + public function initiatePasswordReset($email, $template, $websiteId = null) { - $customer = $this->_customerFactory->create()->setWebsiteId($websiteId)->loadByEmail($email); - - if (!$customer->getId()) { - throw (new NoSuchEntityException('email', $email))->addField('websiteId', $websiteId); + if (is_null($websiteId)) { + $websiteId = $this->storeManager->getStore()->getWebsiteId(); } - $newPasswordToken = $this->_mathRandom->getUniqueHash(); + // load customer by email + $customer = $this->customerRegistry->retrieveByEmail($email, $websiteId); + + $newPasswordToken = $this->mathRandom->getUniqueHash(); $customer->changeResetPasswordLinkToken($newPasswordToken); - $resetUrl = $this->_url->getUrl( + $resetUrl = $this->url->getUrl( 'customer/account/createPassword', - array( + [ '_query' => array('id' => $customer->getId(), 'token' => $newPasswordToken), '_store' => $customer->getStoreId() - ) + ] ); $customer->setResetPasswordUrl($resetUrl); @@ -304,7 +322,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface } } catch (MailException $e) { // If we are not able to send a reset password email, this should be ignored - $this->_logger->logException($e); + $this->logger->logException($e); } } @@ -313,7 +331,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function resetPassword($customerId, $resetToken, $newPassword) { - $customerModel = $this->_validateResetPasswordToken($customerId, $resetToken); + $customerModel = $this->validateResetPasswordToken($customerId, $resetToken); $customerModel->setRpToken(null); $customerModel->setRpTokenCreatedAt(null); $customerModel->setPasswordHash($this->getPasswordHash($newPassword)); @@ -325,11 +343,12 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function getConfirmationStatus($customerId) { - $customerModel = $this->_converter->getCustomerModel($customerId); - if (!$customerModel->getConfirmation()) { + // load customer by id + $customer = $this->customerRegistry->retrieve($customerId); + if (!$customer->getConfirmation()) { return CustomerAccountServiceInterface::ACCOUNT_CONFIRMED; } - if ($customerModel->isConfirmationRequired()) { + if ($customer->isConfirmationRequired()) { return CustomerAccountServiceInterface::ACCOUNT_CONFIRMATION_REQUIRED; } return CustomerAccountServiceInterface::ACCOUNT_CONFIRMATION_NOT_REQUIRED; @@ -338,7 +357,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface /** * {@inheritdoc} */ - public function createAccount( + public function createCustomer( Data\CustomerDetails $customerDetails, $password = null, $hash = null, @@ -349,7 +368,8 @@ class CustomerAccountService implements CustomerAccountServiceInterface // This logic allows an existing customer to be added to a different store. No new account is created. // The plan is to move this logic into a new method called something like 'registerAccountWithStore' if ($customer->getId()) { - $websiteId = $this->_converter->getCustomerModel($customer->getId())->getWebsiteId(); + $customerModel = $this->customerRegistry->retrieve($customer->getId()); + $websiteId = $customerModel->getWebsiteId(); if ($this->isCustomerInStore($websiteId, $customer->getStoreId())) { throw new InputException(__('Customer already exists in this store.')); @@ -357,17 +377,19 @@ class CustomerAccountService implements CustomerAccountServiceInterface if (empty($password) && empty($hash)) { // Reuse existing password - $hash = $this->_converter->getCustomerModel($customer->getId())->getPasswordHash(); + $hash = $this->converter->getCustomerModel($customer->getId())->getPasswordHash(); } } // Make sure we have a storeId to associate this customer with. if (!$customer->getStoreId()) { if ($customer->getWebsiteId()) { - $storeId = $this->_storeManager->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId(); + $storeId = $this->storeManager->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId(); } else { - $storeId = $this->_storeManager->getStore()->getId(); + $storeId = $this->storeManager->getStore()->getId(); } - $customer = $this->_customerBuilder->populate($customer)->setStoreId($storeId)->create(); + $customer = $this->customerBuilder->populate($customer) + ->setStoreId($storeId) + ->create(); } try { @@ -382,13 +404,13 @@ class CustomerAccountService implements CustomerAccountServiceInterface throw $e; } - $this->_customerAddressService->saveAddresses($customerId, $customerDetails->getAddresses()); - $customerModel = $this->_converter->getCustomerModel($customerId); - $newLinkToken = $this->_mathRandom->getUniqueHash(); + $this->customerAddressService->saveAddresses($customerId, $customerDetails->getAddresses()); + $customerModel = $this->customerRegistry->retrieve($customerId); + $newLinkToken = $this->mathRandom->getUniqueHash(); $customerModel->changeResetPasswordLinkToken($newLinkToken); $this->_sendEmailConfirmation($customerModel, $customer, $redirectUrl); - return $this->_converter->createCustomerFromModel($customerModel); + return $this->converter->createCustomerFromModel($customerModel); } /** @@ -417,7 +439,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface } } catch (MailException $e) { // If we are not able to send a new account email, this should be ignored - $this->_logger->logException($e); + $this->logger->logException($e); } } @@ -428,19 +450,19 @@ class CustomerAccountService implements CustomerAccountServiceInterface { $customer = $customerDetails->getCustomer(); // Making this call first will ensure the customer already exists. - $this->getCustomer($customer->getId()); + $this->customerRegistry->retrieve($customer->getId()); $this->saveCustomer( $customer, null, - $this->_converter->getCustomerModel($customer->getId())->getPasswordHash() + $this->converter->getCustomerModel($customer->getId())->getPasswordHash() ); $addresses = $customerDetails->getAddresses(); // If $address is null, no changes must made to the list of addresses // be careful $addresses != null would be true of $addresses is an empty array if ($addresses !== null) { - $existingAddresses = $this->_customerAddressService->getAddresses($customer->getId()); + $existingAddresses = $this->customerAddressService->getAddresses($customer->getId()); /** @var Data\Address[] $deletedAddresses */ $deletedAddresses = array_udiff( $existingAddresses, @@ -453,9 +475,9 @@ class CustomerAccountService implements CustomerAccountServiceInterface // If $addresses is an empty array, all addresses are removed. // array_udiff would return the entire $existing array foreach ($deletedAddresses as $address) { - $this->_customerAddressService->deleteAddress($address->getId()); + $this->customerAddressService->deleteAddress($address->getId()); } - $this->_customerAddressService->saveAddresses($customer->getId(), $addresses); + $this->customerAddressService->saveAddresses($customer->getId(), $addresses); } return true; @@ -464,14 +486,14 @@ class CustomerAccountService implements CustomerAccountServiceInterface /** * (@inheritdoc) */ - public function searchCustomers(Data\SearchCriteria $searchCriteria) + public function searchCustomers(SearchCriteria $searchCriteria) { - $this->_searchResultsBuilder->setSearchCriteria($searchCriteria); + $this->searchResultsBuilder->setSearchCriteria($searchCriteria); /** @var Collection $collection */ - $collection = $this->_customerFactory->create()->getCollection(); + $collection = $this->customerFactory->create()->getCollection(); // This is needed to make sure all the attributes are properly loaded - foreach ($this->_customerMetadataService->getAllCustomerAttributeMetadata() as $metadata) { + foreach ($this->customerMetadataService->getAllCustomerAttributeMetadata() as $metadata) { $collection->addAttributeToSelect($metadata->getAttributeCode()); } // Needed to enable filtering on name as a whole @@ -481,84 +503,49 @@ class CustomerAccountService implements CustomerAccountServiceInterface ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left') ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left') ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left') - ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left'); - $this->addFiltersFromRootToCollection($searchCriteria->getAndGroup(), $collection); - $this->_searchResultsBuilder->setTotalCount($collection->getSize()); + ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left') + ->joinAttribute('company', 'customer_address/company', 'default_billing', null, 'left'); + //Add filters from root filter group to the collection + foreach ($searchCriteria->getFilterGroups() as $group) { + $this->addFilterGroupToCollection($group, $collection); + } + $this->searchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); if ($sortOrders) { foreach ($searchCriteria->getSortOrders() as $field => $direction) { - $collection->addOrder($field, $direction == Data\SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); } } $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); - $customersDetails = array(); + $customersDetails = []; /** @var CustomerModel $customerModel */ foreach ($collection as $customerModel) { - $customer = $this->_converter->createCustomerFromModel($customerModel); - $addresses = $this->_customerAddressService->getAddresses($customer->getId()); - $customerDetails = $this->_customerDetailsBuilder->setCustomer( - $customer - )->setAddresses( - $addresses - )->create(); + $customer = $this->converter->createCustomerFromModel($customerModel); + $addresses = $this->customerAddressService->getAddresses($customer->getId()); + $customerDetails = $this->customerDetailsBuilder + ->setCustomer($customer)->setAddresses($addresses)->create(); $customersDetails[] = $customerDetails; } - $this->_searchResultsBuilder->setItems($customersDetails); - return $this->_searchResultsBuilder->create(); - } - - /** - * Adds some filters from the root filter group to a collection. - * - * @param Data\Search\AndGroup $rootAndGroup - * @param Collection $collection - * @return void - * @throws \Magento\Exception\InputException - */ - protected function addFiltersFromRootToCollection(Data\Search\AndGroup $rootAndGroup, Collection $collection) - { - if (count($rootAndGroup->getAndGroups())) { - throw new InputException('Only OR groups are supported as nested groups.'); - } - - foreach ($rootAndGroup->getFilters() as $filter) { - $this->addFilterToCollection($collection, $filter); - } - - foreach ($rootAndGroup->getOrGroups() as $group) { - $this->addFilterOrGroupToCollection($collection, $group); - } - } - - /** - * Helper function that adds a filter to the collection - * - * @param Collection $collection - * @param Filter $filter - * @return void - */ - protected function addFilterToCollection(Collection $collection, Filter $filter) - { - $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; - $collection->addFieldToFilter($filter->getField(), array($condition => $filter->getValue())); + $this->searchResultsBuilder->setItems($customersDetails); + return $this->searchResultsBuilder->create(); } /** * Helper function that adds a FilterGroup to the collection. * + * @param FilterGroup $filterGroup * @param Collection $collection - * @param Data\Search\OrGroup $orGroup * @return void * @throws \Magento\Exception\InputException */ - protected function addFilterOrGroupToCollection(Collection $collection, Data\Search\OrGroup $orGroup) + protected function addFilterGroupToCollection(FilterGroup $filterGroup, Collection $collection) { $fields = []; $conditions = []; - foreach ($orGroup->getFilters() as $filter) { + foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $fields[] = array('attribute' => $filter->getField(), $condition => $filter->getValue()); } @@ -568,11 +555,21 @@ class CustomerAccountService implements CustomerAccountServiceInterface } /** - * {@inheritdoc} - */ - public function saveCustomer(Data\Customer $customer, $password = null, $hash = null) - { - $customerModel = $this->_converter->createCustomerModel($customer); + * Create or update customer information + * + * @param \Magento\Customer\Service\V1\Data\Customer $customer + * @param string $password Plain text password + * @param string $hash Hashed password ready to be saved + * @throws \Magento\Customer\Exception If something goes wrong during save + * @throws \Magento\Exception\InputException If bad input is provided + * @return int customer ID + */ + protected function saveCustomer( + \Magento\Customer\Service\V1\Data\Customer $customer, + $password = null, + $hash = null + ) { + $customerModel = $this->converter->createCustomerModel($customer); // Priority: hash, password, auto generated password if ($hash) { @@ -586,8 +583,10 @@ class CustomerAccountService implements CustomerAccountServiceInterface } // Shouldn't we be calling validateCustomerData/Details here? - $this->_validate($customerModel); + $this->validate($customerModel); $customerModel->save(); + // Clear the customer from registry so that the updated one can be retrieved next time + $this->customerRegistry->remove($customerModel->getId()); return $customerModel->getId(); } @@ -597,8 +596,8 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function getCustomer($customerId) { - $customerModel = $this->_converter->getCustomerModel($customerId); - return $this->_converter->createCustomerFromModel($customerModel); + $customerModel = $this->customerRegistry->retrieve($customerId); + return $this->converter->createCustomerFromModel($customerModel); } /** @@ -606,7 +605,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function changePassword($customerId, $currentPassword, $newPassword) { - $customerModel = $this->_converter->getCustomerModel($customerId); + $customerModel = $this->customerRegistry->retrieve($customerId); if (!$customerModel->validatePassword($currentPassword)) { throw new AuthenticationException( __("Password doesn't match for this account."), @@ -626,42 +625,119 @@ class CustomerAccountService implements CustomerAccountServiceInterface */ public function getPasswordHash($password) { - return $this->_encryptor->getHash($password, true); + return $this->encryptor->getHash($password, true); } /** * {@inheritdoc} */ - public function validateCustomerData(Data\Customer $customer, array $attributes = array()) + public function validateCustomerData(Data\Customer $customer, array $attributes = []) { - $customerErrors = $this->_validator->validateData( + $customerErrors = $this->validator->validateData( \Magento\Service\DataObjectConverter::toFlatArray($customer), $attributes, 'customer' ); if ($customerErrors !== true) { - return $this->_customerValidationResultsBuilder + return $this->customerValidationResultsBuilder ->setIsValid(false) - ->setMessages($this->_validator->getMessages()) + ->setMessages($this->validator->getMessages()) ->create(); } - $customerModel = $this->_converter->createCustomerModel($customer); + $customerModel = $this->converter->createCustomerModel($customer); $result = $customerModel->validate(); if (true !== $result && is_array($result)) { - return $this->_customerValidationResultsBuilder + return $this->customerValidationResultsBuilder ->setIsValid(false) ->setMessages($result) ->create(); } - return $this->_customerValidationResultsBuilder + return $this->customerValidationResultsBuilder ->setIsValid(true) ->setMessages([]) ->create(); } + /** + * {@inheritdoc} + */ + public function canModify($customerId) + { + $customerModel = $this->customerRegistry->retrieve($customerId); + return !$customerModel->isReadonly(); + } + + /** + * {@inheritdoc} + */ + public function canDelete($customerId) + { + $customerModel = $this->customerRegistry->retrieve($customerId); + return $customerModel->isDeleteable(); + } + + /** + * {@inheritdoc} + */ + public function getCustomerDetails($customerId) + { + return $this->customerDetailsBuilder + ->setCustomer($this->getCustomer($customerId)) + ->setAddresses($this->customerAddressService->getAddresses($customerId)) + ->create(); + } + + /** + * {@inheritdoc} + */ + public function deleteCustomer($customerId) + { + $customerModel = $this->customerRegistry->retrieve($customerId); + foreach ($customerModel->getAddresses() as $addressModel) { + $this->addressRegistry->remove($addressModel->getId()); + } + $customerModel->delete(); + $this->customerRegistry->remove($customerId); + + return true; + } + + /** + * {@inheritdoc} + */ + public function isEmailAvailable($customerEmail, $websiteId = null) + { + try { + if (is_null($websiteId)) { + $websiteId = $this->storeManager->getStore()->getWebsiteId(); + } + $this->customerRegistry->retrieveByEmail($customerEmail, $websiteId); + return false; + } catch (NoSuchEntityException $e) { + return true; + } + } + + /** + * {@inheritDoc} + */ + public function isCustomerInStore($customerWebsiteId, $storeId) + { + $ids = []; + if ((bool)$this->configShare->isWebsiteScope()) { + $ids = $this->storeManager->getWebsite($customerWebsiteId)->getStoreIds(); + } else { + foreach ($this->storeManager->getStores() as $store) { + $ids[] = $store->getId(); + } + } + + return in_array($storeId, $ids); + } + /** * Validate customer attribute values. * @@ -672,7 +748,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - private function _validate(CustomerModel $customerModel) + private function validate(CustomerModel $customerModel) { $exception = new InputException(); if (!\Zend_Validate::is(trim($customerModel->getFirstname()), 'NotEmpty')) { @@ -687,17 +763,17 @@ class CustomerAccountService implements CustomerAccountServiceInterface $exception->addError(InputException::INVALID_FIELD_VALUE, 'email', $customerModel->getEmail()); } - $dob = $this->_getAttributeMetadata('dob'); + $dob = $this->getAttributeMetadata('dob'); if (!is_null($dob) && $dob->isRequired() && '' == trim($customerModel->getDob())) { $exception->addError(InputException::REQUIRED_FIELD, 'dob', ''); } - $taxvat = $this->_getAttributeMetadata('taxvat'); + $taxvat = $this->getAttributeMetadata('taxvat'); if (!is_null($taxvat) && $taxvat->isRequired() && '' == trim($customerModel->getTaxvat())) { $exception->addError(InputException::REQUIRED_FIELD, 'taxvat', ''); } - $gender = $this->_getAttributeMetadata('gender'); + $gender = $this->getAttributeMetadata('gender'); if (!is_null($gender) && $gender->isRequired() && '' == trim($customerModel->getGender())) { $exception->addError(InputException::REQUIRED_FIELD, 'gender', ''); } @@ -717,7 +793,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface * @throws \Magento\Exception\InputException If token or customer id is invalid * @throws \Magento\Exception\NoSuchEntityException If customer doesn't exist */ - private function _validateResetPasswordToken($customerId, $resetPasswordLinkToken) + private function validateResetPasswordToken($customerId, $resetPasswordLinkToken) { if (!is_int($customerId) || empty($customerId) || $customerId < 0) { throw InputException::create(InputException::INVALID_FIELD_VALUE, 'customerId', $customerId); @@ -730,7 +806,7 @@ class CustomerAccountService implements CustomerAccountServiceInterface ); } - $customerModel = $this->_converter->getCustomerModel($customerId); + $customerModel = $this->customerRegistry->retrieve($customerId); $customerToken = $customerModel->getRpToken(); if (strcmp($customerToken, $resetPasswordLinkToken) !== 0) { @@ -746,83 +822,12 @@ class CustomerAccountService implements CustomerAccountServiceInterface * @param string $attributeCode * @return Data\Eav\AttributeMetadata|null */ - private function _getAttributeMetadata($attributeCode) + private function getAttributeMetadata($attributeCode) { try { - return $this->_customerMetadataService->getCustomerAttributeMetadata($attributeCode); + return $this->customerMetadataService->getCustomerAttributeMetadata($attributeCode); } catch (NoSuchEntityException $e) { return null; } } - - /** - * {@inheritdoc} - */ - public function canModify($customerId) - { - $customerModel = $this->_converter->getCustomerModel($customerId); - return !$customerModel->isReadonly(); - } - - /** - * {@inheritdoc} - */ - public function canDelete($customerId) - { - $customerModel = $this->_converter->getCustomerModel($customerId); - return $customerModel->isDeleteable(); - } - - /** - * {@inheritdoc} - */ - public function getCustomerDetails($customerId) - { - return $this->_customerDetailsBuilder->setCustomer( - $this->getCustomer($customerId) - )->setAddresses( - $this->_customerAddressService->getAddresses($customerId) - )->create(); - } - - /** - * {@inheritdoc} - */ - public function deleteCustomer($customerId) - { - $customerModel = $this->_converter->getCustomerModel($customerId); - $customerModel->delete(); - - return true; - } - - /** - * {@inheritdoc} - */ - public function isEmailAvailable($customerEmail, $websiteId) - { - try { - $this->_converter->getCustomerModelByEmail($customerEmail, $websiteId); - return false; - } catch (NoSuchEntityException $e) { - return true; - } - } - - /** - * {@inheritDoc} - */ - public function isCustomerInStore($customerWebsiteId, $storeId) - { - $ids = []; - if ((bool)$this->_configShare->isWebsiteScope()) { - $ids = $this->_storeManager->getWebsite($customerWebsiteId)->getStoreIds(); - } else { - foreach ($this->_storeManager->getStores() as $store) { - $ids[] = $store->getId(); - } - } - - return in_array($storeId, $ids); - } } diff --git a/app/code/Magento/Customer/Service/V1/CustomerAccountServiceInterface.php b/app/code/Magento/Customer/Service/V1/CustomerAccountServiceInterface.php index c316570d251125b86c7cf84d5c5014b1df1b0c1a..f856ef8cd8876deada41d4d4447c44b0216042e5 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAccountServiceInterface.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAccountServiceInterface.php @@ -73,7 +73,7 @@ interface CustomerAccountServiceInterface * @throws \Magento\Exception\InputException If bad input is provided * @throws \Magento\Exception\StateException If the provided email is already used */ - public function createAccount( + public function createCustomer( \Magento\Customer\Service\V1\Data\CustomerDetails $customerDetails, $password = null, $hash = null, @@ -91,19 +91,6 @@ interface CustomerAccountServiceInterface */ public function updateCustomer(\Magento\Customer\Service\V1\Data\CustomerDetails $customerDetails); - /** - * Create or update customer information - * - * @param \Magento\Customer\Service\V1\Data\Customer $customer - * @param string $password Plain text password - * @param string $hash Hashed password ready to be saved - * @throws \Magento\Customer\Exception If something goes wrong during save - * @throws \Magento\Exception\InputException If bad input is provided - * @return int customer ID - * @deprecated use createAccount or updateCustomer instead - */ - public function saveCustomer(\Magento\Customer\Service\V1\Data\Customer $customer, $password = null, $hash = null); - /** * Retrieve Customer * @@ -129,11 +116,11 @@ interface CustomerAccountServiceInterface /** * Retrieve customers which match a specified criteria * - * @param \Magento\Customer\Service\V1\Data\SearchCriteria $searchCriteria + * @param \Magento\Service\V1\Data\SearchCriteria $searchCriteria * @throws \Magento\Exception\InputException if there is a problem with the input * @return \Magento\Customer\Service\V1\Data\SearchResults containing Data\CustomerDetails */ - public function searchCustomers(\Magento\Customer\Service\V1\Data\SearchCriteria $searchCriteria); + public function searchCustomers(\Magento\Service\V1\Data\SearchCriteria $searchCriteria); /** * Login a customer account using username and password @@ -183,12 +170,12 @@ interface CustomerAccountServiceInterface * Send an email to the customer with a password reset link. * * @param string $email - * @param int $websiteId * @param string $template Type of email to send. Must be one of the email constants. + * @param int $websiteId Optional id. If the website id is not provided + * it will be retrieved from the store manager * @return void - * @throws \Magento\Exception\NoSuchEntityException */ - public function initiatePasswordReset($email, $websiteId, $template); + public function initiatePasswordReset($email, $template, $websiteId = null); /** * Reset customer password. @@ -281,12 +268,10 @@ interface CustomerAccountServiceInterface * Check if the email has not been associated with a customer account in given website * * @param string $customerEmail - * @param int $websiteId + * @param int $websiteId If not set, will use the current websiteId * @return bool true if the email is not associated with a customer account in given website - * @throws \Magento\Exception\NoSuchEntityException If customer with email is not found - * @throws \Magento\Model\Exception If website was not specified */ - public function isEmailAvailable($customerEmail, $websiteId); + public function isEmailAvailable($customerEmail, $websiteId = null); /** * Check store availability for customer given the customerId diff --git a/app/code/Magento/Customer/Service/V1/CustomerAddressService.php b/app/code/Magento/Customer/Service/V1/CustomerAddressService.php index af184d3a5432ef1ac0f5fa1630444addd37bb4a1..5db2d338ad6c190557578f6de325f34aa11bba16 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerAddressService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerAddressService.php @@ -24,9 +24,10 @@ namespace Magento\Customer\Service\V1; use Magento\Customer\Model\Address as CustomerAddressModel; +use Magento\Customer\Model\Address\Converter as AddressConverter; +use Magento\Customer\Model\CustomerRegistry; use Magento\Exception\NoSuchEntityException; use Magento\Exception\InputException; -use Magento\Customer\Model\Address\Converter as AddressConverter; /** * Service related to Customer Address related functions @@ -36,45 +37,45 @@ use Magento\Customer\Model\Address\Converter as AddressConverter; class CustomerAddressService implements CustomerAddressServiceInterface { /** - * @var \Magento\Customer\Model\AddressFactory + * @var AddressConverter */ - private $_addressFactory; + private $addressConverter; /** - * @var \Magento\Customer\Model\Converter + * Directory data + * + * @var \Magento\Directory\Helper\Data */ - private $_converter; + protected $directoryData; /** - * @var AddressConverter + * @var \Magento\Customer\Model\AddressRegistry */ - private $_addressConverter; + protected $addressRegistry; /** - * Directory data - * - * @var \Magento\Directory\Helper\Data + * @var CustomerRegistry */ - protected $_directoryData; + protected $customerRegistry; /** * Constructor * - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\Converter $converter + * @param \Magento\Customer\Model\AddressRegistry $addressRegistry * @param AddressConverter $addressConverter + * @param CustomerRegistry $customerRegistry * @param \Magento\Directory\Helper\Data $directoryData */ public function __construct( - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\Converter $converter, + \Magento\Customer\Model\AddressRegistry $addressRegistry, AddressConverter $addressConverter, + CustomerRegistry $customerRegistry, \Magento\Directory\Helper\Data $directoryData ) { - $this->_addressFactory = $addressFactory; - $this->_converter = $converter; - $this->_addressConverter = $addressConverter; - $this->_directoryData = $directoryData; + $this->addressRegistry = $addressRegistry; + $this->addressConverter = $addressConverter; + $this->customerRegistry = $customerRegistry; + $this->directoryData = $directoryData; } /** @@ -82,8 +83,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function getAddresses($customerId) { - //TODO: use cache MAGETWO-16862 - $customer = $this->_converter->getCustomerModel($customerId); + $customer = $this->customerRegistry->retrieve($customerId); $addresses = $customer->getAddresses(); $defaultBillingId = $customer->getDefaultBilling(); $defaultShippingId = $customer->getDefaultShipping(); @@ -91,7 +91,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface $result = array(); /** @var $address CustomerAddressModel */ foreach ($addresses as $address) { - $result[] = $this->_addressConverter->createAddressFromModel( + $result[] = $this->addressConverter->createAddressFromModel( $address, $defaultBillingId, $defaultShippingId @@ -105,13 +105,12 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function getDefaultBillingAddress($customerId) { - //TODO: use cache MAGETWO-16862 - $customer = $this->_converter->getCustomerModel($customerId); + $customer = $this->customerRegistry->retrieve($customerId); $address = $customer->getDefaultBillingAddress(); if ($address === false) { return null; } - return $this->_addressConverter->createAddressFromModel( + return $this->addressConverter->createAddressFromModel( $address, $customer->getDefaultBilling(), $customer->getDefaultShipping() @@ -123,13 +122,12 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function getDefaultShippingAddress($customerId) { - //TODO: use cache MAGETWO-16862 - $customer = $this->_converter->getCustomerModel($customerId); + $customer = $this->customerRegistry->retrieve($customerId); $address = $customer->getDefaultShippingAddress(); if ($address === false) { return null; } - return $this->_addressConverter->createAddressFromModel( + return $this->addressConverter->createAddressFromModel( $address, $customer->getDefaultBilling(), $customer->getDefaultShipping() @@ -141,16 +139,10 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function getAddress($addressId) { - //TODO: use cache MAGETWO-16862 - $address = $this->_addressFactory->create(); - $address->load($addressId); - if (!$address->getId()) { - throw new NoSuchEntityException('addressId', $addressId); - } - - $customer = $this->_converter->getCustomerModel($address->getCustomerId()); + $address = $this->addressRegistry->retrieve($addressId); + $customer = $this->customerRegistry->retrieve($address->getCustomerId()); - return $this->_addressConverter->createAddressFromModel( + return $this->addressConverter->createAddressFromModel( $address, $customer->getDefaultBilling(), $customer->getDefaultShipping() @@ -162,14 +154,10 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function deleteAddress($addressId) { - $address = $this->_addressFactory->create(); - $address->load($addressId); - - if (!$address->getId()) { - throw new NoSuchEntityException('addressId', $addressId); - } - + $address = $this->addressRegistry->retrieve($addressId); $address->delete(); + $this->addressRegistry->remove($addressId); + return true; } @@ -178,8 +166,8 @@ class CustomerAddressService implements CustomerAddressServiceInterface */ public function saveAddresses($customerId, $addresses) { - $customerModel = $this->_converter->getCustomerModel($customerId); - $addressModels = array(); + $customerModel = $this->customerRegistry->retrieve($customerId); + $addressModels = []; $inputException = new InputException(); for ($i = 0; $i < count($addresses); $i++) { @@ -188,15 +176,20 @@ class CustomerAddressService implements CustomerAddressServiceInterface if ($address->getId()) { $addressModel = $customerModel->getAddressItemById($address->getId()); } + if (is_null($addressModel)) { - $addressModel = $this->_addressFactory->create(); + $addressModel = $this->addressConverter->createAddressModel($address); $addressModel->setCustomer($customerModel); + } else { + $this->addressConverter->updateAddressModel($addressModel, $address); } - $this->_addressConverter->updateAddressModel($addressModel, $address); $inputException = $this->_validate($addressModel, $inputException, $i); $addressModels[] = $addressModel; } + + $this->customerRegistry->remove($customerId); + if ($inputException->getErrors()) { throw $inputException; } @@ -205,6 +198,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface /** @var \Magento\Customer\Model\Address $addressModel */ foreach ($addressModels as $addressModel) { $addressModel->save(); + $this->addressRegistry->remove($addressModel->getId()); $addressIds[] = $addressModel->getId(); } @@ -218,7 +212,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface { $inputException = new InputException(); foreach ($addresses as $key => $address) { - $addressModel = $this->_addressConverter->createAddressModel($address); + $addressModel = $this->addressConverter->createAddressModel($address); $inputException = $this->_validate($addressModel, $inputException, $key); } if ($inputException->getErrors()) { @@ -264,7 +258,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface $exception->addError(InputException::REQUIRED_FIELD, 'telephone', null, array('index' => $index)); } - $_havingOptionalZip = $this->_directoryData->getCountriesWithOptionalZip(); + $_havingOptionalZip = $this->directoryData->getCountriesWithOptionalZip(); if (!in_array( $customerAddressModel->getCountryId(), $_havingOptionalZip @@ -283,7 +277,7 @@ class CustomerAddressService implements CustomerAddressServiceInterface if ($customerAddressModel->getCountryModel()->getRegionCollection()->getSize() && !\Zend_Validate::is( $customerAddressModel->getRegionId(), 'NotEmpty' - ) && $this->_directoryData->isRegionRequired( + ) && $this->directoryData->isRegionRequired( $customerAddressModel->getCountryId() ) ) { diff --git a/app/code/Magento/Customer/Service/V1/CustomerCurrentService.php b/app/code/Magento/Customer/Service/V1/CustomerCurrentService.php index e09feadbd4498beaf35f32b21555e8c163ddd2fb..49264264aa9c0ca358bde4894b2b46a6c7de9412 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerCurrentService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerCurrentService.php @@ -49,7 +49,7 @@ class CustomerCurrentService implements \Magento\Customer\Service\V1\CustomerCur protected $customerAccountService; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -63,18 +63,18 @@ class CustomerCurrentService implements \Magento\Customer\Service\V1\CustomerCur * @param \Magento\View\LayoutInterface $layout * @param Data\CustomerBuilder $customerBuilder * @param CustomerAccountServiceInterface $customerAccountService - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Module\Manager $moduleManager - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view */ public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\View\LayoutInterface $layout, \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder, \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Module\Manager $moduleManager, - \Magento\App\ViewInterface $view + \Magento\Framework\App\ViewInterface $view ) { $this->customerSession = $customerSession; $this->layout = $layout; diff --git a/app/code/Magento/Customer/Service/V1/CustomerGroupService.php b/app/code/Magento/Customer/Service/V1/CustomerGroupService.php index 6d72cf418a7e9b2b6c74b6b2147ca2853c64bea6..c20e41e01aacdfb8de154fc470707a1665e1d970 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerGroupService.php +++ b/app/code/Magento/Customer/Service/V1/CustomerGroupService.php @@ -25,13 +25,19 @@ */ namespace Magento\Customer\Service\V1; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\Customer\Model\Group as CustomerGroupModel; use Magento\Customer\Model\GroupFactory; +use Magento\Customer\Model\GroupRegistry; use Magento\Customer\Model\Resource\Group\Collection; +use Magento\Customer\Service\V1\Data\CustomerGroup; +use Magento\Service\V1\Data\Search\FilterGroup; use Magento\Exception\InputException; use Magento\Exception\NoSuchEntityException; use Magento\Exception\StateException; use Magento\Service\V1\Data\Filter; +use Magento\Service\V1\Data\SearchCriteria; use Magento\Tax\Model\ClassModel as TaxClassModel; use Magento\Tax\Model\ClassModelFactory as TaxClassModelFactory; @@ -48,10 +54,15 @@ class CustomerGroupService implements CustomerGroupServiceInterface private $_groupFactory; /** - * @var Scope Config + * @var ScopeConfigInterface */ private $_scopeConfig; + /** + * @var StoreManagerInterface + */ + private $_storeManager; + /** * @var Data\SearchResultsBuilder */ @@ -67,6 +78,11 @@ class CustomerGroupService implements CustomerGroupServiceInterface */ private $_taxClassModelFactory; + /** + * @var GroupRegistry + */ + private $_groupRegistry; + /** * The default tax class id if no tax class id is specified */ @@ -74,23 +90,29 @@ class CustomerGroupService implements CustomerGroupServiceInterface /** * @param GroupFactory $groupFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param ScopeConfigInterface $scopeConfig + * @param StoreManagerInterface $storeManager * @param Data\SearchResultsBuilder $searchResultsBuilder * @param Data\CustomerGroupBuilder $customerGroupBuilder - * @param TaxClassModelFactory $taxClassModel + * @param TaxClassModelFactory $taxClassModelFactory + * @param GroupRegistry $groupRegistry */ public function __construct( GroupFactory $groupFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + ScopeConfigInterface $scopeConfig, + StoreManagerInterface $storeManager, Data\SearchResultsBuilder $searchResultsBuilder, Data\CustomerGroupBuilder $customerGroupBuilder, - TaxClassModelFactory $taxClassModelFactory + TaxClassModelFactory $taxClassModelFactory, + GroupRegistry $groupRegistry ) { $this->_groupFactory = $groupFactory; $this->_scopeConfig = $scopeConfig; + $this->_storeManager = $storeManager; $this->_searchResultsBuilder = $searchResultsBuilder; $this->_customerGroupBuilder = $customerGroupBuilder; $this->_taxClassModelFactory = $taxClassModelFactory; + $this->_groupRegistry = $groupRegistry; } /** @@ -105,7 +127,7 @@ class CustomerGroupService implements CustomerGroupServiceInterface $collection->setRealGroupsFilter(); } if (!is_null($taxClassId)) { - $collection->addFieldToFilter('tax_class_id', $taxClassId); + $collection->addFieldToFilter(CustomerGroup::TAX_CLASS_ID, $taxClassId); } /** @var CustomerGroupModel $group */ foreach ($collection as $group) { @@ -120,20 +142,23 @@ class CustomerGroupService implements CustomerGroupServiceInterface /** * {@inheritdoc} */ - public function searchGroups(Data\SearchCriteria $searchCriteria) + public function searchGroups(SearchCriteria $searchCriteria) { $this->_searchResultsBuilder->setSearchCriteria($searchCriteria); $groups = array(); /** @var Collection $collection */ - $collection = $this->_groupFactory->create()->getCollection(); - $this->addFiltersFromRootToCollection($searchCriteria->getAndGroup(), $collection); + $collection = $this->_groupFactory->create()->getCollection()->addTaxClass(); + //Add filters from root filter group to the collection + foreach ($searchCriteria->getFilterGroups() as $group) { + $this->addFilterGroupToCollection($group, $collection); + } $this->_searchResultsBuilder->setTotalCount($collection->getSize()); $sortOrders = $searchCriteria->getSortOrders(); if ($sortOrders) { foreach ($searchCriteria->getSortOrders() as $field => $direction) { $field = $this->translateField($field); - $collection->addOrder($field, $direction == Data\SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); + $collection->addOrder($field, $direction == SearchCriteria::SORT_ASC ? 'ASC' : 'DESC'); } } $collection->setCurPage($searchCriteria->getCurrentPage()); @@ -141,13 +166,11 @@ class CustomerGroupService implements CustomerGroupServiceInterface /** @var CustomerGroupModel $group */ foreach ($collection as $group) { - $this->_customerGroupBuilder->setId( - $group->getId() - )->setCode( - $group->getCode() - )->setTaxClassId( - $group->getTaxClassId() - ); + $this->_customerGroupBuilder + ->setId($group->getId()) + ->setCode($group->getCode()) + ->setTaxClassId($group->getTaxClassId()) + ->setTaxClassName($group->getClassName()); $groups[] = $this->_customerGroupBuilder->create(); } $this->_searchResultsBuilder->setItems($groups); @@ -155,55 +178,18 @@ class CustomerGroupService implements CustomerGroupServiceInterface } /** - * Adds some filters from a root filter group to a collection. + * Helper function that adds a FilterGroup to the collection. * - * @param Data\Search\AndGroup $rootAndGroup + * @param FilterGroup $filterGroup * @param Collection $collection * @return void * @throws \Magento\Exception\InputException */ - protected function addFiltersFromRootToCollection(Data\Search\AndGroup $rootAndGroup, Collection $collection) - { - if (count($rootAndGroup->getAndGroups())) { - throw new InputException('Only OR groups are supported as nested groups.'); - } - - foreach ($rootAndGroup->getFilters() as $filter) { - $this->addFilterToCollection($collection, $filter); - } - - foreach ($rootAndGroup->getOrGroups() as $group) { - $this->addOrFilterGroupToCollection($collection, $group); - } - } - - /** - * Helper function that adds a filter to the collection - * - * @param Collection $collection - * @param Filter $filter - * @return void - */ - protected function addFilterToCollection(Collection $collection, Filter $filter) - { - $field = $this->translateField($filter->getField()); - $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; - $collection->addFieldToFilter($field, [$condition => $filter->getValue()]); - } - - /** - * Helper function that adds a OrGroup to the collection. - * - * @param Collection $collection - * @param Data\Search\OrGroup $orGroup - * @return void - * @throws \Magento\Exception\InputException - */ - protected function addOrFilterGroupToCollection(Collection $collection, Data\Search\OrGroup $orGroup) + protected function addFilterGroupToCollection(FilterGroup $filterGroup, Collection $collection) { $fields = []; $conditions = []; - foreach ($orGroup->getFilters() as $filter) { + foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $fields[] = $this->translateField($filter->getField()); $conditions[] = [$condition => $filter->getValue()]; @@ -222,9 +208,9 @@ class CustomerGroupService implements CustomerGroupServiceInterface protected function translateField($field) { switch ($field) { - case 'code': + case CustomerGroup::CODE: return 'customer_group_code'; - case 'id': + case CustomerGroup::ID: return 'customer_group_id'; default: return $field; @@ -236,12 +222,7 @@ class CustomerGroupService implements CustomerGroupServiceInterface */ public function getGroup($groupId) { - $customerGroup = $this->_groupFactory->create(); - $customerGroup->load($groupId); - // Throw exception if a customer group does not exist - if (is_null($customerGroup->getId())) { - throw new NoSuchEntityException('groupId', $groupId); - } + $customerGroup = $this->_groupRegistry->retrieve($groupId); $this->_customerGroupBuilder->setId($customerGroup->getId()) ->setCode($customerGroup->getCode()) ->setTaxClassId($customerGroup->getTaxClassId()); @@ -251,8 +232,11 @@ class CustomerGroupService implements CustomerGroupServiceInterface /** * {@inheritdoc} */ - public function getDefaultGroup($storeId) + public function getDefaultGroup($storeId = null) { + if (is_null($storeId)) { + $storeId = $this->_storeManager->getCurrentStore(); + } try { $groupId = $this->_scopeConfig->getValue( CustomerGroupModel::XML_PATH_DEFAULT_ID, @@ -275,14 +259,7 @@ class CustomerGroupService implements CustomerGroupServiceInterface */ public function canDelete($groupId) { - $customerGroup = $this->_groupFactory->create(); - $customerGroup->load($groupId); - - // Throw exception if a customer group does not exist - if (is_null($customerGroup->getId())) { - throw new NoSuchEntityException('groupId', $groupId); - } - + $customerGroup = $this->_groupRegistry->retrieve($groupId); return $groupId > 0 && !$customerGroup->usesAsDefault(); } @@ -295,15 +272,20 @@ class CustomerGroupService implements CustomerGroupServiceInterface throw InputException::create(InputException::INVALID_FIELD_VALUE, 'code', $group->getCode()); } - $customerGroup = $this->_groupFactory->create(); - if ($group->getId()) { - $customerGroup->load($group->getId()); + $customerGroup = null; - // Throw exception if the customer group does not exist - if (is_null($customerGroup->getId())) { + if ($group->getId()) { + try { + $customerGroup = $this->_groupRegistry->retrieve($group->getId()); + } catch (NoSuchEntityException $e) { throw new NoSuchEntityException('id', $group->getId()); } } + + if (!$customerGroup) { + $customerGroup = $this->_groupFactory->create(); + } + $customerGroup->setCode($group->getCode()); $taxClassId = $group->getTaxClassId(); @@ -364,6 +346,7 @@ class CustomerGroupService implements CustomerGroupServiceInterface $customerGroup = $this->_groupFactory->create(); $customerGroup->setId($groupId); $customerGroup->delete(); + $this->_groupRegistry->remove($groupId); return true; } } diff --git a/app/code/Magento/Customer/Service/V1/CustomerGroupServiceInterface.php b/app/code/Magento/Customer/Service/V1/CustomerGroupServiceInterface.php index d4c6fc48c939a7f6ac97f76a4ae7d31e63c8547a..2d73fe79e25100f019a3371acb5bcbea42e6c043 100644 --- a/app/code/Magento/Customer/Service/V1/CustomerGroupServiceInterface.php +++ b/app/code/Magento/Customer/Service/V1/CustomerGroupServiceInterface.php @@ -50,11 +50,11 @@ interface CustomerGroupServiceInterface /** * Search groups * - * @param \Magento\Customer\Service\V1\Data\SearchCriteria $searchCriteria + * @param \Magento\Service\V1\Data\SearchCriteria $searchCriteria * @throws \Magento\Exception\InputException If there is a problem with the input * @return \Magento\Customer\Service\V1\Data\SearchResults containing Data\CustomerGroup objects */ - public function searchGroups(\Magento\Customer\Service\V1\Data\SearchCriteria $searchCriteria); + public function searchGroups(\Magento\Service\V1\Data\SearchCriteria $searchCriteria); /** * Get a customer group by group ID. @@ -68,17 +68,17 @@ interface CustomerGroupServiceInterface /** * Get default group * - * @param int $storeId + * @param int $storeId Defaults the current store * @throws \Magento\Exception\NoSuchEntityException If default group for $storeId is not found * @return \Magento\Customer\Service\V1\Data\CustomerGroup */ - public function getDefaultGroup($storeId); + public function getDefaultGroup($storeId = null); /** * Check if the group can be deleted * * @param int $groupId - * @throws \Magento\Exception\NoSuchEntityException If $groupId is not found + * @throws \Magento\Exception\NoSuchEntityException If group is not found * @return bool True, if this group can be deleted */ public function canDelete($groupId); diff --git a/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php b/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php index 636e0ae02ea0e0f257d0b2885f0f01bddb8dc2d3..49461946628243355ce402f4c7903036b92ebb4d 100644 --- a/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/CustomerBuilder.php @@ -28,7 +28,7 @@ use Magento\Customer\Service\V1\CustomerMetadataServiceInterface; /** * Builder for the Customer Service Data Object * - * @method \Magento\Customer\Service\V1\Data\Customer create() + * @method Customer create() */ class CustomerBuilder extends \Magento\Service\Data\EAV\AbstractObjectBuilder { @@ -84,7 +84,7 @@ class CustomerBuilder extends \Magento\Service\Data\EAV\AbstractObjectBuilder /** * Set confirmation - * + * * @param string $confirmation * @return $this */ diff --git a/app/code/Magento/Customer/Service/V1/Data/CustomerGroup.php b/app/code/Magento/Customer/Service/V1/Data/CustomerGroup.php index 517d0ed05950f5b6eb814db72433b891ce9ea55d..af9fd5fba299fc0fa4e98f3f4852380488aa0a4c 100644 --- a/app/code/Magento/Customer/Service/V1/Data/CustomerGroup.php +++ b/app/code/Magento/Customer/Service/V1/Data/CustomerGroup.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; /** @@ -28,6 +29,13 @@ namespace Magento\Customer\Service\V1\Data; */ class CustomerGroup extends \Magento\Service\Data\AbstractObject { + /**#@+ + * Constants for Data Object keys + */ + const ID = 'id'; + const CODE = 'code'; + const TAX_CLASS_ID = 'tax_class_id'; + /** * Get id * @@ -35,7 +43,7 @@ class CustomerGroup extends \Magento\Service\Data\AbstractObject */ public function getId() { - return $this->_get('id'); + return $this->_get(self::ID); } /** @@ -45,7 +53,7 @@ class CustomerGroup extends \Magento\Service\Data\AbstractObject */ public function getCode() { - return $this->_get('code'); + return $this->_get(self::CODE); } /** @@ -55,6 +63,16 @@ class CustomerGroup extends \Magento\Service\Data\AbstractObject */ public function getTaxClassId() { - return $this->_get('tax_class_id'); + return $this->_get(self::TAX_CLASS_ID); + } + + /** + * Retrieve tax class name + * + * @return string|null + */ + public function getTaxClassName() + { + return $this->_get('tax_class_name'); } } diff --git a/app/code/Magento/Customer/Service/V1/Data/CustomerGroupBuilder.php b/app/code/Magento/Customer/Service/V1/Data/CustomerGroupBuilder.php index 8dbb74e0da2c90ae016788424663ac6a04737b5e..1d48c1892427671993400c818c7c6f161c20aa38 100644 --- a/app/code/Magento/Customer/Service/V1/Data/CustomerGroupBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/CustomerGroupBuilder.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; /** @@ -38,7 +39,7 @@ class CustomerGroupBuilder extends \Magento\Service\Data\AbstractObjectBuilder */ public function setId($id) { - return $this->_set('id', $id); + return $this->_set(CustomerGroup::ID, $id); } /** @@ -49,7 +50,7 @@ class CustomerGroupBuilder extends \Magento\Service\Data\AbstractObjectBuilder */ public function setCode($code) { - return $this->_set('code', $code); + return $this->_set(CustomerGroup::CODE, $code); } /** @@ -60,6 +61,17 @@ class CustomerGroupBuilder extends \Magento\Service\Data\AbstractObjectBuilder */ public function setTaxClassId($taxClassId) { - return $this->_set('tax_class_id', $taxClassId); + return $this->_set(CustomerGroup::TAX_CLASS_ID, $taxClassId); + } + + /** + * Set tax class name + * + * @param string $taxClassName + * @return $this + */ + public function setTaxClassName($taxClassName) + { + return $this->_set('tax_class_name', $taxClassName); } } diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroup.php b/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroup.php deleted file mode 100644 index 589e74824061a7e573d245748443969292b70ed6..0000000000000000000000000000000000000000 --- a/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroup.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Customer\Service\V1\Data\Search; - -use Magento\Service\Data\AbstractObject; - -/** - * Groups two or more filters together using a logical group type - */ -abstract class AbstractFilterGroup extends AbstractObject -{ - const FILTERS = 'filters'; - const AND_GROUPS = 'andGroups'; - const OR_GROUPS = 'orGroups'; - - /** - * Returns a list of filters in this group - * - * @return \Magento\Service\V1\Data\Filter[]|null - */ - public function getFilters() - { - $filters = $this->_get(self::FILTERS); - return is_null($filters) ? [] : $filters; - } - - /** - * Returns a list of filter groups in this group - * - * @return \Magento\Customer\Service\V1\Data\Search\AndGroup[]|null - */ - public function getAndGroups() - { - $groups = $this->_get(self::AND_GROUPS); - return is_null($groups) ? [] : $groups; - } - - /** - * Returns a list of filter groups in this group - * - * @return \Magento\Customer\Service\V1\Data\Search\OrGroup[]|null - */ - public function getOrGroups() - { - $groups = $this->_get(self::OR_GROUPS); - return is_null($groups) ? [] : $groups; - } -} diff --git a/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroupBuilder.php b/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroupBuilder.php deleted file mode 100644 index 469d1c76656f4bba8af03e5f05f9fdbfad567123..0000000000000000000000000000000000000000 --- a/app/code/Magento/Customer/Service/V1/Data/Search/AbstractFilterGroupBuilder.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Customer\Service\V1\Data\Search; - -use Magento\Service\Data\AbstractObjectBuilder; -use Magento\Service\V1\Data\Filter; -use Magento\Service\V1\Data\FilterBuilder; - -/** - * Abstract Builder for AbstractFilterGroup DATA. - */ -abstract class AbstractFilterGroupBuilder extends AbstractObjectBuilder -{ - /** - * @var FilterBuilder - */ - protected $_filterBuilder; - - /** - * Constructor - * - * @param FilterBuilder $filterBuilder - */ - public function __construct(FilterBuilder $filterBuilder) - { - parent::__construct(); - $this->_filterBuilder = $filterBuilder; - } - - /** - * Add filter - * - * @param Filter $filter - * @return $this - */ - public function addFilter(\Magento\Service\V1\Data\Filter $filter) - { - return $this->setFilterGroupData(AbstractFilterGroup::FILTERS, $filter); - } - - /** - * Set filters - * - * @param Filter[] $filters - * @return $this - */ - public function setFilters($filters) - { - return $this->_set(AbstractFilterGroup::FILTERS, $filters); - } - - /** - * Add And filter group - * - * @param AndGroup $group - * @return $this - */ - public function addAndGroup(\Magento\Customer\Service\V1\Data\Search\AndGroup $group) - { - return $this->setFilterGroupData(AbstractFilterGroup::AND_GROUPS, $group); - - } - - /** - * Add Or filter group - * - * @param OrGroup $group - * @return $this - */ - public function addOrGroup(\Magento\Customer\Service\V1\Data\Search\OrGroup $group) - { - return $this->setFilterGroupData(AbstractFilterGroup::OR_GROUPS, $group); - } - - /** - * Set filter groups - * - * @param AndGroup[] $groups - * @return $this - */ - public function setAndGroups($groups) - { - return $this->_set(AbstractFilterGroup::AND_GROUPS, $groups); - } - - /** - * Set filter groups - * - * @param OrGroup[] $groups - * @return $this - */ - public function setOrGroups($groups) - { - return $this->_set(AbstractFilterGroup::OR_GROUPS, $groups); - } - - /** - * Set filter or group data - * - * @param string $key - * @param Filter|AbstractFilterGroup $data - * @return $this - */ - private function setFilterGroupData($key, $data) - { - if (!isset($this->_data[$key]) - || !is_array($this->_data[$key]) - ) { - $this->_data[$key] = []; - } - $this->_data[$key][] = $data; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function _setDataValues(array $data) - { - $newData = []; - if (isset($data[AbstractFilterGroup::FILTERS])) { - $filters = []; - foreach ($data[AbstractFilterGroup::FILTERS] as $filter) { - $filters[] = $this->_filterBuilder->populateWithArray($filter)->create(); - } - $newData[AbstractFilterGroup::FILTERS] = $filters; - } - if (isset($data[AbstractFilterGroup::AND_GROUPS])) { - $andGroups = []; - foreach ($data[AbstractFilterGroup::AND_GROUPS] as $andGroup) { - $andGroups[] = (new AndGroupBuilder(new FilterBuilder()))->populateWithArray($andGroup)->create(); - } - $newData[AbstractFilterGroup::AND_GROUPS] = $andGroups; - } - if (isset($data[AbstractFilterGroup::OR_GROUPS])) { - $orGroups = []; - foreach ($data[AbstractFilterGroup::OR_GROUPS] as $orGroup) { - $orGroups[] = (new OrGroupBuilder(new FilterBuilder()))->populateWithArray($orGroup)->create(); - } - $newData[AbstractFilterGroup::OR_GROUPS] = $orGroups; - } - return parent::_setDataValues($newData); - } -} diff --git a/app/code/Magento/Customer/Service/V1/Data/SearchResults.php b/app/code/Magento/Customer/Service/V1/Data/SearchResults.php index 69ba19709e192770baefc853a8068e24585ceda9..a872b93a528c86fe66526a9236481ba48111ce9c 100644 --- a/app/code/Magento/Customer/Service/V1/Data/SearchResults.php +++ b/app/code/Magento/Customer/Service/V1/Data/SearchResults.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; /** @@ -31,7 +32,7 @@ class SearchResults extends \Magento\Service\Data\AbstractObject /** * Get items * - * @return \Magento\Service\Data\AbstractObject[] + * @return \Magento\Customer\Service\V1\Data\CustomerDetails[] */ public function getItems() { @@ -41,7 +42,7 @@ class SearchResults extends \Magento\Service\Data\AbstractObject /** * Get search criteria * - * @return \Magento\Customer\Service\V1\Data\SearchCriteria + * @return \Magento\Service\V1\Data\SearchCriteria */ public function getSearchCriteria() { diff --git a/app/code/Magento/Customer/Service/V1/Data/SearchResultsBuilder.php b/app/code/Magento/Customer/Service/V1/Data/SearchResultsBuilder.php index 0e815ceb759895682272581e0501207d0cbcf396..7f001511e9b4f91fade6dabe4d1f66dad134e784 100644 --- a/app/code/Magento/Customer/Service/V1/Data/SearchResultsBuilder.php +++ b/app/code/Magento/Customer/Service/V1/Data/SearchResultsBuilder.php @@ -21,8 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1\Data; +use Magento\Service\V1\Data\SearchCriteria; + /** * Builder for the SearchResults Service Data Object * @@ -33,7 +36,7 @@ class SearchResultsBuilder extends \Magento\Service\Data\AbstractObjectBuilder /** * Set search criteria * - * @param \Magento\Customer\Service\V1\Data\SearchCriteria $searchCriteria + * @param SearchCriteria $searchCriteria * @return $this */ public function setSearchCriteria(SearchCriteria $searchCriteria) @@ -55,7 +58,7 @@ class SearchResultsBuilder extends \Magento\Service\Data\AbstractObjectBuilder /** * Set items * - * @param \Magento\Service\Data\AbstractObject[] $items + * @param \Magento\Customer\Service\V1\Data\CustomerDetails[] $items * @return $this */ public function setItems($items) diff --git a/app/code/Magento/Customer/etc/adminhtml/routes.xml b/app/code/Magento/Customer/etc/adminhtml/routes.xml index 7073a2c25c5c8c324a7b70d38fac3fb6d701e0ee..886bb90056c5d1b11475da0096e1d101396a5be7 100644 --- a/app/code/Magento/Customer/etc/adminhtml/routes.xml +++ b/app/code/Magento/Customer/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="customer" frontName="customer"> <module name="Magento_Customer" /> diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index 307bcd50647887277d5c5cbb3f4fa30f3c3f78f2..e70140858ca3dbd9df5794e162ac5dd9df5aa59f 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -74,7 +74,6 @@ <type name="Magento\Customer\Service\V1\Data\Eav\OptionBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\RegionBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\Response\CreateCustomerAccountResponseBuilder" shared="false" /> - <type name="Magento\Customer\Service\V1\Data\SearchCriteriaBuilder" shared="false" /> <type name="Magento\Customer\Service\V1\Data\SearchResultsBuilder" shared="false" /> <type name="Magento\Eav\Model\Entity\Setup\PropertyMapper\Composite"> <arguments> diff --git a/app/code/Magento/Customer/etc/frontend/di.xml b/app/code/Magento/Customer/etc/frontend/di.xml index 927076faa85bb22bac553ff81b6c7d91886a1ac0..cc8337c463121674ca6623d35aaf4701cd990aaf 100644 --- a/app/code/Magento/Customer/etc/frontend/di.xml +++ b/app/code/Magento/Customer/etc/frontend/di.xml @@ -40,7 +40,7 @@ <plugin name="customer-session-depersonalize" type="Magento\Customer\Model\Layout\DepersonalizePlugin" sortOrder="10"/> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="customer-app-action-dispatchController-context-plugin" type="Magento\Customer\Model\App\Action\ContextPlugin" sortOrder="10"/> </type> diff --git a/app/code/Magento/Customer/etc/frontend/routes.xml b/app/code/Magento/Customer/etc/frontend/routes.xml index 1b02980dea0ae443d3ddcd21b7b56d4b4c727b84..5451e972a17d5beb186a4ae16eecfcd51645fc6b 100644 --- a/app/code/Magento/Customer/etc/frontend/routes.xml +++ b/app/code/Magento/Customer/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="customer" frontName="customer"> <module name="Magento_Customer" /> diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index bc7c685bfde23b8bc4e8e8939b18118657609d50..966a202709e203a209c4b5cc248eae4f1d9627e4 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -23,54 +23,256 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> - <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" baseUrl="/V1/customerGroup"> - <rest-route httpMethod="GET" method="getGroup" resources="Magento_Customer::group">/:groupId</rest-route> - <rest-route httpMethod="GET" method="getGroups" resources="Magento_Customer::group"></rest-route> - <rest-route httpMethod="GET" method="getDefaultGroup" resources="Magento_Customer::group">/default/:storeId</rest-route> - <rest-route httpMethod="GET" method="canDelete" resources="Magento_Customer::group">/canDelete/:groupId</rest-route> - <rest-route httpMethod="PUT" method="saveGroup" resources="Magento_Customer::group"></rest-route> - <rest-route httpMethod="DELETE" method="deleteGroup" resources="Magento_Customer::group">/:groupId</rest-route> - </service> - <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" baseUrl="/V1/customerMetadata"> - <rest-route httpMethod="GET" method="getAttributeMetadata" resources="Magento_Customer::customer">/:entityType/entity/:attributeCode/attribute</rest-route> - <rest-route httpMethod="GET" method="getAllAttributeSetMetadata" resources="Magento_Customer::customer">/:entityType/entity/:attributeSetId/attributeSet/:storeId/store</rest-route> - <rest-route httpMethod="GET" method="getAttributes" resources="Magento_Customer::customer">/:entityType/entity/:formCode/form</rest-route> - <rest-route httpMethod="GET" method="getCustomerAttributeMetadata" resources="Magento_Customer::customer">/customer/:attributeCode/attribute</rest-route> - <rest-route httpMethod="GET" method="getAllCustomerAttributeMetadata" resources="Magento_Customer::customer">/customer</rest-route> - <rest-route httpMethod="GET" method="getAddressAttributeMetadata" resources="Magento_Customer::customer">/address/:attributeCode/attribute</rest-route> - <rest-route httpMethod="GET" method="getAllAddressAttributeMetadata" resources="Magento_Customer::customer">/address</rest-route> - </service> - <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" baseUrl="/V1/customerAccounts"> - <!-- TODO: changePassword is a case of SELF. Need to revisit. For now manage is assigned --> - <!-- TODO: createAccount, authenticate, validateResetPasswordLinkToken, initiatePasswordReset, resetPassword, resendConfirmation apis - can be accessed anonymously and need no resources to be assigned. Webapi framework doesn't support support that as yet. - Adding Magento_Customer::customer temporarily until handling anonymous users is finalized --> - <rest-route httpMethod="POST" method="createAccount" resources="Magento_Customer::customer"></rest-route> - <rest-route httpMethod="PUT" method="updateCustomer" resources="Magento_Customer::manage"></rest-route> - <rest-route httpMethod="GET" method="getCustomerDetails" resources="Magento_Customer::customer">/:customerId</rest-route> - <rest-route httpMethod="GET" method="getCustomer" resources="Magento_Customer::customer">/:customerId/customer</rest-route> - <rest-route httpMethod="PUT" method="activateCustomer" resources="Magento_Customer::manage">/:customerId/activateCustomer</rest-route> - <rest-route httpMethod="PUT" method="searchCustomers" resources="Magento_Customer::customer">/search</rest-route> - <rest-route httpMethod="PUT" method="authenticate" resources="Magento_Customer::customer">/authenticate</rest-route> - <rest-route httpMethod="GET" method="validateResetPasswordLinkToken" resources="Magento_Customer::customer">/:customerId/validateResetPasswordLinkToken/:resetPasswordLinkToken</rest-route> - <rest-route httpMethod="PUT" method="initiatePasswordReset" resources="Magento_Customer::customer">/initiatePasswordReset</rest-route> - <rest-route httpMethod="PUT" method="resetPassword" resources="Magento_Customer::customer">/:customerId/resetPassword</rest-route> - <rest-route httpMethod="GET" method="getConfirmationStatus" resources="Magento_Customer::customer">/:customerId/confirmationStatus</rest-route> - <rest-route httpMethod="PUT" method="resendConfirmation" resources="Magento_Customer::customer">/resendConfirmation</rest-route> - <rest-route httpMethod="PUT" method="validateCustomerData" resources="Magento_Customer::manage">/validateCustomerData</rest-route> - <rest-route httpMethod="GET" method="canModify" resources="Magento_Customer::customer">/:customerId/canModify</rest-route> - <rest-route httpMethod="GET" method="canDelete" resources="Magento_Customer::customer">/:customerId/canDelete</rest-route> - <rest-route httpMethod="DELETE" method="deleteCustomer" resources="Magento_Customer::manage">/:customerId</rest-route> - <rest-route httpMethod="PUT" method="isEmailAvailable" resources="Magento_Customer::manage">/isEmailAvailable</rest-route> - </service> - <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" baseUrl="/V1/customer"> - <rest-route httpMethod="GET" method="getAddresses" resources="Magento_Customer::manage">/:customerId/address</rest-route> - <rest-route httpMethod="GET" method="getAddress" resources="Magento_Customer::manage">/address/:addressId</rest-route> - <rest-route httpMethod="GET" method="getDefaultBillingAddress" resources="Magento_Customer::manage">/:customerId/address/defaultBilling</rest-route> - <rest-route httpMethod="GET" method="getDefaultShippingAddress" resources="Magento_Customer::manage">/:customerId/address/defaultShipping</rest-route> - <rest-route httpMethod="DELETE" method="deleteAddress" resources="Magento_Customer::manage">/address/:addressId</rest-route> - <rest-route httpMethod="POST" method="saveAddresses" resources="Magento_Customer::manage">/:customerId/address</rest-route> - </service> -</config> + <route url="/V1/customerGroup/:groupId" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="getGroup"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="getGroups"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup/default/:storeId" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="getDefaultGroup"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup/canDelete/:groupId" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="canDelete"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup/search" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="searchGroups"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="saveGroup"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerGroup/:groupId" method="DELETE"> + <service class="Magento\Customer\Service\V1\CustomerGroupServiceInterface" method="deleteGroup"/> + <resources> + <resource ref="Magento_Customer::group"/> + </resources> + </route> + <route url="/V1/customerMetadata/:entityType/entity/:attributeCode/attribute" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/:entityType/entity/:attributeSetId/attributeSet/:storeId/store" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllAttributeSetMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/:entityType/entity/:formCode/form" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAttributes"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/customer/:attributeCode/attribute" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomerAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/customer/all" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllCustomerAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/customer/custom" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomCustomerAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/address/:attributeCode/attribute" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAddressAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/address/all" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getAllAddressAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerMetadata/address/custom" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerMetadataServiceInterface" method="getCustomAddressAttributeMetadata"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <!-- TODO: changePassword is a case of SELF. Need to revisit. For now manage is assigned --> + <!-- TODO: createCustomer, authenticate, validateResetPasswordLinkToken, initiatePasswordReset, resetPassword, resendConfirmation apis + can be accessed anonymously and need no resources to be assigned. Webapi framework doesn't support support that as yet. + Adding Magento_Customer::customer temporarily until handling anonymous users is finalized --> + <route url="/V1/customerAccounts" method="POST"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="createCustomer"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="updateCustomer"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/customer" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="saveCustomer"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="getCustomerDetails"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/customer" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="getCustomer"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/activateCustomer" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="activateCustomer"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/search" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="searchCustomers"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/authenticate" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="authenticate"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/changePassword" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="changePassword"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/validateResetPasswordLinkToken/:resetPasswordLinkToken" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="validateResetPasswordLinkToken"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/initiatePasswordReset" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="initiatePasswordReset"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/resetPassword" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="resetPassword"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/confirmationStatus" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="getConfirmationStatus"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/resendConfirmation" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="resendConfirmation"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/validateCustomerData" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="validateCustomerData"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/canModify" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="canModify"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId/canDelete" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="canDelete"/> + <resources> + <resource ref="Magento_Customer::customer"/> + </resources> + </route> + <route url="/V1/customerAccounts/:customerId" method="DELETE"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="deleteCustomer"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customerAccounts/isEmailAvailable" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerAccountServiceInterface" method="isEmailAvailable"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/:customerId/address" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="getAddresses"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/address/:addressId" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="getAddress"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/:customerId/address/defaultBilling" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="getDefaultBillingAddress"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/:customerId/address/defaultShipping" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="getDefaultShippingAddress"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/address/:addressId" method="DELETE"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="deleteAddress"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> + <route url="/V1/customer/:customerId/address" method="POST"> + <service class="Magento\Customer\Service\V1\CustomerAddressServiceInterface" method="saveAddresses"/> + <resources> + <resource ref="Magento_Customer::manage"/> + </resources> + </route> +</routes> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml index 79406ecbb5d8f23dab799c617f67bd1d23d77eb1..965e1ddd1409e7e261f5e39b24821e466375592c 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_group_index.xml @@ -47,10 +47,10 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="time"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="id" xsi:type="string">id</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="index" xsi:type="string">id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="type"> @@ -62,8 +62,7 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="class_name"> <arguments> <argument name="header" xsi:type="string" translate="true">Tax Class</argument> - <argument name="width" xsi:type="string">200px</argument> - <argument name="index" xsi:type="string">tax_class_id</argument> + <argument name="index" xsi:type="string">tax_class_name</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml index 22637ddef178ebcb7b9014b08087dc81108c078e..f9ff7bdfb00410b08c0334ec308754c36892b402 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_grid_block.xml @@ -104,7 +104,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="type" xsi:type="string">number</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="id" xsi:type="string">entity_id</argument> <argument name="index" xsi:type="string">entity_id</argument> </arguments> @@ -118,14 +117,12 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="email"> <arguments> <argument name="header" xsi:type="string" translate="true">Email</argument> - <argument name="width" xsi:type="string">150px</argument> <argument name="index" xsi:type="string">email</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="group"> <arguments> <argument name="header" xsi:type="string" translate="true">Group</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="index" xsi:type="string">group_id</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Customer\Model\Config\Source\Group\Multiselect"/> @@ -134,21 +131,20 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_telephone"> <arguments> <argument name="header" xsi:type="string" translate="true">Phone</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="index" xsi:type="string">billing_telephone</argument> + <argument name="column_css_class" xsi:type="string">col-phone</argument> + <argument name="header_css_class" xsi:type="string">col-phone</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_postcode"> <arguments> <argument name="header" xsi:type="string" translate="true">ZIP</argument> - <argument name="width" xsi:type="string">90px</argument> <argument name="index" xsi:type="string">billing_postcode</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_country_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Country</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="index" xsi:type="string">billing_country_id</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Backend\Model\Config\Source\Locale\Country"/> @@ -157,7 +153,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_region"> <arguments> <argument name="header" xsi:type="string" translate="true">State/Province</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="index" xsi:type="string">billing_region</argument> </arguments> </block> @@ -165,7 +160,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Customer Since</argument> <argument name="type" xsi:type="string">datetime</argument> - <argument name="align" xsi:type="string">center</argument> <argument name="index" xsi:type="string">created_at</argument> <argument name="gmtoffset" xsi:type="boolean">true</argument> </arguments> @@ -173,8 +167,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="website_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Web Site</argument> - <argument name="align" xsi:type="string">center</argument> - <argument name="width" xsi:type="string">80px</argument> <argument name="column_css_class" xsi:type="string">col-store</argument> <argument name="header_css_class" xsi:type="string">col-store</argument> <argument name="type" xsi:type="string">options</argument> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml index e23370d1f88bdd8e5c813d59a822e7c5d55be380..e64f69c8d1352181ca8e3d683ca0770415e1410d 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_address_index.xml @@ -26,7 +26,7 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="customer_account"/> <referenceBlock name="page.main.title"> - <block class="Magento\Customer\Block\Address\Book" name="address.book.button" template="address/button.phtml"/> + <block class="Magento\Customer\Block\Address\Book" name="address.book.button" template="address/button.phtml" cacheable="false" /> </referenceBlock> <referenceContainer name="content"> <block class="Magento\Customer\Block\Address\Book" name="address_book" template="address/book.phtml"/> diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php index b7075a4b89cdf536cfd423dd760c6851cd0f3c33..3a4e89b2a7b800ca29853d3466916523c54417fe 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php @@ -472,12 +472,12 @@ class Tools extends \Magento\Backend\App\Action /** * Re-init system configuration * - * @return \Magento\App\Config\ReinitableConfigInterface + * @return \Magento\Framework\App\Config\ReinitableConfigInterface */ protected function _reinitSystemConfiguration() { - /** @var $configModel \Magento\App\Config\ReinitableConfigInterface */ - $configModel = $this->_objectManager->get('Magento\App\Config\ReinitableConfigInterface'); + /** @var $configModel \Magento\Framework\App\Config\ReinitableConfigInterface */ + $configModel = $this->_objectManager->get('Magento\Framework\App\Config\ReinitableConfigInterface'); return $configModel->reinit(); } } diff --git a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php index ae828b9a78735f03a14af8125c6456273d4b22c5..d3365ce49f7b4bd36e3fd6bd6a5b4aec634d2335 100644 --- a/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php +++ b/app/code/Magento/DesignEditor/Controller/Varien/Router/Standard.php @@ -44,7 +44,7 @@ class Standard extends \Magento\Core\App\Router\Base /** * Router list * - * @var \Magento\App\RouterListInterface + * @var \Magento\Framework\App\RouterListInterface */ protected $_routerList; @@ -69,18 +69,18 @@ class Standard extends \Magento\Core\App\Router\Base protected $_session; /** - * @param \Magento\App\ActionFactory $actionFactory - * @param \Magento\App\DefaultPathInterface $defaultPath - * @param \Magento\App\ResponseFactory $responseFactory - * @param \Magento\App\Route\Config $routeConfig - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\ActionFactory $actionFactory + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\ResponseFactory $responseFactory + * @param \Magento\Framework\App\Route\Config $routeConfig + * @param \Magento\Framework\App\State $appState * @param \Magento\UrlInterface $url * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param string $routerId * @param \Magento\Code\NameBuilder $nameBuilder - * @param \Magento\App\RouterListInterface $routerList + * @param \Magento\Framework\App\RouterListInterface $routerList * @param \Magento\ObjectManager $objectManager * @param \Magento\UrlRewrite\App\Request\RewriteService $urlRewriteService * @param \Magento\DesignEditor\Helper\Data $designEditorHelper @@ -90,18 +90,18 @@ class Standard extends \Magento\Core\App\Router\Base * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\ActionFactory $actionFactory, - \Magento\App\DefaultPathInterface $defaultPath, - \Magento\App\ResponseFactory $responseFactory, - \Magento\App\Route\Config $routeConfig, - \Magento\App\State $appState, + \Magento\Framework\App\ActionFactory $actionFactory, + \Magento\Framework\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\ResponseFactory $responseFactory, + \Magento\Framework\App\Route\Config $routeConfig, + \Magento\Framework\App\State $appState, \Magento\UrlInterface $url, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, $routerId, \Magento\Code\NameBuilder $nameBuilder, - \Magento\App\RouterListInterface $routerList, + \Magento\Framework\App\RouterListInterface $routerList, \Magento\ObjectManager $objectManager, \Magento\UrlRewrite\App\Request\RewriteService $urlRewriteService, \Magento\DesignEditor\Helper\Data $designEditorHelper, @@ -131,10 +131,10 @@ class Standard extends \Magento\Core\App\Router\Base /** * Match provided request and if matched - return corresponding controller * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\Action\Action|null + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\Action\Action|null */ - public function match(\Magento\App\RequestInterface $request) + public function match(\Magento\Framework\App\RequestInterface $request) { // if URL has VDE prefix if (!$this->_designEditorHelper->isVdeRequest($request)) { @@ -155,9 +155,9 @@ class Standard extends \Magento\Core\App\Router\Base // match routers $controller = null; $routers = $this->_getMatchedRouters(); - /** @var $router \Magento\App\Router\AbstractRouter */ + /** @var $router \Magento\Framework\App\Router\AbstractRouter */ foreach ($routers as $router) { - /** @var $controller \Magento\App\Action\AbstractAction */ + /** @var $controller \Magento\Framework\App\Action\AbstractAction */ $controller = $router->match($request); if ($controller) { $this->_state->update(\Magento\Core\Model\App\Area::AREA_FRONTEND, $request); @@ -174,10 +174,10 @@ class Standard extends \Magento\Core\App\Router\Base /** * Modify request path to imitate basic request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return $this */ - protected function _prepareVdeRequest(\Magento\App\RequestInterface $request) + protected function _prepareVdeRequest(\Magento\Framework\App\RequestInterface $request) { list($vdeFrontName, $designMode, $themeId) = explode('/', trim($request->getPathInfo(), '/')); $request->setAlias('editorMode', $designMode); diff --git a/app/code/Magento/DesignEditor/Helper/Data.php b/app/code/Magento/DesignEditor/Helper/Data.php index 6443819f42766201431af083f318514565474726..3399d83cd64f70e8ce7a820491c354eb9235df27 100644 --- a/app/code/Magento/DesignEditor/Helper/Data.php +++ b/app/code/Magento/DesignEditor/Helper/Data.php @@ -25,13 +25,13 @@ */ namespace Magento\DesignEditor\Helper; -use Magento\App\Helper\Context; -use Magento\App\RequestInterface; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\App\RequestInterface; /** * Design Editor main helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Parameter to indicate the translation mode (null, text, script, or alt). diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Configuration.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Configuration.php index 82cc86befef5bd47310a06d7bf6d34247962cbe6..a639cfc313e99ad21c160dc0c8aef4102e4c5bf7 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Configuration.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Configuration.php @@ -53,7 +53,7 @@ class Configuration protected $_design; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -100,7 +100,7 @@ class Configuration /** * @param \Magento\View\DesignInterface $design - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Event\ManagerInterface $eventDispatcher * @param \Magento\View\ConfigInterface $viewConfig * @param \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration @@ -109,7 +109,7 @@ class Configuration */ public function __construct( \Magento\View\DesignInterface $design, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Event\ManagerInterface $eventDispatcher, \Magento\View\ConfigInterface $viewConfig, \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration = null, @@ -302,7 +302,7 @@ class Configuration protected function _saveViewConfiguration(\DOMDocument $config) { $targetPath = $this->_theme->getCustomization()->getCustomViewConfigPath(); - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $directory->writeFile($directory->getRelativePath($targetPath), $config->saveXML()); return $this; } diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php index 80574b3c0d478b8b536412f85251327cd1ab4f36..380a2b61f9282e19a91dec1cac75598ca1277da3 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/Controls/Factory.php @@ -65,7 +65,7 @@ class Factory protected $fileIteratorFactory; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -73,13 +73,13 @@ class Factory * @param \Magento\ObjectManager $objectManager * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Config\FileIteratorFactory $fileIteratorFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\ObjectManager $objectManager, \Magento\View\FileSystem $viewFileSystem, \Magento\Config\FileIteratorFactory $fileIteratorFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_objectManager = $objectManager; $this->_viewFileSystem = $viewFileSystem; @@ -134,7 +134,7 @@ class Factory throw new \Magento\Exception("Unknown control configuration type: \"{$type}\""); break; } - $rootDirectory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $rootDirectory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $paths = array(); foreach ($files as $file) { $paths[] = $rootDirectory->getRelativePath($file); diff --git a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/ImageUploader.php b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/ImageUploader.php index 34d0068a7abbcc47732d445c1bfac88cfbcb934c..6a9508d83f9299247ce57f1ca09718aaa0322bea 100644 --- a/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/ImageUploader.php +++ b/app/code/Magento/DesignEditor/Model/Editor/Tools/QuickStyles/ImageUploader.php @@ -43,7 +43,7 @@ class ImageUploader extends \Magento\Object protected $_storagePath; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -63,12 +63,12 @@ class ImageUploader extends \Magento\Object * Generic constructor of change instance * * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $data */ public function __construct( \Magento\Core\Model\File\UploaderFactory $uploaderFactory, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, array $data = array() ) { $this->_uploaderFactory = $uploaderFactory; @@ -154,7 +154,7 @@ class ImageUploader extends \Magento\Object */ public function removeFile($file) { - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $path = $directory->getRelativePath($this->getStoragePath() . '/' . $file); if ($directory->isExist($path)) { $directory->delete($path); diff --git a/app/code/Magento/DesignEditor/Model/State.php b/app/code/Magento/DesignEditor/Model/State.php index 02ec468910925893705794f961bec9c191b90744..f021cd733e69b992db6d0cbe26cd661974fb252d 100644 --- a/app/code/Magento/DesignEditor/Model/State.php +++ b/app/code/Magento/DesignEditor/Model/State.php @@ -67,7 +67,7 @@ class State /** * Application Cache Manager * - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; @@ -82,14 +82,14 @@ class State protected $_objectManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_configuration; /** * Mutable Config * - * @var \Magento\App\Config\MutableScopeConfigInterface + * @var \Magento\Framework\App\Config\MutableScopeConfigInterface */ protected $_mutableConfig; @@ -97,23 +97,23 @@ class State * @param \Magento\Backend\Model\Session $backendSession * @param AreaEmulator $areaEmulator * @param Url\Factory $urlModelFactory - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\DesignEditor\Helper\Data $dataHelper * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param Theme\Context $themeContext - * @param \Magento\App\Config\MutableScopeConfigInterface $mutableConfig + * @param \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig */ public function __construct( \Magento\Backend\Model\Session $backendSession, AreaEmulator $areaEmulator, \Magento\DesignEditor\Model\Url\Factory $urlModelFactory, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\DesignEditor\Helper\Data $dataHelper, \Magento\ObjectManager $objectManager, - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\DesignEditor\Model\Theme\Context $themeContext, - \Magento\App\Config\MutableScopeConfigInterface $mutableConfig + \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig ) { $this->_backendSession = $backendSession; $this->_areaEmulator = $areaEmulator; @@ -130,10 +130,10 @@ class State * Update system data for current VDE environment * * @param string $areaCode - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return void */ - public function update($areaCode, \Magento\App\RequestInterface $request) + public function update($areaCode, \Magento\Framework\App\RequestInterface $request) { $mode = $request->getAlias('editorMode') ?: self::MODE_NAVIGATION; $this->_themeContext->setEditableThemeById($request->getAlias('themeId')); diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index 2b325ac2e3307d26b40a712769a6f77f730f220d..20386f2698aa1283d25391b733150a78d24c00eb 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -36,11 +36,11 @@ class Change extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @return void */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/DesignEditor/Model/Translate/Inline.php b/app/code/Magento/DesignEditor/Model/Translate/Inline.php index 77f8a1d476f35b498e4594aec2f2f22b05657512..b4200f142d5e60a8ce891d0894b553508890d5f7 100644 --- a/app/code/Magento/DesignEditor/Model/Translate/Inline.php +++ b/app/code/Magento/DesignEditor/Model/Translate/Inline.php @@ -88,7 +88,7 @@ class Inline implements \Magento\Translate\InlineInterface protected $_design; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; @@ -96,7 +96,7 @@ class Inline implements \Magento\Translate\InlineInterface * Initialize inline translation model specific for vde * * @param \Magento\View\DesignInterface $design - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param \Magento\Translate\Inline\ParserFactory $parserFactory * @param \Magento\DesignEditor\Helper\Data $helper * @param \Magento\UrlInterface $url @@ -104,7 +104,7 @@ class Inline implements \Magento\Translate\InlineInterface */ public function __construct( \Magento\View\DesignInterface $design, - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\Translate\Inline\ParserFactory $parserFactory, \Magento\DesignEditor\Helper\Data $helper, \Magento\UrlInterface $url, diff --git a/app/code/Magento/DesignEditor/Model/Translate/Inline/Provider.php b/app/code/Magento/DesignEditor/Model/Translate/Inline/Provider.php index c1f91d58c96bd7631d03e40e66529b11dbe6d57b..62479ec5dca7d4b7ed389ff1968610b4138bcb4f 100644 --- a/app/code/Magento/DesignEditor/Model/Translate/Inline/Provider.php +++ b/app/code/Magento/DesignEditor/Model/Translate/Inline/Provider.php @@ -37,7 +37,7 @@ class Provider extends \Magento\Translate\Inline\Provider protected $inlineTranslate; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -50,13 +50,13 @@ class Provider extends \Magento\Translate\Inline\Provider * @param \Magento\Translate\InlineInterface $vdeInlineTranslate * @param \Magento\Translate\InlineInterface $inlineTranslate * @param \Magento\DesignEditor\Helper\Data $helper - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ public function __construct( \Magento\Translate\InlineInterface $vdeInlineTranslate, \Magento\Translate\InlineInterface $inlineTranslate, \Magento\DesignEditor\Helper\Data $helper, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->vdeInlineTranslate = $vdeInlineTranslate; $this->inlineTranslate = $inlineTranslate; diff --git a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php index b1418f17bfff2384da7a505298675657094fb0f1..8011284444eb38b8a9e96f8fe79795f8ef379351 100644 --- a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php +++ b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php @@ -52,8 +52,8 @@ class NavigationMode extends \Magento\Url protected $_themeId; /** - * @param \Magento\App\Route\ConfigInterface $routeConfig - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param \Magento\Url\ScopeResolverInterface $scopeResolver * @param \Magento\Session\Generic $session @@ -61,13 +61,13 @@ class NavigationMode extends \Magento\Url * @param \Magento\Url\RouteParamsResolverFactory $routeParamsResolver * @param \Magento\Url\QueryParamsResolverInterface $queryParamsResolver * @param \Magento\DesignEditor\Helper\Data $helper - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $scopeType * @param array $data */ public function __construct( - \Magento\App\Route\ConfigInterface $routeConfig, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\RequestInterface $request, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Url\ScopeResolverInterface $scopeResolver, \Magento\Session\Generic $session, @@ -75,7 +75,7 @@ class NavigationMode extends \Magento\Url \Magento\Url\RouteParamsResolverFactory $routeParamsResolver, \Magento\Url\QueryParamsResolverInterface $queryParamsResolver, \Magento\DesignEditor\Helper\Data $helper, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $scopeType, array $data = array() ) { diff --git a/app/code/Magento/DesignEditor/etc/adminhtml/routes.xml b/app/code/Magento/DesignEditor/etc/adminhtml/routes.xml index 2969784571230d2daa4fe3818db242096e4ac7e9..e65ba1e1a43ff2197568d78313e76332b1f6c853 100644 --- a/app/code/Magento/DesignEditor/etc/adminhtml/routes.xml +++ b/app/code/Magento/DesignEditor/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_DesignEditor" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/DesignEditor/etc/frontend/di.xml b/app/code/Magento/DesignEditor/etc/frontend/di.xml index afa34908efc8635f0e28d139eff7ece9f613fcb9..a75ac30f64fcd0b474555be363351d21e71eace2 100644 --- a/app/code/Magento/DesignEditor/etc/frontend/di.xml +++ b/app/code/Magento/DesignEditor/etc/frontend/di.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\RouterList"> + <type name="Magento\Framework\App\RouterList"> <arguments> <argument name="routerList" xsi:type="array"> <item name="vde" xsi:type="array"> diff --git a/app/code/Magento/DesignEditor/etc/frontend/routes.xml b/app/code/Magento/DesignEditor/etc/frontend/routes.xml index 3128251dde8f150c6c422d45a1697f489ab32d39..49bcc38679c3bb2bbe9f625e53cb9dc94c52ee7a 100644 --- a/app/code/Magento/DesignEditor/etc/frontend/routes.xml +++ b/app/code/Magento/DesignEditor/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="designeditor" frontName="design"> <module name="Magento_DesignEditor" /> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/css/styles.css b/app/code/Magento/DesignEditor/view/adminhtml/css/styles.css index 30a71482530ea34f179af44ffb461b4b6ee9fd3f..de9ab304c60d5e1518be979c6be026a03f8e0a86 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/css/styles.css +++ b/app/code/Magento/DesignEditor/view/adminhtml/css/styles.css @@ -234,35 +234,8 @@ #theme_selector_tabs .tabs-horiz { background: none; border: 0; - padding: 9px 9px 0; - border-bottom: 1px solid #beb8af; -} - -#theme_selector_tabs .tabs-horiz > li { - margin-right: 4px; - border: 1px solid #beb8af; - border-bottom-width: 0; - border-radius: 5px 5px 0 0; -} - -#theme_selector_tabs .tabs-horiz > li a { - background: #dbd6ce; - font-size: 15px; - color: #524c44; - border-radius: 5px 5px 0 0; - padding: 10px 18px 11px; -} - -#theme_selector_tabs .tabs-horiz > .ui-state-active { - border-bottom: 1px solid #fff; - margin-bottom: -1px; -} - -#theme_selector_tabs .tabs-horiz > .ui-state-active a { - background: #fff; - border: 0; - margin-top: 0; - box-shadow: none; + padding: 9px 0 0; + background: #F2EBDE; } /* @@ -270,12 +243,12 @@ -------------------------------------- */ .theme-selector { overflow: auto; + background: #fff; } .theme-selector .ui-tabs-panel { - padding: 60px 40px 20px; + padding: 20px; background: #fff; - border-radius: 0 0 5px 5px; min-height: 500px; } @@ -429,9 +402,10 @@ My Customizations Tab -------------------------------------- */ .themes-customizations h3 { - font-size: 24px; + font-size: 20px; + font-weight: 400; margin-bottom: 30px; - border-bottom: 1px solid #ededed; + border-bottom: 1px solid #cac3b4; padding-bottom: 8px; } diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 629bbd0929f67c679fd86bc57b3d68bbd8dcea23..08b14934328dd30399fdac45986f02f5e71c4043 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -206,7 +206,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin protected $_httpClientFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory @@ -225,13 +225,13 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\String $string * @param \Magento\Math\Division $mathDivision - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\HTTP\ZendClientFactory $httpClientFactory * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, @@ -250,12 +250,12 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\String $string, \Magento\Math\Division $mathDivision, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Stdlib\DateTime $dateTime, \Magento\HTTP\ZendClientFactory $httpClientFactory, array $data = array() ) { - $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->_carrierHelper = $carrierHelper; $this->_coreDate = $coreDate; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Dhl/Model/Plugin/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Dhl/Model/Plugin/Checkout/Block/Cart/Shipping.php index efbca81e6a6b9e7b74d1dcb5a6d928b00bc9aff2..13c38245279a21a30c8d3aab9bd5d2ca22418d8f 100644 --- a/app/code/Magento/Dhl/Model/Plugin/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Dhl/Model/Plugin/Checkout/Block/Cart/Shipping.php @@ -29,14 +29,14 @@ namespace Magento\Dhl\Model\Plugin\Checkout\Block\Cart; class Shipping { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php b/app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php index ec38043c8cf327ce18133ad56b809b47f84b7829..d741b26d68e6997542f11198694bcd42d33dc87e 100644 --- a/app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php +++ b/app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php @@ -29,14 +29,14 @@ namespace Magento\Dhl\Model\Plugin\Rma\Block\Adminhtml\Rma\Edit\Tab\General; class Shippingmethod { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Directory/Block/Data.php b/app/code/Magento/Directory/Block/Data.php index ea7b927e23cf8f523271acbb7bb3c80dcf9c7fd3..fd2cabddeea013dc47771c0a90757c4ac8cb20ca 100644 --- a/app/code/Magento/Directory/Block/Data.php +++ b/app/code/Magento/Directory/Block/Data.php @@ -32,7 +32,7 @@ namespace Magento\Directory\Block; class Data extends \Magento\View\Element\Template { /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -60,7 +60,7 @@ class Data extends \Magento\View\Element\Template * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Json\EncoderInterface $jsonEncoder - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory * @param array $data @@ -69,7 +69,7 @@ class Data extends \Magento\View\Element\Template \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Json\EncoderInterface $jsonEncoder, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, array $data = array() diff --git a/app/code/Magento/Directory/Controller/Currency.php b/app/code/Magento/Directory/Controller/Currency.php index 410c45e59f63f9834008b4298a0385c173e2a4ab..f7765dcfdaa14f89e1c9dae6b4edc1800652309b 100644 --- a/app/code/Magento/Directory/Controller/Currency.php +++ b/app/code/Magento/Directory/Controller/Currency.php @@ -29,7 +29,7 @@ */ namespace Magento\Directory\Controller; -class Currency extends \Magento\App\Action\Action +class Currency extends \Magento\Framework\App\Action\Action { /** * @return void diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index 05478b635cf5d40b54bc9cb53d36c1383c83487d..b0266aafc9f792120a64359d1befbe798a73699e 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\Directory\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Config value that lists ISO2 country codes which have optional Zip/Postal pre-configured @@ -82,7 +82,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_optZipCountries = null; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -107,29 +107,29 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_currencyFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Country\Collection $countryCollection * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regCollectionFactory, * @param \Magento\Core\Helper\Data $coreHelper * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Country\Collection $countryCollection, \Magento\Directory\Model\Resource\Region\CollectionFactory $regCollectionFactory, \Magento\Core\Helper\Data $coreHelper, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { parent::__construct($context); $this->_configCacheType = $configCacheType; diff --git a/app/code/Magento/Directory/Helper/Url.php b/app/code/Magento/Directory/Helper/Url.php index 3160c2289dd9a7637bcbdc982885b3f8694d9afb..ba77fc02fced5c179bd3fcd826cf10d9c0211f41 100644 --- a/app/code/Magento/Directory/Helper/Url.php +++ b/app/code/Magento/Directory/Helper/Url.php @@ -39,12 +39,12 @@ class Url extends \Magento\Core\Helper\Url protected $_coreData = null; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Helper\Data $coreData */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Core\Helper\Data $coreData ) { @@ -69,7 +69,7 @@ class Url extends \Magento\Core\Helper\Url } else { $url = $this->_urlBuilder->getCurrentUrl(); } - $params[\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED] = $this->_coreData->urlEncode($url); + $params[\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED] = $this->_coreData->urlEncode($url); return $this->_getUrl('directory/currency/switch', $params); } } diff --git a/app/code/Magento/Directory/Model/Currency/DefaultLocator.php b/app/code/Magento/Directory/Model/Currency/DefaultLocator.php index 5a598bcf1263568abb2f626c728f91d3060e758a..21342563faec48a352941c86cefdc94ba7202d2f 100644 --- a/app/code/Magento/Directory/Model/Currency/DefaultLocator.php +++ b/app/code/Magento/Directory/Model/Currency/DefaultLocator.php @@ -30,7 +30,7 @@ class DefaultLocator /** * Config object * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_configuration; @@ -42,11 +42,11 @@ class DefaultLocator protected $_storeManager; /** - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_configuration = $configuration; @@ -56,10 +56,10 @@ class DefaultLocator /** * Retrieve default currency for selected store, website or website group * @todo: Refactor to ScopeDefiner - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return string */ - public function getDefaultCurrency(\Magento\App\RequestInterface $request) + public function getDefaultCurrency(\Magento\Framework\App\RequestInterface $request) { if ($request->getParam('store')) { $store = $request->getParam('store'); diff --git a/app/code/Magento/Directory/Model/Currency/Import/Webservicex.php b/app/code/Magento/Directory/Model/Currency/Import/Webservicex.php index 9665cd8a788d3c627e6f9ad3772a66daef87f45e..b3fd5d7fc3b4ed4b55a88d4acefd43e2c27e0b05 100644 --- a/app/code/Magento/Directory/Model/Currency/Import/Webservicex.php +++ b/app/code/Magento/Directory/Model/Currency/Import/Webservicex.php @@ -46,17 +46,17 @@ class Webservicex extends \Magento\Directory\Model\Currency\Import\AbstractImpor /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { parent::__construct($currencyFactory); $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Directory/Model/Observer.php b/app/code/Magento/Directory/Model/Observer.php index f6f7284212f510b5aa37464a747caa0f4b6b8ece..d732ae9d2ed77c83ae402b1d32e66222115d1749 100644 --- a/app/code/Magento/Directory/Model/Observer.php +++ b/app/code/Magento/Directory/Model/Observer.php @@ -53,7 +53,7 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -79,7 +79,7 @@ class Observer /** * @param \Magento\Directory\Model\Currency\Import\Factory $importFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\TranslateInterface $translate * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -88,7 +88,7 @@ class Observer */ public function __construct( \Magento\Directory\Model\Currency\Import\Factory $importFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\TranslateInterface $translate, \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Directory/Model/PriceCurrency.php b/app/code/Magento/Directory/Model/PriceCurrency.php new file mode 100644 index 0000000000000000000000000000000000000000..dfdaf44243a533ecc996baf42d658091d7cb3a55 --- /dev/null +++ b/app/code/Magento/Directory/Model/PriceCurrency.php @@ -0,0 +1,158 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Directory\Model; + +use Magento\Store\Model\StoreManagerInterface; +use Magento\Logger; + +/** + * Class PriceCurrency model for convert and format price value + */ +class PriceCurrency implements \Magento\Pricing\PriceCurrencyInterface +{ + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var CurrencyFactory + */ + protected $currencyFactory; + + /** + * @var Logger + */ + protected $logger; + + /** + * @param StoreManagerInterface $storeManager + * @param CurrencyFactory $currencyFactory + * @param Logger $logger + */ + public function __construct( + StoreManagerInterface $storeManager, + CurrencyFactory $currencyFactory, + Logger $logger + ) { + $this->storeManager = $storeManager; + $this->currencyFactory = $currencyFactory; + $this->logger = $logger; + } + + /** + * Convert and format price value for specified store or passed currency + * + * @param float $amount + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param Currency|string|null $currency + * @return float + */ + public function convert($amount, $store = null, $currency = null) + { + $currentCurrency = $this->getCurrency($store, $currency); + return $this->getStore($store)->getBaseCurrency()->convert($amount, $currentCurrency); + } + + /** + * Format price value for specified store or passed currency + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param Currency|string|null $currency + * @return string + */ + public function format( + $amount, + $includeContainer = true, + $precision = self::DEFAULT_PRECISION, + $store = null, + $currency = null + ) { + return $this->getCurrency($store, $currency)->formatPrecision($amount, $precision, [], $includeContainer); + } + + /** + * Convert and format price value + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param Currency|string|null $currency + * @return string + */ + public function convertAndFormat( + $amount, + $includeContainer = true, + $precision = self::DEFAULT_PRECISION, + $store = null, + $currency = null + ) { + $amount = $this->convert($amount, $store, $currency); + return $this->format($amount, $includeContainer, $precision, $store, $currency); + } + + /** + * Get currency model + * + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param Currency|string|null $currency + * @return Currency + */ + protected function getCurrency($store = null, $currency = null) + { + if ($currency instanceof Currency) { + $currentCurrency = $currency; + } elseif (is_string($currency)) { + $currency = $this->currencyFactory->create()->load($currency); + $baseCurrency = $this->getStore($store)->getBaseCurrency(); + $currentCurrency = $baseCurrency->getRate($currency) ? $currency : $baseCurrency; + } else { + $currentCurrency = $this->getStore($store)->getCurrentCurrency(); + } + return $currentCurrency; + } + + /** + * Get store model + * + * @param null|string|bool|int|\\Magento\Store\Model\Store $store + * @return \\Magento\Store\Model\Store + */ + protected function getStore($store = null) + { + try { + if (!$store instanceof \Magento\Store\Model\Store) { + $store = $this->storeManager->getStore($store); + } + } catch (\Exception $e) { + $this->logger->logException($e); + $store = $this->storeManager->getStore(); + } + return $store; + } +} diff --git a/app/code/Magento/Directory/Model/Resource/Country/Collection.php b/app/code/Magento/Directory/Model/Resource/Country/Collection.php index f467bccec57562fc6d1120d20cda46b3a1521e62..cf32dbe578b364672687310f076ecc56d3a27dfd 100644 --- a/app/code/Magento/Directory/Model/Resource/Country/Collection.php +++ b/app/code/Magento/Directory/Model/Resource/Country/Collection.php @@ -41,7 +41,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -68,7 +68,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Locale\ListsInterface $localeLists - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Directory\Model\Resource\CountryFactory $countryFactory * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Locale\ResolverInterface $localeResolver @@ -81,7 +81,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Locale\ListsInterface $localeLists, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Directory\Model\Resource\CountryFactory $countryFactory, \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Locale\ResolverInterface $localeResolver, diff --git a/app/code/Magento/Directory/Model/Resource/Region.php b/app/code/Magento/Directory/Model/Resource/Region.php index 22c131b6df08bd86998167c8bd3215ebd31b4893..90d773c18d34cfcd040af278f3b42dbae2b12a3f 100644 --- a/app/code/Magento/Directory/Model/Resource/Region.php +++ b/app/code/Magento/Directory/Model/Resource/Region.php @@ -44,10 +44,10 @@ class Region extends \Magento\Model\Resource\Db\AbstractDb protected $_localeResolver; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Locale\ResolverInterface $localeResolver */ - public function __construct(\Magento\App\Resource $resource, \Magento\Locale\ResolverInterface $localeResolver) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Locale\ResolverInterface $localeResolver) { parent::__construct($resource); $this->_localeResolver = $localeResolver; @@ -78,7 +78,7 @@ class Region extends \Magento\Model\Resource\Db\AbstractDb $adapter = $this->_getReadAdapter(); $locale = $this->_localeResolver->getLocaleCode(); - $systemLocale = \Magento\AppInterface::DISTRO_LOCALE_CODE; + $systemLocale = \Magento\Framework\AppInterface::DISTRO_LOCALE_CODE; $regionField = $adapter->quoteIdentifier($this->getMainTable() . '.' . $this->getIdFieldName()); diff --git a/app/code/Magento/Directory/etc/adminhtml/routes.xml b/app/code/Magento/Directory/etc/adminhtml/routes.xml index 24b369fe0cef3bcbc4f046c3c3e29000774bada7..ea918debe1cfc546178e74893765e50c823bde3c 100644 --- a/app/code/Magento/Directory/etc/adminhtml/routes.xml +++ b/app/code/Magento/Directory/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="directory" frontName="directory"> <module name="Magento_Directory" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Directory/etc/frontend/routes.xml b/app/code/Magento/Directory/etc/frontend/routes.xml index 3ccb3b714642ee4176ef8bbcebcefe1543b36346..d99c94d46c896f6a5a78e301cf7559eef9dbe2c2 100644 --- a/app/code/Magento/Directory/etc/frontend/routes.xml +++ b/app/code/Magento/Directory/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="directory" frontName="directory"> <module name="Magento_Directory" /> diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index 293f330a3b5d5b76c296052783e12ea2412b711a..0e5728bed5092b37110a7b91d2d93e4455cb0fe2 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -132,7 +132,8 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct } if (!$this->calculationModel->getCustomerData()->getId() - && $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID)) { + && $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID) + ) { $customer = $this->accountService ->getCustomer($this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID)); $this->calculationModel->setCustomerData($customer); @@ -151,12 +152,7 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct } elseif ($taxHelper->displayBothPrices()) { $priceStr .= $coreHelper->currencyByStore($_priceExclTax, $store); if ($_priceInclTax != $_priceExclTax) { - $priceStr .= ' (+' . $coreHelper->currencyByStore( - $_priceInclTax, - $store - ) . ' ' . __( - 'Incl. Tax' - ) . ')'; + $priceStr .= ' (+' . $coreHelper->currencyByStore($_priceInclTax, $store) . ' ' . __('Incl. Tax') . ')'; } } $priceStr .= '</span>'; @@ -183,8 +179,23 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct { $config = array(); + $priceModel = $this->getProduct()->getPriceInfo()->getPrice('final_price'); + foreach ($this->getLinks() as $link) { - $config[$link->getId()] = $this->coreData->currency($link->getPrice(), false, false); + $amount = $priceModel->getCustomAmount($link->getPrice()); + $config[$link->getId()] = [ + 'price' => $this->coreData->currency($link->getPrice(), false, false), + 'inclTaxPrice' => $this->coreData->currency( + $amount->getValue(), + false, + false + ), + 'exclTaxPrice' => $this->coreData->currency( + $amount->getBaseAmount(), + false, + false + ) + ]; } return $this->jsonEncoder->encode($config); @@ -249,4 +260,36 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct { return $this->getIsLinkChecked($link) ? 'checked' : ''; } + + /** + * @param Link $link + * @return \Magento\Pricing\Amount\AmountInterface + */ + protected function getLinkAmount($link) + { + return $this->getPriceType()->getLinkAmount($link); + } + + /** + * @param Link $link + * @return string + */ + public function getLinkPrice(Link $link) + { + return $this->getLayout()->getBlock('product.price.render.default')->renderAmount( + $this->getLinkAmount($link), + $this->getPriceType(), + $this->getProduct() + ); + } + + /** + * Get LinkPrice Type + * + * @return \Magento\Pricing\Price\PriceInterface + */ + protected function getPriceType() + { + return $this->getProduct()->getPriceInfo()->getPrice('link_price'); + } } diff --git a/app/code/Magento/Downloadable/Block/Checkout/Success.php b/app/code/Magento/Downloadable/Block/Checkout/Success.php index 1c39a42a27d24913167fa9c83899651854ba5b32..e262741b87ef9bb68167f2137af68c8a9273529d 100644 --- a/app/code/Magento/Downloadable/Block/Checkout/Success.php +++ b/app/code/Magento/Downloadable/Block/Checkout/Success.php @@ -48,7 +48,7 @@ class Success extends \Magento\Checkout\Block\Onepage\Success * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Order\Config $orderConfig - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer * @param array $data */ @@ -58,7 +58,7 @@ class Success extends \Magento\Checkout\Block\Onepage\Success \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Order\Config $orderConfig, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Service\V1\CustomerCurrentService $currentCustomer, array $data = array() ) { diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php index 3737bbf8febd431183916b50b6610f62bd5a7255..7790a492dac76633f3dabdff933759890df19d75 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php @@ -26,14 +26,14 @@ namespace Magento\Downloadable\Controller\Adminhtml\Product\Initialization\Helpe class Downloadable { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ - public function __construct(\Magento\App\RequestInterface $request) + public function __construct(\Magento\Framework\App\RequestInterface $request) { $this->request = $request; } diff --git a/app/code/Magento/Downloadable/Controller/Customer.php b/app/code/Magento/Downloadable/Controller/Customer.php index b0ae92e0593d16acf83c681462dfcdef6c9e9013..9cb820d744eed32a240099d5d8e0f771e36c201e 100644 --- a/app/code/Magento/Downloadable/Controller/Customer.php +++ b/app/code/Magento/Downloadable/Controller/Customer.php @@ -25,7 +25,7 @@ */ namespace Magento\Downloadable\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Customer account controller @@ -34,7 +34,7 @@ use Magento\App\RequestInterface; * @package Magento_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class Customer extends \Magento\App\Action\Action +class Customer extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Customer\Model\Session @@ -42,10 +42,10 @@ class Customer extends \Magento\App\Action\Action protected $_customerSession; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession) { $this->_customerSession = $customerSession; parent::__construct($context); @@ -55,7 +55,7 @@ class Customer extends \Magento\App\Action\Action * Check customer authentication * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Downloadable/Controller/Download.php b/app/code/Magento/Downloadable/Controller/Download.php index 8fc6ec6eb52b5de0908c68336dc6e607b9e9108b..3da4fa5c05feeb4087eb4af4244b0e27fef33df2 100644 --- a/app/code/Magento/Downloadable/Controller/Download.php +++ b/app/code/Magento/Downloadable/Controller/Download.php @@ -23,7 +23,7 @@ */ namespace Magento\Downloadable\Controller; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Downloadable\Helper\Download as DownloadHelper; use Magento\Model\Exception as CoreException; use Magento\Downloadable\Model\Link\Purchased\Item as PurchasedLink; @@ -33,7 +33,7 @@ use Magento\Downloadable\Model\Link\Purchased\Item as PurchasedLink; * * @author Magento Core Team <core@magentocommerce.com> */ -class Download extends \Magento\App\Action\Action +class Download extends \Magento\Framework\App\Action\Action { /** * Return core session object diff --git a/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php index e98c9f31b531ab9ba25c342dc2866997f3fdca44..437bf71bc39aa64eec00c78829f9d637446ccd54 100644 --- a/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php @@ -32,7 +32,7 @@ namespace Magento\Downloadable\Helper\Catalog\Product; * @package Magento_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class Configuration extends \Magento\App\Helper\AbstractHelper implements +class Configuration extends \Magento\Framework\App\Helper\AbstractHelper implements \Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface { /** @@ -45,19 +45,19 @@ class Configuration extends \Magento\App\Helper\AbstractHelper implements /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $productConfigur - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Helper\Product\Configuration $productConfigur, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_productConfigur = $productConfigur; $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Downloadable/Helper/Data.php b/app/code/Magento/Downloadable/Helper/Data.php index 68fd6e2c32a5440facc63b5be276a042f936d5de..99789a1c8c643d93c27bd6f67937fb5239709a18 100644 --- a/app/code/Magento/Downloadable/Helper/Data.php +++ b/app/code/Magento/Downloadable/Helper/Data.php @@ -34,22 +34,22 @@ use Magento\Downloadable\Model\Link\Purchased\Item; * @package Magento_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/Downloadable/Helper/Download.php b/app/code/Magento/Downloadable/Helper/Download.php index 03f6c0ce8b32f2339ff04420362f4eb64e387094..4ac92388dac81cb8f8d339786a80362dbe0debaa 100644 --- a/app/code/Magento/Downloadable/Helper/Download.php +++ b/app/code/Magento/Downloadable/Helper/Download.php @@ -23,13 +23,13 @@ */ namespace Magento\Downloadable\Helper; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Model\Exception as CoreException; /** * Downloadable Products Download Helper */ -class Download extends \Magento\App\Helper\AbstractHelper +class Download extends \Magento\Framework\App\Helper\AbstractHelper { /** * Link type url @@ -112,12 +112,12 @@ class Download extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -128,20 +128,20 @@ class Download extends \Magento\App\Helper\AbstractHelper protected $_workingDirectory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Downloadable\Helper\File $downloadableFile * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Downloadable\Helper\File $downloadableFile, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem ) { $this->_coreData = $coreData; $this->_downloadableFile = $downloadableFile; diff --git a/app/code/Magento/Downloadable/Helper/File.php b/app/code/Magento/Downloadable/Helper/File.php index b1f1a6cdc96a04f20e2ced8423a1ef0cdf1efc8f..400878f75fa0b23f015d92b1b0d93b1b668c57d8 100644 --- a/app/code/Magento/Downloadable/Helper/File.php +++ b/app/code/Magento/Downloadable/Helper/File.php @@ -32,7 +32,7 @@ namespace Magento\Downloadable\Helper; * @package Magento_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class File extends \Magento\App\Helper\AbstractHelper +class File extends \Magento\Framework\App\Helper\AbstractHelper { /** * Core file storage database @@ -44,7 +44,7 @@ class File extends \Magento\App\Helper\AbstractHelper /** * Filesystem object. * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -56,15 +56,15 @@ class File extends \Magento\App\Helper\AbstractHelper protected $_mediaDirectory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $mimeTypes */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, array $mimeTypes = array() ) { $this->_coreFileStorageDatabase = $coreFileStorageDatabase; diff --git a/app/code/Magento/Downloadable/Model/Observer.php b/app/code/Magento/Downloadable/Model/Observer.php index e837b9b8b5818db44f8d39f555fb439a595dbdc9..2bad57fcdecd0a26ba4b93b8de0b0bc6b033aaac 100644 --- a/app/code/Magento/Downloadable/Model/Observer.php +++ b/app/code/Magento/Downloadable/Model/Observer.php @@ -44,7 +44,7 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -80,7 +80,7 @@ class Observer /** * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Downloadable\Model\Link\Purchased\ItemFactory $itemFactory @@ -90,7 +90,7 @@ class Observer */ public function __construct( \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Downloadable\Model\Link\Purchased\ItemFactory $itemFactory, diff --git a/app/code/Magento/Downloadable/Model/Product/Type.php b/app/code/Magento/Downloadable/Model/Product/Type.php index bb8e5216ed5af06644f47f50b21c2d09cc7ca0c2..91ddbceadf0a5ee0b9e552f105e20d280aff30d3 100644 --- a/app/code/Magento/Downloadable/Model/Product/Type.php +++ b/app/code/Magento/Downloadable/Model/Product/Type.php @@ -83,7 +83,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\Virtual * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\Downloadable\Helper\File $downloadableFile @@ -103,7 +103,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\Virtual \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Downloadable\Helper\File $downloadableFile, diff --git a/app/code/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/Downloadable.php b/app/code/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/Downloadable.php index 7d939001d6ae0c6cadc9a0e8a12fce43da9b32bb..507361e6bd276da56e0dc8094357a57e79b3bfc2 100644 --- a/app/code/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/Downloadable.php +++ b/app/code/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/Downloadable.php @@ -24,7 +24,7 @@ namespace Magento\Downloadable\Model\Product\TypeTransitionManager\Plugin; use Closure; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Plugin for product type transition manager @@ -34,7 +34,7 @@ class Downloadable /** * Request instance * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index 6c678b10aa8a2e49c758a721f9841a0a876d7663..66ced9777a5918e56cd3d2780281d5542a339a50 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -42,7 +42,7 @@ class Link extends \Magento\Model\Resource\Db\AbstractDb protected $_catalogData; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_configuration; @@ -57,16 +57,16 @@ class Link extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $configuration + * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $configuration, + \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager ) { diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php index e8898462f5dabaeaf6a9ae88488b42c4a6684c0e..744a4b8c5fec0061602752a96b136cd4e2dbcc68 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php @@ -40,7 +40,7 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -58,9 +58,9 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param \Magento\Model\Resource\AbstractResource $resource @@ -71,9 +71,9 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index e74208ca77df3234c4e1eac8f316726e6ac50e91..302c90bbe91b6c5df39da0b2627ddcfcf341e490 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -39,9 +39,9 @@ class Creditmemo extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstr * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param \Magento\Stdlib\String $string @@ -53,9 +53,9 @@ class Creditmemo extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstr \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, \Magento\Stdlib\String $string, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index f75d3a7c9240c2475ecc393beaca16ddcdd97f35..d44390addd12a978c7ebc91b4381189a9b88ceb3 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -39,9 +39,9 @@ class Invoice extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstract * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param \Magento\Stdlib\String $string @@ -53,9 +53,9 @@ class Invoice extends \Magento\Downloadable\Model\Sales\Order\Pdf\Items\Abstract \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, \Magento\Stdlib\String $string, diff --git a/app/code/Magento/Downloadable/Pricing/Price/LinkPrice.php b/app/code/Magento/Downloadable/Pricing/Price/LinkPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..8b23c4255adb28f4f6d364c3b164de40e0600aa0 --- /dev/null +++ b/app/code/Magento/Downloadable/Pricing/Price/LinkPrice.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Downloadable\Pricing\Price; + +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\Downloadable\Model\Link; + +/** + * Class LinkPrice Model + * + * @package Magento\Downloadable\Pricing\Price + */ +class LinkPrice extends RegularPrice implements LinkPriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE; + + /** + * @param Link $link + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getLinkAmount(Link $link) + { + return $this->calculator->getAmount($link->getPrice(), $link->getProduct()); + } +} diff --git a/app/code/Magento/Downloadable/Pricing/Price/LinkPriceInterface.php b/app/code/Magento/Downloadable/Pricing/Price/LinkPriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..7ecdb230c9f468bfcd22fe5a38ddc4433cd8ebaf --- /dev/null +++ b/app/code/Magento/Downloadable/Pricing/Price/LinkPriceInterface.php @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Downloadable\Pricing\Price; + +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\Downloadable\Model\Link; +use Magento\Pricing\Adjustment\Calculator; + +/** + * Class LinkPrice Model + * @package Magento\Downloadable\Pricing\Price + */ +interface LinkPriceInterface +{ + /** + * Default price type + */ + const PRICE_TYPE = 'link_price'; + + /** + * @param Link $link + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getLinkAmount(Link $link); +} diff --git a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml index 55ba075238760d764a5dc8d6e140c9979fb865df..003e8b0494027a25f35b8f17dd81dfec366bc32a 100644 --- a/app/code/Magento/Downloadable/etc/adminhtml/routes.xml +++ b/app/code/Magento/Downloadable/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Downloadable" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Downloadable/etc/di.xml b/app/code/Magento/Downloadable/etc/di.xml index b2f4add25d2d3005eb1bf34840c4ecf0f5a5ae6c..bcdc9c8a533538f8d0b066f6ece0b6df46b3e300 100644 --- a/app/code/Magento/Downloadable/etc/di.xml +++ b/app/code/Magento/Downloadable/etc/di.xml @@ -52,4 +52,14 @@ </argument> </arguments> </type> + <type name="Magento\Pricing\PriceComposite"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="link_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\Downloadable\Pricing\Price\LinkPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Downloadable/etc/frontend/routes.xml b/app/code/Magento/Downloadable/etc/frontend/routes.xml index 03f1f8da2fa60da064b20ad1633db9f738951da8..baa62f4d101625a106bfbbfa6498d34372c4a916 100644 --- a/app/code/Magento/Downloadable/etc/frontend/routes.xml +++ b/app/code/Magento/Downloadable/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="downloadable" frontName="downloadable"> <module name="Magento_Downloadable" /> diff --git a/app/code/Magento/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/Magento/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php index b840edd97d64520340417cd92827e681bf1e745e..4b4a041081da1a447a87d0cf25ce518d7d068fae 100644 --- a/app/code/Magento/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/Magento/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -29,7 +29,7 @@ $installFile = __DIR__ . '/upgrade-1.6.0.0.1-1.6.0.0.2.php'; /** @var \Magento\Filesystem\Directory\Read $moduleDirectory */ -$moduleDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); +$moduleDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); if ($moduleDirectory->isExist($moduleDirectory->getRelativePath($installFile))) { include $installFile; } diff --git a/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml index fbb1dc038890df4d9d4f27651edd0232638698ba..f7a0ebedf56c5ad16191fe3cf0fd9484f9410363 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml @@ -48,6 +48,8 @@ <?php endif; ?> <?php if ($_linksPurchasedSeparately): ?> <?php echo $this->getFormattedLinkPrice($_link); ?> + <br /> + <?php echo $this->getLinkPrice($_link); ?> <?php endif; ?> </label> <?php if ($_isRequired): ?> diff --git a/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml b/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml index 7e5808dadb0c00eff01bb1a9e5c77a83f2c74742..f1aa9c5fb08dbe216791a19216b83cb271bbbbf4 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml @@ -57,7 +57,6 @@ </div> </div> - <table cellspacing="0" class="data-table"> <thead> <tr> @@ -75,7 +74,7 @@ </thead> <tfoot> <tr> - <td colspan="8" class="a-right"><?php echo $this->getAddButtonHtml()?></td> + <td colspan="8" class="col-actions-add"><?php echo $this->getAddButtonHtml()?></td> </tr> </tfoot> <tbody id="link_items_body"> diff --git a/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml b/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml index fdfa393c02d0861e031f277de582a67b1d5cc4ed..df88802c3fa974a80d7a809eeb03a0872ab0b1a6 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml @@ -58,7 +58,7 @@ $this->getConfigJson(); </thead> <tfoot> <tr> - <td colspan="4" class="a-right"><?php echo $this->getAddButtonHtml() ?></td> + <td colspan="4" class="col-actions-add"><?php echo $this->getAddButtonHtml() ?></td> </tr> </tfoot> <tbody id="sample_items_body"> diff --git a/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml index 2d0b41fe2889ced7bc739fdad9c60c834bf8b1d9..e89520545b835f0a6a8a28d093cd5407cbb5c74b 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml @@ -42,9 +42,9 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> <br /> <small> @@ -53,7 +53,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> @@ -99,9 +99,9 @@ <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> <br /> <small> @@ -110,7 +110,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> diff --git a/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml index 836a2fb1d1df18ef7eb119b1e804ec8c419928a6..f3bfd91be82940a54a86a73c1e01670300ff7c0d 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml @@ -42,9 +42,9 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> <br /> <small> @@ -53,7 +53,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> @@ -85,9 +85,9 @@ <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> <br /> <small> @@ -96,7 +96,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> diff --git a/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml index 802d6dfdafff77ae71faf8927f68f1f32727a1d3..cdd9f62121cfe495aba60ec535750284e931bfd5 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml @@ -42,9 +42,9 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> <br /> <small> @@ -53,7 +53,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> @@ -92,9 +92,9 @@ <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> <br /> <small> @@ -103,7 +103,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> diff --git a/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml index 3a4e87cf572dec5ad51946e27fb61e205d9531ad..ea561935bcba6dc669afeaeeda1cc12e3690b718 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml @@ -42,9 +42,9 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> <br /> <small> @@ -53,7 +53,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> @@ -85,9 +85,9 @@ <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> <br /> <small> @@ -96,7 +96,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> diff --git a/app/code/Magento/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml index db659a7aa73f8f2bb7342fcc9d990e3a1449bbff..d92a367bf65b3266dc75fdb4cd50dc0975e9687e 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml @@ -54,9 +54,9 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)+$_item->getWeeeTaxAppliedAmount()); ?> <br /> <small> @@ -65,7 +65,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> @@ -98,9 +98,9 @@ <span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 0, 'sales')): // including ?> + <?php if ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0, 'sales')): // including ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): // incl. + weee ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)+$_item->getWeeeTaxAppliedRowAmount()); ?> <br /> <small> @@ -109,7 +109,7 @@ <span class="nobr">+ <?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?> + <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): // excl. + weee + final ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item)); ?> <br /> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> diff --git a/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml b/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml index 7d723584364f69e962a6fc2154072bfcd36eceef..3876174beb55cd41910360260818e918c6515ef0 100644 --- a/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml +++ b/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml @@ -48,7 +48,7 @@ </a> <?php endif; ?> <?php if ($_linksPurchasedSeparately): ?> - <?php echo $this->getFormattedLinkPrice($_link); ?> + <?php echo $this->getLinkPrice($_link); ?> <?php endif; ?> </label> </div> diff --git a/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml b/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml index 64f3e3df5da59f1311abbbf54407f752ce883e9a..78e28b90d196414324e30380b1d625feeb5a1888 100644 --- a/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml +++ b/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml @@ -51,9 +51,10 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -91,13 +92,13 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php else: ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price excl tax" data-th="<?php echo __('Unit Price Excl. Tax'); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> @@ -105,21 +106,21 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite </span> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> @@ -132,14 +133,14 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price incl tax" data-th="<?php echo __('Unit Price Incl. Tax'); ?>"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> @@ -148,22 +149,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> @@ -182,7 +183,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite </td> <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> <td class="col subtotal excl tax" data-th="<?php echo __('Subtotal Excl. Tax'); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> @@ -192,7 +193,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($canApplyMsrp): ?> <span class="cart msrp subtotal">--</span> <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> @@ -203,22 +204,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> @@ -231,7 +232,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> <td class="col subtotal incl tax" data-th="<?php echo __('Subtotal Incl. Tax'); ?>"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> @@ -240,7 +241,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($canApplyMsrp): ?> <span class="cart msrp subtotal">--</span> <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -250,22 +251,22 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart tax info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> diff --git a/app/code/Magento/Downloadable/view/frontend/downloadable.js b/app/code/Magento/Downloadable/view/frontend/downloadable.js index 834ee3d2333987fa3a189908a8f1ee64f39cb8b8..9fc9a90e257872dfb05283e12cc84ecfba99d08a 100644 --- a/app/code/Magento/Downloadable/view/frontend/downloadable.js +++ b/app/code/Magento/Downloadable/view/frontend/downloadable.js @@ -34,11 +34,20 @@ * @private */ _reloadPrice: function() { - var price = 0; + var price = 0, inclTaxPrice = 0, exclTaxPrice = 0; this.element.find(this.options.linkElement + ':checked').each($.proxy(function(index, element) { - price += this.options.config[$(element).val()]; + price += this.options.config[$(element).val()].price; + inclTaxPrice += this.options.config[$(element).val()].inclTaxPrice; + exclTaxPrice += this.options.config[$(element).val()].exclTaxPrice; }, this)); - this.element.trigger('changePrice', {'config': 'config', 'price': {'price': price} }).trigger('reloadPrice'); + this.element.trigger('changePrice', { + 'config': 'config', + 'price': { + 'price': price, + 'inclTaxPrice': inclTaxPrice, + 'exclTaxPrice': exclTaxPrice + } + }).trigger('reloadPrice'); } }); })(jQuery); \ No newline at end of file diff --git a/app/code/Magento/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml index ea52004084361b5bffbcea45dcdb443bde38c24f..a34d12d05d156d01998e76e8815f46063ad6c0ff 100644 --- a/app/code/Magento/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml @@ -54,7 +54,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -63,17 +63,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -81,7 +81,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -94,24 +94,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -119,7 +119,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml index 69692419671ea78300d8c05b1e260d8d831917c0..89010ef779b21937b59b89b5bdcd02cbcaea4783 100644 --- a/app/code/Magento/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml @@ -57,7 +57,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -66,17 +66,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -84,7 +84,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -97,24 +97,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -122,7 +122,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Downloadable/view/frontend/email/order/items/order/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/email/order/items/order/downloadable.phtml index 78063e8b81200314289d0a6a10fe9e25a8da9169..3621927a6b92c67ca5d47890517d2f98489c397f 100644 --- a/app/code/Magento/Downloadable/view/frontend/email/order/items/order/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/email/order/items/order/downloadable.phtml @@ -63,7 +63,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -72,17 +72,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -90,7 +90,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -103,24 +103,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -128,7 +128,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml index bd1cadf6c0b0b5c588357e83cf65a45cb8b8292b..26e3ba19054684e4050acac7bd5c77e3328f7984 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/catalog_product_view_type_downloadable.xml @@ -31,6 +31,14 @@ </block> </referenceContainer> <referenceBlock name="product.info.options.wrapper"> - <block class="Magento\Downloadable\Block\Catalog\Product\Links" name="product.info.downloadable.options" as="type_downloadable_options" before="-" template="catalog/product/links.phtml"/> + <block class="Magento\Downloadable\Block\Catalog\Product\Links" name="product.info.downloadable.options" as="type_downloadable_options" before="-" template="catalog/product/links.phtml"> + <block class="Magento\Catalog\Pricing\Render" name="product.price.link" after="product.info.downloadable.options"> + <arguments> + <argument name="price_render" xsi:type="string">product.price.render.default</argument> + <argument name="price_type_code" xsi:type="string">link_price</argument> + <argument name="display_msrp_help_message" xsi:type="string">1</argument> + </arguments> + </block> + </block> </referenceBlock> </layout> diff --git a/app/code/Magento/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml index 70e320005f169bc6f689cfb2343390d982c907ac..84ff70db61ffbad3882a3d5574d39dfa9d6d0766 100644 --- a/app/code/Magento/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml @@ -35,9 +35,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -78,22 +79,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -102,17 +103,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -121,7 +122,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -134,22 +135,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -158,17 +159,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -177,7 +178,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -192,21 +193,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -215,17 +216,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -234,7 +235,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -247,22 +248,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -271,17 +272,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -289,7 +290,7 @@ </small> <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> diff --git a/app/code/Magento/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml index 9be0ce1ede112e1ac7a3963fb8f3cbbf92e8225c..2a60624b908e36ec389131f9e76c19e9897eb02a 100644 --- a/app/code/Magento/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml @@ -35,10 +35,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -78,21 +78,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -102,17 +102,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -121,7 +121,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -134,23 +134,23 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -159,17 +159,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -178,7 +178,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -195,21 +195,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -218,17 +218,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -237,7 +237,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -250,22 +250,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -276,17 +276,17 @@ <span class="cart tax info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -295,7 +295,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> diff --git a/app/code/Magento/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml b/app/code/Magento/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml index cf41bb41f5cd0bc08c7ae1124a9af56ae068c894..52ce7c43bd435abf02abda6ff46630c6d70731eb 100644 --- a/app/code/Magento/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml @@ -34,10 +34,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -83,22 +83,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -108,17 +108,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -127,7 +127,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> @@ -140,22 +140,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -165,17 +165,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?> @@ -184,7 +184,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> @@ -214,21 +214,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price excl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -238,17 +238,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart tax info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -256,7 +256,7 @@ </small> <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> @@ -269,22 +269,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price incl tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -295,17 +295,17 @@ <span class="cart tax info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?> @@ -314,7 +314,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> diff --git a/app/code/Magento/Eav/Helper/Data.php b/app/code/Magento/Eav/Helper/Data.php index 42354fe29062ab82ebaf76ebf3e2746daab54686..1e394286c17808797a491ea67eea7f0ab87f6ba4 100644 --- a/app/code/Magento/Eav/Helper/Data.php +++ b/app/code/Magento/Eav/Helper/Data.php @@ -28,7 +28,7 @@ namespace Magento\Eav\Helper; /** * Eav data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * XML path to input types validator data in config @@ -50,7 +50,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -65,15 +65,15 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_eavConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Eav\Model\Config $eavConfig ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php index 922d02a50d290f9283918fda65a07695974ef442..df1954c827adac8c3c1930fbbc87b3d32b3f8186 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Model\Exception as CoreException; /** diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Date.php b/app/code/Magento/Eav/Model/Attribute/Data/Date.php index 351885349040ca72a8476448336b84815b9850ce..17992298dc0e650fde39fc3ccf33b59dcb7e4590 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Date.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Date.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute Date Data Model diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php index e099ce0dc76774b506824d178568eb16c6130c6b..aefd9abc8451fea4114e80a762bb3b88ce9a97ef 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/File.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute File Data Model @@ -66,7 +66,7 @@ class File extends \Magento\Eav\Model\Attribute\Data\AbstractData * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -74,12 +74,12 @@ class File extends \Magento\Eav\Model\Attribute\Data\AbstractData \Magento\Locale\ResolverInterface $localeResolver, \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { parent::__construct($localeDate, $logger, $localeResolver); $this->_coreData = $coreData; $this->_fileValidator = $fileValidator; - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); } /** diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php b/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php index e851764ae4ee9621939b3ce7b1fb2213411b6050..cfb3fdf8651670634a2663fb6d1a6b98ce142825 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Multiline.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute Multiply line Data Model diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php b/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php index b30cfb117b5eba765f3fed0695c6fbb49ccc681f..46ce5c81e46db29ff0bdeecec015dafc37f693da 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute Multiply select Data Model diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Select.php b/app/code/Magento/Eav/Model/Attribute/Data/Select.php index 4eab125e57431a81b232fd600e89bf8c7dd05848..e47065fb265586519e1d51b500dc181af1b0bc53 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Select.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Select.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute Select Data Model diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Text.php b/app/code/Magento/Eav/Model/Attribute/Data/Text.php index f521c2b492883ee0e3cba0305db9dcba07822381..f08ecc0154e523e7565d58dda6f7e024eac78ab8 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Text.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Text.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model\Attribute\Data; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Attribute Text Data Model diff --git a/app/code/Magento/Eav/Model/Cache/Type.php b/app/code/Magento/Eav/Model/Cache/Type.php index acbc75e0182772bb169dba60e02343c4524226c3..0166f7180e43b62de02bf1430066e39a2e7be4a0 100644 --- a/app/code/Magento/Eav/Model/Cache/Type.php +++ b/app/code/Magento/Eav/Model/Cache/Type.php @@ -43,9 +43,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'EAV'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Eav/Model/Config.php b/app/code/Magento/Eav/Model/Config.php index 03c172d0dd45bc50e6e7502573c7fd11facc4e7b..fa0b4e7afcd3299421b0eef9d468cd36cf693808 100644 --- a/app/code/Magento/Eav/Model/Config.php +++ b/app/code/Magento/Eav/Model/Config.php @@ -104,7 +104,7 @@ class Config protected $_collectionAttributes = array(); /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -119,15 +119,15 @@ class Config protected $_universalFactory; /** - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param Entity\TypeFactory $entityTypeFactory - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Validator\UniversalFactory $universalFactory */ public function __construct( - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Entity\TypeFactory $entityTypeFactory, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Validator\UniversalFactory $universalFactory ) { $this->_cache = $cache; diff --git a/app/code/Magento/Eav/Model/Entity.php b/app/code/Magento/Eav/Model/Entity.php index 9c89ed84f5aa006c4cd143bc63b45ec29567ee8b..26523c27e94455647b198cd4bf7ffae45ea25b5a 100644 --- a/app/code/Magento/Eav/Model/Entity.php +++ b/app/code/Magento/Eav/Model/Entity.php @@ -48,7 +48,7 @@ class Entity extends \Magento\Eav\Model\Entity\AbstractEntity const DEFAULT_ENTITY_ID_FIELD = 'entity_id'; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -57,7 +57,7 @@ class Entity extends \Magento\Eav\Model\Entity\AbstractEntity * @param array $data */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index f65805b2e53aae1a25eb3b60d3f25a99f1f5297d..b19435a68f194626a3728dfdb1a839626c6201a7 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -28,7 +28,7 @@ namespace Magento\Eav\Model\Entity; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Eav\Model\Entity\Type; use Magento\Model\Exception; -use Magento\App\Config\Element; +use Magento\Framework\App\Config\Element; use Magento\Model\AbstractModel; use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; use Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend; @@ -185,7 +185,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i protected static $_attributeBackendTables = array(); /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -215,7 +215,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i protected $_universalFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Locale\FormatInterface $localeFormat @@ -224,7 +224,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i * @param array $data */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Locale\FormatInterface $localeFormat, @@ -383,7 +383,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i */ public function getTypeId() { - return (int)$this->getEntityType()->getEntityTypeId(); + return (int) $this->getEntityType()->getEntityTypeId(); } /** @@ -491,12 +491,10 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i } } - if (empty($attributeInstance) || - !$attributeInstance instanceof AbstractAttribute || - !$attributeInstance->getId() && !in_array( - $attributeInstance->getAttributeCode(), - $this->getDefaultAttributes() - ) + if (empty($attributeInstance) + || !$attributeInstance instanceof AbstractAttribute + || !$attributeInstance->getId() + && !in_array($attributeInstance->getAttributeCode(), $this->getDefaultAttributes()) ) { return false; } @@ -592,7 +590,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i { $result = $this->_isPartialSave; if ($flag !== null) { - $this->_isPartialSave = (bool)$flag; + $this->_isPartialSave = (bool) $flag; } return $result; } @@ -600,7 +598,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i /** * Retrieve configuration for all attributes * - * @param null|object $object + * @param null|\Magento\Object $object * @return $this */ public function loadAllAttributes($object = null) @@ -665,8 +663,8 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i */ public function attributesCompare($firstAttribute, $secondAttribute) { - $firstSort = $firstAttribute->getSortWeight((int)$this->_sortingSetId); - $secondSort = $secondAttribute->getSortWeight((int)$this->_sortingSetId); + $firstSort = $firstAttribute->getSortWeight((int) $this->_sortingSetId); + $secondSort = $secondAttribute->getSortWeight((int) $this->_sortingSetId); if ($firstSort > $secondSort) { return 1; @@ -717,6 +715,9 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i $part = $methodArr[0]; $method = $methodArr[1]; break; + + default: + break; } $results = array(); foreach ($this->getAttributesByCode() as $attrCode => $attribute) { @@ -740,6 +741,9 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i case 'source': $instance = $attribute->getSource(); break; + + default: + break; } if (!$this->_isCallableAttributeInstance($instance, $method, $args)) { @@ -872,7 +876,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i public function getValueTablePrefix() { if (!$this->_valueTablePrefix) { - $prefix = (string)$this->getEntityType()->getValueTablePrefix(); + $prefix = (string) $this->getEntityType()->getValueTablePrefix(); if (!empty($prefix)) { $this->_valueTablePrefix = $prefix; /** @@ -1344,7 +1348,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i 'value' => $v ); } - } else if (!$this->_isAttributeValueEmpty($attribute, $v)) { + } elseif (!$this->_isAttributeValueEmpty($attribute, $v)) { $insert[$attrId] = $v; } } @@ -1595,7 +1599,7 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i $type = $attribute->getBackendType(); if (($type == 'int' || $type == 'decimal' || $type == 'datetime') && $value === '') { $value = null; - } else if ($type == 'decimal') { + } elseif ($type == 'decimal') { $value = $this->_localeFormat->getNumber($value); } $backendTable = $attribute->getBackendTable(); @@ -1701,9 +1705,9 @@ abstract class AbstractEntity extends \Magento\Model\Resource\AbstractResource i public function delete($object) { if (is_numeric($object)) { - $id = (int)$object; + $id = (int) $object; } elseif ($object instanceof \Magento\Object) { - $id = (int)$object->getId(); + $id = (int) $object->getId(); } $this->_beforeDelete($object); diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index cbc5bdda34038dad86b484ee409dc8c2b5f5fe32..dcedb670ac4f802d7e0d73086112db34f4415db6 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -31,14 +31,19 @@ use Magento\Eav\Exception; * EAV Entity attribute model * * @method \Magento\Eav\Model\Entity\Attribute setOption($value) - * - * @category Magento - * @package Magento_Eav - * @author Magento Core Team <core@magentocommerce.com> */ -class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute implements - \Magento\Object\IdentityInterface +class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute implements \Magento\Object\IdentityInterface { + /** + * Attribute code max length + */ + const ATTRIBUTE_CODE_MAX_LENGTH = 30; + + /** + * Cache tag + */ + const CACHE_TAG = 'EAV_ATTRIBUTE'; + /** * Prefix of model events names * @@ -46,8 +51,6 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im */ protected $_eventPrefix = 'eav_entity_attribute'; - const ATTRIBUTE_CODE_MAX_LENGTH = 30; - /** * Parameter name in event * @@ -57,8 +60,6 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im */ protected $_eventObject = 'attribute'; - const CACHE_TAG = 'EAV_ATTRIBUTE'; - /** * @var string */ @@ -148,6 +149,9 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im case 'increment_id': return 'Magento\Eav\Model\Entity\Attribute\Backend\Increment'; + + default: + break; } return parent::_getDefaultBackendModel(); @@ -341,6 +345,9 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im case 'weight': $field = 'decimal'; break; + + default: + break; } return $field; @@ -382,6 +389,9 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im case 'boolean': $field = 'default_value_yesno'; break; + + default: + break; } return $field; @@ -440,12 +450,12 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im */ public function getSortWeight($setId) { - $groupSortWeight = isset( - $this->_data['attribute_set_info'][$setId]['group_sort'] - ) ? (double)$this->_data['attribute_set_info'][$setId]['group_sort'] * 1000 : 0.0; - $sortWeight = isset( - $this->_data['attribute_set_info'][$setId]['sort'] - ) ? (double)$this->_data['attribute_set_info'][$setId]['sort'] * 0.0001 : 0.0; + $groupSortWeight = isset($this->_data['attribute_set_info'][$setId]['group_sort']) + ? (float) $this->_data['attribute_set_info'][$setId]['group_sort'] * 1000 + : 0.0; + $sortWeight = isset($this->_data['attribute_set_info'][$setId]['sort']) + ? (float) $this->_data['attribute_set_info'][$setId]['sort'] * 0.0001 + : 0.0; return $groupSortWeight + $sortWeight; } diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php index 15d3e03a170880981b2abfaf78bedc761989f671..f76d9c270223e15825fe6a540dfb70af7ad1591f 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php @@ -27,10 +27,6 @@ namespace Magento\Eav\Model\Entity\Attribute; /** * Entity/Attribute/Model - attribute abstract - * - * @category Magento - * @package Magento_Eav - * @author Magento Core Team <core@magentocommerce.com> */ abstract class AbstractAttribute extends \Magento\Model\AbstractModel implements AttributeInterface { @@ -603,11 +599,11 @@ abstract class AbstractAttribute extends \Magento\Model\AbstractModel implements */ public function getIdByCode($entityType, $code) { - $k = "{$entityType}|{$code}"; - if (!isset($this->_attributeIdCache[$k])) { - $this->_attributeIdCache[$k] = $this->getResource()->getIdByCode($entityType, $code); + $cacheKey = "{$entityType}|{$code}"; + if (!isset($this->_attributeIdCache[$cacheKey])) { + $this->_attributeIdCache[$cacheKey] = $this->getResource()->getIdByCode($entityType, $code); } - return $this->_attributeIdCache[$k]; + return $this->_attributeIdCache[$cacheKey]; } /** @@ -731,6 +727,8 @@ abstract class AbstractAttribute extends \Magento\Model\AbstractModel implements 'extra' => null ); break; + default: + break; } return $columns; @@ -805,6 +803,8 @@ abstract class AbstractAttribute extends \Magento\Model\AbstractModel implements 'extra' => null ); break; + default: + break; } return $columns; } @@ -869,6 +869,8 @@ abstract class AbstractAttribute extends \Magento\Model\AbstractModel implements $indexName = 'IDX_' . strtoupper($this->getAttributeCode()); $indexes[$indexName] = array('type' => 'index', 'fields' => array($this->getAttributeCode())); break; + default: + break; } return $indexes; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php index c9942b1985c5ce8dbcb285636e745a547ece8c83..b89fbfd15b73af46a81fc89177b7a94e5a672901 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php @@ -27,10 +27,6 @@ namespace Magento\Eav\Model\Entity\Attribute\Backend; /** * Entity/Attribute/Model - attribute backend abstract - * - * @category Magento - * @package Magento_Eav - * @author Magento Core Team <core@magentocommerce.com> */ abstract class AbstractBackend implements \Magento\Eav\Model\Entity\Attribute\Backend\BackendInterface { @@ -258,10 +254,9 @@ abstract class AbstractBackend implements \Magento\Eav\Model\Entity\Attribute\Ba return false; } - if ($this->getAttribute()->getIsUnique() && !$this->getAttribute()->getIsRequired() && ($value == '' || - $this->getAttribute()->isValueEmpty( - $value - )) + if ($this->getAttribute()->getIsUnique() + && !$this->getAttribute()->getIsRequired() + && ($value == '' || $this->getAttribute()->isValueEmpty($value)) ) { return true; } diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php index e7dc1cd62f6a63b5308ee4e0b009fe4bb120b73b..e9343f6da7cf39772759f107403d1b4f33c8a0f1 100644 --- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php +++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php @@ -115,7 +115,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db protected $_eavConfig; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -140,7 +140,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory @@ -152,7 +152,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, @@ -245,7 +245,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db { if ($entity instanceof \Magento\Eav\Model\Entity\AbstractEntity) { $this->_entity = $entity; - } elseif (is_string($entity) || $entity instanceof \Magento\App\Config\Element) { + } elseif (is_string($entity) || $entity instanceof \Magento\Framework\App\Config\Element) { $this->_entity = $this->_eavEntityFactory->create()->setType($entity); } else { throw new \Magento\Eav\Exception(__('Invalid entity supplied: %1', print_r($entity, 1))); @@ -460,7 +460,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db * * If $attribute == '*' select all attributes * - * @param array|string|integer|\Magento\App\Config\Element $attribute + * @param array|string|integer|\Magento\Framework\App\Config\Element $attribute * @param bool|string $joinType flag for joining attribute * @return $this * @throws \Magento\Eav\Exception diff --git a/app/code/Magento/Eav/Model/Entity/Setup.php b/app/code/Magento/Eav/Model/Entity/Setup.php index 04180802b19c71124979381baf47a7786931570b..0db6a0e1aaeb79ef96d1e3ca07f60cb6928eab33 100644 --- a/app/code/Magento/Eav/Model/Entity/Setup.php +++ b/app/code/Magento/Eav/Model/Entity/Setup.php @@ -28,7 +28,7 @@ namespace Magento\Eav\Model\Entity; class Setup extends \Magento\Module\Setup { /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -45,7 +45,7 @@ class Setup extends \Magento\Module\Setup /** * @param Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory * @param string $moduleName * @param string $connectionName @@ -53,7 +53,7 @@ class Setup extends \Magento\Module\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, $moduleName = 'Magento_Eav', $connectionName = \Magento\Module\Updater\SetupInterface::DEFAULT_SETUP_CONNECTION diff --git a/app/code/Magento/Eav/Model/Entity/Setup/Context.php b/app/code/Magento/Eav/Model/Entity/Setup/Context.php index efb8f0a32a6438ad868a3d557366d9aae67faa74..4683574f4dfdbf61a2dec6aac0500d82ba766f8d 100644 --- a/app/code/Magento/Eav/Model/Entity/Setup/Context.php +++ b/app/code/Magento/Eav/Model/Entity/Setup/Context.php @@ -35,25 +35,25 @@ class Context extends \Magento\Module\Setup\Context /** * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Module\ResourceInterface $resourceResource * @param \Magento\Module\Setup\MigrationFactory $migrationFactory * @param \Magento\Encryption\EncryptorInterface $encryptor - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param PropertyMapperInterface $attributeMapper */ public function __construct( \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Module\Dir\Reader $modulesReader, \Magento\Module\ModuleListInterface $moduleList, \Magento\Module\ResourceInterface $resourceResource, \Magento\Module\Setup\MigrationFactory $migrationFactory, \Magento\Encryption\EncryptorInterface $encryptor, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, PropertyMapperInterface $attributeMapper ) { $this->attributeMapper = $attributeMapper; diff --git a/app/code/Magento/Eav/Model/Form.php b/app/code/Magento/Eav/Model/Form.php index 0d26dbfa43eb4b4e16642e6239e676e32f31d9ad..ca35f642555c8fa845f6829b6fe08fa88637d4e4 100644 --- a/app/code/Magento/Eav/Model/Form.php +++ b/app/code/Magento/Eav/Model/Form.php @@ -25,7 +25,7 @@ */ namespace Magento\Eav\Model; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * EAV Entity Form Model diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php index ab979b3b3fa57ca02dce670267670e5a2628590e..43c2487eb8ec1b007f3055c78dcc943520e50ff2 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php @@ -59,12 +59,12 @@ class Attribute extends \Magento\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Type $eavEntityType */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, Type $eavEntityType ) { diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index 2e2e256eadf8b38fa3f427f37044633fb1904440..1d00563cd0f3819c5664cd689a34776797a9460d 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -42,7 +42,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio protected $_optionValueTable; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_coreResource; @@ -56,7 +56,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Resource $coreResource + * @param \Magento\Framework\App\Resource $coreResource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param mixed $connection * @param \Magento\Model\Resource\Db\AbstractDb $resource @@ -66,7 +66,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Resource $coreResource, + \Magento\Framework\App\Resource $coreResource, \Magento\Store\Model\StoreManagerInterface $storeManager, $connection = null, \Magento\Model\Resource\Db\AbstractDb $resource = null diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php index f7c9d7608a6c75bf6410a1c32ad95aaccc6dfad8..f19bed19920c07065a2502211d524cefae7e41b1 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php @@ -40,11 +40,11 @@ class Set extends \Magento\Model\Resource\Db\AbstractDb protected $_attrGroupFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory ) { parent::__construct($resource); diff --git a/app/code/Magento/Eav/Model/Resource/Helper.php b/app/code/Magento/Eav/Model/Resource/Helper.php index 602fd034db695bd086985426c18590df545757a5..6ffb8e75f410805111c94490ea24efc1b067f153 100644 --- a/app/code/Magento/Eav/Model/Resource/Helper.php +++ b/app/code/Magento/Eav/Model/Resource/Helper.php @@ -37,10 +37,10 @@ class Helper extends \Magento\DB\Helper /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix = 'Magento_Eav') + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix = 'Magento_Eav') { parent::__construct($resource, $modulePrefix); } diff --git a/app/code/Magento/Eav/Model/Validator/Attribute/Data.php b/app/code/Magento/Eav/Model/Validator/Attribute/Data.php index cba4be41f43b873dac9ec89f507ac552ae319411..a43c30cb8a8bac670ee799a71a1c277d373bf40a 100644 --- a/app/code/Magento/Eav/Model/Validator/Attribute/Data.php +++ b/app/code/Magento/Eav/Model/Validator/Attribute/Data.php @@ -164,12 +164,12 @@ class Data extends \Magento\Validator\AbstractValidator * This method return specified $_attributes if they defined by setAttributes method, otherwise if $entity * is EAV-model it returns it's all available attributes, otherwise it return empty array. * - * @param mixed $entity + * @param \Magento\Model\AbstractModel $entity * @return array */ protected function _getAttributes($entity) { - /** @var \Magento\Customer\Model\Attribute[] $attributes */ + /** @var \Magento\Eav\Model\Attribute[] $attributes */ $attributes = array(); if ($this->_attributes) { @@ -177,7 +177,9 @@ class Data extends \Magento\Validator\AbstractValidator } elseif ($entity instanceof \Magento\Model\AbstractModel && $entity->getResource() instanceof \Magento\Eav\Model\Entity\AbstractEntity ) { // $entity is EAV-model - $attributes = $entity->getEntityType()->getAttributeCollection()->getItems(); + /** @var \Magento\Eav\Model\Entity\Type $entityType */ + $entityType = $entity->getEntityType(); + $attributes = $entityType->getAttributeCollection()->getItems(); } $attributesByCode = array(); diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php index 78a34b1dac95e9fc72a201bce4d8c8e2a2213b68..a55c4bb3a9b3d5187c645e0d30bd3eda79247039 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Filter/Type.php @@ -41,8 +41,8 @@ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Select */ protected static $_types = array( null => null, - \Magento\App\TemplateTypesInterface::TYPE_HTML => 'HTML', - \Magento\App\TemplateTypesInterface::TYPE_TEXT => 'Text' + \Magento\Framework\App\TemplateTypesInterface::TYPE_HTML => 'HTML', + \Magento\Framework\App\TemplateTypesInterface::TYPE_TEXT => 'Text' ); /** diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php index 32294a6520d2f40c40e7dac653c8dcda7d64c01e..f069258768179b18f181fec5fe64014c74d88388 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Grid/Renderer/Type.php @@ -40,8 +40,8 @@ class Type extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe * @var array */ protected static $_types = array( - \Magento\App\TemplateTypesInterface::TYPE_HTML => 'HTML', - \Magento\App\TemplateTypesInterface::TYPE_TEXT => 'Text' + \Magento\Framework\App\TemplateTypesInterface::TYPE_HTML => 'HTML', + \Magento\Framework\App\TemplateTypesInterface::TYPE_TEXT => 'Text' ); /** diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php index 77d4bb165cfd68d9243ef635a4e1c2f4b7bfacff..9a3c5235c4ab3ea859fa419fa2e5e2d33722ab54 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php @@ -162,7 +162,7 @@ class Template extends \Magento\Backend\App\Action } if ($request->getParam('_change_type_flag')) { - $template->setTemplateType(\Magento\App\TemplateTypesInterface::TYPE_TEXT); + $template->setTemplateType(\Magento\Framework\App\TemplateTypesInterface::TYPE_TEXT); $template->setTemplateStyles(''); } diff --git a/app/code/Magento/Email/Helper/Data.php b/app/code/Magento/Email/Helper/Data.php index 5bed049ee297d8886be7a74279fd958753b48f30..e468a112fff600146d035735a89df91b9acc8db4 100644 --- a/app/code/Magento/Email/Helper/Data.php +++ b/app/code/Magento/Email/Helper/Data.php @@ -25,6 +25,6 @@ */ namespace Magento\Email\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Email/Model/AbstractTemplate.php b/app/code/Magento/Email/Model/AbstractTemplate.php index 570036f3695bc8dedd6031b22b12e5c12fc2532b..d9013dd29e03fc96fa9fd1eafba886798dcc150c 100644 --- a/app/code/Magento/Email/Model/AbstractTemplate.php +++ b/app/code/Magento/Email/Model/AbstractTemplate.php @@ -25,6 +25,9 @@ */ namespace Magento\Email\Model; +use Magento\Framework\App\TemplateTypesInterface; +use Magento\Model\AbstractModel; + /** * Template model class * @@ -32,7 +35,7 @@ namespace Magento\Email\Model; * @package Magento_Core * @author Magento Core Team <core@magentocommerce.com> */ -abstract class AbstractTemplate extends \Magento\Model\AbstractModel implements \Magento\App\TemplateTypesInterface +abstract class AbstractTemplate extends AbstractModel implements TemplateTypesInterface { /** * Default design area for emulation diff --git a/app/code/Magento/Email/Model/BackendTemplate.php b/app/code/Magento/Email/Model/BackendTemplate.php index 15a8cd92dd423a3c6f6727cad61e7c4e11d9068b..589357b0f995ac2a475437ba6311cd85c8c0a4d7 100644 --- a/app/code/Magento/Email/Model/BackendTemplate.php +++ b/app/code/Magento/Email/Model/BackendTemplate.php @@ -41,10 +41,10 @@ class BackendTemplate extends Template * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Url $viewUrl * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Email\Model\Template\FilterFactory $emailFilterFactory * @param \Magento\Email\Model\Template\Config $emailConfig * @param \Magento\Backend\Model\Config\Structure $structure @@ -58,10 +58,10 @@ class BackendTemplate extends Template \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Url $viewUrl, \Magento\View\FileSystem $viewFileSystem, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Email\Model\Template\FilterFactory $emailFilterFactory, \Magento\Email\Model\Template\Config $emailConfig, \Magento\Backend\Model\Config\Structure $structure, @@ -96,7 +96,7 @@ class BackendTemplate extends Template return array(); } - $configData = $this->_scopeConfig->getValue(null, \Magento\App\ScopeInterface::SCOPE_DEFAULT); + $configData = $this->_scopeConfig->getValue(null, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); $paths = $this->_findEmailTemplateUsages($templateCode, $configData, ''); return $paths; } diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index f555bf9db92b8693cfa12eb9c7a05873b19845b7..6a3a761c920f30ba73678d69ee67641e08af4ff8 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -42,10 +42,10 @@ class Template extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Email/Model/Template.php b/app/code/Magento/Email/Model/Template.php index 05924eb9963dd4f6897fd54b7eb1227be6fc9359..7b3933fb88eb9edfe71d4a6b1a982e470627b83a 100644 --- a/app/code/Magento/Email/Model/Template.php +++ b/app/code/Magento/Email/Model/Template.php @@ -138,7 +138,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento protected $_sendingException = null; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -155,7 +155,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento /** * Scope config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -179,10 +179,10 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Url $viewUrl * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Template\FilterFactory $emailFilterFactory * @param Template\Config $emailConfig * @param array $data @@ -195,10 +195,10 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, StoreManagerInterface $storeManager, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Url $viewUrl, \Magento\View\FileSystem $viewFileSystem, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Email\Model\Template\FilterFactory $emailFilterFactory, \Magento\Email\Model\Template\Config $emailConfig, array $data = array() @@ -238,7 +238,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento ); if ($fileName) { $uploadDir = \Magento\Backend\Model\Config\Backend\Email\Logo::UPLOAD_DIR; - $mediaDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); + $mediaDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); if ($mediaDirectory->isFile($uploadDir . '/' . $fileName)) { return $this->_storeManager->getStore()->getBaseUrl( \Magento\UrlInterface::URL_TYPE_MEDIA @@ -336,7 +336,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate implements \Magento $templateTypeCode = $templateType == 'html' ? self::TYPE_HTML : self::TYPE_TEXT; $this->setTemplateType($templateTypeCode); - $modulesDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $modulesDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $templateText = $modulesDirectory->readFile($modulesDirectory->getRelativePath($templateFile)); if (preg_match('/<!--@subject\s*(.*?)\s*@-->/u', $templateText, $matches)) { diff --git a/app/code/Magento/Email/Model/Template/Config/FileIterator.php b/app/code/Magento/Email/Model/Template/Config/FileIterator.php index 50f19f2d9d5c9f631c36dd47d022086f2d6b8cb1..88f5ef7213edd5e87fa31458a69599fcaca59b70 100644 --- a/app/code/Magento/Email/Model/Template/Config/FileIterator.php +++ b/app/code/Magento/Email/Model/Template/Config/FileIterator.php @@ -36,8 +36,8 @@ class FileIterator extends \Magento\Config\FileIterator /** * @param \Magento\Filesystem\Directory\ReadInterface $directory - * @param array $paths - * @param \Magento\Module\Dir\ReverseResolver $dirResolver + * @param array $paths + * @param \Magento\Module\Dir\ReverseResolver $dirResolver */ public function __construct( \Magento\Filesystem\Directory\ReadInterface $directory, @@ -54,18 +54,14 @@ class FileIterator extends \Magento\Config\FileIterator */ public function current() { - if (!isset($this->cached[$this->key()])) { - $contents = $this->directoryRead->readFile($this->key()); - $path = $this->directoryRead->getAbsolutePath($this->key()); - $moduleName = $this->_moduleDirResolver->getModuleName($path); - if (!$moduleName) { - throw new \UnexpectedValueException( - sprintf("Unable to determine a module, file '%s' belongs to.", $this->key()) - ); - } - $contents = str_replace('<template ', '<template module="' . $moduleName . '" ', $contents); - $this->cached[$this->key()] = $contents; + $path = $this->directoryRead->getAbsolutePath($this->key()); + $moduleName = $this->_moduleDirResolver->getModuleName($path); + if (!$moduleName) { + throw new \UnexpectedValueException( + sprintf("Unable to determine a module, file '%s' belongs to.", $this->key()) + ); } - return $this->cached[$this->key()]; + $contents = $this->directoryRead->readFile($this->key()); + return str_replace('<template ', '<template module="' . $moduleName . '" ', $contents); } } diff --git a/app/code/Magento/Email/Model/Template/Config/FileResolver.php b/app/code/Magento/Email/Model/Template/Config/FileResolver.php index 0b1ab5a45dd3bc92ffb34f309e39ecbbde053a87..8293e20c3a2efa4287eadf01113e807fae086e17 100644 --- a/app/code/Magento/Email/Model/Template/Config/FileResolver.php +++ b/app/code/Magento/Email/Model/Template/Config/FileResolver.php @@ -38,14 +38,14 @@ class FileResolver implements \Magento\Config\FileResolverInterface protected $iteratorFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Email\Model\Template\Config\FileIteratorFactory $iteratorFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Email\Model\Template\Config\FileIteratorFactory $iteratorFactory ) { - $this->directoryRead = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->directoryRead = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->iteratorFactory = $iteratorFactory; } diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 6038198882348747c5ab5a17c147c8129317821f..f60579ad06a2ce0b4cf0cd6d444ace9820e2a8c0 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -106,7 +106,7 @@ class Filter extends \Magento\Filter\Template /** * Setup callbacks for filters * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -120,7 +120,7 @@ class Filter extends \Magento\Filter\Template /** * App state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -129,12 +129,12 @@ class Filter extends \Magento\Filter\Template * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\View\Url $viewUrl - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Model\VariableFactory $coreVariableFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\View\LayoutInterface $layout * @param \Magento\View\LayoutFactory $layoutFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param array $variables * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -144,12 +144,12 @@ class Filter extends \Magento\Filter\Template \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\View\Url $viewUrl, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Model\VariableFactory $coreVariableFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\View\LayoutInterface $layout, \Magento\View\LayoutFactory $layoutFactory, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, $variables = array() ) { $this->_escaper = $escaper; diff --git a/app/code/Magento/Email/Model/Template/SenderResolver.php b/app/code/Magento/Email/Model/Template/SenderResolver.php index 2f167cf57a0a4207e92fbf3f3be00929156d0b7c..4be754738ec700124896180aefad86c212fa168f 100644 --- a/app/code/Magento/Email/Model/Template/SenderResolver.php +++ b/app/code/Magento/Email/Model/Template/SenderResolver.php @@ -30,14 +30,14 @@ class SenderResolver implements \Magento\Mail\Template\SenderResolverInterface /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Email/etc/adminhtml/routes.xml b/app/code/Magento/Email/etc/adminhtml/routes.xml index 01438bf1d99e5a881c305ff534c62bd9ef51e15e..d7931e911a28327fde81fe10a7e4f263894ab51d 100644 --- a/app/code/Magento/Email/etc/adminhtml/routes.xml +++ b/app/code/Magento/Email/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Email" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml index 80f8628cb862f46e7451d1ac7a3263ed4ef992a0..c0bfa00b2c5ee76949224c7c5c3cac1d98ad36ba 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_grid_block.xml @@ -49,6 +49,8 @@ <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="index" xsi:type="string">template_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="code"> @@ -63,6 +65,8 @@ <argument name="index" xsi:type="string">added_at</argument> <argument name="gmtoffset" xsi:type="string">1</argument> <argument name="type" xsi:type="string">datetime</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="modified_at"> @@ -71,6 +75,8 @@ <argument name="index" xsi:type="string">modified_at</argument> <argument name="gmtoffset" xsi:type="string">1</argument> <argument name="type" xsi:type="string">datetime</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="subject"> @@ -93,7 +99,6 @@ <argument name="index" xsi:type="string">template_id</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="filter" xsi:type="string">0</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="renderer" xsi:type="string">Magento\Email\Block\Adminhtml\Template\Grid\Renderer\Action</argument> </arguments> </block> diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index f490c472edf380d3d057aa9fb88cb00b1b414bf0..aff869a51bc214b4e1f479f85e55e841bd8e7b7b 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -128,7 +128,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C protected $_productCollectionFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory @@ -150,7 +150,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, @@ -207,7 +207,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C $client->__setLocation( $this->getConfigFlag( 'sandbox_mode' - ) ? 'https://wsbeta.fedex.com:443/web-services/rate' : 'https://ws.fedex.com:443/web-services/rate' + ) ? $this->getConfigData('sandbox_webservices_url') : $this->getConfigData('production_webservices_url') ); return $client; diff --git a/app/code/Magento/Fedex/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php b/app/code/Magento/Fedex/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php index cdef0c92fdbeb46bc924b821b4870fabe7b6e522..2528a3089368b866d496cd4329a0630dcea891d5 100644 --- a/app/code/Magento/Fedex/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php +++ b/app/code/Magento/Fedex/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php @@ -29,14 +29,14 @@ namespace Magento\Fedex\Model\Plugin\Rma\Block\Adminhtml\Rma\Edit\Tab\General; class Shippingmethod { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Fedex/etc/adminhtml/system.xml b/app/code/Magento/Fedex/etc/adminhtml/system.xml index 5a46b494f5496b5e709837be3fc6f0b44f94a3f5..b992af4f5c0d5873c6b469d9e57b97758c9c8585 100644 --- a/app/code/Magento/Fedex/etc/adminhtml/system.xml +++ b/app/code/Magento/Fedex/etc/adminhtml/system.xml @@ -32,6 +32,10 @@ <label>Enabled for Checkout</label> <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> </field> + <field id="active_rma" translate="label" type="select" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>Enabled for RMA</label> + <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> + </field> <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Title</label> </field> @@ -52,93 +56,101 @@ <label>Password</label> <backend_model>Magento\Backend\Model\Config\Backend\Encrypted</backend_model> </field> - <field id="sandbox_mode" translate="label" type="select" sortOrder="75" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="sandbox_mode" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Sandbox Mode</label> <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> </field> - <field id="shipment_requesttype" translate="label" type="select" sortOrder="77" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="production_webservices_url" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>Web-Services URL (Production)</label> + <depends> + <field id="sandbox_mode">0</field> + </depends> + </field> + <field id="sandbox_webservices_url" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>Web-Services URL (Sandbox)</label> + <depends> + <field id="sandbox_mode">1</field> + </depends> + </field> + <field id="shipment_requesttype" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Packages Request Type</label> <source_model>Magento\Shipping\Model\Config\Source\Online\Requesttype</source_model> </field> - <field id="packaging" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="packaging" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Packaging</label> <source_model>Magento\Fedex\Model\Source\Packaging</source_model> </field> - <field id="dropoff" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="dropoff" translate="label" type="select" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Dropoff</label> <source_model>Magento\Fedex\Model\Source\Dropoff</source_model> </field> - <field id="max_package_weight" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="max_package_weight" translate="label" type="text" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)</label> <validate>validate-number validate-zero-or-greater</validate> </field> - <field id="handling_type" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="handling_type" translate="label" type="select" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Calculate Handling Fee</label> <source_model>Magento\Shipping\Model\Source\HandlingType</source_model> </field> - <field id="handling_action" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="handling_action" translate="label" type="select" sortOrder="160" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Handling Applied</label> <source_model>Magento\Shipping\Model\Source\HandlingAction</source_model> </field> - <field id="handling_fee" translate="label" type="text" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="handling_fee" translate="label" type="text" sortOrder="170" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Handling Fee</label> <validate>validate-number validate-zero-or-greater</validate> </field> - <field id="residence_delivery" translate="label" type="select" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="residence_delivery" translate="label" type="select" sortOrder="180" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Residential Delivery</label> <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> </field> - <field id="allowed_methods" translate="label" type="multiselect" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="allowed_methods" translate="label" type="multiselect" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Allowed Methods</label> <source_model>Magento\Fedex\Model\Source\Method</source_model> <can_be_empty>1</can_be_empty> </field> - <field id="smartpost_hubid" translate="label comment" type="text" sortOrder="155" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="smartpost_hubid" translate="label comment" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Hub ID</label> <comment>The field is applicable if the Smart Post method is selected.</comment> </field> - <field id="free_method" translate="label" type="select" sortOrder="160" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="free_method" translate="label" type="select" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Free Method</label> <frontend_class>free-method</frontend_class> <source_model>Magento\Fedex\Model\Source\Freemethod</source_model> </field> - <field id="free_shipping_enable" translate="label" type="select" sortOrder="170" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="free_shipping_enable" translate="label" type="select" sortOrder="220" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Free Shipping Amount Threshold</label> <source_model>Magento\Backend\Model\Config\Source\Enabledisable</source_model> </field> - <field id="free_shipping_subtotal" translate="label" type="text" sortOrder="180" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="free_shipping_subtotal" translate="label" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Free Shipping Amount Threshold</label> <validate>validate-number validate-zero-or-greater</validate> </field> - <field id="specificerrmsg" translate="label" type="textarea" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="1"> + <field id="specificerrmsg" translate="label" type="textarea" sortOrder="240" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Displayed Error Message</label> </field> - <field id="sallowspecific" translate="label" type="select" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="sallowspecific" translate="label" type="select" sortOrder="250" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Ship to Applicable Countries</label> <frontend_class>shipping-applicable-country</frontend_class> <source_model>Magento\Shipping\Model\Config\Source\Allspecificcountries</source_model> </field> - <field id="specificcountry" translate="label" type="multiselect" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="specificcountry" translate="label" type="multiselect" sortOrder="260" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Ship to Specific Countries</label> <source_model>Magento\Directory\Model\Config\Source\Country</source_model> <can_be_empty>1</can_be_empty> </field> - <field id="debug" translate="label" type="select" sortOrder="220" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="debug" translate="label" type="select" sortOrder="270" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Debug</label> <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> </field> - <field id="showmethod" translate="label" type="select" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="showmethod" translate="label" type="select" sortOrder="280" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Show Method if Not Applicable</label> <frontend_class>shipping-skip-hide</frontend_class> <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> </field> - <field id="sort_order" translate="label" type="text" sortOrder="240" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="sort_order" translate="label" type="text" sortOrder="290" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Sort Order</label> </field> - <field id="active_rma" translate="label" type="select" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="0"> - <label>Enabled for RMA</label> - <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model> - </field> </group> </section> </system> diff --git a/app/code/Magento/Fedex/etc/config.xml b/app/code/Magento/Fedex/etc/config.xml index ece7a9b7afa66cf6ed5fd7232a202ff55f8f1da3..06534d67a856402da33321ed563e1a9be1f6305d 100644 --- a/app/code/Magento/Fedex/etc/config.xml +++ b/app/code/Magento/Fedex/etc/config.xml @@ -33,6 +33,8 @@ <key backend_model="Magento\Backend\Model\Config\Backend\Encrypted" /> <password backend_model="Magento\Backend\Model\Config\Backend\Encrypted" /> <sandbox_mode>0</sandbox_mode> + <production_webservices_url><![CDATA[https://ws.fedex.com:443/web-services/]]></production_webservices_url> + <sandbox_webservices_url><![CDATA[https://wsbeta.fedex.com:443/web-services/]]></sandbox_webservices_url> <shipment_requesttype>0</shipment_requesttype> <active>0</active> <sallowspecific>0</sallowspecific> diff --git a/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php b/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php index e0f491a5f084c296141ed43ba02aa28b510b526f..e9b205fb61740befeed6fc53368ccbf164e32db1 100644 --- a/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php +++ b/app/code/Magento/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php @@ -37,7 +37,7 @@ class Config extends \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -45,14 +45,14 @@ class Config extends \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Config * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection * @param \Magento\Escaper $escaper - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data */ public function __construct( \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Escaper $escaper, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $data = array() ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/GiftMessage/Block/Message/Inline.php b/app/code/Magento/GiftMessage/Block/Message/Inline.php index b275a4495bea9886cf2b0a9aef76ce2332a0dff0..d134d8aeb00f5f3cb8cf06ef7a565aff14772d8f 100644 --- a/app/code/Magento/GiftMessage/Block/Message/Inline.php +++ b/app/code/Magento/GiftMessage/Block/Message/Inline.php @@ -74,7 +74,7 @@ class Inline extends \Magento\View\Element\Template protected $_imageHelper; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -83,7 +83,7 @@ class Inline extends \Magento\View\Element\Template * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\GiftMessage\Helper\Message $giftMessageMessage * @param \Magento\Catalog\Helper\Image $imageHelper - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -91,7 +91,7 @@ class Inline extends \Magento\View\Element\Template \Magento\Customer\Model\Session $customerSession, \Magento\GiftMessage\Helper\Message $giftMessageMessage, \Magento\Catalog\Helper\Image $imageHelper, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_imageHelper = $imageHelper; diff --git a/app/code/Magento/GiftMessage/Helper/Data.php b/app/code/Magento/GiftMessage/Helper/Data.php index 0978c288b09c240f66754e185ec5dbe1f4d24a75..6a98b57d0a4d7f13d4fb63c6923198097207e5f4 100644 --- a/app/code/Magento/GiftMessage/Helper/Data.php +++ b/app/code/Magento/GiftMessage/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\GiftMessage\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/GiftMessage/Helper/Message.php b/app/code/Magento/GiftMessage/Helper/Message.php index 3f5e283babea650b8d31ca6a953e3d0c7c2c670c..e1e741cd5b5bd280ccf794d5dcc6345ef14d1ef7 100644 --- a/app/code/Magento/GiftMessage/Helper/Message.php +++ b/app/code/Magento/GiftMessage/Helper/Message.php @@ -73,32 +73,51 @@ class Message extends \Magento\Core\Helper\Data protected $_escaper; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * Pages to skip message checks + * + * @var array + */ + protected $skipMessageCheck = array(); + + /** + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\View\LayoutFactory $layoutFactory * @param \Magento\GiftMessage\Model\MessageFactory $giftMessageFactory * @param \Magento\Escaper $escaper + * @param array $skipMessageCheck * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\View\LayoutFactory $layoutFactory, \Magento\GiftMessage\Model\MessageFactory $giftMessageFactory, \Magento\Escaper $escaper, + $skipMessageCheck = array(), $dbCompatibleMode = true ) { $this->_escaper = $escaper; $this->_productFactory = $productFactory; $this->_layoutFactory = $layoutFactory; $this->_giftMessageFactory = $giftMessageFactory; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + $this->skipMessageCheck = $skipMessageCheck; + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** @@ -111,20 +130,23 @@ class Message extends \Magento\Core\Helper\Data */ public function getInline($type, \Magento\Object $entity, $dontDisplayContainer = false) { - if (!$this->isMessagesAvailable($type, $entity)) { + if (!$this->skipPage($type) && !$this->isMessagesAvailable($type, $entity)) { return ''; } - return $this->_layoutFactory->create()->createBlock( - 'Magento\GiftMessage\Block\Message\Inline' - )->setId( - 'giftmessage_form_' . $this->_nextId++ - )->setDontDisplayContainer( - $dontDisplayContainer - )->setEntity( - $entity - )->setType( - $type - )->toHtml(); + return $this->_layoutFactory->create()->createBlock('Magento\GiftMessage\Block\Message\Inline') + ->setId('giftmessage_form_' . $this->_nextId++) + ->setDontDisplayContainer($dontDisplayContainer) + ->setEntity($entity) + ->setType($type)->toHtml(); + } + + /** + * @param string $pageType + * @return bool + */ + protected function skipPage($pageType) + { + return in_array($pageType, $this->skipMessageCheck); } /** diff --git a/app/code/Magento/GiftMessage/Model/Resource/Setup.php b/app/code/Magento/GiftMessage/Model/Resource/Setup.php index ce0fb357b72df72ae979189df6424986821e0fa0..251804aaa72e0f71c690f8234e8936c1f9892b91 100644 --- a/app/code/Magento/GiftMessage/Model/Resource/Setup.php +++ b/app/code/Magento/GiftMessage/Model/Resource/Setup.php @@ -35,9 +35,9 @@ class Setup extends \Magento\Sales\Model\Resource\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Resource\SetupFactory $catalogSetupFactory * @param string $moduleName * @param string $connectionName @@ -45,9 +45,9 @@ class Setup extends \Magento\Sales\Model\Resource\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Resource\SetupFactory $catalogSetupFactory, $moduleName = 'Magento_GiftMessage', $connectionName = \Magento\Module\Updater\SetupInterface::DEFAULT_SETUP_CONNECTION diff --git a/app/code/Magento/GiftMessage/etc/frontend/di.xml b/app/code/Magento/GiftMessage/etc/frontend/di.xml index 03c7325be22a7f6ceefac5771e4e8cba560e887b..ce8e0136d79b908974a05e3e3b471974422f919c 100644 --- a/app/code/Magento/GiftMessage/etc/frontend/di.xml +++ b/app/code/Magento/GiftMessage/etc/frontend/di.xml @@ -31,4 +31,12 @@ <type name="Magento\Multishipping\Block\Checkout\Shipping"> <plugin name="getItemsBoxTextAfter" type="Magento\GiftMessage\Block\Message\Multishipping\Plugin\ItemsBox"/> </type> + <type name="Magento\GiftMessage\Helper\Message"> + <arguments> + <argument name="skipMessageCheck" xsi:type="array"> + <item name="checkout_page" xsi:type="string">onepage_checkout</item> + <item name="multishipping_page" xsi:type="string">multishipping_address</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/GiftMessage/etc/frontend/routes.xml b/app/code/Magento/GiftMessage/etc/frontend/routes.xml index 8c3a5c51a98567c220668ada39ac83780e0bf6ef..bcdce1fc1f60f2c9bd90f1b9944c663db1d1d517 100644 --- a/app/code/Magento/GiftMessage/etc/frontend/routes.xml +++ b/app/code/Magento/GiftMessage/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="giftmessage" frontName="giftmessage"> <module name="Magento_GiftMessage" /> diff --git a/app/code/Magento/GoogleAdwords/Helper/Data.php b/app/code/Magento/GoogleAdwords/Helper/Data.php index 8e9c4d171966221c5b68ee3657d7e71c3e0aceb3..c0b8a194b2fa0f8cb496db8abd74a7d587660410 100644 --- a/app/code/Magento/GoogleAdwords/Helper/Data.php +++ b/app/code/Magento/GoogleAdwords/Helper/Data.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleAdwords\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /**#@+ * Google AdWords language codes @@ -86,12 +86,12 @@ class Data extends \Magento\App\Helper\AbstractHelper /**#@-*/ /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -101,15 +101,15 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_registry; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Registry $registry */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Registry $registry ) { parent::__construct($context); diff --git a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php index 2b194a858e34bdfd1e62261c2401538482a1e93e..23ca163306f3eb1a4b9c8c297f7937dfc4ef8588 100644 --- a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php +++ b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php @@ -28,7 +28,7 @@ namespace Magento\GoogleAdwords\Model\Config\Backend; /** * @SuppressWarnings(PHPMD.LongVariable) */ -abstract class AbstractConversion extends \Magento\App\Config\Value +abstract class AbstractConversion extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Validator\Object @@ -43,7 +43,7 @@ abstract class AbstractConversion extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Validator\ObjectFactory $validatorCompositeFactory * @param \Magento\GoogleAdwords\Model\Validator\Factory $validatorFactory * @param \Magento\Model\Resource\AbstractResource $resource @@ -53,7 +53,7 @@ abstract class AbstractConversion extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Validator\ObjectFactory $validatorCompositeFactory, \Magento\GoogleAdwords\Model\Validator\Factory $validatorFactory, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/GoogleAnalytics/Helper/Data.php b/app/code/Magento/GoogleAnalytics/Helper/Data.php index de758157c44e4cb4f643a29e60caaf46e8d04e9e..c0633775c50fce79222f5ab25012e5f4f1786fa9 100644 --- a/app/code/Magento/GoogleAnalytics/Helper/Data.php +++ b/app/code/Magento/GoogleAnalytics/Helper/Data.php @@ -33,7 +33,7 @@ use Magento\Store\Model\Store; * @category Magento * @package Magento_GoogleAnalytics */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Config paths for using throughout the code @@ -45,17 +45,17 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/GoogleOptimizer/Helper/Data.php b/app/code/Magento/GoogleOptimizer/Helper/Data.php index 81262a9fc74a863ef50dd7728f2fc0048c0304d4..24cd9498527b4d384c610f283c854d2fe2cbba08 100644 --- a/app/code/Magento/GoogleOptimizer/Helper/Data.php +++ b/app/code/Magento/GoogleOptimizer/Helper/Data.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleOptimizer\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Xml path google experiments enabled @@ -38,7 +38,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_activeForCmsFlag; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -48,13 +48,13 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_analyticsHelper; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\GoogleAnalytics\Helper\Data $analyticsHelper */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\GoogleAnalytics\Helper\Data $analyticsHelper ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/GoogleOptimizer/Helper/Form.php b/app/code/Magento/GoogleOptimizer/Helper/Form.php index ee92da3a3c70e0df89e8a9a6c04ddff7076a3131..8ab2747a1a1a431133bb1a224937bddcdea60cbc 100644 --- a/app/code/Magento/GoogleOptimizer/Helper/Form.php +++ b/app/code/Magento/GoogleOptimizer/Helper/Form.php @@ -28,7 +28,7 @@ namespace Magento\GoogleOptimizer\Helper; use Magento\GoogleOptimizer\Model\Code as ModelCode; use Magento\Data\Form as DataForm; -class Form extends \Magento\App\Helper\AbstractHelper +class Form extends \Magento\Framework\App\Helper\AbstractHelper { /** * Prepare form diff --git a/app/code/Magento/GoogleOptimizer/Model/Observer/AbstractSave.php b/app/code/Magento/GoogleOptimizer/Model/Observer/AbstractSave.php index 4444b209a31280c802ee56bbbcae67b90e64fcc0..50cbd05b139902f6d194186296f264c88ca7a2e6 100644 --- a/app/code/Magento/GoogleOptimizer/Model/Observer/AbstractSave.php +++ b/app/code/Magento/GoogleOptimizer/Model/Observer/AbstractSave.php @@ -40,7 +40,7 @@ abstract class AbstractSave protected $_modelCode; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -52,12 +52,12 @@ abstract class AbstractSave /** * @param \Magento\GoogleOptimizer\Helper\Data $helper * @param \Magento\GoogleOptimizer\Model\Code $modelCode - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ public function __construct( \Magento\GoogleOptimizer\Helper\Data $helper, \Magento\GoogleOptimizer\Model\Code $modelCode, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { $this->_helper = $helper; $this->_modelCode = $modelCode; diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php index bb3b95446d0db124a1d8986addfaa3f60568ba15..832ba634c818096276c893487116189b6413ff4e 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php @@ -89,11 +89,17 @@ class Item extends \Magento\Backend\Block\Widget\Grid\Extended */ protected function _prepareColumns() { - $this->addColumn('name', array('header' => __('Product'), 'width' => '30%', 'index' => 'name')); + $this->addColumn('name', array('header' => __('Product'), 'index' => 'name')); $this->addColumn( 'expires', - array('header' => __('Expires'), 'type' => 'datetime', 'width' => '100px', 'index' => 'expires') + array( + 'header' => __('Expires'), + 'type' => 'datetime', + 'index' => 'expires', + 'header_css_class' => 'col-period', + 'column_css_class' => 'col-period' + ) ); return parent::_prepareColumns(); diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php index e97243686b1857ef453a71affc3b551fb15c2c19..8370db1e7e1a5023d6846f8fed2adbb92b4d158b 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleShopping\Controller\Adminhtml\Googleshopping; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * GoogleShopping Admin Item Types Controller @@ -53,7 +53,7 @@ class Types extends \Magento\Backend\App\Action * Dispatches controller_action_postdispatch_adminhtml Event * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/GoogleShopping/Helper/Data.php b/app/code/Magento/GoogleShopping/Helper/Data.php index 8e7110c71d65ed4f80024b18e66ebd14a3a0736e..76bf9922ed02491de2e18f75fde505c8c97149da 100644 --- a/app/code/Magento/GoogleShopping/Helper/Data.php +++ b/app/code/Magento/GoogleShopping/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\GoogleShopping\Helper; * @package Magento_GoogleShopping * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Magento string lib @@ -49,12 +49,12 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Stdlib\String $string * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Stdlib\String $string, \Magento\Store\Model\StoreManagerInterface $storeManager ) { diff --git a/app/code/Magento/GoogleShopping/Helper/Product.php b/app/code/Magento/GoogleShopping/Helper/Product.php index 7b156da9bfa66963bdf0e97713ae0fc71aa60ae6..9db6e3c9b5051bb2e0bd22f59f516b8881493326 100644 --- a/app/code/Magento/GoogleShopping/Helper/Product.php +++ b/app/code/Magento/GoogleShopping/Helper/Product.php @@ -32,7 +32,7 @@ namespace Magento\GoogleShopping\Helper; * @package Magento_GoogleShopping * @author Magento Core Team <core@magentocommerce.com> */ -class Product extends \Magento\App\Helper\AbstractHelper +class Product extends \Magento\Framework\App\Helper\AbstractHelper { /** * Product attributes cache diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php index f52ca93edb7a62139f3730a1d57b39ede33f0729..ac23b6cdc179bd64ac53d673981f124735dc3001 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php @@ -37,7 +37,7 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -49,7 +49,7 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\Catalog\Model\Product\CatalogPrice $catalogPrice * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ @@ -61,7 +61,7 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\Catalog\Model\Product\CatalogPrice $catalogPrice, \Magento\GoogleShopping\Model\Resource\Attribute $resource, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php index d6d567d3745358f387734aa7999361a92bd54360..c8e0ee57d9b6d5b67db5a9d0a365add3f0a0db01 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php @@ -45,7 +45,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -78,7 +78,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -93,7 +93,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute \Magento\GoogleShopping\Model\Resource\Attribute $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\GoogleShopping\Model\Config $config, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/GoogleShopping/Model/Config.php b/app/code/Magento/GoogleShopping/Model/Config.php index 1fbeb0e9148e1ee452bed9299c671e02d82be742..6446c5c654bb3e94dbd8773ca110479deaf98580 100644 --- a/app/code/Magento/GoogleShopping/Model/Config.php +++ b/app/code/Magento/GoogleShopping/Model/Config.php @@ -44,7 +44,7 @@ class Config extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -61,13 +61,13 @@ class Config extends \Magento\Object protected $_encryptor; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Encryption\EncryptorInterface $encryptor * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Encryption\EncryptorInterface $encryptor, array $data = array() diff --git a/app/code/Magento/GoogleShopping/Model/Observer.php b/app/code/Magento/GoogleShopping/Model/Observer.php index a788acdfc04bce409d13af752a4d42828e201b46..9e471a584e656d98114694d2a6582a03d2e6565e 100644 --- a/app/code/Magento/GoogleShopping/Model/Observer.php +++ b/app/code/Magento/GoogleShopping/Model/Observer.php @@ -33,7 +33,7 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -74,7 +74,7 @@ class Observer * @param \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory * @param \Magento\GoogleShopping\Model\MassOperationsFactory $operationsFactory * @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\GoogleShopping\Model\Flag $flag */ @@ -82,7 +82,7 @@ class Observer \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory, \Magento\GoogleShopping\Model\MassOperationsFactory $operationsFactory, \Magento\AdminNotification\Model\InboxFactory $inboxFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Message\ManagerInterface $messageManager, \Magento\GoogleShopping\Model\Flag $flag ) { diff --git a/app/code/Magento/GoogleShopping/etc/adminhtml/routes.xml b/app/code/Magento/GoogleShopping/etc/adminhtml/routes.xml index dd53bb2180de3e2492e43809141a053742fafe9a..4063e8ba147bea0320e2a698b8951977b61bb906 100644 --- a/app/code/Magento/GoogleShopping/etc/adminhtml/routes.xml +++ b/app/code/Magento/GoogleShopping/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_GoogleShopping" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/items.phtml b/app/code/Magento/GoogleShopping/view/adminhtml/items.phtml index b438917b940ed62e82eca6a03d2c42d4ba0806d9..9f9019dda041e10418a10a9c03164f8a992e910d 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/items.phtml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/items.phtml @@ -38,7 +38,7 @@ <div class="page-actions"><?php echo $this->getAddButtonHtml() ?></div> <span class="title"><?php echo __('Available Products') ?></span> </div> -<div data-mage-init='{"loader": {}}' data-container="products"> +<div data-mage-init='{"loader": {}}' data-container="products" class="available-products"> <?php echo $this->getChildHtml('product') ?> </div> diff --git a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php index ead55e2fe0d461a2e6df3f7bed78b6c21f77f99e..fb2995df05543ae472ad28cbf8abdb34c4226800 100644 --- a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php +++ b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php @@ -26,14 +26,14 @@ namespace Magento\GroupedProduct\Controller\Adminhtml\Product\Initialization\Hel class Grouped { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ - public function __construct(\Magento\App\RequestInterface $request) + public function __construct(\Magento\Framework\App\RequestInterface $request) { $this->request = $request; } diff --git a/app/code/Magento/GroupedProduct/Model/Import/Entity/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Import/Entity/Product/Type/Grouped.php index 246c617f713ede664d2bcfaf436facc25c758e02..f4a553a6217cc13dfc4ae2ed8645cec4e1f1e883 100644 --- a/app/code/Magento/GroupedProduct/Model/Import/Entity/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Import/Entity/Product/Type/Grouped.php @@ -49,7 +49,7 @@ class Grouped extends AbstractType protected $_importFactory; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -64,7 +64,7 @@ class Grouped extends AbstractType * @param array $params * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\Catalog\Model\Resource\Product\LinkFactory $productLinkFactory - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $attrSetColFac, @@ -72,7 +72,7 @@ class Grouped extends AbstractType array $params, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\Catalog\Model\Resource\Product\LinkFactory $productLinkFactory, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_importFactory = $importFactory; $this->_resource = $resource; diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 07c82525a561c4cd3fbe853327fea028c2c0e94c..40918c55745a56e258b96df26809816039952330 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -91,7 +91,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType protected $productLinks; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -103,13 +103,13 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -122,13 +122,13 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, \Magento\Core\Helper\File\Storage\Database $fileStorageDb, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, array $data = array() ) { $this->productLinks = $catalogProductLink; diff --git a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php index 2301f3083b89d9dc294f1c526790309a62cd107f..b6791af331eae34e5553208b077f034ee87b3e85 100644 --- a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php @@ -52,14 +52,14 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\Resource\Produ * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -77,14 +77,14 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\Resource\Produ \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php new file mode 100644 index 0000000000000000000000000000000000000000..d0964ac2ea516dbe268a3cb0fd7b6ae3a129396b --- /dev/null +++ b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php @@ -0,0 +1,150 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\GroupedProduct\Pricing\Price; + +use Magento\Pricing\Adjustment\Calculator; +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Catalog\Pricing\Price\FinalPriceInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\GroupedProduct\Model\Product\Type\Grouped; +use Magento\Catalog\Model\ProductFactory; + +/** + * Final price model + */ +class FinalPrice implements FinalPriceInterface, PriceInterface +{ + /** + * @var string + */ + protected $priceType = self::PRICE_TYPE_FINAL; + + /** + * @var \Magento\Pricing\Object\SaleableInterface + */ + protected $salableItem; + + /** + * @var \Magento\Pricing\Adjustment\Calculator + */ + protected $calculator; + + /** + * @var SaleableInterface + */ + protected $minProduct; + + /** + * @var AmountInterface + */ + protected $amount; + + /** + * @param SaleableInterface $salableItem + * @param Calculator $calculator + */ + public function __construct( + SaleableInterface $salableItem, + Calculator $calculator + ) { + $this->salableItem = $salableItem; + $this->calculator = $calculator; + } + + /** + * Return minimal product price + * + * @return float + */ + public function getValue() + { + return $this->getMinProduct()->getPriceInfo() + ->getPrice(\Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL)->getValue(); + } + + /** + * Get price type code + * + * @return string + */ + public function getPriceType() + { + return $this->priceType; + } + + /** + * Get Price Amount object + * + * @return AmountInterface + */ + public function getAmount() + { + if (!$this->amount) { + $this->amount = $this->calculator->getAmount($this->getValue(), $this->salableItem); + } + return $this->amount; + } + + /** + * Returns product with minimal price + * + * @return SaleableInterface + */ + public function getMinProduct() + { + if (null === $this->minProduct) { + $products = $this->salableItem->getTypeInstance()->getAssociatedProducts($this->salableItem); + $minPrice = null; + foreach ($products as $item) { + $product = clone $item; + $product->setQty(\Magento\Pricing\PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT); + $price = $product->getPriceInfo() + ->getPrice(FinalPriceInterface::PRICE_TYPE_FINAL) + ->getValue(); + if (($price !== false) && ($price <= (is_null($minPrice) ? $price : $minPrice))) { + $this->minProduct = $product; + $minPrice = $price; + } + } + } + return $this->minProduct; + } + + /** + * @param float $amount + * @param null|string $exclude + * @return AmountInterface + */ + public function getCustomAmount($amount = null, $exclude = null) + { + if ($amount === null) { + $amount = $this->getValue(); + } + return $this->calculator->getAmount($amount, $this->salableItem, $exclude); + } +} diff --git a/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml b/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml index e33621fc0cd4ad8d58cf0dfe7a902b228765f036..ec0956b0947ae7a0dc8b660727e8fad4d80abccb 100644 --- a/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml +++ b/app/code/Magento/GroupedProduct/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="groupedProduct" frontName="groupedProduct"> <module name="Magento_GroupedProduct" /> diff --git a/app/code/Magento/GroupedProduct/etc/di.xml b/app/code/Magento/GroupedProduct/etc/di.xml index ad35efb8b478294f308f3a48a221c065dda991c9..cb9b0ef1b438ddd3f6bfc9f12251e8b54dbc5797 100644 --- a/app/code/Magento/GroupedProduct/etc/di.xml +++ b/app/code/Magento/GroupedProduct/etc/di.xml @@ -68,4 +68,14 @@ <type name="Magento\Catalog\Helper\Product\Configuration"> <plugin name="grouped_options" type="Magento\GroupedProduct\Helper\Product\Configuration\Plugin\Grouped"/> </type> + <type name="Magento\Pricing\PriceComposite"> + <arguments> + <argument name="metadata" xsi:type="array"> + <item name="grouped_final_price" xsi:type="array"> + <item name="class" xsi:type="string">Magento\GroupedProduct\Pricing\Price\FinalPrice</item> + <item name="include_in_base_price" xsi:type="boolean">false</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml index 69728afe86d418880d81f0bbafbf8f40dd9db84c..acf10e12bc919df460fd4c7804079746d7a5997a 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml @@ -27,7 +27,7 @@ <?php /* @var $this \Magento\GroupedProduct\Block\Adminhtml\Product\Composite\Fieldset\Grouped */ ?> <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> -<div id="catalog_product_composite_configure_fields_grouped" class="grid <?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>"> +<div id="catalog_product_composite_configure_fields_grouped" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>"> <h4><?php echo __('Associated Products') ?></h4> <div class="product-options"> <?php $_product = $this->getProduct(); ?> @@ -38,21 +38,16 @@ <p class="availability out-of-stock"><?php echo __('Availability:') ?> <span><?php echo __('Out of stock') ?></span></p> <?php endif; ?> <table class="data-table grouped-items-table" id="super-product-table"> - <col /> - <col /> - <col /> - <col /> - <col width="1" /> <thead> <tr class="headings"> - <th><?php echo __('ID') ?></th> - <th><?php echo __('SKU') ?></th> - <th><?php echo __('Product Name') ?></th> + <th class="col-id"><?php echo __('ID') ?></th> + <th class="col-sku"><?php echo __('SKU') ?></th> + <th class="col-name"><?php echo __('Product Name') ?></th> <?php if ($this->getCanShowProductPrice($_product)): ?> - <th class="a-right"><?php echo __('Price') ?></th> + <th class="col-price"><?php echo __('Price') ?></th> <?php endif; ?> <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?> - <th class="a-center"><?php echo __('Qty') ?></th> + <th class="col-qty"><?php echo __('Qty') ?></th> <?php endif; ?> </tr> </thead> @@ -62,18 +57,18 @@ <?php foreach ($_associatedProducts as $_item): ?> <?php $_finalPriceInclTax = $this->helper('Magento\Catalog\Helper\Product\Price')->getPrice($_item, $_item->getFinalPrice(), true) ?> <tr class="<?php echo (++$i % 2) ? 'even' : 'odd' ?>"> - <td><?php echo $_item->getId() ?></td> - <td><?php echo $this->escapeHtml($_item->getSku()) ?></td> - <td><?php echo $this->escapeHtml($_item->getName()) ?></td> + <td class="col-id"><?php echo $_item->getId() ?></td> + <td class="col-sku"><?php echo $this->escapeHtml($_item->getSku()) ?></td> + <td class="col-name"><?php echo $this->escapeHtml($_item->getName()) ?></td> <?php if ($this->getCanShowProductPrice($_product)): ?> - <td class="a-right"> + <td class="col-price"> <?php if ($this->getCanShowProductPrice($_item)): ?> - <?php echo $this->getPriceHtml($_item, true) ?> + <?php echo $this->getProductPrice($_item) ?> <?php endif; ?> </td> <?php endif; ?> <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?> - <td class="a-center"> + <td class="col-qty"> <?php if ($_item->isSaleable() || $_skipSaleableCheck) : ?> <input type="text" name="super_group[<?php echo $_item->getId() ?>]" id="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo __('Qty') ?>" class="input-text qty" /> <input type="hidden" value="1" price="<?php echo $this->getCurrencyPrice($_item->getPrice()) ?>" qtyId="super_group[<?php echo $_item->getId() ?>]" /> @@ -86,7 +81,7 @@ <?php endforeach; ?> <?php else: ?> <tr> - <td colspan="<?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>4<?php else : ?>3<?php endif; ?>"><?php echo __('No options of this product are available.') ?></td> + <td class="empty-text" colspan="<?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>4<?php else : ?>3<?php endif; ?>"><?php echo __('No options of this product are available.') ?></td> </tr> <?php endif; ?> </tbody> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/css/grouped-product.css b/app/code/Magento/GroupedProduct/view/adminhtml/css/grouped-product.css index 95f7ce9fb5209b4a068b613b9d5a64cfa6ca576d..7d3df2eee89a1d9a424624241299d7c0caf87ef2 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/css/grouped-product.css +++ b/app/code/Magento/GroupedProduct/view/adminhtml/css/grouped-product.css @@ -44,3 +44,43 @@ .ui-dialog.grouped .col-entity_id { width: 2%; } + +#grouped-product-container .col-name { + max-width: 300px; + overflow: hidden; + text-overflow: ellipsis; +} + +#grouped-product-container .col-sku { + max-width: 170px; + overflow: hidden; + text-overflow: ellipsis; +} + +#product_info_tabs_grouped_content .grid-container { + margin-bottom: 10px; +} + +#product_info_tabs_grouped_content .col-draggable { + width: 10px; +} + +#product_info_tabs_grouped_content .col-qty { + width: 80px; +} + +#product_info_tabs_grouped_content .col-actions { + width: 50px; +} + +#product_info_tabs_grouped_content .col-name { + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; +} + +#product_info_tabs_grouped_content .col-sku { + max-width: 170px; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/product/stock/disabler.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/product/stock/disabler.phtml index 45dc2b63868a34544d5593e02a79e4483f083f16..19728a542db64dd56e6e50eecc4e72c1c56d0a30 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/product/stock/disabler.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/product/stock/disabler.phtml @@ -23,12 +23,11 @@ */ ?> <script type="text/javascript"> -jQuery(function($) { +(function($) { $('#product_info_tabs_product-details_content').on('stockbeforedisable', function(e) { if (e.productType === 'grouped') { - e.stopImmediatePropagation(); return false; } }); - }); +})(jQuery); </script> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_prices.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_prices.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa45b6776dcdc4edec5d7423495345d14196bd14 --- /dev/null +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_prices.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="render.product.prices"> + <arguments> + <argument name="grouped" xsi:type="array"> + <item name="prices" xsi:type="array"> + <item name="final_price" xsi:type="array"> + <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item> + <item name="render_template" xsi:type="string">Magento_GroupedProduct::product/price/final_price.phtml</item> + </item> + </item> + </argument> + </arguments> + </referenceBlock> +</layout> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml index c6d6db4a1d60b8acdb43ea63b8df9ddbe73a1b00..7c2c3aee62fd2783fdc80912f0a4129aecabff6c 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml @@ -27,4 +27,10 @@ <referenceBlock name="catalog.product.rss.feed.renderer.list"> <block class="Magento\Catalog\Block\Product\Price" as="grouped" template="Magento_GroupedProduct::rss/product/price.phtml" /> </referenceBlock> + <block class="Magento\Pricing\Render" name="product.price.render.grouped"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </layout> diff --git a/app/code/Magento/GroupedProduct/view/frontend/product/price/final_price.phtml b/app/code/Magento/GroupedProduct/view/frontend/product/price/final_price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..67060f9d95c69f4b087e48b6d09e1fbf74fa50d2 --- /dev/null +++ b/app/code/Magento/GroupedProduct/view/frontend/product/price/final_price.phtml @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** + * Template for displaying grouped product price + */ +?> +<?php +$minProduct = $this->getSaleableItem() + ->getPriceInfo() + ->getPrice('grouped_final_price') + ->getMinProduct(); +$amountRender = $this->getRendererPool() + ->createAmountRender( + $minProduct->getPriceInfo()->getPrice('final_price')->getAmount(), + $minProduct, + $minProduct->getPriceInfo()->getPrice('final_price'), + [] + ); +?> +<div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> + <?php if (\Magento\Pricing\Render::ZONE_ITEM_VIEW != $this->getZone()): ?> + <p class="minimal-price"> + <span class="price-label"><?php echo __('Starting at:') . $amountRender->toHtml();?></span> + </p> + <?php endif ?> +</div> diff --git a/app/code/Magento/GroupedProduct/view/frontend/product/view/type/grouped.phtml b/app/code/Magento/GroupedProduct/view/frontend/product/view/type/grouped.phtml index e609f0b4048f8eae292146a4f5feb476fd8e4594..a4dd31f769677cb802acc6859b9371cccf2211ea 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/product/view/type/grouped.phtml +++ b/app/code/Magento/GroupedProduct/view/frontend/product/view/type/grouped.phtml @@ -60,14 +60,16 @@ <tbody> <?php if ($_hasAssociatedProducts): ?> <?php foreach ($_associatedProducts as $_item): ?> - <?php $_finalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_item, $_item->getFinalPrice(), true) ?> <tr> <td class="col item"><strong class="product name"><?php echo $this->escapeHtml($_item->getName()) ?></strong></td> <?php if ($this->getCanShowProductPrice($_product)): ?> <td class="col price"> <?php if ($this->getCanShowProductPrice($_item)): ?> - <?php echo $this->getPriceHtml($_item, true) ?> - <?php echo $this->getTierPriceHtml($_item) ?> + <?php echo $this->getProductPrice($_item) ?> + <?php echo $this->getProductPriceHtml( + $_item, + \Magento\Catalog\Pricing\Price\TierPriceInterface::PRICE_TYPE_TIER + ) ?> <?php endif; ?> </td> <?php endif; ?> diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php index 850b5fb471e736f6ba5f7f43ad4dd17bb5f38833..c8976d75fa6812dcf768c9deb56c8fa153da4a9d 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php @@ -39,7 +39,7 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended /** * Helper object. * - * @var \Magento\App\Helper\AbstractHelper + * @var \Magento\Framework\App\Helper\AbstractHelper */ protected $_helper; @@ -206,22 +206,22 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended return '<strong>' . __( 'From' ) . - ':</strong> ' . - '<input type="text" name="' . - $name . - '[]" class="input-text input-text-range"' . - ' value="' . - $fromValue . - '"/> ' . - '<strong>' . - __( - 'To' - ) . - ':</strong> <input type="text" name="' . - $name . - '[]" class="input-text input-text-range" value="' . - $toValue . - '" />'; + ':</strong> ' . + '<input type="text" name="' . + $name . + '[]" class="input-text input-text-range"' . + ' value="' . + $fromValue . + '"/> ' . + '<strong>' . + __( + 'To' + ) . + ':</strong> <input type="text" name="' . + $name . + '[]" class="input-text input-text-range" value="' . + $toValue . + '" />'; } /** @@ -285,15 +285,30 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended 'field_name' => \Magento\ImportExport\Model\Export::FILTER_ELEMENT_SKIP . '[]', 'filter' => false, 'sortable' => false, - 'align' => 'center', - 'index' => 'attribute_id' + 'index' => 'attribute_id', + 'header_css_class' => 'col-id', + 'column_css_class' => 'col-id' ) ); $this->addColumn( 'frontend_label', - array('header' => __('Attribute Label'), 'index' => 'frontend_label', 'sortable' => false) + array( + 'header' => __('Attribute Label'), + 'index' => 'frontend_label', + 'sortable' => false, + 'header_css_class' => 'col-label', + 'column_css_class' => 'col-label' + ) + ); + $this->addColumn( + 'attribute_code', + array( + 'header' => __('Attribute Code'), + 'index' => 'attribute_code', + 'header_css_class' => 'col-code', + 'column_css_class' => 'col-code' + ) ); - $this->addColumn('attribute_code', array('header' => __('Attribute Code'), 'index' => 'attribute_code')); $this->addColumn( 'filter', array( diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php index 50fab90781264cc172d80e75ef32a282a1714543..11b15f1033634554212a92357e43b0e3f025cea6 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php @@ -36,17 +36,17 @@ namespace Magento\ImportExport\Controller\Adminhtml; class Export extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -92,7 +92,7 @@ class Export extends \Magento\Backend\App\Action return $this->_fileFactory->create( $model->getFileName(), $model->export(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, $model->getContentType() ); } catch (\Magento\Model\Exception $e) { diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php index 54f40cebb579b364f467c0d314782629272b4b32..878e879708216f4fc36649ce5d84e90bab7acc77 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php @@ -155,9 +155,9 @@ class Import extends \Magento\Backend\App\Action $source = \Magento\ImportExport\Model\Import\Adapter::findAdapterFor( $import->uploadSource(), $this->_objectManager->create( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ) ); $validationResult = $import->validateSource($source); diff --git a/app/code/Magento/ImportExport/Helper/Data.php b/app/code/Magento/ImportExport/Helper/Data.php index 85c1aa525815cafafd926c615158185ba3c9ae28..c8c1ba6f2f9ceda9836f38710d1b2a2b47fd5360 100644 --- a/app/code/Magento/ImportExport/Helper/Data.php +++ b/app/code/Magento/ImportExport/Helper/Data.php @@ -49,23 +49,32 @@ class Data extends \Magento\Core\Helper\Data protected $_fileSize; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\File\Size $fileSize * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\File\Size $fileSize, $dbCompatibleMode = true ) { $this->_fileSize = $fileSize; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** diff --git a/app/code/Magento/ImportExport/Model/AbstractModel.php b/app/code/Magento/ImportExport/Model/AbstractModel.php index cec0c04e6a8d03369eafff2d4f902ac81c97721c..566df52908c769402f2a7dfa46d1522ea01c24b3 100644 --- a/app/code/Magento/ImportExport/Model/AbstractModel.php +++ b/app/code/Magento/ImportExport/Model/AbstractModel.php @@ -78,18 +78,18 @@ abstract class AbstractModel extends \Magento\Object /** * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Logger\AdapterFactory $adapterFactory * @param array $data */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Logger\AdapterFactory $adapterFactory, array $data = array() ) { $this->_logger = $logger; - $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->_adapterFactory = $adapterFactory; parent::__construct($data); } diff --git a/app/code/Magento/ImportExport/Model/Export.php b/app/code/Magento/ImportExport/Model/Export.php index 3b78be536046393354e1a4e7f444456e1b44e0d6..1c498c3cf730b28716bf789ca59b2682c7395538 100644 --- a/app/code/Magento/ImportExport/Model/Export.php +++ b/app/code/Magento/ImportExport/Model/Export.php @@ -80,7 +80,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel /** * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig * @param \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory @@ -89,7 +89,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig, \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory, diff --git a/app/code/Magento/ImportExport/Model/Export/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Export/AbstractEntity.php index 799f0d3f3eb9f0f3c1d2bec97e893eb1a0fb9475..5e8e83d11a50fe079940595691041fb43a26a7e6 100644 --- a/app/code/Magento/ImportExport/Model/Export/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Export/AbstractEntity.php @@ -172,19 +172,19 @@ abstract class AbstractEntity /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/app/code/Magento/ImportExport/Model/Export/Adapter/AbstractAdapter.php b/app/code/Magento/ImportExport/Model/Export/Adapter/AbstractAdapter.php index eb636f0f1cb0efd9d9f5df2745b18b744fe19c8b..728f566a033be58c435be2cea52fb31fb13e590e 100644 --- a/app/code/Magento/ImportExport/Model/Export/Adapter/AbstractAdapter.php +++ b/app/code/Magento/ImportExport/Model/Export/Adapter/AbstractAdapter.php @@ -56,13 +56,13 @@ abstract class AbstractAdapter /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string|null $destination * @throws \Magento\Model\Exception */ - public function __construct(\Magento\App\Filesystem $filesystem, $destination = null) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, $destination = null) { - $this->_directoryHandle = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::SYS_TMP_DIR); + $this->_directoryHandle = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); if (!$destination) { $destination = uniqid('importexport_'); $this->_directoryHandle->touch($destination); diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php index 99ac254884d6d5de4a7cb14e364f211444604ec4..d1e314a4ac9ab0fd97a9df3c8ffe7b96e5cbb47f 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php @@ -75,7 +75,7 @@ abstract class AbstractEav extends \Magento\ImportExport\Model\Export\AbstractEn protected $_localeDate; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory @@ -84,7 +84,7 @@ abstract class AbstractEav extends \Magento\ImportExport\Model\Export\AbstractEn * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEntity.php index 33e5c799547a15a34ee6aa480e395ad01cbbb05a..3876bd69c4f5e9db55768e7cc2609a000aa71189 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEntity.php @@ -168,13 +168,13 @@ abstract class AbstractEntity /** * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Eav\Model\Config $config - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Eav\Model\Config $config, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_localeDate = $localeDate; diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer.php b/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer.php index 1646c942adca115710c608f1611833057c2dc7d7..2166ac8e9b0525d355677827557d4a03d1ee3468 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer.php @@ -104,7 +104,7 @@ class Customer extends \Magento\ImportExport\Model\Export\Entity\AbstractEav protected $_customerCollection; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory @@ -114,7 +114,7 @@ class Customer extends \Magento\ImportExport\Model\Export\Entity\AbstractEav * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer/Address.php b/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer/Address.php index 57ed8f801c01a5ba209ab22430ed3a7db6df8035..417a82e5b82b00321a4929a7f2fbe85ceb1b53c0 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer/Address.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/Eav/Customer/Address.php @@ -129,7 +129,7 @@ class Address extends \Magento\ImportExport\Model\Export\Entity\AbstractEav protected $_customers = array(); /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory @@ -141,7 +141,7 @@ class Address extends \Magento\ImportExport\Model\Export\Entity\AbstractEav * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/Product.php b/app/code/Magento/ImportExport/Model/Export/Entity/Product.php index d8bdbbca7d8045e3c8859f9fbb8b00dc61c4fd4a..28ba76ce0f3d18dea5ce77e7796e2c2dc21781ce 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/Product.php @@ -180,7 +180,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity protected $_categoryColFactory; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resourceModel; @@ -219,7 +219,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity /** * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Eav\Model\Config $config - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Logger $logger * @param \Magento\Catalog\Model\Resource\Product\Collection $collection @@ -237,7 +237,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity public function __construct( \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Eav\Model\Config $config, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Logger $logger, \Magento\Catalog\Model\Resource\Product\Collection $collection, diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 90b81dd3a71f287b8c26709346b924027aa87d14..1c82f3e5481da6c5f291d1f5b8ebc205d075e0f2 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -136,16 +136,16 @@ class Import extends \Magento\ImportExport\Model\AbstractModel protected $_behaviorFactory; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Helper\Data $importExportData - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\ImportExport\Model\Import\ConfigInterface $importConfig * @param \Magento\ImportExport\Model\Import\Entity\Factory $entityFactory * @param \Magento\ImportExport\Model\Resource\Import\Data $importData @@ -158,10 +158,10 @@ class Import extends \Magento\ImportExport\Model\AbstractModel */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Helper\Data $importExportData, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\ImportExport\Model\Import\ConfigInterface $importConfig, \Magento\ImportExport\Model\Import\Entity\Factory $entityFactory, \Magento\ImportExport\Model\Resource\Import\Data $importData, @@ -240,7 +240,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel { return \Magento\ImportExport\Model\Import\Adapter::findAdapterFor( $sourceFile, - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR) + $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR) ); } diff --git a/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php index a9dd0c61a405ef2c68fc6fbe5c8f01afa52c90a0..91d2752d5582c612ad213ab055e95553e549b267 100644 --- a/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php @@ -246,26 +246,26 @@ abstract class AbstractEntity /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param array $data */ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, array $data = array() ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEav.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEav.php index 7aaaf4b6111e2e62a1ed63af3018a568ca6dbe8f..57bdddccb9eddaf943d9a863c9df2de6466bc5b5 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEav.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEav.php @@ -94,10 +94,10 @@ abstract class AbstractEav extends \Magento\ImportExport\Model\Import\AbstractEn /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\Eav\Model\Config $eavConfig @@ -106,10 +106,10 @@ abstract class AbstractEav extends \Magento\ImportExport\Model\Import\AbstractEn public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php index b214882f8b4c6fbc2b32ce19ca9f49d8eb6c535d..0cc9280e2b8030fb4f7d06eff9467a9557b21c2f 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php @@ -225,7 +225,7 @@ abstract class AbstractEntity * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\ImportExport\Model\Resource\Import\Data $importData * @param \Magento\Eav\Model\Config $config - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\String $string */ @@ -234,7 +234,7 @@ abstract class AbstractEntity \Magento\ImportExport\Helper\Data $importExportData, \Magento\ImportExport\Model\Resource\Import\Data $importData, \Magento\Eav\Model\Config $config, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\String $string ) { diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/CustomerComposite.php b/app/code/Magento/ImportExport/Model/Import/Entity/CustomerComposite.php index 9df5b48e24bad1c8149cd1109f6d3370c782f10b..4992ff062c5f0239fef856d9a981b3259731ac74 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/CustomerComposite.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/CustomerComposite.php @@ -146,10 +146,10 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\ImportExport\Model\Resource\Import\CustomerComposite\DataFactory $dataFactory * @param \Magento\ImportExport\Model\Import\Entity\Eav\CustomerFactory $customerFactory * @param \Magento\ImportExport\Model\Import\Entity\Eav\Customer\AddressFactory $addressFactory @@ -160,10 +160,10 @@ class CustomerComposite extends \Magento\ImportExport\Model\Import\AbstractEntit public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\ImportExport\Model\Resource\Import\CustomerComposite\DataFactory $dataFactory, \Magento\ImportExport\Model\Import\Entity\Eav\CustomerFactory $customerFactory, \Magento\ImportExport\Model\Import\Entity\Eav\Customer\AddressFactory $addressFactory, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/AbstractCustomer.php b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/AbstractCustomer.php index 2d670c91ff773ab6b69542e93d8273b8e67cd6a8..53a6ffb8a0ad941c695fa09b2a7325827345270c 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/AbstractCustomer.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/AbstractCustomer.php @@ -83,10 +83,10 @@ abstract class AbstractCustomer extends \Magento\ImportExport\Model\Import\Entit /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\Eav\Model\Config $eavConfig @@ -96,10 +96,10 @@ abstract class AbstractCustomer extends \Magento\ImportExport\Model\Import\Entit public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer.php b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer.php index 06d6fc88eab20632449a5d51a988ed99a41b6448..26ea7f8ae7ac7f3819cb1929dfda9dd7363957af 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer.php @@ -142,10 +142,10 @@ class Customer extends \Magento\ImportExport\Model\Import\Entity\Eav\AbstractCus /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\Eav\Model\Config $eavConfig @@ -157,10 +157,10 @@ class Customer extends \Magento\ImportExport\Model\Import\Entity\Eav\AbstractCus public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer/Address.php b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer/Address.php index 22cb7ad9adc1233761d138888ba0617076157e5c..2ce05ef3fa48b8da0a86727c32783d1f4b15d214 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer/Address.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Eav/Customer/Address.php @@ -237,10 +237,10 @@ class Address extends \Magento\ImportExport\Model\Import\Entity\Eav\AbstractCust /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ImportExport\Model\ImportFactory $importFactory * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ImportExport\Model\Export\Factory $collectionFactory * @param \Magento\Eav\Model\Config $eavConfig @@ -256,10 +256,10 @@ class Address extends \Magento\ImportExport\Model\Import\Entity\Eav\AbstractCust public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ImportExport\Model\ImportFactory $importFactory, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product.php index 1e546734d8cec341704ed63d8e7b72352ac247c6..7ad46d219dcca89e9a7402914a64e247e33b6f14 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product.php @@ -465,7 +465,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\ImportExport\Model\Resource\Import\Data $importData * @param \Magento\Eav\Model\Config $config - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\String $string * @param \Magento\Event\ManagerInterface $eventManager @@ -483,7 +483,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity * @param \Magento\Catalog\Model\Resource\Product\LinkFactory $linkFactory * @param \Magento\ImportExport\Model\Import\Proxy\ProductFactory $proxyProdFactory * @param \Magento\ImportExport\Model\Import\UploaderFactory $uploaderFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\CatalogInventory\Model\Resource\Stock\ItemFactory $stockResItemFac * @param \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -496,7 +496,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity \Magento\ImportExport\Helper\Data $importExportData, \Magento\ImportExport\Model\Resource\Import\Data $importData, \Magento\Eav\Model\Config $config, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\String $string, \Magento\Event\ManagerInterface $eventManager, @@ -514,7 +514,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity \Magento\Catalog\Model\Resource\Product\LinkFactory $linkFactory, \Magento\ImportExport\Model\Import\Proxy\ProductFactory $proxyProdFactory, \Magento\ImportExport\Model\Import\UploaderFactory $uploaderFactory, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\CatalogInventory\Model\Resource\Stock\ItemFactory $stockResItemFac, \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -536,7 +536,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity $this->_linkFactory = $linkFactory; $this->_proxyProdFactory = $proxyProdFactory; $this->_uploaderFactory = $uploaderFactory; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_stockResItemFac = $stockResItemFac; $this->_stockItemFactory = $stockItemFactory; $this->_localeDate = $localeDate; diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Option.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Option.php index 412d84f48ebceaf576a54d917205540d605877ae..473c0c5f549f8bf250785ead117c7babbd7a00fa 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Option.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Option.php @@ -281,7 +281,7 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -291,7 +291,7 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity protected $_importFactory; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -322,14 +322,14 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity /** * @param \Magento\ImportExport\Model\Resource\Import\Data $importData - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\ImportExport\Model\Resource\Helper $resourceHelper * @param \Magento\Store\Model\StoreManagerInterface $_storeManager * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Model\Resource\Product\Option\CollectionFactory $optionColFactory * @param \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $colIteratorFactory * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Stdlib\DateTime $dateTime * @param array $data * @@ -337,14 +337,14 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity */ public function __construct( \Magento\ImportExport\Model\Resource\Import\Data $importData, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\ImportExport\Model\Resource\Helper $resourceHelper, \Magento\Store\Model\StoreManagerInterface $_storeManager, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Resource\Product\Option\CollectionFactory $optionColFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $colIteratorFactory, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Stdlib\DateTime $dateTime, array $data = array() ) { diff --git a/app/code/Magento/ImportExport/Model/Import/Uploader.php b/app/code/Magento/ImportExport/Model/Import/Uploader.php index a0951fa404370e22c914f7a15751d6b76b7be01d..ad87f4305c7491f57bf3b80c11fb935f7dc618c6 100644 --- a/app/code/Magento/ImportExport/Model/Import/Uploader.php +++ b/app/code/Magento/ImportExport/Model/Import/Uploader.php @@ -71,7 +71,7 @@ class Uploader extends \Magento\Core\Model\File\Uploader * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Image\AdapterFactory $imageFactory * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $validator - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $filePath */ public function __construct( @@ -79,7 +79,7 @@ class Uploader extends \Magento\Core\Model\File\Uploader \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Image\AdapterFactory $imageFactory, \Magento\Core\Model\File\Validator\NotProtectedExtension $validator, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $filePath = null ) { if (!is_null($filePath)) { @@ -89,7 +89,7 @@ class Uploader extends \Magento\Core\Model\File\Uploader $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; $this->_validator = $validator; - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); } /** diff --git a/app/code/Magento/ImportExport/Model/Resource/Helper.php b/app/code/Magento/ImportExport/Model/Resource/Helper.php index a3c804b1e68f424b06ec454ee596c2798aa64ff1..b754f9a4b4c512842ff4b4f09a6f8bc3c7d1445c 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Helper.php +++ b/app/code/Magento/ImportExport/Model/Resource/Helper.php @@ -47,10 +47,10 @@ class Helper extends \Magento\DB\Helper // The coefficient of useful data from maximum packet length /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix = 'importexport') + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix = 'importexport') { parent::__construct($resource, $modulePrefix); } diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/CustomerComposite/Data.php index f8509a7bd7270c2ed844fed7045f80cbc0686664..a910d24482633426d58958ae66780818047b669d 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -51,12 +51,12 @@ class Data extends \Magento\ImportExport\Model\Resource\Import\Data /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Core\Helper\Data $coreHelper, array $arguments = array() ) { diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php index 097552568709029a0a1da6d73b34e31bc1c06d9f..2f03fea786e4f34f3d23df5d53146bf13bf55468 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php @@ -49,12 +49,12 @@ class Data extends \Magento\Model\Resource\Db\AbstractDb implements \IteratorAgg /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Core\Helper\Data $coreHelper, array $arguments = array() ) { diff --git a/app/code/Magento/ImportExport/etc/adminhtml/routes.xml b/app/code/Magento/ImportExport/etc/adminhtml/routes.xml index d300d543bd24cab6ed1f58c973b8190f890400d8..0ade5c9aef1ab0f2da42c17052f25d41edcb86ca 100644 --- a/app/code/Magento/ImportExport/etc/adminhtml/routes.xml +++ b/app/code/Magento/ImportExport/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_ImportExport" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Index/App/Indexer.php b/app/code/Magento/Index/App/Indexer.php index eba378764910db1965f0634fa13d35c2d0ee3e15..5a9bd968aa8632578ed0c758e00316c2ecbf8eb0 100644 --- a/app/code/Magento/Index/App/Indexer.php +++ b/app/code/Magento/Index/App/Indexer.php @@ -25,8 +25,8 @@ */ namespace Magento\Index\App; -use Magento\App\Console\Response; -use Magento\AppInterface; +use Magento\Framework\App\Console\Response; +use Magento\Framework\AppInterface; class Indexer implements AppInterface { @@ -38,7 +38,7 @@ class Indexer implements AppInterface protected $_reportDir; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -48,19 +48,19 @@ class Indexer implements AppInterface protected $_indexerFactory; /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $_response; /** * @param string $reportDir - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Index\Model\IndexerFactory $indexerFactory * @param Response $response */ public function __construct( $reportDir, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Index\Model\IndexerFactory $indexerFactory, Response $response ) { @@ -73,12 +73,12 @@ class Indexer implements AppInterface /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { /* Clean reports */ - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $path = $directory->getRelativePath($this->_reportDir); if ($directory->isExist($path)) { $directory->delete($path); diff --git a/app/code/Magento/Index/App/Shell.php b/app/code/Magento/Index/App/Shell.php index a7af2049c500e55215c6ee38b6a5951e91786f7a..e1489af69cdb7ed0fa3204025d0868cb97049465 100644 --- a/app/code/Magento/Index/App/Shell.php +++ b/app/code/Magento/Index/App/Shell.php @@ -25,8 +25,8 @@ */ namespace Magento\Index\App; -use Magento\App\Console\Response; -use Magento\AppInterface; +use Magento\Framework\App\Console\Response; +use Magento\Framework\AppInterface; class Shell implements AppInterface { @@ -43,7 +43,7 @@ class Shell implements AppInterface protected $_shellFactory; /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $_response; @@ -62,7 +62,7 @@ class Shell implements AppInterface /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { diff --git a/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php b/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php index 4947eb46d8bddd599fcf7f19a2ee880ac9c97f4e..7f9cdd557ea2aa0df41981cdd3bfc134bc054bc1 100644 --- a/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php @@ -133,20 +133,18 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { $this->addColumn( 'indexer_code', - array('header' => __('Index'), 'width' => '180', 'align' => 'left', 'index' => 'name', 'sortable' => false) + array('header' => __('Index'), 'index' => 'name', 'sortable' => false) ); $this->addColumn( 'description', - array('header' => __('Description'), 'align' => 'left', 'index' => 'description', 'sortable' => false) + array('header' => __('Description'), 'index' => 'description', 'sortable' => false) ); $this->addColumn( 'mode', array( 'header' => __('Mode'), - 'width' => '150', - 'align' => 'left', 'index' => 'mode', 'type' => 'options', 'options' => $this->_indexProcess->getModesOptions() @@ -157,8 +155,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'status', array( 'header' => __('Status'), - 'width' => '120', - 'align' => 'left', 'index' => 'status', 'type' => 'options', 'options' => $this->_indexProcess->getStatusesOptions(), @@ -171,8 +167,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended array( 'header' => __('Update Required'), 'sortable' => false, - 'width' => '120', - 'align' => 'left', 'index' => 'update_required', 'type' => 'options', 'options' => $this->_indexProcess->getUpdateRequiredOptions(), @@ -185,8 +179,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended array( 'header' => __('Updated'), 'type' => 'datetime', - 'width' => '180', - 'align' => 'left', 'index' => 'ended_at', 'frame_callback' => array($this, 'decorateDate') ) @@ -196,7 +188,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'action', array( 'header' => __('Action'), - 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array( diff --git a/app/code/Magento/Index/Helper/Data.php b/app/code/Magento/Index/Helper/Data.php index cc0b7e61d2809cc637b38726fb508a2cdb26ac81..69ec355480c8253d40a777300c6047abd0de1275 100644 --- a/app/code/Magento/Index/Helper/Data.php +++ b/app/code/Magento/Index/Helper/Data.php @@ -25,6 +25,6 @@ */ namespace Magento\Index\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Index/Model/Lock/Storage.php b/app/code/Magento/Index/Model/Lock/Storage.php index 8378096229bb2e0f5dad7b53db1d91d374358e3d..a61b5d3063e5acc1794ae44c7a1d3512e5c11dc0 100644 --- a/app/code/Magento/Index/Model/Lock/Storage.php +++ b/app/code/Magento/Index/Model/Lock/Storage.php @@ -31,7 +31,7 @@ namespace Magento\Index\Model\Lock; use Magento\Index\Model\Process\File; use Magento\Index\Model\Process\FileFactory; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\WriteInterface; class Storage diff --git a/app/code/Magento/Index/Model/Observer.php b/app/code/Magento/Index/Model/Observer.php index 290fcd3e25a0b4571b125970ee027ca02dacc9e1..997dcc724d43766ce4d809785485c9be577f78c9 100644 --- a/app/code/Magento/Index/Model/Observer.php +++ b/app/code/Magento/Index/Model/Observer.php @@ -149,7 +149,7 @@ class Observer $configData = $observer->getEvent()->getConfigData(); $this->_indexer->processEntityAction( $configData, - \Magento\App\Config\ValueInterface::ENTITY, + \Magento\Framework\App\Config\ValueInterface::ENTITY, \Magento\Index\Model\Event::TYPE_SAVE ); } diff --git a/app/code/Magento/Index/Model/Resource/Process.php b/app/code/Magento/Index/Model/Resource/Process.php index d3c9033b172a71ef97db25286f9f0513a8ce43a5..defc20ba988a633927a11465e3115e0e36b2a92e 100644 --- a/app/code/Magento/Index/Model/Resource/Process.php +++ b/app/code/Magento/Index/Model/Resource/Process.php @@ -42,10 +42,10 @@ class Process extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Index/Model/Shell.php b/app/code/Magento/Index/Model/Shell.php index 29c0afb6e88d853f2e0f2e56475a877e18bd55db..89542f02baf01ebe65972a61c24adfcc2e1c080b 100644 --- a/app/code/Magento/Index/Model/Shell.php +++ b/app/code/Magento/Index/Model/Shell.php @@ -32,7 +32,7 @@ namespace Magento\Index\Model; * @package Magento_Index * @author Magento Core Team <core@magentocommerce.com> */ -class Shell extends \Magento\App\AbstractShell +class Shell extends \Magento\Framework\App\AbstractShell { /** * Error status - whether errors have happened @@ -47,11 +47,11 @@ class Shell extends \Magento\App\AbstractShell protected $_indexer; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $entryPoint * @param Indexer $indexer */ - public function __construct(\Magento\App\Filesystem $filesystem, $entryPoint, Indexer $indexer) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, $entryPoint, Indexer $indexer) { $this->_indexer = $indexer; parent::__construct($filesystem, $entryPoint); diff --git a/app/code/Magento/Index/etc/adminhtml/routes.xml b/app/code/Magento/Index/etc/adminhtml/routes.xml index aedba27ec7c54c3d425b6932dfa24d166b39cfff..90e6c818d90b7f2b460e62fb37ea1fd767e66784 100644 --- a/app/code/Magento/Index/etc/adminhtml/routes.xml +++ b/app/code/Magento/Index/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Index" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Indexer/App/Indexer.php b/app/code/Magento/Indexer/App/Indexer.php index 2822af37707ef7f7ac620f874fb46c097006fc18..e63ffbc0cd741ba054b1423c7c97c980aa61050f 100644 --- a/app/code/Magento/Indexer/App/Indexer.php +++ b/app/code/Magento/Indexer/App/Indexer.php @@ -23,7 +23,7 @@ */ namespace Magento\Indexer\App; -class Indexer implements \Magento\AppInterface +class Indexer implements \Magento\Framework\AppInterface { /** * Report directory @@ -65,7 +65,7 @@ class Indexer implements \Magento\AppInterface public function launch() { /* Clean reports */ - $directory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $path = $directory->getRelativePath($this->reportDir); if ($directory->isExist($path)) { $directory->delete($path); diff --git a/app/code/Magento/Indexer/App/Shell.php b/app/code/Magento/Indexer/App/Shell.php index 9d31630ece195fbc72494b219d36e90d97864e0c..b6ecaa5ecdaa2c00f47875fb5ed06cb9897dde0a 100644 --- a/app/code/Magento/Indexer/App/Shell.php +++ b/app/code/Magento/Indexer/App/Shell.php @@ -23,7 +23,7 @@ */ namespace Magento\Indexer\App; -class Shell implements \Magento\AppInterface +class Shell implements \Magento\Framework\AppInterface { /** * Filename of the entry point script @@ -33,7 +33,7 @@ class Shell implements \Magento\AppInterface protected $entryFileName; /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $response; @@ -45,12 +45,12 @@ class Shell implements \Magento\AppInterface /** * @param string $entryFileName * @param \Magento\Indexer\Model\ShellFactory $shellFactory - * @param \Magento\App\Console\Response $response + * @param \Magento\Framework\App\Console\Response $response */ public function __construct( $entryFileName, \Magento\Indexer\Model\ShellFactory $shellFactory, - \Magento\App\Console\Response $response + \Magento\Framework\App\Console\Response $response ) { $this->entryFileName = $entryFileName; $this->shellFactory = $shellFactory; @@ -60,7 +60,7 @@ class Shell implements \Magento\AppInterface /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { diff --git a/app/code/Magento/Indexer/Model/Shell.php b/app/code/Magento/Indexer/Model/Shell.php index a9c72bdf9a59c3ef97c4283e37ef3d412e1fb666..1601d0cedaf7116d34fb1ea1128a4edd2387f7ef 100644 --- a/app/code/Magento/Indexer/Model/Shell.php +++ b/app/code/Magento/Indexer/Model/Shell.php @@ -23,7 +23,7 @@ */ namespace Magento\Indexer\Model; -class Shell extends \Magento\App\AbstractShell +class Shell extends \Magento\Framework\App\AbstractShell { /** * Error status - whether errors have happened @@ -43,13 +43,13 @@ class Shell extends \Magento\App\AbstractShell protected $indexerFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $entryPoint * @param Indexer\CollectionFactory $indexersFactory * @param IndexerFactory $indexerFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $entryPoint, Indexer\CollectionFactory $indexersFactory, IndexerFactory $indexerFactory diff --git a/app/code/Magento/Indexer/etc/adminhtml/routes.xml b/app/code/Magento/Indexer/etc/adminhtml/routes.xml index 6c4816307ea2e74d4a2689defdceb139af044efa..c842b6169699b9b4e868c4ab11191a54e176490c 100644 --- a/app/code/Magento/Indexer/etc/adminhtml/routes.xml +++ b/app/code/Magento/Indexer/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="indexer" frontName="indexer"> <module name="Magento_Indexer"/> diff --git a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml index bb9049666fde05c525697cee06ab221e35dbd136..e5447068dff9c4e587b3019acaf0c218eb809839 100644 --- a/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml +++ b/app/code/Magento/Indexer/view/adminhtml/layout/indexer_indexer_list_grid.xml @@ -68,7 +68,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="indexer_description"> <arguments> <argument name="header" xsi:type="string" translate="true">Description</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">description</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="column_css_class" xsi:type="string">indexer-description</argument> @@ -77,8 +76,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="indexer_mode"> <arguments> <argument name="header" xsi:type="string" translate="true">Mode</argument> - <argument name="width" xsi:type="string">150</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="getter" xsi:type="string">isScheduled</argument> <argument name="renderer" xsi:type="string">Magento\Indexer\Block\Backend\Grid\Column\Renderer\Scheduled</argument> <argument name="sortable" xsi:type="string">0</argument> @@ -88,8 +85,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="indexer_status"> <arguments> <argument name="header" xsi:type="string" translate="true">Status</argument> - <argument name="width" xsi:type="string">120</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="getter" xsi:type="string">getStatus</argument> <argument name="renderer" xsi:type="string">Magento\Indexer\Block\Backend\Grid\Column\Renderer\Status</argument> <argument name="sortable" xsi:type="string">0</argument> @@ -99,14 +94,13 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="indexer_updated"> <arguments> <argument name="header" xsi:type="string" translate="true">Updated</argument> - <argument name="width" xsi:type="string">180</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">updated</argument> <argument name="type" xsi:type="string">datetime</argument> <argument name="getter" xsi:type="string">getLatestUpdated</argument> <argument name="renderer" xsi:type="string">Magento\Indexer\Block\Backend\Grid\Column\Renderer\Updated</argument> <argument name="sortable" xsi:type="string">0</argument> - <argument name="column_css_class" xsi:type="string">indexer-updated</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Install/App/Action/Plugin/Design.php b/app/code/Magento/Install/App/Action/Plugin/Design.php index be7710e02c597fa8c9bac3422e2af1a9e7d642ea..ee7ad22611d96d28ac2e4bd563b4fbb37af518de 100644 --- a/app/code/Magento/Install/App/Action/Plugin/Design.php +++ b/app/code/Magento/Install/App/Action/Plugin/Design.php @@ -23,22 +23,22 @@ */ namespace Magento\Install\App\Action\Plugin; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; class Design { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_areaList; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; @@ -54,15 +54,15 @@ class Design /** * @param RequestInterface $request - * @param \Magento\App\AreaList $areaList - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\AreaList $areaList + * @param \Magento\Framework\App\State $appState * @param \Magento\View\DesignInterface $viewDesign * @param \Magento\View\Design\Theme\ListInterface $themeList */ public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\AreaList $areaList, - \Magento\App\State $appState, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\AreaList $areaList, + \Magento\Framework\App\State $appState, \Magento\View\DesignInterface $viewDesign, \Magento\View\Design\Theme\ListInterface $themeList ) { diff --git a/app/code/Magento/Install/App/Action/Plugin/Dir.php b/app/code/Magento/Install/App/Action/Plugin/Dir.php index 070c20423e120605c8a839e6fb18123b1d92790b..4de4667e7d9eac2f6f7987cd70612ab1784a097c 100644 --- a/app/code/Magento/Install/App/Action/Plugin/Dir.php +++ b/app/code/Magento/Install/App/Action/Plugin/Dir.php @@ -24,10 +24,10 @@ */ namespace Magento\Install\App\Action\Plugin; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\FilesystemException; use Magento\Filesystem\Directory\Write; -use Magento\App\State; +use Magento\Framework\App\State; use Magento\Logger; class Dir @@ -69,12 +69,12 @@ class Dir * Clear temporary directories * * @param \Magento\Install\Controller\Index $subject - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function beforeDispatch(\Magento\Install\Controller\Index $subject, \Magento\App\RequestInterface $request) + public function beforeDispatch(\Magento\Install\Controller\Index $subject, \Magento\Framework\App\RequestInterface $request) { if (!$this->appState->isInstalled()) { foreach ($this->varDirectory->read() as $dir) { diff --git a/app/code/Magento/Install/App/Action/Plugin/Install.php b/app/code/Magento/Install/App/Action/Plugin/Install.php index 57e3b716c500cd8c826c4ae3a8f50aeb9344d001..e70266fb88048529b547f72bf4a9b3569baaeece 100644 --- a/app/code/Magento/Install/App/Action/Plugin/Install.php +++ b/app/code/Magento/Install/App/Action/Plugin/Install.php @@ -27,12 +27,12 @@ namespace Magento\Install\App\Action\Plugin; class Install { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; @@ -42,21 +42,21 @@ class Install protected $_url; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; /** - * @param \Magento\App\State $appState - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\UrlInterface $url - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ActionFlag $actionFlag */ public function __construct( - \Magento\App\State $appState, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\ResponseInterface $response, \Magento\UrlInterface $url, - \Magento\App\ActionFlag $actionFlag + \Magento\Framework\App\ActionFlag $actionFlag ) { $this->_appState = $appState; $this->_response = $response; @@ -67,18 +67,18 @@ class Install /** * Dispatch request * - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if (!$this->_appState->isInstalled()) { - $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true); + $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $this->_response->setRedirect($this->_url->getUrl('install')); return $this->_response; } diff --git a/app/code/Magento/Install/App/Console.php b/app/code/Magento/Install/App/Console.php index 806e11ef9f6667d78b07e27fc7972333ec0d8059..fc8d4e072dc936ce839f32e93087ea71b597a762 100644 --- a/app/code/Magento/Install/App/Console.php +++ b/app/code/Magento/Install/App/Console.php @@ -25,9 +25,9 @@ */ namespace Magento\Install\App; -use Magento\App\Console\Response; +use Magento\Framework\App\Console\Response; -class Console implements \Magento\AppInterface +class Console implements \Magento\Framework\AppInterface { /** * @var \Magento\Install\Model\Installer\ConsoleFactory @@ -41,12 +41,12 @@ class Console implements \Magento\AppInterface protected $_output; /** - * @var \Magento\App\ObjectManager\ConfigLoader + * @var \Magento\Framework\App\ObjectManager\ConfigLoader */ protected $_loader; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_state; @@ -61,31 +61,31 @@ class Console implements \Magento\AppInterface protected $rootDirectory; /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $_response; /** * @param \Magento\Install\Model\Installer\ConsoleFactory $installerFactory * @param \Magento\Install\App\Output $output - * @param \Magento\App\State $state - * @param \Magento\App\ObjectManager\ConfigLoader $loader + * @param \Magento\Framework\App\State $state + * @param \Magento\Framework\App\ObjectManager\ConfigLoader $loader * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param Response $response * @param array $arguments */ public function __construct( \Magento\Install\Model\Installer\ConsoleFactory $installerFactory, \Magento\Install\App\Output $output, - \Magento\App\State $state, - \Magento\App\ObjectManager\ConfigLoader $loader, + \Magento\Framework\App\State $state, + \Magento\Framework\App\ObjectManager\ConfigLoader $loader, \Magento\ObjectManager $objectManager, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, Response $response, array $arguments = array() ) { - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_loader = $loader; $this->_state = $state; $this->_installerFactory = $installerFactory; @@ -107,13 +107,13 @@ class Console implements \Magento\AppInterface if (!empty($args[\Magento\Install\Model\Installer\Console::OPTION_URIS])) { $uris = unserialize(base64_decode($args[\Magento\Install\Model\Installer\Console::OPTION_URIS])); foreach ($uris as $code => $uri) { - $args[\Magento\App\Filesystem::PARAM_APP_DIRS][$code]['uri'] = $uri; + $args[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS][$code]['uri'] = $uri; } } if (!empty($args[\Magento\Install\Model\Installer\Console::OPTION_DIRS])) { $dirs = unserialize(base64_decode($args[\Magento\Install\Model\Installer\Console::OPTION_DIRS])); foreach ($dirs as $code => $dir) { - $args[\Magento\App\Filesystem::PARAM_APP_DIRS][$code]['path'] = $dir; + $args[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS][$code]['path'] = $dir; } } return $args; @@ -157,7 +157,7 @@ class Console implements \Magento\AppInterface /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { diff --git a/app/code/Magento/Install/Block/Begin.php b/app/code/Magento/Install/Block/Begin.php index feba8d80b64a41ff82a267f89750fbb2edf80d7d..7d8b72caa90201fdd1d94abf8ee731c9b2806ff7 100644 --- a/app/code/Magento/Install/Block/Begin.php +++ b/app/code/Magento/Install/Block/Begin.php @@ -81,7 +81,7 @@ class Begin extends \Magento\Install\Block\AbstractBlock public function getLicenseHtml() { return $this->_eulaFile ? $this->_filesystem->getDirectoryRead( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->readFile( $this->_eulaFile ) : ''; diff --git a/app/code/Magento/Install/Block/Download.php b/app/code/Magento/Install/Block/Download.php index 827a0e5ea3e7e837e501c295f4465a40ee4402a6..740ec515c5e84a590fe0e379db1711c460f47d42 100644 --- a/app/code/Magento/Install/Block/Download.php +++ b/app/code/Magento/Install/Block/Download.php @@ -87,7 +87,7 @@ class Download extends \Magento\Install\Block\AbstractBlock public function hasLocalCopy() { $path = $this->_moduleReader->getModuleDir('etc', 'Magento_Adminhtml'); - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); if ($path && $directory->isDirectory($directory->getRelativePath($path))) { return true; diff --git a/app/code/Magento/Install/Controller/Action.php b/app/code/Magento/Install/Controller/Action.php index 5baf57323cb7161244f32d6635e10d7db2f19376..ae79365c3513283b4c59848efc56c6bc21be28ca 100644 --- a/app/code/Magento/Install/Controller/Action.php +++ b/app/code/Magento/Install/Controller/Action.php @@ -25,13 +25,13 @@ */ namespace Magento\Install\Controller; -class Action extends \Magento\App\Action\Action +class Action extends \Magento\Framework\App\Action\Action { /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Config\Scope $configScope */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Config\Scope $configScope) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Config\Scope $configScope) { parent::__construct($context); $configScope->setCurrentScope('install'); diff --git a/app/code/Magento/Install/Controller/Index.php b/app/code/Magento/Install/Controller/Index.php index c64360e28634bb3da79403065c5e705648c1623e..2d09ed3de328b3d3a6fbf8534fa3c1f744508915 100644 --- a/app/code/Magento/Install/Controller/Index.php +++ b/app/code/Magento/Install/Controller/Index.php @@ -33,10 +33,10 @@ namespace Magento\Install\Controller; class Index extends \Magento\Install\Controller\Action { /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Config\Scope $configScope */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Config\Scope $configScope) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Config\Scope $configScope) { parent::__construct($context, $configScope); } diff --git a/app/code/Magento/Install/Controller/Wizard.php b/app/code/Magento/Install/Controller/Wizard.php index 154fdb4608c460d7388e1ea178ea60dd43cfe369..a2ac1a027bc0aa31ec9abaecaeb11d32dd1140b0 100644 --- a/app/code/Magento/Install/Controller/Wizard.php +++ b/app/code/Magento/Install/Controller/Wizard.php @@ -25,8 +25,8 @@ */ namespace Magento\Install\Controller; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; /** * Installation wizard controller @@ -36,7 +36,7 @@ class Wizard extends \Magento\Install\Controller\Action /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -69,24 +69,24 @@ class Wizard extends \Magento\Install\Controller\Action protected $_dbUpdater; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Config\Scope $configScope * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $wizard * @param \Magento\Session\Generic $session * @param \Magento\Module\UpdaterInterface $dbUpdater * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Config\Scope $configScope, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $wizard, \Magento\Session\Generic $session, \Magento\Module\UpdaterInterface $dbUpdater, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState + \Magento\Framework\App\State $appState ) { $this->_storeManager = $storeManager; parent::__construct($context, $configScope); @@ -104,7 +104,7 @@ class Wizard extends \Magento\Install\Controller\Action * Throw a bootstrap exception if page cannot be displayed due to mis-configured base directories * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Install/Helper/Data.php b/app/code/Magento/Install/Helper/Data.php index d97a7e4f3556159f52e4175558dcdcc765bafe6a..55b03b5fb52cf88df1442b00da0691eba982e6b5 100644 --- a/app/code/Magento/Install/Helper/Data.php +++ b/app/code/Magento/Install/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Install\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Install/Model/Config.php b/app/code/Magento/Install/Model/Config.php index d3d3d459abd6b5330f6d314849922647d8c6c042..03cd3a3d1d750ea24d03969c77bfe866de5c0916 100644 --- a/app/code/Magento/Install/Model/Config.php +++ b/app/code/Magento/Install/Model/Config.php @@ -45,7 +45,7 @@ class Config /** * Filesystem * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -53,9 +53,9 @@ class Config * Constructor * * @param Config\Data $dataStorage - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\Install\Model\Config\Data $dataStorage, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Install\Model\Config\Data $dataStorage, \Magento\Framework\App\Filesystem $filesystem) { $this->_dataStorage = $dataStorage; $this->filesystem = $filesystem; diff --git a/app/code/Magento/Install/Model/Installer.php b/app/code/Magento/Install/Model/Installer.php index 8e36ad4e4fff9350b6bd8a838e293eb182ef382d..9c3cb14311eb3d6194fae3ea17e730b58ca3e7e8 100644 --- a/app/code/Magento/Install/Model/Installer.php +++ b/app/code/Magento/Install/Model/Installer.php @@ -47,24 +47,24 @@ class Installer extends \Magento\Object /** * Application chache model * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; /** * Application config model * - * @var \Magento\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\App\Config\ReinitableConfigInterface */ protected $_config; /** - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -90,14 +90,14 @@ class Installer extends \Magento\Object /** * Area list * - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_areaList; /** * Application * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -137,7 +137,7 @@ class Installer extends \Magento\Object protected $_session; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -154,7 +154,7 @@ class Installer extends \Magento\Object /** * Configuration arguments * - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $_arguments; @@ -184,15 +184,15 @@ class Installer extends \Magento\Object protected $_localeResolver; /** - * @param \Magento\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config * @param \Magento\Module\UpdaterInterface $dbUpdater - * @param \Magento\App\CacheInterface $cache - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\CacheInterface $cache + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Install\Model\Setup $installSetup - * @param \Magento\App\Arguments $arguments - * @param \Magento\App\AreaList $areaList - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\Arguments $arguments + * @param \Magento\Framework\App\AreaList $areaList + * @param \Magento\Framework\App\State $appState * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\User\Model\UserFactory $userModelFactory * @param Installer\Filesystem $filesystem @@ -202,7 +202,7 @@ class Installer extends \Magento\Object * @param \Magento\Session\Generic $session * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Math\Random $mathRandom - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Module\DependencyManagerInterface $dependencyManager * @param \Magento\Message\ManagerInterface $messageManager @@ -211,15 +211,15 @@ class Installer extends \Magento\Object * @param array $data */ public function __construct( - \Magento\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Module\UpdaterInterface $dbUpdater, - \Magento\App\CacheInterface $cache, - \Magento\App\Cache\TypeListInterface $cacheTypeList, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\CacheInterface $cache, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Install\Model\Setup $installSetup, - \Magento\App\Arguments $arguments, - \Magento\App\AreaList $areaList, - \Magento\App\State $appState, + \Magento\Framework\App\Arguments $arguments, + \Magento\Framework\App\AreaList $areaList, + \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\User\Model\UserFactory $userModelFactory, \Magento\Install\Model\Installer\Filesystem $filesystem, @@ -229,7 +229,7 @@ class Installer extends \Magento\Object \Magento\Session\Generic $session, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Math\Random $mathRandom, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Module\ModuleListInterface $moduleList, \Magento\Module\DependencyManagerInterface $dependencyManager, \Magento\Message\ManagerInterface $messageManager, @@ -495,7 +495,7 @@ class Installer extends \Magento\Object // \Magento\User\Model\User belongs to adminhtml area $this->_areaList ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) - ->load(\Magento\App\AreaInterface::PART_CONFIG); + ->load(\Magento\Framework\App\AreaInterface::PART_CONFIG); /** @var $user \Magento\User\Model\User */ $user = $this->_userModelFactory->create(); diff --git a/app/code/Magento/Install/Model/Installer/Config.php b/app/code/Magento/Install/Model/Installer/Config.php index 56380a0f96084b5deed727011b1fc428e9889e45..bd0fd70ea574438024a4dd70fc9fa6841413808d 100644 --- a/app/code/Magento/Install/Model/Installer/Config.php +++ b/app/code/Magento/Install/Model/Installer/Config.php @@ -42,7 +42,7 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller protected $_localConfigFile = 'local.xml'; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -52,7 +52,7 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller protected $_configData = array(); /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -80,15 +80,15 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller /** * @param \Magento\Install\Model\Installer $installer - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( \Magento\Install\Model\Installer $installer, - \Magento\App\RequestInterface $request, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Message\ManagerInterface $messageManager ) { @@ -96,8 +96,8 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller $this->_request = $request; $this->_storeManager = $storeManager; $this->_filesystem = $filesystem; - $this->_pubDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::PUB_LIB_DIR); - $this->_configDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::CONFIG_DIR); + $this->_pubDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::PUB_LIB_DIR); + $this->_configDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::CONFIG_DIR); $this->messageManager = $messageManager; } @@ -131,9 +131,9 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller $data = $this->getConfigData(); $defaults = array( - 'root_dir' => $this->_filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR), - 'app_dir' => $this->_filesystem->getPath(\Magento\App\Filesystem::APP_DIR), - 'var_dir' => $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR), + 'root_dir' => $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR), + 'app_dir' => $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::APP_DIR), + 'var_dir' => $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR), 'base_url' => $this->_request->getDistroBaseUrl() ); foreach ($defaults as $index => $value) { @@ -230,7 +230,7 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller try { $staticFile = $this->_findFirstFileRelativePath('', '/.+\.(html?|js|css|gif|jpe?g|png)$/'); $staticUrl = $baseUrl . $this->_filesystem->getUri( - \Magento\App\Filesystem::PUB_LIB_DIR + \Magento\Framework\App\Filesystem::PUB_LIB_DIR ) . '/' . $staticFile; $client = new \Magento\HTTP\ZendClient($staticUrl); $response = $client->request('GET'); diff --git a/app/code/Magento/Install/Model/Installer/Console.php b/app/code/Magento/Install/Model/Installer/Console.php index f4e35e4c68e008b178fd1d0332f6135d8d3341d6..0e8e9a1190d8e8d1290c9d627f1b00db53606834 100644 --- a/app/code/Magento/Install/Model/Installer/Console.php +++ b/app/code/Magento/Install/Model/Installer/Console.php @@ -92,7 +92,7 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller ); /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -106,7 +106,7 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller /** * Resource config * - * @var \Magento\App\Resource\Config + * @var \Magento\Framework\App\Resource\Config */ protected $_resourceConfig; @@ -127,7 +127,7 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller /** * Application State * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -147,21 +147,21 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller /** * @param \Magento\Install\Model\Installer $installer - * @param \Magento\App\Resource\Config $resourceConfig + * @param \Magento\Framework\App\Resource\Config $resourceConfig * @param \Magento\Module\UpdaterInterface $dbUpdater - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Install\Model\Installer\Data $installerData - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Locale\ListsInterface $localeLists * @param \Magento\ObjectManager $objectManager */ public function __construct( \Magento\Install\Model\Installer $installer, - \Magento\App\Resource\Config $resourceConfig, + \Magento\Framework\App\Resource\Config $resourceConfig, \Magento\Module\UpdaterInterface $dbUpdater, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Install\Model\Installer\Data $installerData, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Locale\ListsInterface $localeLists, \Magento\ObjectManager $objectManager ) { @@ -384,7 +384,7 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller /** * Change directories mode to be writable by apache user */ - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR)->changePermissions('', 0777); + $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR)->changePermissions('', 0777); return $encryptionKey; } catch (\Exception $e) { @@ -426,13 +426,13 @@ class Console extends \Magento\Install\Model\Installer\AbstractInstaller $this->_cleanUpDatabase(); /* Remove temporary directories and local.xml */ - $varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $varDirectory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); foreach ($varDirectory->read() as $path) { if ($varDirectory->isDirectory($path)) { $varDirectory->delete($path); } } - $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::CONFIG_DIR)->delete('local.xml'); + $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::CONFIG_DIR)->delete('local.xml'); return true; } diff --git a/app/code/Magento/Install/Model/Installer/Db/AbstractDb.php b/app/code/Magento/Install/Model/Installer/Db/AbstractDb.php index ed42f7631206920a37018f908b536457c800c0cf..90178b998ae2918b8d45875f74cc36e69ad21021 100644 --- a/app/code/Magento/Install/Model/Installer/Db/AbstractDb.php +++ b/app/code/Magento/Install/Model/Installer/Db/AbstractDb.php @@ -73,18 +73,18 @@ abstract class AbstractDb /** * Configuration arguments * - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $_arguments; /** * @param \Magento\Model\Resource\Type\Db\Pdo\MysqlFactory $adapterFactory - * @param \Magento\App\Arguments $arguments + * @param \Magento\Framework\App\Arguments $arguments * @param array $dbExtensions */ public function __construct( \Magento\Model\Resource\Type\Db\Pdo\MysqlFactory $adapterFactory, - \Magento\App\Arguments $arguments, + \Magento\Framework\App\Arguments $arguments, array $dbExtensions = array() ) { $this->_adapterFactory = $adapterFactory; diff --git a/app/code/Magento/Install/Model/Installer/Filesystem.php b/app/code/Magento/Install/Model/Installer/Filesystem.php index a3470690da1982db7573ae4628cbe9f2c908fc3e..9ba1d3e0cc51eed70e6370c0cf2eff48b61e0be5 100644 --- a/app/code/Magento/Install/Model/Installer/Filesystem.php +++ b/app/code/Magento/Install/Model/Installer/Filesystem.php @@ -40,7 +40,7 @@ class Filesystem extends \Magento\Install\Model\Installer\AbstractInstaller /**#@- */ /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -65,13 +65,13 @@ class Filesystem extends \Magento\Install\Model\Installer\AbstractInstaller /** * @param \Magento\Install\Model\Installer $installer - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Install\Model\Config $installConfig * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( \Magento\Install\Model\Installer $installer, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Install\Model\Config $installConfig, \Magento\Message\ManagerInterface $messageManager ) { @@ -127,7 +127,7 @@ class Filesystem extends \Magento\Install\Model\Installer\AbstractInstaller protected function _checkFullPath($fullPath, $recursive, $existence) { $result = true; - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $path = $directory->getRelativePath($fullPath); if ($recursive && $directory->isDirectory($path)) { $pathsToCheck = $directory->read($path); diff --git a/app/code/Magento/Install/Model/Setup.php b/app/code/Magento/Install/Model/Setup.php index b1fcca378bc8439945ec7a4e7362b2287f07d62b..94fa40704dd5ec54dff5c7b35a355f6ffda7fee0 100644 --- a/app/code/Magento/Install/Model/Setup.php +++ b/app/code/Magento/Install/Model/Setup.php @@ -36,7 +36,7 @@ class Setup extends \Magento\Module\Setup * @param int $scopeId * @return $this */ - public function setConfigData($path, $value, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) + public function setConfigData($path, $value, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) { $table = $this->getTable('core_config_data'); // this is a fix for mysql 4.1 diff --git a/app/code/Magento/Install/Model/Wizard.php b/app/code/Magento/Install/Model/Wizard.php index e5007b4e996eb38455278c3da350f70ba10d258b..21a1d1edfa679a7d5f43406dd4ac9dd4939b9b4e 100644 --- a/app/code/Magento/Install/Model/Wizard.php +++ b/app/code/Magento/Install/Model/Wizard.php @@ -97,10 +97,10 @@ class Wizard /** * Get wizard step by request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return \Magento\Object|bool */ - public function getStepByRequest(\Magento\App\RequestInterface $request) + public function getStepByRequest(\Magento\Framework\App\RequestInterface $request) { foreach ($this->_steps as $step) { if ($step->getController() == $request->getControllerName() && diff --git a/app/code/Magento/Install/etc/di.xml b/app/code/Magento/Install/etc/di.xml index 7d3e17f83b579dd2f8552aa8c620b2de80b8e003..caa8fee2d9c8ebeee1c1305f44a66a2db3b7a989 100644 --- a/app/code/Magento/Install/etc/di.xml +++ b/app/code/Magento/Install/etc/di.xml @@ -126,7 +126,7 @@ <argument name="installer" xsi:type="object">Magento\Install\Model\Installer\Proxy</argument> </arguments> </type> - <type name="Magento\App\AreaList"> + <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> <item name="install" xsi:type="array"> @@ -141,7 +141,7 @@ <argument name="areaCode" xsi:type="string">adminhtml</argument> </arguments> </type> - <type name="Magento\App\Action\Action"> + <type name="Magento\Framework\App\Action\Action"> <plugin name="installInitializer" type="Magento\Install\App\Action\Plugin\Install" sortOrder="5"/> </type> <type name="Magento\Install\Model\Setup"> diff --git a/app/code/Magento/Install/etc/frontend/routes.xml b/app/code/Magento/Install/etc/frontend/routes.xml index a3e5a89f1f8356113540f15e8a0515e98cd97513..5149bd8af323cb16413be7bb35b45508a52da6a1 100644 --- a/app/code/Magento/Install/etc/frontend/routes.xml +++ b/app/code/Magento/Install/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="install" frontName="install"> <module name="Magento_Install" /> diff --git a/app/code/Magento/Install/etc/install/di.xml b/app/code/Magento/Install/etc/install/di.xml index ec4b144de731b4f8a79ebcedfaa15609d02a54aa..aa1da0aeb4c70251f214805ddeff38dceeacc6f8 100644 --- a/app/code/Magento/Install/etc/install/di.xml +++ b/app/code/Magento/Install/etc/install/di.xml @@ -25,7 +25,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Core\Model\Theme" type="Magento\Core\Model\Theme\Data" /> - <type name="Magento\App\RouterList" shared="true"> + <type name="Magento\Framework\App\RouterList" shared="true"> <arguments> <argument name="routerList" xsi:type="array"> <item name="install" xsi:type="array"> diff --git a/app/code/Magento/Install/etc/install/routes.xml b/app/code/Magento/Install/etc/install/routes.xml index 570ae3060506afcd7ec9a69d77520a96721c6e7d..88e8680934a6ef5ca7f9e546615b3d5d93a2992c 100644 --- a/app/code/Magento/Install/etc/install/routes.xml +++ b/app/code/Magento/Install/etc/install/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="install"> <route id="install" frontName="install"> <module name="Magento_Install" /> diff --git a/app/code/Magento/Install/i18n/en_US.csv b/app/code/Magento/Install/i18n/en_US.csv index 43192dd0f4c3f869f1565925fac44c37248aae9c..95e1e4e67f913833cfa72d63104c3d2c004a5875 100644 --- a/app/code/Magento/Install/i18n/en_US.csv +++ b/app/code/Magento/Install/i18n/en_US.csv @@ -123,3 +123,4 @@ "You could enable this option to use web server rewrites functionality for improved search engines optimization.","You could enable this option to use web server rewrites functionality for improved search engines optimization." "You're All Set","You're All Set" "You're All Set!","You're All Set!" +"Something went wrong while connecting to the database.","Something went wrong while connecting to the database." diff --git a/app/code/Magento/Install/view/install/page.phtml b/app/code/Magento/Install/view/install/page.phtml index 8214c287ecc9a50187fe08aa1a8524080ffa3c20..bd15bba5a3f9bafb32d6576744b3fb5f3adfc599 100644 --- a/app/code/Magento/Install/view/install/page.phtml +++ b/app/code/Magento/Install/view/install/page.phtml @@ -113,7 +113,7 @@ <p class="legality"> <?php echo __('Help Us Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" - target="varien_external"><strong><?php echo __('Report All Bugs') ?></strong></a> <?php echo __('(ver. %1)', \Magento\AppInterface::VERSION) ?> + target="varien_external"><strong><?php echo __('Report All Bugs') ?></strong></a> <?php echo __('(ver. %1)', \Magento\Framework\AppInterface::VERSION) ?> <br/> <?php echo $this->getChildHtml('copyright');?> </p> diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php index f2c00b0c45631159a9e4ebe010258af015857423..54e1a7d1ea226bfefba4bed8678cf8bd30d6a750 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php @@ -26,7 +26,6 @@ namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer; use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; -use Magento\Customer\Block\Account\AuthorizationLink; use Magento\Object; class Link extends AbstractRenderer diff --git a/app/code/Magento/Integration/Controller/Token.php b/app/code/Magento/Integration/Controller/Token.php index 59ca14cdb662443071e79261d8440a1e4624e72c..bedbee3440f961afaa36789cf2407cb70155e8e8 100644 --- a/app/code/Magento/Integration/Controller/Token.php +++ b/app/code/Magento/Integration/Controller/Token.php @@ -30,7 +30,7 @@ use Magento\Integration\Model\Integration as IntegrationModel; /** * oAuth token controller */ -class Token extends \Magento\App\Action\Action +class Token extends \Magento\Framework\App\Action\Action { /** @var \Magento\Oauth\OauthInterface */ protected $_oauthService; @@ -45,14 +45,14 @@ class Token extends \Magento\App\Action\Action protected $_helper; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Oauth\OauthInterface $oauthService * @param IntegrationOauthService $intOauthService * @param IntegrationService $integrationService * @param \Magento\Oauth\Helper\Request $helper */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Oauth\OauthInterface $oauthService, IntegrationOauthService $intOauthService, IntegrationService $integrationService, diff --git a/app/code/Magento/Integration/Helper/Data.php b/app/code/Magento/Integration/Helper/Data.php index 2beb670913b3cfc3db8e45c2fe92e3ba6b4c0f4d..8cd6062fc94a1f96e4914b470d859c2c91d80177 100644 --- a/app/code/Magento/Integration/Helper/Data.php +++ b/app/code/Magento/Integration/Helper/Data.php @@ -25,7 +25,7 @@ namespace Magento\Integration\Helper; use Magento\Integration\Model\Integration as IntegrationModel; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Make ACL resource array compatible with jQuery jsTree component. diff --git a/app/code/Magento/Integration/Helper/Oauth/Data.php b/app/code/Magento/Integration/Helper/Oauth/Data.php index b342af3b6e01b8528981a797cbb76556d936f172..5057c88ca6a280d52da9a799bbde31e8dd136e13 100644 --- a/app/code/Magento/Integration/Helper/Oauth/Data.php +++ b/app/code/Magento/Integration/Helper/Oauth/Data.php @@ -28,13 +28,13 @@ namespace Magento\Integration\Helper\Oauth; */ class Data { - /** @var \Magento\App\Config\ScopeConfigInterface */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Integration/Model/Cache/Type.php b/app/code/Magento/Integration/Model/Cache/Type.php index d4711826353599294e8923285cddeacabff4f6bc..cb0cb42903e387ab4120030ca765a40cd0dbd376 100644 --- a/app/code/Magento/Integration/Model/Cache/Type.php +++ b/app/code/Magento/Integration/Model/Cache/Type.php @@ -41,9 +41,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'INTEGRATION'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Integration/Model/Config.php b/app/code/Magento/Integration/Model/Config.php index 299ce5d8e5cde15b7c74806474cce0cc82eeae2e..6adee3895f13eefc96710029efc459601e328239 100644 --- a/app/code/Magento/Integration/Model/Config.php +++ b/app/code/Magento/Integration/Model/Config.php @@ -35,7 +35,7 @@ class Config const CACHE_ID = 'integration'; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index f8f12fc2a4157ce06cd2b48264eacf8fd129a3b7..58716f90d1bd6b901d9c9c924a6f03afcd6a46d7 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -31,10 +31,10 @@ class Consumer extends \Magento\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->_dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index 97c600e34feef29ea230d97f62ab836b1d241991..5ca5e9d7fdd185413fea848d215b6f4bba126ee6 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -36,10 +36,10 @@ class Token extends \Magento\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->_dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Integration/etc/adminhtml/routes.xml b/app/code/Magento/Integration/etc/adminhtml/routes.xml index 2a6dc9e849606cbcc66b17e1aa5e97f10992907f..81f8d779524ce1eda381abfd45b775060b038d98 100644 --- a/app/code/Magento/Integration/etc/adminhtml/routes.xml +++ b/app/code/Magento/Integration/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Integration" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Integration/etc/frontend/routes.xml b/app/code/Magento/Integration/etc/frontend/routes.xml index 99a9cc7b63b0e475a7b186372e6ea236179d31c8..11ae3aa131ffa596de480f1d1e0dde51fff67847 100644 --- a/app/code/Magento/Integration/etc/frontend/routes.xml +++ b/app/code/Magento/Integration/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="oauth" frontName="oauth"> <module name="Magento_Integration" /> diff --git a/app/code/Magento/Integration/view/adminhtml/integration.css b/app/code/Magento/Integration/view/adminhtml/integration.css index 5c2a8c8cb0ff313b71d88ad4209988e1c4fcaeff..8f7cb5584e476510426ee7fef8c4dccae01e681e 100644 --- a/app/code/Magento/Integration/view/adminhtml/integration.css +++ b/app/code/Magento/Integration/view/adminhtml/integration.css @@ -21,21 +21,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -#integrationGrid_table .col-name { - width: 75%; -} - -#integrationGrid_table .col-status, -#integrationGrid_table .col-reauthorize, -#integrationGrid_table .col-authorize { - width: 10%; -} - -#integrationGrid_table .col-delete, -#integrationGrid_table .col-edit { - width: 2%; -} - #integration-popup-container #resource-tree { max-height: 170px; overflow: auto; diff --git a/app/code/Magento/Integration/view/adminhtml/js/integration.js b/app/code/Magento/Integration/view/adminhtml/js/integration.js index 76fce8fad403be52fc57a25592a353f78c89dadb..69157d6ca4de91d08f0727c1c8614a2921b2c6c1 100644 --- a/app/code/Magento/Integration/view/adminhtml/js/integration.js +++ b/app/code/Magento/Integration/view/adminhtml/js/integration.js @@ -94,7 +94,7 @@ }, error: function (jqXHR, status, error) { alert($.mage.__('Sorry, something went wrong. Please try again later.')); - console && console.log(status + ': ' + error + "\nResponse text:\n" + jqXHR.responseText); + window.console && console.log(status + ': ' + error + "\nResponse text:\n" + jqXHR.responseText); }, complete: function () { jQuery('body').trigger('processStop'); @@ -267,7 +267,7 @@ }, error: function (jqXHR, status, error) { alert($.mage.__('Sorry, something went wrong. Please try again later.')); - console && console.log(status + ': ' + error + "\nResponse text:\n" + jqXHR.responseText); + window.console && console.log(status + ': ' + error + "\nResponse text:\n" + jqXHR.responseText); }, complete: function () { // Hide the spinner diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layer/view.phtml b/app/code/Magento/LayeredNavigation/view/frontend/layer/view.phtml index 173ae7a68d52304111eec3cd7b7224568fd853c8..f061ad515b34a824536d1685ac00ffb05fe4927c 100644 --- a/app/code/Magento/LayeredNavigation/view/frontend/layer/view.phtml +++ b/app/code/Magento/LayeredNavigation/view/frontend/layer/view.phtml @@ -29,19 +29,24 @@ * @var $this \Magento\LayeredNavigation\Block\Navigation */ ?> + <?php if($this->canShowBlock()): ?> <div class="block filter"> <div class="title"> <strong><?php echo __('Shop By') ?></strong> </div> + <div class="content"> <?php echo $this->getChildHtml('state') ?> + <?php if ($this->getLayer()->getState()->getFilters()): ?> <div class="actions"> - <a href="<?php echo $this->getClearUrl() ?>" class="action reset"><?php echo __('Clear All') ?></a> + <a href="<?php echo $this->getClearUrl() ?>" class="action clear"><span><?php echo __('Clear All') ?></span></a> </div> <?php endif; ?> + <strong class="subtitle"><?php echo __('Shopping Options') ?></strong> + <dl class="options" id="narrow-by-list"> <?php foreach ($this->getFilters() as $filter): ?> <?php if ($filter->getItemsCount()): ?> diff --git a/app/code/Magento/Log/App/Shell.php b/app/code/Magento/Log/App/Shell.php index 1cd2bfee5f8bc36dffefaa672b54b270b4bd6ce6..eebdacb3bf00dab51bcbd7bfee3f147f2a538ecb 100644 --- a/app/code/Magento/Log/App/Shell.php +++ b/app/code/Magento/Log/App/Shell.php @@ -25,8 +25,8 @@ */ namespace Magento\Log\App; -use Magento\App\Console\Response; -use Magento\AppInterface; +use Magento\Framework\App\Console\Response; +use Magento\Framework\AppInterface; class Shell implements AppInterface { @@ -43,7 +43,7 @@ class Shell implements AppInterface protected $_shellFactory; /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $_response; @@ -62,7 +62,7 @@ class Shell implements AppInterface /** * Run application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch() { diff --git a/app/code/Magento/Log/Helper/Data.php b/app/code/Magento/Log/Helper/Data.php index f3b77b1f0106688e497b081e8ac04711b38edea4..afcf77c622f24cd005d3c983201559f91c2e13fb 100644 --- a/app/code/Magento/Log/Helper/Data.php +++ b/app/code/Magento/Log/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Log\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Log/Model/Cron.php b/app/code/Magento/Log/Model/Cron.php index 2c5ca83c0ef0b55dab15654b6db5834f63bb8af9..7cc31c932983bd79ce06530501723b9dc23cd533 100644 --- a/app/code/Magento/Log/Model/Cron.php +++ b/app/code/Magento/Log/Model/Cron.php @@ -54,7 +54,7 @@ class Cron extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -84,7 +84,7 @@ class Cron extends \Magento\Model\AbstractModel * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Log\Model\Log $log * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Translate\Inline\StateInterface $inlineTranslation * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -96,7 +96,7 @@ class Cron extends \Magento\Model\AbstractModel \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Log\Model\Log $log, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Translate\Inline\StateInterface $inlineTranslation, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/Model/Log.php b/app/code/Magento/Log/Model/Log.php index cb48b1b144b6da43fd73eb806812930d1666ffa7..879533f252451c2221273849b908bb920a8288b1 100644 --- a/app/code/Magento/Log/Model/Log.php +++ b/app/code/Magento/Log/Model/Log.php @@ -52,14 +52,14 @@ class Log extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -67,7 +67,7 @@ class Log extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index 218a5bc0bc040848fa791a62660c06335151006b..3263e6f56e93e77c7bcb998753711a94b6a7e051 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -52,13 +52,13 @@ class Log extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime diff --git a/app/code/Magento/Log/Model/Resource/Shell.php b/app/code/Magento/Log/Model/Resource/Shell.php index 4ca3dba3f5f321a72ba788a1bd120fc230670da5..e904dd1b4d80040c65cea02a9ac206d4e5db52be 100644 --- a/app/code/Magento/Log/Model/Resource/Shell.php +++ b/app/code/Magento/Log/Model/Resource/Shell.php @@ -36,7 +36,7 @@ namespace Magento\Log\Model\Resource; class Shell { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -47,11 +47,11 @@ class Shell /** * @param \Magento\Log\Model\Resource\Helper $resourceHelper - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Log\Model\Resource\Helper $resourceHelper, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_resourceHelper = $resourceHelper; $this->_resource = $resource; diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index 55861b02dfa349484afd69e3795bdcd5c5454407..e728b808df1146194662d5004dcc61b2cc8c60bd 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -48,13 +48,13 @@ class Visitor extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\String $string */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\String $string diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index c5102b3499cff15997a78b8123861635b325ec20..a053742ba98f85a49d0746fcd144a20882c7a87e 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -40,10 +40,10 @@ class Online extends \Magento\Model\Resource\Db\AbstractDb protected $_date; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date) { $this->_date = $date; parent::__construct($resource); diff --git a/app/code/Magento/Log/Model/Shell.php b/app/code/Magento/Log/Model/Shell.php index 7307452804869345f567c456b10a14146764b445..aed48fc4bd2e72c4edee76afce9fa7e7b59910d9 100644 --- a/app/code/Magento/Log/Model/Shell.php +++ b/app/code/Magento/Log/Model/Shell.php @@ -32,7 +32,7 @@ namespace Magento\Log\Model; * @package Magento_Log * @author Magento Core Team <core@magentocommerce.com> */ -class Shell extends \Magento\App\AbstractShell +class Shell extends \Magento\Framework\App\AbstractShell { /** * @var \Magento\Log\Model\Shell\Command\Factory @@ -40,12 +40,12 @@ class Shell extends \Magento\App\AbstractShell protected $_commandFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $entryPoint * @param \Magento\Log\Model\Shell\Command\Factory $commandFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $entryPoint, \Magento\Log\Model\Shell\Command\Factory $commandFactory ) { diff --git a/app/code/Magento/Log/Model/Shell/Command/Clean.php b/app/code/Magento/Log/Model/Shell/Command/Clean.php index ccef52c6579c9003c7b07e29d6bef8a0398048f2..2e34df0e318615feec5bceb2c65564f3dde3eb84 100644 --- a/app/code/Magento/Log/Model/Shell/Command/Clean.php +++ b/app/code/Magento/Log/Model/Shell/Command/Clean.php @@ -30,7 +30,7 @@ class Clean implements \Magento\Log\Model\Shell\CommandInterface /** * Mutable Config * - * @var \Magento\App\Config\MutableScopeConfigInterface + * @var \Magento\Framework\App\Config\MutableScopeConfigInterface */ protected $_mutableConfig; @@ -47,12 +47,12 @@ class Clean implements \Magento\Log\Model\Shell\CommandInterface protected $_days; /** - * @param \Magento\App\Config\MutableScopeConfigInterface $mutableConfig + * @param \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig * @param LogFactory $logFactory * @param int $days */ public function __construct( - \Magento\App\Config\MutableScopeConfigInterface $mutableConfig, + \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig, LogFactory $logFactory, $days ) { diff --git a/app/code/Magento/Log/Model/Visitor.php b/app/code/Magento/Log/Model/Visitor.php index 7f03049e1cb413db0c0a9fbe7b4263ed48d8bd91..7a568693a11803d906c568b33c5bd552b4648965 100644 --- a/app/code/Magento/Log/Model/Visitor.php +++ b/app/code/Magento/Log/Model/Visitor.php @@ -58,12 +58,12 @@ class Visitor extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -112,11 +112,11 @@ class Visitor extends \Magento\Model\AbstractModel /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\HTTP\Header $httpHeader * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param \Magento\HTTP\PhpEnvironment\ServerAddress $serverAddress @@ -131,11 +131,11 @@ class Visitor extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Session\SessionManagerInterface $session, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\HTTP\Header $httpHeader, \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, \Magento\HTTP\PhpEnvironment\ServerAddress $serverAddress, diff --git a/app/code/Magento/Log/Model/Visitor/Online.php b/app/code/Magento/Log/Model/Visitor/Online.php index e40a9d9148429da076f15445f9cdb2046631e3e2..5cc0ea83cf840fdcbea54a6bcdd99399ad348ec3 100644 --- a/app/code/Magento/Log/Model/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Visitor/Online.php @@ -55,14 +55,14 @@ class Online extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -70,7 +70,7 @@ class Online extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Multishipping/Controller/Checkout.php b/app/code/Magento/Multishipping/Controller/Checkout.php index de025198e8bd4bdcd48710ecc595f6d9bf7f45f2..469891b387a4a11618e74ded226d4025fbb3fdcc 100755 --- a/app/code/Magento/Multishipping/Controller/Checkout.php +++ b/app/code/Magento/Multishipping/Controller/Checkout.php @@ -23,7 +23,7 @@ */ namespace Magento\Multishipping\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Multishipping\Model\Checkout\Type\Multishipping\State; use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccountService; use Magento\Customer\Service\V1\CustomerMetadataServiceInterface as CustomerMetadataService; @@ -35,13 +35,13 @@ class Checkout extends \Magento\Checkout\Controller\Action implements \Magento\Checkout\Controller\Express\RedirectLoginInterface { /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param CustomerAccountService $customerAccountService * @param CustomerMetadataService $customerMetadataService */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, CustomerAccountService $customerAccountService, CustomerMetadataService $customerMetadataService @@ -93,7 +93,7 @@ class Checkout extends \Magento\Checkout\Controller\Action implements * Dispatch request * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address.php b/app/code/Magento/Multishipping/Controller/Checkout/Address.php index b6e724089ad5fd4e73e9be803afdea1c375e4861..f6ef6f2b51310c2f6ca18475eb5b71b73a63974f 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address.php @@ -23,13 +23,13 @@ */ namespace Magento\Multishipping\Controller\Checkout; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Context; use Magento\Customer\Service\V1\CustomerAddressServiceInterface; /** * Multishipping checkout address manipulation controller */ -class Address extends \Magento\App\Action\Action +class Address extends \Magento\Framework\App\Action\Action { /** @var CustomerAddressServiceInterface */ protected $_customerAddressService; @@ -41,7 +41,7 @@ class Address extends \Magento\App\Action\Action * @param CustomerAddressServiceInterface $customerAddressService */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, CustomerAddressServiceInterface $customerAddressService ) { $this->_customerAddressService = $customerAddressService; diff --git a/app/code/Magento/Multishipping/Helper/Data.php b/app/code/Magento/Multishipping/Helper/Data.php index e3068190e9fb821a3a9f2252e4cec149840b3694..7b2bcf1efa4f53b1ea198744b71d48104bdfa901 100644 --- a/app/code/Magento/Multishipping/Helper/Data.php +++ b/app/code/Magento/Multishipping/Helper/Data.php @@ -26,7 +26,7 @@ namespace Magento\Multishipping\Helper; /** * Data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /**#@+ * Xml paths for multishipping checkout @@ -40,7 +40,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -54,13 +54,13 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Construct * - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Checkout\Model\Session $checkoutSession */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Checkout\Model\Session $checkoutSession ) { $this->scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php index 11b62bf412c3858d1b793f66cc8931a59ffb85ec..f0cf6231c68a6b196b653385dfc1ed90a7bdebef 100644 --- a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php +++ b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php @@ -47,7 +47,7 @@ class Multishipping extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -109,7 +109,7 @@ class Multishipping extends \Magento\Object * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param CustomerAddressServiceInterface $customerAddressService * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Session\Generic $session * @param \Magento\Sales\Model\Quote\AddressFactory $addressFactory * @param \Magento\Sales\Model\Convert\Quote $quote @@ -124,7 +124,7 @@ class Multishipping extends \Magento\Object \Magento\Sales\Model\OrderFactory $orderFactory, CustomerAddressServiceInterface $customerAddressService, \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Session\Generic $session, \Magento\Sales\Model\Quote\AddressFactory $addressFactory, \Magento\Sales\Model\Convert\Quote $quote, diff --git a/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php b/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php index f5134561c0792ad7f13db71d8c2f2e402f5186eb..a1faca894f42597ed387f681a1537ace6b79c1c1 100644 --- a/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php +++ b/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php @@ -25,7 +25,7 @@ namespace Magento\Multishipping\Model\Payment\Method\Specification; use Magento\Payment\Model\Method\Specification\AbstractSpecification; use Magento\Payment\Model\Config as PaymentConfig; -use Magento\App\Config\ScopeConfigInterface as StoreConfig; +use Magento\Framework\App\Config\ScopeConfigInterface as StoreConfig; /** * 3D secure specification diff --git a/app/code/Magento/Multishipping/etc/frontend/routes.xml b/app/code/Magento/Multishipping/etc/frontend/routes.xml index 55e57c6863eb6e99e92ef4693f8b94018216627a..2ec883ed4430c9f07f592d105fffe7f6bbe59381 100644 --- a/app/code/Magento/Multishipping/etc/frontend/routes.xml +++ b/app/code/Magento/Multishipping/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="multishipping" frontName="multishipping"> <module name="Magento_Multishipping"/> diff --git a/app/code/Magento/Multishipping/view/frontend/checkout/item/default.phtml b/app/code/Magento/Multishipping/view/frontend/checkout/item/default.phtml index 6598bbc8a354475b702f1a940b205ddb00f8aa34..67c247805e89274c8400eaae2b749b917edd0118 100644 --- a/app/code/Magento/Multishipping/view/frontend/checkout/item/default.phtml +++ b/app/code/Magento/Multishipping/view/frontend/checkout/item/default.phtml @@ -30,9 +30,10 @@ <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <dl class="item options"> + <dl class="item options tooltip content"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> </dl> diff --git a/app/code/Magento/Multishipping/view/frontend/checkout/overview/item.phtml b/app/code/Magento/Multishipping/view/frontend/checkout/overview/item.phtml index ea0a864390be2466a5d114694e17459d7c7dccf9..5b0aed742c5afbdcd5b8306c0df4f9e20e169089 100644 --- a/app/code/Magento/Multishipping/view/frontend/checkout/overview/item.phtml +++ b/app/code/Magento/Multishipping/view/frontend/checkout/overview/item.phtml @@ -37,13 +37,13 @@ <?php /* Excluding Tax */ ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price excl tax"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> @@ -53,15 +53,15 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> @@ -70,7 +70,7 @@ <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> </div> @@ -84,13 +84,13 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price incll tax"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> @@ -99,22 +99,22 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> </div> @@ -128,13 +128,13 @@ <?php /* Excluding Tax Subtotal */ ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col subtotal excl tax"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> @@ -144,22 +144,22 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> </div> @@ -173,13 +173,13 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col subtotal incl tax"> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -189,22 +189,22 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> <?php endforeach; ?> <?php endif; ?> </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> </div> diff --git a/app/code/Magento/Multishipping/view/frontend/multishipping/item/default.phtml b/app/code/Magento/Multishipping/view/frontend/multishipping/item/default.phtml index 6598bbc8a354475b702f1a940b205ddb00f8aa34..67c247805e89274c8400eaae2b749b917edd0118 100644 --- a/app/code/Magento/Multishipping/view/frontend/multishipping/item/default.phtml +++ b/app/code/Magento/Multishipping/view/frontend/multishipping/item/default.phtml @@ -30,9 +30,10 @@ <?php foreach ($_options as $_option) : ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <dl class="item options"> + <dl class="item options tooltip content"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> </dl> diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php index 8a0608240b7be37b44bcb52b263ef629b8a76eae..fa8053aa89d178f46955b5edc2c1176141de8851 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php @@ -104,8 +104,8 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'index' => 'added_at', 'gmtoffset' => true, 'type' => 'datetime', - 'header_css_class' => 'col-added', - 'column_css_class' => 'col-added' + 'header_css_class' => 'col-added col-date', + 'column_css_class' => 'col-added col-date' ) ); @@ -116,8 +116,8 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'index' => 'modified_at', 'gmtoffset' => true, 'type' => 'datetime', - 'header_css_class' => 'col-updated', - 'column_css_class' => 'col-updated' + 'header_css_class' => 'col-updated col-date', + 'column_css_class' => 'col-updated col-date' ) ); diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php index 31b0ecd0595bd470e0e5c0bfcef164fd87cce1bf..0578002320743cbbb32b311a575a43ca058f2bca 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php @@ -25,7 +25,7 @@ */ namespace Magento\Newsletter\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Newsletter subscribers controller @@ -33,17 +33,17 @@ use Magento\App\ResponseInterface; class Subscriber extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -98,7 +98,7 @@ class Subscriber extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $content->getCsvFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } @@ -115,7 +115,7 @@ class Subscriber extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $content->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } diff --git a/app/code/Magento/Newsletter/Controller/Manage.php b/app/code/Magento/Newsletter/Controller/Manage.php index 849148966bf0e3c4fd6a0f4b04736d389cadec53..8e46fce90feab960878929e5c966f13d050c48c7 100644 --- a/app/code/Magento/Newsletter/Controller/Manage.php +++ b/app/code/Magento/Newsletter/Controller/Manage.php @@ -25,12 +25,12 @@ */ namespace Magento\Newsletter\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Customers newsletter subscription controller */ -class Manage extends \Magento\App\Action\Action +class Manage extends \Magento\Framework\App\Action\Action { /** * Customer session @@ -70,7 +70,7 @@ class Manage extends \Magento\App\Action\Action protected $_subscriberFactory; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -80,7 +80,7 @@ class Manage extends \Magento\App\Action\Action * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, \Magento\Store\Model\StoreManagerInterface $storeManager, @@ -103,7 +103,7 @@ class Manage extends \Magento\App\Action\Action * Check customer authentication for some actions * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Newsletter/Controller/Subscriber.php b/app/code/Magento/Newsletter/Controller/Subscriber.php index 30827b361d69523ee54c76fe845400848a641beb..fdaa21391938c034aeca8b0fa9523db915fdbc3a 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber.php @@ -29,14 +29,14 @@ */ namespace Magento\Newsletter\Controller; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Context; use Magento\Store\Model\StoreManagerInterface; use Magento\Customer\Model\Session; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Newsletter\Model\SubscriberFactory; use Magento\Customer\Helper\Data as CustomerHelper; -class Subscriber extends \Magento\App\Action\Action +class Subscriber extends \Magento\Framework\App\Action\Action { /** * Customer session @@ -201,7 +201,7 @@ class Subscriber extends \Magento\App\Action\Action */ protected function validateGuestSubscription() { - if ($this->_objectManager->get('Magento\App\Config\ScopeConfigInterface') + if ($this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface') ->getValue( \Magento\Newsletter\Model\Subscriber::XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG, \Magento\Store\Model\ScopeInterface::SCOPE_STORE diff --git a/app/code/Magento/Newsletter/Helper/Data.php b/app/code/Magento/Newsletter/Helper/Data.php index 2e252e61a61a3573ab287fe4899073b3fef6c3d0..b841349866466989c51acca006c2f8d2c564596e 100644 --- a/app/code/Magento/Newsletter/Helper/Data.php +++ b/app/code/Magento/Newsletter/Helper/Data.php @@ -34,7 +34,7 @@ */ namespace Magento\Newsletter\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Retrieve subsription confirmation url diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index d0d8bcce8a06a61f91ec9e5ea0853261334271b0..797d72743de376d10b54cfc31cafdd4ad514c069 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -49,7 +49,7 @@ class CustomerPlugin } /** - * Plugin after create account that updates any newsletter subscription that may have existed. + * Plugin after create customer that updates any newsletter subscription that may have existed. * * @param CustomerAccountServiceInterface $subject * @param Customer $customer @@ -57,7 +57,7 @@ class CustomerPlugin * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterCreateAccount(CustomerAccountServiceInterface $subject, Customer $customer) + public function afterCreateCustomer(CustomerAccountServiceInterface $subject, Customer $customer) { $this->subscriberFactory->create()->updateSubscription($customer->getId()); diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue.php b/app/code/Magento/Newsletter/Model/Resource/Queue.php index 025d08b3f5f468821264e710ded36ce93c7ea34f..f2ff3ee484fcdd7f3d27c3ddbc245e7323c9c861 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue.php @@ -47,11 +47,11 @@ class Queue extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection ) { parent::__construct($resource); diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php index 35417d13b4ddaf8c4f44bdb1be2249778432defd..188954b02f8d8196b40d228c08fc1ef013756c9d 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php @@ -77,12 +77,12 @@ class Subscriber extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Math\Random $mathRandom */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Math\Random $mathRandom ) { diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index 08eaf75852feb872947ce57282da877499f41223..ba8aeb3b118a0b7f00a6a077d7622727818fedf3 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -42,10 +42,10 @@ class Template extends \Magento\Model\Resource\Db\AbstractDb protected $_date; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date) { parent::__construct($resource); $this->_date = $date; diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index f1340e5c6ea65d3fc019ef71173196442322a904..d1d60ed372d62b2343eb75a80239aeac9b59b838 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -98,7 +98,7 @@ class Subscriber extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -137,7 +137,7 @@ class Subscriber extends \Magento\Model\AbstractModel * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Newsletter\Helper\Data $newsletterData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession @@ -151,7 +151,7 @@ class Subscriber extends \Magento\Model\AbstractModel \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Newsletter\Helper\Data $newsletterData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Newsletter/Model/Template.php b/app/code/Magento/Newsletter/Model/Template.php index 8a2cef173c9cec84b4a69527c275cf4e27744cb4..ace206a7d5f4649d04a76342b5408a708d85f626 100644 --- a/app/code/Magento/Newsletter/Model/Template.php +++ b/app/code/Magento/Newsletter/Model/Template.php @@ -81,7 +81,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate /** * Http-request, used to determine current store in multi-store mode * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -95,7 +95,7 @@ class Template extends \Magento\Email\Model\AbstractTemplate /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -117,9 +117,9 @@ class Template extends \Magento\Email\Model\AbstractTemplate * @param \Magento\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Newsletter\Model\Template\Filter $filter - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory * @param \Magento\Filter\FilterManager $filterManager * @param array $data @@ -130,9 +130,9 @@ class Template extends \Magento\Email\Model\AbstractTemplate \Magento\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Newsletter\Model\Template\Filter $filter, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Newsletter\Model\TemplateFactory $templateFactory, \Magento\Filter\FilterManager $filterManager, array $data = array() diff --git a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml index 30ca0ce7b6033f27a9cb4b4018db3c08164ef393..479ac3a8f61a45267bb4fa549300584a651bf822 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/routes.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="newsletter" frontName="newsletter"> <module name="Magento_Newsletter" /> diff --git a/app/code/Magento/Newsletter/etc/frontend/routes.xml b/app/code/Magento/Newsletter/etc/frontend/routes.xml index 57fa94c694caf31795e984a6e8b59033a2ccf4b2..76bf5abe47fe312d8d3b8190ebdeacad647c1076 100644 --- a/app/code/Magento/Newsletter/etc/frontend/routes.xml +++ b/app/code/Magento/Newsletter/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="newsletter" frontName="newsletter"> <module name="Magento_Newsletter" /> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml index 44972f7999d37ea0ba209654ab15d50999c33236..c6c397799cca84c7a1e56f81d3cfc9292bfa28e5 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_problem_block.xml @@ -60,8 +60,8 @@ <argument name="header" xsi:type="string" translate="true">Subscriber</argument> <argument name="format" xsi:type="string">#$subscriber_id $customer_name ($subscriber_email)</argument> <argument name="index" xsi:type="string">subscriber_id</argument> - <argument name="header_css_class" xsi:type="string">col-subscriber</argument> - <argument name="column_css_class" xsi:type="string">col-subscriber</argument> + <argument name="header_css_class" xsi:type="string">col-subscriber col-name</argument> + <argument name="column_css_class" xsi:type="string">col-subscriber col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="queue_start"> @@ -70,8 +70,8 @@ <argument name="index" xsi:type="string">queue_start_at</argument> <argument name="gmtoffset" xsi:type="string">true</argument> <argument name="type" xsi:type="string">datetime</argument> - <argument name="header_css_class" xsi:type="string">col-start</argument> - <argument name="column_css_class" xsi:type="string">col-start</argument> + <argument name="header_css_class" xsi:type="string">col-start col-date</argument> + <argument name="column_css_class" xsi:type="string">col-start col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="queue"> diff --git a/app/code/Magento/OfflineShipping/Controller/Adminhtml/System/Config.php b/app/code/Magento/OfflineShipping/Controller/Adminhtml/System/Config.php index bde9261879a34a3d2d152c0fb69f6b6944781dfe..1e00e6d40329190d8555fae67d144e760a813f7d 100644 --- a/app/code/Magento/OfflineShipping/Controller/Adminhtml/System/Config.php +++ b/app/code/Magento/OfflineShipping/Controller/Adminhtml/System/Config.php @@ -23,7 +23,7 @@ */ namespace Magento\OfflineShipping\Controller\Adminhtml\System; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Backend\Controller\Adminhtml\System\AbstractConfig; /** @@ -32,7 +32,7 @@ use Magento\Backend\Controller\Adminhtml\System\AbstractConfig; class Config extends AbstractConfig { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -44,13 +44,13 @@ class Config extends AbstractConfig /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; @@ -78,6 +78,6 @@ class Config extends AbstractConfig } $gridBlock->setWebsiteId($website->getId())->setConditionName($conditionName); $content = $gridBlock->getCsvFile(); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } } diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php index 1d5d8fa203488f3f22813c0b65e4de49944ddc98..d9b81bf6be66205b601c9b3c655790ebd974da0d 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php @@ -52,7 +52,7 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement protected $_rateMethodFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory @@ -60,7 +60,7 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 03b1b1b1e4c63c42389aa5978d6f06936683d9f1..d8a081ed689954c1b8606dff2a180065d950c210 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -56,7 +56,7 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple protected $_rateMethodFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory @@ -64,7 +64,7 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index 9e05a7c6264adc2af3d8fb826db82ec53f795104..029ad7400f23276b04a559dd67b7793cbb40a07f 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -47,7 +47,7 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements protected $_rateMethodFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory @@ -55,7 +55,7 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php index e57997cdc19cbfeb9cea0607ff9fd8970a937d0c..b466f5c6dcae0202413dcae5c55a7698f1dcc3a0 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php @@ -62,7 +62,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen protected $_tablerateFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory @@ -71,7 +71,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, diff --git a/app/code/Magento/OfflineShipping/Model/Config/Backend/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Config/Backend/Tablerate.php index e9b5a66358f068957e1a9ba81845bf6cc0599770..fc6416ce0f8f7a645c90eb4eff366106b6b0f801 100644 --- a/app/code/Magento/OfflineShipping/Model/Config/Backend/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Config/Backend/Tablerate.php @@ -30,7 +30,7 @@ use Magento\Model\AbstractModel; * * @author Magento Core Team <core@magentocommerce.com> */ -class Tablerate extends \Magento\App\Config\Value +class Tablerate extends \Magento\Framework\App\Config\Value { /** * @var \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory @@ -40,7 +40,7 @@ class Tablerate extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -49,7 +49,7 @@ class Tablerate extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/OfflineShipping/Model/Plugin/Checkout/Block/Cart/Shipping.php b/app/code/Magento/OfflineShipping/Model/Plugin/Checkout/Block/Cart/Shipping.php index 4fbc5aa2193d0a66c159ad16fbcf2691b9da393d..4f9c3c189d937d85778b6df643924194228df420 100644 --- a/app/code/Magento/OfflineShipping/Model/Plugin/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/OfflineShipping/Model/Plugin/Checkout/Block/Cart/Shipping.php @@ -34,14 +34,14 @@ namespace Magento\OfflineShipping\Model\Plugin\Checkout\Block\Cart; class Shipping { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 0dce4e02a5ad102abed84903f3c0445fbf681c49..b49b164acce36a196060e9f626e5e262526717e2 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -98,7 +98,7 @@ class Tablerate extends \Magento\Model\Resource\Db\AbstractDb protected $_conditionFullNames = array(); /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -130,29 +130,29 @@ class Tablerate extends \Magento\Model\Resource\Db\AbstractDb /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\OfflineShipping\Model\Carrier\Tablerate $carrierTablerate * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\OfflineShipping\Model\Carrier\Tablerate $carrierTablerate, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { parent::__construct($resource); $this->_coreConfig = $coreConfig; @@ -273,7 +273,7 @@ class Tablerate extends \Magento\Model\Resource\Db\AbstractDb $this->_importErrors = array(); $this->_importedRows = 0; - $tmpDirectory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::SYS_TMP_DIR); + $tmpDirectory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); $path = $tmpDirectory->getRelativePath($csvFile); $stream = $tmpDirectory->openFile($path); diff --git a/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml index 9c57c8f1adfd5aa26497b2d54102b380b930ca7a..3ac054bcffc9b7c30010c8ea0fd7069d6e420c1e 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_OfflineShipping" before="Magento_Backend" /> diff --git a/app/code/Magento/OfflineShipping/etc/config.xml b/app/code/Magento/OfflineShipping/etc/config.xml index f4c7071eb8d2304904d72f09f06cd80b0d2b8831..0575647f8e1ab355bdecea9829b1ae07340e5409 100644 --- a/app/code/Magento/OfflineShipping/etc/config.xml +++ b/app/code/Magento/OfflineShipping/etc/config.xml @@ -27,7 +27,7 @@ <default> <carriers> <flatrate> - <active>0</active> + <active>1</active> <sallowspecific>0</sallowspecific> <model>Magento\OfflineShipping\Model\Carrier\Flatrate</model> <name>Fixed</name> diff --git a/app/code/Magento/Ogone/Controller/Api.php b/app/code/Magento/Ogone/Controller/Api.php index 05695d9952b0efe08a050e61eaba31f8a6761a8d..0bd3e30deb8ed41e0220197373f575d6aed0858a 100644 --- a/app/code/Magento/Ogone/Controller/Api.php +++ b/app/code/Magento/Ogone/Controller/Api.php @@ -30,7 +30,7 @@ use Magento\Sales\Model\Order; /** * Ogone Api Controller */ -class Api extends \Magento\App\Action\Action +class Api extends \Magento\Framework\App\Action\Action { /** * Order instance @@ -50,12 +50,12 @@ class Api extends \Magento\App\Action\Action protected $_transactionFactory; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\DB\TransactionFactory $transactionFactory * @param \Magento\Sales\Model\OrderFactory $salesOrderFactory */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\DB\TransactionFactory $transactionFactory, \Magento\Sales\Model\OrderFactory $salesOrderFactory ) { diff --git a/app/code/Magento/Ogone/Helper/Data.php b/app/code/Magento/Ogone/Helper/Data.php index fdcbc2ba1960e07bd0599a2291a5be62c51a0f40..0528fa88d77ee05ce9ecb19c4018185ace329cc1 100644 --- a/app/code/Magento/Ogone/Helper/Data.php +++ b/app/code/Magento/Ogone/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Ogone\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Ogone/Model/Api.php b/app/code/Magento/Ogone/Model/Api.php index ce9b4ced589b973600e461c6f01f7193f09f612f..08b8b27812aa9049e21d496ab61efd8d1b318661 100644 --- a/app/code/Magento/Ogone/Model/Api.php +++ b/app/code/Magento/Ogone/Model/Api.php @@ -476,7 +476,7 @@ class Api extends \Magento\Payment\Model\Method\AbstractMethod /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Locale\ResolverInterface $localeResolver @@ -488,7 +488,7 @@ class Api extends \Magento\Payment\Model\Method\AbstractMethod public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Locale\ResolverInterface $localeResolver, diff --git a/app/code/Magento/Ogone/Model/Config.php b/app/code/Magento/Ogone/Model/Config.php index c2ce28236a4ebbca1512d66dae13c813ddcf73f0..986927794a5843152f6274345c777451893a50f0 100644 --- a/app/code/Magento/Ogone/Model/Config.php +++ b/app/code/Magento/Ogone/Model/Config.php @@ -43,8 +43,8 @@ class Config extends \Magento\Payment\Model\Config protected $_encryptor; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Payment\Model\Method\Factory $paymentMethodFactory * @param \Magento\Locale\ListsInterface $localeLists * @param \Magento\Config\DataInterface $dataStorage @@ -52,8 +52,8 @@ class Config extends \Magento\Payment\Model\Config * @param \Magento\Encryption\EncryptorInterface $encryptor */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Payment\Model\Method\Factory $paymentMethodFactory, \Magento\Locale\ListsInterface $localeLists, \Magento\Config\DataInterface $dataStorage, diff --git a/app/code/Magento/Ogone/etc/frontend/routes.xml b/app/code/Magento/Ogone/etc/frontend/routes.xml index 6183edb7f1a0c0e14f00e845d406ca6f7986705b..2c414d3998efa1e217b72d91d1c26af96bb116ef 100644 --- a/app/code/Magento/Ogone/etc/frontend/routes.xml +++ b/app/code/Magento/Ogone/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="ogone" frontName="ogone"> <module name="Magento_Ogone" /> diff --git a/app/code/Magento/Ogone/etc/resources.xml b/app/code/Magento/Ogone/etc/resources.xml index 2f5e47b5653b0061e6b61d0a595312152e482274..c07eb9413d010312eca7abd6038d69dee6a8ccf3 100644 --- a/app/code/Magento/Ogone/etc/resources.xml +++ b/app/code/Magento/Ogone/etc/resources.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Framework/App/etc/resources.xsd"> <resource name="ogone_setup" extends="core_setup" /> <resource name="ogone_write" extends="core_write" /> <resource name="ogone_read" extends="core_read" /> diff --git a/app/code/Magento/PageCache/Block/Javascript.php b/app/code/Magento/PageCache/Block/Javascript.php index fe2784ede607274eacde99d095c7b4e1ad47c3e4..d67b9cf3e8db96f80f4e40ec3ce96ce24724e90c 100644 --- a/app/code/Magento/PageCache/Block/Javascript.php +++ b/app/code/Magento/PageCache/Block/Javascript.php @@ -62,7 +62,7 @@ class Javascript extends \Magento\View\Element\Template $params = array( 'url' => $this->getUrl('page_cache/block/render/'), 'handles' => $this->helper->getActualHandles(), - 'versionCookieName' => \Magento\App\PageCache\Version::COOKIE_NAME + 'versionCookieName' => \Magento\Framework\App\PageCache\Version::COOKIE_NAME ); return json_encode($params); } diff --git a/app/code/Magento/PageCache/Controller/Adminhtml/PageCache.php b/app/code/Magento/PageCache/Controller/Adminhtml/PageCache.php index 58fafff8c4a529b14421ec8af3b8b6709b819415..16ae0664144622cdf21021c4a81cf994f8740828 100644 --- a/app/code/Magento/PageCache/Controller/Adminhtml/PageCache.php +++ b/app/code/Magento/PageCache/Controller/Adminhtml/PageCache.php @@ -42,12 +42,12 @@ class PageCache extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\PageCache\Model\Config $config */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\PageCache\Model\Config $config ) { parent::__construct($context); @@ -58,12 +58,12 @@ class PageCache extends \Magento\Backend\App\Action /** * Export Varnish Configuration as .vcl * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function exportVarnishConfigAction() { $fileName = 'varnish.vcl'; $content = $this->config->getVclFile(); - return $this->fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } } diff --git a/app/code/Magento/PageCache/Controller/Block.php b/app/code/Magento/PageCache/Controller/Block.php index f45632fb43fdf61eba10e88293be992101ce7140..bcc10a6d9217d6aaa8de246aa16ddb28be460675 100644 --- a/app/code/Magento/PageCache/Controller/Block.php +++ b/app/code/Magento/PageCache/Controller/Block.php @@ -25,7 +25,7 @@ */ namespace Magento\PageCache\Controller; -class Block extends \Magento\App\Action\Action +class Block extends \Magento\Framework\App\Action\Action { /** * Returns block content depends on ajax request diff --git a/app/code/Magento/PageCache/Helper/Data.php b/app/code/Magento/PageCache/Helper/Data.php index b7788752613e3dbefea56927f3a1df6ac32be5b1..d71060185e4acb62645792a75deeb07a8c2a68a3 100644 --- a/app/code/Magento/PageCache/Helper/Data.php +++ b/app/code/Magento/PageCache/Helper/Data.php @@ -35,7 +35,7 @@ namespace Magento\PageCache\Helper; /** * Helper for Page Cache module */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Private caching time one year @@ -43,19 +43,19 @@ class Data extends \Magento\App\Helper\AbstractHelper const PRIVATE_MAX_AGE_CACHE = 31536000; /** - * @var \Magento\App\View + * @var \Magento\Framework\App\View */ protected $view; /** * Constructor * - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\View $view + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\View $view */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\View $view + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\View $view ) { parent::__construct($context); $this->view = $view; diff --git a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php index ed15764433503b14d40310c6efbf0b5b1796e579..659973217162a1f9bbd73a02a65a4137aa8c2fa5 100755 --- a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php +++ b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php @@ -29,36 +29,36 @@ namespace Magento\PageCache\Model\App\FrontController; class BuiltinPlugin { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @var \Magento\App\PageCache\Version + * @var \Magento\Framework\App\PageCache\Version */ protected $version; /** - * @var \Magento\App\PageCache\Kernel + * @var \Magento\Framework\App\PageCache\Kernel */ protected $kernel; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $state; /** * @param \Magento\PageCache\Model\Config $config - * @param \Magento\App\PageCache\Version $version - * @param \Magento\App\PageCache\Kernel $kernel - * @param \Magento\App\State $state + * @param \Magento\Framework\App\PageCache\Version $version + * @param \Magento\Framework\App\PageCache\Kernel $kernel + * @param \Magento\Framework\App\State $state */ public function __construct( \Magento\PageCache\Model\Config $config, - \Magento\App\PageCache\Version $version, - \Magento\App\PageCache\Kernel $kernel, - \Magento\App\State $state + \Magento\Framework\App\PageCache\Version $version, + \Magento\Framework\App\PageCache\Kernel $kernel, + \Magento\Framework\App\State $state ) { $this->config = $config; $this->version = $version; @@ -67,15 +67,15 @@ class BuiltinPlugin } /** - * @param \Magento\App\FrontControllerInterface $subject + * @param \Magento\Framework\App\FrontControllerInterface $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request - * @return false|\Magento\App\Response\Http + * @param \Magento\Framework\App\RequestInterface $request + * @return false|\Magento\Framework\App\Response\Http */ public function aroundDispatch( - \Magento\App\FrontControllerInterface $subject, + \Magento\Framework\App\FrontControllerInterface $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if ($this->config->getType() == \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) { $this->version->process(); @@ -98,14 +98,14 @@ class BuiltinPlugin /** * Add additional header for debug purpose * - * @param \Magento\App\Response\Http $response + * @param \Magento\Framework\App\Response\Http $response * @param string $name * @param string $value * @return void */ - protected function addDebugHeader(\Magento\App\Response\Http $response, $name, $value) + protected function addDebugHeader(\Magento\Framework\App\Response\Http $response, $name, $value) { - if ($this->state->getMode() == \Magento\App\State::MODE_DEVELOPER) { + if ($this->state->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { $response->setHeader($name, $value); } } diff --git a/app/code/Magento/Core/App/FrontController/Plugin/MessageBox.php b/app/code/Magento/PageCache/Model/App/FrontController/MessageBox.php similarity index 77% rename from app/code/Magento/Core/App/FrontController/Plugin/MessageBox.php rename to app/code/Magento/PageCache/Model/App/FrontController/MessageBox.php index e5567a88203fa057071dc0bd8965033c40bc078a..d8ee0625f08d390c8ee79b02ba9b615dc478f7cd 100644 --- a/app/code/Magento/Core/App/FrontController/Plugin/MessageBox.php +++ b/app/code/Magento/PageCache/Model/App/FrontController/MessageBox.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\App\FrontController\Plugin; +namespace Magento\PageCache\Model\App\FrontController; class MessageBox { @@ -47,12 +47,12 @@ class MessageBox /** * Request * - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $request; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; @@ -63,13 +63,13 @@ class MessageBox /** * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param \Magento\PageCache\Model\Config $config * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( \Magento\Stdlib\Cookie $cookie, - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, \Magento\PageCache\Model\Config $config, \Magento\Message\ManagerInterface $messageManager ) { @@ -82,15 +82,15 @@ class MessageBox /** * Set Cookie for msg box when it displays first * - * @param \Magento\App\FrontController $subject - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\FrontController $subject + * @param \Magento\Framework\App\ResponseInterface $response * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterDispatch(\Magento\App\FrontController $subject, \Magento\App\ResponseInterface $response) + public function afterDispatch(\Magento\Framework\App\FrontController $subject, \Magento\Framework\App\ResponseInterface $response) { - if ($this->request->isPost() && $this->config->isEnabled() && $this->messageManager->hasMessages()) { + if ($this->request->isPost() && $this->messageManager->hasMessages()) { $this->cookie->set(self::COOKIE_NAME, 1, self::COOKIE_PERIOD, '/'); } return $response; diff --git a/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php b/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php index d6ab88385d8fd03915d7e5112cb01c50ccfc107d..eea4f6b909eb37b714d7d5f42425fca0a44b22cf 100755 --- a/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php +++ b/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php @@ -29,29 +29,29 @@ namespace Magento\PageCache\Model\App\FrontController; class VarnishPlugin { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @var \Magento\App\PageCache\Version + * @var \Magento\Framework\App\PageCache\Version */ protected $version; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $state; /** * @param \Magento\PageCache\Model\Config $config - * @param \Magento\App\PageCache\Version $version - * @param \Magento\App\State $state + * @param \Magento\Framework\App\PageCache\Version $version + * @param \Magento\Framework\App\State $state */ public function __construct( \Magento\PageCache\Model\Config $config, - \Magento\App\PageCache\Version $version, - \Magento\App\State $state + \Magento\Framework\App\PageCache\Version $version, + \Magento\Framework\App\State $state ) { $this->config = $config; $this->version = $version; @@ -59,20 +59,20 @@ class VarnishPlugin } /** - * @param \Magento\App\FrontControllerInterface $subject + * @param \Magento\Framework\App\FrontControllerInterface $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request - * @return false|\Magento\App\Response\Http + * @param \Magento\Framework\App\RequestInterface $request + * @return false|\Magento\Framework\App\Response\Http */ public function aroundDispatch( - \Magento\App\FrontControllerInterface $subject, + \Magento\Framework\App\FrontControllerInterface $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if ($this->config->getType() == \Magento\PageCache\Model\Config::VARNISH && $this->config->isEnabled()) { $this->version->process(); $response = $proceed($request); - if ($this->state->getMode() == \Magento\App\State::MODE_DEVELOPER) { + if ($this->state->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { $response->setHeader('X-Magento-Debug', 1); } } else { diff --git a/app/code/Magento/PageCache/Model/Cache/Type.php b/app/code/Magento/PageCache/Model/Cache/Type.php index 9f49e28deca776c9e4beb8382cf03afa2f32659f..c8ac99146e6874a155e46a2b1c7be2fc3d3f467b 100644 --- a/app/code/Magento/PageCache/Model/Cache/Type.php +++ b/app/code/Magento/PageCache/Model/Cache/Type.php @@ -40,9 +40,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'FPC'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/PageCache/Model/Config.php b/app/code/Magento/PageCache/Model/Config.php index 8f3e1d3c5d5b498a05ed7ad2f5749ad30d78f9e0..1753fa81dfe04f8a339869b4153ea3ecb53b323d 100644 --- a/app/code/Magento/PageCache/Model/Config.php +++ b/app/code/Magento/PageCache/Model/Config.php @@ -25,7 +25,7 @@ */ namespace Magento\PageCache\Model; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; /** * Model is responsible for replacing default vcl template @@ -66,7 +66,7 @@ class Config const XML_VARNISH_PAGECACHE_DESIGN_THEME_REGEX = 'design/theme/ua_regexp'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -76,7 +76,7 @@ class Config const VARNISH_CONFIGURATION_PATH = 'system/full_page_cache/varnish/path'; /** - * @var \Magento\App\Cache\StateInterface $_cacheState + * @var \Magento\Framework\App\Cache\StateInterface $_cacheState */ protected $_cacheState; @@ -87,15 +87,15 @@ class Config /** * @param Filesystem $filesystem - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Cache\StateInterface $cacheState */ public function __construct( - \Magento\App\Filesystem $filesystem, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Cache\StateInterface $cacheState + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Cache\StateInterface $cacheState ) { - $this->_modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->_modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->_scopeConfig = $scopeConfig; $this->_cacheState = $cacheState; } diff --git a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php index f3ee1385a8648e54598360ef765b9788bc1d110a..d008b0470ddaec4e02f5eae9d46240f156fc1e5b 100644 --- a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php +++ b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php @@ -39,7 +39,7 @@ class LayoutPlugin protected $config; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $response; @@ -47,12 +47,12 @@ class LayoutPlugin * Constructor * * @param \Magento\View\Layout $layout - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\PageCache\Model\Config $config */ public function __construct( \Magento\View\Layout $layout, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\ResponseInterface $response, \Magento\PageCache\Model\Config $config ) { $this->layout = $layout; diff --git a/app/code/Magento/PageCache/Model/Observer.php b/app/code/Magento/PageCache/Model/Observer.php index 82318fc81bbef38a597b6815a372fb544d988e40..9e2af4e5814c0ad7ad1435d967986a2a63b2d9e1 100644 --- a/app/code/Magento/PageCache/Model/Observer.php +++ b/app/code/Magento/PageCache/Model/Observer.php @@ -38,7 +38,7 @@ class Observer protected $_config; /** - * @var \Magento\App\PageCache\Cache + * @var \Magento\Framework\App\PageCache\Cache */ protected $_cache; @@ -48,7 +48,7 @@ class Observer protected $_helper; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_typeList; @@ -58,7 +58,7 @@ class Observer protected $_session; /** - * @var \Magento\App\PageCache\FormKey + * @var \Magento\Framework\App\PageCache\FormKey */ protected $_formKey; @@ -66,18 +66,18 @@ class Observer * Constructor * * @param Config $config - * @param \Magento\App\PageCache\Cache $cache + * @param \Magento\Framework\App\PageCache\Cache $cache * @param \Magento\PageCache\Helper\Data $helper - * @param \Magento\App\Cache\TypeListInterface $typeList + * @param \Magento\Framework\App\Cache\TypeListInterface $typeList * @param \Magento\Session\Generic $session - * @param \Magento\App\PageCache\FormKey $formKey + * @param \Magento\Framework\App\PageCache\FormKey $formKey */ public function __construct( \Magento\PageCache\Model\Config $config, - \Magento\App\PageCache\Cache $cache, + \Magento\Framework\App\PageCache\Cache $cache, \Magento\PageCache\Helper\Data $helper, - \Magento\App\Cache\TypeListInterface $typeList, - \Magento\App\PageCache\FormKey $formKey, + \Magento\Framework\App\Cache\TypeListInterface $typeList, + \Magento\Framework\App\PageCache\FormKey $formKey, \Magento\Session\Generic $session ) { $this->_config = $config; @@ -195,10 +195,6 @@ class Observer */ public function registerFormKeyFromCookie(\Magento\Event\Observer $observer) { - if (!$this->_config->isEnabled()) { - return; - } - $formKeyFromCookie = $this->_formKey->get(); if ($formKeyFromCookie) { $this->_session->setData(\Magento\Data\Form\FormKey::FORM_KEY, $formKeyFromCookie); diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/Ttl.php b/app/code/Magento/PageCache/Model/System/Config/Backend/Ttl.php index 075f54406619498884234c1ffacd107b9d1855a8..8ffa19a5be2a724679a3924125c573fc7bc840de 100644 --- a/app/code/Magento/PageCache/Model/System/Config/Backend/Ttl.php +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/Ttl.php @@ -30,7 +30,7 @@ namespace Magento\PageCache\Model\System\Config\Backend; * Class Ttl * @package Magento\PageCache\Model\System\Config\Backend */ -class Ttl extends \Magento\App\Config\Value +class Ttl extends \Magento\Framework\App\Config\Value { /** * Throw exception if Ttl data is invalid or empty diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php index 36fd9084896c462ee01523e16612027de714e716..8ed70da7835a7bf21a884baf2227887066e8302a 100644 --- a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php @@ -29,7 +29,7 @@ namespace Magento\PageCache\Model\System\Config\Backend; * Class Varnish * @package Magento\PageCache\Model\System\Config\Backend */ -class Varnish extends \Magento\App\Config\Value +class Varnish extends \Magento\Framework\App\Config\Value { /** * @var array diff --git a/app/code/Magento/PageCache/etc/adminhtml/routes.xml b/app/code/Magento/PageCache/etc/adminhtml/routes.xml index 06c042bcade9917b4a7e4dd236b3c190a202ae3d..298543f3e29ee6c5ca93ccb40ffc3195e27acd03 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/routes.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_PageCache" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/PageCache/etc/events.xml b/app/code/Magento/PageCache/etc/events.xml index fd56f005bbe4f8a974c758207f6c2e850811a35e..f7304b68993527e52d324d841eb647de61880ceb 100644 --- a/app/code/Magento/PageCache/etc/events.xml +++ b/app/code/Magento/PageCache/etc/events.xml @@ -72,7 +72,7 @@ method="flushCacheByTags" /> </event> <event name="controller_action_predispatch"> - <observer name="register_from_key" + <observer name="register_form_key" instance="Magento\PageCache\Model\Observer" method="registerFormKeyFromCookie" /> </event> diff --git a/app/code/Magento/PageCache/etc/frontend/di.xml b/app/code/Magento/PageCache/etc/frontend/di.xml index d40fd62a48303679d725373d752d01a0f6e8de9a..00269b8b6307db1bc96e8d0c17a0e7dce0c5786c 100644 --- a/app/code/Magento/PageCache/etc/frontend/di.xml +++ b/app/code/Magento/PageCache/etc/frontend/di.xml @@ -24,9 +24,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\FrontControllerInterface"> + <type name="Magento\Framework\App\FrontControllerInterface"> <plugin name="front-controller-builtin-cache" type="Magento\PageCache\Model\App\FrontController\BuiltinPlugin"/> <plugin name="front-controller-varnish-cache" type="Magento\PageCache\Model\App\FrontController\VarnishPlugin"/> + <plugin name="front-controller-message-box" type="Magento\PageCache\Model\App\FrontController\MessageBox" sortOrder="0"/> </type> <type name="Magento\View\Layout"> <plugin name="layout-model-caching-unique-name" type="Magento\PageCache\Model\Layout\LayoutPlugin"/> diff --git a/app/code/Magento/PageCache/etc/frontend/routes.xml b/app/code/Magento/PageCache/etc/frontend/routes.xml index 45de830f84750c5603e7bf197362f47d3feb70bf..7f9b4ddb548e072186d8134780276484d4d78970 100644 --- a/app/code/Magento/PageCache/etc/frontend/routes.xml +++ b/app/code/Magento/PageCache/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="magento_pagecache" frontName="page_cache"> <module name="Magento_PageCache" /> diff --git a/app/code/Magento/PageCache/view/frontend/javascript.phtml b/app/code/Magento/PageCache/view/frontend/javascript.phtml index 87c224740145311bfcbcdd22a14601eb5d507d07..dac67a9a75bbff26e164720b405d4ba519831383 100644 --- a/app/code/Magento/PageCache/view/frontend/javascript.phtml +++ b/app/code/Magento/PageCache/view/frontend/javascript.phtml @@ -31,13 +31,4 @@ }); })(jQuery); //]]> -</script> -<script type="text/javascript"> - //<![CDATA[ - (function ($) { - head.js("<?php echo $this->getViewFileUrl('Magento_PageCache::js/form-key.js')?>", function () { - $('body').formKey(); - }); - })(jQuery); - //]]> </script> \ No newline at end of file diff --git a/app/code/Magento/PageCache/view/frontend/js/form-key.js b/app/code/Magento/PageCache/view/frontend/js/form-key.js index e4929cc1c38edae99852b283bdcbc55bd05fd679..f9d98aa1ce73e54217f093a04b6f5dd2c0013ca6 100644 --- a/app/code/Magento/PageCache/view/frontend/js/form-key.js +++ b/app/code/Magento/PageCache/view/frontend/js/form-key.js @@ -34,12 +34,12 @@ }, _create: function() { - var formKey = $.cookie('form_key'); + var formKey = $.mage.cookies.get('form_key'); if (!formKey) { formKey = this._generate(this.options.allowedCharacters, this.options.length); var date = new Date(); date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000)); - $.cookie('form_key', formKey, {expires: date, path: '/'}); + $.mage.cookies.set('form_key', formKey, {expires: date, path: '/'}); } $(this.options.inputSelector).val(formKey); }, @@ -50,4 +50,5 @@ return result; } }); + $('body').formKey(); })(jQuery); \ No newline at end of file diff --git a/app/code/Magento/Theme/view/frontend/js/msg-box.js b/app/code/Magento/PageCache/view/frontend/js/msg-box.js similarity index 92% rename from app/code/Magento/Theme/view/frontend/js/msg-box.js rename to app/code/Magento/PageCache/view/frontend/js/msg-box.js index 7cccf4ec3569f01d8e33cfd50a9d49e78e7c85f6..248c2f0f9c04e141ea5aa8dc88b39988dfa8014f 100644 --- a/app/code/Magento/Theme/view/frontend/js/msg-box.js +++ b/app/code/Magento/PageCache/view/frontend/js/msg-box.js @@ -34,9 +34,7 @@ }, _create: function() { if ($.mage.cookies.get(this.options.msgBoxCookieName)) { - var expires = new Date(); - expires.setFullYear(1970); - $.mage.cookies.set(this.options.msgBoxCookieName, null, {expires: expires, path: "/"}); + $.mage.cookies.set(this.options.msgBoxCookieName, null, {expires: new Date(), path: "/"}); } else { $(this.options.msgBoxSelector).hide(); } diff --git a/app/code/Magento/PageCache/view/frontend/layout/default.xml b/app/code/Magento/PageCache/view/frontend/layout/default.xml index 68ba3c2aed9f1d6c38b1bbd8bb4a64bc6ce16442..f70f74c36365f2e4ce680bb449df3f5a473a4691 100644 --- a/app/code/Magento/PageCache/view/frontend/layout/default.xml +++ b/app/code/Magento/PageCache/view/frontend/layout/default.xml @@ -30,6 +30,16 @@ <argument name="file" xsi:type="string">Magento_PageCache::js/comments.js</argument> </arguments> </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-pagecache-form-key-js" after="jquery-jquery-ui-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_PageCache::js/form-key.js</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-msg-box-js" after="jquery-jquery-ui-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_PageCache::js/msg-box.js</argument> + </arguments> + </block> </referenceBlock> <referenceContainer name="content"> <block class="Magento\PageCache\Block\Javascript" template="Magento_PageCache::javascript.phtml" name="pageCache" as="pageCache"/> diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index c24ff534764e9f94f25eb2f02ec66d3470a4683f..006a85a7ea7877e4c71a3808377f608b760f5a39 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -32,14 +32,14 @@ use Magento\View\Element\Template; /** * Payment module base helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_PAYMENT_METHODS = 'payment'; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -70,30 +70,30 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_appEmulation; /** - * @var \Magento\App\Config\Initial + * @var \Magento\Framework\App\Config\Initial */ protected $_initialConfig; /** * Construct * - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\LayoutInterface $layout * @param \Magento\Payment\Model\Method\Factory $paymentMethodFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Payment\Model\Config $paymentConfig - * @param \Magento\App\Config\Initial $initialConfig + * @param \Magento\Framework\App\Config\Initial $initialConfig */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\LayoutInterface $layout, \Magento\Payment\Model\Method\Factory $paymentMethodFactory, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Payment\Model\Config $paymentConfig, - \Magento\App\Config\Initial $initialConfig + \Magento\Framework\App\Config\Initial $initialConfig ) { parent::__construct($context); $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Payment/Model/Config.php b/app/code/Magento/Payment/Model/Config.php index bcbe160258fcc68d624ae7523557ea8549d11e93..fca4e243e9f0af87a872add0bde486a9b8647365 100644 --- a/app/code/Magento/Payment/Model/Config.php +++ b/app/code/Magento/Payment/Model/Config.php @@ -43,7 +43,7 @@ class Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -69,15 +69,15 @@ class Config /** * Construct * - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Payment\Model\Method\Factory $paymentMethodFactory * @param \Magento\Locale\ListsInterface $localeLists * @param \Magento\Config\DataInterface $dataStorage */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Payment\Model\Method\Factory $paymentMethodFactory, \Magento\Locale\ListsInterface $localeLists, \Magento\Config\DataInterface $dataStorage diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index c1df6b7971de4eaa10bbef6998666cf338f41f36..75c5576521c2f0d05d1fce50e98cffff89e36291 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -194,7 +194,7 @@ abstract class AbstractMethod extends \Magento\Object implements \Magento\Paymen /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -217,14 +217,14 @@ abstract class AbstractMethod extends \Magento\Object implements \Magento\Paymen * * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, array $data = array() ) { diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index d0e79896a71e41836dcfe3e193d7d2fec6a1fd6a..1672e1203024eafc978a4f0751f7b8b423ff0c4f 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -69,7 +69,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -80,7 +80,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index 9a1840a0c20c400a6cd1b540d928a9a9d5fcc904..0bfd8f569be44c4ff7dcc1ab524cf773a4ae4414 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -65,7 +65,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod * * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param array $data @@ -73,7 +73,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data = array() diff --git a/app/code/Magento/Payment/Model/Resource/Grid/GroupList.php b/app/code/Magento/Payment/Model/Resource/Grid/GroupList.php new file mode 100644 index 0000000000000000000000000000000000000000..89b2778adc37ae759a047aafd62568c2e78a5e77 --- /dev/null +++ b/app/code/Magento/Payment/Model/Resource/Grid/GroupList.php @@ -0,0 +1,55 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Payment\Model\Resource\Grid; + +/** + * Sales transaction types option array + */ +class GroupList implements \Magento\Option\ArrayInterface +{ + /** + * Payment data + * + * @var \Magento\Payment\Helper\Data + */ + protected $paymentData; + + /** + * @param \Magento\Payment\Helper\Data $paymentData + */ + public function __construct(\Magento\Payment\Helper\Data $paymentData) + { + $this->paymentData = $paymentData; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->paymentData->getPaymentMethodList(true, true, true); + } +} diff --git a/app/code/Magento/Payment/Model/Resource/Grid/TypeList.php b/app/code/Magento/Payment/Model/Resource/Grid/TypeList.php new file mode 100644 index 0000000000000000000000000000000000000000..01711c9091728b00d2bf7a8b888714c44d67c0f2 --- /dev/null +++ b/app/code/Magento/Payment/Model/Resource/Grid/TypeList.php @@ -0,0 +1,55 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Payment\Model\Resource\Grid; + +/** + * Sales transaction payment method types option array + */ +class TypeList implements \Magento\Option\ArrayInterface +{ + /** + * Payment data + * + * @var \Magento\Payment\Helper\Data + */ + protected $paymentData; + + /** + * @param \Magento\Payment\Helper\Data $paymentData + */ + public function __construct(\Magento\Payment\Helper\Data $paymentData) + { + $this->paymentData = $paymentData; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->paymentData->getPaymentMethodList(); + } +} diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index d4852ca0fd7746b5d33f35fe92a25d98ec5d2cb9..2464ad5ae38a7a1277d5cdafbc6ef446f29b9022 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -113,7 +113,7 @@ class Iframe extends \Magento\Payment\Block\Form $templatePath = str_replace('_', '', $paymentCode); $templateFile = "{$templatePath}/iframe.phtml"; - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $file = $this->_viewFileSystem->getFilename($templateFile, array('module' => 'Magento_Paypal')); if ($directory->isExist($directory->getRelativePath($file))) { $this->setTemplate($templateFile); diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement.php b/app/code/Magento/Paypal/Controller/Billing/Agreement.php index d2a5c6fc532f49ed10500684468ce0ea0553c522..9456f3ef6d06b3eaaab839229961994c4ec23673 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement.php @@ -23,12 +23,12 @@ */ namespace Magento\Paypal\Controller\Billing; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Billing agreements controller */ -class Agreement extends \Magento\App\Action\Action +class Agreement extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -38,19 +38,19 @@ class Agreement extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_title; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Action\Title $title + * @param \Magento\Framework\App\Action\Title $title */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Action\Title $title + \Magento\Framework\App\Action\Title $title ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); @@ -74,7 +74,7 @@ class Agreement extends \Magento\App\Action\Action * Check customer authentication * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Paypal/Controller/Express.php b/app/code/Magento/Paypal/Controller/Express.php index deffdffc937b7dc2f2416d9cb624c88407da4db1..1ca2c204c3952dc4d95805e364d651590da081bc 100644 --- a/app/code/Magento/Paypal/Controller/Express.php +++ b/app/code/Magento/Paypal/Controller/Express.php @@ -60,7 +60,7 @@ class Express extends \Magento\Paypal\Controller\Express\AbstractExpress protected $_customerHelper; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Checkout\Model\Session $checkoutSession @@ -73,7 +73,7 @@ class Express extends \Magento\Paypal\Controller\Express\AbstractExpress * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Checkout\Model\Session $checkoutSession, diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php index 025145cb4533ce4f6ba7888bba3d39fd5249b3b0..d70090ddb235482345ba1ca56053d806cda8f636 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress.php @@ -24,7 +24,7 @@ namespace Magento\Paypal\Controller\Express; use Magento\Checkout\Model\Type\Onepage; -use Magento\App\Action\Action as AppAction; +use Magento\Framework\App\Action\Action as AppAction; use Magento\Checkout\Controller\Express\RedirectLoginInterface; /** @@ -106,7 +106,7 @@ abstract class AbstractExpress extends AppAction implements RedirectLoginInterfa protected $_paypalSession; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Checkout\Model\Session $checkoutSession @@ -115,7 +115,7 @@ abstract class AbstractExpress extends AppAction implements RedirectLoginInterfa * @param \Magento\Session\Generic $paypalSession */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Checkout\Model\Session $checkoutSession, diff --git a/app/code/Magento/Paypal/Controller/Hostedpro.php b/app/code/Magento/Paypal/Controller/Hostedpro.php index 09b94a50fe5e886833a0545a71f34ec47161c9fe..ad63fdb15ab65aa6e201b96b6b03ff7e078a3ee0 100644 --- a/app/code/Magento/Paypal/Controller/Hostedpro.php +++ b/app/code/Magento/Paypal/Controller/Hostedpro.php @@ -30,7 +30,7 @@ namespace Magento\Paypal\Controller; * @package Magento_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Hostedpro extends \Magento\App\Action\Action +class Hostedpro extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Checkout\Model\Session @@ -38,10 +38,10 @@ class Hostedpro extends \Magento\App\Action\Action protected $_session; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Checkout\Model\Session $session */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Checkout\Model\Session $session) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $session) { parent::__construct($context); $this->_session = $session; diff --git a/app/code/Magento/Paypal/Controller/Ipn.php b/app/code/Magento/Paypal/Controller/Ipn.php index d0ff9def214cc87dc3d21af7adb7656a6b8babd6..b619d7af8ae5a9d10e8a163a6c24bf8fa16ca976 100644 --- a/app/code/Magento/Paypal/Controller/Ipn.php +++ b/app/code/Magento/Paypal/Controller/Ipn.php @@ -26,7 +26,7 @@ namespace Magento\Paypal\Controller; /** * Unified IPN controller for all supported PayPal methods */ -class Ipn extends \Magento\App\Action\Action +class Ipn extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Logger @@ -39,12 +39,12 @@ class Ipn extends \Magento\App\Action\Action protected $_ipnFactory; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Paypal\Model\IpnFactory $ipnFactory * @param \Magento\Logger $logger */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Paypal\Model\IpnFactory $ipnFactory, \Magento\Logger $logger ) { diff --git a/app/code/Magento/Paypal/Controller/Payflow.php b/app/code/Magento/Paypal/Controller/Payflow.php index da5a6dba3343932188629f1e4b4edac7b8b32a50..334647595322348b9b65df0229e8890e77d97745 100644 --- a/app/code/Magento/Paypal/Controller/Payflow.php +++ b/app/code/Magento/Paypal/Controller/Payflow.php @@ -26,7 +26,7 @@ namespace Magento\Paypal\Controller; /** * Payflow Checkout Controller */ -class Payflow extends \Magento\App\Action\Action +class Payflow extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Checkout\Model\Session @@ -60,7 +60,7 @@ class Payflow extends \Magento\App\Action\Action protected $_redirectBlockName = 'payflow.link.iframe'; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Paypal\Model\PayflowlinkFactory $payflowModelFactory @@ -68,7 +68,7 @@ class Payflow extends \Magento\App\Action\Action * @param \Magento\Logger $logger */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Paypal\Model\PayflowlinkFactory $payflowModelFactory, diff --git a/app/code/Magento/Paypal/Controller/Standard.php b/app/code/Magento/Paypal/Controller/Standard.php index 9509faf2c5db0c5d411a63fd0c1b5724e165a3c6..f8c138f37a5a00de276759556847bfd7bfa23094 100644 --- a/app/code/Magento/Paypal/Controller/Standard.php +++ b/app/code/Magento/Paypal/Controller/Standard.php @@ -32,7 +32,7 @@ use Magento\Sales\Model\Order; * @package Magento_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Standard extends \Magento\App\Action\Action +class Standard extends \Magento\Framework\App\Action\Action { /** * Order instance diff --git a/app/code/Magento/Paypal/Helper/Data.php b/app/code/Magento/Paypal/Helper/Data.php index 45455d8188042734b59e12a1b0e80370c40a29f5..7e2233f6daee4f2ca6195e2c921871ce0c0f4363 100644 --- a/app/code/Magento/Paypal/Helper/Data.php +++ b/app/code/Magento/Paypal/Helper/Data.php @@ -28,7 +28,7 @@ use Magento\Paypal\Model\Billing\Agreement\MethodInterface; /** * Paypal Data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Cache for shouldAskToCreateBillingAgreement() @@ -48,12 +48,12 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_agreementFactory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Payment\Helper\Data $paymentData, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory ) { diff --git a/app/code/Magento/Paypal/Helper/Hss.php b/app/code/Magento/Paypal/Helper/Hss.php index eee61a6b44372b8f0af09e558973b745bab00780..6652b8d7d348a7af54274539feb02a42313bad1e 100644 --- a/app/code/Magento/Paypal/Helper/Hss.php +++ b/app/code/Magento/Paypal/Helper/Hss.php @@ -26,7 +26,7 @@ namespace Magento\Paypal\Helper; /** * Hosted Sole Solution helper */ -class Hss extends \Magento\App\Helper\AbstractHelper +class Hss extends \Magento\Framework\App\Helper\AbstractHelper { /** * Hosted Sole Solution methods @@ -50,12 +50,12 @@ class Hss extends \Magento\App\Helper\AbstractHelper protected $_layout; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\View\LayoutInterface $layout */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\View\LayoutInterface $layout ) { diff --git a/app/code/Magento/Paypal/Model/Cert.php b/app/code/Magento/Paypal/Model/Cert.php index 16caa27201204adf3a8e355f37658199cdde04ff..f7e990998b5b8f48fcf97a840b86eabe64ecb592 100644 --- a/app/code/Magento/Paypal/Model/Cert.php +++ b/app/code/Magento/Paypal/Model/Cert.php @@ -50,7 +50,7 @@ class Cert extends \Magento\Model\AbstractModel /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -59,13 +59,13 @@ class Cert extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->encryptor = $encryptor; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index 5c5da6cc9b7656266388c1fb5195ac8fa2f9a796..e44a49deee21d5d8cf152ea7d81403f2eba19686 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -608,7 +608,7 @@ class Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -629,7 +629,7 @@ class Config /** * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Payment\Model\Source\CctypeFactory $cctypeFactory * @param \Magento\Paypal\Model\CertFactory $certFactory @@ -637,7 +637,7 @@ class Config */ public function __construct( \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Payment\Model\Source\CctypeFactory $cctypeFactory, \Magento\Paypal\Model\CertFactory $certFactory, diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php index d0aa159603356227cbd78d0b762191420abeefb2..8861e79ac6a6408ce4e500301d908f32d6efcf13 100644 --- a/app/code/Magento/Paypal/Model/Direct.php +++ b/app/code/Magento/Paypal/Model/Direct.php @@ -154,7 +154,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc protected $_urlBuilder; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_requestHttp; @@ -166,7 +166,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -175,7 +175,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\App\RequestInterface $requestHttp + * @param \Magento\Framework\App\RequestInterface $requestHttp * @param \Magento\Paypal\Model\CartFactory $cartFactory * @param array $data * @@ -184,7 +184,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, @@ -193,7 +193,7 @@ class Direct extends \Magento\Payment\Model\Method\Cc \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $urlBuilder, - \Magento\App\RequestInterface $requestHttp, + \Magento\Framework\App\RequestInterface $requestHttp, \Magento\Paypal\Model\CartFactory $cartFactory, array $data = array() ) { diff --git a/app/code/Magento/Paypal/Model/Express.php b/app/code/Magento/Paypal/Model/Express.php index a663058ac87ee7dce2fdd606e95d2ab97748c253..a8c4ad15bc07f117b618a79022faf4091f07d582 100644 --- a/app/code/Magento/Paypal/Model/Express.php +++ b/app/code/Magento/Paypal/Model/Express.php @@ -184,7 +184,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -195,7 +195,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 0ad3b256d627df4471c254a9f0427bdcdd1cc214..42480acaa2debd8c5679a31ce190bf043c8a7a89 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -146,7 +146,7 @@ class Checkout protected $_order; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -274,7 +274,7 @@ class Checkout * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Checkout\Helper\Data $checkoutData * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Paypal\Model\Info $paypalInfo * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -302,7 +302,7 @@ class Checkout \Magento\Tax\Helper\Data $taxData, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Customer\Model\Session $customerSession, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Locale\ResolverInterface $localeResolver, \Magento\Paypal\Model\Info $paypalInfo, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Paypal/Model/Hostedpro.php b/app/code/Magento/Paypal/Model/Hostedpro.php index 230a037329f314de5f9ef573de8df29b81406209..d1230554e7b8f50a6a8739ad13c92767f1ec284f 100644 --- a/app/code/Magento/Paypal/Model/Hostedpro.php +++ b/app/code/Magento/Paypal/Model/Hostedpro.php @@ -91,7 +91,7 @@ class Hostedpro extends \Magento\Paypal\Model\Direct /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -100,7 +100,7 @@ class Hostedpro extends \Magento\Paypal\Model\Direct * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\App\RequestInterface $requestHttp + * @param \Magento\Framework\App\RequestInterface $requestHttp * @param \Magento\Paypal\Model\CartFactory $cartFactory * @param \Magento\Paypal\Model\Hostedpro\RequestFactory $hostedproRequestFactory * @param array $data @@ -110,7 +110,7 @@ class Hostedpro extends \Magento\Paypal\Model\Direct public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, @@ -119,7 +119,7 @@ class Hostedpro extends \Magento\Paypal\Model\Direct \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\UrlInterface $urlBuilder, - \Magento\App\RequestInterface $requestHttp, + \Magento\Framework\App\RequestInterface $requestHttp, \Magento\Paypal\Model\CartFactory $cartFactory, \Magento\Paypal\Model\Hostedpro\RequestFactory $hostedproRequestFactory, array $data = array() diff --git a/app/code/Magento/Paypal/Model/Method/Agreement.php b/app/code/Magento/Paypal/Model/Method/Agreement.php index 30992645189b2684f3b9be958ca792d197d68c3c..23991cf5416f842af2d57190352309cb4b5e5619 100644 --- a/app/code/Magento/Paypal/Model/Method/Agreement.php +++ b/app/code/Magento/Paypal/Model/Method/Agreement.php @@ -137,7 +137,7 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -151,7 +151,7 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index fcda347c3e9eac60bbcd41064d8afcb4598fee2f..368afda64c5c01400742d15d3871479f25d8a957 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -64,7 +64,7 @@ class Observer protected $_settlementFactory; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_view; @@ -89,7 +89,7 @@ class Observer * @param \Magento\Registry $coreRegistry * @param \Magento\Logger $logger * @param Report\SettlementFactory $settlementFactory - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Checkout\Model\Session $checkoutSession @@ -100,7 +100,7 @@ class Observer \Magento\Registry $coreRegistry, \Magento\Logger $logger, \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory, - \Magento\App\ViewInterface $view, + \Magento\Framework\App\ViewInterface $view, \Magento\AuthorizationInterface $authorization, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Checkout\Model\Session $checkoutSession @@ -180,7 +180,7 @@ class Observer if ($order && $order->getId()) { $payment = $order->getPayment(); if ($payment && in_array($payment->getMethod(), $this->_paypalHss->getHssMethods())) { - /* @var $controller \Magento\App\Action\Action */ + /* @var $controller \Magento\Framework\App\Action\Action */ $controller = $observer->getEvent()->getData('controller_action'); $result = $this->_coreData->jsonDecode($controller->getResponse()->getBody('default')); diff --git a/app/code/Magento/Paypal/Model/PayflowExpress.php b/app/code/Magento/Paypal/Model/PayflowExpress.php index 04da1a17bcb78334f2791bea7f65ed5bc71c2834..dd323952210bb1eea7a217523fb9c83d49d8fec3 100644 --- a/app/code/Magento/Paypal/Model/PayflowExpress.php +++ b/app/code/Magento/Paypal/Model/PayflowExpress.php @@ -57,7 +57,7 @@ class PayflowExpress extends \Magento\Paypal\Model\Express /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -69,7 +69,7 @@ class PayflowExpress extends \Magento\Paypal\Model\Express public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Method\ProTypeFactory $proTypeFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Paypal/Model/Payflowlink.php b/app/code/Magento/Paypal/Model/Payflowlink.php index ebaee46d2f4a1b2250b20cde1d046bccb11fba51..35cb6458d4dd1bd9fa5ff0e115a17fce1152a41c 100644 --- a/app/code/Magento/Paypal/Model/Payflowlink.php +++ b/app/code/Magento/Paypal/Model/Payflowlink.php @@ -149,7 +149,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -161,7 +161,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro * @param \Magento\Paypal\Model\Payflow\RequestFactory $requestFactory * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\App\RequestInterface $requestHttp + * @param \Magento\Framework\App\RequestInterface $requestHttp * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param array $data * @@ -170,7 +170,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, @@ -182,7 +182,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro \Magento\Paypal\Model\Payflow\RequestFactory $requestFactory, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\App\RequestInterface $requestHttp, + \Magento\Framework\App\RequestInterface $requestHttp, \Magento\Store\Model\WebsiteFactory $websiteFactory, array $data = array() ) { diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php index 33eda8848c32acb2f8d4c00f56811ba049573a76..0bc3f10524fc78363e635bf61ddb651ac38fe2ae 100644 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ b/app/code/Magento/Paypal/Model/Payflowpro.php @@ -218,7 +218,7 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Logger $logger * @param \Magento\Module\ModuleListInterface $moduleList @@ -234,7 +234,7 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Logger $logger, \Magento\Module\ModuleListInterface $moduleList, diff --git a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php index 68e627b791572fd709788e395ed82ae7ff196190..ec91b66a8ebd45b322e4d4bf11cb85dbe4ad86ca 100644 --- a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php +++ b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php @@ -60,7 +60,7 @@ abstract class AbstractAgreement extends \Magento\Payment\Model\Method\AbstractM /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param array $data @@ -68,7 +68,7 @@ abstract class AbstractAgreement extends \Magento\Payment\Model\Method\AbstractM public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, array $data = array() diff --git a/app/code/Magento/Paypal/Model/Report/Settlement.php b/app/code/Magento/Paypal/Model/Report/Settlement.php index c92aa51e5ee34271c13cb036248b5d3fead6fcfb..5444e302444ea5f60da0cf0f5028ff4541ed55c1 100644 --- a/app/code/Magento/Paypal/Model/Report/Settlement.php +++ b/app/code/Magento/Paypal/Model/Report/Settlement.php @@ -169,16 +169,16 @@ class Settlement extends \Magento\Model\AbstractModel protected $_storeManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -186,14 +186,14 @@ class Settlement extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - $this->_tmpDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::SYS_TMP_DIR); + $this->_tmpDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); $this->_storeManager = $storeManager; $this->_scopeConfig = $scopeConfig; parent::__construct($context, $registry, $resource, $resourceCollection, $data); diff --git a/app/code/Magento/Paypal/Model/Resource/Cert.php b/app/code/Magento/Paypal/Model/Resource/Cert.php index 32886a68f6e8c27e7b202a40cec521bd58d7295a..f6fed37bcd3131cb33c45639a02dc74555750c47 100644 --- a/app/code/Magento/Paypal/Model/Resource/Cert.php +++ b/app/code/Magento/Paypal/Model/Resource/Cert.php @@ -41,12 +41,12 @@ class Cert extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $coreDate * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $coreDate, \Magento\Stdlib\DateTime $dateTime ) { diff --git a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php b/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php index 216f62e5ba264761138c7b66bae68c8c712f4aa9..83b9d71a931f7d8632615f6e02c5ed233fbcebbb 100644 --- a/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/Magento/Paypal/Model/Resource/Report/Settlement.php @@ -43,10 +43,10 @@ class Settlement extends \Magento\Model\Resource\Db\AbstractDb protected $_coreDate; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $coreDate */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $coreDate) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $coreDate) { $this->_coreDate = $coreDate; parent::__construct($resource); diff --git a/app/code/Magento/Paypal/Model/Standard.php b/app/code/Magento/Paypal/Model/Standard.php index 94c2cd90409c81ad613c4d3cb24d2b22a2dc7784..9de5026a32e80104313f63f94ce014a08cabb327 100644 --- a/app/code/Magento/Paypal/Model/Standard.php +++ b/app/code/Magento/Paypal/Model/Standard.php @@ -105,7 +105,7 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod /** * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Session\Generic $paypalSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -122,7 +122,7 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod public function __construct( \Magento\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Session\Generic $paypalSession, \Magento\Checkout\Model\Session $checkoutSession, diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php index bf1583544adfd65671fefc7d10f422662c0e81ca..ce8b17bc950ef7d3454cd3399d3190fc4685096b 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/Cert.php @@ -28,7 +28,7 @@ namespace Magento\Paypal\Model\System\Config\Backend; /** * Backend model for saving certificate file in case of using certificate based authentication */ -class Cert extends \Magento\App\Config\Value +class Cert extends \Magento\Framework\App\Config\Value { /** * @var \Magento\Paypal\Model\CertFactory @@ -48,10 +48,10 @@ class Cert extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Paypal\Model\CertFactory $certFactory * @param \Magento\Encryption\EncryptorInterface $encryptor - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -59,17 +59,17 @@ class Cert extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Paypal\Model\CertFactory $certFactory, \Magento\Encryption\EncryptorInterface $encryptor, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_certFactory = $certFactory; $this->_encryptor = $encryptor; - $this->_tmpDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::SYS_TMP_DIR); + $this->_tmpDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); } diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php b/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php index 4e72683ee4634acdb61be2d6bdaa9219449c3451..26b366e41aa2275f15e156063215e747052b11c5 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/Cron.php @@ -25,22 +25,22 @@ */ namespace Magento\Paypal\Model\System\Config\Backend; -class Cron extends \Magento\App\Config\Value +class Cron extends \Magento\Framework\App\Config\Value { const CRON_STRING_PATH = 'crontab/default/jobs/paypal_fetch_settlement_reports/schedule/cron_expr'; const CRON_MODEL_PATH_INTERVAL = 'paypal/fetch_reports/schedule'; /** - * @var \Magento\App\Config\ValueFactory + * @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Config\ValueFactory $configValueFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ValueFactory $configValueFactory * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -48,8 +48,8 @@ class Cron extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Config\ValueFactory $configValueFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ValueFactory $configValueFactory, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php index a5ba9c992e9c9ac9a6f62a2d69232ca275c112dc..e08a05b47def974066ab6e5045c75eca521ed372 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php @@ -28,7 +28,7 @@ namespace Magento\Paypal\Model\System\Config\Backend; /** * Backend model for merchant country. Default country used instead of empty value. */ -class MerchantCountry extends \Magento\App\Config\Value +class MerchantCountry extends \Magento\Framework\App\Config\Value { /** * Core data @@ -45,7 +45,7 @@ class MerchantCountry extends \Magento\App\Config\Value /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Model\Resource\AbstractResource $resource @@ -55,7 +55,7 @@ class MerchantCountry extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Core\Helper\Data $coreData, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Paypal/etc/adminhtml/routes.xml b/app/code/Magento/Paypal/etc/adminhtml/routes.xml index 8cae831ad933087396c2a01fe13a3e3f1c0612f6..5ea080e7b525c638ecb505a8283d9188c6aea4d7 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/routes.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="paypal" frontName="paypal"> <module name="Magento_Paypal" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Paypal/etc/frontend/routes.xml b/app/code/Magento/Paypal/etc/frontend/routes.xml index c41b51903bc7fea9f4e3038c998c9dd8bd72c5a8..24b4a67aca4a21f41223c14880eac80b51f19ba2 100644 --- a/app/code/Magento/Paypal/etc/frontend/routes.xml +++ b/app/code/Magento/Paypal/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="paypal" frontName="paypal"> <module name="Magento_Paypal" /> diff --git a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml index 8b164e23860990fefe1e7a787204a1872d660f52..a5e3bcbaf91e02ed3e08de67db6786ccaf90b03c 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/customer_account.xml @@ -24,6 +24,11 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="head"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Billing Agreements</argument> + </action> + </referenceBlock> <referenceBlock name="customer_account_navigation"> <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-billing-agreements-link"> <arguments> diff --git a/app/code/Magento/Persistent/Controller/Index.php b/app/code/Magento/Persistent/Controller/Index.php index 6059ebca70bbc5d22e85f16beb04d289761bd8ca..1fed2876b62f153cb6cfe35ce6b309cf1b725fc7 100644 --- a/app/code/Magento/Persistent/Controller/Index.php +++ b/app/code/Magento/Persistent/Controller/Index.php @@ -28,7 +28,7 @@ namespace Magento\Persistent\Controller; /** * Persistent front controller */ -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** * Whether clear checkout session when logout @@ -61,13 +61,13 @@ class Index extends \Magento\App\Action\Action /** * Construct * - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Persistent\Model\Observer $persistentObserver * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Persistent\Model\Observer $persistentObserver, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession diff --git a/app/code/Magento/Persistent/Helper/Data.php b/app/code/Magento/Persistent/Helper/Data.php index 634e9bddd81470c28d1a5f7341fd731d6369e623..9c0ea4cf58d8f0d6f37a078a023bba7e14efe0d0 100644 --- a/app/code/Magento/Persistent/Helper/Data.php +++ b/app/code/Magento/Persistent/Helper/Data.php @@ -68,20 +68,22 @@ class Data extends \Magento\Core\Helper\Data protected $_modulesReader; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param Session $persistentSession * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\Escaper $escaper * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, Session $persistentSession, \Magento\Module\Dir\Reader $modulesReader, \Magento\Escaper $escaper, @@ -91,7 +93,14 @@ class Data extends \Magento\Core\Helper\Data $this->_persistentSession = $persistentSession; $this->_escaper = $escaper; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** diff --git a/app/code/Magento/Persistent/Helper/Session.php b/app/code/Magento/Persistent/Helper/Session.php index a018b171113c20808d21ac97af9435b084ca66ec..53f179ddb311accc74f8bf848e9c217492835842 100644 --- a/app/code/Magento/Persistent/Helper/Session.php +++ b/app/code/Magento/Persistent/Helper/Session.php @@ -80,10 +80,11 @@ class Session extends \Magento\Core\Helper\Data protected $_checkoutSession; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param Data $persistentData * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -91,10 +92,11 @@ class Session extends \Magento\Core\Helper\Data * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Persistent\Helper\Data $persistentData, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\CustomerFactory $customerFactory, @@ -105,7 +107,14 @@ class Session extends \Magento\Core\Helper\Data $this->_checkoutSession = $checkoutSession; $this->_customerFactory = $customerFactory; $this->_sessionFactory = $sessionFactory; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** @@ -160,9 +169,9 @@ class Session extends \Magento\Core\Helper\Data return $isRememberMeChecked; } - return $this->_persistentData->isEnabled() && - $this->_persistentData->isRememberMeEnabled() && - $this->_persistentData->isRememberMeCheckedDefault(); + return $this->_persistentData->isEnabled() + && $this->_persistentData->isRememberMeEnabled() + && $this->_persistentData->isRememberMeCheckedDefault(); } return (bool)$this->_isRememberMeChecked; diff --git a/app/code/Magento/Persistent/Model/Observer.php b/app/code/Magento/Persistent/Model/Observer.php index fd287266d511782835abc09054af44deb4290d39..cde2d71af627b0ee786367ec42ce6bfdd855c814 100644 --- a/app/code/Magento/Persistent/Model/Observer.php +++ b/app/code/Magento/Persistent/Model/Observer.php @@ -25,6 +25,8 @@ */ namespace Magento\Persistent\Model; +use Magento\Customer\Model\Converter as CustomerConverter; + /** * Persistent Observer * @@ -70,7 +72,7 @@ class Observer /** * Request http * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_requestHttp; @@ -145,6 +147,11 @@ class Observer */ protected $_expressRedirectHelper; + /** + * @var CustomerConverter + */ + protected $customerConverter; + /** * Construct * @@ -159,11 +166,12 @@ class Observer * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Persistent\Model\Persistent\ConfigFactory $persistentConfigFactory - * @param \Magento\App\RequestInterface $requestHttp + * @param \Magento\Framework\App\RequestInterface $requestHttp * @param \Magento\View\LayoutInterface $layout * @param \Magento\Escaper $escaper * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\Checkout\Helper\ExpressRedirect $expressRedirectHelper + * @param CustomerConverter $customerConverter * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -179,11 +187,12 @@ class Observer \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Persistent\Model\Persistent\ConfigFactory $persistentConfigFactory, - \Magento\App\RequestInterface $requestHttp, + \Magento\Framework\App\RequestInterface $requestHttp, \Magento\View\LayoutInterface $layout, \Magento\Escaper $escaper, \Magento\Message\ManagerInterface $messageManager, - \Magento\Checkout\Helper\ExpressRedirect $expressRedirectHelper + \Magento\Checkout\Helper\ExpressRedirect $expressRedirectHelper, + CustomerConverter $customerConverter ) { $this->_eventManager = $eventManager; $this->_persistentSession = $persistentSession; @@ -201,6 +210,7 @@ class Observer $this->_escaper = $escaper; $this->messageManager = $messageManager; $this->_expressRedirectHelper = $expressRedirectHelper; + $this->customerConverter = $customerConverter; } /** @@ -327,7 +337,9 @@ class Observer } if ($this->_isShoppingCartPersist()) { - $this->_checkoutSession->setCustomer($this->_getPersistentCustomer()); + $this->_checkoutSession->setCustomerData( + $this->customerConverter->createCustomerFromModel($this->_getPersistentCustomer()) + ); if (!$this->_checkoutSession->hasQuote()) { $this->_checkoutSession->getQuote(); } @@ -643,17 +655,13 @@ class Observer { $quote = $this->_checkoutSession->setLoadInactive()->getQuote(); if ($quote->getIsActive() && $quote->getCustomerId()) { - $this->_checkoutSession->setCustomer(null)->clearQuote()->clearStorage(); + $this->_checkoutSession->setCustomerData(null)->clearQuote()->clearStorage(); } else { - $quote->setIsActive( - true - )->setIsPersistent( - false - )->setCustomerId( - null - )->setCustomerGroupId( - \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID - ); + $quote + ->setIsActive(true) + ->setIsPersistent(false) + ->setCustomerId(null) + ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); } } diff --git a/app/code/Magento/Persistent/Model/Observer/Session.php b/app/code/Magento/Persistent/Model/Observer/Session.php index 3d01a5eb0d341011b6ce10b45fc6a7925b4bc248..05009b094a84e7f84b840e809d8ab71904dddf20 100644 --- a/app/code/Magento/Persistent/Model/Observer/Session.php +++ b/app/code/Magento/Persistent/Model/Observer/Session.php @@ -189,7 +189,7 @@ class Session /** @var $sessionModel \Magento\Persistent\Model\Session */ $sessionModel = $this->_persistentSession->getSession(); - /** @var $request \Magento\App\RequestInterface */ + /** @var $request \Magento\Framework\App\RequestInterface */ $request = $observer->getEvent()->getRequest(); // Quote Id could be changed only by logged in customer @@ -215,7 +215,7 @@ class Session return; } - /** @var $controllerAction \Magento\App\RequestInterface */ + /** @var $controllerAction \Magento\Framework\App\RequestInterface */ $request = $observer->getEvent()->getRequest(); if ($request) { $rememberMeCheckbox = $request->getPost('persistent_remember_me'); @@ -243,7 +243,7 @@ class Session return; } - /** @var $request \Magento\App\RequestInterface */ + /** @var $request \Magento\Framework\App\RequestInterface */ $request = $observer->getEvent()->getRequest(); if ($this->_customerSession->isLoggedIn() || $request->getFullActionName() == 'customer_account_logout') { diff --git a/app/code/Magento/Persistent/Model/Persistent/Config.php b/app/code/Magento/Persistent/Model/Persistent/Config.php index 27b91bb55113df6cf735362766b0b55629571e2d..1a7b4153feacc9c81a0b4b228b26015ffdf76626 100644 --- a/app/code/Magento/Persistent/Model/Persistent/Config.php +++ b/app/code/Magento/Persistent/Model/Persistent/Config.php @@ -62,7 +62,7 @@ class Config /** * App state model * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -84,24 +84,24 @@ class Config * @param \Magento\Config\DomFactory $domFactory * @param \Magento\Module\Dir\Reader $moduleReader * @param \Magento\View\LayoutInterface $layout - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Persistent\Model\Factory $persistentFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Config\DomFactory $domFactory, \Magento\Module\Dir\Reader $moduleReader, \Magento\View\LayoutInterface $layout, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Persistent\Model\Factory $persistentFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_domFactory = $domFactory; $this->_moduleReader = $moduleReader; $this->_layout = $layout; $this->_appState = $appState; $this->_persistentFactory = $persistentFactory; - $this->_modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->_modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); } /** @@ -249,7 +249,7 @@ class Config if (method_exists($object, $method)) { $object->{$method}($instance); - } elseif ($this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER) { + } elseif ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { throw new \Magento\Model\Exception( 'Method "' . $method . '" is not defined in "' . get_class($object) . '"' ); diff --git a/app/code/Magento/Persistent/Model/Resource/Session.php b/app/code/Magento/Persistent/Model/Resource/Session.php index 8ef15f607081fd5a255ae56c21a47d7540440872..542e2cb415c44a61e818362cd9aa282d76353603 100644 --- a/app/code/Magento/Persistent/Model/Resource/Session.php +++ b/app/code/Magento/Persistent/Model/Resource/Session.php @@ -47,11 +47,11 @@ class Session extends \Magento\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Persistent\Model\SessionFactory $sessionFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Persistent\Model\SessionFactory $sessionFactory ) { $this->_sessionFactory = $sessionFactory; diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index 05f78c577da8c7f28fa310089762ef249bc7ca02..ba901e632c49d43fc4beff70bb2ff6aad535a9cc 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -76,7 +76,7 @@ class Session extends \Magento\Model\AbstractModel protected $_coreData; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfig; @@ -109,7 +109,7 @@ class Session extends \Magento\Model\AbstractModel * * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Persistent\Helper\Data $persistentData * @param \Magento\Stdlib\Cookie $cookie @@ -123,7 +123,7 @@ class Session extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Core\Helper\Data $coreData, \Magento\Persistent\Helper\Data $persistentData, \Magento\Stdlib\Cookie $cookie, diff --git a/app/code/Magento/Persistent/etc/frontend/routes.xml b/app/code/Magento/Persistent/etc/frontend/routes.xml index e5fcd4267e21a962d92338c63a628a1c2d682a4b..727656c687400bdce81b724ffbccd1680e315c57 100644 --- a/app/code/Magento/Persistent/etc/frontend/routes.xml +++ b/app/code/Magento/Persistent/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="persistent" frontName="persistent"> <module name="Magento_Persistent" /> diff --git a/app/code/Magento/ProductAlert/Controller/Add.php b/app/code/Magento/ProductAlert/Controller/Add.php index cc67044c67a09fe6fd180ec433fc58569fdd35e9..75a8779c63dd3edd5534aa1e25d776d24cf85770 100644 --- a/app/code/Magento/ProductAlert/Controller/Add.php +++ b/app/code/Magento/ProductAlert/Controller/Add.php @@ -25,8 +25,8 @@ */ namespace Magento\ProductAlert\Controller; -use Magento\App\Action\Context; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\Context; +use Magento\Framework\App\RequestInterface; /** * ProductAlert controller @@ -35,7 +35,7 @@ use Magento\App\RequestInterface; * @package Magento_ProductAlert * @author Magento Core Team <core@magentocommerce.com> */ -class Add extends \Magento\App\Action\Action +class Add extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -47,7 +47,7 @@ class Add extends \Magento\App\Action\Action * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; @@ -58,7 +58,7 @@ class Add extends \Magento\App\Action\Action * Check customer authentication for some actions * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { @@ -90,7 +90,7 @@ class Add extends \Magento\App\Action\Action */ public function priceAction() { - $backUrl = $this->getRequest()->getParam(\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED); + $backUrl = $this->getRequest()->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED); $productId = (int)$this->getRequest()->getParam('product_id'); if (!$backUrl || !$productId) { $this->_redirect('/'); @@ -134,7 +134,7 @@ class Add extends \Magento\App\Action\Action */ public function stockAction() { - $backUrl = $this->getRequest()->getParam(\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED); + $backUrl = $this->getRequest()->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED); $productId = (int)$this->getRequest()->getParam('product_id'); if (!$backUrl || !$productId) { $this->_redirect('/'); diff --git a/app/code/Magento/ProductAlert/Controller/Unsubscribe.php b/app/code/Magento/ProductAlert/Controller/Unsubscribe.php index ae038ed11ca0dc5cc33eb816f15ba5073b2d595c..111fbdb273e545b60a561e0f13768a2b4d429c35 100644 --- a/app/code/Magento/ProductAlert/Controller/Unsubscribe.php +++ b/app/code/Magento/ProductAlert/Controller/Unsubscribe.php @@ -32,16 +32,16 @@ namespace Magento\ProductAlert\Controller; * @package Magento_ProductAlert * @author Magento Core Team <core@magentocommerce.com> */ -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; -class Unsubscribe extends \Magento\App\Action\Action +class Unsubscribe extends \Magento\Framework\App\Action\Action { /** * Check customer authentication for some actions * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/ProductAlert/Helper/Data.php b/app/code/Magento/ProductAlert/Helper/Data.php index 4b26d2f7c091ca5bc0318cfb8fdb8b47eee3434a..314678b8983b0f99b36b41b7e22440f97d142f68 100644 --- a/app/code/Magento/ProductAlert/Helper/Data.php +++ b/app/code/Magento/ProductAlert/Helper/Data.php @@ -54,7 +54,7 @@ class Data extends \Magento\Core\Helper\Url /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -69,19 +69,19 @@ class Data extends \Magento\Core\Helper\Url protected $_session; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Registry $coreRegistry * @param \Magento\View\LayoutInterface $layout - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Model\Session $session */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Registry $coreRegistry, \Magento\View\LayoutInterface $layout, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $session ) { $this->_coreRegistry = $coreRegistry; @@ -142,7 +142,7 @@ class Data extends \Magento\Core\Helper\Url 'productalert/add/' . $type, array( 'product_id' => $this->getProduct()->getId(), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl() ) ); } diff --git a/app/code/Magento/ProductAlert/Model/Email.php b/app/code/Magento/ProductAlert/Model/Email.php index 8db18d59f0ed206a188ad27ab402c953e9c275af..3044020ea906f4e9d83c3953c98d3481c29a3fa8 100644 --- a/app/code/Magento/ProductAlert/Model/Email.php +++ b/app/code/Magento/ProductAlert/Model/Email.php @@ -99,7 +99,7 @@ class Email extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -127,7 +127,7 @@ class Email extends \Magento\Model\AbstractModel * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\ProductAlert\Helper\Data $productAlertData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Core\Model\App\Emulation $appEmulation @@ -140,7 +140,7 @@ class Email extends \Magento\Model\AbstractModel \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\ProductAlert\Helper\Data $productAlertData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Core\Model\App\Emulation $appEmulation, diff --git a/app/code/Magento/ProductAlert/Model/Observer.php b/app/code/Magento/ProductAlert/Model/Observer.php index 712b616e4cf1607204557e1fd9aee0104ae1c83e..02290d3d9908cded40c2b45fcc1f217b51112f9b 100644 --- a/app/code/Magento/ProductAlert/Model/Observer.php +++ b/app/code/Magento/ProductAlert/Model/Observer.php @@ -85,7 +85,7 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -136,7 +136,7 @@ class Observer /** * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ProductAlert\Model\Resource\Price\CollectionFactory $priceColFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -149,7 +149,7 @@ class Observer */ public function __construct( \Magento\Tax\Helper\Data $taxData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ProductAlert\Model\Resource\Price\CollectionFactory $priceColFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, diff --git a/app/code/Magento/ProductAlert/Model/Resource/Price.php b/app/code/Magento/ProductAlert/Model/Resource/Price.php index 165949255c901759c5806def2f532d9be4340ebe..7f7a9af8cd9c6a0cb53cccdbe6fcef7c2e9135fa 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Price.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Price.php @@ -36,10 +36,10 @@ class Price extends \Magento\ProductAlert\Model\Resource\AbstractResource protected $_dateFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory) { $this->_dateFactory = $dateFactory; parent::__construct($resource); diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index 7dea67151e288728cd972b7bf1791cc9fb5fb1f1..ca29e33254b70441f120e6096b56f06ee6765ca5 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -36,10 +36,10 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource protected $_dateFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTimeFactory $dateFactory) { $this->_dateFactory = $dateFactory; parent::__construct($resource); diff --git a/app/code/Magento/ProductAlert/etc/frontend/routes.xml b/app/code/Magento/ProductAlert/etc/frontend/routes.xml index c0ee4cb6c3f767587a7ac15f8b7176eb9728b392..ca125601a0ff25174986c3ebe82e38ef6410776c 100644 --- a/app/code/Magento/ProductAlert/etc/frontend/routes.xml +++ b/app/code/Magento/ProductAlert/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="productalert" frontName="productalert"> <module name="Magento_ProductAlert" /> diff --git a/app/code/Magento/RecurringPayment/Block/Adminhtml/Customer/Edit/Tab/RecurringPayment.php b/app/code/Magento/RecurringPayment/Block/Adminhtml/Customer/Edit/Tab/RecurringPayment.php index ac17f901d315fac00f7a0f5c14686d34b9264242..c83f69da43e9ea433fbe94d830030d80f57effa7 100644 --- a/app/code/Magento/RecurringPayment/Block/Adminhtml/Customer/Edit/Tab/RecurringPayment.php +++ b/app/code/Magento/RecurringPayment/Block/Adminhtml/Customer/Edit/Tab/RecurringPayment.php @@ -23,7 +23,6 @@ */ namespace Magento\RecurringPayment\Block\Adminhtml\Customer\Edit\Tab; -use Magento\Customer\Controller\Adminhtml\Index as CustomerController; use Magento\Customer\Controller\RegistryConstants; use Magento\RecurringPayment\Block\Adminhtml\Payment\Grid as PaymentGrid; use Magento\Backend\Block\Widget\Tab\TabInterface; @@ -66,15 +65,7 @@ class RecurringPayment extends PaymentGrid implements TabInterface array $data = array() ) { $this->_coreRegistry = $coreRegistry; - - // @todo remove usage of CURRENT_CUSTOMER in advantage of CURRENT_CUSTOMER_ID - $currentCustomer = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER); - if ($currentCustomer) { - $this->_currentCustomerId = $currentCustomer->getId(); - } else { - $this->_currentCustomerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); - } - + $this->_currentCustomerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); parent::__construct($context, $backendHelper, $paymentCollection, $recurringStates, $fields, $payments, $data); } diff --git a/app/code/Magento/RecurringPayment/Block/Payment/Grid.php b/app/code/Magento/RecurringPayment/Block/Payment/Grid.php index 07022980322accbebad5b33f3cac2fbd4c86a888..7f3ba9e9fc2702dcdf2a0a9b9fad6d67d4a211fc 100644 --- a/app/code/Magento/RecurringPayment/Block/Payment/Grid.php +++ b/app/code/Magento/RecurringPayment/Block/Payment/Grid.php @@ -23,6 +23,8 @@ */ namespace Magento\RecurringPayment\Block\Payment; +use Magento\Customer\Controller\RegistryConstants; + /** * Recurring payment view grid */ @@ -81,7 +83,7 @@ class Grid extends \Magento\RecurringPayment\Block\Payments { $this->_payments = $this->_recurringPayment->getCollection()->addFieldToFilter( 'customer_id', - $this->_registry->registry('current_customer')->getId() + $this->_registry->registry(RegistryConstants::CURRENT_CUSTOMER_ID) )->addFieldToSelect( $fields )->setOrder( diff --git a/app/code/Magento/RecurringPayment/Block/Payment/Related/Orders/Grid.php b/app/code/Magento/RecurringPayment/Block/Payment/Related/Orders/Grid.php index 25aff54944e4e4a368fd12db3633a1646ac45696..faaf481851b580b332c62e64846029855dc83884 100644 --- a/app/code/Magento/RecurringPayment/Block/Payment/Related/Orders/Grid.php +++ b/app/code/Magento/RecurringPayment/Block/Payment/Related/Orders/Grid.php @@ -23,8 +23,13 @@ */ namespace Magento\RecurringPayment\Block\Payment\Related\Orders; +use Magento\Customer\Controller\RegistryConstants; + /** * Recurring payment related orders grid + * + * @method \Magento\Object[] getGridElements() + * @method Grid setGridElements($orders) */ class Grid extends \Magento\RecurringPayment\Block\Payment\View { @@ -83,15 +88,10 @@ class Grid extends \Magento\RecurringPayment\Block\Payment\View protected function _prepareRelatedOrders($fieldsToSelect = '*') { if (null === $this->_relatedOrders) { - $this->_orderCollection->addFieldToSelect( - $fieldsToSelect - )->addFieldToFilter( - 'customer_id', - $this->_registry->registry('current_customer')->getId() - )->setOrder( - 'entity_id', - 'desc' - ); + $this->_orderCollection + ->addFieldToSelect($fieldsToSelect) + ->addFieldToFilter('customer_id', $this->_registry->registry(RegistryConstants::CURRENT_CUSTOMER_ID)) + ->setOrder('entity_id', 'desc'); $this->_relatedOrders = $this->_recurringCollectionFilter->byIds( $this->_orderCollection, $this->_recurringPayment->getId() diff --git a/app/code/Magento/RecurringPayment/Controller/Adminhtml/RecurringPayment.php b/app/code/Magento/RecurringPayment/Controller/Adminhtml/RecurringPayment.php index 1a68efb3b7c3440d58ddde9eac0c4111d51e3230..9f6c60143e92a9a14eccaad47fcedd539224d53b 100644 --- a/app/code/Magento/RecurringPayment/Controller/Adminhtml/RecurringPayment.php +++ b/app/code/Magento/RecurringPayment/Controller/Adminhtml/RecurringPayment.php @@ -23,7 +23,7 @@ */ namespace Magento\RecurringPayment\Controller\Adminhtml; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; use Magento\Model\Exception as CoreException; use Magento\Customer\Controller\RegistryConstants; diff --git a/app/code/Magento/RecurringPayment/Controller/Download.php b/app/code/Magento/RecurringPayment/Controller/Download.php index 9f2678e104b7910f3f09087c8f9bab19e9b01324..0c5dfd96fa9bd0caa785851fb2045f598daf1944 100644 --- a/app/code/Magento/RecurringPayment/Controller/Download.php +++ b/app/code/Magento/RecurringPayment/Controller/Download.php @@ -23,7 +23,7 @@ */ namespace Magento\RecurringPayment\Controller; -class Download extends \Magento\App\Action\Action +class Download extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Sales\Model\Download @@ -31,10 +31,10 @@ class Download extends \Magento\App\Action\Action protected $download; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Sales\Model\Download $download */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Sales\Model\Download $download) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Sales\Model\Download $download) { parent::__construct($context); $this->download = $download; diff --git a/app/code/Magento/RecurringPayment/Controller/RecurringPayment.php b/app/code/Magento/RecurringPayment/Controller/RecurringPayment.php index 0ab0ef6b0bf6907eb7b662c3864cf41b776ed276..a690b37d44059c1a9b76c1975376e4269d0b1dc1 100644 --- a/app/code/Magento/RecurringPayment/Controller/RecurringPayment.php +++ b/app/code/Magento/RecurringPayment/Controller/RecurringPayment.php @@ -27,16 +27,16 @@ */ namespace Magento\RecurringPayment\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Customer\Controller\RegistryConstants; -class RecurringPayment extends \Magento\App\Action\Action +class RecurringPayment extends \Magento\Framework\App\Action\Action { /** * * @var \Magento\Customer\Model\Session */ - protected $_session = null; + protected $_session; /** * Core registry @@ -46,37 +46,41 @@ class RecurringPayment extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_title; /** - * @param \Magento\App\Action\Context $context + * Initialize dependencies + * + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Action\Title $title + * @param \Magento\Framework\App\Action\Title $title + * @param \Magento\Customer\Model\Session $customerSession */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Action\Title $title + \Magento\Framework\App\Action\Title $title, + \Magento\Customer\Model\Session $customerSession ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); $this->_title = $title; + $this->_session = $customerSession; } /** * Make sure customer is logged in and put it into registry * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { if (!$request->isDispatched()) { return parent::dispatch($request); } - $this->_session = $this->_objectManager->get('Magento\Customer\Model\Session'); if (!$this->_session->authenticate($this)) { $this->_actionFlag->set('', 'no-dispatch', true); } diff --git a/app/code/Magento/RecurringPayment/Model/Product/Attribute/Backend/Recurring.php b/app/code/Magento/RecurringPayment/Model/Product/Attribute/Backend/Recurring.php index 8cdf714d66903db94e24ba6d30ecc2ec2c4fecf8..af8683d82b704864edb93b325d9c6aff7b0be7a0 100644 --- a/app/code/Magento/RecurringPayment/Model/Product/Attribute/Backend/Recurring.php +++ b/app/code/Magento/RecurringPayment/Model/Product/Attribute/Backend/Recurring.php @@ -22,11 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\RecurringPayment\Model\Product\Attribute\Backend; + /** * Backend for recurring payment parameter */ -namespace Magento\RecurringPayment\Model\Product\Attribute\Backend; - class Recurring extends \Magento\Eav\Model\Entity\Attribute\Backend\Serialized { /** @@ -49,7 +49,7 @@ class Recurring extends \Magento\Eav\Model\Entity\Attribute\Backend\Serialized /** * Unserialize or remove on failure * - * @param \Magento\Catalog\Model\Product $product + * @param \Magento\Catalog\Model\Product|\Magento\Object $product * @return void */ protected function _unserialize(\Magento\Object $product) diff --git a/app/code/Magento/RecurringPayment/etc/adminhtml/routes.xml b/app/code/Magento/RecurringPayment/etc/adminhtml/routes.xml index da8489d6fd2180fb093380c34367f982c8facaa8..3f3158a79c272f63ef958fc107d0f3b4a47215db 100644 --- a/app/code/Magento/RecurringPayment/etc/adminhtml/routes.xml +++ b/app/code/Magento/RecurringPayment/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="sales" frontName="sales"> <module name="Magento_RecurringPayment" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/RecurringPayment/etc/frontend/routes.xml b/app/code/Magento/RecurringPayment/etc/frontend/routes.xml index 33656e5781084fbea024ff21a79bf7ab9bf5a215..121a929bddbdbcb70b03be954e5c2edcfe1533ca 100644 --- a/app/code/Magento/RecurringPayment/etc/frontend/routes.xml +++ b/app/code/Magento/RecurringPayment/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="sales" frontName="sales"> <module name="Magento_RecurringPayment" /> diff --git a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml index 51e20356fdf6e13249097f77144c8d7079ac4710..6901d86b2b9b9e6b810dddca919fe90752adb826 100644 --- a/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml +++ b/app/code/Magento/RecurringPayment/view/frontend/layout/sales_recurringpayment_index.xml @@ -25,6 +25,11 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="customer_account"/> + <referenceBlock name="head"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Recurring Payments</argument> + </action> + </referenceBlock> <referenceContainer name="content"> <block class="Magento\RecurringPayment\Block\Payments" name="sales.recurring.payments" template="recurring/payments.phtml" cacheable="false"> <block class="Magento\RecurringPayment\Block\Payment\Grid" name="sales.recurring.payments.grid" as="grid" template="recurring/grid.phtml" cacheable="false"> diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Index.php b/app/code/Magento/Reports/Controller/Adminhtml/Index.php index c4cea1275b6e88a5269db6cfc677b8aab2f7b03e..58fb222edd099de19ab064c627ca2e35bd6c1802 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Index.php @@ -33,22 +33,22 @@ */ namespace Magento\Reports\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Index extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -95,7 +95,7 @@ class Index extends \Magento\Backend\App\Action { $this->_view->loadLayout(false); $content = $this->_view->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); - return $this->_fileFactory->create('search.csv', $content->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create('search.csv', $content->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -107,7 +107,7 @@ class Index extends \Magento\Backend\App\Action { $this->_view->loadLayout(false); $content = $this->_view->getLayout()->getChildBlock('adminhtml.report.search.grid', 'grid.export'); - return $this->_fileFactory->create('search.xml', $content->getExcelFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create('search.xml', $content->getExcelFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php index 708e6cb5d2735e572ab03cd00e660b0fbf5c2248..1cc3541a6983a9d36a079938ae22e8e0fd7479bd 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php @@ -37,7 +37,7 @@ namespace Magento\Reports\Controller\Adminhtml\Report; abstract class AbstractReport extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -48,12 +48,12 @@ abstract class AbstractReport extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Stdlib\DateTime\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Stdlib\DateTime\Filter\Date $dateFilter ) { parent::__construct($context); diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php index 9f03547488aa23e0679c4436fd841180344fabca..d13365957a889a4c17138ee4a49ece71e3933510 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php @@ -34,23 +34,23 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Backend\Block\Widget\Grid\ExportInterface; class Customer extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -103,7 +103,11 @@ class Customer extends \Magento\Backend\App\Action $fileName = 'new_accounts.csv'; /** @var ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -120,7 +124,7 @@ class Customer extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $exportBlock->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } @@ -153,7 +157,11 @@ class Customer extends \Magento\Backend\App\Action $fileName = 'customers_orders.csv'; /** @var ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -170,7 +178,7 @@ class Customer extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $exportBlock->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } @@ -203,7 +211,11 @@ class Customer extends \Magento\Backend\App\Action $fileName = 'customer_totals.csv'; /** @var ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -220,7 +232,7 @@ class Customer extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $exportBlock->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php index b7ff27d704bced72d850a5668adbef451ed38223..a5fc1c4f7478b84ac5374dea575765db0ba5aa6d 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php @@ -34,7 +34,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Backend\Block\Widget\Grid\ExportInterface; use Magento\Reports\Model\Flag; @@ -80,7 +80,11 @@ class Product extends AbstractReport $fileName = 'products_ordered.csv'; /** @var ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('adminhtml.report.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -97,7 +101,7 @@ class Product extends AbstractReport return $this->_fileFactory->create( $fileName, $exportBlock->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } @@ -137,7 +141,7 @@ class Product extends AbstractReport $fileName = 'products_mostviewed.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Product\Viewed\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -150,7 +154,11 @@ class Product extends AbstractReport $fileName = 'products_mostviewed.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Product\Viewed\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $grid->getExcelFile($fileName), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -184,7 +192,11 @@ class Product extends AbstractReport 'adminhtml.block.report.product.lowstock.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -200,7 +212,11 @@ class Product extends AbstractReport 'adminhtml.block.report.product.lowstock.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php index eade50ac9c058c30ada07ac708d76d2db039e7cb..a77742dca46d1e0af26abf7d7d02e48768b5d80a 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php @@ -33,22 +33,22 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Review extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -98,7 +98,7 @@ class Review extends \Magento\Backend\App\Action 'adminhtml.block.report.review.customer.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -114,7 +114,7 @@ class Review extends \Magento\Backend\App\Action 'adminhtml.block.report.review.customer.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -148,7 +148,7 @@ class Review extends \Magento\Backend\App\Action 'adminhtml.block.report.review.product.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -164,7 +164,7 @@ class Review extends \Magento\Backend\App\Action 'adminhtml.block.report.review.product.grid', 'grid.export' ); - return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -202,7 +202,7 @@ class Review extends \Magento\Backend\App\Action 'Magento\Reports\Block\Adminhtml\Review\Detail\Grid' )->getCsv(); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -219,7 +219,7 @@ class Review extends \Magento\Backend\App\Action $fileName ); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php index 6cc81da44e10a826288cb16c884593c929094588..526de98e2e5ed20c5c57e3e17591f756e1a81d1e 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php @@ -33,7 +33,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Reports\Model\Flag; class Sales extends AbstractReport @@ -112,7 +112,7 @@ class Sales extends AbstractReport $fileName = 'bestsellers.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Bestsellers\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -125,7 +125,7 @@ class Sales extends AbstractReport $fileName = 'bestsellers.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Bestsellers\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -158,7 +158,7 @@ class Sales extends AbstractReport $fileName = 'sales.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Sales\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -171,7 +171,7 @@ class Sales extends AbstractReport $fileName = 'sales.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Sales\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -210,7 +210,7 @@ class Sales extends AbstractReport $fileName = 'tax.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Tax\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -223,7 +223,7 @@ class Sales extends AbstractReport $fileName = 'tax.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Tax\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -262,7 +262,7 @@ class Sales extends AbstractReport $fileName = 'shipping.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Shipping\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -275,7 +275,7 @@ class Sales extends AbstractReport $fileName = 'shipping.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Shipping\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -314,7 +314,7 @@ class Sales extends AbstractReport $fileName = 'invoiced.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Invoiced\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -327,7 +327,7 @@ class Sales extends AbstractReport $fileName = 'invoiced.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Invoiced\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -366,7 +366,7 @@ class Sales extends AbstractReport $fileName = 'refunded.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Refunded\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -379,7 +379,7 @@ class Sales extends AbstractReport $fileName = 'refunded.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Refunded\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -418,7 +418,7 @@ class Sales extends AbstractReport $fileName = 'coupons.csv'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Coupons\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -431,7 +431,7 @@ class Sales extends AbstractReport $fileName = 'coupons.xml'; $grid = $this->_view->getLayout()->createBlock('Magento\Reports\Block\Adminhtml\Sales\Coupons\Grid'); $this->_initReportAction($grid); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php index 7580696fd92cc61e7047096ea8cd42b4dc7cf8f3..2aab4e58c37075e60c901a723ebda69cd29817f1 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php @@ -33,22 +33,22 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Shopcart extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -151,7 +151,7 @@ class Shopcart extends \Magento\Backend\App\Action 'Magento\Reports\Block\Adminhtml\Shopcart\Product\Grid' )->getCsvFile(); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -168,7 +168,7 @@ class Shopcart extends \Magento\Backend\App\Action $fileName ); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -203,7 +203,7 @@ class Shopcart extends \Magento\Backend\App\Action 'Magento\Reports\Block\Adminhtml\Shopcart\Abandoned\Grid' )->getCsvFile(); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -220,7 +220,7 @@ class Shopcart extends \Magento\Backend\App\Action $fileName ); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Reports/Helper/Data.php b/app/code/Magento/Reports/Helper/Data.php index 6182597e056536f8db5e0364569ff50b5dea9637..89b435ec04f152257fb15b23368b8e4a58b29457 100644 --- a/app/code/Magento/Reports/Helper/Data.php +++ b/app/code/Magento/Reports/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\Reports\Helper; use Magento\Data\Collection; use Magento\Stdlib\DateTime; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const REPORT_PERIOD_TYPE_DAY = 'day'; @@ -46,10 +46,10 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_itemFactory; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Reports\Model\ItemFactory $itemFactory */ - public function __construct(\Magento\App\Helper\Context $context, \Magento\Reports\Model\ItemFactory $itemFactory) + public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Reports\Model\ItemFactory $itemFactory) { parent::__construct($context); $this->_itemFactory = $itemFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php index bf6ab19ae18f34fc9d2aca791c14af4b93a45b8f..1813ac6a1a2a6f47614b564c5508b2c968dddb32 100644 --- a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php @@ -93,7 +93,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory @@ -111,7 +111,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, diff --git a/app/code/Magento/Reports/Model/Resource/Event.php b/app/code/Magento/Reports/Model/Resource/Event.php index 80a203c6c31dafe82d5765ba6086f002ae6032ab..ee433a36d4bde502104ecc054c5770e52bcab696 100644 --- a/app/code/Magento/Reports/Model/Resource/Event.php +++ b/app/code/Magento/Reports/Model/Resource/Event.php @@ -39,7 +39,7 @@ class Event extends \Magento\Model\Resource\Db\AbstractDb /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -49,13 +49,13 @@ class Event extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager ) { parent::__construct($resource); diff --git a/app/code/Magento/Reports/Model/Resource/Helper.php b/app/code/Magento/Reports/Model/Resource/Helper.php index 499c52e287940207aecc1f147d5aa18786a85e6c..d60b97da2b01f853916d9d9d9fa0eee312e2fa32 100644 --- a/app/code/Magento/Reports/Model/Resource/Helper.php +++ b/app/code/Magento/Reports/Model/Resource/Helper.php @@ -37,10 +37,10 @@ namespace Magento\Reports\Model\Resource; class Helper extends \Magento\DB\Helper implements \Magento\Reports\Model\Resource\HelperInterface { /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix = 'reports') + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix = 'reports') { parent::__construct($resource, $modulePrefix); } diff --git a/app/code/Magento/Reports/Model/Resource/Order/Collection.php b/app/code/Magento/Reports/Model/Resource/Order/Collection.php index 850473854f09f356795488e1196d94258cb94fe4..68a725d289188edb48c997e7dd4b8fbdfc2376ea 100644 --- a/app/code/Magento/Reports/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Order/Collection.php @@ -51,7 +51,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -81,7 +81,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\DB\Helper $coreResourceHelper - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Sales\Model\Order\Config $orderConfig @@ -97,7 +97,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\DB\Helper $coreResourceHelper, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Sales\Model\Order\Config $orderConfig, @@ -124,7 +124,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection /** * Check range for live mode * - * @param unknown_type $range + * @param string $range * @return $this */ public function checkIsLive($range) diff --git a/app/code/Magento/Reports/Model/Resource/Product/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Collection.php index 805016dedd9bd8295ce1ce2b925eb04509f70989..ac74391545c0e09c750823b5e0614d0cd7e8c9f6 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Collection.php @@ -82,14 +82,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -108,14 +108,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php index fd3aefaaa4f8e3035be686461306884629a8446d..2fc137cf2ab4c963e050c7a08d546cb9dd5376f3 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php @@ -41,12 +41,12 @@ abstract class AbstractIndex extends \Magento\Model\Resource\Db\AbstractDb protected $_resourceHelper; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Reports\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Reports\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime ) { diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php index ae0df570ce4c4634a835470fa79bd545d50e12dd..dcec5c7cfee9195b111fe6f96a8a7cc550c78697 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php @@ -54,14 +54,14 @@ abstract class AbstractCollection extends \Magento\Catalog\Model\Resource\Produc * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -78,14 +78,14 @@ abstract class AbstractCollection extends \Magento\Catalog\Model\Resource\Produc \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php index 9e199b5c63c532ae0c00bdb2d0304f2be8e07b22..39f43024666788cf8f71debeb728be26b3357783 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -68,14 +68,14 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -96,14 +96,14 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 0456aad26150d600cf8dfb0742b00153e18488f9..70b94bd764960c73f5f11ef35f65802b3e13db81 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -24,16 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Reports\Model\Resource\Report; /** * Abstract report aggregate resource model - * - * @category Magento - * @package Magento_Reports - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Reports\Model\Resource\Report; - abstract class AbstractReport extends \Magento\Model\Resource\Db\AbstractDb { /** @@ -59,7 +54,7 @@ abstract class AbstractReport extends \Magento\Model\Resource\Db\AbstractDb protected $_reportsFlagFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -67,7 +62,7 @@ abstract class AbstractReport extends \Magento\Model\Resource\Db\AbstractDb * @param \Magento\Stdlib\DateTime\Timezone\Validator $timezoneValidator */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -461,7 +456,7 @@ abstract class AbstractReport extends \Magento\Model\Resource\Db\AbstractDb $tr = $transitions[$i]; try { $this->timezoneValidator->validate($tr['ts'], $to); - } catch (\Exception $e) { + } catch (\Magento\Stdlib\DateTime\Timezone\ValidationException $e) { continue; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index 131a567eec21bf7fd5c00084ca24e5d2031bd9d2..842f029a480601c717b9eec15bf998609f00c4ce 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -62,7 +62,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport protected $_resourceHelper; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -72,7 +72,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport * @param \Magento\Reports\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, diff --git a/app/code/Magento/Reports/etc/adminhtml/routes.xml b/app/code/Magento/Reports/etc/adminhtml/routes.xml index a144b14c3036f3fc8dff73b44a79bde460454175..b1de433d31e58ba96cc3983f235c7fe3063b4b3e 100644 --- a/app/code/Magento/Reports/etc/adminhtml/routes.xml +++ b/app/code/Magento/Reports/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="reports" frontName="reports"> <module name="Magento_Reports_Adminhtml" before="Magento_Reports" /> diff --git a/app/code/Magento/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php b/app/code/Magento/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php index 3d793e1d2a1c5141af35f4f2c6a2a70db5bc3c3a..0df424b0bbcf34410251a53102e349419b2b35e9 100644 --- a/app/code/Magento/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php +++ b/app/code/Magento/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php @@ -217,7 +217,7 @@ $this->getConnection()->createTable($table); $installFile = __DIR__ . '/install-1.6.0.0.php'; /** @var \Magento\Filesystem\Directory\Read $modulesDirectory */ -$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); +$modulesDirectory = $this->getFilesystem()->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); if ($modulesDirectory->isExist($modulesDirectory->getRelativePath($installFile))) { include $installFile; } diff --git a/app/code/Magento/Reports/view/adminhtml/grid.phtml b/app/code/Magento/Reports/view/adminhtml/grid.phtml index b8327242939388d1424f259adb07205c7b7028e9..04ee450529dc07a3e743b70c89040e280ea68176 100644 --- a/app/code/Magento/Reports/view/adminhtml/grid.phtml +++ b/app/code/Magento/Reports/view/adminhtml/grid.phtml @@ -68,9 +68,9 @@ $numColumns = sizeof($this->getColumns()); </div> <div class="show-by"> - <label> - <?php echo __('Show By') ?>: - <select name="report_period" id="<?php echo $this->getSuffixId('report_period')?>"> + <label class="label"> + <span><?php echo __('Show By') ?>:</span> + <select name="report_period" id="<?php echo $this->getSuffixId('report_period')?>" class="select"> <?php foreach ($this->getPeriods() as $_value => $_label): ?> <option value="<?php echo $_value ?>" <?php if ($this->getFilter('report_period') == $_value): ?> selected<?php endif; ?>><?php echo $_label ?></option> <?php endforeach; ?> diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Grid.php index 29415b7ba615d89a806303624db340c92d25bb51..7a8d2ba41e26009fcc239075361040b42817712b 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid.php @@ -182,10 +182,10 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'review_id', array( 'header' => __('ID'), - 'align' => 'right', - 'width' => '50px', 'filter_index' => 'rt.review_id', - 'index' => 'review_id' + 'index' => 'review_id', + 'header_css_class' => 'col-id', + 'column_css_class' => 'col-id' ) ); @@ -193,11 +193,11 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'created_at', array( 'header' => __('Created'), - 'align' => 'left', 'type' => 'datetime', - 'width' => '100px', 'filter_index' => 'rt.created_at', - 'index' => 'review_created_at' + 'index' => 'review_created_at', + 'header_css_class' => 'col-date', + 'column_css_class' => 'col-date' ) ); @@ -206,10 +206,8 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'status', array( 'header' => __('Status'), - 'align' => 'left', 'type' => 'options', 'options' => $this->_reviewData->getReviewStatuses(), - 'width' => '100px', 'filter_index' => 'rt.status_id', 'index' => 'status_id' ) @@ -220,8 +218,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'title', array( 'header' => __('Title'), - 'align' => 'left', - 'width' => '100px', 'filter_index' => 'rdt.title', 'index' => 'title', 'type' => 'text', @@ -234,13 +230,13 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'nickname', array( 'header' => __('Nickname'), - 'align' => 'left', - 'width' => '100px', 'filter_index' => 'rdt.nickname', 'index' => 'nickname', 'type' => 'text', 'truncate' => 50, - 'escape' => true + 'escape' => true, + 'header_css_class' => 'col-name', + 'column_css_class' => 'col-name' ) ); @@ -248,7 +244,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'detail', array( 'header' => __('Review'), - 'align' => 'left', 'index' => 'detail', 'filter_index' => 'rdt.detail', 'type' => 'text', @@ -281,16 +276,14 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended $this->addColumn( 'name', - array('header' => __('Product'), 'align' => 'left', 'type' => 'text', 'index' => 'name', 'escape' => true) + array('header' => __('Product'), 'type' => 'text', 'index' => 'name', 'escape' => true) ); $this->addColumn( 'sku', array( 'header' => __('SKU'), - 'align' => 'right', 'type' => 'text', - 'width' => '50px', 'index' => 'sku', 'escape' => true ) @@ -300,7 +293,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'action', array( 'header' => __('Action'), - 'width' => '50px', 'type' => 'action', 'getter' => 'getReviewId', 'actions' => array( diff --git a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php index 34a5a4a5d4e6e85960d455c0fcc22b0c38beac08..59ca745af5c3bf5e9b530218a7a11266da2ebbd2 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php @@ -101,7 +101,15 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid */ protected function _prepareColumns() { - $this->addColumn('entity_id', array('header' => __('ID'), 'width' => '50px', 'index' => 'entity_id')); + $this->addColumn( + 'entity_id', + array( + 'header' => __('ID'), + 'index' => 'entity_id', + 'header_css_class' => 'col-id', + 'column_css_class' => 'col-id' + ) + ); $this->addColumn('name', array('header' => __('Name'), 'index' => 'name')); @@ -109,20 +117,19 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid $this->addColumn('custom_name', array('header' => __('Product Store Name'), 'index' => 'custom_name')); } - $this->addColumn('sku', array('header' => __('SKU'), 'width' => '80px', 'index' => 'sku')); + $this->addColumn('sku', array('header' => __('SKU'), 'index' => 'sku')); $this->addColumn('price', array('header' => __('Price'), 'type' => 'currency', 'index' => 'price')); $this->addColumn( 'qty', - array('header' => __('Quantity'), 'width' => '130px', 'type' => 'number', 'index' => 'qty') + array('header' => __('Quantity'), 'type' => 'number', 'index' => 'qty') ); $this->addColumn( 'status', array( 'header' => __('Status'), - 'width' => '90px', 'index' => 'status', 'type' => 'options', 'source' => 'Magento\Catalog\Model\Product\Attribute\Source\Status', @@ -138,7 +145,6 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid 'websites', array( 'header' => __('Websites'), - 'width' => '100px', 'sortable' => false, 'index' => 'websites', 'type' => 'options', diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php index 5b779c560f81d1bf3add05d5f5d4b6c0986a7ab5..b3f5279c40744e09966c900e4ee60ede3aa2ae4e 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php @@ -211,15 +211,12 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected function _getWarningHtml() { - return '<div> -<div class="messages"> - <div class="message notice"> + return ' + <div class="message info"> <div>' . __( 'Please specify a rating title for a store, or we\'ll just use the default value.' ) . '</div> - </div> -</div> -</div>'; + </div>'; } } diff --git a/app/code/Magento/Review/Block/Form.php b/app/code/Magento/Review/Block/Form.php index 061fdc8efb85d90e069dc363b3e4ef2233e36775..d0543d2d05ec5d3e7c5a64b98bdb881f00c76aba 100644 --- a/app/code/Magento/Review/Block/Form.php +++ b/app/code/Magento/Review/Block/Form.php @@ -87,7 +87,7 @@ class Form extends \Magento\View\Element\Template protected $messageManager; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -100,7 +100,7 @@ class Form extends \Magento\View\Element\Template * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Review\Model\RatingFactory $ratingFactory * @param \Magento\Message\ManagerInterface $messageManager - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -112,7 +112,7 @@ class Form extends \Magento\View\Element\Template \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Review\Model\RatingFactory $ratingFactory, \Magento\Message\ManagerInterface $messageManager, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_coreData = $coreData; diff --git a/app/code/Magento/Review/Controller/Customer.php b/app/code/Magento/Review/Controller/Customer.php index 95f6c450c9fa22807f6e1a4cebbd5697ef2a329e..add355df42cca21af598dec27ca5395e95e4d5b9 100644 --- a/app/code/Magento/Review/Controller/Customer.php +++ b/app/code/Magento/Review/Controller/Customer.php @@ -25,15 +25,15 @@ */ namespace Magento\Review\Controller; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; /** * Customer reviews controller * * @author Magento Core Team <core@magentocommerce.com> */ -class Customer extends \Magento\App\Action\Action +class Customer extends \Magento\Framework\App\Action\Action { /** * Customer session model @@ -43,10 +43,10 @@ class Customer extends \Magento\App\Action\Action protected $_customerSession; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Customer\Model\Session $customerSession */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession) { $this->_customerSession = $customerSession; parent::__construct($context); @@ -56,7 +56,7 @@ class Customer extends \Magento\App\Action\Action * Check customer authentication for some actions * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index dc7ef93a5d128ea937674f83f3af44b1da03c23b..726252bc093298bc98cac50c39457b05340a05e8 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -25,7 +25,7 @@ */ namespace Magento\Review\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Catalog\Model\Product as CatalogProduct; use Magento\Review\Model\Review; @@ -34,7 +34,7 @@ use Magento\Review\Model\Review; * * @author Magento Core Team <core@magentocommerce.com> */ -class Product extends \Magento\App\Action\Action +class Product extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -114,7 +114,7 @@ class Product extends \Magento\App\Action\Action protected $_formKeyValidator; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory @@ -128,7 +128,7 @@ class Product extends \Magento\App\Action\Action * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\CategoryFactory $categoryFactory, @@ -160,7 +160,7 @@ class Product extends \Magento\App\Action\Action * Dispatch request * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Review/Helper/Action/Pager.php b/app/code/Magento/Review/Helper/Action/Pager.php index 6509a1e97616e105f5008806fcf49f3a47594a98..ffb12c6f839b694a5977256a53709fe437e0e331 100644 --- a/app/code/Magento/Review/Helper/Action/Pager.php +++ b/app/code/Magento/Review/Helper/Action/Pager.php @@ -32,7 +32,7 @@ use Magento\Model\Exception; * * @author Magento Core Team <core@magentocommerce.com> */ -class Pager extends \Magento\App\Helper\AbstractHelper +class Pager extends \Magento\Framework\App\Helper\AbstractHelper { const STORAGE_PREFIX = 'search_result_ids'; @@ -58,10 +58,10 @@ class Pager extends \Magento\App\Helper\AbstractHelper protected $_backendSession; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Backend\Model\Session $backendSession */ - public function __construct(\Magento\App\Helper\Context $context, \Magento\Backend\Model\Session $backendSession) + public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Backend\Model\Session $backendSession) { $this->_backendSession = $backendSession; parent::__construct($context); diff --git a/app/code/Magento/Review/Helper/Data.php b/app/code/Magento/Review/Helper/Data.php index 47d429d97e0a62af23400b8a00f7f9808c2191da..d74b90ad3764b57a2b55834d755091da19da8690 100644 --- a/app/code/Magento/Review/Helper/Data.php +++ b/app/code/Magento/Review/Helper/Data.php @@ -28,7 +28,7 @@ namespace Magento\Review\Helper; /** * Default review helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_REVIEW_GUETS_ALLOW = 'catalog/review/allow_guest'; @@ -42,7 +42,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -54,14 +54,14 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filter */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filter ) { diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index 9e9ffeb059501843f8e7b2a85e2f251c7cb9938e..259821f684ea4587fae77dae55336e0b6b74fd7a 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -56,14 +56,14 @@ class Rating extends \Magento\Model\Resource\Db\AbstractDb protected $_logger; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Review\Helper\Data $ratingData * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\Resource\Review\Summary $reviewSummary */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Review\Helper\Data $ratingData, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option.php b/app/code/Magento/Review/Model/Resource/Rating/Option.php index 0204805e06bbe78ca2ed03f9a37720e6d45f1b96..2c7768e6f662e0b68fe7282c372fd287d6adef57 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option.php @@ -101,13 +101,13 @@ class Option extends \Magento\Model\Resource\Db\AbstractDb protected $_ratingOptionVoteF; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Customer\Model\Session $customerSession, \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF, \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index 33b59ca487617fbcc49b19cf79266072e7f54092..dc8c1f2ccaa3079e4fe0f191f4547ddc610b540a 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -114,14 +114,14 @@ class Review extends \Magento\Model\Resource\Db\AbstractDb protected $_ratingOptions; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory * @param \Magento\Review\Model\Resource\Rating\Option $ratingOptions */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, diff --git a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php index 62f409e5d2cb05031efedd0ddf04d9000ca2855b..4045ec1d058d2bba9d92e6067367258941e8dc8f 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php @@ -82,14 +82,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate @@ -107,14 +107,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php index 8efc522d2ea12375f2a9fe06e86559139bc59361..3f603b942e2b3bb7b474fcdbd99471571dc85647 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php @@ -43,13 +43,13 @@ class Collection extends \Magento\Data\Collection\Db * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_setIdFieldName('primary_id'); diff --git a/app/code/Magento/Review/etc/adminhtml/routes.xml b/app/code/Magento/Review/etc/adminhtml/routes.xml index 859cc6b8208e11043d1541ee73f0366823af8448..23384e724c20a58309a14184dcb4d6a72c135d70 100644 --- a/app/code/Magento/Review/etc/adminhtml/routes.xml +++ b/app/code/Magento/Review/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="review" frontName="review"> <module name="Magento_Review" /> diff --git a/app/code/Magento/Review/etc/frontend/routes.xml b/app/code/Magento/Review/etc/frontend/routes.xml index ac71d7cb95b564874d6ab894b83ebdc604551d52..08db32ae7dbd2bd23402e6e2ba471036ea2b4da4 100644 --- a/app/code/Magento/Review/etc/frontend/routes.xml +++ b/app/code/Magento/Review/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="review" frontName="review"> <module name="Magento_Review" /> diff --git a/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml b/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml index 27fb8b56201de291fa59d6429b2d76cb0b92f964..56d58a88d329628774420701429cccaa0a2ddba1 100644 --- a/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml +++ b/app/code/Magento/Review/view/adminhtml/layout/rating_block.xml @@ -45,9 +45,9 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="rating_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="align" xsi:type="string">right</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="index" xsi:type="string">rating_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="rating_code"> @@ -59,15 +59,12 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="position"> <arguments> <argument name="header" xsi:type="string" translate="true">Sort Order</argument> - <argument name="align" xsi:type="string">left</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="index" xsi:type="string">position</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="is_active"> <arguments> <argument name="header" xsi:type="string" translate="true">Is Active</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">is_active</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="array"> diff --git a/app/code/Magento/Review/view/frontend/form.phtml b/app/code/Magento/Review/view/frontend/form.phtml index b1e079b9b8568f5bab7ce215e9de56835d8c0562..1ba33b81bfe29b1ac412a6d9ec5618a13e259dfe 100644 --- a/app/code/Magento/Review/view/frontend/form.phtml +++ b/app/code/Magento/Review/view/frontend/form.phtml @@ -88,8 +88,10 @@ </div> </div> </fieldset> - <div class="actions form"> - <button type="submit" class="action submit"><span><?php echo __('Submit Review') ?></span></button> + <div class="actions toolbar"> + <div class="primary"> + <button type="submit" class="action submit"><span><?php echo __('Submit Review') ?></span></button> + </div> <!-- <button type="button" class="action cancel"><span><?php echo __('Cancel') ?></span></button> --> </div> </form> diff --git a/app/code/Magento/Rss/App/Action/Plugin/Authentication.php b/app/code/Magento/Rss/App/Action/Plugin/Authentication.php index 8e9a0a1dff6d644de4cd90525865408b164dc244..27615c12105e81c6a00cc72e64b24273b7e7a75f 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/Authentication.php @@ -25,8 +25,8 @@ */ namespace Magento\Rss\App\Action\Plugin; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Backend\App\AbstractAction; class Authentication extends \Magento\Backend\App\Action\Plugin\Authentication @@ -59,7 +59,7 @@ class Authentication extends \Magento\Backend\App\Action\Plugin\Authentication * @param \Magento\Backend\Model\Auth $auth * @param \Magento\Backend\Model\UrlInterface $url * @param ResponseInterface $response - * @param \Magento\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\HTTP\Authentication $httpAuthentication * @param \Magento\Logger $logger @@ -69,7 +69,7 @@ class Authentication extends \Magento\Backend\App\Action\Plugin\Authentication \Magento\Backend\Model\Auth $auth, \Magento\Backend\Model\UrlInterface $url, ResponseInterface $response, - \Magento\App\ActionFlag $actionFlag, + \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Message\ManagerInterface $messageManager, \Magento\HTTP\Authentication $httpAuthentication, \Magento\Logger $logger, diff --git a/app/code/Magento/Rss/Block/AbstractBlock.php b/app/code/Magento/Rss/Block/AbstractBlock.php index a2e67552bb27ca49238b23d3be9278cae21d9790..659dd4281c6a037180f4eae547b31f5e044c9c9c 100644 --- a/app/code/Magento/Rss/Block/AbstractBlock.php +++ b/app/code/Magento/Rss/Block/AbstractBlock.php @@ -28,18 +28,18 @@ namespace Magento\Rss\Block; class AbstractBlock extends \Magento\View\Element\Template { /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->httpContext = $httpContext; diff --git a/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php b/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php index 240210e010398bd4fe3753fa417df0cc7058895a..1851fc79df7b4194bd0cfe2610072c88cb366c8a 100644 --- a/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php +++ b/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php @@ -60,13 +60,13 @@ class AbstractCatalog extends \Magento\Rss\Block\AbstractBlock /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { @@ -80,6 +80,8 @@ class AbstractCatalog extends \Magento\Rss\Block\AbstractBlock * * @param string $type Catalog Product type * @return \Magento\View\Element\Template + * @throws \RuntimeException + * @deprecated */ protected function _getPriceBlock($type) { @@ -112,6 +114,7 @@ class AbstractCatalog extends \Magento\Rss\Block\AbstractBlock * @param bool $displayMinimalPrice Display "As low as" etc. * @param string $idSuffix Suffix for HTML containers * @return string + * @deprecated see renderPriceHtml */ public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '') { @@ -132,4 +135,32 @@ class AbstractCatalog extends \Magento\Rss\Block\AbstractBlock $this->_useLinkForAsLowAs )->toHtml(); } + + /** + * Get rendered price html + * + * @param \Magento\Catalog\Model\Product $product + * @param bool $displayMinimalPrice + * @return string + */ + public function renderPriceHtml(\Magento\Catalog\Model\Product $product, $displayMinimalPrice = false) + { + /** @var \Magento\Pricing\Render $priceRender */ + $priceRender = $this->getLayout()->getBlock('product.price.render.default'); + + $price = ''; + if ($priceRender) { + $price = $priceRender->render( + \Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL, + $product, + [ + 'display_minimal_price' => $displayMinimalPrice, + 'use_link_for_as_low_as' => $this->_useLinkForAsLowAs, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_LIST + ] + ); + } + + return $price; + } } diff --git a/app/code/Magento/Rss/Block/Catalog/Category.php b/app/code/Magento/Rss/Block/Catalog/Category.php index 0e25f857a52d5506857bdd81f5da9b7bdcd3ae21..a4a22e441e172f4c89b987fe728e43f7fbc39cf3 100644 --- a/app/code/Magento/Rss/Block/Catalog/Category.php +++ b/app/code/Magento/Rss/Block/Catalog/Category.php @@ -67,7 +67,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Layer\Category $catalogLayer * @param \Magento\Catalog\Model\Product\Visibility $visibility @@ -80,7 +80,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Layer\Category $catalogLayer, \Magento\Catalog\Model\Product\Visibility $visibility, @@ -224,6 +224,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog if ($product->getAllowedPriceInRss()) { $description .= $this->getPriceHtml($product, true); + $description .= 'NEWPRICETEST: ' . $this->renderPriceHtml($product, true) . ' ENDNEWPRICETEST'; } $description .= '</td></tr></table>'; diff --git a/app/code/Magento/Rss/Block/Catalog/NewCatalog.php b/app/code/Magento/Rss/Block/Catalog/NewCatalog.php index f42447812049d9ff0aa74d2851241f80e015f7d5..a11b2c3f1251353ddfe47fea0fec49b8718eb75c 100644 --- a/app/code/Magento/Rss/Block/Catalog/NewCatalog.php +++ b/app/code/Magento/Rss/Block/Catalog/NewCatalog.php @@ -57,7 +57,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Rss\Model\RssFactory $rssFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -68,7 +68,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Data $catalogData, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -225,6 +225,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog if ($allowedPriceInRss) { $description .= $this->getPriceHtml($product, true); + $description .= 'NEWPRICETEST: ' . $this->renderPriceHtml($product, true) . ' ENDNEWPRICETEST'; } $description .= '</td>' . '</tr></table>'; diff --git a/app/code/Magento/Rss/Block/Catalog/Salesrule.php b/app/code/Magento/Rss/Block/Catalog/Salesrule.php index 6475dd7ad5639ccd9d7b6e56d3189fd912cb73cb..2fec3a4e5574b7e4ace84996df3ce3406e00c5f0 100644 --- a/app/code/Magento/Rss/Block/Catalog/Salesrule.php +++ b/app/code/Magento/Rss/Block/Catalog/Salesrule.php @@ -42,14 +42,14 @@ class Salesrule extends \Magento\Rss\Block\AbstractBlock /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Rss\Model\RssFactory $rssFactory * @param \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory, array $data = array() diff --git a/app/code/Magento/Rss/Block/Catalog/Special.php b/app/code/Magento/Rss/Block/Catalog/Special.php index f98103a4ed8f72b97fbb87630377365f8b56994a..8248666bb31f27720e34731cffbbc34aa3a733d1 100644 --- a/app/code/Magento/Rss/Block/Catalog/Special.php +++ b/app/code/Magento/Rss/Block/Catalog/Special.php @@ -69,7 +69,7 @@ class Special extends \Magento\Rss\Block\Catalog\AbstractCatalog /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -81,7 +81,7 @@ class Special extends \Magento\Rss\Block\Catalog\AbstractCatalog */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\ProductFactory $productFactory, diff --git a/app/code/Magento/Rss/Block/ListBlock.php b/app/code/Magento/Rss/Block/ListBlock.php index c9ee80b7a1ccb0f31799d0bd238539dbd7c776aa..d0850d0e18d8989f728e6d509e8f37933cb83631 100644 --- a/app/code/Magento/Rss/Block/ListBlock.php +++ b/app/code/Magento/Rss/Block/ListBlock.php @@ -38,7 +38,7 @@ class ListBlock extends \Magento\View\Element\Template protected $_rssFeeds = array(); /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -49,13 +49,13 @@ class ListBlock extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array() ) { diff --git a/app/code/Magento/Rss/Block/Wishlist.php b/app/code/Magento/Rss/Block/Wishlist.php index 7e90e9260636b900b1c9e518e7244bedd611e4ca..68d28ed139ab31961922adb45e2508e225483cd2 100644 --- a/app/code/Magento/Rss/Block/Wishlist.php +++ b/app/code/Magento/Rss/Block/Wishlist.php @@ -63,7 +63,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock /** * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory @@ -74,7 +74,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock */ public function __construct( \Magento\Catalog\Block\Product\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Helper\Data $coreData, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, diff --git a/app/code/Magento/Rss/Controller/Catalog.php b/app/code/Magento/Rss/Controller/Catalog.php index d08d71d8ccf6c993cb967026f3d32e03f11eb0a3..4c80fc9ddabddaa0b33803f79b2567d04b003001 100644 --- a/app/code/Magento/Rss/Controller/Catalog.php +++ b/app/code/Magento/Rss/Controller/Catalog.php @@ -28,20 +28,20 @@ namespace Magento\Rss\Controller; /** * RSS Controller for Catalog feeds */ -class Catalog extends \Magento\App\Action\Action +class Catalog extends \Magento\Framework\App\Action\Action { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Action\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Action\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Action\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Action\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/Rss/Controller/Index.php b/app/code/Magento/Rss/Controller/Index.php index f72f9517cc8aefff860bad96d6f45acfc3884d2c..4f1297b5fa066eba4ec580e8cdce25932a01af45 100644 --- a/app/code/Magento/Rss/Controller/Index.php +++ b/app/code/Magento/Rss/Controller/Index.php @@ -25,12 +25,12 @@ */ namespace Magento\Rss\Controller; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; -class Index extends \Magento\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -45,14 +45,14 @@ class Index extends \Magento\App\Action\Action protected $_customerSession; /** - * @param \Magento\App\Action\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Action\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Rss\Helper\WishlistRss $wishlistHelper * @param \Magento\Customer\Model\Session $customerSession */ public function __construct( - \Magento\App\Action\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Action\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Rss\Helper\WishlistRss $wishlistHelper, \Magento\Customer\Model\Session $customerSession ) { diff --git a/app/code/Magento/Rss/Controller/Order.php b/app/code/Magento/Rss/Controller/Order.php index 1d4f7bfc0e9e024f4f64d0affd1f91f1ee23df13..46602b25f828868c360316088204e95ce08c6392 100644 --- a/app/code/Magento/Rss/Controller/Order.php +++ b/app/code/Magento/Rss/Controller/Order.php @@ -28,7 +28,7 @@ namespace Magento\Rss\Controller; /** * RSS Controller for Order feed */ -class Order extends \Magento\App\Action\Action +class Order extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -38,10 +38,10 @@ class Order extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Registry $coreRegistry) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Rss/Helper/Order.php b/app/code/Magento/Rss/Helper/Order.php index e0933a25d40229025899796daebb0a2e0902559f..5c2f2f472fbb0a011224422e50a0a181edf8e61f 100644 --- a/app/code/Magento/Rss/Helper/Order.php +++ b/app/code/Magento/Rss/Helper/Order.php @@ -30,10 +30,10 @@ namespace Magento\Rss\Helper; * * @author Magento Core Team <core@magentocommerce.com> */ -class Order extends \Magento\App\Helper\AbstractHelper +class Order extends \Magento\Framework\App\Helper\AbstractHelper { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -43,13 +43,13 @@ class Order extends \Magento\App\Helper\AbstractHelper protected $_orderFactory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\OrderFactory $orderFactory ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Rss/Helper/WishlistRss.php b/app/code/Magento/Rss/Helper/WishlistRss.php index 414ab732519ebe2084c6b95f2461ac22441497bd..43766a99d657cf188507ca0c0cc1fa990c5ff7ec 100644 --- a/app/code/Magento/Rss/Helper/WishlistRss.php +++ b/app/code/Magento/Rss/Helper/WishlistRss.php @@ -37,10 +37,10 @@ class WishlistRss extends \Magento\Wishlist\Helper\Data protected $_customerBuilder; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -49,10 +49,10 @@ class WishlistRss extends \Magento\Wishlist\Helper\Data * @param \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Rss/Model/Resource/Order.php b/app/code/Magento/Rss/Model/Resource/Order.php index 8d4bdf907fd9f78974a2d3b7437335c41f9d17a8..2a2359f9209e6ae0111682845b55c36ffd056c56 100644 --- a/app/code/Magento/Rss/Model/Resource/Order.php +++ b/app/code/Magento/Rss/Model/Resource/Order.php @@ -35,14 +35,14 @@ namespace Magento\Rss\Model\Resource; class Order { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->_resource = $resource; } @@ -55,7 +55,7 @@ class Order */ public function getAllCommentCollection($orderId) { - /** @var $res \Magento\App\Resource */ + /** @var $res \Magento\Framework\App\Resource */ $res = $this->_resource; $read = $res->getConnection('core_read'); diff --git a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php index 48591e2ccfbefdcdfba51335efff0d5d607d4346..f584705625105eede5e5301adb9eaaaf632d6e29 100644 --- a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php @@ -29,18 +29,18 @@ namespace Magento\Rss\Model\System\Config\Backend; * Cache cleaner backend model * */ -class Links extends \Magento\App\Config\Value +class Links extends \Magento\Framework\App\Config\Value { /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -48,8 +48,8 @@ class Links extends \Magento\App\Config\Value public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Rss/etc/adminhtml/routes.xml b/app/code/Magento/Rss/etc/adminhtml/routes.xml index 4cc109712273ab50f2684ea9a1fb7205aec48567..63bd37f02c08a5d7fe578865410a0d6d515f53e9 100644 --- a/app/code/Magento/Rss/etc/adminhtml/routes.xml +++ b/app/code/Magento/Rss/etc/adminhtml/routes.xml @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="rss" frontName="rss"> <module name="Magento_Rss_Adminhtml" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Rss/etc/frontend/routes.xml b/app/code/Magento/Rss/etc/frontend/routes.xml index c5fb282ea4ec5c3e81f4fe00b3eb86e821f0f3c8..353f2d4e6b291e83b58cb653a6bf90c9be908966 100644 --- a/app/code/Magento/Rss/etc/frontend/routes.xml +++ b/app/code/Magento/Rss/etc/frontend/routes.xml @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="rss" frontName="rss"> <module name="Magento_Rss" /> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml index 81ae6b8c10184448520eab62408210d213136552..b40835e4625a629c34db4ec2734b8448ca511f56 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml @@ -28,4 +28,10 @@ <block class="Magento\Rss\Block\Catalog\Category" output="1" name="rss.catalog.category" cacheable="false"> <block class="Magento\View\Element\RendererList" name="catalog.product.rss.feed.renderer.list" as="renderer.list" /> </block> + <block class="Magento\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </layout> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml index 9cd69be3f21ff801e4e75eac514be6224d4cb839..d0d3ced5f48838660a1fcfc1414d0249be880643 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml @@ -28,4 +28,10 @@ <block class="Magento\Rss\Block\Catalog\NewCatalog" output="1" name="rss.catalog.new" cacheable="false"> <block class="Magento\View\Element\RendererList" name="catalog.product.rss.feed.renderer.list" as="renderer.list" /> </block> + <block class="Magento\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </layout> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml index d5b4787b93a83f8aefca161c129baa7921712032..dd2510c21abb7b8e1d781fd954c8895219c30978 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_special.xml @@ -25,4 +25,10 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <block class="Magento\Rss\Block\Catalog\Special" output="1" name="rss.catalog.special" cacheable="false"/> + <block class="Magento\Pricing\Render" name="product.price.render.default"> + <arguments> + <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> + <!-- set "override" configuration settings here --> + </arguments> + </block> </layout> diff --git a/app/code/Magento/Rule/Helper/Data.php b/app/code/Magento/Rule/Helper/Data.php index 3c954390f31862b3787ffc59bc0b8e70ddd1ab02..ec3e050186b6f14cd5488c5ab5a38ac7881ad40e 100644 --- a/app/code/Magento/Rule/Helper/Data.php +++ b/app/code/Magento/Rule/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Rule\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php deleted file mode 100644 index da374636b9a8de3da288f65a9e6a2b52dd0a0db7..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php +++ /dev/null @@ -1,244 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Sales - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Sales\Block\Adminhtml\Creditmemo; - -/** - * Adminhtml sales orders grid - * - * @author Magento Core Team <core@magentocommerce.com> - */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended -{ - /** - * @var \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @var \Magento\Sales\Model\Order\CreditmemoFactory - */ - protected $_creditmemoFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory - * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory, - \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { - $this->_creditmemoFactory = $creditmemoFactory; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('sales_creditmemo_grid'); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - } - - /** - * Prepare collection - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Prepare columns - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Credit Memo'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-memo-number', - 'column_css_class' => 'col-memo-number' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Created'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'order_increment_id', - array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - ) - ); - - $this->addColumn( - 'order_created_at', - array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'billing_name', - array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ) - ); - - $this->addColumn( - 'state', - array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_creditmemoFactory->create()->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - ) - ); - - $this->addColumn( - 'grand_total', - array( - 'header' => __('Refunded'), - 'index' => 'grand_total', - 'type' => 'currency', - 'currency' => 'order_currency_code', - 'header_css_class' => 'col-refunded', - 'column_css_class' => 'col-refunded' - ) - ); - - $this->addColumn( - 'action', - array( - 'header' => __('Action'), - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base' => 'sales/creditmemo/view'), - 'field' => 'creditmemo_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - ) - ); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - /** - * Prepare mass action - * - * @return $this - */ - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('creditmemo_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem( - 'pdfcreditmemos_order', - array('label' => __('PDF Credit Memos'), 'url' => $this->getUrl('sales/creditmemo/pdfcreditmemos')) - ); - - return $this; - } - - /** - * Get row url - * - * @param \Magento\Object $row - * @return false|string - */ - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/creditmemo/view', array('creditmemo_id' => $row->getId())); - } - - /** - * Get grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/*', array('_current' => true)); - } -} diff --git a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php deleted file mode 100644 index 68f5931216e55f275806e814b69d3618c62f61b5..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Sales - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Sales\Block\Adminhtml\Invoice; - -/** - * Adminhtml sales orders grid - * - * @author Magento Core Team <core@magentocommerce.com> - */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended -{ - /** - * @var \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @var \Magento\Sales\Model\Order\InvoiceFactory - */ - protected $_invoiceFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory - * @param \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory, - \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { - $this->_invoiceFactory = $invoiceFactory; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('sales_invoice_grid'); - $this->setUseAjax(true); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection'; - } - - /** - * Prepare collection - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Prepare columns - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Invoice'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-invoice-number', - 'column_css_class' => 'col-invoice-number' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Invoice Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'order_increment_id', - array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - ) - ); - - $this->addColumn( - 'order_created_at', - array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'billing_name', - array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ) - ); - - $this->addColumn( - 'state', - array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_invoiceFactory->create()->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - ) - ); - - $this->addColumn( - 'grand_total', - array( - 'header' => __('Amount'), - 'index' => 'grand_total', - 'type' => 'currency', - 'align' => 'right', - 'currency' => 'order_currency_code', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - ) - ); - - $this->addColumn( - 'action', - array( - 'header' => __('Action'), - 'width' => '50px', - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base' => 'sales/invoice/view'), - 'field' => 'invoice_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - ) - ); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - /** - * Prepare mass action - * - * @return $this - */ - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('invoice_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem( - 'pdfinvoices_order', - array('label' => __('PDF Invoices'), 'url' => $this->getUrl('sales/invoice/pdfinvoices')) - ); - - return $this; - } - - /** - * Get row url - * - * @param \Magento\Object $row - * @return false|string - */ - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/invoice/view', array('invoice_id' => $row->getId())); - } - - /** - * Get grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/grid', array('_current' => true)); - } -} diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php index 78a5763200fc3e28ca9261cbcfac522f5b0d06b7..f7ebb51e2ad86b3c71bad1331767019e73edd964 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php @@ -68,12 +68,24 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_messageHelper; + /** + * @var \Magento\Customer\Service\V1\CustomerAccountServiceInterface + */ + protected $_customerService; + + /** + * @var \Magento\Customer\Helper\View + */ + protected $_customerViewHelper; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Session\Quote $sessionQuote * @param \Magento\GiftMessage\Helper\Message $messageHelper + * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerService + * @param \Magento\Customer\Helper\View $customerViewHelper * @param array $data */ public function __construct( @@ -82,10 +94,14 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Session\Quote $sessionQuote, \Magento\GiftMessage\Helper\Message $messageHelper, + \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerService, + \Magento\Customer\Helper\View $customerViewHelper, array $data = array() ) { $this->_messageHelper = $messageHelper; $this->_sessionQuote = $sessionQuote; + $this->_customerService = $customerService; + $this->_customerViewHelper = $customerViewHelper; parent::__construct($context, $registry, $formFactory, $data); } @@ -130,8 +146,9 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic return ''; } - if ($this->_getSession()->getCustomer()->getId()) { - return $this->_getSession()->getCustomer()->getName(); + if ($this->_getSession()->hasCustomerId()) { + $customerData = $this->_customerService->getCustomer($this->_getSession()->getCustomerId()); + return $this->_customerViewHelper->getCustomerName($customerData); } $object = $this->getEntity(); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php index 042d85320bc9ce474c544df810e461477a675ae5..5f56f2b98c08f056ca5ffbf10dfbec81971a46b4 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php @@ -189,7 +189,13 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { $this->addColumn( 'entity_id', - array('header' => __('ID'), 'sortable' => true, 'width' => '60', 'index' => 'entity_id') + array( + 'header' => __('ID'), + 'sortable' => true, + 'header_css_class' => 'col-id', + 'column_css_class' => 'col-id', + 'index' => 'entity_id' + ) ); $this->addColumn( 'name', @@ -199,13 +205,12 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'index' => 'name' ) ); - $this->addColumn('sku', array('header' => __('SKU'), 'width' => '80', 'index' => 'sku')); + $this->addColumn('sku', array('header' => __('SKU'), 'index' => 'sku')); $this->addColumn( 'price', array( 'header' => __('Price'), 'column_css_class' => 'price', - 'align' => 'center', 'type' => 'currency', 'currency_code' => $this->getStore()->getCurrentCurrencyCode(), 'rate' => $this->getStore()->getBaseCurrency()->getRate($this->getStore()->getCurrentCurrencyCode()), @@ -218,7 +223,6 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'in_products', array( 'header' => __('Select'), - 'header_css_class' => 'a-center', 'type' => 'checkbox', 'name' => 'in_products', 'values' => $this->_getSelectedProducts(), @@ -237,11 +241,9 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended 'renderer' => 'Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\Renderer\Qty', 'name' => 'qty', 'inline_css' => 'qty', - 'align' => 'center', 'type' => 'input', 'validate_class' => 'validate-number', - 'index' => 'qty', - 'width' => '1' + 'index' => 'qty' ) ); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php index e5cbca35b706b370102fdda36d02db829c1d8fe3..9f971b684781403991fda845ee394fce6e91ee05 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php @@ -101,7 +101,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems 'Magento\Backend\Block\Widget\Button', array( 'label' => __('Refund Offline'), - 'class' => 'save submit-button', + 'class' => 'save submit-button primary', 'onclick' => 'disableElements(\'submit-button\');submitCreditMemoOffline()' ) ); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php index fc16280fc3e1783c4ba0d8ba21a3fb78bc9c9c84..6eee521714e25bdf58615c6fdcbacc2bd048a955 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php @@ -97,7 +97,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems 'Magento\Backend\Block\Widget\Button', array( 'label' => $_submitLabel, - 'class' => 'save submit-button' . $_submitButtonClass, + 'class' => 'save submit-button primary' . $_submitButtonClass, 'onclick' => 'disableElements(\'submit-button\');$(\'edit_form\').submit()', 'disabled' => $this->_disableSubmitButton ) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php index 3d536b2334d605b58b5fb911695a7210a35b3eca..33e0f5abdcd9094c23e42ce8aab796b6b9ff144b 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php @@ -32,209 +32,9 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; * @package Magento_Sales * @author Magento Core Team <core@magentocommerce.com> */ -class Creditmemos extends \Magento\Backend\Block\Widget\Grid\Extended implements +class Creditmemos extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** - * Core registry - * - * @var \Magento\Registry - */ - protected $_coreRegistry = null; - - /** - * @var \Magento\Sales\Model\Order\Creditmemo - */ - protected $_orderCreditmemo; - - /** - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo - * @param \Magento\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo, - \Magento\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_orderCreditmemo = $orderCreditmemo; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('order_creditmemos'); - $this->setUseAjax(true); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection'; - } - - /** - * Apply sorting and filtering to collection - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create( - $this->_getCollectionClass() - )->addFieldToSelect( - 'entity_id' - )->addFieldToSelect( - 'created_at' - )->addFieldToSelect( - 'increment_id' - )->addFieldToSelect( - 'order_currency_code' - )->addFieldToSelect( - 'store_currency_code' - )->addFieldToSelect( - 'base_currency_code' - )->addFieldToSelect( - 'state' - )->addFieldToSelect( - 'grand_total' - )->addFieldToSelect( - 'base_grand_total' - )->addFieldToSelect( - 'billing_name' - )->setOrderFilter( - $this->getOrder() - ); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Initialize grid columns - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Credit Memo'), - 'index' => 'increment_id', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - ) - ); - - $this->addColumn( - 'billing_name', - array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Created'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'state', - array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_orderCreditmemo->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - ) - ); - - $this->addColumn( - 'base_grand_total', - array( - 'header' => __('Refunded'), - 'index' => 'base_grand_total', - 'type' => 'currency', - 'currency' => 'base_currency_code', - 'header_css_class' => 'col-refunded', - 'column_css_class' => 'col-refunded' - ) - ); - - return parent::_prepareColumns(); - } - - /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order - */ - public function getOrder() - { - return $this->_coreRegistry->registry('current_order'); - } - - /** - * Row URL getter - * - * @param \Magento\Object $row - * @return string - */ - public function getRowUrl($row) - { - return $this->getUrl( - '*/order_creditmemo/view', - array('creditmemo_id' => $row->getId(), 'order_id' => $row->getOrderId()) - ); - } - - /** - * Grid URL getter - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/creditmemos', array('_current' => true)); - } - - /** - * ######################## TAB settings ################################# - */ - /** * {@inheritdoc} */ diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php index 23f2f654ed352366f4860f833c03a56868fbbff4..5bd3b760f2fad4b145b1b47d94ad90a2052733a4 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php @@ -32,215 +32,9 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; * @package Magento_Sales * @author Magento Core Team <core@magentocommerce.com> */ -class Invoices extends \Magento\Backend\Block\Widget\Grid\Extended implements +class Invoices extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** - * Core registry - * - * @var \Magento\Registry - */ - protected $_coreRegistry = null; - - /** - * Order invoice - * - * @var \Magento\Sales\Model\Order\Invoice - */ - protected $_orderInvoice; - - /** - * Collection factory - * - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Invoice $orderInvoice - * @param \Magento\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Invoice $orderInvoice, - \Magento\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_orderInvoice = $orderInvoice; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('order_invoices'); - $this->setUseAjax(true); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection'; - } - - /** - * Apply sorting and filtering to collection - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create( - $this->_getCollectionClass() - )->addFieldToSelect( - 'entity_id' - )->addFieldToSelect( - 'created_at' - )->addFieldToSelect( - 'order_id' - )->addFieldToSelect( - 'increment_id' - )->addFieldToSelect( - 'state' - )->addFieldToSelect( - 'grand_total' - )->addFieldToSelect( - 'base_grand_total' - )->addFieldToSelect( - 'store_currency_code' - )->addFieldToSelect( - 'base_currency_code' - )->addFieldToSelect( - 'order_currency_code' - )->addFieldToSelect( - 'billing_name' - )->setOrderFilter( - $this->getOrder() - ); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Initialize grid columns - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Invoice'), - 'index' => 'increment_id', - 'header_css_class' => 'col-invoice-number', - 'column_css_class' => 'col-invoice-number' - ) - ); - - $this->addColumn( - 'billing_name', - array( - 'header' => __('Bill-to Name'), - 'index' => 'billing_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Invoice Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'state', - array( - 'header' => __('Status'), - 'index' => 'state', - 'type' => 'options', - 'options' => $this->_orderInvoice->getStates(), - 'header_css_class' => 'col-status', - 'column_css_class' => 'col-status' - ) - ); - - $this->addColumn( - 'base_grand_total', - array( - 'header' => __('Amount'), - 'index' => 'base_grand_total', - 'type' => 'currency', - 'currency' => 'base_currency_code', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - ) - ); - - return parent::_prepareColumns(); - } - - /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order - */ - public function getOrder() - { - return $this->_coreRegistry->registry('current_order'); - } - - /** - * Row URL getter - * - * @param \Magento\Object $row - * @return string - */ - public function getRowUrl($row) - { - return $this->getUrl( - 'sales/order_invoice/view', - array('invoice_id' => $row->getId(), 'order_id' => $row->getOrderId()) - ); - } - - /** - * Grid URL getter - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/invoices', array('_current' => true)); - } - - /** - * ######################## TAB settings ################################# - */ - /** * {@inheritdoc} */ diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php index e5e4f8132b329d6a227b4979763c133909389577..e70fc5cc6dff29b51d0a6146df1ef9dfd5878295 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php @@ -28,7 +28,7 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; /** * Order Shipments grid */ -class Shipments extends \Magento\Backend\Block\Widget\Grid\Extended implements +class Shipments extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** @@ -41,127 +41,17 @@ class Shipments extends \Magento\Backend\Block\Widget\Grid\Extended implements /** * Collection factory * - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param \Magento\View\Element\Context $context * @param \Magento\Registry $coreRegistry * @param array $data */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + \Magento\View\Element\Context $context, \Magento\Registry $coreRegistry, array $data = array() ) { - $this->_coreRegistry = $coreRegistry; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Constructor - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('order_shipments'); - $this->setUseAjax(true); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection'; - } - - /** - * Apply sorting and filtering to collection - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create( - $this->_getCollectionClass() - )->addFieldToSelect( - 'entity_id' - )->addFieldToSelect( - 'created_at' - )->addFieldToSelect( - 'increment_id' - )->addFieldToSelect( - 'total_qty' - )->addFieldToSelect( - 'shipping_name' - )->setOrderFilter( - $this->getOrder() - ); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Initialize grid columns - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Shipment'), - 'index' => 'increment_id', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - ) - ); - - $this->addColumn( - 'shipping_name', - array( - 'header' => __('Ship-to Name'), - 'index' => 'shipping_name', - 'header_css_class' => 'col-name', - 'column_css_class' => 'col-name' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Ship Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'total_qty', - array( - 'header' => __('Total Quantity'), - 'index' => 'total_qty', - 'type' => 'number', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - ) - ); - - return parent::_prepareColumns(); + $this->_coreRegistry = $coreRegistry; + parent::__construct($context, $data); } /** @@ -174,34 +64,6 @@ class Shipments extends \Magento\Backend\Block\Widget\Grid\Extended implements return $this->_coreRegistry->registry('current_order'); } - /** - * Row URL getter - * - * @param \Magento\Object $row - * @return string - */ - public function getRowUrl($row) - { - return $this->getUrl( - 'adminhtml/order_shipment/view', - array('shipment_id' => $row->getId(), 'order_id' => $row->getOrderId()) - ); - } - - /** - * Grid URL getter - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/shipments', array('_current' => true)); - } - - /** - * ######################## TAB settings ################################# - */ - /** * {@inheritdoc} */ diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php index 235169915d9792e344322a68bedeb2f5e003cba2..29ca896db02ad30dd29bde805424ae03e7758a56 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Transactions.php @@ -32,28 +32,26 @@ namespace Magento\Sales\Block\Adminhtml\Order\View\Tab; * @package Magento_Sales * @author Magento Core Team <core@magentocommerce.com> */ -class Transactions extends \Magento\Sales\Block\Adminhtml\Transactions\Grid implements +class Transactions extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { /** - * Retrieve grid url - * - * @return string + * @var \Magento\AuthorizationInterface */ - public function getGridUrl() - { - return $this->getUrl('sales/order/transactions', array('_current' => true)); - } + protected $_authorization; /** - * Retrieve grid row url - * - * @param \Magento\Object $item - * @return string + * @param \Magento\View\Element\Context $context + * @param \Magento\AuthorizationInterface $authorization + * @param array $data */ - public function getRowUrl($item) - { - return $this->getUrl('sales/transactions/view', array('_current' => true, 'txn_id' => $item->getId())); + public function __construct( + \Magento\View\Element\Context $context, + \Magento\AuthorizationInterface $authorization, + array $data = array() + ) { + $this->_authorization = $authorization; + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Reorder/Renderer/Action.php b/app/code/Magento/Sales/Block/Adminhtml/Reorder/Renderer/Action.php index bf97322ff1a3ce56a69bfb5be009daba98534fa1..1e4584778aaa9848a5860a32fd5c74c808bb540a 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Reorder/Renderer/Action.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Reorder/Renderer/Action.php @@ -115,7 +115,7 @@ class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract $attributesObject->setData($action['@']); $html[] = '<a ' . $attributesObject->serialize() . '>' . $action['#'] . '</a>'; } - return implode($html, '<span class="separator">|</span>'); + return implode($html, ''); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php deleted file mode 100644 index 316dd0def7150c7e02aa4e405372272d79a36365..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php +++ /dev/null @@ -1,243 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Sales - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Sales\Block\Adminhtml\Shipment; - -/** - * Adminhtml sales orders grid - * - * @author Magento Core Team <core@magentocommerce.com> - */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended -{ - /** - * Collection factory - * - * @var \Magento\Sales\Model\Resource\Order\Collection\Factory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - array $data = array() - ) { - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Initialization - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('sales_shipment_grid'); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - } - - /** - * Retrieve collection class - * - * @return string - */ - protected function _getCollectionClass() - { - return 'Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection'; - } - - /** - * Prepare and set collection of grid - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create($this->_getCollectionClass()); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Prepare and add columns to grid - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'increment_id', - array( - 'header' => __('Shipment'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-shipment-number', - 'column_css_class' => 'col-shipment-number' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Ship Date'), - 'index' => 'created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'order_increment_id', - array( - 'header' => __('Order'), - 'index' => 'order_increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-number', - 'column_css_class' => 'col-order-number' - ) - ); - - $this->addColumn( - 'order_created_at', - array( - 'header' => __('Order Date'), - 'index' => 'order_created_at', - 'type' => 'datetime', - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - $this->addColumn( - 'shipping_name', - array( - 'header' => __('Ship-to Name'), - 'index' => 'shipping_name', - 'header_css_class' => 'col-memo', - 'column_css_class' => 'col-memo' - ) - ); - - $this->addColumn( - 'total_qty', - array( - 'header' => __('Total Quantity'), - 'index' => 'total_qty', - 'type' => 'number', - 'header_css_class' => 'col-qty', - 'column_css_class' => 'col-qty' - ) - ); - - $this->addColumn( - 'action', - array( - 'header' => __('Action'), - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array( - array( - 'caption' => __('View'), - 'url' => array('base' => 'sales/shipment/view'), - 'field' => 'shipment_id' - ) - ), - 'filter' => false, - 'sortable' => false, - 'is_system' => true, - 'header_css_class' => 'col-actions', - 'column_css_class' => 'col-actions' - ) - ); - - $this->addExportType('*/*/exportCsv', __('CSV')); - $this->addExportType('*/*/exportExcel', __('Excel XML')); - - return parent::_prepareColumns(); - } - - /** - * Get url for row - * - * @param string $row - * @return string - */ - public function getRowUrl($row) - { - if (!$this->_authorization->isAllowed(null)) { - return false; - } - - return $this->getUrl('sales/shipment/view', array('shipment_id' => $row->getId())); - } - - /** - * Prepare and set options for massaction - * - * @return $this - */ - protected function _prepareMassaction() - { - $this->setMassactionIdField('entity_id'); - $this->getMassactionBlock()->setFormFieldName('shipment_ids'); - $this->getMassactionBlock()->setUseSelectAll(false); - - $this->getMassactionBlock()->addItem( - 'pdfshipments_order', - array('label' => __('PDF Packing Slips'), 'url' => $this->getUrl('sales/shipment/pdfshipments')) - ); - - $this->getMassactionBlock()->addItem( - 'print_shipping_label', - array( - 'label' => __('Print Shipping Labels'), - 'url' => $this->getUrl('adminhtml/order_shipment/massPrintShippingLabel') - ) - ); - - return $this; - } - - /** - * Get url of grid - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/*', array('_current' => true)); - } -} diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Child/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Child/Grid.php deleted file mode 100644 index d13dd8e016a3491c05d06af81b28a52c0e60450f..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Child/Grid.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Sales - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Sales\Block\Adminhtml\Transactions\Child; - -/** - * Adminhtml transaction details grid - * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team <core@magentocommerce.com> - */ -class Grid extends \Magento\Sales\Block\Adminhtml\Transactions\Grid -{ - /** - * Columns, that should be removed from grid - * - * @var string[] - */ - protected $_columnsToRemove = array('parent_id', 'parent_txn_id'); - - /** - * Disable pager and filter - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('transactionChildGrid'); - $this->setDefaultSort('created_at'); - $this->setPagerVisibility(false); - $this->setFilterVisibility(false); - } - - /** - * Add filter by parent transaction ID - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->_collectionFactory->create(); - $collection->addParentIdFilter($this->_coreRegistry->registry('current_transaction')->getId()); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Remove some columns and make other not sortable - * - * @return $this - */ - protected function _prepareColumns() - { - $result = parent::_prepareColumns(); - - foreach ($this->_columns as $key => $value) { - if (in_array($key, $this->_columnsToRemove)) { - unset($this->_columns[$key]); - } else { - $this->_columns[$key]->setData('sortable', false); - } - } - return $result; - } -} diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php deleted file mode 100644 index 1367f2b7e449e84e40d4accd9e4e1aa708973bbf..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php +++ /dev/null @@ -1,254 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Sales - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Sales\Block\Adminhtml\Transactions; - -/** - * Adminhtml transactions grid - * - * @category Magento - * @package Magento_Sales - * @author Magento Core Team <core@magentocommerce.com> - */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended -{ - /** - * Core registry - * - * @var \Magento\Registry - */ - protected $_coreRegistry = null; - - /** - * Payment data - * - * @var \Magento\Payment\Helper\Data - */ - protected $_paymentData = null; - - /** - * Transaction - * - * @var \Magento\Sales\Model\Order\Payment\Transaction - */ - protected $_transaction; - - /** - * Collection factory - * - * @var \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory - */ - protected $_collectionFactory; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction - * @param \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Registry $coreRegistry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Sales\Model\Order\Payment\Transaction $transaction, - \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Registry $coreRegistry, - array $data = array() - ) { - $this->_coreRegistry = $coreRegistry; - $this->_paymentData = $paymentData; - $this->_transaction = $transaction; - $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $backendHelper, $data); - } - - /** - * Set grid params - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setId('order_transactions'); - $this->setUseAjax(true); - $this->setDefaultSort('created_at'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Prepare collection for grid - * - * @return $this - */ - protected function _prepareCollection() - { - $collection = $this->getCollection(); - if (!$collection) { - $collection = $this->_collectionFactory->create(); - } - $order = $this->_coreRegistry->registry('current_order'); - if ($order) { - $collection->addOrderIdFilter($order->getId()); - } - $collection->addOrderInformation(array('increment_id')); - $collection->addPaymentInformation(array('method')); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - /** - * Add columns to grid - * - * @return $this - */ - protected function _prepareColumns() - { - $this->addColumn( - 'transaction_id', - array( - 'header' => __('ID'), - 'index' => 'transaction_id', - 'type' => 'number', - 'header_css_class' => 'col-id', - 'column_css_class' => 'col-id' - ) - ); - - $this->addColumn( - 'increment_id', - array( - 'header' => __('Order ID'), - 'index' => 'increment_id', - 'type' => 'text', - 'header_css_class' => 'col-order-id', - 'column_css_class' => 'col-order-id' - ) - ); - - $this->addColumn( - 'txn_id', - array( - 'header' => __('Transaction ID'), - 'index' => 'txn_id', - 'type' => 'text', - 'header_css_class' => 'col-transaction-id', - 'column_css_class' => 'col-transaction-id' - ) - ); - - $this->addColumn( - 'parent_txn_id', - array( - 'header' => __('Parent Transaction ID'), - 'index' => 'parent_txn_id', - 'type' => 'text', - 'header_css_class' => 'col-parent-transaction-id', - 'column_css_class' => 'col-parent-transaction-id' - ) - ); - - $this->addColumn( - 'method', - array( - 'header' => __('Payment Method'), - 'index' => 'method', - 'type' => 'options', - 'options' => $this->_paymentData->getPaymentMethodList(true), - 'option_groups' => $this->_paymentData->getPaymentMethodList(true, true, true), - 'header_css_class' => 'col-method', - 'column_css_class' => 'col-method' - ) - ); - - $this->addColumn( - 'txn_type', - array( - 'header' => __('Transaction Type'), - 'index' => 'txn_type', - 'type' => 'options', - 'options' => $this->_transaction->getTransactionTypes(), - 'header_css_class' => 'col-transaction-type', - 'column_css_class' => 'col-transaction-type' - ) - ); - - $this->addColumn( - 'is_closed', - array( - 'header' => __('Closed'), - 'index' => 'is_closed', - 'width' => 1, - 'type' => 'options', - 'align' => 'center', - 'options' => array(1 => __('Yes'), 0 => __('No')), - 'header_css_class' => 'col-closed', - 'column_css_class' => 'col-closed' - ) - ); - - $this->addColumn( - 'created_at', - array( - 'header' => __('Created'), - 'index' => 'created_at', - 'width' => 1, - 'type' => 'datetime', - 'align' => 'center', - 'default' => __('N/A'), - 'html_decorators' => array('nobr'), - 'header_css_class' => 'col-period', - 'column_css_class' => 'col-period' - ) - ); - - return parent::_prepareColumns(); - } - - /** - * Retrieve grid url - * - * @return string - */ - public function getGridUrl() - { - return $this->getUrl('sales/*/grid', array('_current' => true)); - } - - /** - * Retrieve row url - * - * @param \Magento\Object $item - * @return string - */ - public function getRowUrl($item) - { - return $this->getUrl('sales/*/view', array('txn_id' => $item->getId())); - } -} diff --git a/app/code/Magento/Sales/Block/Guest/Link.php b/app/code/Magento/Sales/Block/Guest/Link.php index a734a942589a66b08a34f7d677d0415b4a846eec..aa195fb7ece673638f40981dcadbe81f2d7b97a6 100644 --- a/app/code/Magento/Sales/Block/Guest/Link.php +++ b/app/code/Magento/Sales/Block/Guest/Link.php @@ -29,20 +29,20 @@ namespace Magento\Sales\Block\Guest; class Link extends \Magento\View\Element\Html\Link\Current { /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\DefaultPathInterface $defaultPath - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\DefaultPathInterface $defaultPath, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { parent::__construct($context, $defaultPath, $data); diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo.php b/app/code/Magento/Sales/Block/Order/Creditmemo.php index 9e8756d344b25e87681b95c125859b44d72431c6..2e1835565934ea0ef2c14e286989398211f37ee0 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo.php @@ -40,7 +40,7 @@ class Creditmemo extends \Magento\Sales\Block\Order\Creditmemo\Items protected $_template = 'order/creditmemo.phtml'; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -52,14 +52,14 @@ class Creditmemo extends \Magento\Sales\Block\Order\Creditmemo\Items /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/Info/Buttons.php b/app/code/Magento/Sales/Block/Order/Info/Buttons.php index 20bf11e00ca8cce4f28e322cdf21142eb065434b..5786d3bf58b4be10d8f44c028d3cc66d6f3eb3ba 100644 --- a/app/code/Magento/Sales/Block/Order/Info/Buttons.php +++ b/app/code/Magento/Sales/Block/Order/Info/Buttons.php @@ -45,20 +45,20 @@ class Buttons extends \Magento\View\Element\Template protected $_coreRegistry = null; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_coreRegistry = $registry; diff --git a/app/code/Magento/Sales/Block/Order/Invoice.php b/app/code/Magento/Sales/Block/Order/Invoice.php index 0eee5c81e7ae84a729f4e28d626aa039285361f7..187f84cad6c51d84b696cb6ec7a01771bfec636e 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice.php +++ b/app/code/Magento/Sales/Block/Order/Invoice.php @@ -36,7 +36,7 @@ class Invoice extends \Magento\Sales\Block\Order\Invoice\Items protected $_template = 'order/invoice.phtml'; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -48,14 +48,14 @@ class Invoice extends \Magento\Sales\Block\Order\Invoice\Items /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php b/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php index ba5b73480aab3355dee4df88af6beb5f43d5abd7..b1ef23af0fe2f513c4c32e8730bf5bb4b66de5b5 100644 --- a/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php @@ -184,7 +184,7 @@ class DefaultRenderer extends \Magento\View\Element\Template $result = array('value' => $truncatedValue); if ($this->string->strlen($optionValue) > 55) { - $result['value'] = $result['value'] . ' <a href="#" class="dots" onclick="return false">...</a>'; + $result['value'] = $result['value'] . ' <a href="#" class="dots tooltip toggle" onclick="return false">...</a>'; $optionValue = nl2br($optionValue); $result = array_merge($result, array('full_view' => $optionValue)); } diff --git a/app/code/Magento/Sales/Block/Order/Link.php b/app/code/Magento/Sales/Block/Order/Link.php index 39706d8923725d163622fe74c45151ae8ab36ccd..4cdf84a62b3cce9d88c7e89a464e2bfd66ab89c7 100644 --- a/app/code/Magento/Sales/Block/Order/Link.php +++ b/app/code/Magento/Sales/Block/Order/Link.php @@ -33,13 +33,13 @@ class Link extends \Magento\View\Element\Html\Link\Current /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath * @param \Magento\Registry $registry * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\DefaultPathInterface $defaultPath, \Magento\Registry $registry, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Order/View.php b/app/code/Magento/Sales/Block/Order/View.php index d8842c7f8e0040ecd0a1b3b7b0566611c32eb83d..50edf9c1fa3bd00e76ca22a46d17dbcbe1c1299a 100644 --- a/app/code/Magento/Sales/Block/Order/View.php +++ b/app/code/Magento/Sales/Block/Order/View.php @@ -55,14 +55,14 @@ class View extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Reorder/Sidebar.php b/app/code/Magento/Sales/Block/Reorder/Sidebar.php index 59bfac23a5ad0aa4cfb80dc6fc47051a60a88ccc..ead096fb6e724bd0c3b62245225f67b5a383cb48 100644 --- a/app/code/Magento/Sales/Block/Reorder/Sidebar.php +++ b/app/code/Magento/Sales/Block/Reorder/Sidebar.php @@ -27,6 +27,9 @@ namespace Magento\Sales\Block\Reorder; /** * Sales order view block + * + * @method Sidebar setOrders(\Magento\Sales\Model\Resource\Order\Collection $ordersCollection) + * @method \Magento\Sales\Model\Resource\Order\Collection|null getOrders() */ class Sidebar extends \Magento\View\Element\Template implements \Magento\View\Block\IdentityInterface { @@ -51,7 +54,7 @@ class Sidebar extends \Magento\View\Element\Template implements \Magento\View\Bl protected $_customerSession; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -60,7 +63,7 @@ class Sidebar extends \Magento\View\Element\Template implements \Magento\View\Bl * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Sales\Model\Order\Config $orderConfig * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -68,7 +71,7 @@ class Sidebar extends \Magento\View\Element\Template implements \Magento\View\Bl \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Customer\Model\Session $customerSession, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_orderCollectionFactory = $orderCollectionFactory; @@ -99,11 +102,9 @@ class Sidebar extends \Magento\View\Element\Template implements \Magento\View\Bl */ public function initOrders() { - $customerId = $this->getCustomerId() ? $this - ->getCustomerId() : $this - ->_customerSession - ->getCustomer() - ->getId(); + $customerId = $this->getCustomerId() + ? $this->getCustomerId() + : $this->_customerSession->getCustomerId(); $orders = $this->_orderCollectionFactory->create()->addAttributeToFilter( 'customer_id', diff --git a/app/code/Magento/Sales/Block/Widget/Guest/Form.php b/app/code/Magento/Sales/Block/Widget/Guest/Form.php index b5782529ab1b4a7eb94d0be651aa7a876cc7941f..11fbfd83865761c3c90a287b18e973ddcde698e4 100644 --- a/app/code/Magento/Sales/Block/Widget/Guest/Form.php +++ b/app/code/Magento/Sales/Block/Widget/Guest/Form.php @@ -32,18 +32,18 @@ namespace Magento\Sales\Block\Widget\Guest; class Form extends \Magento\View\Element\Template implements \Magento\Widget\Block\BlockInterface { /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->httpContext = $httpContext; diff --git a/app/code/Magento/Sales/Controller/AbstractController.php b/app/code/Magento/Sales/Controller/AbstractController.php index 414c185b3f58d32233adae3cfa8c7c8ac32da445..0e1c378acaefb6495d90378a8e726a394256b15e 100644 --- a/app/code/Magento/Sales/Controller/AbstractController.php +++ b/app/code/Magento/Sales/Controller/AbstractController.php @@ -28,7 +28,7 @@ namespace Magento\Sales\Controller; /** * Sales Controller */ -abstract class AbstractController extends \Magento\App\Action\Action +abstract class AbstractController extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -38,10 +38,10 @@ abstract class AbstractController extends \Magento\App\Action\Action protected $_coreRegistry = null; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry */ - public function __construct(\Magento\App\Action\Context $context, \Magento\Registry $coreRegistry) + public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php index 1a3c8dc218daf67030abaf6e18ba792d8510a27c..f91afcd9f29a4baf97b9c820177c091eb7e502ec 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales orders controller @@ -41,11 +41,11 @@ class Creditmemo extends \Magento\Sales\Controller\Adminhtml\Creditmemo\Abstract */ public function exportCsvAction() { + $this->_view->loadLayout(false); $fileName = 'creditmemos.csv'; - /** @var $grid \Magento\Sales\Block\Adminhtml\Creditmemo\Grid*/ - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo\Grid'); + $grid = $grid = $this->_view->getLayout()->getChildBlock('sales.creditmemo.grid', 'grid.export'); $csvFile = $grid->getCsvFile(); - return $this->_fileFactory->create($fileName, $csvFile, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $csvFile, \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -55,9 +55,14 @@ class Creditmemo extends \Magento\Sales\Controller\Adminhtml\Creditmemo\Abstract */ public function exportExcelAction() { + $this->_view->loadLayout(false); $fileName = 'creditmemos.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + $grid = $this->_view->getLayout()->getChildBlock('sales.creditmemo.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $grid->getExcelFile($fileName), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php index a38e129cafabb9794ef4094c2c87052f71a4e2f6..ffacc4d7e0679bc4d9a4ea145d08b1f29d25d220 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml\Creditmemo; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales orders controller @@ -35,17 +35,17 @@ use Magento\App\ResponseInterface; class AbstractCreditmemo extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -78,9 +78,7 @@ class AbstractCreditmemo extends \Magento\Backend\App\Action */ public function indexAction() { - $this->_initAction()->_addContent( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Creditmemo') - ); + $this->_initAction(); $this->_view->renderLayout(); } @@ -153,7 +151,7 @@ class AbstractCreditmemo extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'creditmemo' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -179,7 +177,7 @@ class AbstractCreditmemo extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'creditmemo' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -195,4 +193,15 @@ class AbstractCreditmemo extends \Magento\Backend\App\Action { return $this->_authorization->isAllowed('Magento_Sales::sales_creditmemo'); } + + /** + * Creditmemo grid + * + * @return void + */ + public function gridAction() + { + $this->_view->loadLayout(false); + $this->_view->renderLayout(); + } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php index db0f5545fcbe0e82347621c7c26f64a2b67dac04..2b4facc6870074e486d0c525c1fee631ad2ff0b0 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Invoice.php @@ -25,10 +25,10 @@ */ namespace Magento\Sales\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** - * Adminhtml sales orders controller + * Adminhtml sales invoices controller * * @author Magento Core Team <core@magentocommerce.com> */ @@ -41,9 +41,15 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic */ public function exportCsvAction() { + $this->_view->loadLayout(); $fileName = 'invoices.csv'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid'); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.invoice.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -53,8 +59,13 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic */ public function exportExcelAction() { + $this->_view->loadLayout(); $fileName = 'invoices.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + $exportBlock = $this->_view->getLayout()->getChildBlock('sales.invoice.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $exportBlock->getExcelFile($fileName), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php index a7737fcf295fee4f931f39ab8d4ed863a236f641..a320b2a75a10542a5619f9fd9ff1dcbbe6c72bc1 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml\Invoice; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales orders controller @@ -35,17 +35,17 @@ use Magento\App\ResponseInterface; class AbstractInvoice extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -78,10 +78,8 @@ class AbstractInvoice extends \Magento\Backend\App\Action */ public function gridAction() { - $this->_view->loadLayout(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice\Grid')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -93,9 +91,7 @@ class AbstractInvoice extends \Magento\Backend\App\Action { $this->_title->add(__('Invoices')); - $this->_initAction()->_addContent( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Invoice') - ); + $this->_initAction(); $this->_view->renderLayout(); } @@ -156,7 +152,7 @@ class AbstractInvoice extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'invoice' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -191,7 +187,7 @@ class AbstractInvoice extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'invoice' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order.php b/app/code/Magento/Sales/Controller/Adminhtml/Order.php index d6d3ef3eff4eaf61175a8901dbaf2fe0c08623ff..77e8387b7140e793ea3763ed8af2c304615d7a69 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Backend\App\Action; /** @@ -52,7 +52,7 @@ class Order extends \Magento\Backend\App\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -64,13 +64,13 @@ class Order extends \Magento\Backend\App\Action /** * @param Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Translate\InlineInterface $translateInline */ public function __construct( Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Translate\InlineInterface $translateInline ) { $this->_coreRegistry = $coreRegistry; @@ -156,7 +156,7 @@ class Order extends \Magento\Backend\App\Action if ($order) { try { $this->_initAction(); - } catch (\Magento\App\Action\Exception $e) { + } catch (\Magento\Framework\App\Action\Exception $e) { $this->messageManager->addError($e->getMessage()); $this->_redirect('sales/order/index'); return; @@ -363,9 +363,8 @@ class Order extends \Magento\Backend\App\Action public function invoicesAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -376,9 +375,8 @@ class Order extends \Magento\Backend\App\Action public function shipmentsAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments')->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -389,11 +387,8 @@ class Order extends \Magento\Backend\App\Action public function creditmemosAction() { $this->_initOrder(); - $this->getResponse()->setBody( - $this->_view->getLayout()->createBlock( - 'Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos' - )->toHtml() - ); + $this->_view->loadLayout(false); + $this->_view->renderLayout(); } /** @@ -577,7 +572,7 @@ class Order extends \Magento\Backend\App\Action 'Y-m-d_H-i-s' ) . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } else { @@ -630,7 +625,7 @@ class Order extends \Magento\Backend\App\Action 'Y-m-d_H-i-s' ) . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } else { @@ -683,7 +678,7 @@ class Order extends \Magento\Backend\App\Action 'Y-m-d_H-i-s' ) . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } else { @@ -782,7 +777,7 @@ class Order extends \Magento\Backend\App\Action 'Y-m-d_H-i-s' ) . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } else { @@ -871,7 +866,7 @@ class Order extends \Magento\Backend\App\Action $fileName = 'orders.csv'; /** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */ $exportBlock = $this->_view->getLayout()->getChildBlock('sales.order.grid', 'grid.export'); - return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -888,7 +883,7 @@ class Order extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, $exportBlock->getExcelFile($fileName), - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php index 853b135d7d9bc50fd2fd52ed75bef9800e335245..2b7b98ba159b4f6b0705d68e95cc216305e09416 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo.php @@ -26,7 +26,7 @@ namespace Magento\Sales\Controller\Adminhtml\Order; use Magento\Sales\Model\Order; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales order creditmemo controller diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php index ad7039a40c6ee7e00aeb51428f477984fde156cb..e4fd0f564450cfd03bcccca88cf992f16e46b944 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice.php @@ -26,10 +26,10 @@ namespace Magento\Sales\Controller\Adminhtml\Order; use Magento\Model\Exception; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** - * Adminhtml sales order edit controller + * Adminhtml sales order invoice edit controller * * @category Magento * @package Magento_Sales @@ -45,18 +45,18 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic protected $_coreRegistry = null; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_title; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Registry $coreRegistry */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Registry $coreRegistry ) { $this->_coreRegistry = $coreRegistry; @@ -82,11 +82,10 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic /** * Initialize invoice model instance * - * @param bool $update * @return \Magento\Sales\Model\Order\Invoice * @throws Exception */ - protected function _initInvoice($update = false) + protected function _initInvoice() { $this->_title->add(__('Invoices')); @@ -447,6 +446,8 @@ class Invoice extends \Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoic } /** + * Add comment to invoice action + * * @return void */ public function addCommentAction() diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php b/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php index 392dd63b48f86fc7ad5bf7bd72971cc1398a7872..4929203e55b949f8b00be58f79babcae49d8dbe3 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Shipment.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales orders controller @@ -41,9 +41,14 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip */ public function exportCsvAction() { + $this->_view->loadLayout(false); $fileName = 'shipments.csv'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment\Grid'); - return $this->_fileFactory->create($fileName, $grid->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + $grid = $this->_view->getLayout()->getChildBlock('sales.shipment.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $grid->getCsvFile(), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } /** @@ -53,8 +58,13 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip */ public function exportExcelAction() { + $this->_view->loadLayout(false); $fileName = 'shipments.xml'; - $grid = $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment\Grid'); - return $this->_fileFactory->create($fileName, $grid->getExcelFile($fileName), \Magento\App\Filesystem::VAR_DIR); + $grid = $this->_view->getLayout()->getChildBlock('sales.shipment.grid', 'grid.export'); + return $this->_fileFactory->create( + $fileName, + $grid->getExcelFile($fileName), + \Magento\Framework\App\Filesystem::VAR_DIR + ); } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php b/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php index 91a87644f8b32a32f825519aa164376d8ad52a9e..b44e7e29d62d6ac7c44028aa67dcac92547cfb84 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Shipment/AbstractShipment.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller\Adminhtml\Shipment; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml sales orders controller @@ -35,17 +35,17 @@ use Magento\App\ResponseInterface; class AbstractShipment extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -80,9 +80,7 @@ class AbstractShipment extends \Magento\Backend\App\Action { $this->_title->add(__('Shipments')); - $this->_initAction()->_addContent( - $this->_view->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Shipment') - ); + $this->_initAction(); $this->_view->renderLayout(); } @@ -125,7 +123,7 @@ class AbstractShipment extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'packingslip' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -150,7 +148,7 @@ class AbstractShipment extends \Magento\Backend\App\Action return $this->_fileFactory->create( 'packingslip' . $date . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php index 8f7853a6332966435a2ce3295a8ed2f864c377e3..d163b973f9b662ea4e8228caa9df5a0064485fb0 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php @@ -45,8 +45,10 @@ class Transactions extends \Magento\Backend\App\Action * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Registry $coreRegistry */ - public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Registry $coreRegistry) - { + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\Registry $coreRegistry + ) { $this->_coreRegistry = $coreRegistry; parent::__construct($context); } diff --git a/app/code/Magento/Sales/Controller/Download.php b/app/code/Magento/Sales/Controller/Download.php index 651d34b82e29295b4429d31f056210fe749c444e..dd5def557b688da64dde8969d9e5af732df6f1aa 100644 --- a/app/code/Magento/Sales/Controller/Download.php +++ b/app/code/Magento/Sales/Controller/Download.php @@ -23,14 +23,14 @@ */ namespace Magento\Sales\Controller; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Context; use Magento\Sales\Model\Download as ModelDownload; use Magento\Catalog\Model\Product\Type\AbstractType as AbstractProductType; /** * Sales controller for download purposes */ -class Download extends \Magento\App\Action\Action +class Download extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Sales\Model\Download diff --git a/app/code/Magento/Sales/Controller/Order.php b/app/code/Magento/Sales/Controller/Order.php index 52e5afafd6be95b206448e714d519db6e835695d..dcde08f41fee9771baccb23e3cab5a0e14c2628f 100644 --- a/app/code/Magento/Sales/Controller/Order.php +++ b/app/code/Magento/Sales/Controller/Order.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Controller; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Sales orders controller @@ -36,7 +36,7 @@ class Order extends \Magento\Sales\Controller\AbstractController * Check customer authentication for some actions * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Sales/Helper/Admin.php b/app/code/Magento/Sales/Helper/Admin.php index 45d4d2f2b82a05ce1ebd38683fec386d46f43d69..f77f252825d807018baf476a952c6a9fea7d3619 100644 --- a/app/code/Magento/Sales/Helper/Admin.php +++ b/app/code/Magento/Sales/Helper/Admin.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Helper; -class Admin extends \Magento\App\Helper\AbstractHelper +class Admin extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Sales\Model\Config @@ -38,12 +38,12 @@ class Admin extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Config $salesConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Config $salesConfig ) { diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index c26c551ce26afc8153a3750821a79f1cc45df526..7aad9f8e7b02f5b839e9d62c62757b091026f10c 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -70,29 +70,31 @@ class Guest extends \Magento\Core\Helper\Data protected $_orderFactory; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Stdlib\Cookie $coreCookie * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\Sales\Model\OrderFactory $orderFactory - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\ViewInterface $view * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Stdlib\Cookie $coreCookie, \Magento\Message\ManagerInterface $messageManager, \Magento\Sales\Model\OrderFactory $orderFactory, - \Magento\App\ViewInterface $view, + \Magento\Framework\App\ViewInterface $view, $dbCompatibleMode = true ) { $this->_coreRegistry = $coreRegistry; @@ -101,17 +103,24 @@ class Guest extends \Magento\Core\Helper\Data $this->messageManager = $messageManager; $this->_orderFactory = $orderFactory; $this->_view = $view; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** * Try to load valid order by $_POST or $_COOKIE * - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ResponseInterface $response * @return bool */ - public function loadValidOrder(\Magento\App\RequestInterface $request, \Magento\App\ResponseInterface $response) + public function loadValidOrder(\Magento\Framework\App\RequestInterface $request, \Magento\Framework\App\ResponseInterface $response) { if ($this->_customerSession->isLoggedIn()) { $response->setRedirect($this->_urlBuilder->getUrl('sales/order/history')); diff --git a/app/code/Magento/Sales/Helper/Reorder.php b/app/code/Magento/Sales/Helper/Reorder.php index d24e914df1e7e854ce7ca12e17dc503864c563c6..4241c74ac8be2feab641d5dc6199fb37f9ee2ab2 100644 --- a/app/code/Magento/Sales/Helper/Reorder.php +++ b/app/code/Magento/Sales/Helper/Reorder.php @@ -38,23 +38,32 @@ class Reorder extends \Magento\Core\Helper\Data protected $_customerSession; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState + * @param \Magento\Pricing\PriceCurrencyInterface $priceCurrency * @param \Magento\Customer\Model\Session $customerSession * @param bool $dbCompatibleMode */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, + \Magento\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Customer\Model\Session $customerSession, $dbCompatibleMode = true ) { $this->_customerSession = $customerSession; - parent::__construct($context, $scopeConfig, $storeManager, $appState, $dbCompatibleMode); + parent::__construct( + $context, + $scopeConfig, + $storeManager, + $appState, + $priceCurrency, + $dbCompatibleMode + ); } /** diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index a550b6e55afc63732df1bb6e2d50554806fed807..b458b737e11a916f9f129b09486558e91beb6ad4 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -183,7 +183,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car protected $_customerGroupService; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -204,7 +204,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car * @param CustomerBuilder $customerBuilder * @param \Magento\Customer\Helper\Data $customerHelper * @param CustomerGroupServiceInterface $customerGroupService - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data */ public function __construct( @@ -224,7 +224,7 @@ class Create extends \Magento\Object implements \Magento\Checkout\Model\Cart\Car CustomerBuilder $customerBuilder, \Magento\Customer\Helper\Data $customerHelper, CustomerGroupServiceInterface $customerGroupService, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = array() ) { $this->_objectManager = $objectManager; diff --git a/app/code/Magento/Sales/Model/Config.php b/app/code/Magento/Sales/Model/Config.php index 63cb7f109e9da57617522010ef273a68ee2984c7..5825321efb70968b2d65dde558f67681b80e778c 100644 --- a/app/code/Magento/Sales/Model/Config.php +++ b/app/code/Magento/Sales/Model/Config.php @@ -39,15 +39,15 @@ class Config implements \Magento\Sales\Model\ConfigInterface protected $_dataContainer; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** * @param \Magento\Sales\Model\Config\Data $dataContainer - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ - public function __construct(\Magento\Sales\Model\Config\Data $dataContainer, \Magento\App\State $appState) + public function __construct(\Magento\Sales\Model\Config\Data $dataContainer, \Magento\Framework\App\State $appState) { $this->_dataContainer = $dataContainer; $this->_appState = $appState; diff --git a/app/code/Magento/Sales/Model/Config/Ordered.php b/app/code/Magento/Sales/Model/Config/Ordered.php index c5be42d982f8f5a337e5660adb2be5be3c6fa1ad..6dfa4c29e0c985da492dca0c35f2939d639409eb 100644 --- a/app/code/Magento/Sales/Model/Config/Ordered.php +++ b/app/code/Magento/Sales/Model/Config/Ordered.php @@ -32,7 +32,7 @@ namespace Magento\Sales\Model\Config; * @package Magento_Sales * @author Magento Core Team <core@magentocommerce.com> */ -abstract class Ordered extends \Magento\App\Config\Base +abstract class Ordered extends \Magento\Framework\App\Config\Base { /** * Cache key for collectors @@ -77,7 +77,7 @@ abstract class Ordered extends \Magento\App\Config\Base protected $_collectors = array(); /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -92,13 +92,13 @@ abstract class Ordered extends \Magento\App\Config\Base protected $_salesConfig; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Simplexml\Element $sourceData */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Sales\Model\Config $salesConfig, $sourceData = null @@ -141,7 +141,7 @@ abstract class Ordered extends \Magento\App\Config\Base * Prepare configuration array for total model * * @param string $code - * @param \Magento\App\Config\Element $totalConfig + * @param \Magento\Framework\App\Config\Element $totalConfig * @return array */ protected function _prepareConfigArray($code, $totalConfig) diff --git a/app/code/Magento/Sales/Model/Download.php b/app/code/Magento/Sales/Model/Download.php index ec9ad80a29b4905f15171562c6027c42a6bd8deb..0e4fcc51cfa28d65779abee9b8ae9f1db79ab3b5 100644 --- a/app/code/Magento/Sales/Model/Download.php +++ b/app/code/Magento/Sales/Model/Download.php @@ -41,23 +41,23 @@ class Download protected $_storageDatabaseFactory; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase * @param \Magento\Core\Model\File\Storage\DatabaseFactory $storageDatabaseFactory - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase, \Magento\Core\Model\File\Storage\DatabaseFactory $storageDatabaseFactory, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { - $this->_rootDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->_rootDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_fileStorageDatabase = $fileStorageDatabase; $this->_storageDatabaseFactory = $storageDatabaseFactory; $this->_fileFactory = $fileFactory; @@ -84,7 +84,7 @@ class Download $this->_fileFactory->create( $info['title'], array('value' => $this->_rootDir->getRelativePath($relativePath), 'type' => 'filename'), - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); } diff --git a/app/code/Magento/Sales/Model/Grid/Child/CollectionUpdater.php b/app/code/Magento/Sales/Model/Grid/Child/CollectionUpdater.php new file mode 100644 index 0000000000000000000000000000000000000000..1eb9bc4ae9a349e8a1f3bc7fa990ba1ce3e2e05d --- /dev/null +++ b/app/code/Magento/Sales/Model/Grid/Child/CollectionUpdater.php @@ -0,0 +1,55 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Grid\Child; + + +class CollectionUpdater implements \Magento\View\Layout\Argument\UpdaterInterface +{ + /** + * @var \Magento\Registry + */ + protected $registryManager; + + /** + * @param \Magento\Registry $registryManager + */ + public function __construct( + \Magento\Registry $registryManager + ) { + $this->registryManager = $registryManager; + } + + /** + * Update grid collection according to chosen transaction + * + * @param \Magento\Sales\Model\Resource\Transaction\Grid\Collection $argument + * @return \Magento\Sales\Model\Resource\Transaction\Grid\Collection + */ + public function update($argument) + { + $argument->addParentIdFilter($this->registryManager->registry('current_transaction')->getId()); + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Grid/CollectionUpdater.php b/app/code/Magento/Sales/Model/Grid/CollectionUpdater.php new file mode 100644 index 0000000000000000000000000000000000000000..baca8854bcfec33e2d3803bd6ccee0f7e473e05d --- /dev/null +++ b/app/code/Magento/Sales/Model/Grid/CollectionUpdater.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Grid; + + +class CollectionUpdater implements \Magento\View\Layout\Argument\UpdaterInterface +{ + /** + * @var \Magento\Registry + */ + protected $registryManager; + + /** + * @param \Magento\Registry $registryManager + */ + public function __construct(\Magento\Registry $registryManager) + { + $this->registryManager = $registryManager; + } + + /** + * Update grid collection according to chosen order + * + * @param \Magento\Sales\Model\Resource\Transaction\Grid\Collection $argument + * @return \Magento\Sales\Model\Resource\Transaction\Grid\Collection + */ + public function update($argument) + { + $order = $this->registryManager->registry('current_order'); + if ($order) { + $argument->setOrderFilter($order->getId()); + } + $argument->addOrderInformation(array('increment_id')); + + return $argument; + } +} diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index ec97087b506e7cf6605bda0c0a50a45cbc48e4c8..8d9446f1494c09abcdb94b6f452cf77503c3841b 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -506,7 +506,7 @@ class Order extends \Magento\Sales\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -612,7 +612,7 @@ class Order extends \Magento\Sales\Model\AbstractModel * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Order\Config $orderConfig * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -643,7 +643,7 @@ class Order extends \Magento\Sales\Model\AbstractModel \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Helper\Data $salesData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Catalog\Model\ProductFactory $productFactory, diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index f09db4f2a00d8396ab2e9d808d76edd0ecd57106..edffa066c1dc38ecade73195abddb22a5e66bf47 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -217,7 +217,7 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -268,7 +268,7 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Creditmemo\Config $creditmemoConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollectionFactory @@ -288,7 +288,7 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Helper\Data $salesData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Order\Creditmemo\Config $creditmemoConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollectionFactory, diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index ffda47854b11ab9907c4f3bd3a17e27d1178c06e..e653e3843725f127e64aeae1be2a09696251cc53 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -227,7 +227,7 @@ class Invoice extends \Magento\Sales\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -278,7 +278,7 @@ class Invoice extends \Magento\Sales\Model\AbstractModel * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Invoice\Config $invoiceConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory @@ -298,7 +298,7 @@ class Invoice extends \Magento\Sales\Model\AbstractModel \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Helper\Data $salesData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Order\Invoice\Config $invoiceConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory, diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Grid/Row/UrlGenerator.php b/app/code/Magento/Sales/Model/Order/Invoice/Grid/Row/UrlGenerator.php new file mode 100644 index 0000000000000000000000000000000000000000..5864c6b5a1b3499698a05a10d8fe908fce15669c --- /dev/null +++ b/app/code/Magento/Sales/Model/Order/Invoice/Grid/Row/UrlGenerator.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Sales + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Order\Invoice\Grid\Row; + +/** + * Sales orders grid row url generator + */ +class UrlGenerator extends \Magento\Backend\Model\Widget\Grid\Row\UrlGenerator +{ + /** + * @var \Magento\AuthorizationInterface + */ + protected $_authorization; + + /** + * @param \Magento\Backend\Model\UrlInterface $backendUrl + * @param \Magento\AuthorizationInterface $authorization + * @param array $args + */ + public function __construct( + \Magento\Backend\Model\UrlInterface $backendUrl, + \Magento\AuthorizationInterface $authorization, + array $args = array() + ) { + $this->_authorization = $authorization; + parent::__construct($backendUrl, $args); + } + + /** + * Generate row url + * + * @param \Magento\Object $item + * @return bool|string + */ + public function getUrl($item) + { + if ($this->_authorization->isAllowed('Magento_Sales::sales_invoice')) { + return parent::getUrl($item); + } + return false; + } +} diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 1bf20f4414970d1df80a80b4d40e9becea7b3faf..ff4e8fb9aab6314b7e18a00b04a403bd4305fb87 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -89,7 +89,7 @@ abstract class AbstractPdf extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -126,8 +126,8 @@ abstract class AbstractPdf extends \Magento\Object /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory @@ -140,8 +140,8 @@ abstract class AbstractPdf extends \Magento\Object public function __construct( \Magento\Payment\Helper\Data $paymentData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, @@ -153,8 +153,8 @@ abstract class AbstractPdf extends \Magento\Object $this->_localeDate = $localeDate; $this->string = $string; $this->_scopeConfig = $scopeConfig; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); - $this->_rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); + $this->_rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_pdfConfig = $pdfConfig; $this->_pdfTotalFactory = $pdfTotalFactory; $this->_pdfItemsFactory = $pdfItemsFactory; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php index 605961525826701fea2f1c124ceab9b5b451e634..27c15ff3fb6f174b66038458fcc91d2b2c71f58c 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Creditmemo.php @@ -38,8 +38,8 @@ class Creditmemo extends AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory @@ -55,8 +55,8 @@ class Creditmemo extends AbstractPdf public function __construct( \Magento\Payment\Helper\Data $paymentData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php index 40cef5d0618769a0baad19125ba1a925d25b49a3..deef03aacd7f3f05eec625dfa49d00b3abda1882 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php @@ -43,8 +43,8 @@ class Invoice extends AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory @@ -59,8 +59,8 @@ class Invoice extends AbstractPdf public function __construct( \Magento\Payment\Helper\Data $paymentData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php index b91a0832f48ae5ccfb5aa5d6063717b3b0162d3a..0208a670de3d8e4054e4e1627f364ddad24e8eed 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php @@ -86,7 +86,7 @@ abstract class AbstractItems extends \Magento\Model\AbstractModel * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem , + * @param \Magento\Framework\App\Filesystem $filesystem , * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -96,7 +96,7 @@ abstract class AbstractItems extends \Magento\Model\AbstractModel \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -104,7 +104,7 @@ abstract class AbstractItems extends \Magento\Model\AbstractModel ) { $this->filterManager = $filterManager; $this->_taxData = $taxData; - $this->_rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->_rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index ec21d8430da3b21500d5cd4dce365797c4b2c50c..c38ca1f137bcfee56d6840647f45addc78a74883 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -41,7 +41,7 @@ class DefaultCreditmemo extends \Magento\Sales\Model\Order\Pdf\Items\AbstractIte * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $string * @param \Magento\Model\Resource\AbstractResource $resource @@ -52,7 +52,7 @@ class DefaultCreditmemo extends \Magento\Sales\Model\Order\Pdf\Items\AbstractIte \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $string, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index b25083fdca25885304ca52f300d4f1ccb075303b..307e09aff10fd0c53a2e8ba0fdb4d10edd3651df 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -41,7 +41,7 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $string * @param \Magento\Model\Resource\AbstractResource $resource @@ -52,7 +52,7 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $string, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index b1b52f57b278e9db5378a3ce6a9384c609689f1a..2d2eca5ea55bd771c55d4e9ea02caa24281dc972 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -41,7 +41,7 @@ class DefaultShipment extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\String $string * @param \Magento\Model\Resource\AbstractResource $resource @@ -52,7 +52,7 @@ class DefaultShipment extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\String $string, \Magento\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php index 01a3982d987dd760fc071948b70444b7544faf21..04bd989bca52522896909a95e95547b5078f5f0c 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Shipment.php @@ -43,8 +43,8 @@ class Shipment extends AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory @@ -59,8 +59,8 @@ class Shipment extends AbstractPdf public function __construct( \Magento\Payment\Helper\Data $paymentData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, diff --git a/app/code/Magento/Sales/Model/Order/Shipment.php b/app/code/Magento/Sales/Model/Order/Shipment.php index f66755af08f5b1a1e5c23238e0fa6711fed485ee..8742e1c13cd35b4d5a6936c2c7ced945d6137d1d 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Order/Shipment.php @@ -154,7 +154,7 @@ class Shipment extends \Magento\Sales\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -195,7 +195,7 @@ class Shipment extends \Magento\Sales\Model\AbstractModel * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\Order\Shipment\Item\CollectionFactory $shipmentItemCollectionFactory * @param \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollectionFactory @@ -213,7 +213,7 @@ class Shipment extends \Magento\Sales\Model\AbstractModel \Magento\Stdlib\DateTime $dateTime, \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Helper\Data $salesData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\Order\Shipment\Item\CollectionFactory $shipmentItemCollectionFactory, \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollectionFactory, diff --git a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php index cb33393baf0c5054c7529225ce55b8955e1b86b4..31b96920cf5c0c09dea10e22011e528c876972a3 100644 --- a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php +++ b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php @@ -57,14 +57,14 @@ class Base extends \Magento\Sales\Model\Config\Ordered protected $_orderTotalFactory; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory * @param mixed $sourceData */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Sales\Model\Config $salesConfig, \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory, diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index 2dadfbd1f23c204688449bdab58ffe72a332d0ad..4294c29a902f871bea78d2324af4eff0c9615394 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -210,7 +210,7 @@ class Quote extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -220,7 +220,7 @@ class Quote extends \Magento\Model\AbstractModel protected $_storeManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -304,9 +304,9 @@ class Quote extends \Magento\Model\AbstractModel * @param \Magento\Registry $registry * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Sales\Model\Quote\AddressFactory $quoteAddressFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param CustomerGroupServiceInterface $customerGroupService @@ -330,9 +330,9 @@ class Quote extends \Magento\Model\AbstractModel \Magento\Registry $registry, \Magento\Sales\Helper\Data $salesData, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Sales\Model\Quote\AddressFactory $quoteAddressFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, CustomerGroupServiceInterface $customerGroupService, diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php index a7b5a1037df7b1e786f5eaf34629cbd85a04a69f..77e7422b148c8f45dbd9f9d0ddb96c25497f83cd 100644 --- a/app/code/Magento/Sales/Model/Quote/Address.php +++ b/app/code/Magento/Sales/Model/Quote/Address.php @@ -208,7 +208,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -260,7 +260,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param \Magento\Customer\Model\Address\Config $addressConfig * @param \Magento\Directory\Model\RegionFactory $regionFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\ItemFactory $addressItemFactory * @param \Magento\Sales\Model\Resource\Quote\Address\Item\CollectionFactory $itemCollectionFactory * @param \Magento\Sales\Model\Quote\Address\RateFactory $addressRateFactory @@ -285,7 +285,7 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress \Magento\Customer\Model\Address\Config $addressConfig, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\ItemFactory $addressItemFactory, \Magento\Sales\Model\Resource\Quote\Address\Item\CollectionFactory $itemCollectionFactory, \Magento\Sales\Model\Quote\Address\RateFactory $addressRateFactory, diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php index c4549d76948de4b36421ced36ea66a7f7b100985..0fa90a3a0ee86e2093c99667913b6d932f807358 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php +++ b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php @@ -71,7 +71,7 @@ class Collector extends \Magento\Sales\Model\Config\Ordered /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -81,20 +81,20 @@ class Collector extends \Magento\Sales\Model\Config\Ordered protected $_totalFactory; /** - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Logger $logger * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Quote\Address\TotalFactory $totalFactory * @param mixed $sourceData * @param mixed $store */ public function __construct( - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Logger $logger, \Magento\Sales\Model\Config $salesConfig, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Quote\Address\TotalFactory $totalFactory, $sourceData = null, diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Tax.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Tax.php index 880860efbbd3d45885ca568fd3a534094754a209..01fe1d6130fa747b170a30c268df362e7448f668 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Tax.php +++ b/app/code/Magento/Sales/Model/Quote/Address/Total/Tax.php @@ -42,7 +42,7 @@ class Tax extends \Magento\Sales\Model\Quote\Address\Total\AbstractTotal /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -53,12 +53,12 @@ class Tax extends \Magento\Sales\Model\Quote\Address\Total\AbstractTotal /** * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Tax\Model\Calculation $calculation */ public function __construct( \Magento\Tax\Helper\Data $taxData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Tax\Model\Calculation $calculation ) { $this->_taxData = $taxData; diff --git a/app/code/Magento/Sales/Model/Resource/AbstractResource.php b/app/code/Magento/Sales/Model/Resource/AbstractResource.php index 22dd41d55b3355c1cdf8d007b3d165679e8ea715..2a34747303017e23847a5329fdf43695e2f29840 100644 --- a/app/code/Magento/Sales/Model/Resource/AbstractResource.php +++ b/app/code/Magento/Sales/Model/Resource/AbstractResource.php @@ -47,10 +47,10 @@ abstract class AbstractResource extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Sales/Model/Resource/Helper.php b/app/code/Magento/Sales/Model/Resource/Helper.php index 503f30206f1bec34df4fefc3787c7e4aa99172c5..1f5e994746a1d64d9330f72f863b670b5700c15d 100644 --- a/app/code/Magento/Sales/Model/Resource/Helper.php +++ b/app/code/Magento/Sales/Model/Resource/Helper.php @@ -36,12 +36,12 @@ class Helper extends \Magento\DB\Helper implements HelperInterface protected $_reportsResourceHelper; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Reports\Model\Resource\Helper $reportsResourceHelper * @param string $modulePrefix */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Reports\Model\Resource\Helper $reportsResourceHelper, $modulePrefix = 'sales' ) { diff --git a/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php b/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php index 88ee734ab871f24747aec7f92bccc5e9dccd2946..e828ed74c856b56192ff063b8d8e7229a93fa8c4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php +++ b/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php @@ -99,13 +99,13 @@ abstract class AbstractOrder extends \Magento\Sales\Model\Resource\AbstractResou protected $_eavEntityTypeFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index a577d1dceb3b42d284f485e2e1584bc13809d3f5..2c32ed1abd5e5e93d37151d2c343f576500c227b 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -43,14 +43,14 @@ class Address extends AbstractOrder protected $_salesResourceFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory * @param \Magento\Sales\Model\Resource\Factory $salesResourceFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusList.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusList.php new file mode 100644 index 0000000000000000000000000000000000000000..9a113fe321727a33ee1b9ccdea541f58d83b7309 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Grid/StatusList.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Order\Creditmemo\Grid; + +/** + * Sales creditmemo statuses option array + */ +class StatusList implements \Magento\Option\ArrayInterface +{ + /** + * @var \Magento\Sales\Model\Order\CreditmemoFactory + */ + protected $creditmemoFactory; + + /** + * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory + */ + public function __construct(\Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory) + { + $this->creditmemoFactory = $creditmemoFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->creditmemoFactory->create()->getStates(); + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..cd488c2941d2f3b496722bb947be8b4ba54a4a1d --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php @@ -0,0 +1,107 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Sales + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Order\Creditmemo\Order\Grid; + +/** + * Flat sales order creditmemo collection + * + * @category Magento + * @package Magento_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +class Collection extends \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection +{ + /** + * @var \Magento\Registry + */ + protected $registryManager; + + /** + * @param \Magento\Data\Collection\EntityFactoryInterface $entityFactory + * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Registry $registryManager + * @param null $connection + * @param \Magento\Model\Resource\Db\AbstractDb $resource + */ + public function __construct( + \Magento\Data\Collection\EntityFactoryInterface $entityFactory, + \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Registry $registryManager, + $connection = null, + \Magento\Model\Resource\Db\AbstractDb $resource = null + ) { + $this->registryManager = $registryManager; + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + } + + /** + * Retrieve order model instance + * + * @return \Magento\Sales\Model\Order + */ + public function getOrder() + { + return $this->registryManager->registry('current_order'); + } + + /** + * Apply sorting and filtering to collection + * + * @return $this + */ + protected function _initSelect() + { + parent::_initSelect(); + $this->addFieldToSelect( + 'entity_id' + )->addFieldToSelect( + 'created_at' + )->addFieldToSelect( + 'increment_id' + )->addFieldToSelect( + 'order_currency_code' + )->addFieldToSelect( + 'store_currency_code' + )->addFieldToSelect( + 'base_currency_code' + )->addFieldToSelect( + 'state' + )->addFieldToSelect( + 'grand_total' + )->addFieldToSelect( + 'base_grand_total' + )->addFieldToSelect( + 'billing_name' + )->setOrderFilter( + $this->getOrder() + ); + return $this; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusList.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusList.php new file mode 100644 index 0000000000000000000000000000000000000000..1cfe3d992e57b440c48b31a9ef519d36fad66343 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Grid/StatusList.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Order\Invoice\Grid; + +/** + * Sales invoices statuses option array + */ +class StatusList implements \Magento\Option\ArrayInterface +{ + /** + * @var \Magento\Sales\Model\Order\InvoiceFactory + */ + protected $invoiceFactory; + + /** + * @param \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory + */ + public function __construct(\Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory) + { + $this->invoiceFactory = $invoiceFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->invoiceFactory->create()->getStates(); + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..9bf583ae9b2ea39417fb92104f5be3370c34eeb5 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php @@ -0,0 +1,103 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Sales + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Order\Invoice\Orders\Grid; + +class Collection extends \Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection +{ + /** + * @var \Magento\Registry + */ + protected $registryManager; + + /** + * @param \Magento\Data\Collection\EntityFactoryInterface $entityFactory + * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Registry $registryManager + * @param null $connection + * @param \Magento\Model\Resource\Db\AbstractDb $resource + */ + public function __construct( + \Magento\Data\Collection\EntityFactoryInterface $entityFactory, + \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Registry $registryManager, + $connection = null, + \Magento\Model\Resource\Db\AbstractDb $resource = null + ) { + $this->registryManager = $registryManager; + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + } + + /** + * Retrieve order model instance + * + * @return \Magento\Sales\Model\Order + */ + public function getOrder() + { + return $this->registryManager->registry('current_order'); + } + + + /** + * Apply sorting and filtering to collection + * + * @return $this + */ + protected function _initSelect() + { + parent::_initSelect(); + $this->addFieldToSelect( + 'entity_id' + )->addFieldToSelect( + 'created_at' + )->addFieldToSelect( + 'order_id' + )->addFieldToSelect( + 'increment_id' + )->addFieldToSelect( + 'state' + )->addFieldToSelect( + 'grand_total' + )->addFieldToSelect( + 'base_grand_total' + )->addFieldToSelect( + 'store_currency_code' + )->addFieldToSelect( + 'base_currency_code' + )->addFieldToSelect( + 'order_currency_code' + )->addFieldToSelect( + 'billing_name' + )->setOrderFilter( + $this->getOrder() + ); + return $this; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Order/Payment.php b/app/code/Magento/Sales/Model/Resource/Order/Payment.php index b94d31c9e8858a229c8bf062ff77b065d7941b1e..0b9a352e1e1fca4acc65c7dfcfc2da5bbe6902f4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Payment.php @@ -50,14 +50,14 @@ class Payment extends AbstractOrder protected $_paymentConverter; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory * @param \Magento\Sales\Model\Payment\Method\Converter $paymentConverter */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php index 2e3a6e9716c063ee916e23cb4eb54f20173377c8..5ff9258ce8c309d46c052e7068d47e1e27781f6e 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Collection.php @@ -26,7 +26,7 @@ namespace Magento\Sales\Model\Resource\Order\Shipment; /** - * Flat sales order shipment collection + * Sales order shipment collection * * @category Magento * @package Magento_Sales diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..af1b71085cf3633ad7c4a1886f29a375be829966 --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Sales + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Order\Shipment\Order\Grid; + +/** + * Flat sales order shipment collection + * + * @category Magento + * @package Magento_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +class Collection extends \Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection +{ + /** + * @var \Magento\Registry + */ + protected $registryManager; + + /** + * @param \Magento\Data\Collection\EntityFactoryInterface $entityFactory + * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Registry $registryManager + * @param null $connection + * @param \Magento\Model\Resource\Db\AbstractDb $resource + */ + public function __construct( + \Magento\Data\Collection\EntityFactoryInterface $entityFactory, + \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Registry $registryManager, + $connection = null, + \Magento\Model\Resource\Db\AbstractDb $resource = null + ) { + $this->registryManager = $registryManager; + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + } + + /** + * Retrieve order model instance + * + * @return \Magento\Sales\Model\Order + */ + public function getOrder() + { + return $this->registryManager->registry('current_order'); + } + + /** + * Apply sorting and filtering to collection + * + * @return $this + */ + protected function _initSelect() + { + parent::_initSelect(); + $this->addFieldToSelect( + 'entity_id' + )->addFieldToSelect( + 'created_at' + )->addFieldToSelect( + 'increment_id' + )->addFieldToSelect( + 'total_qty' + )->addFieldToSelect( + 'shipping_name' + )->setOrderFilter( + $this->getOrder() + ); + return $this; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Quote.php b/app/code/Magento/Sales/Model/Resource/Quote.php index f91148fa76fcab5ab3d78d56faf5ac13d49b68e7..a2ff746e578c54980d0544e555ab5c1e7a235c08 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote.php +++ b/app/code/Magento/Sales/Model/Resource/Quote.php @@ -36,12 +36,12 @@ class Quote extends AbstractResource protected $_config; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Eav\Model\Config $config */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Eav\Model\Config $config ) { diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Payment.php b/app/code/Magento/Sales/Model/Resource/Quote/Payment.php index 9b0a44d120336c4dd60a585bf7531511c1443ff2..e74247756be51d20b6f1b8efd033825428f202ca 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Payment.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Payment.php @@ -43,12 +43,12 @@ class Payment extends \Magento\Sales\Model\Resource\AbstractResource protected $_paymentConverter; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Sales\Model\Payment\Method\Converter $paymentConverter */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, \Magento\Sales\Model\Payment\Method\Converter $paymentConverter ) { diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index cde8de3756107d1f0b8559079ec997705a7068ab..0eafa0d29816ce6b10e0addb49bbdfae2fc40f7d 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -56,7 +56,7 @@ class Bestsellers extends AbstractReport ); /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -67,7 +67,7 @@ class Bestsellers extends AbstractReport * @param array $ignoredProductTypes */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 58f4889f0b607d865871a0a9fd235b39d985e387..92193412af1808cd91a474154acc1ff713601ce3 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -41,7 +41,7 @@ class Order extends AbstractReport protected $_updateDatFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -51,7 +51,7 @@ class Order extends AbstractReport * @param \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Setup.php b/app/code/Magento/Sales/Model/Resource/Setup.php index 505510be5c4cb8315855f23d11358e132cb18b91..bbeb91a28d8d724c371299ff2a09a70985feea47 100644 --- a/app/code/Magento/Sales/Model/Resource/Setup.php +++ b/app/code/Magento/Sales/Model/Resource/Setup.php @@ -31,7 +31,7 @@ namespace Magento\Sales\Model\Resource; class Setup extends \Magento\Eav\Model\Entity\Setup { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -43,18 +43,18 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, $moduleName = 'Magento_Sales', $connectionName = \Magento\Module\Updater\SetupInterface::DEFAULT_SETUP_CONNECTION ) { @@ -267,7 +267,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * Get config model * - * @return \Magento\App\Config\ScopeConfigInterface + * @return \Magento\Framework\App\Config\ScopeConfigInterface */ public function getConfigModel() { diff --git a/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..4911eb789e76a482fe863345cde85647a673c66f --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php @@ -0,0 +1,75 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Resource\Transaction\Grid; + + +class Collection extends \Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection +{ + /** + * Core registry + * + * @var \Magento\Registry + */ + protected $registryManager = null; + + /** + * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Registry $registryManager + * @param null $connection + * @param \Magento\Model\Resource\Db\AbstractDb $resource + */ + public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Registry $registryManager, + $connection = null, + \Magento\Model\Resource\Db\AbstractDb $resource = null + ) { + $this->registryManager = $registryManager; + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + } + + /** + * Resource initialization + * + * @return $this + */ + protected function _initSelect() + { + parent::_initSelect(); + $order = $this->registryManager->registry('current_order'); + if ($order) { + $this->addOrderIdFilter($order->getId()); + } + $this->addOrderInformation(array('increment_id')); + $this->addPaymentInformation(array('method')); + return $this; + } +} diff --git a/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypeList.php b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypeList.php new file mode 100644 index 0000000000000000000000000000000000000000..5e83642911dadef7cfce55970f76e279f7c2323f --- /dev/null +++ b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/TypeList.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Sales\Model\Resource\Transaction\Grid; + +/** + * Sales transaction types option array + */ +class TypeList implements \Magento\Option\ArrayInterface +{ + /** + * @var \Magento\Sales\Model\Order\Payment\TransactionFactory + */ + protected $_transactionFactory; + + /** + * @param \Magento\Sales\Model\Order\Payment\TransactionFactory $transactionFactory + */ + public function __construct(\Magento\Sales\Model\Order\Payment\TransactionFactory $transactionFactory) + { + $this->_transactionFactory = $transactionFactory; + } + + /** + * Return option array + * + * @return array + */ + public function toOptionArray() + { + return $this->_transactionFactory->create()->getTransactionTypes(); + } +} diff --git a/app/code/Magento/Sales/Model/Service/Quote.php b/app/code/Magento/Sales/Model/Service/Quote.php index 02632c5defc9a1a82126249d98bc645ea1627234..46e7199ba07e4df324146fa4f2557f331026d64e 100755 --- a/app/code/Magento/Sales/Model/Service/Quote.php +++ b/app/code/Magento/Sales/Model/Service/Quote.php @@ -202,13 +202,14 @@ class Quote if (!$quote->getCustomerIsGuest()) { $customerData = $quote->getCustomerData(); $addresses = $quote->getCustomerAddressData(); + $customerDetails = $this->_customerDetailsBuilder + ->setCustomer($customerData) + ->setAddresses($addresses) + ->create(); if ($customerData->getId()) { - $this->_customerAccountService->saveCustomer($customerData); - $this->_customerAddressService->saveAddresses($customerData->getId(), $addresses); + $this->_customerAccountService->updateCustomer($customerDetails); } else { //for new customers - $customerDetails = - $this->_customerDetailsBuilder->setCustomer($customerData)->setAddresses($addresses)->create(); - $customerData = $this->_customerAccountService->createAccount( + $customerData = $this->_customerAccountService->createCustomer( $customerDetails, null, $quote->getPasswordHash() diff --git a/app/code/Magento/Sales/etc/adminhtml/routes.xml b/app/code/Magento/Sales/etc/adminhtml/routes.xml index a46c4ed4e60e412866869ef9f42df26fec98e358..9403bf6918323d7656274086d2e8618c2109f8af 100644 --- a/app/code/Magento/Sales/etc/adminhtml/routes.xml +++ b/app/code/Magento/Sales/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="sales" frontName="sales"> <module name="Magento_Sales" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Sales/etc/frontend/routes.xml b/app/code/Magento/Sales/etc/frontend/routes.xml index bb554d69b219c92812a1a02f357a00c304d4709e..9d07a156e42476bd0d89926a3920830059a47219 100644 --- a/app/code/Magento/Sales/etc/frontend/routes.xml +++ b/app/code/Magento/Sales/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="sales" frontName="sales"> <module name="Magento_Sales" /> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml new file mode 100644 index 0000000000000000000000000000000000000000..ccf448d39e0f1844a0289754f72d108f0e1495ad --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportcsv.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_creditmemo_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml new file mode 100644 index 0000000000000000000000000000000000000000..ccf448d39e0f1844a0289754f72d108f0e1495ad --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_exportexcel.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_creditmemo_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdfb781e6af64912afcc05d792cf370170ffc475 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="formkey"/> + <update handle="sales_creditmemo_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_creditmemo.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..4fd4361ece466f5775a41a7abd8e078801b8da96 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_grid_block.xml @@ -0,0 +1,175 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_creditmemo.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.creditmemo.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">sales_creditmemo_grid</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="grid_url" xsi:type="url" path="sales/creditmemo/grid"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Massaction" name="sales.creditmemo.grid.massaction" as="grid.massaction"> + <arguments> + <argument name="massaction_id_field" xsi:type="string">entity_id</argument> + <argument name="form_field_name" xsi:type="string">creditmemo_ids</argument> + <argument name="use_select_all" xsi:type="boolean">false</argument> + <argument name="options" xsi:type="array"> + <item name="print_creditmemos" xsi:type="array"> + <item name="label" xsi:type="string" translate="true">PDF Credit Memos</item> + <item name="url" xsi:type="string">sales/creditmemo/pdfcreditmemos</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Export" name="sales.creditmemo.grid.export" as="grid.export"> + <arguments> + <argument name="exportTypes" xsi:type="array"> + <item name="csv" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportCsv</item> + <item name="label" xsi:type="string" translate="true">CSV</item> + </item> + <item name="excel" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportExcel</item> + <item name="label" xsi:type="string" translate="true">Excel XML</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.creditmemo.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">sales_creditmemo_grid</argument> + <argument name="rowupdaterUrl" xsi:type="array"> + <item name="generatorClass" xsi:type="string">Magento\Sales\Model\Order\Grid\Row\UrlGenerator</item> + <item name="path" xsi:type="string">sales/creditmemo/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="creditmemo_id" xsi:type="string">getId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="real_creditmemo_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Credit Memo</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">real_creditmemo_id</argument> + <argument name="header_css_class" xsi:type="string">col-memo-number</argument> + <argument name="column_css_class" xsi:type="string">col-memo-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Created</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">order_increment_id</argument> + <argument name="id" xsi:type="string">order_increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-order-number</argument> + <argument name="column_css_class" xsi:type="string">col-order-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">order_created_at</argument> + <argument name="id" xsi:type="string">order_created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_name"> + <arguments> + <argument name="id" xsi:type="string">billing_name</argument> + <argument name="header" xsi:type="string" translate="true">Bill-to Name</argument> + <argument name="index" xsi:type="string">billing_name</argument> + <argument name="header_css_class" xsi:type="string">col-bill-to-name</argument> + <argument name="column_css_class" xsi:type="string">col-bill-to-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="state"> + <arguments> + <argument name="id" xsi:type="string">state</argument> + <argument name="header" xsi:type="string" translate="true">Status</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">state</argument> + <argument name="options" xsi:type="options" model="Magento\Sales\Model\Resource\Order\Creditmemo\Grid\StatusList"/> + <argument name="header_css_class" xsi:type="string">col-status</argument> + <argument name="column_css_class" xsi:type="string">col-status</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="base_grand_total"> + <arguments> + <argument name="id" xsi:type="string">grand_total</argument> + <argument name="header" xsi:type="string" translate="true">Refunded</argument> + <argument name="type" xsi:type="string">currency</argument> + <argument name="currency" xsi:type="string">order_currency_code</argument> + <argument name="rate" xsi:type="string">1</argument> + <argument name="index" xsi:type="string">grand_total</argument> + <argument name="header_css_class" xsi:type="string">col-refunded</argument> + <argument name="column_css_class" xsi:type="string">col-refunded</argument> + </arguments> + </block> + + <block class="Magento\Backend\Block\Widget\Grid\Column" as="action" acl="Magento_Sales::actions_view"> + <arguments> + <argument name="id" xsi:type="string">action</argument> + <argument name="header" xsi:type="string" translate="true">Action</argument> + <argument name="type" xsi:type="string">action</argument> + <argument name="getter" xsi:type="string">getId</argument> + <argument name="filter" xsi:type="boolean">false</argument> + <argument name="sortable" xsi:type="boolean">false</argument> + <argument name="is_system" xsi:type="boolean">true</argument> + <argument name="actions" xsi:type="array"> + <item name="view_action" xsi:type="array"> + <item name="caption" xsi:type="string" translate="true">View</item> + <item name="url" xsi:type="array"> + <item name="base" xsi:type="string">sales/creditmemo/view</item> + </item> + <item name="field" xsi:type="string">creditmemo_id</item> + </item> + </argument> + <argument name="header_css_class" xsi:type="string">col-actions</argument> + <argument name="column_css_class" xsi:type="string">col-actions</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml new file mode 100644 index 0000000000000000000000000000000000000000..b3293a47594af81e58a2b0cf415deac92fee1469 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_creditmemo_index.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_creditmemo_grid_block"/> + <referenceContainer name="content"> + <block class="Magento\Sales\Block\Adminhtml\Creditmemo" name="sales_creditmemo.grid.container"/> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml new file mode 100644 index 0000000000000000000000000000000000000000..7439fca2bdb478d1ff89e47124b68580106615f3 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportcsv.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_invoice_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml new file mode 100644 index 0000000000000000000000000000000000000000..7439fca2bdb478d1ff89e47124b68580106615f3 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_exportexcel.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_invoice_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml new file mode 100644 index 0000000000000000000000000000000000000000..79ea0f4c6b24b4eeb446259824a787e0df8a63cc --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" > + <update handle="formkey"/> + <update handle="sales_invoice_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_invoice.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..e8d53f24a4646e45cc55af90d70792787a34d981 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_grid_block.xml @@ -0,0 +1,175 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_invoice.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.invoice.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">sales_invoice_grid</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Invoice\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="save_parameters_in_session" xsi:type="boolean">true</argument> + <argument name="grid_url" xsi:type="url" path="*/*/grid"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Massaction" name="sales.invoice.grid.massaction" as="grid.massaction"> + <arguments> + <argument name="massaction_id_field" xsi:type="string">entity_id</argument> + <argument name="form_field_name" xsi:type="string">invoice_ids</argument> + <argument name="use_select_all" xsi:type="boolean">false</argument> + <argument name="options" xsi:type="array"> + <item name="pdfinvoices_order" xsi:type="array"> + <item name="label" xsi:type="string" translate="true">PDF Invoices</item> + <item name="url" xsi:type="string">sales/invoice/pdfinvoices</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Export" name="sales.invoice.grid.export" as="grid.export"> + <arguments> + <argument name="exportTypes" xsi:type="array"> + <item name="csv" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportCsv</item> + <item name="label" xsi:type="string" translate="true">CSV</item> + </item> + <item name="excel" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportExcel</item> + <item name="label" xsi:type="string" translate="true">Excel XML</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.invoice.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">sales_invoice_grid</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="generatorClass" xsi:type="string">Magento\Sales\Model\Order\Invoice\Grid\Row\UrlGenerator</item> + <item name="path" xsi:type="string">sales/invoice/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="invoice_id" xsi:type="string">getId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Invoice</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-invoice-number</argument> + <argument name="column_css_class" xsi:type="string">col-invoice-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Invoice Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">order_increment_id</argument> + <argument name="id" xsi:type="string">order_increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-order-number</argument> + <argument name="column_css_class" xsi:type="string">col-order-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">order_created_at</argument> + <argument name="id" xsi:type="string">order_created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_name"> + <arguments> + <argument name="id" xsi:type="string">billing_name</argument> + <argument name="header" xsi:type="string" translate="true">Bill-to Name</argument> + <argument name="index" xsi:type="string">billing_name</argument> + <argument name="header_css_class" xsi:type="string">col-bill-to-name</argument> + <argument name="column_css_class" xsi:type="string">col-bill-to-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="state"> + <arguments> + <argument name="id" xsi:type="string">state</argument> + <argument name="header" xsi:type="string" translate="true">Status</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">state</argument> + <argument name="options" xsi:type="options" model="Magento\Sales\Model\Resource\Order\Invoice\Grid\StatusList"/> + <argument name="header_css_class" xsi:type="string">col-status</argument> + <argument name="column_css_class" xsi:type="string">col-status</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="grand_total"> + <arguments> + <argument name="id" xsi:type="string">grand_total</argument> + <argument name="header" xsi:type="string" translate="true">Amount</argument> + <argument name="type" xsi:type="string">currency</argument> + <argument name="currency" xsi:type="string">order_currency_code</argument> + <argument name="index" xsi:type="string">grand_total</argument> + <argument name="header_css_class" xsi:type="string">col-gtpurchased</argument> + <argument name="column_css_class" xsi:type="string">col-gtpurchased</argument> + <argument name="align" xsi:type="string">right</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="action"> + <arguments> + <argument name="id" xsi:type="string">action</argument> + <argument name="header" xsi:type="string" translate="true">Action</argument> + <argument name="type" xsi:type="string">action</argument> + <argument name="getter" xsi:type="string">getId</argument> + <argument name="filter" xsi:type="boolean">false</argument> + <argument name="sortable" xsi:type="boolean">false</argument> + <argument name="is_system" xsi:type="boolean">true</argument> + <argument name="actions" xsi:type="array"> + <item name="view_action" xsi:type="array"> + <item name="caption" xsi:type="string" translate="true">View</item> + <item name="url" xsi:type="array"> + <item name="base" xsi:type="string">sales/invoice/view</item> + </item> + <item name="field" xsi:type="string">invoice_id</item> + </item> + </argument> + <argument name="header_css_class" xsi:type="string">col-actions</argument> + <argument name="column_css_class" xsi:type="string">col-actions</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml new file mode 100644 index 0000000000000000000000000000000000000000..1b7999b2760c22da7cfaa9ee247ddd8ec48756f0 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_invoice_index.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_invoice_grid_block"/> + <referenceContainer name="content"> + <block class="Magento\Sales\Block\Adminhtml\Invoice" name="sales_invoice.grid.container"/> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml index 894d6d1d9d41c32fedce1d7331016311fcb49150..30cac6d1047ec3cc3e36c7d6a7b7b383874cbcfc 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_customer_block.xml @@ -48,7 +48,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="index" xsi:type="string">entity_id</argument> - <argument name="width" xsi:type="string">50</argument> <argument name="align" xsi:type="string">right</argument> </arguments> </block> @@ -62,28 +61,26 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Email</argument> <argument name="index" xsi:type="string">email</argument> - <argument name="width" xsi:type="string">150</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="Telephone"> <arguments> <argument name="header" xsi:type="string" translate="true">Phone</argument> <argument name="index" xsi:type="string">billing_telephone</argument> - <argument name="width" xsi:type="string">100</argument> + <argument name="column_css_class" xsi:type="string">col-phone</argument> + <argument name="header_css_class" xsi:type="string">col-phone</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_postcode"> <arguments> <argument name="header" xsi:type="string" translate="true">ZIP/Post Code</argument> <argument name="index" xsi:type="string">billing_postcode</argument> - <argument name="width" xsi:type="string">120</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_country_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Country</argument> <argument name="index" xsi:type="string">billing_country_id</argument> - <argument name="width" xsi:type="string">100</argument> <argument name="type" xsi:type="string">country</argument> </arguments> </block> @@ -91,14 +88,12 @@ <arguments> <argument name="header" xsi:type="string" translate="true">State/Province</argument> <argument name="index" xsi:type="string">billing_regione</argument> - <argument name="width" xsi:type="string">100</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="store_name"> <arguments> <argument name="header" xsi:type="string" translate="true">Signed-up Point</argument> <argument name="index" xsi:type="string">store_name</argument> - <argument name="width" xsi:type="string">130</argument> <argument name="align" xsi:type="string">center</argument> </arguments> </block> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..8e9625a350a94d24aa007657756c18210cf45293 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_grid_block.xml @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_order_creditmemo.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_creditmemo.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">order_creditmemos</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Creditmemo\Order\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="grid_url" xsi:type="url" path="sales/order/creditmemos"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.order_creditmemo.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">sales_order_creditmemo_grid</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">sales/order_creditmemo/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="creditmemo_id" xsi:type="string">getId</item> + <item name="order_id" xsi:type="string">getOrderId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Credit Memo</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-memo</argument> + <argument name="column_css_class" xsi:type="string">col-memo</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_name"> + <arguments> + <argument name="id" xsi:type="string">billing_name</argument> + <argument name="header" xsi:type="string" translate="true">Bill-to Name</argument> + <argument name="index" xsi:type="string">billing_name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Created</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="state"> + <arguments> + <argument name="id" xsi:type="string">state</argument> + <argument name="header" xsi:type="string" translate="true">Status</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">state</argument> + <argument name="options" xsi:type="options" model="Magento\Sales\Model\Resource\Order\Creditmemo\Grid\StatusList"/> + <argument name="header_css_class" xsi:type="string">col-status</argument> + <argument name="column_css_class" xsi:type="string">col-status</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="base_grand_total"> + <arguments> + <argument name="id" xsi:type="string">grand_total</argument> + <argument name="header" xsi:type="string" translate="true">Refunded</argument> + <argument name="type" xsi:type="string">currency</argument> + <argument name="currency" xsi:type="string">order_currency_code</argument> + <argument name="index" xsi:type="string">base_grand_total</argument> + <argument name="header_css_class" xsi:type="string">col-refunded</argument> + <argument name="column_css_class" xsi:type="string">col-refunded</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml new file mode 100644 index 0000000000000000000000000000000000000000..d0d8446fbde17495e84bcbb892581f79f9b3871b --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemos.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_order_creditmemo_grid_block"/> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos" name="sales_order_creditmemo.grid.container" output="1"/> +</layout> \ No newline at end of file diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml index 31086e594b7be7c2ec10f16de02a5c7727504c66..58ac6acc42c3035e3b0c19b08c5a5c5036319554 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml @@ -147,8 +147,8 @@ <argument name="id" xsi:type="string">billing_name</argument> <argument name="header" xsi:type="string" translate="true">Bill-to Name</argument> <argument name="index" xsi:type="string">billing_name</argument> - <argument name="header_css_class" xsi:type="string">col-bill-to-name</argument> - <argument name="column_css_class" xsi:type="string">col-bill-to-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="shipping_name"> @@ -156,8 +156,8 @@ <argument name="id" xsi:type="string">shipping_name</argument> <argument name="header" xsi:type="string" translate="true">Ship-to Name</argument> <argument name="index" xsi:type="string">shipping_name</argument> - <argument name="header_css_class" xsi:type="string">col-ship-to-name</argument> - <argument name="column_css_class" xsi:type="string">col-ship-to-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="base_grand_total"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5790563327c4170859fc4bab74890f819906642 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_grid_block.xml @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_order_invoice.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_invoice.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">order_invoices</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Invoice\Orders\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="grid_url" xsi:type="url" path="sales/order/invoices"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.order_invoice.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">order_invoices</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">sales/order_invoice/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="invoice_id" xsi:type="string">getId</item> + <item name="order_id" xsi:type="string">getOrderId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Invoice</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-invoice-number</argument> + <argument name="column_css_class" xsi:type="string">col-invoice-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_name"> + <arguments> + <argument name="id" xsi:type="string">billing_name</argument> + <argument name="header" xsi:type="string" translate="true">Bill-to Name</argument> + <argument name="index" xsi:type="string">billing_name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Invoice Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="state"> + <arguments> + <argument name="id" xsi:type="string">state</argument> + <argument name="header" xsi:type="string" translate="true">Status</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">state</argument> + <argument name="options" xsi:type="options" model="Magento\Sales\Model\Resource\Order\Invoice\Grid\StatusList"/> + <argument name="header_css_class" xsi:type="string">col-status</argument> + <argument name="column_css_class" xsi:type="string">col-status</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="base_grand_total"> + <arguments> + <argument name="id" xsi:type="string">base_grand_total</argument> + <argument name="header" xsi:type="string" translate="true">Amount</argument> + <argument name="type" xsi:type="string">currency</argument> + <argument name="currency" xsi:type="string">base_currency_code</argument> + <argument name="index" xsi:type="string">base_grand_total</argument> + <argument name="header_css_class" xsi:type="string">col-qty</argument> + <argument name="column_css_class" xsi:type="string">col-qty</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml new file mode 100644 index 0000000000000000000000000000000000000000..38cee582081f9c53c3aa55d66f875453d8ef7539 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoices.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_order_invoice_grid_block"/> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices" name="sales_order_invoice.grid.container" output="1"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..013f11d106442b08b9f121bc582e790e1fc565f5 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_grid_block.xml @@ -0,0 +1,92 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_order_shipment.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.order_shipment.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">order_shipments</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Shipment\Order\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="grid_url" xsi:type="url" path="sales/order/shipments"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.order_shipment.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">order_shipments</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">adminhtml/order_shipment/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="shipment_id" xsi:type="string">getId</item> + <item name="order_id" xsi:type="string">getOrderId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="real_shipment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Shipment</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">real_shipment_id</argument> + <argument name="header_css_class" xsi:type="string">col-memo</argument> + <argument name="column_css_class" xsi:type="string">col-memo</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="shipping_name"> + <arguments> + <argument name="id" xsi:type="string">shipping_name</argument> + <argument name="header" xsi:type="string" translate="true">Ship-to Name</argument> + <argument name="index" xsi:type="string">shipping_name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Ship Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="total_qty"> + <arguments> + <argument name="id" xsi:type="string">total_qty</argument> + <argument name="header" xsi:type="string" translate="true">Total Quantity</argument> + <argument name="type" xsi:type="string">number</argument> + <argument name="index" xsi:type="string">total_qty</argument> + <argument name="header_css_class" xsi:type="string">col-qty</argument> + <argument name="column_css_class" xsi:type="string">col-qty</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f60f3b38470bd686de754b34ac4baf740e2d2f8 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipments.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_order_shipment_grid_block"/> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments" name="sales_order_shipment.grid.container" output="1"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml index 05ac30817ba8a0600cc9a0f6101381e55822c8f6..a9976e0717fa42c54b2fc277da461e19c03adfbb 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml @@ -64,8 +64,9 @@ <argument name="header" xsi:type="string" translate="true">Default Status</argument> <argument name="index" xsi:type="string">is_default</argument> <argument name="type" xsi:type="string">options</argument> - <argument name="width" xsi:type="string">100</argument> <argument name="sortable" xsi:type="string">0</argument> + <argument name="column_css_class" xsi:type="string">col-status-default</argument> + <argument name="header_css_class" xsi:type="string">col-status-default</argument> <argument name="options" xsi:type="array"> <item name="no" xsi:type="array"> <item name="value" xsi:type="string">0</item> @@ -83,7 +84,6 @@ <argument name="header" xsi:type="string" translate="true">State Code and Title</argument> <argument name="index" xsi:type="string">state</argument> <argument name="type" xsi:type="string">text</argument> - <argument name="width" xsi:type="string">250</argument> </arguments> </block> <block class="Magento\Sales\Block\Status\Grid\Column\Unassign" as="unassign"> @@ -91,9 +91,10 @@ <argument name="header" xsi:type="string" translate="true">Action</argument> <argument name="index" xsi:type="string">unassign</argument> <argument name="type" xsi:type="string">text</argument> - <argument name="width" xsi:type="string">100</argument> <argument name="sortable" xsi:type="string">0</argument> <argument name="filter" xsi:type="string">0</argument> + <argument name="column_css_class" xsi:type="string">col-actions</argument> + <argument name="header_css_class" xsi:type="string">col-actions</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml index 098fa8808f32f7f25abab45db48cd60e43645561..cff3feb40ae6db7bc220fc2827ec984ced5c70f2 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions.xml @@ -24,5 +24,6 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Sales\Block\Adminhtml\Transactions\Grid" name="sales_transactions.grid" output="1"/> + <update handle="sales_order_transactions_grid_block"/> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions" name="sales_transactions.grid.container" output="1"/> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..14960f2aa40b026c79a76e174c75beac52745b6f --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_transactions_grid_block.xml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_transactions_grid_block"/> + <referenceBlock name="sales.transactions.grid"> + <arguments> + <argument name="id" xsi:type="string">order_transactions</argument> + <argument name="dataSource" xsi:type="object"> + <updater>Magento\Sales\Model\Grid\CollectionUpdater</updater> + </argument> + <argument name="use_ajax" xsi:type="boolean">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="save_parameters_in_session" xsi:type="boolean">true</argument> + <argument name="grid_url" xsi:type="url" path="*/*/transactions"> + <param name="_current">1</param> + </argument> + </arguments> + <referenceBlock name="sales.transactions.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">order_transactions</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">sales/transactions/view</item> + <item name="params" xsi:type="array"> + <item name="_current" xsi:type="string">1</item> + </item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="txn_id" xsi:type="string">getId</item> + </item> + </argument> + </arguments> + </referenceBlock> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml index 47ca3d2390b602b1c7a4d7301d40926093b75282..fe60cab694d8dba27e6f05a5f2e48121d62cb711 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml @@ -39,6 +39,10 @@ <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Order\View" name="sales_order_edit"/> </referenceContainer> + <update handle="sales_order_invoice_grid_block"/> + <update handle="sales_order_shipment_grid_block"/> + <update handle="sales_order_transactions_grid_block"/> + <update handle="sales_order_creditmemo_grid_block"/> <referenceContainer name="left"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tabs" name="sales_order_tabs"> <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Info" name="order_tab_info" template="order/view/tab/info.phtml"> @@ -63,25 +67,29 @@ <argument name="name" xsi:type="string">order_info</argument> <argument name="block" xsi:type="string">order_tab_info</argument> </action> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices" name="sales_order_invoice.grid.container"/> <action method="addTab"> <argument name="name" xsi:type="string">order_invoices</argument> - <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices</argument> + <argument name="block" xsi:type="string">sales_order_invoice.grid.container</argument> </action> + <block class = "Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos" name="sales_order_creditmemo.grid.container"/> <action method="addTab"> <argument name="name" xsi:type="string">order_creditmemos</argument> - <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos</argument> + <argument name="block" xsi:type="string">sales_order_creditmemo.grid.container</argument> </action> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments" name="sales_order_shipment.grid.container"/> <action method="addTab"> <argument name="name" xsi:type="string">order_shipments</argument> - <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments</argument> + <argument name="block" xsi:type="string">sales_order_shipment.grid.container</argument> </action> <action method="addTab"> <argument name="name" xsi:type="string">order_history</argument> <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\History</argument> </action> + <block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions" name="sales_transactions.grid.container"/> <action method="addTab"> <argument name="name" xsi:type="string">order_transactions</argument> - <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\Transactions</argument> + <argument name="block" xsi:type="string">sales_transactions.grid.container</argument> </action> </block> </referenceContainer> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml new file mode 100644 index 0000000000000000000000000000000000000000..6de2d885fbd316458b23ef6339905827a132813c --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportcsv.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_shipment_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ec4617a251755e82a33159f8cd92e00163a51a7 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_exportexcel.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd" > + <update handle="sales_shipment_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_shipment.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..741e46cf438b7c102608c9b32ab424b252f191c0 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_grid_block.xml @@ -0,0 +1,164 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_shipment.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.shipment.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">sales_shipment_grid</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Order\Shipment\Grid\Collection</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="grid_url" xsi:type="url" path="sales/*/*"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Massaction" name="sales.shipment.grid.massaction" as="grid.massaction"> + <arguments> + <argument name="massaction_id_field" xsi:type="string">entity_id</argument> + <argument name="form_field_name" xsi:type="string">shipment_ids</argument> + <argument name="use_select_all" xsi:type="boolean">false</argument> + <argument name="options" xsi:type="array"> + <item name="pdfshipments_order" xsi:type="array"> + <item name="label" xsi:type="string" translate="true">PDF Packing Slips</item> + <item name="url" xsi:type="string">sales/shipment/pdfshipments</item> + </item> + <item name="print_shipping_labels" xsi:type="array"> + <item name="label" xsi:type="string" translate="true">Print Shipping Labels</item> + <item name="url" xsi:type="string">adminhtml/order_shipment/massPrintShippingLabel</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Export" name="sales.shipment.grid.export" as="grid.export"> + <arguments> + <argument name="exportTypes" xsi:type="array"> + <item name="csv" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportCsv</item> + <item name="label" xsi:type="string" translate="true">CSV</item> + </item> + <item name="excel" xsi:type="array"> + <item name="urlPath" xsi:type="string">*/*/exportExcel</item> + <item name="label" xsi:type="string" translate="true">Excel XML</item> + </item> + </argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.shipment.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">sales_shipment_grid</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="generatorClass" xsi:type="string">Magento\Sales\Model\Order\Grid\Row\UrlGenerator</item> + <item name="path" xsi:type="string">sales/shipment/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="shipment_id" xsi:type="string">getId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="real_shipment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Shipment</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">real_shipment_id</argument> + <argument name="header_css_class" xsi:type="string">col-shipment-number</argument> + <argument name="column_css_class" xsi:type="string">col-shipment-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Ship Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">order_increment_id</argument> + <argument name="id" xsi:type="string">order_increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-order-number</argument> + <argument name="column_css_class" xsi:type="string">col-order-number</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="order_created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order Date</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">order_created_at</argument> + <argument name="id" xsi:type="string">order_created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="shipping_name"> + <arguments> + <argument name="id" xsi:type="string">shipping_name</argument> + <argument name="header" xsi:type="string" translate="true">Ship-to Name</argument> + <argument name="index" xsi:type="string">shipping_name</argument> + <argument name="header_css_class" xsi:type="string">col-ship-to-name</argument> + <argument name="column_css_class" xsi:type="string">col-ship-to-name</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="total_qty"> + <arguments> + <argument name="id" xsi:type="string">total_qty</argument> + <argument name="header" xsi:type="string" translate="true">Total Quantity</argument> + <argument name="type" xsi:type="string">number</argument> + <argument name="index" xsi:type="string">total_qty</argument> + <argument name="header_css_class" xsi:type="string">col-qty</argument> + <argument name="column_css_class" xsi:type="string">col-qty</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="action" acl="Magento_Sales::actions_view"> + <arguments> + <argument name="id" xsi:type="string">action</argument> + <argument name="header" xsi:type="string" translate="true">Action</argument> + <argument name="type" xsi:type="string">action</argument> + <argument name="getter" xsi:type="string">getId</argument> + <argument name="filter" xsi:type="boolean">false</argument> + <argument name="sortable" xsi:type="boolean">false</argument> + <argument name="is_system" xsi:type="boolean">true</argument> + <argument name="actions" xsi:type="array"> + <item name="view_action" xsi:type="array"> + <item name="caption" xsi:type="string" translate="true">View</item> + <item name="url" xsi:type="array"> + <item name="base" xsi:type="string">sales/shipment/view</item> + </item> + <item name="field" xsi:type="string">shipment_id</item> + </item> + </argument> + <argument name="header_css_class" xsi:type="string">col-actions</argument> + <argument name="column_css_class" xsi:type="string">col-actions</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml new file mode 100644 index 0000000000000000000000000000000000000000..0df4c515a3a1b872e74db73f8ff481bceed0f04e --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_shipment_index.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_shipment_grid_block"/> + <referenceContainer name="content"> + <block class="Magento\Sales\Block\Adminhtml\Shipment" name="sales_shipment.grid.container"/> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..396cac4a5048cd72242b3809a9bcb7b2e5a77ba2 --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_transactions_grid_block"/> + <referenceBlock name="sales.transactions.grid"> + <arguments> + <argument name="id" xsi:type="string">transactionChildGrid</argument> + <argument name="dataSource" xsi:type="object"> + <updater>Magento\Sales\Model\Grid\Child\CollectionUpdater</updater> + </argument> + <argument name="use_ajax" xsi:type="string">false</argument> + <argument name="pager_visibility" xsi:type="boolean">false</argument> + </arguments> + <referenceBlock name="sales.transactions.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">transactionChildGrid</argument> + <argument name="filter_visibility" xsi:type="boolean">false</argument> + </arguments> + <referenceBlock name="transaction_id"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <referenceBlock name="increment_id"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <referenceBlock name="txn_id"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <remove name="parent_txn_id"/> + <referenceBlock name="method"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <referenceBlock name="txn_type"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <referenceBlock name="is_closed"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + <referenceBlock name="created_at"> + <arguments> + <argument name="sortable" xsi:type="boolean">false</argument> + </arguments> + </referenceBlock> + </referenceBlock> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml index 098fa8808f32f7f25abab45db48cd60e43645561..d99c4225d9a5a7cd2057dfe9a2c799524360369f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid.xml @@ -24,5 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <block class="Magento\Sales\Block\Adminhtml\Transactions\Grid" name="sales_transactions.grid" output="1"/> + <update handle="formkey"/> + <update handle="sales_transactions_grid_block"/> + <block class="Magento\Backend\Block\Widget\Grid\Container" name="sales_transactions.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml" output="1"/> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml new file mode 100644 index 0000000000000000000000000000000000000000..9022296853435b38e52cb86d023440f3fcda48cb --- /dev/null +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_grid_block.xml @@ -0,0 +1,137 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="sales_transactions.grid.container"> + <block class="Magento\Backend\Block\Widget\Grid" name="sales.transactions.grid" as="grid"> + <arguments> + <argument name="id" xsi:type="string">sales_transactions_grid</argument> + <argument name="dataSource" xsi:type="object">Magento\Sales\Model\Resource\Transaction\Grid\Collection</argument> + <argument name="use_ajax" xsi:type="string">true</argument> + <argument name="default_sort" xsi:type="string">created_at</argument> + <argument name="default_dir" xsi:type="string">DESC</argument> + <argument name="save_parameters_in_session" xsi:type="string">1</argument> + <argument name="grid_url" xsi:type="url" path="*/*/grid"> + <param name="_current">1</param> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="sales.transactions.grid.columnSet"> + <arguments> + <argument name="id" xsi:type="string">sales_transactions_grid</argument> + <argument name="rowUrl" xsi:type="array"> + <item name="path" xsi:type="string">sales/*/view</item> + <item name="extraParamsTemplate" xsi:type="array"> + <item name="txn_id" xsi:type="string">getId</item> + </item> + </argument> + </arguments> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="transaction_id" as="transaction_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">ID</argument> + <argument name="type" xsi:type="string">number</argument> + <argument name="index" xsi:type="string">transaction_id</argument> + <argument name="id" xsi:type="string">transaction_id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="increment_id" as="increment_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Order ID</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">increment_id</argument> + <argument name="id" xsi:type="string">increment_id</argument> + <argument name="header_css_class" xsi:type="string">col-order-id</argument> + <argument name="column_css_class" xsi:type="string">col-order-id</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="txn_id" as="txn_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Transaction ID</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">txn_id</argument> + <argument name="id" xsi:type="string">txn_id</argument> + <argument name="header_css_class" xsi:type="string">col-transaction-id</argument> + <argument name="column_css_class" xsi:type="string">col-transaction-id</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="parent_txn_id" as="parent_txn_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Parent Transaction ID</argument> + <argument name="type" xsi:type="string">text</argument> + <argument name="index" xsi:type="string">parent_txn_id</argument> + <argument name="id" xsi:type="string">parent_txn_id</argument> + <argument name="header_css_class" xsi:type="string">col-parent-transaction-id</argument> + <argument name="column_css_class" xsi:type="string">col-parent-transaction-id</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="method" as="method"> + <arguments> + <argument name="id" xsi:type="string">method</argument> + <argument name="header" xsi:type="string" translate="true">Payment Method</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">method</argument> + <argument name="options" xsi:type="options" model="Magento\Payment\Model\Resource\Grid\TypeList"/> + <argument name="option_groups" xsi:type="options" model="Magento\Payment\Model\Resource\Grid\GroupList"/> + <argument name="header_css_class" xsi:type="string">col-method</argument> + <argument name="column_css_class" xsi:type="string">col-method</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="txn_type" as="txn_type"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Transaction Type</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">txn_type</argument> + <argument name="id" xsi:type="string">txn_type</argument> + <argument name="options" xsi:type="options" model="Magento\Sales\Model\Resource\Transaction\Grid\TypeList"/> + <argument name="header_css_class" xsi:type="string">col-transaction-type</argument> + <argument name="column_css_class" xsi:type="string">col-transaction-type</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="is_closed" as="is_closed"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Closed</argument> + <argument name="type" xsi:type="string">options</argument> + <argument name="index" xsi:type="string">is_closed</argument> + <argument name="id" xsi:type="string">is_closed</argument> + <argument name="options" xsi:type="options" model="Magento\Backend\Model\Config\Source\Yesno"/> + <argument name="header_css_class" xsi:type="string">col-closed</argument> + <argument name="column_css_class" xsi:type="string">col-closed</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" name="created_at" as="created_at"> + <arguments> + <argument name="header" xsi:type="string" translate="true">Created</argument> + <argument name="type" xsi:type="string">datetime</argument> + <argument name="index" xsi:type="string">created_at</argument> + <argument name="id" xsi:type="string">created_at</argument> + <argument name="header_css_class" xsi:type="string">col-period</argument> + <argument name="column_css_class" xsi:type="string">col-period</argument> + </arguments> + </block> + </block> + </block> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml index 81d4481d2b682df6fd805a006240d7f16d902d98..40d80741c10b02ff11e0641bd6e69e9995e0c68d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_index.xml @@ -24,6 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_transactions_grid_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Transactions" name="sales_transactions.grid.container"/> </referenceContainer> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml index 7739205514418ab6535871666739ab3a91dfe72c..c72b95f36e85746fb93233afea97efb5ab685cc9 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transactions_view.xml @@ -24,10 +24,11 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="sales_transaction_child_block"/> <referenceContainer name="content"> <block class="Magento\Sales\Block\Adminhtml\Transactions\Detail" name="sales_transactions.detail" template="transactions/detail.phtml"> <block class="Magento\Sales\Block\Adminhtml\Transactions\Detail\Grid" name="sales_transactions.detail.grid" as="detail_grid"/> - <block class="Magento\Sales\Block\Adminhtml\Transactions\Child\Grid" name="sales_transactions.child.grid" as="child_grid"/> + <block class="Magento\Sales\Block\Adminhtml\Transactions" name="sales_transactions.grid.container" as="child_grid"/> </block> </referenceContainer> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/coupons/form.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/coupons/form.phtml index 32f588024b6f2bbfd7f1ae782322eb095a725529..57df6763eefe17051bde986c13e7227d9a0df0ff 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/coupons/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/coupons/form.phtml @@ -34,7 +34,8 @@ <h4><?php echo __('Apply Coupon Code') ?></h4> <fieldset> <div class="content"> - <p><input type="text" class="input-text" id="coupons:code" value="" name="coupon_code" style="width:200px" /> <?php echo $this->getButtonHtml(__('Apply'), 'order.applyCoupon($F(\'coupons:code\'))') ?></p> + <input type="text" class="input-text" id="coupons:code" value="" name="coupon_code" /> + <?php echo $this->getButtonHtml(__('Apply'), 'order.applyCoupon($F(\'coupons:code\'))') ?> <?php if($this->getCouponCode()): ?> <p><strong><?php echo $this->escapeHtml($this->getCouponCode()) ?></strong> [<a href="#" onclick="order.applyCoupon(''); return false;" title="<?php echo __('Remove Coupon Code') ?>"><?php echo __('Remove') ?></a>]</p> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/data.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/data.phtml index 7817f19814d04a15e4dc250109f4a94c6f0e566b..917f384f25c2c5706a18e106d31fec6af8348f2d 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/data.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/data.phtml @@ -24,22 +24,23 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="store-switcher"> - <label for="currency_switcher"><?php echo __('Order Currency:') ?></label> - <select id="currency_switcher" name="order[currency]" onchange="order.setCurrencyId(this.value); order.setCurrencySymbol(this.options[this.selectedIndex].getAttribute('symbol'));"> - <?php foreach ($this->getAvailableCurrencies() as $_code): ?> - <option value="<?php echo $_code ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?> symbol="<?php echo $this->getCurrencySymbol($_code) ?>"> - <?php echo $this->getCurrencyName($_code) ?> - </option> - <?php endforeach; ?> - </select> -</div> - <div class="page-create-order"> <script type="text/javascript">order.setCurrencySymbol('<?php echo $this->getCurrencySymbol($this->getCurrentCurrencyCode()) ?>')</script> <?php if($this->getCustomerId()): ?> - <div class="customer-current-activity" id="order-sidebar"> - <?php echo $this->getChildHtml('sidebar') ?> + <div class="order-sidebar"> + <div class="store-switcher order-currency"> + <label for="currency_switcher"><?php echo __('Order Currency:') ?></label> + <select id="currency_switcher" name="order[currency]" onchange="order.setCurrencyId(this.value); order.setCurrencySymbol(this.options[this.selectedIndex].getAttribute('symbol'));"> + <?php foreach ($this->getAvailableCurrencies() as $_code): ?> + <option value="<?php echo $_code ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?> symbol="<?php echo $this->getCurrencySymbol($_code) ?>"> + <?php echo $this->getCurrencyName($_code) ?> + </option> + <?php endforeach; ?> + </select> + </div> + <div class="customer-current-activity" id="order-sidebar"> + <?php echo $this->getChildHtml('sidebar') ?> + </div> </div> <?php endif; ?> <div class="order-details<?php if($this->getCustomerId()): ?> order-details-existing-customer<?php endif; ?>"> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/items/grid.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/items/grid.phtml index 86869a3feb75d02a06a4bdf0851c22491a186604..4121982049fe5a76d9bad013d715ecb4133341e8 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/items/grid.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/items/grid.phtml @@ -33,69 +33,53 @@ <?php $_items = $this->getItems() ?> <?php if (empty($_items)): ?> <div class="grid" id="order-items_grid"> - <table cellspacing="0" class="data order-tables"> - <col /> - <col width="100" /> - <col width="40" /> - <col width="100" /> - <col width="80" /> - <col width="100" /> - <col width="80" /> + <table cellspacing="0" class="data-table order-tables"> <thead> <tr class="headings"> - <th class="no-link"><span><?php echo __('Product') ?></span></th> - <th class="no-link"><span><?php echo __('Price') ?></span></th> - <th class="no-link"><span><?php echo __('Qty') ?></span></th> - <th class="no-link"><span><?php echo __('Subtotal') ?></span></th> - <th class="no-link"><span><?php echo __('Discount') ?></span></th> - <th class="no-link"><span><?php echo __('Row Subtotal') ?></span></th> - - <th class="no-link last"><span><?php echo __('Action') ?></span></th> + <th class="col-product"><span><?php echo __('Product') ?></span></th> + <th class="col-price"><span><?php echo __('Price') ?></span></th> + <th class="col-qty"><span><?php echo __('Qty') ?></span></th> + <th class="col-subtotal"><span><?php echo __('Subtotal') ?></span></th> + <th class="col-discount"><span><?php echo __('Discount') ?></span></th> + <th class="col-row-total"><span><?php echo __('Row Subtotal') ?></span></th> + <th class="col-action"><span><?php echo __('Action') ?></span></th> </tr> </thead> <tbody> <tr class="even"> - <td class="empty-text a-center" colspan="100"><?php echo __('No ordered items') ?></td> + <td class="empty-text" colspan="100"><?php echo __('No ordered items') ?></td> </tr> </tbody> </table> </div> <?php else: ?> -<div> + +<div class="grid" id="order-items_grid"> + <div class="hor-scroll"> <?php if(count($_items)>10): ?> - <p class="a-right"> - <?php echo $this->getButtonHtml(__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?> - </p> + <div class="actions update"> + <?php echo $this->getButtonHtml(__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?> + </div> <?php endif; ?> - <div class="grid" id="order-items_grid"> - <table cellspacing="0" class="data order-tables"> - <col /> - <col width="100" /> - <col width="100" /> - <col width="40" /> - <col width="100" /> - <col width="80" /> - <col width="100" /> - <col width="80" /> + <table cellspacing="0" class="data-table order-tables"> <thead> <tr class="headings"> - <th class="no-link" colspan="2"><span><?php echo __('Product') ?></span></th> - <th class="no-link"><span><?php echo __('Price') ?></span></th> - <th class="no-link"><span><?php echo __('Qty') ?></span></th> - <th class="no-link"><span><?php echo __('Subtotal') ?></span></th> - <th class="no-link"><span><?php echo __('Discount') ?></span></th> - <th class="no-link"><span><?php echo __('Row Subtotal') ?></span></th> - - <th class="no-link last"><span><?php echo __('Action') ?></span></th> + <th class="col-product" colspan="2"><span><?php echo __('Product') ?></span></th> + <th class="col-price"><span><?php echo __('Price') ?></span></th> + <th class="col-qty"><span><?php echo __('Qty') ?></span></th> + <th class="col-subtotal"><span><?php echo __('Subtotal') ?></span></th> + <th class="col-discount"><span><?php echo __('Discount') ?></span></th> + <th class="col-row-total"><span><?php echo __('Row Subtotal') ?></span></th> + <th class="col-action"><span><?php echo __('Action') ?></span></th> </tr> </thead> <tfoot> <tr> - <td class="a-left" colspan="2"><?php echo __('Total %1 product(s)', count($_items)) ?></td> - <td colspan="2" class="a-right"><?php echo __('Subtotal:') ?></td> - <td class="price"><strong><?php echo $this->formatPrice($this->getSubtotal()) ?></strong></td> - <td class="price"><strong><?php echo $this->formatPrice($this->getDiscountAmount()) ?></strong></td> - <td class="price"><strong> + <td class="col-total" colspan="2"><?php echo __('Total %1 product(s)', count($_items)) ?></td> + <td colspan="2" class="col-subtotal"><?php echo __('Subtotal:') ?></td> + <td class="col-price"><strong><?php echo $this->formatPrice($this->getSubtotal()) ?></strong></td> + <td class="col-price"><strong><?php echo $this->formatPrice($this->getDiscountAmount()) ?></strong></td> + <td class="col-price"><strong> <?php echo $this->formatPrice($this->getSubtotal() + $this->getDiscountAmount()); ?></strong></td> @@ -106,7 +90,7 @@ <?php foreach ($_items as $_item):$i++ ?> <tbody class="<?php echo ($i%2)?'even':'odd' ?>"> <tr> - <td> + <td class="col-product"> <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->escapeHtml($_item->getName()) ?></span> <div> <strong><?php echo __('SKU') ?>:</strong> @@ -115,24 +99,21 @@ <?php if($_item->getMessage(false)): ?> <?php foreach ($_item->getMessage(false) as $message): ?> <div class="<?php if($_item->getHasError()): ?>error<?php else: ?>notice<?php endif; ?>"> - <div style="font-size:95%"><?php echo $this->escapeHtml($message); ?></div> + <?php echo $this->escapeHtml($message); ?> </div> <?php endforeach; ?> <?php endif; ?> </td> - <td class="a-center v-middle"> + <td class="col-configure"> <?php echo $this->getConfigureButtonHtml($_item) ?> </td> - <td class="price"> - - - + <td class="col-price"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax($this->getStore()) || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->formatPrice($_item->getCalculationPrice()) ?> @@ -141,17 +122,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br /> @@ -159,7 +140,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> <?php endif; ?> @@ -172,24 +153,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br /> @@ -197,15 +178,12 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> <?php endif; ?> <?php endif; ?> - - - <?php $_isCustomPrice = $this->usedCustomPriceForItem($_item) ?> <?php if($_tier = $this->getTierHtml($_item)): ?> <div id="item_tier_block_<?php echo $_item->getId() ?>"<?php if ($_isCustomPrice): ?> style="display:none"<?php endif; ?>> @@ -221,17 +199,13 @@ <?php endif; ?> <input id="item_custom_price_<?php echo $_item->getId() ?>" name="item[<?php echo $_item->getId() ?>][custom_price]" value="<?php echo sprintf("%.2f", $this->getOriginalEditablePrice($_item))?>"<?php if (!$_isCustomPrice): ?> style="display:none" disabled="disabled"<?php endif; ?> class="input-text item-price"/> </td> - <td><input name="item[<?php echo $_item->getId() ?>][qty]" class="input-text item-qty" value="<?php echo $_item->getQty()*1 ?>" maxlength="12" /></td> - <td class="price"> - - - - + <td class="col-qty"><input name="item[<?php echo $_item->getId() ?>][qty]" class="input-text item-qty" value="<?php echo $_item->getQty()*1 ?>" maxlength="12" /></td> + <td class="col-subtotal col-price"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax($this->getStore()) || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->formatPrice($_item->getRowTotal()) ?> @@ -240,17 +214,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -258,37 +232,36 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax($this->getStore()) || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -296,29 +269,26 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> <?php endif; ?> - - </td> - <td class="price"> + <td class="col-discount col-price"> <?php echo $this->formatPrice(-$_item->getDiscountAmount()) ?><br /> <input id="item_use_discount_<?php echo $_item->getId() ?>" name="item[<?php echo $_item->getId() ?>][use_discount]"<?php if (!$_item->getNoDiscount()): ?>checked="checked"<?php endif; ?> value="1" type="checkbox" /> <label for="item_use_discount_<?php echo $_item->getId() ?>" class="normal"><?php echo __('Apply') ?></label> </td> - <td class="price"> - + <td class="col-price col-row-subtotal"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax($this->getStore()) || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <?php $_rowTotalWithoutDiscount = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount() - $_item->getTaxAmount(); ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices($this->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition())); ?> <?php else: ?> <?php echo $this->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?> @@ -327,17 +297,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -345,7 +315,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -358,24 +328,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $_item->getPriceInclTax() * $_item->getQty() - $_item->getDiscountAmount(); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -383,14 +353,14 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> <?php endif; ?> </td> - <td class="last"> + <td class="col-actions last"> <select name="item[<?php echo $_item->getId() ?>][action]" style="width:100px;"> <option value=""></option> <option value="remove"><?php echo __('Remove') ?></option> @@ -416,11 +386,10 @@ </tbody> <?php endforeach; ?> </table> + <p><small><?php echo $this->getInclExclTaxMessage(); ?></small></p> + <p><?php echo $this->getButtonHtml(__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?></p> </div> - <p><small><?php echo $this->getInclExclTaxMessage(); ?></small></p> - <p><?php echo $this->getButtonHtml(__('Update Items and Qty\'s'),'order.itemsUpdate()'); ?></p> <div class="order-coupons" id="order-coupons"><?php echo $this->getChildHtml();?></div> - <div class="clearfix"></div> <script type="text/javascript">order.itemsOnchangeBind()</script> </div> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/sidebar.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/sidebar.phtml index f8faf4d03fd0a7b39751bb16e826a2103b32b541..56c7f5bd3f08b0c53a77ab6a395734f1ee1ac928 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/sidebar.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/sidebar.phtml @@ -27,7 +27,7 @@ /** @var $this \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar */ ?> <div class="customer-current-activity-inner"> - <h4><?php echo __('Customer\'s Current Activities') ?></h4> + <h4><?php echo __('Customer\'s Activities') ?></h4> <div class="create-order-sidebar-container"> <?php echo $this->getChildHtml('top_button'); ?> <?php foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $_alias => $_child): ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/sidebar/items.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/sidebar/items.phtml index 6e6d2171acf220cdd64372665116bb020e83a619..6fc34bb6791390c8be594493b3610f2fd4c19594 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/sidebar/items.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/sidebar/items.phtml @@ -93,7 +93,7 @@ </tbody> </table> <?php else: ?> - <?php echo __('No items') ?> + <span class="no-items"><?php echo __('No items') ?></span> <?php endif ?> </div> <?php if ($this->getItemCount() && $this->canRemoveItems()): ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals.phtml index 2104a5c06dbd342668b82f2ecb2d22e84ad4cf7f..32a5a6f1d105aa2c1b5c4e5d08b590a2bcb77284 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/totals.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals.phtml @@ -33,17 +33,17 @@ </table> <div class="divider"></div> <div class="order-totals-bottom"> - <p> - <label for="notify_customer" class="normal"><?php echo __('Append Comments') ?></label> + <div class="field choice field-append-comments"> <input type="checkbox" id="notify_customer" name="order[comment][customer_note_notify]" value="1" <?php if($this->getNoteNotify()): ?>checked="true"<?php endif; ?>/> - </p> + <label for="notify_customer" class="normal"><?php echo __('Append Comments') ?></label> + </div> <?php if ($this->canSendNewOrderConfirmationEmail()): ?> - <p> - <label for="send_confirmation" class="normal"><?php echo __('Email Order Confirmation') ?></label> + <div class="field choice field-email-order-confirmation"> <input type="checkbox" id="send_confirmation" name="order[send_confirmation]" value="1" checked="checked"/> - </p> + <label for="send_confirmation" class="normal"><?php echo __('Email Order Confirmation') ?></label> + </div> <?php endif; ?> - <p><?php echo $this->getButtonHtml(__('Submit Order'),'order.submit()' ,'save'); ?></p> + <div class="actions"><?php echo $this->getButtonHtml(__('Submit Order'),'order.submit()' ,'save primary'); ?></div> </div> <script type="text/javascript"> diff --git a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items.phtml b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items.phtml index 784a7669f9b53621d11999f910ed4d8fc3098cd4..e7a4fc890d9ced5a12512a74dcb207d98b09c6d0 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items.phtml @@ -100,14 +100,14 @@ <div class="fieldset-wrapper-title"><span class="title"><?php echo __('Refund Totals') ?></span></div> <?php echo $this->getChildHtml('creditmemo_totals') ?> <div class="order-totals-bottom"> - <div> - <label class="normal" for="notify_customer"><?php echo __('Append Comments') ?></label> + <div class="field choice field-append-comments"> <input id="notify_customer" name="creditmemo[comment_customer_notify]" value="1" type="checkbox" /> + <label for="notify_customer"><span><?php echo __('Append Comments') ?></span></label> </div> <?php if ($this->canSendCreditmemoEmail()):?> - <div> - <label class="normal" for="send_email"><?php echo __('Email Copy of Credit Memo') ?></label> + <div class="field choice field-email-copy"> <input id="send_email" name="creditmemo[send_email]" value="1" type="checkbox" /> + <label for="send_email"><span><?php echo __('Email Copy of Credit Memo') ?></span></label> </div> <?php endif; ?> <?php echo $this->getChildHtml('submit_before') ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items/renderer/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items/renderer/default.phtml index e837c51df2714b1a9bc8562aeef8b16bf76bb523..e47537f4ad91bf24a85d714e4d64651034281dde 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/create/items/renderer/default.phtml @@ -35,7 +35,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -49,17 +49,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -67,7 +67,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -90,7 +90,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -98,17 +98,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -116,7 +116,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -146,7 +146,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -159,17 +159,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -177,7 +177,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -199,7 +199,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -209,17 +209,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -227,7 +227,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/view/items/renderer/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/view/items/renderer/default.phtml index 07271cd33738c571c45f6026d0afd9b90c733921..0f55621ff7a730931bde764856828bc42f94a30b 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/creditmemo/view/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/creditmemo/view/items/renderer/default.phtml @@ -36,7 +36,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -50,17 +50,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -68,7 +68,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -91,7 +91,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -99,17 +99,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -117,7 +117,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -134,7 +134,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -147,17 +147,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -165,7 +165,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -187,7 +187,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -197,17 +197,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -215,7 +215,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items.phtml b/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items.phtml index 925d811bc5dd918641ee1da4dcb65b9bf74853c6..53838aeddb0e2828645e5ff0fe787c038a58ac3e 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items.phtml @@ -91,7 +91,7 @@ <div class="fieldset-wrapper-title"> <span class="title"><?php echo __('Invoice Totals') ?></span> </div> - <div> + <div class="order-totals-bottom"> <?php echo $this->getChildHtml('invoice_totals') ?> <?php if ($this->isCaptureAllowed()): ?> <?php if ($this->canCapture()):?> @@ -112,12 +112,12 @@ <div><?php echo __('The invoice will be created offline without the payment gateway.') ?></div> <?php endif?> <?php endif; ?> - <div> + <div class="field choice field-append"> <input id="notify_customer" name="invoice[comment_customer_notify]" value="1" type="checkbox" /> <label class="normal" for="notify_customer"><?php echo __('Append Comments') ?></label> </div> <?php if ($this->canSendInvoiceEmail()): ?> - <div> + <div class="field choice field-email"> <input id="send_email" name="invoice[send_email]" value="1" type="checkbox" /> <label class="normal" for="send_email"><?php echo __('Email Copy of Invoice') ?></label> </div> diff --git a/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items/renderer/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items/renderer/default.phtml index 687c566ec442d97145ac96348cdad960ce111f8e..56e98fc9b35c1222013f2b67bc61ad00ffaf2d3b 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/invoice/create/items/renderer/default.phtml @@ -34,7 +34,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -47,17 +47,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -65,7 +65,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -88,7 +88,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -96,17 +96,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -114,7 +114,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -137,7 +137,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -149,17 +149,17 @@ <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?> @@ -167,7 +167,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <?php echo __('Total'); ?>:<br /> <?php @@ -188,31 +188,31 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?> <?php endforeach; ?> </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/items/renderer/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/items/renderer/default.phtml index 1b737f1d039274db12cdd92936d2ae40eabdfa40..f0b9838bfc0b40aa240beb735246bac1f9fe8838 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/items/renderer/default.phtml @@ -36,7 +36,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -49,17 +49,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -67,7 +67,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -90,7 +90,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -98,17 +98,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales')): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -116,7 +116,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -132,7 +132,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -144,17 +144,17 @@ <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -162,7 +162,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -184,7 +184,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -193,17 +193,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -211,7 +211,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/items.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/items.phtml index 5bd40c038c60f378f0b41cd83f08bba1fc9d49ae..65befb57d71693e6a9b413e6f729860846b7a2f9 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/view/items.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/view/items.phtml @@ -27,7 +27,7 @@ <?php $_order = $this->getOrder() ?> <div class="grid"> <div class="hor-scroll"> - <table cellspacing="0" class="data"> + <table cellspacing="0" class="data-table"> <thead> <tr class="headings"> <th class="col-product"><span><?php echo __('Product') ?></span></th> diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/items/renderer/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/items/renderer/default.phtml index abe363990a2f651141754136e9b7316996b174f9..e24ad752d4ad794951f862ff77e6276cf2c22d61 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/view/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/view/items/renderer/default.phtml @@ -45,7 +45,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(), @@ -58,17 +58,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -76,7 +76,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -98,7 +98,7 @@ <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?> @@ -106,17 +106,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span> @@ -124,7 +124,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedAmount(), $_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> <?php endif; ?> @@ -141,7 +141,7 @@ <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices( $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmnt()+$_item->getBaseWeeeTaxRowDisposition(), @@ -154,17 +154,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -172,7 +172,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php @@ -193,7 +193,7 @@ <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> <?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales', $_item->getStoreId())): ?> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?> @@ -203,17 +203,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales', $_item->getStoreId())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span> @@ -221,7 +221,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales', $_item->getStoreId())): ?> <br /><span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/frontend/email/items/creditmemo/default.phtml b/app/code/Magento/Sales/view/frontend/email/items/creditmemo/default.phtml index 40f14112dd9011a1b8fdb9f19ab17821f8a17d69..40ae319306dc3051f954913ba08296626a413324 100644 --- a/app/code/Magento/Sales/view/frontend/email/items/creditmemo/default.phtml +++ b/app/code/Magento/Sales/view/frontend/email/items/creditmemo/default.phtml @@ -50,7 +50,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -59,17 +59,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -77,7 +77,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -90,24 +90,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -115,7 +115,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/frontend/email/items/invoice/default.phtml b/app/code/Magento/Sales/view/frontend/email/items/invoice/default.phtml index 40f14112dd9011a1b8fdb9f19ab17821f8a17d69..40ae319306dc3051f954913ba08296626a413324 100644 --- a/app/code/Magento/Sales/view/frontend/email/items/invoice/default.phtml +++ b/app/code/Magento/Sales/view/frontend/email/items/invoice/default.phtml @@ -50,7 +50,7 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -59,17 +59,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -77,7 +77,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -90,24 +90,24 @@ <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -115,7 +115,7 @@ </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/frontend/email/items/order/default.phtml b/app/code/Magento/Sales/view/frontend/email/items/order/default.phtml index 2726b5cb92774b074a69ba6a26df2804fb3e1bbd..5c0e14f5f1bde2267a71cc2f0bbbac3ea9db72da 100644 --- a/app/code/Magento/Sales/view/frontend/email/items/order/default.phtml +++ b/app/code/Magento/Sales/view/frontend/email/items/order/default.phtml @@ -56,7 +56,7 @@ $_order = $_item->getOrder(); <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices($_order->getStore())): ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $_order->formatPrice($_item->getRowTotal()) ?> @@ -65,17 +65,17 @@ $_order = $_item->getOrder(); <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -83,7 +83,7 @@ $_order = $_item->getOrder(); </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <br /> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> <?php endif; ?> @@ -96,24 +96,24 @@ $_order = $_item->getOrder(); <br /><span class="label"><?php echo __('Incl. Tax'); ?>:</span> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'email', $_order->getStore())): ?> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> <?php endif; ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> <br /> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br /> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br /> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'email', $_order->getStore())): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br /> @@ -121,7 +121,7 @@ $_order = $_item->getOrder(); </small> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'email', $_order->getStore())): ?> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml b/app/code/Magento/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml index c4b56ef046d173b1cc6d2597988b7027c2e2359f..b3878485a33574cea51ce275883d61477c5c14bb 100644 --- a/app/code/Magento/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml @@ -35,9 +35,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -79,21 +80,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -103,17 +104,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -122,7 +123,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span> </span> @@ -134,22 +135,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -159,17 +160,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -178,7 +179,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span> </span> @@ -192,21 +193,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -216,17 +217,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -235,7 +236,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span> </span> @@ -247,21 +248,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -271,17 +272,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -290,7 +291,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span> </span> diff --git a/app/code/Magento/Sales/view/frontend/order/history.phtml b/app/code/Magento/Sales/view/frontend/order/history.phtml index 39bc9134c8ef9457944591e6d985d4fc19c9e3f8..b89ff4bcbce5c42e24995bff850fefda048c8b68 100644 --- a/app/code/Magento/Sales/view/frontend/order/history.phtml +++ b/app/code/Magento/Sales/view/frontend/order/history.phtml @@ -25,45 +25,45 @@ ?> <?php $_orders = $this->getOrders(); ?> <?php echo $this->getChildHtml('info');?> -<div class="order products toolbar"><?php echo $this->getPagerHtml(); ?></div> <?php if($_orders->getSize()): ?> -<div class="wrapper table orders history"> - <table class="data table orders history" id="my-orders-table"> - <caption class="table caption"><?php echo __('Orders') ?></caption> - <thead> - <tr> - <th class="col id"><?php echo __('Order #') ?></th> - <th class="col date"><?php echo __('Date') ?></th> - <th class="col shipping"><?php echo __('Ship To') ?></th> - <th class="col total"><?php echo __('Order Total') ?></th> - <th class="col status"><?php echo __('Status') ?></th> - <th class="col actions"> </th> - </tr> - </thead> - <tbody> - <?php foreach ($_orders as $_order): ?> + <div class="order products toolbar"><?php echo $this->getPagerHtml(); ?></div> + <div class="wrapper table orders history"> + <table class="data table orders history" id="my-orders-table"> + <caption class="table caption"><?php echo __('Orders') ?></caption> + <thead> <tr> - <td class="col id"><?php echo $_order->getRealOrderId() ?></td> - <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td> - <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : ' ' ?></td> - <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td> - <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td> - <td class="col actions"> - <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view"> - <span><?php echo __('View Order') ?></span> - </a> - <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?> - <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order"> - <span><?php echo __('Reorder') ?></span> - </a> - <?php endif ?> - </td> + <th class="col id"><?php echo __('Order #') ?></th> + <th class="col date"><?php echo __('Date') ?></th> + <th class="col shipping"><?php echo __('Ship To') ?></th> + <th class="col total"><?php echo __('Order Total') ?></th> + <th class="col status"><?php echo __('Status') ?></th> + <th class="col actions"> </th> </tr> - <?php endforeach; ?> - </tbody> - </table> -</div> -<div class="order products toolbar bottom"><?php echo $this->getPagerHtml(); ?></div> + </thead> + <tbody> + <?php foreach ($_orders as $_order): ?> + <tr> + <td class="col id"><?php echo $_order->getRealOrderId() ?></td> + <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td> + <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : ' ' ?></td> + <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td> + <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td> + <td class="col actions"> + <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view"> + <span><?php echo __('View Order') ?></span> + </a> + <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?> + <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order"> + <span><?php echo __('Reorder') ?></span> + </a> + <?php endif ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + </div> + <div class="order products toolbar bottom"><?php echo $this->getPagerHtml(); ?></div> <?php else: ?> <div class="message info empty"><span><?php echo __('You have placed no orders.'); ?></span></div> <?php endif ?> diff --git a/app/code/Magento/Sales/view/frontend/order/invoice/items/renderer/default.phtml b/app/code/Magento/Sales/view/frontend/order/invoice/items/renderer/default.phtml index 2191919489ed9b2cf4437ba1d8839d625c3aa7ad..294ec40fe62d343ee082edbe8899b5d02890ee07 100644 --- a/app/code/Magento/Sales/view/frontend/order/invoice/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/frontend/order/invoice/items/renderer/default.phtml @@ -34,10 +34,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -70,21 +70,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -95,17 +95,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -114,7 +114,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span> </span> @@ -126,22 +126,22 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -152,17 +152,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -171,7 +171,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span> </span> @@ -187,21 +187,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -212,17 +212,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -231,7 +231,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span> </span> @@ -243,21 +243,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -268,17 +268,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -287,7 +287,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span> </span> diff --git a/app/code/Magento/Sales/view/frontend/order/items/renderer/default.phtml b/app/code/Magento/Sales/view/frontend/order/items/renderer/default.phtml index 0fa187bece7056cb55d957d9b680f67f260ac19e..b1ee8562c07e29525078978748bffb172d541932 100644 --- a/app/code/Magento/Sales/view/frontend/order/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/frontend/order/items/renderer/default.phtml @@ -33,10 +33,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> @@ -72,21 +72,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?> @@ -96,17 +96,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -115,7 +115,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span> </span> @@ -126,21 +126,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?> @@ -150,17 +150,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span> @@ -169,7 +169,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"}' <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span> </span> @@ -198,20 +198,20 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?> <span class="price-excl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Excl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?> @@ -221,17 +221,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -240,7 +240,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span> </span> @@ -252,21 +252,21 @@ <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?> <span class="price-incl-tax"> <?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-price"> <?php endif; ?> <span class="label"><?php echo __('Incl. Tax'); ?>:</span> - <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if (!$this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> </span> <?php endif; ?> <?php endif; ?> <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($this->getItem()); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <?php else: ?> <span class="cart-price"> <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?> <?php else: ?> <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?> @@ -276,17 +276,17 @@ <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem())): ?> <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span> <?php endforeach; ?> </small> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span> <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <small> <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($this->getItem()) as $tax): ?> <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span> @@ -295,7 +295,7 @@ <?php endif; ?> </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?> <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"}'> <span class="nobr"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span> </span> diff --git a/app/code/Magento/Sales/view/frontend/order/shipment/items/renderer/default.phtml b/app/code/Magento/Sales/view/frontend/order/shipment/items/renderer/default.phtml index 50275ae3c816f109f8a75466679fe18c42acf7ca..8ba627b8a542ddb28fb048fb42104fd7eca26543 100644 --- a/app/code/Magento/Sales/view/frontend/order/shipment/items/renderer/default.phtml +++ b/app/code/Magento/Sales/view/frontend/order/shipment/items/renderer/default.phtml @@ -34,10 +34,10 @@ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <?php if (!$this->getPrintStatus()): ?> <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated" data-mage-init='{"truncateOptions":[]}'<?php endif; ?>> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip box"<?php endif; ?>> <?php echo $_formatedOptionValue['value'] ?> <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="truncated_full_value"> + <div class="tooltip content"> <dl class="item options"> <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php index 6e9b76239cd407b33b4b4412d9520243e7fb7f81..90daec60ae42d67e95afc722c0eed8737495b986 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php @@ -35,7 +35,7 @@ class Quote extends \Magento\Backend\App\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -47,13 +47,13 @@ class Quote extends \Magento\Backend\App\Action /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Stdlib\DateTime\Filter\Date $dateFilter */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Stdlib\DateTime\Filter\Date $dateFilter ) { parent::__construct($context); @@ -381,7 +381,7 @@ class Quote extends \Magento\Backend\App\Action /** * Export coupon codes as excel xml file * - * @return \Magento\App\ResponseInterface|null + * @return \Magento\Framework\App\ResponseInterface|null */ public function exportCouponsXmlAction() { @@ -394,7 +394,7 @@ class Quote extends \Magento\Backend\App\Action )->getExcelFile( $fileName ); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } else { $this->_redirect('sales_rule/*/detail', array('_current' => true)); return; @@ -404,7 +404,7 @@ class Quote extends \Magento\Backend\App\Action /** * Export coupon codes as CSV file * - * @return \Magento\App\ResponseInterface|null + * @return \Magento\Framework\App\ResponseInterface|null */ public function exportCouponsCsvAction() { @@ -415,7 +415,7 @@ class Quote extends \Magento\Backend\App\Action $content = $this->_view->getLayout()->createBlock( 'Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid' )->getCsvFile(); - return $this->_fileFactory->create($fileName, $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR); } else { $this->_redirect('sales_rule/*/detail', array('_current' => true)); return; diff --git a/app/code/Magento/SalesRule/Helper/Coupon.php b/app/code/Magento/SalesRule/Helper/Coupon.php index 1c844342ce308071c88e1ac2106a25ae42d39ba8..13754bd969cb6561198bdf076098ff9033e3d711 100644 --- a/app/code/Magento/SalesRule/Helper/Coupon.php +++ b/app/code/Magento/SalesRule/Helper/Coupon.php @@ -32,7 +32,7 @@ namespace Magento\SalesRule\Helper; * @package Magento_SalesRule * @author Magento Core Team <core@magentocommerce.com> */ -class Coupon extends \Magento\App\Helper\AbstractHelper +class Coupon extends \Magento\Framework\App\Helper\AbstractHelper { /** * Constants which defines all possible coupon codes formats @@ -69,18 +69,18 @@ class Coupon extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $couponParameters */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $couponParameters ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/SalesRule/Helper/Data.php b/app/code/Magento/SalesRule/Helper/Data.php index e51e46a6241efbcf97b36edd375d88a5756296bc..128e5b44c946cf44baded639f16ca8a00ceddda2 100644 --- a/app/code/Magento/SalesRule/Helper/Data.php +++ b/app/code/Magento/SalesRule/Helper/Data.php @@ -30,7 +30,7 @@ use Magento\Sales\Model\Quote\Item\AbstractItem; /** * SalesRule data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Set store and base price which will be used during discount calculation to item object diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index 87dccde19f0446a20e3e84bc9f43b136d105c880..2b0f9f4f99d364073e634ffe382ebd44d1524c9e 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -45,7 +45,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedatFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -55,7 +55,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Rule.php index 8e72386f73b6f11469d36b5cdc5128d4653a175d..e52febd36380bbe88d119776a9f0dde0166e3d1f 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule.php @@ -63,12 +63,12 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource protected $_resourceCoupon; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\String $string * @param \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Stdlib\String $string, \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon ) { diff --git a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml index a36dde34fc9f2a9cf4663891b3a1f4773e984a0b..16316ebebf3540c0a6d57f3ac43ca9bc5094b80e 100644 --- a/app/code/Magento/SalesRule/etc/adminhtml/routes.xml +++ b/app/code/Magento/SalesRule/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="sales_rule" frontName="sales_rule"> <module name="Magento_SalesRule" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml index 8558bfb5f36274e57b6475cca89f562f2af540f8..f1ecb3c7649f26c73de30832666e474d10e32f43 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml @@ -46,50 +46,45 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="rule_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">50px</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="index" xsi:type="string">rule_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="name"> <arguments> <argument name="header" xsi:type="string" translate="true">Rule</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="coupon_code"> <arguments> <argument name="header" xsi:type="string" translate="true">Coupon Code</argument> - <argument name="width" xsi:type="string">150px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">code</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="from_date"> <arguments> <argument name="header" xsi:type="string" translate="true">Start on</argument> - <argument name="width" xsi:type="string">120px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="type" xsi:type="string">date</argument> <argument name="index" xsi:type="string">from_date</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="to_date"> <arguments> <argument name="header" xsi:type="string" translate="true">End on</argument> - <argument name="width" xsi:type="string">120px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="type" xsi:type="string">date</argument> <argument name="default" xsi:type="string">--</argument> <argument name="index" xsi:type="string">to_date</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="is_active"> <arguments> <argument name="header" xsi:type="string" translate="true">Status</argument> - <argument name="width" xsi:type="string">80px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">is_active</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="array"> @@ -107,8 +102,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="rule_website"> <arguments> <argument name="header" xsi:type="string" translate="true">Web Site</argument> - <argument name="width" xsi:type="string">200</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">website_ids</argument> <argument name="type" xsi:type="string">options</argument> <argument name="sortable" xsi:type="string">0</argument> @@ -118,8 +111,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="sort_order"> <arguments> <argument name="header" xsi:type="string" translate="true">Priority</argument> - <argument name="width" xsi:type="string">100</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="index" xsi:type="string">sort_order</argument> </arguments> </block> diff --git a/app/code/Magento/Sendfriend/Block/Send.php b/app/code/Magento/Sendfriend/Block/Send.php index f2a3d00685ccf625fe32eeac61bc1ba8aac9d2f4..8a61fe7b2709aa547c915dfaf096a7c7a33ad18e 100644 --- a/app/code/Magento/Sendfriend/Block/Send.php +++ b/app/code/Magento/Sendfriend/Block/Send.php @@ -54,7 +54,7 @@ class Send extends \Magento\View\Element\Template protected $_customerSession; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -63,7 +63,7 @@ class Send extends \Magento\View\Element\Template * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sendfriend\Helper\Data $sendfriendData * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( @@ -71,7 +71,7 @@ class Send extends \Magento\View\Element\Template \Magento\Customer\Model\Session $customerSession, \Magento\Sendfriend\Helper\Data $sendfriendData, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->_customerSession = $customerSession; diff --git a/app/code/Magento/Sendfriend/Controller/Product.php b/app/code/Magento/Sendfriend/Controller/Product.php index 10e2e5c4f6698c04e6a4c189e6503738dcbe224b..680e184572d05a2c117c353266080b2b64bf1bed 100644 --- a/app/code/Magento/Sendfriend/Controller/Product.php +++ b/app/code/Magento/Sendfriend/Controller/Product.php @@ -25,8 +25,8 @@ */ namespace Magento\Sendfriend\Controller; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; /** * Email to a Friend Product Controller @@ -35,7 +35,7 @@ use Magento\App\RequestInterface; * @package Magento_Sedfriend * @author Magento Core Team <core@magentocommerce.com> */ -class Product extends \Magento\App\Action\Action +class Product extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -50,12 +50,12 @@ class Product extends \Magento\App\Action\Action protected $_formKeyValidator; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator ) { @@ -69,8 +69,8 @@ class Product extends \Magento\App\Action\Action * If allow only for customer - redirect to login page * * @param RequestInterface $request - * @return \Magento\App\ResponseInterface - * @throws \Magento\App\Action\NotFoundException + * @return \Magento\Framework\App\ResponseInterface + * @throws \Magento\Framework\App\Action\NotFoundException */ public function dispatch(RequestInterface $request) { diff --git a/app/code/Magento/Sendfriend/Helper/Data.php b/app/code/Magento/Sendfriend/Helper/Data.php index df62c0ba12f033077e7b7d4461f508fefab02734..c498b01f636cf24b3810450694eb6ee9ce1368db 100644 --- a/app/code/Magento/Sendfriend/Helper/Data.php +++ b/app/code/Magento/Sendfriend/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\Sendfriend\Helper; * @package Magento_Sendfriend * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const XML_PATH_ENABLED = 'sendfriend/email/enabled'; @@ -55,17 +55,17 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/Sendfriend/etc/frontend/routes.xml b/app/code/Magento/Sendfriend/etc/frontend/routes.xml index 647a29ee6ee44c3c526198f31c4987afd39aa17f..d594e827d7b77501dc52911dccc64cddccf0bd72 100644 --- a/app/code/Magento/Sendfriend/etc/frontend/routes.xml +++ b/app/code/Magento/Sendfriend/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="sendfriend" frontName="sendfriend"> <module name="Magento_Sendfriend" /> diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php b/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php index e793c6779d0ab9bc87f118682f3ed24c924d9c05..128f1945c55fb1f68addcbea86e29107f4ec5854 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Create/Items.php @@ -105,7 +105,7 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems 'Magento\Backend\Block\Widget\Button', array( 'label' => __('Submit Shipment'), - 'class' => 'save submit-button', + 'class' => 'save submit-button primary', 'onclick' => 'submitShipment(this);' ) ); diff --git a/app/code/Magento/Shipping/Block/Order/Shipment.php b/app/code/Magento/Shipping/Block/Order/Shipment.php index f2ac35331612e87b0e34fc9ea7a2182b4c3c3b6d..e6a355abdba4056b6113b9d72086d9416f13dde6 100644 --- a/app/code/Magento/Shipping/Block/Order/Shipment.php +++ b/app/code/Magento/Shipping/Block/Order/Shipment.php @@ -43,7 +43,7 @@ class Shipment extends \Magento\View\Element\Template protected $_coreRegistry = null; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -55,14 +55,14 @@ class Shipment extends \Magento\View\Element\Template /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Payment\Helper\Data $paymentHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Registry $registry, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Payment\Helper\Data $paymentHelper, array $data = array() ) { diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php index 9cbf29177463a6f5eb4f7d00dcd8f126034e8d38..f5df97f349bcab1b9d6f282680e12864055d5761 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment.php @@ -25,7 +25,7 @@ */ namespace Magento\Shipping\Controller\Adminhtml\Order; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; /** * Adminhtml order shipment controller @@ -42,7 +42,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip protected $_coreRegistry; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; @@ -53,13 +53,13 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory * @param \Magento\Registry $coreRegistry * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Registry $coreRegistry, \Magento\Shipping\Model\CarrierFactory $carrierFactory ) { @@ -500,12 +500,12 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip $shipment->setShippingLabel($outputPdf->render()); $carrierCode = $carrier->getCarrierCode(); $carrierTitle = $this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface', + 'Magento\Framework\App\Config\ScopeConfigInterface', \Magento\Store\Model\ScopeInterface::SCOPE_STORE )->getValue( 'carriers/' . $carrierCode . '/title', - $shipment->getStoreId(), - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $shipment->getStoreId() ); if ($trackingNumbers) { foreach ($trackingNumbers as $trackingNumber) { @@ -583,7 +583,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip return $this->_fileFactory->create( 'ShippingLabel(' . $shipment->getIncrementId() . ').pdf', $pdfContent, - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -617,7 +617,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip 'Y-m-d_H-i-s' ) . '.pdf', $pdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } else { @@ -678,7 +678,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip return $this->_fileFactory->create( 'ShippingLabels.pdf', $outputPdf->render(), - \Magento\App\Filesystem::VAR_DIR, + \Magento\Framework\App\Filesystem::VAR_DIR, 'application/pdf' ); } @@ -688,7 +688,7 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip $this->_redirect('sales/order/index'); } else { $this->messageManager->addError(__('There are no shipping labels related to selected shipments.')); - $this->_redirect('adminhtml/order_shipment/index'); + $this->_redirect('sales/shipment/index'); } } @@ -727,9 +727,9 @@ class Shipment extends \Magento\Sales\Controller\Adminhtml\Shipment\AbstractShip { /** @var \Magento\Filesystem\Directory\Write $directory */ $directory = $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::TMP_DIR + \Magento\Framework\App\Filesystem::TMP_DIR ); $directory->create(); $image = imagecreatefromstring($imageString); diff --git a/app/code/Magento/Shipping/Controller/Tracking.php b/app/code/Magento/Shipping/Controller/Tracking.php index fcdaa78b23de9dcbdcedd2895220460d62915bbe..d6f6a5952af3a45f406ae740476c7352767076d8 100644 --- a/app/code/Magento/Shipping/Controller/Tracking.php +++ b/app/code/Magento/Shipping/Controller/Tracking.php @@ -23,12 +23,12 @@ */ namespace Magento\Shipping\Controller; -use Magento\App\Action\NotFoundException; +use Magento\Framework\App\Action\NotFoundException; /** * Sales orders controller */ -class Tracking extends \Magento\App\Action\Action +class Tracking extends \Magento\Framework\App\Action\Action { /** * Core registry @@ -48,13 +48,13 @@ class Tracking extends \Magento\App\Action\Action protected $_orderFactory; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Registry $coreRegistry * @param \Magento\Shipping\Model\InfoFactory $shippingInfoFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Registry $coreRegistry, \Magento\Shipping\Model\InfoFactory $shippingInfoFactory, \Magento\Sales\Model\OrderFactory $orderFactory diff --git a/app/code/Magento/Shipping/Helper/Carrier.php b/app/code/Magento/Shipping/Helper/Carrier.php index 785a1a05fa6d44c8ac929c517b7e2e15e5d8614e..f38bf7bc1a1d7693eb982ce254d38c8eb780b122 100644 --- a/app/code/Magento/Shipping/Helper/Carrier.php +++ b/app/code/Magento/Shipping/Helper/Carrier.php @@ -26,7 +26,7 @@ namespace Magento\Shipping\Helper; /** * Carrier helper */ -class Carrier extends \Magento\App\Helper\AbstractHelper +class Carrier extends \Magento\Framework\App\Helper\AbstractHelper { /** * Carriers root xml path @@ -43,19 +43,19 @@ class Carrier extends \Magento\App\Helper\AbstractHelper /** * Store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Locale\ResolverInterface $localeResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Locale\ResolverInterface $localeResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->localeResolver = $localeResolver; $this->scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Shipping/Helper/Data.php b/app/code/Magento/Shipping/Helper/Data.php index d96093de746344aacf5a657108788b58c503d12c..df1a2031f3f87cb51354dafa9225646a5ecd4a15 100644 --- a/app/code/Magento/Shipping/Helper/Data.php +++ b/app/code/Magento/Shipping/Helper/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\Shipping\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Allowed hash keys @@ -48,7 +48,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -58,15 +58,15 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_coreData = $coreData; diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index dbf778f4544ff92afc8d8e0b8465f9bc56e9ab19..6d51e918e90391905e941c1605280892334dd482 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -95,7 +95,7 @@ abstract class AbstractCarrier extends \Magento\Object implements AbstractCarrie /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -110,13 +110,13 @@ abstract class AbstractCarrier extends \Magento\Object implements AbstractCarrie protected $_logAdapterFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, array $data = array() diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index ac7dac8ea499162e0e34d8a11cc80a641a13f24e..82131ac6c85483e730ac64695429cf8a78ddee53 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -108,7 +108,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier protected $_currencyFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory @@ -126,7 +126,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, diff --git a/app/code/Magento/Shipping/Model/CarrierFactory.php b/app/code/Magento/Shipping/Model/CarrierFactory.php index 345f658c4561b74d4abf86ab57305f25228e61a3..a2d7917dff77e3a4f6de8b6cf232b8820d2013f4 100644 --- a/app/code/Magento/Shipping/Model/CarrierFactory.php +++ b/app/code/Magento/Shipping/Model/CarrierFactory.php @@ -30,7 +30,7 @@ class CarrierFactory implements CarrierFactoryInterface /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -40,11 +40,11 @@ class CarrierFactory implements CarrierFactoryInterface protected $_objectManager; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\ObjectManager $objectManager */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\ObjectManager $objectManager ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Shipping/Model/Config.php b/app/code/Magento/Shipping/Model/Config.php index 87bc48191b8ec485c87cc92db23fbc9f7e382b05..5aca22da968615be4fba3b15b23f3c946286a322 100644 --- a/app/code/Magento/Shipping/Model/Config.php +++ b/app/code/Magento/Shipping/Model/Config.php @@ -41,7 +41,7 @@ class Config extends \Magento\Object /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -53,12 +53,12 @@ class Config extends \Magento\Object /** * Constructor * - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = array() ) { diff --git a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php index cd41929bc52b9bbb7f83b933d5f85d4239ff81f5..0bbcc5da98759c1e194f551b1ae5450d5e88d566 100644 --- a/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php +++ b/app/code/Magento/Shipping/Model/Config/Source/Allmethods.php @@ -30,7 +30,7 @@ class Allmethods implements \Magento\Option\ArrayInterface /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -40,11 +40,11 @@ class Allmethods implements \Magento\Option\ArrayInterface protected $_shippingConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Shipping\Model\Config $shippingConfig */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Shipping\Model\Config $shippingConfig ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Shipping/Model/Order/Pdf/Packaging.php b/app/code/Magento/Shipping/Model/Order/Pdf/Packaging.php index 8dfbcd584d7ff3f9a86185bfb65421c252f0c2a6..77a136e857f7742a1558312cb4762d44cbe00fda 100644 --- a/app/code/Magento/Shipping/Model/Order/Pdf/Packaging.php +++ b/app/code/Magento/Shipping/Model/Order/Pdf/Packaging.php @@ -52,8 +52,8 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Stdlib\String $string - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Sales\Model\Order\Pdf\Config $pdfConfig * @param \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory * @param \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory @@ -70,8 +70,8 @@ class Packaging extends \Magento\Sales\Model\Order\Pdf\AbstractPdf public function __construct( \Magento\Payment\Helper\Data $paymentData, \Magento\Stdlib\String $string, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Sales\Model\Order\Pdf\Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, diff --git a/app/code/Magento/Shipping/Model/Shipping.php b/app/code/Magento/Shipping/Model/Shipping.php index f3e8bf2ca423dbc54711313cb5991b6926fbc086..f2b6076a1633e74a5c00d01b240e1e0af207d407 100644 --- a/app/code/Magento/Shipping/Model/Shipping.php +++ b/app/code/Magento/Shipping/Model/Shipping.php @@ -54,7 +54,7 @@ class Shipping implements RateCollectorInterface /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -94,7 +94,7 @@ class Shipping implements RateCollectorInterface protected $mathDivision; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Shipping\Model\Config $shippingConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory @@ -104,7 +104,7 @@ class Shipping implements RateCollectorInterface * @param \Magento\Math\Division $mathDivision */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Shipping\Model\Config $shippingConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Shipping\Model\CarrierFactory $carrierFactory, diff --git a/app/code/Magento/Shipping/Model/Shipping/Labels.php b/app/code/Magento/Shipping/Model/Shipping/Labels.php index d5eb96a91f7e413c0c22bc40c4bee7c24768907a..d22a0e91476feb4d1d5c20d2c2db16d0f4778868 100644 --- a/app/code/Magento/Shipping/Model/Shipping/Labels.php +++ b/app/code/Magento/Shipping/Model/Shipping/Labels.php @@ -43,7 +43,7 @@ class Labels extends \Magento\Shipping\Model\Shipping protected $_request; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Shipping\Model\Config $shippingConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory @@ -55,7 +55,7 @@ class Labels extends \Magento\Shipping\Model\Shipping * @param \Magento\Shipping\Model\Shipment\Request $request */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Shipping\Model\Config $shippingConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Shipping\Model\CarrierFactory $carrierFactory, diff --git a/app/code/Magento/Shipping/etc/adminhtml/routes.xml b/app/code/Magento/Shipping/etc/adminhtml/routes.xml index 197a4aba425a7f6956c09dc69175f39a3e1c5de0..0ce9bb6b90b3e5c5a01495c11f0e0e95b7acfb8d 100644 --- a/app/code/Magento/Shipping/etc/adminhtml/routes.xml +++ b/app/code/Magento/Shipping/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Shipping" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Shipping/etc/frontend/routes.xml b/app/code/Magento/Shipping/etc/frontend/routes.xml index 7a55a0bf4623d613eac9dffaf1d681e296d11136..940b418aa4aa87c5028fe30f32207440112973b1 100644 --- a/app/code/Magento/Shipping/etc/frontend/routes.xml +++ b/app/code/Magento/Shipping/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="shipping" frontName="shipping"> <module name="Magento_Shipping" /> diff --git a/app/code/Magento/Shipping/view/adminhtml/create/items.phtml b/app/code/Magento/Shipping/view/adminhtml/create/items.phtml index 9cf4ebddd7bb43e6eae7dfa35a0e6ec2588802f2..86ab4179a360f8d928cffc8c5959efe27e480e91 100644 --- a/app/code/Magento/Shipping/view/adminhtml/create/items.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/create/items.phtml @@ -66,26 +66,25 @@ </div> <div class="order-totals"> <div class="fieldset-wrapper"> - <div class="clearfix"> - <div class="actions"> - <?php echo $this->getChildHtml('submit_button') ?> + <?php if ($this->canCreateShippingLabel()): ?> + <div class="field choice field-create"> + <input id="create_shipping_label" name="shipment[create_shipping_label]" value="1" type="checkbox" + onclick="toggleCreateLabelCheckbox();"/> + <label class="normal" for="create_shipping_label"><?php echo __('Create Shipping Label') ?></label> </div> - <?php if ($this->canCreateShippingLabel()): ?> - <div> - <label class="normal" for="create_shipping_label"><?php echo __('Create Shipping Label') ?></label> - <input id="create_shipping_label" name="shipment[create_shipping_label]" value="1" type="checkbox" onclick="toggleCreateLabelCheckbox();" /> - </div> - <?php endif ?> - <div> - <label class="normal" for="notify_customer"><?php echo __('Append Comments') ?></label> - <input id="notify_customer" name="shipment[comment_customer_notify]" value="1" type="checkbox" /> - </div> - <?php if ($this->canSendShipmentEmail()): ?> - <div> - <label class="normal" for="send_email"><?php echo __('Email Copy of Shipment') ?></label> - <input id="send_email" name="shipment[send_email]" value="1" type="checkbox" /> - </div> - <?php endif; ?> + <?php endif ?> + <div class="field choice field-append"> + <input id="notify_customer" name="shipment[comment_customer_notify]" value="1" type="checkbox"/> + <label class="normal" for="notify_customer"><?php echo __('Append Comments') ?></label> + </div> + <?php if ($this->canSendShipmentEmail()): ?> + <div class="field choice field-email"> + <input id="send_email" name="shipment[send_email]" value="1" type="checkbox"/> + <label class="normal" for="send_email"><?php echo __('Email Copy of Shipment') ?></label> + </div> + <?php endif; ?> + <div class="actions"> + <?php echo $this->getChildHtml('submit_button') ?> </div> </div> </div> diff --git a/app/code/Magento/Shipping/view/adminhtml/order/tracking.phtml b/app/code/Magento/Shipping/view/adminhtml/order/tracking.phtml index 907fd1ade049eb7eb1b910ea60c0f3860efe4bb2..cd43be3c70d2ab25f5dbf8baa2852806c66d55f7 100644 --- a/app/code/Magento/Shipping/view/adminhtml/order/tracking.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/order/tracking.phtml @@ -77,7 +77,7 @@ </thead> <tfoot> <tr> - <td colspan="4" class="last"><?php echo $this->getChildHtml('add_button') ?></td> + <td colspan="4" class="last col-actions-add"><?php echo $this->getChildHtml('add_button') ?></td> </tr> </tfoot> <tbody id="track_row_container"> diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php index 18f1766b05cff9961cec319006c491af0ce9e67c..5cd172a43db466b51cd29b6db6fb01e78f2523b0 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php @@ -35,7 +35,7 @@ namespace Magento\Sitemap\Block\Adminhtml\Grid\Renderer; class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { /** - * @var \Magento\App\Filesystem $filesystem + * @var \Magento\Framework\App\Filesystem $filesystem */ protected $_filesystem; @@ -47,13 +47,13 @@ class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe /** * @param \Magento\Backend\Block\Context $context * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $data */ public function __construct( \Magento\Backend\Block\Context $context, \Magento\Sitemap\Model\SitemapFactory $sitemapFactory, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, array $data = array() ) { $this->_sitemapFactory = $sitemapFactory; @@ -74,7 +74,7 @@ class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe $url = $this->escapeHtml($sitemap->getSitemapUrl($row->getSitemapPath(), $row->getSitemapFilename())); $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename()); - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); if ($directory->isFile($fileName)) { return sprintf('<a href="%1$s">%1$s</a>', $url); } diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php index 5c1c4b9f560e79277b1b3134533ed0d4215e0f1a..a563b4c6229dd95f8da6aee5cac5635a43ec4954 100644 --- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php +++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php @@ -176,9 +176,9 @@ class Sitemap extends \Magento\Backend\App\Action /** @var \Magento\Filesystem\Directory\Write $directory */ $directory = $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); if ($this->getRequest()->getParam('sitemap_id')) { @@ -240,9 +240,9 @@ class Sitemap extends \Magento\Backend\App\Action { /** @var \Magento\Filesystem\Directory\Write $directory */ $directory = $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); // check if we know what should be deleted diff --git a/app/code/Magento/Sitemap/Helper/Data.php b/app/code/Magento/Sitemap/Helper/Data.php index 4f1af5356f921b36c0c4f429ba88bd462cc9711d..7f89dfec209a6c8aab98ccc98d5c23b5b84617e7 100644 --- a/app/code/Magento/Sitemap/Helper/Data.php +++ b/app/code/Magento/Sitemap/Helper/Data.php @@ -32,7 +32,7 @@ */ namespace Magento\Sitemap\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /**#@+ * Limits xpath config settings @@ -76,17 +76,17 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; parent::__construct($context); diff --git a/app/code/Magento/Sitemap/Model/Config/Backend/Priority.php b/app/code/Magento/Sitemap/Model/Config/Backend/Priority.php index 76073cf397511fc2cafbcbe886ba2c5f8c718331..0017293c2e93c0fe286730351a96e8f5da8f4deb 100644 --- a/app/code/Magento/Sitemap/Model/Config/Backend/Priority.php +++ b/app/code/Magento/Sitemap/Model/Config/Backend/Priority.php @@ -25,7 +25,7 @@ */ namespace Magento\Sitemap\Model\Config\Backend; -class Priority extends \Magento\App\Config\Value +class Priority extends \Magento\Framework\App\Config\Value { /** * @return $this diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index 3ca7cd646cd80a80c6e0177f11508b12264115b1..be6765ad1771cb7e06696d37f03cae9a2228f713 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -60,7 +60,7 @@ class Observer /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -85,14 +85,14 @@ class Observer protected $inlineTranslation; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Resource\Sitemap\CollectionFactory $collectionFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Translate\Inline\StateInterface $inlineTranslation */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sitemap\Model\Resource\Sitemap\CollectionFactory $collectionFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Mail\Template\TransportBuilder $transportBuilder, diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php index ca6c0ecf37f828c4ef5001100141c48682a34b4e..fe122db17dd3841fea918779a76097a22576584b 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php @@ -57,12 +57,12 @@ class Category extends \Magento\Model\Resource\Db\AbstractDb protected $_categoryResource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category $categoryResource */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category $categoryResource ) { diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index 44ceca48f73dea2339198cfe765fd72ea4ce539f..c40c87c502044d06c4de4a987da2948364e34efd 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -100,7 +100,7 @@ class Product extends \Magento\Model\Resource\Db\AbstractDb protected $_mediaConfig; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Sitemap\Helper\Data $sitemapData * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -111,7 +111,7 @@ class Product extends \Magento\Model\Resource\Db\AbstractDb * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Sitemap\Helper\Data $sitemapData, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 63ed96c9be8311c0d903a186abe166ae4f4e161f..c976698bde8e5b822a33c89d6d8d821253cc3240 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -150,7 +150,7 @@ class Sitemap extends \Magento\Model\AbstractModel protected $_storeManager; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -164,13 +164,13 @@ class Sitemap extends \Magento\Model\AbstractModel * @param \Magento\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\Sitemap\Helper\Data $sitemapData - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Sitemap\Model\Resource\Catalog\CategoryFactory $categoryFactory * @param \Magento\Sitemap\Model\Resource\Catalog\ProductFactory $productFactory * @param \Magento\Sitemap\Model\Resource\Cms\PageFactory $cmsFactory * @param \Magento\Stdlib\DateTime\DateTime $modelDate * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection @@ -181,13 +181,13 @@ class Sitemap extends \Magento\Model\AbstractModel \Magento\Registry $registry, \Magento\Escaper $escaper, \Magento\Sitemap\Helper\Data $sitemapData, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Sitemap\Model\Resource\Catalog\CategoryFactory $categoryFactory, \Magento\Sitemap\Model\Resource\Catalog\ProductFactory $productFactory, \Magento\Sitemap\Model\Resource\Cms\PageFactory $cmsFactory, \Magento\Stdlib\DateTime\DateTime $modelDate, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Stdlib\DateTime $dateTime, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -195,7 +195,7 @@ class Sitemap extends \Magento\Model\AbstractModel ) { $this->_escaper = $escaper; $this->_sitemapData = $sitemapData; - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; $this->_cmsFactory = $cmsFactory; diff --git a/app/code/Magento/Sitemap/etc/adminhtml/routes.xml b/app/code/Magento/Sitemap/etc/adminhtml/routes.xml index 35269b0266828fa3239a0379be0c63dcb9a77b2a..20b3ec3ec6b462254aeb806d8a06bd2341df8ec9 100644 --- a/app/code/Magento/Sitemap/etc/adminhtml/routes.xml +++ b/app/code/Magento/Sitemap/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Sitemap" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml index 8272c0aadee42a1939709e12de20a5224a2d0283..4b1ae97207d3707ab9d4b13219d5aac1cb49a685 100644 --- a/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml +++ b/app/code/Magento/Sitemap/view/adminhtml/layout/adminhtml_sitemap_index_grid_block.xml @@ -44,8 +44,9 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="sitemap_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">50px</argument> <argument name="index" xsi:type="string">sitemap_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="sitemap_filename"> @@ -69,9 +70,10 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="sitemap_time"> <arguments> <argument name="header" xsi:type="string" translate="true">Last Generated</argument> - <argument name="width" xsi:type="string">150px</argument> <argument name="index" xsi:type="string">sitemap_time</argument> <argument name="type" xsi:type="string">datetime</argument> + <argument name="column_css_class" xsi:type="string">col-date</argument> + <argument name="header_css_class" xsi:type="string">col-date</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column\Multistore" as="store_id"> @@ -88,7 +90,6 @@ <argument name="header" xsi:type="string" translate="true">Action</argument> <argument name="filter" xsi:type="string">0</argument> <argument name="sortable" xsi:type="string">0</argument> - <argument name="width" xsi:type="string">100px</argument> <argument name="renderer" xsi:type="string">Magento\Sitemap\Block\Adminhtml\Grid\Renderer\Action</argument> </arguments> </block> diff --git a/app/code/Magento/Store/App/Action/Plugin/StoreCheck.php b/app/code/Magento/Store/App/Action/Plugin/StoreCheck.php index c3d38eee0b61aeab7615c86e05f1b5cb8945f5be..6abc24cbb39638ebb7a5a96df6482f806c4953c9 100644 --- a/app/code/Magento/Store/App/Action/Plugin/StoreCheck.php +++ b/app/code/Magento/Store/App/Action/Plugin/StoreCheck.php @@ -40,17 +40,17 @@ class StoreCheck } /** - * @param \Magento\App\Action\Action $subject + * @param \Magento\Framework\App\Action\Action $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\Action\Action $subject, + \Magento\Framework\App\Action\Action $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if (!$this->_storeManager->getStore()->getIsActive()) { $this->_storeManager->throwStoreException(); diff --git a/app/code/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandler.php b/app/code/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandler.php index 9469b222cdf22ed43c8a43d6a67654e0910f9bc9..d7e401e7a42f9405582ab0d02a0a1b632a277007 100644 --- a/app/code/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandler.php +++ b/app/code/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandler.php @@ -26,7 +26,7 @@ namespace Magento\Store\App\FrontController\Plugin; use Magento\Store\Model\StoreManager; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; class DispatchExceptionHandler { @@ -38,7 +38,7 @@ class DispatchExceptionHandler /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -55,17 +55,17 @@ class DispatchExceptionHandler /** * Handle dispatch exceptions * - * @param \Magento\App\FrontController $subject + * @param \Magento\Framework\App\FrontController $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\FrontController $subject, + \Magento\Framework\App\FrontController $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { try { return $proceed($request); diff --git a/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php b/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php index 89860b0b652fb960c433572dadcacfde71f15a5e..0883ad08ab7932282cebacb2857bd5dbc822efd7 100644 --- a/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php +++ b/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php @@ -26,12 +26,12 @@ namespace Magento\Store\App\FrontController\Plugin; class RequestPreprocessor { /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\ResponseFactory + * @var \Magento\Framework\App\ResponseFactory */ protected $_responseFactory; @@ -41,7 +41,7 @@ class RequestPreprocessor protected $_url; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -52,17 +52,17 @@ class RequestPreprocessor /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\UrlInterface $url - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\ResponseFactory $responseFactory + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\ResponseFactory $responseFactory */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\UrlInterface $url, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\ResponseFactory $responseFactory + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\ResponseFactory $responseFactory ) { $this->_storeManager = $storeManager; $this->_appState = $appState; @@ -75,17 +75,17 @@ class RequestPreprocessor * Auto-redirect to base url (without SID) if the requested url doesn't match it. * By default this feature is enabled in configuration. * - * @param \Magento\App\FrontController $subject + * @param \Magento\Framework\App\FrontController $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\FrontController $subject, + \Magento\Framework\App\FrontController $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if ($this->_appState->isInstalled() && !$request->isPost() && $this->_isBaseUrlCheckEnabled()) { $baseUrl = $this->_storeManager->getStore()->getBaseUrl( @@ -131,7 +131,7 @@ class RequestPreprocessor * Check if base url enabled * * @param array $uri - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @return bool */ protected function _isBaseUrlCorrect($uri, $request) diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php index bddcdc096314d73887b91cc03b82fcda85f19447..fbcbcfa49b4c18c634b9b40247560698dc7e9023 100644 --- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php @@ -23,7 +23,7 @@ */ namespace Magento\Store\App\Request; -class PathInfoProcessor implements \Magento\App\Request\PathInfoProcessorInterface +class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -41,11 +41,11 @@ class PathInfoProcessor implements \Magento\App\Request\PathInfoProcessorInterfa /** * Process path info * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $pathInfo * @return string */ - public function process(\Magento\App\RequestInterface $request, $pathInfo) + public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo) { $pathParts = explode('/', ltrim($pathInfo, '/'), 2); $storeCode = $pathParts[0]; diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php index d5ee274c0e9d023f810f75658e2ddba97001dbbd..f6d51a62bd2d0291bc9689839c368213790e15b7 100644 --- a/app/code/Magento/Store/App/Response/Redirect.php +++ b/app/code/Magento/Store/App/Response/Redirect.php @@ -25,10 +25,10 @@ */ namespace Magento\Store\App\Response; -class Redirect implements \Magento\App\Response\RedirectInterface +class Redirect implements \Magento\Framework\App\Response\RedirectInterface { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -63,7 +63,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface protected $_urlBuilder; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Encryption\UrlCoder $urlCoder * @param \Magento\Session\SessionManagerInterface $session @@ -72,7 +72,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface * @param bool $canUseSessionIdInParam */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Encryption\UrlCoder $urlCoder, \Magento\Session\SessionManagerInterface $session, @@ -99,11 +99,11 @@ class Redirect implements \Magento\App\Response\RedirectInterface if ($url) { $refererUrl = $url; } - $url = $this->_request->getParam(\Magento\App\Action\Action::PARAM_NAME_BASE64_URL); + $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_BASE64_URL); if ($url) { $refererUrl = $this->_urlCoder->decode($url); } - $url = $this->_request->getParam(\Magento\App\Action\Action::PARAM_NAME_URL_ENCODED); + $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED); if ($url) { $refererUrl = $this->_urlCoder->decode($url); } @@ -128,7 +128,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface * Set referer url for redirect in response * * @param string $defaultUrl - * @return \Magento\App\ActionInterface + * @return \Magento\Framework\App\ActionInterface */ public function getRedirectUrl($defaultUrl = null) { @@ -178,12 +178,12 @@ class Redirect implements \Magento\App\Response\RedirectInterface /** * Set redirect into response * - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response * @param string $path * @param array $arguments * @return void */ - public function redirect(\Magento\App\ResponseInterface $response, $path, $arguments = array()) + public function redirect(\Magento\Framework\App\ResponseInterface $response, $path, $arguments = array()) { if ($this->_session->getCookieShouldBeReceived() && $this->_urlBuilder->getUseSession() && diff --git a/app/code/Magento/Store/Helper/Cookie.php b/app/code/Magento/Store/Helper/Cookie.php index 16607768243347e649a32ec882d4ab0e21188cdb..a0f6336af409def7e0504d2dd7c40ddd3d84bb09 100644 --- a/app/code/Magento/Store/Helper/Cookie.php +++ b/app/code/Magento/Store/Helper/Cookie.php @@ -26,7 +26,7 @@ namespace Magento\Store\Helper; /** * Cookie helper */ -class Cookie extends \Magento\App\Helper\AbstractHelper +class Cookie extends \Magento\Framework\App\Helper\AbstractHelper { /** * Cookie name for users who allowed cookie save @@ -54,22 +54,22 @@ class Cookie extends \Magento\App\Helper\AbstractHelper protected $_website; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data * * @throws \InvalidArgumentException */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = array() ) { parent::__construct($context); diff --git a/app/code/Magento/Store/Model/Config/Converter.php b/app/code/Magento/Store/Model/Config/Converter.php index dc47459b309efc3287abc8ecb6e81faef729312a..ed010d162c0b89597abcda40e2fcb25e28f8df4b 100644 --- a/app/code/Magento/Store/Model/Config/Converter.php +++ b/app/code/Magento/Store/Model/Config/Converter.php @@ -25,7 +25,7 @@ */ namespace Magento\Store\Model\Config; -class Converter extends \Magento\App\Config\Scope\Converter +class Converter extends \Magento\Framework\App\Config\Scope\Converter { /** * @var \Magento\Store\Model\Config\Processor\Placeholder diff --git a/app/code/Magento/Store/Model/Config/Processor/Placeholder.php b/app/code/Magento/Store/Model/Config/Processor/Placeholder.php index 863412fb97a72a57b52e0ba65a4ac03bc74fb6c7..6e2351891680579bce385f6f9894d19a5d24592a 100644 --- a/app/code/Magento/Store/Model/Config/Processor/Placeholder.php +++ b/app/code/Magento/Store/Model/Config/Processor/Placeholder.php @@ -28,7 +28,7 @@ namespace Magento\Store\Model\Config\Processor; class Placeholder { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -43,11 +43,11 @@ class Placeholder protected $urlPlaceholder; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string[] $urlPaths * @param string $urlPlaceholder */ - public function __construct(\Magento\App\RequestInterface $request, $urlPaths, $urlPlaceholder) + public function __construct(\Magento\Framework\App\RequestInterface $request, $urlPaths, $urlPlaceholder) { $this->request = $request; $this->urlPaths = $urlPaths; diff --git a/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php b/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php index fa5ea39b792bc8873cb2bfb2c5048df4a892f6a1..72c6baa10461d61834eb8b97e6aadd3cd4915dd8 100644 --- a/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php +++ b/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php @@ -25,15 +25,15 @@ */ namespace Magento\Store\Model\Config\Reader; -class DefaultReader implements \Magento\App\Config\Scope\ReaderInterface +class DefaultReader implements \Magento\Framework\App\Config\Scope\ReaderInterface { /** - * @var \Magento\App\Config\Initial + * @var \Magento\Framework\App\Config\Initial */ protected $_initialConfig; /** - * @var \Magento\App\Config\Scope\Converter + * @var \Magento\Framework\App\Config\Scope\Converter */ protected $_converter; @@ -43,21 +43,21 @@ class DefaultReader implements \Magento\App\Config\Scope\ReaderInterface protected $_collectionFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @param \Magento\App\Config\Initial $initialConfig - * @param \Magento\App\Config\Scope\Converter $converter + * @param \Magento\Framework\App\Config\Initial $initialConfig + * @param \Magento\Framework\App\Config\Scope\Converter $converter * @param \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ public function __construct( - \Magento\App\Config\Initial $initialConfig, - \Magento\App\Config\Scope\Converter $converter, + \Magento\Framework\App\Config\Initial $initialConfig, + \Magento\Framework\App\Config\Scope\Converter $converter, \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory, - \Magento\App\State $appState + \Magento\Framework\App\State $appState ) { $this->_initialConfig = $initialConfig; $this->_converter = $converter; @@ -72,10 +72,10 @@ class DefaultReader implements \Magento\App\Config\Scope\ReaderInterface */ public function read() { - $config = $this->_initialConfig->getData(\Magento\App\ScopeInterface::SCOPE_DEFAULT); + $config = $this->_initialConfig->getData(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); if ($this->_appState->isInstalled()) { $collection = $this->_collectionFactory->create( - array('scope' => \Magento\App\ScopeInterface::SCOPE_DEFAULT) + array('scope' => \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT) ); $dbDefaultConfig = array(); foreach ($collection as $item) { diff --git a/app/code/Magento/Store/Model/Config/Reader/ReaderPool.php b/app/code/Magento/Store/Model/Config/Reader/ReaderPool.php index 7fbb98c4cabd3d0af41c673a29d64f90baf07605..0e2c39cea9926cc9ae3de3a6e9af7515f1da44e7 100644 --- a/app/code/Magento/Store/Model/Config/Reader/ReaderPool.php +++ b/app/code/Magento/Store/Model/Config/Reader/ReaderPool.php @@ -23,7 +23,7 @@ */ namespace Magento\Store\Model\Config\Reader; -class ReaderPool implements \Magento\App\Config\Scope\ReaderPoolInterface +class ReaderPool implements \Magento\Framework\App\Config\Scope\ReaderPoolInterface { /** * List of readers @@ -33,7 +33,7 @@ class ReaderPool implements \Magento\App\Config\Scope\ReaderPoolInterface protected $_readers = array(); /** - * @param \Magento\App\Config\Scope\ReaderInterface[] $readers + * @param \Magento\Framework\App\Config\Scope\ReaderInterface[] $readers */ public function __construct( array $readers diff --git a/app/code/Magento/Store/Model/Config/Reader/Store.php b/app/code/Magento/Store/Model/Config/Reader/Store.php index 91bc3f3fe2bdd946dda0f96c8d315234869f80bb..dcf43b13818d09693aea79593bc3c5cc7524d151 100644 --- a/app/code/Magento/Store/Model/Config/Reader/Store.php +++ b/app/code/Magento/Store/Model/Config/Reader/Store.php @@ -23,15 +23,17 @@ */ namespace Magento\Store\Model\Config\Reader; -class Store implements \Magento\App\Config\Scope\ReaderInterface +use Magento\Exception\NoSuchEntityException; + +class Store implements \Magento\Framework\App\Config\Scope\ReaderInterface { /** - * @var \Magento\App\Config\Initial + * @var \Magento\Framework\App\Config\Initial */ protected $_initialConfig; /** - * @var \Magento\App\Config\ScopePool + * @var \Magento\Framework\App\Config\ScopePool */ protected $_scopePool; @@ -51,7 +53,7 @@ class Store implements \Magento\App\Config\Scope\ReaderInterface protected $_storeFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -61,21 +63,21 @@ class Store implements \Magento\App\Config\Scope\ReaderInterface protected $_storeManager; /** - * @param \Magento\App\Config\Initial $initialConfig - * @param \Magento\App\Config\ScopePool $scopePool + * @param \Magento\Framework\App\Config\Initial $initialConfig + * @param \Magento\Framework\App\Config\ScopePool $scopePool * @param \Magento\Store\Model\Config\Converter $converter * @param \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory * @param \Magento\Store\Model\StoreFactory $storeFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Config\Initial $initialConfig, - \Magento\App\Config\ScopePool $scopePool, + \Magento\Framework\App\Config\Initial $initialConfig, + \Magento\Framework\App\Config\ScopePool $scopePool, \Magento\Store\Model\Config\Converter $converter, \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory, \Magento\Store\Model\StoreFactory $storeFactory, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_initialConfig = $initialConfig; @@ -103,6 +105,9 @@ class Store implements \Magento\App\Config\Scope\ReaderInterface $store->load($code); } + if (!$store->getCode()) { + throw new NoSuchEntityException('storeCode', $code); + } $websiteConfig = $this->_scopePool->getScope( \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, $store->getWebsite()->getCode() @@ -120,7 +125,7 @@ class Store implements \Magento\App\Config\Scope\ReaderInterface } else { $websiteConfig = $this->_scopePool->getScope( \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )->getSource(); $config = $this->_converter->convert($websiteConfig, $this->_initialConfig->getData("stores|{$code}")); } diff --git a/app/code/Magento/Store/Model/Config/Reader/Website.php b/app/code/Magento/Store/Model/Config/Reader/Website.php index 2b6d690ff5c26bf05d6bbba29f96003e12c2e92e..eadead79c46a6cf2da61355fe8c31790448436b2 100644 --- a/app/code/Magento/Store/Model/Config/Reader/Website.php +++ b/app/code/Magento/Store/Model/Config/Reader/Website.php @@ -23,20 +23,20 @@ */ namespace Magento\Store\Model\Config\Reader; -class Website implements \Magento\App\Config\Scope\ReaderInterface +class Website implements \Magento\Framework\App\Config\Scope\ReaderInterface { /** - * @var \Magento\App\Config\Initial + * @var \Magento\Framework\App\Config\Initial */ protected $_initialConfig; /** - * @var \Magento\App\Config\ScopePool + * @var \Magento\Framework\App\Config\ScopePool */ protected $_scopePool; /** - * @var \Magento\App\Config\Scope\Converter + * @var \Magento\Framework\App\Config\Scope\Converter */ protected $_converter; @@ -51,25 +51,25 @@ class Website implements \Magento\App\Config\Scope\ReaderInterface protected $_websiteFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @param \Magento\App\Config\Initial $initialConfig - * @param \Magento\App\Config\ScopePool $scopePool - * @param \Magento\App\Config\Scope\Converter $converter + * @param \Magento\Framework\App\Config\Initial $initialConfig + * @param \Magento\Framework\App\Config\ScopePool $scopePool + * @param \Magento\Framework\App\Config\Scope\Converter $converter * @param \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory * @param \Magento\Store\Model\WebsiteFactory $websiteFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ public function __construct( - \Magento\App\Config\Initial $initialConfig, - \Magento\App\Config\ScopePool $scopePool, - \Magento\App\Config\Scope\Converter $converter, + \Magento\Framework\App\Config\Initial $initialConfig, + \Magento\Framework\App\Config\ScopePool $scopePool, + \Magento\Framework\App\Config\Scope\Converter $converter, \Magento\Store\Model\Resource\Config\Collection\ScopedFactory $collectionFactory, \Magento\Store\Model\WebsiteFactory $websiteFactory, - \Magento\App\State $appState + \Magento\Framework\App\State $appState ) { $this->_initialConfig = $initialConfig; $this->_scopePool = $scopePool; @@ -88,7 +88,7 @@ class Website implements \Magento\App\Config\Scope\ReaderInterface public function read($code = null) { $config = array_replace_recursive( - $this->_scopePool->getScope(\Magento\App\ScopeInterface::SCOPE_DEFAULT)->getSource(), + $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT)->getSource(), $this->_initialConfig->getData("websites|{$code}") ); diff --git a/app/code/Magento/Store/Model/Resolver/Store.php b/app/code/Magento/Store/Model/Resolver/Store.php index 721550c00abec804b39eb01c0c1519e4c2fb8ab7..971ee31ea707763f6a9a988a9f34086f2dd08999 100644 --- a/app/code/Magento/Store/Model/Resolver/Store.php +++ b/app/code/Magento/Store/Model/Resolver/Store.php @@ -23,7 +23,7 @@ */ namespace Magento\Store\Model\Resolver; -class Store implements \Magento\App\ScopeResolverInterface +class Store implements \Magento\Framework\App\ScopeResolverInterface { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -44,7 +44,7 @@ class Store implements \Magento\App\ScopeResolverInterface public function getScope($scopeId = null) { $scope = $this->_storeManager->getStore($scopeId); - if (!$scope instanceof \Magento\App\ScopeInterface) { + if (!$scope instanceof \Magento\Framework\App\ScopeInterface) { throw new \Magento\Store\Model\Exception('Invalid scope object'); } diff --git a/app/code/Magento/Store/Model/Resolver/Website.php b/app/code/Magento/Store/Model/Resolver/Website.php index d7408744771678c24c385e1c9267aabfdb6c9ec5..5ffd7d9122f00f0c505885b69dc69f4dd390fa4c 100644 --- a/app/code/Magento/Store/Model/Resolver/Website.php +++ b/app/code/Magento/Store/Model/Resolver/Website.php @@ -23,7 +23,7 @@ */ namespace Magento\Store\Model\Resolver; -class Website implements \Magento\App\ScopeResolverInterface +class Website implements \Magento\Framework\App\ScopeResolverInterface { /** * @var \Magento\Store\Model\StoreManagerInterface @@ -45,7 +45,7 @@ class Website implements \Magento\App\ScopeResolverInterface public function getScope($scopeId = null) { $scope = $this->_storeManager->getWebsite($scopeId); - if (!($scope instanceof \Magento\App\ScopeInterface)) { + if (!($scope instanceof \Magento\Framework\App\ScopeInterface)) { throw new \Magento\Store\Model\Exception('Invalid scope object'); } diff --git a/app/code/Magento/Store/Model/Storage/Db.php b/app/code/Magento/Store/Model/Storage/Db.php index 09fb61f664ea8606c09fc3c048718ee35ab78d1d..55ac9246589cf7a20cc56c602c9499fc4a9a284d 100644 --- a/app/code/Magento/Store/Model/Storage/Db.php +++ b/app/code/Magento/Store/Model/Storage/Db.php @@ -25,7 +25,7 @@ */ namespace Magento\Store\Model\Storage; -use Magento\App\State; +use Magento\Framework\App\State; use Magento\Store\Model\Store; use Magento\Store\Model\Group; use Magento\Store\Model\Group\Factory; @@ -87,7 +87,7 @@ class Db implements \Magento\Store\Model\StoreManagerInterface /** * Config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; @@ -142,7 +142,7 @@ class Db implements \Magento\Store\Model\StoreManagerInterface * @param StoreFactory $storeFactory * @param WebsiteFactory $websiteFactory * @param Factory $groupFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Stdlib\Cookie $cookie * @param State $appState * @param \Magento\Core\Helper\Data $helper @@ -153,7 +153,7 @@ class Db implements \Magento\Store\Model\StoreManagerInterface StoreFactory $storeFactory, WebsiteFactory $websiteFactory, Factory $groupFactory, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Stdlib\Cookie $cookie, State $appState, \Magento\Core\Helper\Data $helper, diff --git a/app/code/Magento/Store/Model/StorageFactory.php b/app/code/Magento/Store/Model/StorageFactory.php index 146f9a759db1973dcfbcfdb80595b80fba0e8254..a967b652442d4ec7ac1fcc7bfdc595f47dab0584 100644 --- a/app/code/Magento/Store/Model/StorageFactory.php +++ b/app/code/Magento/Store/Model/StorageFactory.php @@ -69,7 +69,7 @@ class StorageFactory protected $_sidResolver; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -84,7 +84,7 @@ class StorageFactory protected $_cookie; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_httpContext; @@ -93,10 +93,10 @@ class StorageFactory * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Logger $logger * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Http\Context $httpContext - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Http\Context $httpContext + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $defaultStorageClassName * @param string $installedStoreClassName * @param string $writerModel @@ -106,10 +106,10 @@ class StorageFactory \Magento\Event\ManagerInterface $eventManager, \Magento\Logger $logger, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Stdlib\Cookie $cookie, - \Magento\App\Http\Context $httpContext, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Http\Context $httpContext, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $defaultStorageClassName = 'Magento\Store\Model\Storage\DefaultStorage', $installedStoreClassName = 'Magento\Store\Model\Storage\Db', $writerModel = '' @@ -166,7 +166,7 @@ class StorageFactory \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); - if ($logActive || $this->_appState->getMode() === \Magento\App\State::MODE_DEVELOPER) { + if ($logActive || $this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { $logFile = $this->_scopeConfig->getValue( 'dev/log/file', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 0036236a8bcf7bdc9be71717ec7e17d81fa59552..ccfdd85e49b4441e01f93f50f49db7917058cb93 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -39,7 +39,7 @@ use Magento\Model\AbstractModel; * @method \Magento\Store\Model\Store setIsActive(int $value) */ class Store extends AbstractModel implements - \Magento\App\ScopeInterface, + \Magento\Framework\App\ScopeInterface, \Magento\Url\ScopeInterface, \Magento\Object\IdentityInterface { @@ -153,7 +153,7 @@ class Store extends AbstractModel implements const DISTRO_STORE_ID = 1; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; @@ -268,7 +268,7 @@ class Store extends AbstractModel implements protected $_isCustomEntryPoint = false; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -287,14 +287,14 @@ class Store extends AbstractModel implements /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; /** * Store Config * - * @var \Magento\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\App\Config\ReinitableConfigInterface */ protected $_config; @@ -311,7 +311,7 @@ class Store extends AbstractModel implements protected $_cookie; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_httpContext; @@ -320,16 +320,16 @@ class Store extends AbstractModel implements * @param \Magento\Registry $registry * @param \Magento\Store\Model\Resource\Store $resource * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\App\Cache\Type\Config $configCacheType + * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\UrlInterface $url - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Core\Model\Resource\Config\Data $configDataResource - * @param \Magento\App\Filesystem $filesystem - * @param \Magento\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\App\Filesystem $filesystem + * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config * @param StoreManagerInterface $storeManager * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Data\Collection\Db $resourceCollection * @param bool $isCustomEntryPoint * @param array $data @@ -339,16 +339,16 @@ class Store extends AbstractModel implements \Magento\Registry $registry, \Magento\Store\Model\Resource\Store $resource, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\App\Cache\Type\Config $configCacheType, + \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\UrlInterface $url, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Core\Model\Resource\Config\Data $configDataResource, - \Magento\App\Filesystem $filesystem, - \Magento\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Stdlib\Cookie $cookie, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Data\Collection\Db $resourceCollection = null, $isCustomEntryPoint = false, array $data = array() @@ -386,13 +386,13 @@ class Store extends AbstractModel implements public function __wakeup() { parent::__wakeup(); - $this->_coreFileStorageDatabase = \Magento\App\ObjectManager::getInstance()->get( + $this->_coreFileStorageDatabase = \Magento\Framework\App\ObjectManager::getInstance()->get( 'Magento\Core\Helper\File\Storage\Database' ); - $this->_config = \Magento\App\ObjectManager::getInstance()->get( - 'Magento\App\Config\ReinitableConfigInterface' + $this->_config = \Magento\Framework\App\ObjectManager::getInstance()->get( + 'Magento\Framework\App\Config\ReinitableConfigInterface' ); - $this->_cookie = \Magento\App\ObjectManager::getInstance()->get('Magento\Stdlib\Cookie'); + $this->_cookie = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Stdlib\Cookie'); } /** @@ -413,7 +413,7 @@ class Store extends AbstractModel implements protected function _getSession() { if (!$this->_session) { - $this->_session = \Magento\App\ObjectManager::getInstance()->create( + $this->_session = \Magento\Framework\App\ObjectManager::getInstance()->create( 'Magento\Session\SessionManagerInterface' )->start( 'store_' . $this->getCode() @@ -484,7 +484,7 @@ class Store extends AbstractModel implements { $data = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $this->getCode()); if (!$data && !$this->_appState->isInstalled()) { - $data = $this->_config->getValue($path, \Magento\App\ScopeInterface::SCOPE_DEFAULT); + $data = $this->_config->getValue($path, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); } return $data === false ? null : $data; } @@ -571,7 +571,7 @@ class Store extends AbstractModel implements \Magento\UrlInterface::URL_TYPE_WEB, $secure ) . $this->filesystem->getUri( - \Magento\App\Filesystem::PUB_LIB_DIR + \Magento\Framework\App\Filesystem::PUB_LIB_DIR ); } break; @@ -584,7 +584,7 @@ class Store extends AbstractModel implements \Magento\UrlInterface::URL_TYPE_WEB, $secure ) . $this->filesystem->getUri( - \Magento\App\Filesystem::STATIC_VIEW_DIR + \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR ); } break; @@ -597,7 +597,7 @@ class Store extends AbstractModel implements \Magento\UrlInterface::URL_TYPE_WEB, $secure ) . $this->filesystem->getUri( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR ); } break; @@ -612,7 +612,7 @@ class Store extends AbstractModel implements \Magento\UrlInterface::URL_TYPE_WEB, $secure ) . $this->filesystem->getUri( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); } } @@ -671,18 +671,18 @@ class Store extends AbstractModel implements * If we use Database file storage and server doesn't support rewrites (.htaccess in media folder) * we have to put name of fetching media script exactly into URL * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param bool $secure * @return string|bool */ - protected function _getMediaScriptUrl(\Magento\App\Filesystem $filesystem, $secure) + protected function _getMediaScriptUrl(\Magento\Framework\App\Filesystem $filesystem, $secure) { if (!$this->_getConfig(self::XML_PATH_USE_REWRITES) && $this->_coreFileStorageDatabase->checkDbUsage()) { return $this->getBaseUrl( \Magento\UrlInterface::URL_TYPE_WEB, $secure ) . $filesystem->getUri( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR ) . '/' . self::MEDIA_REWRITE_SCRIPT; } return false; @@ -761,7 +761,7 @@ class Store extends AbstractModel implements $offloaderHeader = trim( (string)$this->_config->getValue( self::XML_PATH_OFFLOADER_HEADER, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ) ); @@ -806,7 +806,7 @@ class Store extends AbstractModel implements if ($configValue == self::PRICE_SCOPE_GLOBAL) { return $this->_config->getValue( \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); } else { return $this->_getConfig(\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE); @@ -822,7 +822,7 @@ class Store extends AbstractModel implements { $currency = $this->getData('base_currency'); if (null === $currency) { - $currency = \Magento\App\ObjectManager::getInstance()->create( + $currency = \Magento\Framework\App\ObjectManager::getInstance()->create( 'Magento\Directory\Model\Currency' )->load( $this->getBaseCurrencyCode() @@ -852,7 +852,7 @@ class Store extends AbstractModel implements { $currency = $this->getData('default_currency'); if (null === $currency) { - $currency = \Magento\App\ObjectManager::getInstance()->create( + $currency = \Magento\Framework\App\ObjectManager::getInstance()->create( 'Magento\Directory\Model\Currency' )->load( $this->getDefaultCurrencyCode() @@ -960,7 +960,7 @@ class Store extends AbstractModel implements $currency = $this->getData('current_currency'); if (is_null($currency)) { - $currency = \Magento\App\ObjectManager::getInstance()->create( + $currency = \Magento\Framework\App\ObjectManager::getInstance()->create( 'Magento\Directory\Model\Currency' )->load( $this->getCurrentCurrencyCode() @@ -1226,7 +1226,7 @@ class Store extends AbstractModel implements */ protected function _beforeDelete() { - \Magento\App\ObjectManager::getInstance()->get( + \Magento\Framework\App\ObjectManager::getInstance()->get( 'Magento\Index\Model\Indexer' )->logEvent( $this, @@ -1258,7 +1258,7 @@ class Store extends AbstractModel implements protected function _afterDeleteCommit() { parent::_afterDeleteCommit(); - \Magento\App\ObjectManager::getInstance()->get( + \Magento\Framework\App\ObjectManager::getInstance()->get( 'Magento\Index\Model\Indexer' )->indexEvents( self::ENTITY, diff --git a/app/code/Magento/Store/Model/StoreManager.php b/app/code/Magento/Store/Model/StoreManager.php index 8a1dac6bf87dd382560055aad77b5efb486339d3..4c484bad658367fa25b0ed27fb67b8d6176deb8c 100644 --- a/app/code/Magento/Store/Model/StoreManager.php +++ b/app/code/Magento/Store/Model/StoreManager.php @@ -52,7 +52,7 @@ class StoreManager implements \Magento\Store\Model\StoreManagerInterface /** * Request model * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -91,14 +91,14 @@ class StoreManager implements \Magento\Store\Model\StoreManagerInterface /** * @param \Magento\Store\Model\StorageFactory $factory - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Core\Helper\Data $helper * @param string $scopeCode * @param string $scopeType */ public function __construct( \Magento\Store\Model\StorageFactory $factory, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\Core\Helper\Data $helper, $scopeCode = '', $scopeType = ScopeInterface::SCOPE_STORE diff --git a/app/code/Magento/Store/Model/StoresConfig.php b/app/code/Magento/Store/Model/StoresConfig.php index ceb106c4add430ecd39755619b90677227a47824..803de288139f0f1c109bced62831bd4107722999 100644 --- a/app/code/Magento/Store/Model/StoresConfig.php +++ b/app/code/Magento/Store/Model/StoresConfig.php @@ -24,6 +24,7 @@ namespace Magento\Store\Model; +use Magento\Exception\NoSuchEntityException; use Magento\Store\Model\StoreManagerInterface; class StoresConfig @@ -34,17 +35,17 @@ class StoresConfig protected $_storeManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** * @param StoreManagerInterface $storeManager - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( StoreManagerInterface $storeManager, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_storeManager = $storeManager; $this->_config = $config; @@ -64,8 +65,13 @@ class StoresConfig $storeValues = array(); /** @var $store \Magento\Store\Model\Store */ foreach ($stores as $store) { - $value = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $store->getCode()); - $storeValues[$store->getId()] = $value; + try { + $value = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $store->getCode()); + $storeValues[$store->getId()] = $value; + } catch (NoSuchEntityException $e) { + // Store doesn't really exist, so move on. + continue; + } } return $storeValues; } diff --git a/app/code/Magento/Store/Model/Website.php b/app/code/Magento/Store/Model/Website.php index e32f66c3d2b21b23604ad7b01822829787c41d9d..6cfb7ec0089f4f68ad386bce3a2f8765950e4b19 100644 --- a/app/code/Magento/Store/Model/Website.php +++ b/app/code/Magento/Store/Model/Website.php @@ -45,7 +45,7 @@ namespace Magento\Store\Model; */ class Website extends \Magento\Model\AbstractModel implements \Magento\Object\IdentityInterface, - \Magento\App\ScopeInterface + \Magento\Framework\App\ScopeInterface { const ENTITY = 'store_website'; @@ -182,7 +182,7 @@ class Website extends \Magento\Model\AbstractModel implements * @param \Magento\Model\Context $context * @param \Magento\Registry $registry * @param \Magento\Core\Model\Resource\Config\Data $configDataResource - * @param \Magento\App\Config\ScopeConfigInterface $coreConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Store\Model\StoreFactory $storeFactory * @param \Magento\Store\Model\GroupFactory $storeGroupFactory * @param \Magento\Store\Model\WebsiteFactory $websiteFactory @@ -196,7 +196,7 @@ class Website extends \Magento\Model\AbstractModel implements \Magento\Model\Context $context, \Magento\Registry $registry, \Magento\Core\Model\Resource\Config\Data $configDataResource, - \Magento\App\Config\ScopeConfigInterface $coreConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Store\Model\StoreFactory $storeFactory, \Magento\Store\Model\GroupFactory $storeGroupFactory, \Magento\Store\Model\WebsiteFactory $websiteFactory, diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index f46953f868aea5502763e1cd32813c6cfeb1c5cd..7f671849cb1c0af17841fe82fb8351e3487506a3 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -33,12 +33,12 @@ </type> <type name="Magento\Store\Model\Config\Reader\Website"> <arguments> - <argument name="scopePool" xsi:type="object">Magento\App\Config\ScopePool\Proxy</argument> + <argument name="scopePool" xsi:type="object">Magento\Framework\App\Config\ScopePool\Proxy</argument> </arguments> </type> <type name="Magento\Store\Model\Config\Reader\Store"> <arguments> - <argument name="scopePool" xsi:type="object">Magento\App\Config\ScopePool\Proxy</argument> + <argument name="scopePool" xsi:type="object">Magento\Framework\App\Config\ScopePool\Proxy</argument> <argument name="storeManager" xsi:type="object">Magento\Store\Model\StoreManagerInterface\Proxy</argument> </arguments> </type> @@ -63,12 +63,12 @@ </argument> </arguments> </type> - <preference for="Magento\App\Config\Scope\ReaderPoolInterface" type="Magento\Store\Model\Config\Reader\ReaderPool"/> - <preference for="Magento\App\ScopeResolverInterface" type="Magento\Store\Model\Resolver\Store" /> - <type name="Magento\App\Action\Action"> + <preference for="Magento\Framework\App\Config\Scope\ReaderPoolInterface" type="Magento\Store\Model\Config\Reader\ReaderPool"/> + <preference for="Magento\Framework\App\ScopeResolverInterface" type="Magento\Store\Model\Resolver\Store" /> + <type name="Magento\Framework\App\Action\Action"> <plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck" sortOrder="10"/> </type> - <type name="Magento\App\FrontController"> + <type name="Magento\Framework\App\FrontController"> <plugin name="dispatchExceptionHandler" type="Magento\Store\App\FrontController\Plugin\DispatchExceptionHandler" sortOrder="30"/> </type> <type name="Magento\Store\Model\Resource\Website\Collection"> @@ -94,13 +94,13 @@ </type> <type name="Magento\Store\Model\StoreManager"> <arguments> - <argument name="request" xsi:type="object">Magento\App\Request\Http\Proxy</argument> + <argument name="request" xsi:type="object">Magento\Framework\App\Request\Http\Proxy</argument> <argument name="helper" xsi:type="object">Magento\Core\Helper\Data\Proxy</argument> </arguments> </type> <virtualType name="Magento\Store\Model\Resource\Group\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Collection</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument> <argument name="cacheIdPrefix" xsi:type="string">app_</argument> <argument name="cacheTags" xsi:type="array"> <item name="storeTag" xsi:type="const">Magento\Store\Model\Store::CACHE_TAG</item> @@ -110,7 +110,7 @@ </virtualType> <virtualType name="Magento\Store\Model\Resource\Store\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Collection</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument> <argument name="cacheIdPrefix" xsi:type="string">app_</argument> <argument name="cacheTags" xsi:type="array"> <item name="storeTag" xsi:type="const">Magento\Store\Model\Store::CACHE_TAG</item> @@ -120,7 +120,7 @@ </virtualType> <virtualType name="Magento\Store\Model\Resource\Website\Collection\FetchStrategy" type="Magento\Data\Collection\Db\FetchStrategy\Cache"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Collection</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Collection</argument> <argument name="cacheIdPrefix" xsi:type="string">app_</argument> <argument name="cacheTags" xsi:type="array"> <item name="storeTag" xsi:type="const">Magento\Store\Model\Website::CACHE_TAG</item> @@ -130,7 +130,7 @@ </virtualType> <type name="Magento\Store\Model\Config\Processor\Placeholder"> <arguments> - <argument name="request" xsi:type="object">Magento\App\Request\Http\Proxy</argument> + <argument name="request" xsi:type="object">Magento\Framework\App\Request\Http\Proxy</argument> <argument name="urlPaths" xsi:type="array"> <item name="unsecureBaseUrl" xsi:type="string">web/unsecure/base_url</item> <item name="secureBaseUrl" xsi:type="string">web/secure/base_url</item> diff --git a/app/code/Magento/Store/etc/frontend/di.xml b/app/code/Magento/Store/etc/frontend/di.xml index d0e389d443ffa1c1c4c8ba664116bae3a79f1c47..5bbd8cf5597837f46a99a284a52e9ebf7b437650 100644 --- a/app/code/Magento/Store/etc/frontend/di.xml +++ b/app/code/Magento/Store/etc/frontend/di.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\FrontController"> + <type name="Magento\Framework\App\FrontController"> <plugin name="requestPreprocessor" type="Magento\Store\App\FrontController\Plugin\RequestPreprocessor" sortOrder="50"/> </type> </config> diff --git a/app/code/Magento/Store/view/frontend/switch/stores.phtml b/app/code/Magento/Store/view/frontend/switch/stores.phtml index 44131d6f85f61559348dbe89f8aef2645023cea6..493fc2ff3b55befc52cab36bc2f87870e2f9ea95 100644 --- a/app/code/Magento/Store/view/frontend/switch/stores.phtml +++ b/app/code/Magento/Store/view/frontend/switch/stores.phtml @@ -30,19 +30,28 @@ */ ?> <?php if(count($this->getGroups())>1): ?> -<div class="switcher-store"> - <label><?php echo __('Select Store') ?>:</label> - <ul id="select-store"> - <?php foreach ($this->getGroups() as $_group): ?> +<div class="switcher store"> + <strong class="label"><span><?php echo __('Select Store') ?></span></strong> + <div class="options"> + <?php foreach ($this->getGroups() as $_group): ?> <?php if ($_group->getId()==$this->getCurrentGroupId()): ?> - <li class="current"><strong><?php echo $this->escapeHtml($_group->getName()) ?></strong></li> - <?php else: ?> - <li> - <a href="#" data-post='<?php echo $this->getTargetStorePostData($_group->getDefaultStore()); ?>'> - <?php echo $this->escapeHtml($_group->getName()) ?></a> - </li> + <strong> + <span><?php echo $this->escapeHtml($_group->getName()) ?></span> + </strong> <?php endif; ?> - <?php endforeach; ?> - </ul> + <?php endforeach; ?> + <button type="button" data-toggle="dropdown" class="action switch"><span><?php echo __('Change')?></span></button> + <ul data-target="dropdown"> + <?php foreach ($this->getGroups() as $_group): ?> + <?php if (!($_group->getId()==$this->getCurrentGroupId())): ?> + <li> + <a href="#" data-post='<?php echo $this->getTargetStorePostData($_group->getDefaultStore()); ?>'> + <?php echo $this->escapeHtml($_group->getName()) ?> + </a> + </li> + <?php endif; ?> + <?php endforeach; ?> + </ul> + </div> </div> <?php endif; ?> diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Rate.php b/app/code/Magento/Tax/Controller/Adminhtml/Rate.php index bddcf561cfb7f462513bceb45bc0733fa6ab06a4..048d0f17c924f25011a4372606454bfa7aaab6db 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Rate.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Rate.php @@ -33,22 +33,22 @@ */ namespace Magento\Tax\Controller\Adminhtml; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Rate extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -337,7 +337,7 @@ class Rate extends \Magento\Backend\App\Action { $this->_view->loadLayout(false); $content = $this->_view->getLayout()->getChildBlock('adminhtml.tax.rate.grid', 'grid.export'); - return $this->_fileFactory->create('rates.csv', $content->getCsvFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create('rates.csv', $content->getCsvFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -349,7 +349,7 @@ class Rate extends \Magento\Backend\App\Action { $this->_view->loadLayout(false); $content = $this->_view->getLayout()->getChildBlock('adminhtml.tax.rate.grid', 'grid.export'); - return $this->_fileFactory->create('rates.xml', $content->getExcelFile(), \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create('rates.xml', $content->getExcelFile(), \Magento\Framework\App\Filesystem::VAR_DIR); } /** @@ -491,7 +491,7 @@ class Rate extends \Magento\Backend\App\Action $content .= $rate->toString($template) . "\n"; } $this->_view->loadLayout(); - return $this->_fileFactory->create('tax_rates.csv', $content, \Magento\App\Filesystem::VAR_DIR); + return $this->_fileFactory->create('tax_rates.csv', $content, \Magento\Framework\App\Filesystem::VAR_DIR); } /** diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index b62851c985bcf1bb583cab813ae3acb506fec0d7..8eb273b08cbbc334da1fd9bd479e7729146e7d76 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -27,11 +27,12 @@ namespace Magento\Tax\Helper; use Magento\Store\Model\Store; use Magento\Customer\Model\Address; +use Magento\Tax\Model\Config; /** * Catalog data helper */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { const PRICE_CONVERSION_PLUS = 1; @@ -44,9 +45,9 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Tax configuration object * - * @var \Magento\Tax\Model\Config + * @var Config */ - protected $_config = null; + protected $_config; /** * @var \Magento\Tax\Model\Calculation @@ -79,7 +80,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_applyTaxAfterDiscount; /** - * @var mixed + * @var int */ protected $_priceDisplayType; @@ -100,19 +101,19 @@ class Data extends \Magento\App\Helper\AbstractHelper * * @var \Magento\Core\Helper\Data */ - protected $_coreData = null; + protected $_coreData; /** * Core registry * * @var \Magento\Registry */ - protected $_coreRegistry = null; + protected $_coreRegistry; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -142,11 +143,11 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_localeResolver; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Tax\Model\Config $taxConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param Config $taxConfig * @param \Magento\Tax\Model\Calculation $calculation * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Locale\FormatInterface $localeFormat @@ -155,11 +156,11 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Locale\ResolverInterface $localeResolver */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Tax\Model\Config $taxConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + Config $taxConfig, \Magento\Tax\Model\Calculation $calculation, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Locale\FormatInterface $localeFormat, @@ -187,7 +188,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getPostCodeSubStringLength() { - $len = (int)$this->_postCodeSubStringLength; + $len = (int) $this->_postCodeSubStringLength; if ($len <= 0) { $len = 10; } @@ -197,7 +198,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Get tax configuration object * - * @return \Magento\Tax\Model\Config + * @return Config */ public function getConfig() { @@ -263,12 +264,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getIncExcText($flag, $store = null) { - if ($flag) { - $s = __('Incl. Tax'); - } else { - $s = __('Excl. Tax'); - } - return $s; + return $flag ? __('Incl. Tax') : __('Excl. Tax'); } /** @@ -297,19 +293,25 @@ class Data extends \Magento\App\Helper\AbstractHelper $res = false; if ($this->priceIncludesTax($store)) { switch ($this->getPriceDisplayType($store)) { - case \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX: - case \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH: + case Config::DISPLAY_TYPE_EXCLUDING_TAX: + case Config::DISPLAY_TYPE_BOTH: return self::PRICE_CONVERSION_MINUS; - case \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX: + case Config::DISPLAY_TYPE_INCLUDING_TAX: $res = true; + break; + default: + break; } } else { switch ($this->getPriceDisplayType($store)) { - case \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX: - case \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH: + case Config::DISPLAY_TYPE_INCLUDING_TAX: + case Config::DISPLAY_TYPE_BOTH: return self::PRICE_CONVERSION_PLUS; - case \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX: + case Config::DISPLAY_TYPE_EXCLUDING_TAX: $res = false; + break; + default: + break; } } @@ -590,24 +592,26 @@ class Data extends \Magento\App\Helper\AbstractHelper } else { if ($priceIncludesTax) { switch ($this->getPriceDisplayType($store)) { - case \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX: - case \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH: + case Config::DISPLAY_TYPE_EXCLUDING_TAX: + case Config::DISPLAY_TYPE_BOTH: $price = $this->_calculatePrice($price, $includingPercent, false); break; - - case \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX: + case Config::DISPLAY_TYPE_INCLUDING_TAX: $price = $this->_calculatePrice($price, $includingPercent, false); $price = $this->_calculatePrice($price, $percent, true); break; + default: + break; } } else { switch ($this->getPriceDisplayType($store)) { - case \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX: + case Config::DISPLAY_TYPE_INCLUDING_TAX: $price = $this->_calculatePrice($price, $percent, true); break; - - case \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH: - case \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX: + case Config::DISPLAY_TYPE_BOTH: + case Config::DISPLAY_TYPE_EXCLUDING_TAX: + break; + default: break; } } @@ -622,7 +626,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayPriceIncludingTax() { - return $this->getPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX; + return $this->getPriceDisplayType() == Config::DISPLAY_TYPE_INCLUDING_TAX; } /** @@ -632,7 +636,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayPriceExcludingTax() { - return $this->getPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX; + return $this->getPriceDisplayType() == Config::DISPLAY_TYPE_EXCLUDING_TAX; } /** @@ -642,11 +646,11 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayBothPrices() { - return $this->getPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH; + return $this->getPriceDisplayType() == Config::DISPLAY_TYPE_BOTH; } /** - * Calculate price imcluding/excluding tax base on tax rate percent + * Calculate price including/excluding tax base on tax rate percent * * @param float $price * @param float $percent @@ -697,7 +701,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayShippingPriceIncludingTax() { - return $this->getShippingPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX; + return $this->getShippingPriceDisplayType() == Config::DISPLAY_TYPE_INCLUDING_TAX; } /** @@ -705,7 +709,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayShippingPriceExcludingTax() { - return $this->getShippingPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_EXCLUDING_TAX; + return $this->getShippingPriceDisplayType() == Config::DISPLAY_TYPE_EXCLUDING_TAX; } /** @@ -713,7 +717,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function displayShippingBothPrices() { - return $this->getShippingPriceDisplayType() == \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH; + return $this->getShippingPriceDisplayType() == Config::DISPLAY_TYPE_BOTH; } /** @@ -827,7 +831,7 @@ class Data extends \Magento\App\Helper\AbstractHelper ' AND ', array( "tax_class_d.entity_id = {$priceTable}.entity_id", - $select->getAdapter()->quoteInto('tax_class_d.attribute_id = ?', (int)$taxClassAttribute->getId()), + $select->getAdapter()->quoteInto('tax_class_d.attribute_id = ?', (int) $taxClassAttribute->getId()), 'tax_class_d.store_id = 0' ) ); @@ -835,19 +839,20 @@ class Data extends \Magento\App\Helper\AbstractHelper ' AND ', array( "tax_class_c.entity_id = {$priceTable}.entity_id", - $select->getAdapter()->quoteInto('tax_class_c.attribute_id = ?', (int)$taxClassAttribute->getId()), - $select->getAdapter()->quoteInto('tax_class_c.store_id = ?', (int)$storeId) + $select->getAdapter()->quoteInto('tax_class_c.attribute_id = ?', (int) $taxClassAttribute->getId()), + $select->getAdapter()->quoteInto('tax_class_c.store_id = ?', (int) $storeId) ) ); - $select->joinLeft( - array('tax_class_d' => $taxClassAttribute->getBackend()->getTable()), - $joinConditionD, - array() - )->joinLeft( - array('tax_class_c' => $taxClassAttribute->getBackend()->getTable()), - $joinConditionC, - array() - ); + $select + ->joinLeft( + array('tax_class_d' => $taxClassAttribute->getBackend()->getTable()), + $joinConditionD, + array() + )->joinLeft( + array('tax_class_c' => $taxClassAttribute->getBackend()->getTable()), + $joinConditionC, + array() + ); return $this; } @@ -872,7 +877,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function getTaxBasedOn($store = null) { return $this->_scopeConfig->getValue( - \Magento\Tax\Model\Config::CONFIG_XML_PATH_BASED_ON, + Config::CONFIG_XML_PATH_BASED_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); @@ -887,7 +892,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function applyTaxOnCustomPrice($store = null) { return (int)$this->_scopeConfig->getValue( - \Magento\Tax\Model\Config::CONFIG_XML_PATH_APPLY_ON, + Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ) == 0; @@ -902,14 +907,15 @@ class Data extends \Magento\App\Helper\AbstractHelper public function applyTaxOnOriginalPrice($store = null) { return (int)$this->_scopeConfig->getValue( - \Magento\Tax\Model\Config::CONFIG_XML_PATH_APPLY_ON, + Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ) == 1; } /** - * Get taxes/discounts calculation sequence. + * Get taxes/discounts calculation sequence + * * This sequence depends on "Catalog price include tax", "Apply Tax After Discount" * and "Apply Discount On Prices Including Tax" configuration options. * diff --git a/app/code/Magento/Tax/Model/Calculation.php b/app/code/Magento/Tax/Model/Calculation.php index 3471e4c8a2420e298d82f8a957dfc1873e05be88..b12418298233a9f35c03efc90e56a14d5b2a2172 100644 --- a/app/code/Magento/Tax/Model/Calculation.php +++ b/app/code/Magento/Tax/Model/Calculation.php @@ -29,6 +29,7 @@ use Magento\Customer\Service\V1\Data\CustomerBuilder; use Magento\Customer\Service\V1\Data\Region as RegionDataObject; use Magento\Customer\Service\V1\CustomerAddressServiceInterface as AddressServiceInterface; use Magento\Customer\Service\V1\CustomerGroupServiceInterface as GroupServiceInterface; +use Magento\Customer\Service\V1\CustomerAccountServiceInterface; use Magento\Exception\NoSuchEntityException; /** @@ -76,7 +77,7 @@ class Calculation extends \Magento\Model\AbstractModel protected $_rateCalculationProcess = array(); /** - * @var \Magento\Customer\Model\Customer|bool + * @var CustomerDataObject|bool */ protected $_customer; @@ -88,7 +89,7 @@ class Calculation extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -123,19 +124,19 @@ class Calculation extends \Magento\Model\AbstractModel protected $_groupService; /** - * @var \Magento\Customer\Model\Converter + * @var CustomerAccountServiceInterface */ - protected $_converter; + protected $customerAccountService; /** * @var CustomerBuilder */ - protected $_customerBuilder; + protected $customerBuilder; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\GroupFactory $groupFactory * @param \Magento\Customer\Model\Session $customerSession @@ -144,15 +145,16 @@ class Calculation extends \Magento\Model\AbstractModel * @param \Magento\Tax\Model\Resource\Calculation $resource * @param AddressServiceInterface $addressService * @param GroupServiceInterface $groupService - * @param \Magento\Customer\Model\Converter $converter + * @param CustomerAccountServiceInterface $customerAccount * @param CustomerBuilder $customerBuilder * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data + * @internal param \Magento\Customer\Model\Converter $converter */ public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\GroupFactory $groupFactory, \Magento\Customer\Model\Session $customerSession, @@ -161,7 +163,7 @@ class Calculation extends \Magento\Model\AbstractModel \Magento\Tax\Model\Resource\Calculation $resource, AddressServiceInterface $addressService, GroupServiceInterface $groupService, - \Magento\Customer\Model\Converter $converter, + CustomerAccountServiceInterface $customerAccount, CustomerBuilder $customerBuilder, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -174,9 +176,8 @@ class Calculation extends \Magento\Model\AbstractModel $this->_classesFactory = $classesFactory; $this->_addressService = $addressService; $this->_groupService = $groupService; - $this->_converter = $converter; - $this->_customerBuilder = $customerBuilder; - + $this->customerAccountService = $customerAccount; + $this->customerBuilder = $customerBuilder; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -188,20 +189,6 @@ class Calculation extends \Magento\Model\AbstractModel $this->_init('Magento\Tax\Model\Resource\Calculation'); } - /** - * Specify customer object which can be used for rate calculation - * - * @deprecated in favor of \Magento\Tax\Model\Calculation::setCustomerData - * - * @param \Magento\Customer\Model\Customer $customer - * @return $this - */ - public function setCustomer(\Magento\Customer\Model\Customer $customer) - { - $this->_customer = $customer; - return $this; - } - /** * Specify customer object which can be used for rate calculation * @@ -210,9 +197,7 @@ class Calculation extends \Magento\Model\AbstractModel */ public function setCustomerData(CustomerDataObject $customerData) { - /* @TODO: remove model usage in favor of Data Object */ - $customer = $this->_converter->createCustomerModel($customerData); - $this->setCustomer($customer); + $this->_customer = $customerData; return $this; } @@ -233,43 +218,23 @@ class Calculation extends \Magento\Model\AbstractModel } /** - * Get customer object - * - * @deprecated in favor of \Magento\Tax\Model\Calculation::getCustomerData + * Retrieve customer data object * - * @return \Magento\Customer\Model\Customer|bool + * @return CustomerDataObject */ - public function getCustomer() + public function getCustomerData() { if ($this->_customer === null) { if ($this->_customerSession->isLoggedIn()) { - $this->_customer = $this->_customerSession->getCustomer(); + $this->_customer = $this->_customerSession->getCustomerDataObject(); } elseif ($this->_customerSession->getCustomerId()) { - /** @var $customer \Magento\Customer\Model\Customer */ - $customer = $this->_customerFactory->create(); - $this->_customer = $customer->load($this->_customerSession->getCustomerId()); + $this->_customer = $this->customerAccountService->getCustomer($this->_customerSession->getCustomerId()); } else { - $this->_customer = false; + $this->_customer = $this->customerBuilder->create(); } } - return $this->_customer; - } - /** - * Retrieve customer data object - * - * @return CustomerDataObject - */ - public function getCustomerData() - { - /* @TODO: remove this code in favor of setCustomerData*/ - $customerModel = $this->getCustomer(); - //getCustomer can return false. Returning empty data object as a workaround. This behavior needs to be fixed - // for now till the time \Magento\Tax\Model\Calculation::getCustomer is removed. - if (!$customerModel) { - return $this->_customerBuilder->create(); - } - return $this->_converter->createCustomerFromModel($customerModel); + return $this->_customer; } /** @@ -387,15 +352,11 @@ class Calculation extends \Magento\Model\AbstractModel protected function _getRequestCacheKey($request) { $key = $request->getStore() ? $request->getStore()->getId() . '|' : ''; - $key .= $request->getProductClassId() . - '|' . - $request->getCustomerClassId() . - '|' . - $request->getCountryId() . - '|' . - $request->getRegionId() . - '|' . - $request->getPostcode(); + $key .= $request->getProductClassId() . '|' + . $request->getCustomerClassId() . '|' + . $request->getCountryId() . '|' + . $request->getRegionId() . '|' + . $request->getPostcode(); return $key; } @@ -462,7 +423,7 @@ class Calculation extends \Magento\Model\AbstractModel * @param null|bool|\Magento\Object $shippingAddress * @param null|bool||\Magento\Object $billingAddress * @param null|int $customerTaxClass - * @param null|int $store + * @param null|int|\Magento\Store\Model\Store $store * @return \Magento\Object */ public function getRateRequest( @@ -486,11 +447,11 @@ class Calculation extends \Magento\Model\AbstractModel ) { $basedOn = 'default'; } else { - if (($billingAddress === false || is_null( - $billingAddress - ) || !$billingAddress->getCountryId()) && $basedOn == 'billing' || ($shippingAddress === false || is_null( - $shippingAddress - ) || !$shippingAddress->getCountryId()) && $basedOn == 'shipping' + + if (($billingAddress === false || is_null($billingAddress) || !$billingAddress->getCountryId()) + && $basedOn == 'billing' + || ($shippingAddress === false || is_null($shippingAddress) || !$shippingAddress->getCountryId()) + && $basedOn == 'shipping' ) { if ($customerData->getId()) { try { @@ -503,9 +464,9 @@ class Calculation extends \Magento\Model\AbstractModel } catch (NoSuchEntityException $e) { } - if ($basedOn == 'billing' && $defaultBilling && $defaultBilling->getCountryId()) { + if ($basedOn == 'billing' && isset($defaultBilling) && $defaultBilling->getCountryId()) { $billingAddress = $defaultBilling; - } elseif ($basedOn == 'shipping' && $defaultShipping && $defaultShipping->getCountryId()) { + } elseif ($basedOn == 'shipping' && isset($defaultShipping) && $defaultShipping->getCountryId()) { $shippingAddress = $defaultShipping; } else { $basedOn = 'default'; diff --git a/app/code/Magento/Tax/Model/ClassModel.php b/app/code/Magento/Tax/Model/ClassModel.php index f07cdec6488b5a716e3fccf4f06319b272e13538..7404979182579a8dd3f281eb27b7f517bff175c9 100644 --- a/app/code/Magento/Tax/Model/ClassModel.php +++ b/app/code/Magento/Tax/Model/ClassModel.php @@ -107,12 +107,10 @@ class ClassModel extends \Magento\Model\AbstractModel ); } - $objectCount = $typeModel->getAssignedToObjects()->getSize(); - if ($objectCount > 0) { + if ($typeModel->isAssignedToObjects()) { throw new \Magento\Model\Exception( __( - 'You cannot delete this tax class because it is used for %1 %2(s).', - $objectCount, + 'You cannot delete this tax class because it is used in existing %1(s).', $typeModel->getObjectTypeName() ) ); diff --git a/app/code/Magento/Tax/Model/Config.php b/app/code/Magento/Tax/Model/Config.php index 08ee1e830505cc972ce2dbb734ca16a00856c562..7944bcaa52309d7dc2e0b7206336cfad248e493b 100644 --- a/app/code/Magento/Tax/Model/Config.php +++ b/app/code/Magento/Tax/Model/Config.php @@ -131,14 +131,14 @@ class Config /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $scopeConfig) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->_scopeConfig = $scopeConfig; } diff --git a/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php b/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php index 9e7443dacf2419958aa8d81815099a1f0862ef83..05270d3446397d9838fda0ba87292010897e1262 100644 --- a/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php +++ b/app/code/Magento/Tax/Model/Config/Price/IncludePrice.php @@ -25,7 +25,7 @@ */ namespace Magento\Tax\Model\Config\Price; -class IncludePrice extends \Magento\App\Config\Value +class IncludePrice extends \Magento\Framework\App\Config\Value { /** * @return void diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index b3f6df0759f574ec00dd2a2c9dee50f6161a8f7a..348832dbf5d7f4b9b8cf4e2acee6e6fe05fb0aca 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -59,12 +59,12 @@ class Calculation extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Tax\Helper\Data $taxData, \Magento\Store\Model\StoreManagerInterface $storeManager ) { diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 121a3ec35d2b979b38b51a3463da709ff0412e79..22a4e0bfb0153e51f5d1e62785741a2130d53ccd 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -42,7 +42,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedAtFactory; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -52,7 +52,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Logger $logger, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, diff --git a/app/code/Magento/Tax/Model/Resource/Setup.php b/app/code/Magento/Tax/Model/Resource/Setup.php index 76c86c34f0b95c3588bc1365c473ef46821e856d..1b281fa2bd7aff5ba060f2df2ed60b23c4a3c8e1 100644 --- a/app/code/Magento/Tax/Model/Resource/Setup.php +++ b/app/code/Magento/Tax/Model/Resource/Setup.php @@ -43,9 +43,9 @@ class Setup extends \Magento\Sales\Model\Resource\Setup /** * @param \Magento\Eav\Model\Entity\Setup\Context $context * @param string $resourceName - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Catalog\Model\Resource\SetupFactory $setupFactory * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig * @param string $moduleName @@ -54,9 +54,9 @@ class Setup extends \Magento\Sales\Model\Resource\Setup public function __construct( \Magento\Eav\Model\Entity\Setup\Context $context, $resourceName, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGroupCollectionFactory, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Model\Resource\SetupFactory $setupFactory, \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig, $moduleName = 'Magento_Tax', diff --git a/app/code/Magento/Tax/Model/TaxClass/Type/Customer.php b/app/code/Magento/Tax/Model/TaxClass/Type/Customer.php index 72dc25b1b79ca91dbd5e163c90c86bc5698ad451..52babb147afb64fc857591ebc3d0e01d29c909b2 100644 --- a/app/code/Magento/Tax/Model/TaxClass/Type/Customer.php +++ b/app/code/Magento/Tax/Model/TaxClass/Type/Customer.php @@ -23,8 +23,6 @@ */ namespace Magento\Tax\Model\TaxClass\Type; -use Magento\Customer\Service\V1\Data\CustomerGroup; - /** * Customer Tax Class */ @@ -46,7 +44,7 @@ class Customer extends \Magento\Tax\Model\TaxClass\AbstractType protected $filterBuilder; /** - * @var \Magento\Customer\Service\V1\Data\SearchCriteriaBuilder + * @var \Magento\Service\V1\Data\SearchCriteriaBuilder */ protected $searchCriteriaBuilder; @@ -59,53 +57,36 @@ class Customer extends \Magento\Tax\Model\TaxClass\AbstractType /** * @param \Magento\Tax\Model\Calculation\Rule $calculationRule - * @param \Magento\Customer\Model\Group $modelCustomerGroup * @param \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService * @param \Magento\Service\V1\Data\FilterBuilder $filterBuilder - * @param \Magento\Customer\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder * @param array $data */ public function __construct( \Magento\Tax\Model\Calculation\Rule $calculationRule, - \Magento\Customer\Model\Group $modelCustomerGroup, \Magento\Customer\Service\V1\CustomerGroupServiceInterface $groupService, \Magento\Service\V1\Data\FilterBuilder $filterBuilder, - \Magento\Customer\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder, + \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteriaBuilder, array $data = array() ) { parent::__construct($calculationRule, $data); - $this->_modelCustomerGroup = $modelCustomerGroup; $this->groupService = $groupService; $this->filterBuilder = $filterBuilder; $this->searchCriteriaBuilder = $searchCriteriaBuilder; } /** - * Get Customer Groups with this tax class - * - * @deprecated In favor of getAssignedDataObjects. This function should be removed once all the implementations of - * \Magento\Tax\Model\TaxClass\Type\TypeInterface::getAssignedToObjects are refactored to return Data Objects. - * Will be revisited in MAGETWO-21827 - * - * @return \Magento\Model\Resource\Db\Collection\AbstractCollection - */ - public function getAssignedToObjects() - { - return $this->_modelCustomerGroup->getCollection()->addFieldToFilter('tax_class_id', $this->getId()); - } - - /** - * Get Customer Groups Data Objects with this tax class - * - * @return CustomerGroup[] + * {@inheritdoc} */ - public function getAssignedDataObjects() + public function isAssignedToObjects() { $searchCriteria = $this->searchCriteriaBuilder->addFilter( - $this->filterBuilder->setField('tax_class_id')->setValue($this->getId())->create() + [$this->filterBuilder->setField('tax_class_id')->setValue($this->getId())->create()] )->create(); + $result = $this->groupService->searchGroups($searchCriteria); - return $result->getItems(); + $items = $result->getItems(); + return !empty($items); } /** diff --git a/app/code/Magento/Tax/Model/TaxClass/Type/Product.php b/app/code/Magento/Tax/Model/TaxClass/Type/Product.php index 3bafa2e6247d9294fbaec77ea6e7f005b0b934d5..5e2ca82dabcd5aaebc757d3e6ddba72646de2022 100644 --- a/app/code/Magento/Tax/Model/TaxClass/Type/Product.php +++ b/app/code/Magento/Tax/Model/TaxClass/Type/Product.php @@ -58,13 +58,12 @@ class Product extends \Magento\Tax\Model\TaxClass\AbstractType } /** - * Get Products with this tax class - * - * @return \Magento\Model\Resource\Db\Collection\AbstractCollection + * {@inheritdoc} */ - public function getAssignedToObjects() + public function isAssignedToObjects() { - return $this->_modelProduct->getCollection()->addAttributeToFilter('tax_class_id', $this->getId()); + return $this->_modelProduct->getCollection()->addAttributeToFilter('tax_class_id', $this->getId()) + ->getSize() > 0; } /** diff --git a/app/code/Magento/Tax/Model/TaxClass/Type/TypeInterface.php b/app/code/Magento/Tax/Model/TaxClass/Type/TypeInterface.php index 56a4b56a6125f0d80926640c33d598ddbf643941..c338ec166b17b3a3ff8b0b9527d5163645ddc401 100644 --- a/app/code/Magento/Tax/Model/TaxClass/Type/TypeInterface.php +++ b/app/code/Magento/Tax/Model/TaxClass/Type/TypeInterface.php @@ -32,11 +32,11 @@ namespace Magento\Tax\Model\TaxClass\Type; interface TypeInterface { /** - * Get Collection of Objects that are assigned to this tax class + * Check are any objects assigned to the tax class * - * @return \Magento\Model\Resource\Db\Collection\AbstractCollection + * @return bool */ - public function getAssignedToObjects(); + public function isAssignedToObjects(); /** * Get Collection of Tax Rules that are assigned to this tax class diff --git a/app/code/Magento/Tax/Pricing/Adjustment.php b/app/code/Magento/Tax/Pricing/Adjustment.php new file mode 100644 index 0000000000000000000000000000000000000000..200c8216f5f30a706fd89dd9d54f3cf6bffff196 --- /dev/null +++ b/app/code/Magento/Tax/Pricing/Adjustment.php @@ -0,0 +1,145 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Tax + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Tax\Pricing; + +use Magento\Pricing\Adjustment\AdjustmentInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Tax\Helper\Data as TaxHelper; + +/** + * Tax pricing adjustment model + */ +class Adjustment implements AdjustmentInterface +{ + /** + * Adjustment code tax + */ + const CODE = 'tax'; + + /** + * @var TaxHelper + */ + protected $taxHelper; + + /** + * @var int|null + */ + protected $sortOrder; + + /** + * @param TaxHelper $taxHelper + * @param int $sortOrder + */ + public function __construct(TaxHelper $taxHelper, $sortOrder = null) + { + $this->taxHelper = $taxHelper; + $this->sortOrder = $sortOrder; + } + + /** + * Get adjustment code + * + * @return string + */ + public function getAdjustmentCode() + { + return self::CODE; + } + + /** + * Define if adjustment is included in base price + * + * @return bool + */ + public function isIncludedInBasePrice() + { + return $this->taxHelper->priceIncludesTax(); + } + + /** + * Define if adjustment is included in display price + * + * @return bool + */ + public function isIncludedInDisplayPrice() + { + return $this->taxHelper->displayPriceIncludingTax() || $this->taxHelper->displayBothPrices(); + } + + /** + * Extract adjustment amount from the given amount value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function extractAdjustment($amount, SaleableInterface $saleableItem) + { + if ($this->taxHelper->priceIncludesTax()) { + $adjustedAmount = $this->taxHelper->getPrice($saleableItem, $amount); + $result = $amount - $adjustedAmount; + } else { + $result = 0.; + } + return $result; + } + + /** + * Apply adjustment amount and return result value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function applyAdjustment($amount, SaleableInterface $saleableItem) + { + $includingTax = !$this->taxHelper->priceIncludesTax(); + $amount = $this->taxHelper->getPrice($saleableItem, $amount, $includingTax); + return $amount; + } + + /** + * Check if adjustment should be excluded from calculations along with the given adjustment + * + * @param string $adjustmentCode + * @return bool + */ + public function isExcludedWith($adjustmentCode) + { + return $this->getAdjustmentCode() === $adjustmentCode; + } + + /** + * Return sort order position + * + * @return int + */ + public function getSortOrder() + { + return $this->sortOrder; + } +} diff --git a/app/code/Magento/Tax/Pricing/Render/Adjustment.php b/app/code/Magento/Tax/Pricing/Render/Adjustment.php new file mode 100644 index 0000000000000000000000000000000000000000..0fb9b65c2020dba93fa1e5800a0b63f318d59302 --- /dev/null +++ b/app/code/Magento/Tax/Pricing/Render/Adjustment.php @@ -0,0 +1,166 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Tax\Pricing\Render; + +use Magento\View\Element\Template; +use Magento\Pricing\Render\AbstractAdjustment; +use Magento\Pricing\PriceCurrencyInterface; + +/** + * @method string getIdSuffix() + * @method string getDisplayLabel() + */ +class Adjustment extends AbstractAdjustment +{ + /** + * @var \Magento\Tax\Helper\Data + */ + protected $taxHelper; + + /** + * @param Template\Context $context + * @param \Magento\Tax\Helper\Data $helper + * @param PriceCurrencyInterface $priceCurrency + * @param array $data + */ + public function __construct( + Template\Context $context, + PriceCurrencyInterface $priceCurrency, + \Magento\Tax\Helper\Data $helper, + array $data = [] + ) { + $this->taxHelper = $helper; + parent::__construct($context, $priceCurrency, $data); + } + + /** + * @return null + */ + protected function apply() + { + $html = $this->toHtml(); + if ($this->displayBothPrices()) { + if ($this->getZone() !== \Magento\Pricing\Render::ZONE_ITEM_OPTION) { + $this->amountRender->setPriceDisplayLabel(__('Excl. Tax:')); + } + $this->amountRender->setPriceId( + $this->buildIdWithPrefix('price-excluding-tax-') + ); + $this->amountRender->setDisplayValue( + $this->amountRender->getDisplayValue() - + $this->amountRender->getAmount()->getAdjustmentAmount($this->getAdjustmentCode()) + ); + } elseif ($this->displayPriceExcludingTax()) { + + $this->amountRender->setDisplayValue( + $this->amountRender->getDisplayValue() - + $this->amountRender->getAmount()->getAdjustmentAmount($this->getAdjustmentCode()) + ); + } + if (trim($html)) { + $this->amountRender->addAdjustmentHtml($this->getAdjustmentCode(), $html); + } + } + + /** + * Obtain code of adjustment type + * + * @return string + */ + public function getAdjustmentCode() + { + //@TODO We can build two model using DI, not code. What about passing it in constructor? + return \Magento\Tax\Pricing\Adjustment::CODE; + } + + /** + * Define if both prices should be displayed + * + * @return bool + */ + public function displayBothPrices() + { + return $this->taxHelper->displayBothPrices(); + } + + /** + * Obtain display amount excluding tax + * + * @return string + */ + public function getDisplayAmountExclTax() + { + // todo use 'excludeWith' method instead hard-coded list here + return $this->convertAndFormatCurrency($this->amountRender->getAmount()->getValue(['tax', 'weee']), false); + } + + /** + * Obtain display amount + * + * @param bool $includeContainer + * @return string + */ + public function getDisplayAmount($includeContainer = true) + { + return $this->convertAndFormatCurrency($this->amountRender->getAmount()->getValue(), $includeContainer); + } + + /** + * Build identifier with prefix + * + * @param string $prefix + * @return string + */ + public function buildIdWithPrefix($prefix) + { + $priceId = $this->getPriceId(); + if (!$priceId) { + $priceId = $this->getSaleableItem()->getId(); + } + return $prefix . $priceId . $this->getIdSuffix(); + } + + /** + * Should be displayed price including tax + * + * @return bool + */ + public function displayPriceIncludingTax() + { + return $this->taxHelper->displayPriceIncludingTax(); + } + + /** + * Should be displayed price excluding tax + * + * @return bool + */ + public function displayPriceExcludingTax() + { + return $this->taxHelper->displayPriceExcludingTax(); + } +} diff --git a/app/code/Magento/Tax/etc/adminhtml/routes.xml b/app/code/Magento/Tax/etc/adminhtml/routes.xml index 70f3b15223ff576f11e22af2b1b55446a0ab7b29..0df2f8fe88e9e45a1aa55a7f47581e4e7584280b 100644 --- a/app/code/Magento/Tax/etc/adminhtml/routes.xml +++ b/app/code/Magento/Tax/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="tax" frontName="tax"> <module name="Magento_Tax" /> diff --git a/app/code/Magento/Tax/etc/di.xml b/app/code/Magento/Tax/etc/di.xml index fe7b5f4233762c1c184d15c25d4d020cd2efe31e..9243606f9f5b51c0abbb0576cbe73eaad8fce160 100644 --- a/app/code/Magento/Tax/etc/di.xml +++ b/app/code/Magento/Tax/etc/di.xml @@ -41,4 +41,14 @@ <argument name="taxData" xsi:type="object">Magento\Tax\Helper\Data\Proxy</argument> </arguments> </type> + <type name="Magento\Pricing\Adjustment\Pool"> + <arguments> + <argument name="adjustments" xsi:type="array"> + <item name="tax" xsi:type="array"> + <item name="className" xsi:type="string">Magento\Tax\Pricing\Adjustment</item> + <item name="sortOrder" xsi:type="string">20</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml index d795d2be7a686108af42bfc92281c9bde7623f5d..7e5f4a76f978e6eb53601a2a55e753ce862c16fe 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rate_block.xml @@ -61,16 +61,16 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Tax Identifier</argument> <argument name="header_export" xsi:type="string" translate="true">Code</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="filter_index" xsi:type="string">main_table.code</argument> <argument name="index" xsi:type="string">code</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="tax_country_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Country</argument> <argument name="type" xsi:type="string">country</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="filter_index" xsi:type="string">main_table.tax_country_id</argument> <argument name="index" xsi:type="string">tax_country_id</argument> <argument name="renderer" xsi:type="string">Magento\Tax\Block\Adminhtml\Rate\Grid\Renderer\Country</argument> @@ -81,7 +81,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">State/Region</argument> <argument name="header_export" xsi:type="string" translate="true">State</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="filter_index" xsi:type="string">region_table.code</argument> <argument name="index" xsi:type="string">region_name</argument> <argument name="default" xsi:type="string">*</argument> @@ -90,7 +89,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="tax_postcode"> <arguments> <argument name="header" xsi:type="string" translate="true">Zip/Post Code</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">tax_postcode</argument> <argument name="default" xsi:type="string">*</argument> </arguments> @@ -98,11 +96,12 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="rate"> <arguments> <argument name="header" xsi:type="string" translate="true">Rate</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="index" xsi:type="string">rate</argument> <argument name="type" xsi:type="string">number</argument> <argument name="default" xsi:type="string">0.00</argument> <argument name="renderer" xsi:type="string">Magento\Tax\Block\Adminhtml\Rate\Grid\Renderer\Data</argument> + <argument name="column_css_class" xsi:type="string">col-price</argument> + <argument name="header_css_class" xsi:type="string">col-price</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml index e5ad4a650fb2958bcfb64a9ac63cc533e334c875..c64f797803d1ae57802e66f8de09d98001f24dc0 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_block.xml @@ -46,16 +46,16 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Name</argument> <argument name="index" xsi:type="string">code</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="type" xsi:type="string">longtext</argument> <argument name="filter_index" xsi:type="string">code</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="customer_tax_classes"> <arguments> <argument name="header" xsi:type="string" translate="true">Customer Tax Class</argument> <argument name="sortable" xsi:type="string">0</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">customer_tax_classes</argument> <argument name="filter_index" xsi:type="string">ctc.customer_tax_class_id</argument> <argument name="show_missing_option_values" xsi:type="string">1</argument> @@ -67,7 +67,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Product Tax Class</argument> <argument name="sortable" xsi:type="string">0</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">product_tax_classes</argument> <argument name="filter_index" xsi:type="string">ptc.product_tax_class_id</argument> <argument name="show_missing_option_values" xsi:type="string">1</argument> @@ -79,19 +78,19 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Tax Rate</argument> <argument name="sortable" xsi:type="string">0</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">tax_rates</argument> <argument name="filter_index" xsi:type="string">rate.tax_calculation_rate_id</argument> <argument name="show_missing_option_values" xsi:type="string">1</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Tax\Model\Resource\Rule\Grid\Options\HashOptimized"/> + <argument name="column_css_class" xsi:type="string">col-title</argument> + <argument name="header_css_class" xsi:type="string">col-title</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="priority"> <arguments> <argument name="header" xsi:type="string" translate="true">Priority</argument> <argument name="index" xsi:type="string">priority</argument> - <argument name="width" xsi:type="string">50</argument> <argument name="type" xsi:type="string">text</argument> </arguments> </block> @@ -99,7 +98,6 @@ <arguments> <argument name="header" xsi:type="string" translate="true">Sort Order</argument> <argument name="index" xsi:type="string">position</argument> - <argument name="width" xsi:type="string">50</argument> <argument name="type" xsi:type="string">text</argument> </arguments> </block> diff --git a/app/code/Magento/Tax/view/frontend/layout/catalog_product_prices.xml b/app/code/Magento/Tax/view/frontend/layout/catalog_product_prices.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdecd4bc1b228004be313a43e66e41c166b52b17 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/layout/catalog_product_prices.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="render.product.prices"> + <arguments> + <argument name="default" xsi:type="array"> + <item name="adjustments" xsi:type="array"> + <item name="default" xsi:type="array"> + <item name="tax" xsi:type="array"> + <item name="adjustment_render_class" xsi:type="string">Magento\Tax\Pricing\Render\Adjustment</item> + <item name="adjustment_render_template" xsi:type="string">Magento_Tax::pricing/adjustment.phtml</item> + </item> + </item> + </item> + </argument> + <argument name="downloadable" xsi:type="array"> + <item name="adjustments" xsi:type="array"> + <item name="link_price" xsi:type="array"> + <item name="tax" xsi:type="array"> + <item name="adjustment_render_class" xsi:type="string">Magento\Tax\Pricing\Render\Adjustment</item> + <item name="adjustment_render_template" xsi:type="string">Magento_Tax::pricing/adjustment/downloadable.phtml</item> + </item> + </item> + </item> + </argument> + <argument name="bundle" xsi:type="array"> + <item name="adjustments" xsi:type="array"> + <item name="bundle_option" xsi:type="array"> + <item name="tax" xsi:type="array"> + <item name="adjustment_render_class" xsi:type="string">Magento\Tax\Pricing\Render\Adjustment</item> + <item name="adjustment_render_template" xsi:type="string">Magento_Tax::pricing/adjustment/bundle.phtml</item> + </item> + </item> + </item> + </argument> + </arguments> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Tax/view/frontend/pricing/adjustment.phtml b/app/code/Magento/Tax/view/frontend/pricing/adjustment.phtml new file mode 100644 index 0000000000000000000000000000000000000000..13f3a05cf1ada9a2b9ffbb68f24345b2efa86054 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/pricing/adjustment.phtml @@ -0,0 +1,37 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php /** @var \Magento\Tax\Pricing\Render\Adjustment $this */ ?> + +<?php if ($this->displayBothPrices()): ?> + <span class="price-including-tax"> + <span class="label"><?php echo __('Incl. Tax:') ?></span> + <span class="price" id="<?php echo $this->buildIdWithPrefix('price-including-tax-') ?>"> + <?php echo $this->getDisplayAmount(false) ?> + </span> + </span> +<?php endif; ?> diff --git a/app/code/Magento/Tax/view/frontend/pricing/adjustment/bundle.phtml b/app/code/Magento/Tax/view/frontend/pricing/adjustment/bundle.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d9da473cc9ce46950677af825e1d737382ab83a0 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/pricing/adjustment/bundle.phtml @@ -0,0 +1,39 @@ + +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php /** @var \Magento\Tax\Pricing\Render\Adjustment $this */ ?> +<?php if ($this->displayPriceIncludingTax()): ?> + <?php echo $this->getDisplayAmount() ?> +<?php elseif ($this->displayPriceExcludingTax()): ?> + <?php echo $this->getDisplayAmountExclTax() ?>< +<?php elseif ($this->displayBothPrices()): ?> + <?php echo $this->getDisplayAmountExclTax() ?> + <?php if ($this->getDisplayAmountExclTax() !== $this->getDisplayAmount()): ?> + (+<?php echo $this->getDisplayAmount() ?> Incl. Tax) + <?php endif; ?> +<?php endif; ?> \ No newline at end of file diff --git a/app/code/Magento/Tax/view/frontend/pricing/adjustment/downloadable.phtml b/app/code/Magento/Tax/view/frontend/pricing/adjustment/downloadable.phtml new file mode 100644 index 0000000000000000000000000000000000000000..85ef59ded848baf3c738d36285706da632762d6d --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/pricing/adjustment/downloadable.phtml @@ -0,0 +1,45 @@ + +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php /** @var \Magento\Tax\Pricing\Render\Adjustment $this */ ?> +<span class="price-notice">+ + <?php if ($this->displayPriceIncludingTax()): ?> + <span class="price" id="<?php echo $this->buildIdWithPrefix('link-price-including-tax-') ?>"> + <?php echo $this->getDisplayAmount() ?></span> + <?php elseif ($this->displayPriceExcludingTax()): ?> + <span class="price" id="<?php echo $this->buildIdWithPrefix('link-price-excluding-tax-') ?>"> + <?php echo $this->getDisplayAmountExclTax() ?></span> + <?php elseif ($this->displayBothPrices()): ?> + <span class="price" id="<?php echo $this->buildIdWithPrefix('link-price-both-tax-') ?>"> + <?php echo $this->getDisplayAmountExclTax() ?> + <?php if ($this->getDisplayAmountExclTax() !== $this->getDisplayAmount()): ?> + (+<?php echo $this->getDisplayAmount() ?> Incl. Tax) + <?php endif; ?> + </span> + <?php endif; ?> +</span> \ No newline at end of file diff --git a/app/code/Magento/Theme/Block/Html/Footer.php b/app/code/Magento/Theme/Block/Html/Footer.php index 2802dc5b08cc81bf2bb5eb6ab07b03861cacff77..736ebb6a20bd8c592589de8d353cf9f23054ce17 100644 --- a/app/code/Magento/Theme/Block/Html/Footer.php +++ b/app/code/Magento/Theme/Block/Html/Footer.php @@ -36,18 +36,18 @@ class Footer extends \Magento\View\Element\Template implements \Magento\View\Blo protected $_copyright; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; /** * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, array $data = array() ) { $this->httpContext = $httpContext; diff --git a/app/code/Magento/Theme/Block/Html/Header.php b/app/code/Magento/Theme/Block/Html/Header.php index ccba737c558c55904fc47f87c7b025bc224f1fa6..93f7a4c5e888c0ecf56357d24924ede2fd11a2c7 100644 --- a/app/code/Magento/Theme/Block/Html/Header.php +++ b/app/code/Magento/Theme/Block/Html/Header.php @@ -21,9 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Theme\Block\Html; use Magento\Customer\Helper\Data; +use Magento\Customer\Helper\View as CustomerViewHelper; /** * Html page header block @@ -48,28 +50,36 @@ class Header extends \Magento\View\Element\Template protected $_fileStorageHelper; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; + /** + * @var \Magento\Customer\Helper\View + */ + protected $_customerViewHelper; + /** * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Helper\File\Storage\Database $fileStorageHelper - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext + * @param CustomerViewHelper $customerViewHelper * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Core\Helper\File\Storage\Database $fileStorageHelper, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, + CustomerViewHelper $customerViewHelper, array $data = array() ) { $this->_fileStorageHelper = $fileStorageHelper; $this->_customerSession = $customerSession; parent::__construct($context, $data); $this->httpContext = $httpContext; + $this->_customerViewHelper = $customerViewHelper; $this->_isScopePrivate = true; } @@ -123,9 +133,12 @@ class Header extends \Magento\View\Element\Template { if (empty($this->_data['welcome'])) { if ($this->_appState->isInstalled() && $this->httpContext->getValue(Data::CONTEXT_AUTH)) { + $customerName = $this->_customerViewHelper->getCustomerName( + $this->_customerSession->getCustomerDataObject() + ); $this->_data['welcome'] = __( 'Welcome, %1!', - $this->escapeHtml($this->_customerSession->getCustomer()->getName()) + $this->escapeHtml($customerName) ); } else { $this->_data['welcome'] = $this->_scopeConfig->getValue( diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php index 1735231aedc1246024ef46d0798ebacad95d2459..9d5ad572088fa1b50f777472f34b8c4d586d7c37 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme.php @@ -29,7 +29,7 @@ */ namespace Magento\Theme\Controller\Adminhtml\System\Design; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Theme extends \Magento\Backend\App\Action { @@ -41,19 +41,19 @@ class Theme extends \Magento\Backend\App\Action protected $_coreRegistry = null; /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Registry $coreRegistry, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_coreRegistry = $coreRegistry; $this->_fileFactory = $fileFactory; @@ -324,7 +324,7 @@ class Theme extends \Magento\Backend\App\Action return $this->_fileFactory->create( $customCssFile->getFileName(), array('type' => 'filename', 'value' => $customCssFile->getFullPath()), - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); } } catch (\Exception $e) { @@ -364,7 +364,7 @@ class Theme extends \Magento\Backend\App\Action return $this->_fileFactory->create( $fileName, array('type' => 'filename', 'value' => $themeCss[$fileName]['path']), - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot find file "%1".', $fileName)); diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files.php index cc66f382d36a2fa290f512d0c0fb77b43ed8ad2b..a2fd692a16cdc5fb1b0bf1f3d48238621451399f 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files.php @@ -29,22 +29,22 @@ */ namespace Magento\Theme\Controller\Adminhtml\System\Design\Wysiwyg; -use Magento\App\ResponseInterface; +use Magento\Framework\App\ResponseInterface; class Files extends \Magento\Backend\App\Action { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileFactory; /** * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\App\Response\Http\FileFactory $fileFactory + \Magento\Framework\App\Response\Http\FileFactory $fileFactory ) { $this->_fileFactory = $fileFactory; parent::__construct($context); @@ -169,7 +169,7 @@ class Files extends \Magento\Backend\App\Action return $this->_fileFactory->create( $file, array('type' => 'filename', 'value' => $helper->getThumbnailPath($file)), - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); } catch (\Exception $e) { $this->_objectManager->get('Magento\Logger')->logException($e); diff --git a/app/code/Magento/Theme/Helper/Data.php b/app/code/Magento/Theme/Helper/Data.php index b310b3d63e339ef54b3d1ff9471a048e18f7bd29..d18112013253890a4f2adac6863dd1db33c65622 100644 --- a/app/code/Magento/Theme/Helper/Data.php +++ b/app/code/Magento/Theme/Helper/Data.php @@ -29,6 +29,6 @@ */ namespace Magento\Theme\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Theme/Helper/Layout.php b/app/code/Magento/Theme/Helper/Layout.php index be625fb477bbe8ba8a60e63040e32ea1bf20cdd9..f701097e56e1e98a26324c13c8e8d8befe18dd53 100644 --- a/app/code/Magento/Theme/Helper/Layout.php +++ b/app/code/Magento/Theme/Helper/Layout.php @@ -23,7 +23,7 @@ */ namespace Magento\Theme\Helper; -class Layout extends \Magento\App\Helper\AbstractHelper +class Layout extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\View\LayoutInterface @@ -36,12 +36,12 @@ class Layout extends \Magento\App\Helper\AbstractHelper protected $_config; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Theme\Model\Layout\Config $config * @param \Magento\View\LayoutInterface $layout */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Theme\Model\Layout\Config $config, \Magento\View\LayoutInterface $layout ) { diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 01872c64002ab2f8666fae875cae2c76e7756326..e4992fd1a1987a0456ba691ae73dacb3406b5ebe 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -29,7 +29,7 @@ */ namespace Magento\Theme\Helper; -class Storage extends \Magento\App\Helper\AbstractHelper +class Storage extends \Magento\Framework\App\Helper\AbstractHelper { /** * Parameter name of node @@ -83,7 +83,7 @@ class Storage extends \Magento\App\Helper\AbstractHelper /** * Magento filesystem * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -103,14 +103,14 @@ class Storage extends \Magento\App\Helper\AbstractHelper protected $mediaDirectoryWrite; /** - * @param \Magento\App\Helper\Context $context - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Backend\Model\Session $session * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory */ public function __construct( - \Magento\App\Helper\Context $context, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Backend\Model\Session $session, \Magento\View\Design\Theme\FlyweightFactory $themeFactory ) { @@ -118,7 +118,7 @@ class Storage extends \Magento\App\Helper\AbstractHelper $this->filesystem = $filesystem; $this->_session = $session; $this->_themeFactory = $themeFactory; - $this->mediaDirectoryWrite = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->mediaDirectoryWrite = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->mediaDirectoryWrite->create($this->getStorageRoot()); } diff --git a/app/code/Magento/Theme/Model/Config.php b/app/code/Magento/Theme/Model/Config.php index 3838ccb5fbb8f84576930ea7420d0ab5726a5be2..6e03f8ad00ed69350a8c915822638394d9c4da6b 100644 --- a/app/code/Magento/Theme/Model/Config.php +++ b/app/code/Magento/Theme/Model/Config.php @@ -32,12 +32,12 @@ namespace Magento\Theme\Model; class Config { /** - * @var \Magento\App\Config\Storage\WriterInterface + * @var \Magento\Framework\App\Config\Storage\WriterInterface */ protected $_configWriter; /** - * @var \Magento\App\Config\ValueInterface + * @var \Magento\Framework\App\Config\ValueInterface */ protected $_configData; @@ -64,16 +64,16 @@ class Config protected $_layoutCache; /** - * @param \Magento\App\Config\ValueInterface $configData - * @param \Magento\App\Config\Storage\WriterInterface $configWriter + * @param \Magento\Framework\App\Config\ValueInterface $configData + * @param \Magento\Framework\App\Config\Storage\WriterInterface $configWriter * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Cache\FrontendInterface $configCache * @param \Magento\Cache\FrontendInterface $layoutCache */ public function __construct( - \Magento\App\Config\ValueInterface $configData, - \Magento\App\Config\Storage\WriterInterface $configWriter, + \Magento\Framework\App\Config\ValueInterface $configData, + \Magento\Framework\App\Config\Storage\WriterInterface $configWriter, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Event\ManagerInterface $eventManager, \Magento\Cache\FrontendInterface $configCache, @@ -193,7 +193,7 @@ class Config protected function _assignThemeToDefaultScope($themeId, &$isReassigned) { $configPath = \Magento\View\DesignInterface::XML_PATH_THEME_ID; - $this->_configWriter->save($configPath, $themeId, \Magento\App\ScopeInterface::SCOPE_DEFAULT); + $this->_configWriter->save($configPath, $themeId, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); $isReassigned = true; return $this; } diff --git a/app/code/Magento/Theme/Model/CopyService.php b/app/code/Magento/Theme/Model/CopyService.php index 71f5ed6b54c84772d4c3fea5ad4816306f5f5437..16aa223347aecf870396761a7bd7ee565783c4f7 100644 --- a/app/code/Magento/Theme/Model/CopyService.php +++ b/app/code/Magento/Theme/Model/CopyService.php @@ -64,7 +64,7 @@ class CopyService protected $_customizationPath; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Design\Theme\FileFactory $fileFactory * @param \Magento\Core\Model\Layout\Link $link * @param \Magento\Core\Model\Layout\UpdateFactory $updateFactory @@ -72,14 +72,14 @@ class CopyService * @param \Magento\View\Design\Theme\Customization\Path $customization */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Design\Theme\FileFactory $fileFactory, \Magento\Core\Model\Layout\Link $link, \Magento\Core\Model\Layout\UpdateFactory $updateFactory, \Magento\Event\ManagerInterface $eventManager, \Magento\View\Design\Theme\Customization\Path $customization ) { - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_fileFactory = $fileFactory; $this->_link = $link; $this->_updateFactory = $updateFactory; diff --git a/app/code/Magento/Theme/Model/Uploader/Service.php b/app/code/Magento/Theme/Model/Uploader/Service.php index 31f5980bcf8c7f8ec6da7dba5400958f60b52433..437fc915b7f8ee100031516ae8fe3500486cac53 100644 --- a/app/code/Magento/Theme/Model/Uploader/Service.php +++ b/app/code/Magento/Theme/Model/Uploader/Service.php @@ -73,18 +73,18 @@ class Service /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\File\Size $fileSize * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param array $uploadLimits keys are 'css' and 'js' for file type, values defines maximum file size, example: 2M */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\File\Size $fileSize, \Magento\Core\Model\File\UploaderFactory $uploaderFactory, array $uploadLimits = array() ) { - $this->_tmpDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::SYS_TMP_DIR); + $this->_tmpDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::SYS_TMP_DIR); $this->_fileSize = $fileSize; $this->_uploaderFactory = $uploaderFactory; if (isset($uploadLimits['css'])) { diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index f3e7b740077c42ba7a9f70f5d2b7780945f0c7fa..7508a9b91b117e5b14617919936ada16f63cffd7 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -86,18 +86,18 @@ class Storage /** * Initialize dependencies * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Theme\Helper\Storage $helper * @param \Magento\ObjectManager $objectManager * @param \Magento\Image\AdapterFactory $imageFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Theme\Helper\Storage $helper, \Magento\ObjectManager $objectManager, \Magento\Image\AdapterFactory $imageFactory ) { - $this->mediaWriteDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->mediaWriteDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_helper = $helper; $this->_objectManager = $objectManager; $this->_imageFactory = $imageFactory; diff --git a/app/code/Magento/Theme/etc/adminhtml/routes.xml b/app/code/Magento/Theme/etc/adminhtml/routes.xml index 8ef7cc2533f501f648ec03f2899fd92680701a4b..35bbd600f13dab99f92a08ad390c50f4d20b3c3d 100644 --- a/app/code/Magento/Theme/etc/adminhtml/routes.xml +++ b/app/code/Magento/Theme/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Theme" /> diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index cf5ce4a860fdeadbce3ac6ab01b5428f68d5272d..748edd90e694afbf14e83268fb6c3415502f4cfa 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -26,8 +26,8 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <type name="Magento\Theme\Model\Config"> <arguments> - <argument name="configCache" xsi:type="object">Magento\App\Cache\Type\Config</argument> - <argument name="layoutCache" xsi:type="object">Magento\App\Cache\Type\Layout</argument> + <argument name="configCache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> + <argument name="layoutCache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument> </arguments> </type> <type name="Magento\Theme\Model\Uploader\Service"> diff --git a/app/code/Magento/Theme/view/frontend/html/bugreport.phtml b/app/code/Magento/Theme/view/frontend/html/bugreport.phtml index 220c76c6979c26b4129ff1645e42f1ba3e26b247..f0c703d54c18444893ab721c5a173bc0a2275bb5 100644 --- a/app/code/Magento/Theme/view/frontend/html/bugreport.phtml +++ b/app/code/Magento/Theme/view/frontend/html/bugreport.phtml @@ -29,5 +29,5 @@ target="_blank"> <?php echo __('Report All Bugs') ?> </a> - <strong><?php echo __('(ver. %1)', \Magento\AppInterface::VERSION) ?></strong> + <strong><?php echo __('(ver. %1)', \Magento\Framework\AppInterface::VERSION) ?></strong> </small> diff --git a/app/code/Magento/Theme/view/frontend/html/footer.phtml b/app/code/Magento/Theme/view/frontend/html/footer.phtml index 0998dbefb4cddc6d3f39528392ed3e8df2894b7e..7cb215a8ce6a973e2ce7f8d1b773cfdd4b023570 100644 --- a/app/code/Magento/Theme/view/frontend/html/footer.phtml +++ b/app/code/Magento/Theme/view/frontend/html/footer.phtml @@ -29,7 +29,7 @@ <?php echo $this->getChildHtml() ?> <p class="bugs"><?php echo __('Help Us to Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" - target="_blank"><strong><?php echo __('Report All Bugs') ?></strong></a> <?php echo __('(ver. %1)', \Magento\AppInterface::VERSION) ?> + target="_blank"><strong><?php echo __('Report All Bugs') ?></strong></a> <?php echo __('(ver. %1)', \Magento\Framework\AppInterface::VERSION) ?> </p> <address><?php echo $this->getCopyright() ?></address> </div> diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index 9679bb1d15c2e4f3b2ef8af75b85f249db2ffa21..92ea6789456540364ee6ecd93cfe3cbc3b15a3d4 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -29,7 +29,7 @@ <block class="Magento\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/> </block> <container name="after_body_start" as="after_body_start" label="Page Top"> - <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="html/notices.phtml"/> + <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="html/notices.phtml" cacheable="false"/> </container> <container name="header-container" label="Page Header Container" as="header-container" htmlTag="header" htmlClass="page header"> <container name="header.panel" label="Page Header Panel" htmlTag="div" htmlClass="panel header"> @@ -109,13 +109,6 @@ <container name="before_body_end" as="before_body_end" label="Page Bottom"/> </block> <update handle="default_head_blocks"/> - <referenceBlock name="head"> - <block class="Magento\Theme\Block\Html\Head\Script" name="magento-msg-box-js" after="jquery-jquery-ui-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Theme::js/msg-box.js</argument> - </arguments> - </block> - </referenceBlock> <referenceContainer name="content"> <block class="Magento\View\Element\FormKey" name="formkey"/> </referenceContainer> diff --git a/app/code/Magento/Translation/Controller/Ajax.php b/app/code/Magento/Translation/Controller/Ajax.php index b5fdb069d14531dadf2af1dab6f03f99be3a37ff..5c866875676d2ecd989fda0ceb85576367b84153 100644 --- a/app/code/Magento/Translation/Controller/Ajax.php +++ b/app/code/Magento/Translation/Controller/Ajax.php @@ -23,7 +23,7 @@ */ namespace Magento\Translation\Controller; -class Ajax extends \Magento\App\Action\Action +class Ajax extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Translate\Inline\ParserInterface @@ -31,11 +31,11 @@ class Ajax extends \Magento\App\Action\Action protected $inlineParser; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Translate\Inline\ParserInterface $inlineParser */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Translate\Inline\ParserInterface $inlineParser ) { parent::__construct($context); diff --git a/app/code/Magento/Translation/Model/Inline/Config.php b/app/code/Magento/Translation/Model/Inline/Config.php index c9ebad0b559121e46f3d0202fdc71634ae7bb98c..64529d167d449fcaf5f02a13f2b1c55d37f7388a 100644 --- a/app/code/Magento/Translation/Model/Inline/Config.php +++ b/app/code/Magento/Translation/Model/Inline/Config.php @@ -31,7 +31,7 @@ class Config implements \Magento\Translate\Inline\ConfigInterface /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -41,11 +41,11 @@ class Config implements \Magento\Translate\Inline\ConfigInterface protected $_helper; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Helper\Data $helper */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Helper\Data $helper ) { $this->_scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index 74f15cd583b02876ab26a4f11eba3de432dcfce8..0f5f666042ce613a1c1d6ce51fa426b860975fea 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -123,7 +123,7 @@ class Parser implements \Magento\Translate\Inline\ParserInterface protected $_inputFilter; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -133,7 +133,7 @@ class Parser implements \Magento\Translate\Inline\ParserInterface protected $_translateInline; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_appCache; @@ -143,16 +143,16 @@ class Parser implements \Magento\Translate\Inline\ParserInterface * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Translation\Model\Resource\StringFactory $resource * @param \Zend_Filter_Interface $inputFilter - * @param \Magento\App\State $appState - * @param \Magento\App\Cache\TypeListInterface $appCache, + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\Cache\TypeListInterface $appCache, * @param \Magento\Translate\InlineInterface $translateInline */ public function __construct( \Magento\Translation\Model\Resource\StringFactory $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Zend_Filter_Interface $inputFilter, - \Magento\App\State $appState, - \Magento\App\Cache\TypeListInterface $appCache, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\Cache\TypeListInterface $appCache, \Magento\Translate\InlineInterface $translateInline ) { $this->_resourceFactory = $resource; @@ -174,7 +174,7 @@ class Parser implements \Magento\Translate\Inline\ParserInterface if (!$this->_translateInline->isAllowed()) { return $this; } - $this->_appCache->invalidate(\Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER); + $this->_appCache->invalidate(\Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER); $this->_validateTranslationParams($translateParams); $this->_filterTranslationParams($translateParams, array('custom')); diff --git a/app/code/Magento/Translation/Model/Resource/String.php b/app/code/Magento/Translation/Model/Resource/String.php index 136a21d6ccd812b28dfa58da13c612ac4a1f5b89..f5b0dc6470f4f35c4e26506936f8cc7960048f8f 100644 --- a/app/code/Magento/Translation/Model/Resource/String.php +++ b/app/code/Magento/Translation/Model/Resource/String.php @@ -31,7 +31,7 @@ class String extends \Magento\Model\Resource\Db\AbstractDb protected $_localeResolver; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $scopeResolver; @@ -41,15 +41,15 @@ class String extends \Magento\Model\Resource\Db\AbstractDb protected $scope; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Locale\ResolverInterface $localeResolver - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param string|null $scope */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Locale\ResolverInterface $localeResolver, - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null ) { $this->_localeResolver = $localeResolver; diff --git a/app/code/Magento/Translation/Model/Resource/Translate.php b/app/code/Magento/Translation/Model/Resource/Translate.php index e57c0e8ebc0d98037baa82e5cee69398eac94adc..1b23cc83eb38e5f79539bcfb85ee302c586dcc77 100644 --- a/app/code/Magento/Translation/Model/Resource/Translate.php +++ b/app/code/Magento/Translation/Model/Resource/Translate.php @@ -26,12 +26,12 @@ namespace Magento\Translation\Model\Resource; class Translate extends \Magento\Model\Resource\Db\AbstractDb implements \Magento\Translate\ResourceInterface { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $scopeResolver; @@ -41,15 +41,15 @@ class Translate extends \Magento\Model\Resource\Db\AbstractDb implements \Magent protected $scope; /** - * @param \Magento\App\Resource $resource - * @param \Magento\App\State $appState - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param null|string $scope */ public function __construct( - \Magento\App\Resource $resource, - \Magento\App\State $appState, - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null ) { $this->_appState = $appState; diff --git a/app/code/Magento/Translation/etc/adminhtml/routes.xml b/app/code/Magento/Translation/etc/adminhtml/routes.xml index f54eea71c040efb0d961d00ceae487be475720b0..4b7be520b50bfa174f77a829c5d47998e9381002 100644 --- a/app/code/Magento/Translation/etc/adminhtml/routes.xml +++ b/app/code/Magento/Translation/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="translation" frontName="translation"> <module name="Magento_Translation" /> diff --git a/app/code/Magento/Translation/etc/cache.xml b/app/code/Magento/Translation/etc/cache.xml index d8e3c37ea7c28e2570d6e9d320c6a0bf69dc9eb5..6ce62e610caa8ba4ed5242d2fa1d0a01c95b14bc 100644 --- a/app/code/Magento/Translation/etc/cache.xml +++ b/app/code/Magento/Translation/etc/cache.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/Cache/etc/cache.xsd"> - <type name="translate" translate="label,description" instance="Magento\App\Cache\Type\Translate"> + <type name="translate" translate="label,description" instance="Magento\Framework\App\Cache\Type\Translate"> <label>Translations</label> <description>Translation files.</description> </type> diff --git a/app/code/Magento/Translation/etc/frontend/routes.xml b/app/code/Magento/Translation/etc/frontend/routes.xml index 0cfe58766bc3034a6d47542b424b7e9f5c9dfdf3..8492fbee148f7685ca081550817122ae77abda17 100644 --- a/app/code/Magento/Translation/etc/frontend/routes.xml +++ b/app/code/Magento/Translation/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="translation" frontName="translation"> <module name="Magento_Translation" /> diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 0fd355a8b209bb81b5285c8b12ad48218d5f0248..a3c6e0f3751df0f6fdaedf556ec9cc7efb8e5b79 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -141,7 +141,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface protected $configHelper; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory @@ -162,7 +162,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, diff --git a/app/code/Magento/UrlRewrite/App/FrontController/Plugin/UrlRewrite.php b/app/code/Magento/UrlRewrite/App/FrontController/Plugin/UrlRewrite.php index 7a709597ed3661d346668fd2143cc76530977f12..f3141604122c534255d86ddb0e54d9ea7ad56e71 100644 --- a/app/code/Magento/UrlRewrite/App/FrontController/Plugin/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/App/FrontController/Plugin/UrlRewrite.php @@ -33,17 +33,17 @@ class UrlRewrite protected $_rewriteService; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_state; /** * @param \Magento\UrlRewrite\App\Request\RewriteService $rewriteService - * @param \Magento\App\State $state + * @param \Magento\Framework\App\State $state */ public function __construct( \Magento\UrlRewrite\App\Request\RewriteService $rewriteService, - \Magento\App\State $state + \Magento\Framework\App\State $state ) { $this->_rewriteService = $rewriteService; $this->_state = $state; @@ -52,17 +52,17 @@ class UrlRewrite /** * Perform url rewites * - * @param \Magento\App\FrontController $subject + * @param \Magento\Framework\App\FrontController $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\FrontController $subject, + \Magento\Framework\App\FrontController $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if (!$this->_state->isInstalled()) { return $proceed($request); diff --git a/app/code/Magento/UrlRewrite/App/Request/RewriteService.php b/app/code/Magento/UrlRewrite/App/Request/RewriteService.php index a13b7ec2cd47c69d974f3b63ff9f109c46e88345..c33572ea976cc156a78b0df59572b841d26a07ef 100644 --- a/app/code/Magento/UrlRewrite/App/Request/RewriteService.php +++ b/app/code/Magento/UrlRewrite/App/Request/RewriteService.php @@ -31,24 +31,24 @@ class RewriteService protected $_rewriteFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @var \Magento\App\RouterList + * @var \Magento\Framework\App\RouterList */ protected $_routerList; /** - * @param \Magento\App\RouterList $routerList + * @param \Magento\Framework\App\RouterList $routerList * @param \Magento\UrlRewrite\Model\UrlRewriteFactory $rewriteFactory - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\App\RouterList $routerList, + \Magento\Framework\App\RouterList $routerList, \Magento\UrlRewrite\Model\UrlRewriteFactory $rewriteFactory, - \Magento\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config ) { $this->_rewriteFactory = $rewriteFactory; $this->_config = $config; @@ -58,10 +58,10 @@ class RewriteService /** * Apply rewrites to current request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return void */ - public function applyRewrites(\Magento\App\RequestInterface $request) + public function applyRewrites(\Magento\Framework\App\RequestInterface $request) { // URL rewrite if (!$request->isStraight()) { diff --git a/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php b/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php index 18b86e60882877cfafce9138e58bfef54c71213e..bbf804d584dff6f79ff3b947f4178d299d272a00 100644 --- a/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php @@ -23,7 +23,7 @@ */ namespace Magento\UrlRewrite\Helper; -class UrlRewrite extends \Magento\App\Helper\AbstractHelper +class UrlRewrite extends \Magento\Framework\App\Helper\AbstractHelper { /** * Validation error constants @@ -41,11 +41,11 @@ class UrlRewrite extends \Magento\App\Helper\AbstractHelper protected $_urlrewrite; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\UrlRewrite\Model\UrlRewrite\OptionProvider $urlrewrite */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\UrlRewrite\Model\UrlRewrite\OptionProvider $urlrewrite ) { parent::__construct($context); diff --git a/app/code/Magento/UrlRewrite/Model/UrlRewrite.php b/app/code/Magento/UrlRewrite/Model/UrlRewrite.php index ac2694245bb040f3ceae3ffc247b10ac9186c6ab..71fafaea0552cd74aa9fded90b09820f3620b61a 100644 --- a/app/code/Magento/UrlRewrite/Model/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/Model/UrlRewrite.php @@ -62,7 +62,7 @@ class UrlRewrite extends \Magento\Model\AbstractModel /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -77,17 +77,17 @@ class UrlRewrite extends \Magento\Model\AbstractModel protected $_storeManager; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_httpContext; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Stdlib\Cookie $cookie * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -95,10 +95,10 @@ class UrlRewrite extends \Magento\Model\AbstractModel public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Stdlib\Cookie $cookie, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -262,10 +262,10 @@ class UrlRewrite extends \Magento\Model\AbstractModel /** * Perform custom url rewrites * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - public function rewrite(\Magento\App\RequestInterface $request = null) + public function rewrite(\Magento\Framework\App\RequestInterface $request = null) { if (!$this->_appState->isInstalled()) { return false; diff --git a/app/code/Magento/UrlRewrite/etc/frontend/di.xml b/app/code/Magento/UrlRewrite/etc/frontend/di.xml index b4d43a0e76d8b8f0b80611cfd59e614dec5283ea..3b5f6b02ebd101f079ffa39d3fd5d7910c35be51 100644 --- a/app/code/Magento/UrlRewrite/etc/frontend/di.xml +++ b/app/code/Magento/UrlRewrite/etc/frontend/di.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\FrontController"> + <type name="Magento\Framework\App\FrontController"> <plugin name="urlRewrite" type="Magento\UrlRewrite\App\FrontController\Plugin\UrlRewrite" sortOrder="60"/> </type> </config> diff --git a/app/code/Magento/User/Helper/Data.php b/app/code/Magento/User/Helper/Data.php index 7e288a7adfe947ef7780ff8e653cc5ffde46219e..e77b950d701bf594b60f84786b8726b81cd1416f 100644 --- a/app/code/Magento/User/Helper/Data.php +++ b/app/code/Magento/User/Helper/Data.php @@ -32,7 +32,7 @@ namespace Magento\User\Helper; * @package Magento_User * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Configuration path to expiration period of reset password link @@ -50,12 +50,12 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $mathRandom; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Backend\App\ConfigInterface $config * @param \Magento\Math\Random $mathRandom */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Backend\App\ConfigInterface $config, \Magento\Math\Random $mathRandom ) { diff --git a/app/code/Magento/User/Model/Acl/Loader/Role.php b/app/code/Magento/User/Model/Acl/Loader/Role.php index 0e8c4b5947e4375bd3308702069c50b4569e2ce7..4aba7d4266c28afb84cc174c17dd25544bc70ae7 100644 --- a/app/code/Magento/User/Model/Acl/Loader/Role.php +++ b/app/code/Magento/User/Model/Acl/Loader/Role.php @@ -29,7 +29,7 @@ use Magento\User\Model\Acl\Role\User as RoleUser; class Role implements \Magento\Acl\LoaderInterface { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -46,12 +46,12 @@ class Role implements \Magento\Acl\LoaderInterface /** * @param \Magento\User\Model\Acl\Role\GroupFactory $groupFactory * @param \Magento\User\Model\Acl\Role\UserFactory $roleFactory - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\User\Model\Acl\Role\GroupFactory $groupFactory, \Magento\User\Model\Acl\Role\UserFactory $roleFactory, - \Magento\App\Resource $resource + \Magento\Framework\App\Resource $resource ) { $this->_resource = $resource; $this->_groupFactory = $groupFactory; diff --git a/app/code/Magento/User/Model/Acl/Loader/Rule.php b/app/code/Magento/User/Model/Acl/Loader/Rule.php index d05aa67fb9ca933c53b2c0a5f9a0186fa7e8ad7f..c08e16b1cd9c06093b7cf41781208da32881a210 100644 --- a/app/code/Magento/User/Model/Acl/Loader/Rule.php +++ b/app/code/Magento/User/Model/Acl/Loader/Rule.php @@ -26,19 +26,19 @@ namespace Magento\User\Model\Acl\Loader; class Rule implements \Magento\Acl\LoaderInterface { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** * @param \Magento\Acl\RootResource $rootResource - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param array $data * @SuppressWarnings(PHPMD.UnusedFormalParameter): */ public function __construct( \Magento\Acl\RootResource $rootResource, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, array $data = array() ) { $this->_resource = $resource; diff --git a/app/code/Magento/User/Model/Resource/Role.php b/app/code/Magento/User/Model/Resource/Role.php index cb6dd6ed93cc0dfd665f12db71775f7fec1d514b..22bf0ed7bc532eea187f9ebd1ff35434032b5453 100644 --- a/app/code/Magento/User/Model/Resource/Role.php +++ b/app/code/Magento/User/Model/Resource/Role.php @@ -57,13 +57,13 @@ class Role extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\Resource $resource, + \Magento\Framework\App\CacheInterface $cache, \Magento\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; diff --git a/app/code/Magento/User/Model/Resource/Rules.php b/app/code/Magento/User/Model/Resource/Rules.php index 887b80576b55fdfdb4f519b4c6fcd34261fe4848..2a6a5b0c01f0930127892530b68f53f4ab2e1466 100644 --- a/app/code/Magento/User/Model/Resource/Rules.php +++ b/app/code/Magento/User/Model/Resource/Rules.php @@ -53,14 +53,14 @@ class Rules extends \Magento\Model\Resource\Db\AbstractDb protected $_logger; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Logger $logger * @param \Magento\Acl\RootResource $rootResource * @param \Magento\Acl\CacheInterface $aclCache */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Acl\Builder $aclBuilder, \Magento\Logger $logger, \Magento\Acl\RootResource $rootResource, diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index 2dcc688ae28f9eb798ae91a1e71e8dd7b3bea540..f7c3bc66dfccda4c1c2b1faddd270649ce0d987f 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -52,13 +52,13 @@ class User extends \Magento\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Acl\CacheInterface $aclCache * @param \Magento\User\Model\RoleFactory $roleFactory * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Acl\CacheInterface $aclCache, \Magento\User\Model\RoleFactory $roleFactory, \Magento\Stdlib\DateTime $dateTime diff --git a/app/code/Magento/User/Model/Role.php b/app/code/Magento/User/Model/Role.php index fbca5b9dbe587f1617b61109dbc1dd607bb5a11a..c436a8a92cac2a009940578057c65bd9b214c831 100644 --- a/app/code/Magento/User/Model/Role.php +++ b/app/code/Magento/User/Model/Role.php @@ -90,7 +90,7 @@ class Role extends \Magento\Model\AbstractModel public function __wakeup() { parent::__wakeup(); - $objectManager = \Magento\App\ObjectManager::getInstance(); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $this->_userRolesFactory = $objectManager->get('Magento\User\Model\Resource\Role\User\CollectionFactory'); $this->_resource = $objectManager->get('Magento\User\Model\Resource\Role'); $this->_resourceCollection = $objectManager->get('Magento\User\Model\Resource\Role\Collection'); diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php index 8b3ce32a5d1a2e1afa1a2197b759411d1b85bb2b..c75148c0159750004b7ee997c7941ed4ee993dae 100644 --- a/app/code/Magento/User/Model/User.php +++ b/app/code/Magento/User/Model/User.php @@ -219,7 +219,7 @@ class User extends \Magento\Model\AbstractModel implements \Magento\Backend\Mode public function __wakeup() { parent::__wakeup(); - $objectManager = \Magento\App\ObjectManager::getInstance(); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $this->_eventManager = $objectManager->get('Magento\Event\ManagerInterface'); $this->_userData = $objectManager->get('Magento\User\Helper\Data'); $this->_config = $objectManager->get('Magento\Backend\App\ConfigInterface'); diff --git a/app/code/Magento/User/etc/adminhtml/routes.xml b/app/code/Magento/User/etc/adminhtml/routes.xml index c22abe1afe8dfa8d2855ab8e263a62225f16fe31..183fca3856f82833ff0473e939b0afff07ecc69c 100644 --- a/app/code/Magento/User/etc/adminhtml/routes.xml +++ b/app/code/Magento/User/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_User" before="Magento_Backend" /> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml index 1617cf21f7cc6d1b9116a8627fe85d1b4bf460f9..d6057e5573110d6013d22596913c62f24a231bfb 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml @@ -48,10 +48,11 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="user_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">5px</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="sortable" xsi:type="string">true</argument> <argument name="index" xsi:type="string">user_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> + </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="username"> @@ -60,6 +61,8 @@ <argument name="type" xsi:type="string">text</argument> <argument name="index" xsi:type="string">username</argument> <argument name="escape" xsi:type="string">1</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="firstname"> @@ -68,6 +71,8 @@ <argument name="type" xsi:type="string">text</argument> <argument name="index" xsi:type="string">firstname</argument> <argument name="escape" xsi:type="string">1</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="lastname"> @@ -76,14 +81,14 @@ <argument name="type" xsi:type="string">text</argument> <argument name="index" xsi:type="string">lastname</argument> <argument name="escape" xsi:type="string">1</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="email"> <arguments> <argument name="header" xsi:type="string" translate="true">Email</argument> <argument name="type" xsi:type="string">text</argument> - <argument name="width" xsi:type="string">40px</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">email</argument> </arguments> </block> @@ -102,6 +107,8 @@ </item> </argument> <argument name="index" xsi:type="string">is_active</argument> + <argument name="column_css_class" xsi:type="string">col-status</argument> + <argument name="header_css_class" xsi:type="string">col-status</argument> </arguments> </block> </block> diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml index feddf9c3b89d5c4e67c39cc1dbe60905dbf09cd9..077c9f1d62f8691638c2a1484520aaead7364af8 100644 --- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml +++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_role_grid_block.xml @@ -50,9 +50,9 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="role_id"> <arguments> <argument name="header" xsi:type="string" translate="true">ID</argument> - <argument name="width" xsi:type="string">50px</argument> - <argument name="align" xsi:type="string">right</argument> <argument name="index" xsi:type="string">role_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="role_name"> diff --git a/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php b/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php index 9b47226f545cf6818e491d046de23a9a1f8db6e1..8c3f32f185e6ac34cb8d6a8cce316fa8d7a08c86 100644 --- a/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php +++ b/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php @@ -23,7 +23,7 @@ */ namespace Magento\Usps\Block\Rma\Adminhtml\Rma\Edit\Tab\General\Shipping\Packaging; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; use Magento\Usps\Helper\Data as UspsHelper; use Magento\Usps\Model\Carrier; @@ -42,7 +42,7 @@ class Plugin /** * Request * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -50,7 +50,7 @@ class Plugin * Construct * * @param \Magento\Usps\Helper\Data $uspsHelper - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request */ public function __construct(UspsHelper $uspsHelper, RequestInterface $request) { diff --git a/app/code/Magento/Usps/Helper/Data.php b/app/code/Magento/Usps/Helper/Data.php index c190983bf151de75343b3d47354be325ef8e5acc..5cca2065c49060af58a0c4db85a15b07bfe75406 100644 --- a/app/code/Magento/Usps/Helper/Data.php +++ b/app/code/Magento/Usps/Helper/Data.php @@ -23,7 +23,7 @@ */ namespace Magento\Usps\Helper; -use Magento\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\AbstractHelper; /** * Usps data helper diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index bae1280590e1a25bad029e03fe47353043d0c993..9ba1e9c35a218baf2440cec3355069809a5426b2 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -139,7 +139,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C protected $_httpClientFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory * @param \Magento\Logger\AdapterFactory $logAdapterFactory * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory @@ -160,7 +160,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Magento\Logger\AdapterFactory $logAdapterFactory, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, diff --git a/app/code/Magento/Webapi/Controller/ErrorProcessor.php b/app/code/Magento/Webapi/Controller/ErrorProcessor.php index fed168d13b776b08b7990f359c3491f5c863fcf6..b6ff4b79eb6bacb728808e3bf4770bebe275b5f4 100644 --- a/app/code/Magento/Webapi/Controller/ErrorProcessor.php +++ b/app/code/Magento/Webapi/Controller/ErrorProcessor.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Controller; -use Magento\App\State; +use Magento\Framework\App\State; class ErrorProcessor { @@ -50,7 +50,7 @@ class ErrorProcessor protected $_coreHelper; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -62,7 +62,7 @@ class ErrorProcessor /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -73,21 +73,21 @@ class ErrorProcessor /** * @param \Magento\Core\Helper\Data $helper - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Core\Helper\Data $helper, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_coreHelper = $helper; $this->_appState = $appState; $this->_logger = $logger; $this->_filesystem = $filesystem; - $this->directoryWrite = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->directoryWrite = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->registerShutdownFunction(); } diff --git a/app/code/Magento/Webapi/Controller/Request.php b/app/code/Magento/Webapi/Controller/Request.php index 442980e4f72ab0eec805097199e13785ef61da8c..c7312a28423664ea211f4ae5007d7b70034ee152 100644 --- a/app/code/Magento/Webapi/Controller/Request.php +++ b/app/code/Magento/Webapi/Controller/Request.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Controller; -class Request extends \Zend_Controller_Request_Http implements \Magento\App\RequestInterface +class Request extends \Zend_Controller_Request_Http implements \Magento\Framework\App\RequestInterface { /** @var int */ protected $_consumerId = 0; @@ -33,12 +33,12 @@ class Request extends \Zend_Controller_Request_Http implements \Magento\App\Requ /** * Modify pathInfo: strip down the front name and query parameters. * - * @param \Magento\App\AreaList $areaList + * @param \Magento\Framework\App\AreaList $areaList * @param \Magento\Config\ScopeInterface $configScope * @param null|string|\Zend_Uri $uri */ public function __construct( - \Magento\App\AreaList $areaList, + \Magento\Framework\App\AreaList $areaList, \Magento\Config\ScopeInterface $configScope, $uri = null ) { diff --git a/app/code/Magento/Webapi/Controller/Response.php b/app/code/Magento/Webapi/Controller/Response.php index c3ad57b4cca093821532d5bb97f801bf4077ac58..0546910615d89ff93d221e94540ac42418154e10 100644 --- a/app/code/Magento/Webapi/Controller/Response.php +++ b/app/code/Magento/Webapi/Controller/Response.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Controller; -class Response extends \Zend_Controller_Response_Http implements \Magento\App\ResponseInterface +class Response extends \Zend_Controller_Response_Http implements \Magento\Framework\App\ResponseInterface { /** * Character set which must be used in response. diff --git a/app/code/Magento/Webapi/Controller/Rest.php b/app/code/Magento/Webapi/Controller/Rest.php index 24bc5743c26578e5b84ad54eccb24a1bb1483a80..016418012f74bf4f077a5d55f2fce9e93a540c0a 100644 --- a/app/code/Magento/Webapi/Controller/Rest.php +++ b/app/code/Magento/Webapi/Controller/Rest.php @@ -28,6 +28,8 @@ use Magento\Service\Data\AbstractObject; use Magento\Webapi\Controller\Rest\Request as RestRequest; use Magento\Webapi\Controller\Rest\Response as RestResponse; use Magento\Webapi\Controller\Rest\Router; +use Magento\Webapi\Model\PathProcessor; +use Magento\Webapi\Model\Config\Converter; /** * Front controller for WebAPI REST area. @@ -36,7 +38,7 @@ use Magento\Webapi\Controller\Rest\Router; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Rest implements \Magento\App\FrontControllerInterface +class Rest implements \Magento\Framework\App\FrontControllerInterface { /** @var Router */ protected $_router; @@ -50,7 +52,7 @@ class Rest implements \Magento\App\FrontControllerInterface /** @var \Magento\ObjectManager */ protected $_objectManager; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appState; /** @var \Magento\View\LayoutInterface */ @@ -71,8 +73,11 @@ class Rest implements \Magento\App\FrontControllerInterface /** @var ErrorProcessor */ protected $_errorProcessor; + /** @var PathProcessor */ + protected $_pathProcessor; + /** - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $areaList; @@ -83,14 +88,15 @@ class Rest implements \Magento\App\FrontControllerInterface * @param RestResponse $response * @param Router $router * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\View\LayoutInterface $layout * @param \Magento\Oauth\OauthInterface $oauthService * @param \Magento\Oauth\Helper\Request $oauthHelper * @param AuthorizationService $authorizationService * @param ServiceArgsSerializer $serializer * @param ErrorProcessor $errorProcessor - * @param \Magento\App\AreaList $areaList + * @param PathProcessor $pathProcessor + * @param \Magento\Framework\App\AreaList $areaList * * TODO: Consider removal of warning suppression * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -100,14 +106,15 @@ class Rest implements \Magento\App\FrontControllerInterface RestResponse $response, Router $router, \Magento\ObjectManager $objectManager, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\View\LayoutInterface $layout, \Magento\Oauth\OauthInterface $oauthService, \Magento\Oauth\Helper\Request $oauthHelper, AuthorizationService $authorizationService, ServiceArgsSerializer $serializer, ErrorProcessor $errorProcessor, - \Magento\App\AreaList $areaList + PathProcessor $pathProcessor, + \Magento\Framework\App\AreaList $areaList ) { $this->_router = $router; $this->_request = $request; @@ -120,20 +127,20 @@ class Rest implements \Magento\App\FrontControllerInterface $this->_authorizationService = $authorizationService; $this->_serializer = $serializer; $this->_errorProcessor = $errorProcessor; + $this->_pathProcessor = $pathProcessor; $this->areaList = $areaList; } /** * Handle REST request * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ - public function dispatch(\Magento\App\RequestInterface $request) + public function dispatch(\Magento\Framework\App\RequestInterface $request) { - $pathParts = explode('/', trim($request->getPathInfo(), '/')); - array_shift($pathParts); - $request->setPathInfo('/' . implode('/', $pathParts)); + $path = $this->_pathProcessor->process($request->getPathInfo()); + $this->_request->setPathInfo($path); $this->areaList->getArea($this->_appState->getAreaCode()) ->load(\Magento\Core\Model\App\Area::PART_TRANSLATE); try { @@ -169,6 +176,7 @@ class Rest implements \Magento\App\FrontControllerInterface $inputData = $this->_request->getRequestData(); $serviceMethodName = $route->getServiceMethod(); $serviceClassName = $route->getServiceClass(); + $inputData = $this->_overrideParams($inputData, $route->getParameters()); $inputParams = $this->_serializer->getInputData($serviceClassName, $serviceMethodName, $inputData); $service = $this->_objectManager->get($serviceClassName); /** @var \Magento\Service\Data\AbstractObject $outputData */ @@ -215,4 +223,21 @@ class Rest implements \Magento\App\FrontControllerInterface } return $result; } + + /** + * Override parameter values based on webapi.xml + * + * @param array $inputData Incoming data from request + * @param array $parameters Contains parameters to replace or default + * @return array Data in same format as $inputData with appropriate parameters added or changed + */ + protected function _overrideParams(array $inputData, array $parameters) + { + foreach ($parameters as $name => $paramData) { + if ($paramData[Converter::KEY_FORCE] || !isset($inputData[$name])) { + $inputData[$name] = $paramData[Converter::KEY_VALUE]; + } + } + return $inputData; + } } diff --git a/app/code/Magento/Webapi/Controller/Rest/Request.php b/app/code/Magento/Webapi/Controller/Rest/Request.php index 7435f8be363aef26f7b67024958382e7672626d5..59df5d38a62458f1c236cd4bdc68242ee68f171a 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Request.php +++ b/app/code/Magento/Webapi/Controller/Rest/Request.php @@ -50,13 +50,13 @@ class Request extends \Magento\Webapi\Controller\Request /** * Initialize dependencies * - * @param \Magento\App\AreaList $areaList + * @param \Magento\Framework\App\AreaList $areaList * @param \Magento\Config\ScopeInterface $configScope * @param \Magento\Webapi\Controller\Rest\Request\Deserializer\Factory $deserializerFactory * @param null|string $uri */ public function __construct( - \Magento\App\AreaList $areaList, + \Magento\Framework\App\AreaList $areaList, \Magento\Config\ScopeInterface $configScope, \Magento\Webapi\Controller\Rest\Request\Deserializer\Factory $deserializerFactory, $uri = null diff --git a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php index cbde612db3eb9b1ef8965fb4b33fecb8595fd06e..5de267179136c2dce0b5424f3ca9549a022a5b19 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php +++ b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Json.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Controller\Rest\Request\Deserializer; -use \Magento\App\State; +use \Magento\Framework\App\State; class Json implements \Magento\Webapi\Controller\Rest\Request\DeserializerInterface { @@ -41,7 +41,7 @@ class Json implements \Magento\Webapi\Controller\Rest\Request\DeserializerInterf /** * @param \Magento\Core\Helper\Data $helper - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ public function __construct(\Magento\Core\Helper\Data $helper, State $appState) { diff --git a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php index 23cbc4a9818b2255e70f1b1cb5a92ee22e00e1d6..0fc059c5f2eada5b2056f1252a817ae2f2ee97f8 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php +++ b/app/code/Magento/Webapi/Controller/Rest/Request/Deserializer/Xml.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Controller\Rest\Request\Deserializer; -use Magento\App\State; +use Magento\Framework\App\State; class Xml implements \Magento\Webapi\Controller\Rest\Request\DeserializerInterface { diff --git a/app/code/Magento/Webapi/Controller/Rest/Response.php b/app/code/Magento/Webapi/Controller/Rest/Response.php index 4cdbf332c6843672accebc929f36995ee687cec6..49fbe860955fddbebdb47d4c2636314ce8e2a3a0 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Response.php +++ b/app/code/Magento/Webapi/Controller/Rest/Response.php @@ -34,7 +34,7 @@ class Response extends \Magento\Webapi\Controller\Response protected $_renderer; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -43,12 +43,12 @@ class Response extends \Magento\Webapi\Controller\Response * * @param \Magento\Webapi\Controller\Rest\Response\Renderer\Factory $rendererFactory * @param \Magento\Webapi\Controller\ErrorProcessor $errorProcessor - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ public function __construct( \Magento\Webapi\Controller\Rest\Response\Renderer\Factory $rendererFactory, \Magento\Webapi\Controller\ErrorProcessor $errorProcessor, - \Magento\App\State $appState + \Magento\Framework\App\State $appState ) { $this->_renderer = $rendererFactory->get(); $this->_errorProcessor = $errorProcessor; @@ -107,7 +107,7 @@ class Response extends \Magento\Webapi\Controller\Response $messageData['wrapped_errors'] = $maskedException->getWrappedErrors(); } - if ($this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { $messageData['trace'] = $exception->getTraceAsString(); } $formattedMessages['errors'][] = $messageData; diff --git a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php index 2c85514c4819a44cb8d6d6cdaba50e1b7ae0d2ab..09b91abab9c3d626b94b07d24ff8ebc2f379e810 100644 --- a/app/code/Magento/Webapi/Controller/Rest/Router/Route.php +++ b/app/code/Magento/Webapi/Controller/Rest/Router/Route.php @@ -37,7 +37,10 @@ class Route extends \Zend_Controller_Router_Route protected $_secure; /** @var array */ - protected $_aclResources = array(); + protected $_aclResources = []; + + /** @var array */ + protected $_parameters = []; /** * Set service class. @@ -109,11 +112,12 @@ class Route extends \Zend_Controller_Router_Route * Set ACL resources list. * * @param array $aclResources - * @return void + * @return $this */ public function setAclResources($aclResources) { $this->_aclResources = $aclResources; + return $this; } /** @@ -126,6 +130,29 @@ class Route extends \Zend_Controller_Router_Route return $this->_aclResources; } + + /** + * Set parameters list. + * + * @param array $parameters + * @return $this + */ + public function setParameters($parameters) + { + $this->_parameters = $parameters; + return $this; + } + + /** + * Get parameters list. + * + * @return array + */ + public function getParameters() + { + return $this->_parameters; + } + /** * Matches a Request with parts defined by a map. Assigns and * returns an array of variables on a successful match. diff --git a/app/code/Magento/Webapi/Controller/Soap.php b/app/code/Magento/Webapi/Controller/Soap.php index 8e64915d7d668076fb87106898a28f6d35ea3884..1111b471c1bb4f6cba65b7c0912e29aaa2a3ccd2 100644 --- a/app/code/Magento/Webapi/Controller/Soap.php +++ b/app/code/Magento/Webapi/Controller/Soap.php @@ -27,13 +27,14 @@ namespace Magento\Webapi\Controller; use Magento\Webapi\ServiceAuthorizationException; use Magento\Webapi\Exception as WebapiException; +use Magento\Webapi\Model\PathProcessor; /** * TODO: Consider warnings suppression removal * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Soap implements \Magento\App\FrontControllerInterface +class Soap implements \Magento\Framework\App\FrontControllerInterface { /**#@+ * Content types used for responses processed by SOAP web API. @@ -59,7 +60,7 @@ class Soap implements \Magento\App\FrontControllerInterface /** @var ErrorProcessor */ protected $_errorProcessor; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appState; /** @var \Magento\View\LayoutInterface */ @@ -76,7 +77,12 @@ class Soap implements \Magento\App\FrontControllerInterface protected $_localeResolver; /** - * @var \Magento\App\AreaList + * @var PathProcessor + */ + protected $_pathProcessor; + + /** + * @var \Magento\Framework\App\AreaList */ protected $areaList; @@ -86,11 +92,12 @@ class Soap implements \Magento\App\FrontControllerInterface * @param \Magento\Webapi\Model\Soap\Wsdl\Generator $wsdlGenerator * @param \Magento\Webapi\Model\Soap\Server $soapServer * @param ErrorProcessor $errorProcessor - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\View\LayoutInterface $layout * @param \Magento\Oauth\OauthInterface $oauthService * @param \Magento\Locale\ResolverInterface $localeResolver - * @param \Magento\App\AreaList $areaList + * @param PathProcessor $pathProcessor + * @param \Magento\Framework\App\AreaList $areaList * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -100,11 +107,12 @@ class Soap implements \Magento\App\FrontControllerInterface \Magento\Webapi\Model\Soap\Wsdl\Generator $wsdlGenerator, \Magento\Webapi\Model\Soap\Server $soapServer, ErrorProcessor $errorProcessor, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\View\LayoutInterface $layout, \Magento\Oauth\OauthInterface $oauthService, \Magento\Locale\ResolverInterface $localeResolver, - \Magento\App\AreaList $areaList + PathProcessor $pathProcessor, + \Magento\Framework\App\AreaList $areaList ) { $this->_request = $request; $this->_response = $response; @@ -115,20 +123,20 @@ class Soap implements \Magento\App\FrontControllerInterface $this->_oauthService = $oauthService; $this->_localeResolver = $localeResolver; $this->_layout = $layout; + $this->_pathProcessor = $pathProcessor; $this->areaList = $areaList; } /** * Dispatch SOAP request. * - * @param \Magento\App\RequestInterface $request - * @return \Magento\App\ResponseInterface + * @param \Magento\Framework\App\RequestInterface $request + * @return \Magento\Framework\App\ResponseInterface */ - public function dispatch(\Magento\App\RequestInterface $request) + public function dispatch(\Magento\Framework\App\RequestInterface $request) { - $pathParts = explode('/', trim($request->getPathInfo(), '/')); - array_shift($pathParts); - $request->setPathInfo('/' . implode('/', $pathParts)); + $path = $this->_pathProcessor->process($request->getPathInfo()); + $this->_request->setPathInfo($path); $this->areaList->getArea($this->_appState->getAreaCode()) ->load(\Magento\Core\Model\App\Area::PART_TRANSLATE); try { diff --git a/app/code/Magento/Webapi/Helper/Data.php b/app/code/Magento/Webapi/Helper/Data.php index dc784fdd06dfff9bcf6b450758aea35295f973de..07a8e447bb6ab4d1869e20c89bb2bb4eb7a690b9 100644 --- a/app/code/Magento/Webapi/Helper/Data.php +++ b/app/code/Magento/Webapi/Helper/Data.php @@ -26,16 +26,16 @@ namespace Magento\Webapi\Helper; use Magento\Integration\Controller\Adminhtml\Integration as IntegrationController; use Magento\Service\Data\AbstractObject; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** @var \Magento\Registry */ protected $_registry; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Registry $registry */ - public function __construct(\Magento\App\Helper\Context $context, \Magento\Registry $registry) + public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Registry $registry) { $this->_registry = $registry; parent::__construct($context); @@ -59,9 +59,9 @@ class Data extends \Magento\App\Helper\AbstractHelper * Translate service interface name into service name. * Example: * <pre> - * - \Magento\Customer\Service\CustomerV1Interface => customer // $preserveVersion == false - * - \Magento\Customer\Service\Customer\AddressV1Interface => customerAddressV1 // $preserveVersion == true - * - \Magento\Catalog\Service\ProductV2Interface => catalogProductV2 // $preserveVersion == true + * - 'Magento\Customer\Service\V1\CustomerAccountInterface', false => customerCustomerAccount + * - 'Magento\Customer\Service\V1\CustomerAddressInterface', true => customerCustomerAddressV1 + * - 'Magento\Catalog\Service\V2\ProductInterface', true => catalogProductV2 * </pre> * * @param string $interfaceName @@ -78,10 +78,12 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Identify the list of service name parts including sub-services using class name. * - * Examples of input/output pairs: <br/> - * - 'Magento\Customer\Service\Customer\AddressV1Interface' => array('Customer', 'Address', 'V1') <br/> - * - 'Vendor\Customer\Service\Customer\AddressV1Interface' => array('VendorCustomer', 'Address', 'V1) <br/> - * - 'Magento\Catalog\Service\ProductV2Interface' => array('CatalogProduct', 'V2') + * Examples of input/output pairs: + * <pre> + * - 'Magento\Customer\Service\V1\CustomerAccountInterface', false => ['CustomerCustomerAccount'] + * - 'Vendor\Customer\Service\V1\Customer\AddressInterface', true => ['VendorCustomer', 'Address', 'V1'] + * - 'Magento\Catalog\Service\V2\ProductInterface', true => ['CatalogProduct', 'V2'] + * </pre> * * @param string $className * @param bool $preserveVersion Should version be preserved during class name conversion into service name diff --git a/app/code/Magento/Webapi/Model/Cache/Type.php b/app/code/Magento/Webapi/Model/Cache/Type.php index 97aa69b20b17dfa70b06c79241f3c089862e532e..0669c84772e69130c596803d88933f5305faa41b 100644 --- a/app/code/Magento/Webapi/Model/Cache/Type.php +++ b/app/code/Magento/Webapi/Model/Cache/Type.php @@ -42,9 +42,9 @@ class Type extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'WEBSERVICE'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php b/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php index dd4b597a4425a7b7b5447ed462048beba9bff9ad..95ee4a028c9767299bf77e55b0d288d5270872d6 100644 --- a/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php +++ b/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php @@ -41,9 +41,9 @@ class TypeIntegration extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'INTEGRATION_API_CONFIG'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/app/code/Magento/Webapi/Model/Config.php b/app/code/Magento/Webapi/Model/Config.php index e758e02865e87d46a716ff977ae30b4c72e8b097..f912195e062e0756cb05b73bab54734731fe5de7 100644 --- a/app/code/Magento/Webapi/Model/Config.php +++ b/app/code/Magento/Webapi/Model/Config.php @@ -41,7 +41,7 @@ class Config const SERVICE_CLASS_PATTERN = '/^(.+?)\\\\(.+?)\\\\Service\\\\(V\d+)+(\\\\.+)Interface$/'; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; diff --git a/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php b/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php index dda43cdc43623eb3159f92758c60352d12ca198a..a3414861f6fa64718db4922735acda150449bee4 100644 --- a/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php +++ b/app/code/Magento/Webapi/Model/Config/ClassReflector/TypeProcessor.php @@ -348,8 +348,8 @@ class TypeProcessor * * Example: * <pre> - * Magento_Customer_Service_CustomerData => CustomerData - * Magento_Catalog_Service_ProductData => CatalogProductData + * \Magento\Customer\Service\V1\Data\Customer => CustomerV1DataCustomer + * \Magento\Catalog\Service\V2\Data\Product => CatalogV2DataProduct * </pre> * * @param string $class diff --git a/app/code/Magento/Webapi/Model/Config/Converter.php b/app/code/Magento/Webapi/Model/Config/Converter.php index 6297702f8fbfb8c42b2353967b6989f64c48fe18..1ad58cd7bd19834c17e9398872ba08fb56cb2bf0 100644 --- a/app/code/Magento/Webapi/Model/Config/Converter.php +++ b/app/code/Magento/Webapi/Model/Config/Converter.php @@ -32,75 +32,89 @@ class Converter implements \Magento\Config\ConverterInterface * Array keys for config internal representation. */ const KEY_SERVICE_CLASS = 'class'; - - const KEY_BASE_URL = 'baseUrl'; - + const KEY_URL = 'url'; const KEY_SERVICE_METHOD = 'method'; - - const KEY_IS_SECURE = 'isSecure'; - - const KEY_HTTP_METHOD = 'httpMethod'; - - const KEY_SERVICE_METHODS = 'methods'; - - const KEY_METHOD_ROUTE = 'route'; - + const KEY_SECURE = 'secure'; + const KEY_ROUTES = 'routes'; const KEY_ACL_RESOURCES = 'resources'; - + const KEY_SERVICE = 'service'; + const KEY_SERVICES = 'services'; + const KEY_FORCE = 'force'; + const KEY_VALUE = 'value'; + const KEY_DATA_PARAMETERS = 'parameters'; /**#@-*/ /** * {@inheritdoc} + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function convert($source) { - $result = array(); - /** @var \DOMNodeList $services */ - $services = $source->getElementsByTagName('service'); - /** @var \DOMElement $service */ - foreach ($services as $service) { - if ($service->nodeType != XML_ELEMENT_NODE) { + $result = []; + /** @var \DOMNodeList $routes */ + $routes = $source->getElementsByTagName('route'); + /** @var \DOMElement $route */ + foreach ($routes as $route) { + if ($route->nodeType != XML_ELEMENT_NODE) { continue; } + /** @var \DOMElement $service */ + $service = $route->getElementsByTagName('service')->item(0); $serviceClass = $service->attributes->getNamedItem('class')->nodeValue; - $result[$serviceClass] = array( - self::KEY_SERVICE_CLASS => $serviceClass, - self::KEY_SERVICE_METHODS => array() - ); + $serviceMethod = $service->attributes->getNamedItem('method')->nodeValue; - /** @var \DOMAttr $baseUrlNode */ - $baseUrlNode = $service->attributes->getNamedItem('baseUrl'); - if ($baseUrlNode) { - $result[$serviceClass][self::KEY_BASE_URL] = $baseUrlNode->nodeValue; + $resources = $route->getElementsByTagName('resource'); + $resourceReferences = []; + /** @var \DOMElement $resource */ + foreach ($resources as $resource) { + if ($resource->nodeType != XML_ELEMENT_NODE) { + continue; + } + $ref = $resource->attributes->getNamedItem('ref')->nodeValue; + $resourceReferences[$ref] = true; + // For SOAP + $result[self::KEY_SERVICES][$serviceClass][$serviceMethod][self::KEY_ACL_RESOURCES][$ref] = true; } - /** @var \DOMNodeList $restRoutes */ - $restRoutes = $service->getElementsByTagName('rest-route'); - /** @var \DOMElement $restRoute */ - foreach ($restRoutes as $restRoute) { - if ($restRoute->nodeType != XML_ELEMENT_NODE) { + $parameters = $route->getElementsByTagName('parameter'); + $data = []; + /** @var \DOMElement $parameter */ + foreach ($parameters as $parameter) { + if ($parameter->nodeType != XML_ELEMENT_NODE) { continue; } - $httpMethod = $restRoute->attributes->getNamedItem('httpMethod')->nodeValue; - $method = $restRoute->attributes->getNamedItem('method')->nodeValue; - - $resources = $restRoute->attributes->getNamedItem('resources')->nodeValue; - /** Allow whitespace usage after comma. */ - $resources = str_replace(', ', ',', $resources); - $resources = explode(',', $resources); - - $isSecureAttribute = $restRoute->attributes->getNamedItem('isSecure'); - $isSecure = $isSecureAttribute ? true : false; - $path = (string)$restRoute->nodeValue; + $name = $parameter->attributes->getNamedItem('name')->nodeValue; + $forceNode = $parameter->attributes->getNamedItem('force'); + $force = $forceNode ? (bool)$forceNode->nodeValue : false; + $value = $parameter->nodeValue; + $data[$name] = [ + self::KEY_FORCE => $force, + self::KEY_VALUE => ($value === 'null') ? null : $value, + ]; + } - $result[$serviceClass][self::KEY_SERVICE_METHODS][$method] = array( - self::KEY_HTTP_METHOD => $httpMethod, - self::KEY_SERVICE_METHOD => $method, - self::KEY_METHOD_ROUTE => $path, - self::KEY_IS_SECURE => $isSecure, - self::KEY_ACL_RESOURCES => $resources - ); + $method = $route->attributes->getNamedItem('method')->nodeValue; + $url = trim($route->attributes->getNamedItem('url')->nodeValue); + $secureNode = $route->attributes->getNamedItem('secure'); + $secure = $secureNode ? (bool)trim($secureNode->nodeValue) : false; + // We could handle merging here by checking if the route already exists + $result[self::KEY_ROUTES][$url][$method] = [ + self::KEY_SECURE => $secure, + self::KEY_SERVICE => [ + self::KEY_SERVICE_CLASS => $serviceClass, + self::KEY_SERVICE_METHOD => $serviceMethod, + ], + self::KEY_ACL_RESOURCES => $resourceReferences, + self::KEY_DATA_PARAMETERS => $data, + ]; + $serviceSecure = false; + if (isset($result[self::KEY_SERVICES][$serviceClass][$serviceMethod][self::KEY_SECURE])) { + $serviceSecure = $result[self::KEY_SERVICES][$serviceClass][$serviceMethod][self::KEY_SECURE]; } + $result[self::KEY_SERVICES][$serviceClass][$serviceMethod][self::KEY_SECURE] = $serviceSecure || $secure; + } return $result; } diff --git a/app/code/Magento/Webapi/Model/Config/Reader.php b/app/code/Magento/Webapi/Model/Config/Reader.php index 5bad6ce25cade3a6b382b79a7f9d12fc09e4c760..292d6ad133cb369c8c089cb16c6a3ef6e5a4bc75 100644 --- a/app/code/Magento/Webapi/Model/Config/Reader.php +++ b/app/code/Magento/Webapi/Model/Config/Reader.php @@ -33,7 +33,11 @@ class Reader extends \Magento\Config\Reader\Filesystem * * @var array */ - protected $_idAttributes = array('/config/service' => 'class', '/config/service/rest-route' => 'method'); + protected $_idAttributes = [ + '/routes/route' => ['url', 'method'], + '/routes/route/resources/resource' => 'ref', + '/routes/route/data' => 'name', + ]; /** * @param \Magento\Config\FileResolverInterface $fileResolver diff --git a/app/code/Magento/Webapi/Model/IntegrationConfig.php b/app/code/Magento/Webapi/Model/IntegrationConfig.php index 62632016d07622b4f208c2743777ad89f880feb1..5609e1b85b4b3d53e282f2cf171464550f55fd63 100644 --- a/app/code/Magento/Webapi/Model/IntegrationConfig.php +++ b/app/code/Magento/Webapi/Model/IntegrationConfig.php @@ -35,7 +35,7 @@ class IntegrationConfig const CACHE_ID = 'integration-api'; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; diff --git a/app/code/Magento/Webapi/Model/PathProcessor.php b/app/code/Magento/Webapi/Model/PathProcessor.php new file mode 100644 index 0000000000000000000000000000000000000000..860cd2e021dd2c363abf17d291191ee5db46c6ca --- /dev/null +++ b/app/code/Magento/Webapi/Model/PathProcessor.php @@ -0,0 +1,78 @@ +<?php + +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Webapi\Model; + +use Magento\Exception\NoSuchEntityException; + +class PathProcessor +{ + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + + /** + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager) + { + $this->storeManager = $storeManager; + } + + /** + * Process path + * + * @param string $pathInfo + * @return array + */ + private function stripPathBeforeStorecode($pathInfo) + { + $pathParts = explode('/', trim($pathInfo, '/')); + array_shift($pathParts); + $path = '/' . implode('/', $pathParts); + return explode('/', ltrim($path, '/'), 2); + } + /** + * Process path info + * + * @param string $pathInfo + * @return string + * @throws NoSuchEntityException + */ + public function process($pathInfo) + { + $pathParts = $this->stripPathBeforeStorecode($pathInfo); + $storeCode = $pathParts[0]; + $stores = $this->storeManager->getStores(false, true); + if (isset($stores[$storeCode])) { + $this->storeManager->setCurrentStore($storeCode); + $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : ''); + return $path; + } else { + // store does not exist + throw new NoSuchEntityException('storeCode', $storeCode); + } + } +} diff --git a/app/code/Magento/Webapi/Model/Rest/Config.php b/app/code/Magento/Webapi/Model/Rest/Config.php index 6d069311ae97132a80209c5e20c19a04b6d15d49..82ba5d62d9558422956e47525949cb5bd6679a67 100644 --- a/app/code/Magento/Webapi/Model/Rest/Config.php +++ b/app/code/Magento/Webapi/Model/Rest/Config.php @@ -58,6 +58,8 @@ class Config const KEY_ACL_RESOURCES = 'resources'; + const KEY_PARAMETERS = 'parameters'; + /*#@-*/ /** @var ModelConfig */ @@ -104,6 +106,8 @@ class Config $routeData[self::KEY_IS_SECURE] )->setAclResources( $routeData[self::KEY_ACL_RESOURCES] + )->setParameters( + $routeData[self::KEY_PARAMETERS] ); return $route; } @@ -150,33 +154,26 @@ class Config public function getRestRoutes(\Magento\Webapi\Controller\Rest\Request $request) { $serviceBaseUrl = $this->_getServiceBaseUrl($request); - $httpMethod = $request->getHttpMethod(); + $requestHttpMethod = $request->getHttpMethod(); $routes = array(); - foreach ($this->_config->getServices() as $serviceName => $serviceData) { + foreach ($this->_config->getServices()[Converter::KEY_ROUTES] as $url => $httpMethods) { // skip if baseurl is not null and does not match - if (!isset( - $serviceData[Converter::KEY_BASE_URL] - ) || !$serviceBaseUrl || strcasecmp( - trim($serviceBaseUrl, '/'), - trim($serviceData[Converter::KEY_BASE_URL], '/') - ) !== 0 - ) { - // baseurl does not match, just skip this service + if (!$serviceBaseUrl || strpos(trim($url, '/'), trim($serviceBaseUrl, '/')) !== 0) { + // base url does not match, just skip this service continue; } - foreach ($serviceData[Converter::KEY_SERVICE_METHODS] as $methodName => $methodInfo) { - if (strtoupper($methodInfo[Converter::KEY_HTTP_METHOD]) == strtoupper($httpMethod)) { - $secure = $methodInfo[Converter::KEY_IS_SECURE]; - $methodRoute = $methodInfo[Converter::KEY_METHOD_ROUTE]; - $aclResources = $methodInfo[Converter::KEY_ACL_RESOURCES]; + foreach ($httpMethods as $httpMethod => $methodInfo) { + if (strtoupper($httpMethod) == strtoupper($requestHttpMethod)) { + $aclResources = array_keys($methodInfo[Converter::KEY_ACL_RESOURCES]); $routes[] = $this->_createRoute( - array( - self::KEY_ROUTE_PATH => $serviceData[Converter::KEY_BASE_URL] . $methodRoute, - self::KEY_CLASS => $serviceName, - self::KEY_METHOD => $methodName, - self::KEY_IS_SECURE => $secure, - self::KEY_ACL_RESOURCES => $aclResources - ) + [ + self::KEY_ROUTE_PATH => $url, + self::KEY_CLASS => $methodInfo[Converter::KEY_SERVICE][Converter::KEY_SERVICE_CLASS], + self::KEY_METHOD => $methodInfo[Converter::KEY_SERVICE][Converter::KEY_SERVICE_METHOD], + self::KEY_IS_SECURE => $methodInfo[Converter::KEY_SECURE], + self::KEY_ACL_RESOURCES => $aclResources, + self::KEY_PARAMETERS => $methodInfo[Converter::KEY_DATA_PARAMETERS], + ] ); } } diff --git a/app/code/Magento/Webapi/Model/Soap/Config.php b/app/code/Magento/Webapi/Model/Soap/Config.php index 460706fc6941d36bd9cbdd81e2d9d73f9b4a30f7..10c1ebb56038f22a9a3d334d48ea5d526abf8ea6 100644 --- a/app/code/Magento/Webapi/Model/Soap/Config.php +++ b/app/code/Magento/Webapi/Model/Soap/Config.php @@ -38,6 +38,8 @@ class Config const KEY_IS_SECURE = 'isSecure'; + const KEY_SERVICE_METHODS = 'methods'; + const KEY_METHOD = 'method'; const KEY_IS_REQUIRED = 'inputRequired'; @@ -80,20 +82,20 @@ class Config * Initialize dependencies. * * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Webapi\Model\Config $config * @param \Magento\Webapi\Model\Config\ClassReflector $classReflector * @param \Magento\Webapi\Helper\Data $helper */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Webapi\Model\Config $config, \Magento\Webapi\Model\Config\ClassReflector $classReflector, \Magento\Webapi\Helper\Data $helper ) { // TODO: Check if Service specific XSD is already cached - $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->_config = $config; $this->_objectManager = $objectManager; $this->_helper = $helper; @@ -118,18 +120,18 @@ class Config protected function _getSoapOperations($requestedService) { if (null == $this->_soapOperations) { - $this->_soapOperations = array(); + $this->_soapOperations = []; foreach ($this->getRequestedSoapServices($requestedService) as $serviceData) { - foreach ($serviceData[Converter::KEY_SERVICE_METHODS] as $methodData) { - $method = $methodData[Converter::KEY_SERVICE_METHOD]; - $class = $serviceData[Converter::KEY_SERVICE_CLASS]; + foreach ($serviceData[self::KEY_SERVICE_METHODS] as $methodData) { + $method = $methodData[self::KEY_METHOD]; + $class = $serviceData[self::KEY_CLASS]; $operationName = $this->getSoapOperation($class, $method); - $this->_soapOperations[$operationName] = array( + $this->_soapOperations[$operationName] = [ self::KEY_CLASS => $class, self::KEY_METHOD => $method, - self::KEY_IS_SECURE => $methodData[Converter::KEY_IS_SECURE], - self::KEY_ACL_RESOURCES => $methodData[Converter::KEY_ACL_RESOURCES] - ); + self::KEY_IS_SECURE => $methodData[self::KEY_IS_SECURE], + self::KEY_ACL_RESOURCES => $methodData[self::KEY_ACL_RESOURCES] + ]; } } } @@ -145,28 +147,25 @@ class Config { // TODO: Implement caching if this approach is approved if (is_null($this->_soapServices)) { - $this->_soapServices = array(); - foreach ($this->_config->getServices() as $serviceData) { - $serviceClass = $serviceData[Converter::KEY_SERVICE_CLASS]; + $this->_soapServices = []; + foreach ($this->_config->getServices()[Converter::KEY_SERVICES] as $serviceClass => $serviceData) { $serviceName = $this->_helper->getServiceName($serviceClass); - foreach ($serviceData[Converter::KEY_SERVICE_METHODS] as $methodMetadata) { - // TODO: Simplify the structure in SOAP. Currently it is unified in SOAP and REST - $methodName = $methodMetadata[Converter::KEY_SERVICE_METHOD]; - $this->_soapServices[$serviceName]['methods'][$methodName] = array( + foreach ($serviceData as $methodName => $methodMetadata) { + $this->_soapServices[$serviceName][self::KEY_SERVICE_METHODS][$methodName] = [ self::KEY_METHOD => $methodName, - self::KEY_IS_REQUIRED => (bool)$methodMetadata[Converter::KEY_IS_SECURE], - self::KEY_IS_SECURE => $methodMetadata[Converter::KEY_IS_SECURE], - self::KEY_ACL_RESOURCES => $methodMetadata[Converter::KEY_ACL_RESOURCES] - ); + self::KEY_IS_REQUIRED => (bool)$methodMetadata[Converter::KEY_SECURE], + self::KEY_IS_SECURE => $methodMetadata[Converter::KEY_SECURE], + self::KEY_ACL_RESOURCES => array_keys($methodMetadata[Converter::KEY_ACL_RESOURCES]), + ]; $this->_soapServices[$serviceName][self::KEY_CLASS] = $serviceClass; } $reflectedMethodsMetadata = $this->_classReflector->reflectClassMethods( $serviceClass, - $this->_soapServices[$serviceName]['methods'] + $this->_soapServices[$serviceName][self::KEY_SERVICE_METHODS] ); // TODO: Consider service documentation extraction via reflection - $this->_soapServices[$serviceName]['methods'] = array_merge_recursive( - $this->_soapServices[$serviceName]['methods'], + $this->_soapServices[$serviceName][self::KEY_SERVICE_METHODS] = array_merge_recursive( + $this->_soapServices[$serviceName][self::KEY_SERVICE_METHODS], $reflectedMethodsMetadata ); } @@ -192,12 +191,12 @@ class Config \Magento\Webapi\Exception::HTTP_NOT_FOUND ); } - return array( + return [ self::KEY_CLASS => $soapOperations[$soapOperation][self::KEY_CLASS], self::KEY_METHOD => $soapOperations[$soapOperation][self::KEY_METHOD], self::KEY_IS_SECURE => $soapOperations[$soapOperation][self::KEY_IS_SECURE], self::KEY_ACL_RESOURCES => $soapOperations[$soapOperation][self::KEY_ACL_RESOURCES] - ); + ]; } /** @@ -208,7 +207,7 @@ class Config */ public function getRequestedSoapServices(array $requestedServices) { - $services = array(); + $services = []; foreach ($requestedServices as $serviceName) { if (isset($this->_soapServices[$serviceName])) { $services[] = $this->_soapServices[$serviceName]; diff --git a/app/code/Magento/Webapi/Model/Soap/Fault.php b/app/code/Magento/Webapi/Model/Soap/Fault.php index 4388133affa6bad7cd16d150b1c5df3d4141dfef..1cca0498fdf56ed851c1ea13bd69a83797fa9774 100644 --- a/app/code/Magento/Webapi/Model/Soap/Fault.php +++ b/app/code/Magento/Webapi/Model/Soap/Fault.php @@ -25,7 +25,7 @@ */ namespace Magento\Webapi\Model\Soap; -use Magento\App\State; +use Magento\Framework\App\State; class Fault extends \RuntimeException { @@ -86,7 +86,7 @@ class Fault extends \RuntimeException protected $_details = array(); /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -101,19 +101,19 @@ class Fault extends \RuntimeException protected $_localeResolver; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param Server $soapServer * @param \Magento\Webapi\Exception $previousException * @param \Magento\Locale\ResolverInterface $localeResolver * @param State $appState */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, Server $soapServer, \Magento\Webapi\Exception $previousException, \Magento\Locale\ResolverInterface $localeResolver, diff --git a/app/code/Magento/Webapi/Model/Soap/Server.php b/app/code/Magento/Webapi/Model/Soap/Server.php index c2e194f7aa23315343f74cc943eea559a6b57740..b3e4d80243299b6536c1d28f27cfa8cd9dbd6d1b 100644 --- a/app/code/Magento/Webapi/Model/Soap/Server.php +++ b/app/code/Magento/Webapi/Model/Soap/Server.php @@ -42,7 +42,7 @@ class Server const REQUEST_PARAM_WSDL = 'wsdl'; /** - * @var \Magento\App\AreaLIst + * @var \Magento\Framework\App\AreaLIst */ protected $_areaList; @@ -67,32 +67,32 @@ class Server protected $_typeProcessor; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** * Initialize dependencies, initialize WSDL cache. * - * @param \Magento\App\AreaList $areaList + * @param \Magento\Framework\App\AreaList $areaList * @param \Magento\Config\ScopeInterface $configScope * @param \Magento\Webapi\Controller\Soap\Request $request * @param \Magento\DomDocument\Factory $domDocumentFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Webapi\Model\Soap\Server\Factory $soapServerFactory * @param \Magento\Webapi\Model\Config\ClassReflector\TypeProcessor $typeProcessor - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @throws \Magento\Webapi\Exception */ public function __construct( - \Magento\App\AreaList $areaList, + \Magento\Framework\App\AreaList $areaList, \Magento\Config\ScopeInterface $configScope, \Magento\Webapi\Controller\Soap\Request $request, \Magento\DomDocument\Factory $domDocumentFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Webapi\Model\Soap\Server\Factory $soapServerFactory, \Magento\Webapi\Model\Config\ClassReflector\TypeProcessor $typeProcessor, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { if (!extension_loaded('soap')) { throw new \Magento\Webapi\Exception( @@ -172,9 +172,9 @@ class Server */ public function getEndpointUri() { - return $this->_storeManager->getStore()->getBaseUrl() . $this->_areaList->getFrontName( - $this->_configScope->getCurrentScope() - ); + return $this->_storeManager->getStore()->getBaseUrl() + . $this->_areaList->getFrontName($this->_configScope->getCurrentScope()) + . '/' . $this->_storeManager->getStore()->getCode(); } /** diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index e9c9e318792ee1970282ef976dd38a8c221ec169..aaec7282d0fb015d426f99c0c13cc9fbb9aca938 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -24,7 +24,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\AreaList"> + <type name="Magento\Framework\App\AreaList"> <arguments> <argument name="areas" xsi:type="array"> <item name="webapi_rest" xsi:type="array"> diff --git a/app/code/Magento/Webapi/etc/webapi.xsd b/app/code/Magento/Webapi/etc/webapi.xsd index d054ff02d4655124defd3b523183cd09c3313d96..0d17ba34279e11b8a8917b20cfdde25f024542ae 100644 --- a/app/code/Magento/Webapi/etc/webapi.xsd +++ b/app/code/Magento/Webapi/etc/webapi.xsd @@ -26,41 +26,68 @@ */ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="config" type="configType"/> - <xs:complexType name="configType"> + <xs:element name="routes" type="routesType"/> + + <xs:complexType name="routesType"> <xs:sequence> - <xs:element type="serviceType" name="service" maxOccurs="unbounded" minOccurs="1"/> + <xs:element name="route" type="routeType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> + + <xs:complexType name="routeType"> + <xs:sequence> + <xs:element name="service" type="serviceType"/> + <xs:element name="resources" type="resourcesType"/> + <xs:element name="data" type="dataType" minOccurs="0"/> + </xs:sequence> + <xs:attribute name="method" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="GET"/> + <xs:enumeration value="PUT"/> + <xs:enumeration value="POST"/> + <xs:enumeration value="DELETE"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="url" type="xs:string" use="required"/> + <xs:attribute name="secure" type="xs:boolean"/> + </xs:complexType> + <xs:complexType name="serviceType"> + <xs:attribute name="class" type="xs:string" use="required"/> + <xs:attribute name="method" type="xs:string" use="required"/> + </xs:complexType> + + <xs:complexType name="resourcesType" > + <xs:sequence> + <xs:element name="resource" type="resourceType" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="resourceType"> + <xs:attribute name="ref" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:pattern value=".+::.+(, ?.+::.+)*"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + + <xs:complexType name="dataType" > <xs:sequence> - <xs:element type="restRouteType" name="rest-route" maxOccurs="unbounded" minOccurs="1"/> + <xs:element name="parameter" type="parameterType" maxOccurs="unbounded"/> </xs:sequence> - <xs:attribute type="xs:string" name="class"/> - <xs:attribute type="xs:string" name="baseUrl"/> </xs:complexType> - <xs:complexType name="restRouteType"> + + <xs:complexType name="parameterType"> <xs:simpleContent> <xs:extension base="xs:string"> - <xs:attribute name="httpMethod"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="GET"/> - <xs:enumeration value="PUT"/> - <xs:enumeration value="POST"/> - <xs:enumeration value="DELETE"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute type="xs:string" name="method"/> - <xs:attribute type="resourcesType" name="resources"/> - <xs:attribute type="xs:boolean" name="isSecure" default="false"/> + <xs:attribute name="name" type="xs:string" use="required"/> + <xs:attribute name="force" type="xs:boolean"/> </xs:extension> </xs:simpleContent> </xs:complexType> - <xs:simpleType name="resourcesType"> - <xs:restriction base="xs:string"> - <xs:pattern value=".+::.+(, ?.+::.+)*"/> - </xs:restriction> - </xs:simpleType> + </xs:schema> diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml index 9d49baaf00233e04b93d8daddc6e8d17ea982d39..b53e6e715c2da4388d8fb893212daee20f76778c 100644 --- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml @@ -30,7 +30,7 @@ <argument name="request" xsi:type="object">Magento\Webapi\Controller\Rest\Request</argument> </arguments> </type> - <preference for="Magento\App\FrontControllerInterface" type="Magento\Webapi\Controller\Rest" /> + <preference for="Magento\Framework\App\FrontControllerInterface" type="Magento\Webapi\Controller\Rest" /> <preference for="Magento\Model\ActionValidator\RemoveAction" type="Magento\Model\ActionValidator\RemoveAction\Allowed" /> <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" /> <type name="Magento\Webapi\Controller\Rest\Request\Deserializer\Factory"> diff --git a/app/code/Magento/Webapi/etc/webapi_soap/di.xml b/app/code/Magento/Webapi/etc/webapi_soap/di.xml index 4415bbc060be1e49c7536ff4c07bcf333939f31a..dc1b7f2e05ba203fc49301a097d185d5d64ae124 100644 --- a/app/code/Magento/Webapi/etc/webapi_soap/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_soap/di.xml @@ -30,7 +30,7 @@ <argument name="request" xsi:type="object">Magento\Webapi\Controller\Soap\Request</argument> </arguments> </type> - <preference for="Magento\App\FrontControllerInterface" type="Magento\Webapi\Controller\Soap" /> + <preference for="Magento\Framework\App\FrontControllerInterface" type="Magento\Webapi\Controller\Soap" /> <preference for="Magento\Model\ActionValidator\RemoveAction" type="Magento\Model\ActionValidator\RemoveAction\Allowed" /> <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" /> <type name="Magento\Webapi\Controller\Soap"> diff --git a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php index 3743765a2e50ea89afbbb52c30f8b9a9908980d5..f1eab4db6b058b7ceb70ac212627b04e92ea6675 100644 --- a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php @@ -29,10 +29,6 @@ use Magento\Data\Form\Element\AbstractElement; /** * Adminhtml weee tax item renderer - * - * @category Magento - * @package Magento_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> */ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Data\Form\Element\Renderer\RendererInterface { @@ -61,7 +57,7 @@ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Data\Form\El * * @var \Magento\Registry */ - protected $_coreRegistry = null; + protected $_coreRegistry; /** * @var \Magento\Directory\Model\Config\Source\Country @@ -167,17 +163,17 @@ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Data\Form\El } /** - * @param array $a - * @param array $b + * @param array $firstItem + * @param array $secondItem * @return int */ - protected function _sortWeeeTaxes($a, $b) + protected function _sortWeeeTaxes($firstItem, $secondItem) { - if ($a['website_id'] != $b['website_id']) { - return $a['website_id'] < $b['website_id'] ? -1 : 1; + if ($firstItem['website_id'] != $secondItem['website_id']) { + return $firstItem['website_id'] < $secondItem['website_id'] ? -1 : 1; } - if ($a['country'] != $b['country']) { - return $a['country'] < $b['country'] ? -1 : 1; + if ($firstItem['country'] != $secondItem['country']) { + return $firstItem['country'] < $secondItem['country'] ? -1 : 1; } return 0; } @@ -203,7 +199,7 @@ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Data\Form\El */ public function getCountries() { - if (is_null($this->_countries)) { + if (null === $this->_countries) { $this->_countries = $this->_sourceCountry->toOptionArray(); } @@ -215,7 +211,7 @@ class Tax extends \Magento\Backend\Block\Widget implements \Magento\Data\Form\El */ public function getWebsites() { - if (!is_null($this->_websites)) { + if (null !== $this->_websites) { return $this->_websites; } $websites = array(); diff --git a/app/code/Magento/Weee/Helper/Data.php b/app/code/Magento/Weee/Helper/Data.php index 4e821142f3f88fc125d38c755fdfb8607ab76f1e..68968e822d97d2a7718eb25f69de0a8442b4246d 100644 --- a/app/code/Magento/Weee/Helper/Data.php +++ b/app/code/Magento/Weee/Helper/Data.php @@ -30,13 +30,12 @@ use Magento\Store\Model\Website; /** * WEEE data helper - * - * @category Magento - * @package Magento_Weee - * @author Magento Core Team <core@magentocommerce.com> */ -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { + /** + * Enabled config path + */ const XML_PATH_FPT_ENABLED = 'tax/weee/enable'; /** @@ -49,19 +48,19 @@ class Data extends \Magento\App\Helper\AbstractHelper * * @var \Magento\Registry */ - protected $_coreRegistry = null; + protected $_coreRegistry; /** * Tax data * * @var \Magento\Tax\Helper\Data */ - protected $_taxData = null; + protected $_taxData; /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -76,20 +75,20 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Weee\Model\Tax $weeeTax * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Weee\Model\Tax $weeeTax, \Magento\Tax\Helper\Data $taxData, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_storeManager = $storeManager; $this->_weeeTax = $weeeTax; @@ -220,30 +219,29 @@ class Data extends \Magento\App\Helper\AbstractHelper } /** - * Returns diaplay type for price accordingly to current zone + * Returns display type for price accordingly to current zone * - * @param \Magento\Catalog\Model\Product $product * @param int|int[]|null $compareTo * @param string $zone * @param Store $store * @return bool|int */ - public function typeOfDisplay($product, $compareTo = null, $zone = null, $store = null) + public function typeOfDisplay($compareTo = null, $zone = \Magento\Pricing\Render::ZONE_DEFAULT, $store = null) { if (!$this->isEnabled($store)) { return false; } switch ($zone) { - case 'product_view': + case \Magento\Pricing\Render::ZONE_ITEM_VIEW: $type = $this->getPriceDisplayType($store); break; - case 'product_list': + case \Magento\Pricing\Render::ZONE_ITEM_LIST: $type = $this->getListPriceDisplayType($store); break; - case 'sales': + case \Magento\Pricing\Render::ZONE_SALES: $type = $this->getSalesPriceDisplayType($store); break; - case 'email': + case \Magento\Pricing\Render::ZONE_EMAIL: $type = $this->getEmailPriceDisplayType($store); break; default: @@ -283,7 +281,13 @@ class Data extends \Magento\App\Helper\AbstractHelper $website = null, $calculateTaxes = false ) { - return $this->_weeeTax->getProductWeeeAttributes($product, $shipping, $billing, $website, $calculateTaxes); + return $this->_weeeTax->getProductWeeeAttributes( + $product, + $shipping, + $billing, + $website, + $calculateTaxes + ); } /** @@ -340,7 +344,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function getProductWeeeAttributesForDisplay($product) { if ($this->isEnabled()) { - return $this->getProductWeeeAttributes($product, null, null, null, $this->typeOfDisplay($product, 1)); + return $this->getProductWeeeAttributes($product, null, null, null, $this->typeOfDisplay(1)); } return array(); } @@ -368,7 +372,7 @@ class Data extends \Magento\App\Helper\AbstractHelper $shipping, $billing, $website, - $calculateTaxes ? $calculateTaxes : $this->typeOfDisplay($product, 1) + $calculateTaxes ? $calculateTaxes : $this->typeOfDisplay(1) ); } return array(); @@ -383,7 +387,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function getAmountForDisplay($product) { if ($this->isEnabled()) { - return $this->_weeeTax->getWeeeAmount($product, null, null, null, $this->typeOfDisplay($product, 1)); + return $this->_weeeTax->getWeeeAmount($product, null, null, null, $this->typeOfDisplay(1)); } return 0; } @@ -418,11 +422,7 @@ class Data extends \Magento\App\Helper\AbstractHelper $store->convertPrice($this->_taxData->getPrice($product, $tier['website_price'], true) + $weeeAmount), false ); - $tier['formated_price_incl_weee'] = '<span class="price tier-' . - $index . - '-incl-tax">' . - $html . - '</span>'; + $tier['formated_price_incl_weee'] = '<span class="price tier-' . $index . '-incl-tax">' . $html . '</span>'; $html = $store->formatPrice( $store->convertPrice($this->_taxData->getPrice($product, $tier['website_price']) + $weeeAmount), false @@ -457,16 +457,16 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getAmountInclTaxes($attributes) { - if (is_array($attributes)) { - $amount = 0; - foreach ($attributes as $attribute) { - /* @var $attribute \Magento\Object */ - $amount += $attribute->getAmount() + $attribute->getTaxAmount(); - } - } else { + if (!is_array($attributes)) { throw new \Magento\Exception('$attributes must be an array'); } - return (double)$amount; + $amount = 0; + foreach ($attributes as $attribute) { + /* @var $attribute \Magento\Object */ + $amount += $attribute->getAmount() + $attribute->getTaxAmount(); + } + + return (float) $amount; } } diff --git a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php index d187fa69a4f7e9ca733d3cdd20c447b5d4916de9..4d8913eab8c886f1c6f14e6fc987648e08828b53 100644 --- a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -49,7 +49,7 @@ class Tax extends \Magento\Catalog\Model\Product\Attribute\Backend\Price * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Directory\Helper\Data $directoryHelper * @param \Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax $attributeTax */ @@ -58,7 +58,7 @@ class Tax extends \Magento\Catalog\Model\Product\Attribute\Backend\Price \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax $attributeTax ) { @@ -100,7 +100,9 @@ class Tax extends \Magento\Catalog\Model\Product\Attribute\Backend\Price $key1 = implode('-', array($tax['website_id'], $tax['country'], $state)); if (!empty($dup[$key1])) { - throw new Exception(__('We found a duplicate website, country, and state tax.')); + throw new Exception( + __('We found a duplicate of website, country and state fields for a fixed product tax') + ); } $dup[$key1] = 1; } diff --git a/app/code/Magento/Weee/Model/Observer.php b/app/code/Magento/Weee/Model/Observer.php index 2a570d11b0f35547a667f3b091aa916d491e97f0..ddf3264859316e61b7ed381cbfee494b4546e4de 100644 --- a/app/code/Magento/Weee/Model/Observer.php +++ b/app/code/Magento/Weee/Model/Observer.php @@ -258,7 +258,7 @@ class Observer extends \Magento\Model\AbstractModel $options['plusDisposition'] = $this->_weeeData->getAmount($_product); // Exclude Weee amount from excluding tax amount - if (!$this->_weeeData->typeOfDisplay($_product, array(Tax::DISPLAY_INCL, Tax::DISPLAY_INCL_DESCR))) { + if (!$this->_weeeData->typeOfDisplay(array(Tax::DISPLAY_INCL, Tax::DISPLAY_INCL_DESCR))) { $options['exclDisposition'] = true; } @@ -297,7 +297,7 @@ class Observer extends \Magento\Model\AbstractModel $options['plusDisposition'] = $amount; $options['plusDispositionTax'] = $taxes < 0 ? 0 : $taxes; // Exclude Weee amount from excluding tax amount - if (!$this->_weeeData->typeOfDisplay($_product, array(0, 1, 4))) { + if (!$this->_weeeData->typeOfDisplay(array(0, 1, 4))) { $options['exclDisposition'] = true; } diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index af8bd26067c5f29a16450151d637dd341e7d6c4c..b874cb736ce01b43e9cc2038825b7af50201b19a 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -40,11 +40,11 @@ class Tax extends \Magento\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Weee/Model/Resource/Tax.php b/app/code/Magento/Weee/Model/Resource/Tax.php index 3d8c6d73db0c132d5665b4bf68038216b75d87d7..b0424630e11408f729fcb7772851152e1b0a304c 100644 --- a/app/code/Magento/Weee/Model/Resource/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Tax.php @@ -39,10 +39,10 @@ class Tax extends \Magento\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Weee/Model/Tax.php b/app/code/Magento/Weee/Model/Tax.php index ab2636d575fb10c5818ca41f89465a8977153883..2f9a710fed099c02fedf0fe6244df46720d6dbd7 100644 --- a/app/code/Magento/Weee/Model/Tax.php +++ b/app/code/Magento/Weee/Model/Tax.php @@ -27,6 +27,7 @@ namespace Magento\Weee\Model; use Magento\Catalog\Model\Product; use Magento\Store\Model\Website; +use Magento\Customer\Model\Converter as CustomerConverter; class Tax extends \Magento\Model\AbstractModel { @@ -94,6 +95,11 @@ class Tax extends \Magento\Model\AbstractModel */ protected $_customerSession; + /** + * @var CustomerConverter + */ + protected $customerConverter; + /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry @@ -104,6 +110,7 @@ class Tax extends \Magento\Model\AbstractModel * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Weee\Helper\Data $weeeData * @param \Magento\Weee\Model\Resource\Tax $resource + * @param CustomerConverter $customerConverter * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ @@ -117,6 +124,7 @@ class Tax extends \Magento\Model\AbstractModel \Magento\Tax\Helper\Data $taxData, \Magento\Weee\Helper\Data $weeeData, \Magento\Weee\Model\Resource\Tax $resource, + CustomerConverter $customerConverter, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { @@ -126,6 +134,7 @@ class Tax extends \Magento\Model\AbstractModel $this->_customerSession = $customerSession; $this->_taxData = $taxData; $this->_weeeData = $weeeData; + $this->customerConverter = $customerConverter; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -200,8 +209,8 @@ class Tax extends \Magento\Model\AbstractModel /** * @param Product $product - * @param null|false|\Magento\Object $shipping - * @param null|false|\Magento\Object $billing + * @param null|false|\Magento\Sales\Model\Quote\Address $shipping + * @param null|false|\Magento\Sales\Model\Quote\Address $billing * @param Website $website * @param bool $calculateTax * @param bool $ignoreDiscount @@ -226,6 +235,7 @@ class Tax extends \Magento\Model\AbstractModel /** @var \Magento\Tax\Model\Calculation $calculator */ $calculator = $this->_calculationFactory->create(); + if ($shipping) { $customerTaxClass = $shipping->getQuote()->getCustomerTaxClassId(); $calculator->setCustomerData($shipping->getQuote()->getCustomerData()); @@ -297,15 +307,10 @@ class Tax extends \Magento\Model\AbstractModel } $one = new \Magento\Object(); - $one->setName( - __($attribute->getFrontend()->getLabel()) - )->setAmount( - $amount - )->setTaxAmount( - $taxAmount - )->setCode( - $attribute->getAttributeCode() - ); + $one->setName(__($attribute->getFrontend()->getLabel())) + ->setAmount($amount) + ->setTaxAmount($taxAmount) + ->setCode($attribute->getAttributeCode()); $result[] = $one; } diff --git a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php index fcd7c277cc3c4a09d13881ac005e467b7a114fd4..063539859b09c6818a5c032a404edd6a2621bc3b 100644 --- a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php @@ -23,6 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Weee\Model\Total\Creditmemo; use Magento\Sales\Model\Order\Creditmemo; @@ -66,7 +67,6 @@ class Weee extends \Magento\Sales\Model\Order\Creditmemo\Total\AbstractTotal if ($item->getOrderItem()->isDummy()) { continue; } - $orderItemQty = $item->getOrderItem()->getQtyOrdered(); $totalTax += $item->getWeeeTaxAppliedAmount() * $item->getQty(); $baseTotalTax += $item->getBaseWeeeTaxAppliedAmount() * $item->getQty(); diff --git a/app/code/Magento/Weee/Model/Total/Quote/Nominal/Weee.php b/app/code/Magento/Weee/Model/Total/Quote/Nominal/Weee.php index a76f77bc17e12da6d492b0503aff829c7d98bb40..50dc52032de3f04ec2ab99a968899b13a0a9f3cd 100644 --- a/app/code/Magento/Weee/Model/Total/Quote/Nominal/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Quote/Nominal/Weee.php @@ -24,11 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Weee\Model\Total\Quote\Nominal; + /** * Nominal fixed product tax total */ -namespace Magento\Weee\Model\Total\Quote\Nominal; - class Weee extends \Magento\Weee\Model\Total\Quote\Weee { /** diff --git a/app/code/Magento/Weee/Model/Total/Quote/Weee.php b/app/code/Magento/Weee/Model/Total/Quote/Weee.php index 5132431f3b6ee2fd29e3c48110c2fd22e9ff8e0a..453b09b1a89f2b5402abdc7ad29a944ac5973788 100644 --- a/app/code/Magento/Weee/Model/Total/Quote/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Quote/Weee.php @@ -42,7 +42,7 @@ class Weee extends \Magento\Tax\Model\Sales\Total\Quote\Tax protected $_store; /** - * Flag which notify what tax amount can be affected by fixed porduct tax + * Flag which notify what tax amount can be affected by fixed product tax * * @var bool */ @@ -136,12 +136,12 @@ class Weee extends \Magento\Tax\Model\Sales\Total\Quote\Tax $totalRowValue = 0; $baseTotalRowValue = 0; - foreach ($attributes as $k => $attribute) { - $baseValue = $attribute->getAmount(); - $value = $this->_store->convertPrice($baseValue); - $rowValue = $value * $item->getTotalQty(); - $baseRowValue = $baseValue * $item->getTotalQty(); - $title = $attribute->getName(); + foreach ($attributes as $key => $attribute) { + $baseValue = $attribute->getAmount(); + $value = $this->_store->convertPrice($baseValue); + $rowValue = $value * $item->getTotalQty(); + $baseRowValue = $baseValue * $item->getTotalQty(); + $title = $attribute->getName(); $totalValue += $value; $baseTotalValue += $baseValue; @@ -164,33 +164,26 @@ class Weee extends \Magento\Tax\Model\Sales\Total\Quote\Tax ); $applied[] = array( - 'id' => $attribute->getCode(), - 'percent' => null, - 'hidden' => $this->_weeeData->includeInSubtotal($this->_store), - 'rates' => array( - array( - 'base_real_amount' => $baseRowValue, - 'base_amount' => $baseRowValue, - 'amount' => $rowValue, - 'code' => $attribute->getCode(), - 'title' => $title, - 'percent' => null, - 'position' => 1, - 'priority' => -1000 + $k - ) - ) + 'id' => $attribute->getCode(), + 'percent' => null, + 'hidden' => $this->_weeeData->includeInSubtotal($this->_store), + 'rates' => array(array( + 'base_real_amount'=> $baseRowValue, + 'base_amount' => $baseRowValue, + 'amount' => $rowValue, + 'code' => $attribute->getCode(), + 'title' => $title, + 'percent' => null, + 'position' => 1, + 'priority' => -1000 + $key, + )) ); } - $item->setWeeeTaxAppliedAmount( - $totalValue - )->setBaseWeeeTaxAppliedAmount( - $baseTotalValue - )->setWeeeTaxAppliedRowAmount( - $totalRowValue - )->setBaseWeeeTaxAppliedRowAmnt( - $baseTotalRowValue - ); + $item->setWeeeTaxAppliedAmount($totalValue) + ->setBaseWeeeTaxAppliedAmount($baseTotalValue) + ->setWeeeTaxAppliedRowAmount($totalRowValue) + ->setBaseWeeeTaxAppliedRowAmnt($baseTotalRowValue); $this->_processTaxSettings( $item, @@ -250,15 +243,10 @@ class Weee extends \Magento\Tax\Model\Sales\Total\Quote\Tax { if ($this->_weeeData->isTaxable($this->_store) && $rowValue) { if (!$this->_config->priceIncludesTax($this->_store)) { - $item->setExtraTaxableAmount( - $value - )->setBaseExtraTaxableAmount( - $baseValue - )->setExtraRowTaxableAmount( - $rowValue - )->setBaseExtraRowTaxableAmount( - $baseRowValue - ); + $item->setExtraTaxableAmount($value) + ->setBaseExtraTaxableAmount($baseValue) + ->setExtraRowTaxableAmount($rowValue) + ->setBaseExtraRowTaxableAmount($baseRowValue); } $item->unsRowTotalInclTax()->unsBaseRowTotalInclTax()->unsPriceInclTax()->unsBasePriceInclTax(); $this->_isTaxAffected = true; diff --git a/app/code/Magento/Weee/Pricing/Adjustment.php b/app/code/Magento/Weee/Pricing/Adjustment.php new file mode 100644 index 0000000000000000000000000000000000000000..4257db497f6ef970247862fbc2106b76206b81bb --- /dev/null +++ b/app/code/Magento/Weee/Pricing/Adjustment.php @@ -0,0 +1,162 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Tax + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Weee\Pricing; + +use Magento\Pricing\Adjustment\AdjustmentInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Weee\Helper\Data as WeeeHelper; + +/** + * Weee pricing adjustment + */ +class Adjustment implements AdjustmentInterface +{ + /** + * Adjustment code weee + */ + const CODE = 'weee'; + + /** + * Weee helper + * + * @var WeeeHelper + */ + protected $weeeHelper; + + /** + * Sort order + * + * @var int|null + */ + protected $sortOrder; + + /** + * Constructor + * + * @param WeeeHelper $weeeHelper + * @param int $sortOrder + */ + public function __construct(WeeeHelper $weeeHelper, $sortOrder = null) + { + $this->weeeHelper = $weeeHelper; + $this->sortOrder = $sortOrder; + } + + /** + * Get adjustment code + * + * @return string + */ + public function getAdjustmentCode() + { + return self::CODE; + } + + /** + * Define if adjustment is included in base price + * (FPT is excluded from base price) + * + * @return bool + */ + public function isIncludedInBasePrice() + { + return false; + } + + /** + * Define if adjustment is included in display price + * + * @return bool + */ + public function isIncludedInDisplayPrice() + { + return $this->weeeHelper->typeOfDisplay( + [ + \Magento\Weee\Model\Tax::DISPLAY_INCL, + \Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, + \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, + 4 + ] + ); + } + + /** + * Extract adjustment amount from the given amount value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function extractAdjustment($amount, SaleableInterface $saleableItem) + { + return $this->getAmount($saleableItem); + } + + /** + * Apply adjustment amount and return result value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function applyAdjustment($amount, SaleableInterface $saleableItem) + { + return $amount + $this->getAmount($saleableItem); + } + + /** + * Check if adjustment should be excluded from calculations along with the given adjustment + * + * @param string $adjustmentCode + * @return bool + */ + public function isExcludedWith($adjustmentCode) + { + return ($adjustmentCode === self::CODE) || $adjustmentCode === \Magento\Tax\Pricing\Adjustment::CODE; + } + + /** + * Obtain amount + * + * @param SaleableInterface $saleableItem + * @return float + */ + protected function getAmount(SaleableInterface $saleableItem) + { + return $this->weeeHelper->getAmount($saleableItem); + } + + /** + * Return sort order position + * + * @return int + */ + public function getSortOrder() + { + return $this->weeeHelper->isTaxable() ? $this->sortOrder : -1; + } +} diff --git a/app/code/Magento/Weee/Pricing/Render/Adjustment.php b/app/code/Magento/Weee/Pricing/Render/Adjustment.php new file mode 100644 index 0000000000000000000000000000000000000000..ae7425365d82adae064fdadcb33c96fe6f6a7f8a --- /dev/null +++ b/app/code/Magento/Weee/Pricing/Render/Adjustment.php @@ -0,0 +1,203 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Weee\Pricing\Render; + +use Magento\View\Element\Template; +use Magento\Pricing\Render\AbstractAdjustment; +use Magento\Pricing\PriceCurrencyInterface; +use Magento\Weee\Model\Tax; + +/** + * Weee Tax Price Adjustment + */ +class Adjustment extends AbstractAdjustment +{ + /** + * Weee helper + * + * @var \Magento\Weee\Helper\Data + */ + protected $weeeHelper; + + /** + * @var float + */ + protected $finalAmount; + + /** + * Constructor + * + * @param Template\Context $context + * @param PriceCurrencyInterface $priceCurrency + * @param \Magento\Weee\Helper\Data $weeeHelper + * @param array $data + */ + public function __construct( + Template\Context $context, + PriceCurrencyInterface $priceCurrency, + \Magento\Weee\Helper\Data $weeeHelper, + array $data = [] + ) { + $this->weeeHelper = $weeeHelper; + parent::__construct($context, $priceCurrency, $data); + } + + /** + * @return null + */ + protected function apply() + { + if ($this->typeOfDisplay( + [ + Tax::DISPLAY_EXCL, + Tax::DISPLAY_EXCL_DESCR_INCL + ] + ) + ) { + $this->finalAmount = $this->amountRender->getDisplayValue(); + $this->amountRender->setDisplayValue( + $this->amountRender->getDisplayValue() - + $this->amountRender->getAmount()->getAdjustmentAmount($this->getAdjustmentCode()) + ); + } + $html = $this->toHtml(); + if (trim($html)) { + $this->amountRender->addAdjustmentHtml($this->getAdjustmentCode(), $html); + } + } + + /** + * Obtain adjustment code + * + * @return string + */ + public function getAdjustmentCode() + { + //@TODO We can build two model using DI, not code. What about passing it in constructor? + return \Magento\Weee\Pricing\Adjustment::CODE; + } + + /** + * @return float + */ + public function getFinalAmount() + { + return $this->finalAmount; + } + + /** + * Get weee amount + * + * @return float + */ + protected function getWeeeTaxAmount() + { + $product = $this->getSaleableItem(); + return $this->weeeHelper->getAmount($product); + } + + /** + * Define if adjustment should be shown with including tax, description + * + * @return bool + */ + public function showInclDescr() + { + return $this->isDisplayFpt() && $this->getWeeeTaxAmount() && $this->typeOfDisplay(Tax::DISPLAY_INCL_DESCR); + } + + /** + * Define if adjustment should be shown with including tax, excluding tax, description + * + * @return bool + */ + public function showExclDescrIncl() + { + return $this->isDisplayFpt() && $this->getWeeeTaxAmount() && $this->typeOfDisplay(Tax::DISPLAY_EXCL_DESCR_INCL); + } + + /** + * Obtain Weee tax attributes + * + * @return array|\Magento\Object[] + */ + public function getWeeeTaxAttributes() + { + return $this->isDisplayFpt() ? $this->getWeeeAttributesForDisplay() : []; + } + + /** + * Render Weee tax attributes + * + * @param \Magento\Object $attribute + * @return string + */ + public function renderWeeeTaxAttribute(\Magento\Object $attribute) + { + return $attribute->getData('name') . ': ' . $this->convertAndFormatCurrency($attribute->getData('amount')); + } + + /** + * Returns display type for price accordingly to current zone + * + * @param int|int[]|null $compareTo + * @param \Magento\Store\Model\Store|null $store + * @return bool|int + */ + protected function typeOfDisplay($compareTo = null, $store = null) + { + return $this->weeeHelper->typeOfDisplay($compareTo, $this->getZone(), $store); + } + + /** + * Get Weee attributes for display + * + * @return \Magento\Object[] + */ + protected function getWeeeAttributesForDisplay() + { + $product = $this->getSaleableItem(); + return $this->weeeHelper->getProductWeeeAttributesForDisplay($product); + } + + /** + * Define if the FPT should be displayed + * + * @return bool + */ + protected function isDisplayFpt() + { + $isDisplayFpt = $this->typeOfDisplay( + [ + Tax::DISPLAY_INCL_DESCR, + Tax::DISPLAY_EXCL_DESCR_INCL + ] + ); + + return $isDisplayFpt; + } +} diff --git a/app/code/Magento/Weee/etc/di.xml b/app/code/Magento/Weee/etc/di.xml index 8fd85ef93d2a05f8af20b005285bd02283cee350..25f6141f16808455b8fbb96ef7c983214a69e992 100644 --- a/app/code/Magento/Weee/etc/di.xml +++ b/app/code/Magento/Weee/etc/di.xml @@ -43,4 +43,15 @@ </argument> </arguments> </type> + + <type name="Magento\Pricing\Adjustment\Pool"> + <arguments> + <argument name="adjustments" xsi:type="array"> + <item name="weee" xsi:type="array"> + <item name="className" xsi:type="string">Magento\Weee\Pricing\Adjustment</item> + <item name="sortOrder" xsi:type="string">10</item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml b/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml index fc482611fa393530e90d1de55c0badd1851e69d5..b6a7d87305125b0386cbbf3a5b6e8f38c7abf7a7 100644 --- a/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml +++ b/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml @@ -51,12 +51,17 @@ $data = ['fptAttribute' => [ </thead> <tfoot> <tr> - <td colspan="4"><?php echo $this->getAddButtonHtml(); ?></td> + <td colspan="4" class="col-actions-add"><?php echo $this->getAddButtonHtml(); ?></td> </tr> </tfoot> <tbody data-role="fpt-item-container" class="fpt-item-container"> </tbody> </table> + <!-- + Hidden field below with attribute code id is necessary for jQuery validation plugin. + Validation message will be displayed after this field. + --> + <input type="hidden" name="<?php echo $this->getElement()->getHtmlId(); ?>" id="<?php echo $this->getElement()->getHtmlId(); ?>" disabled="disabled"> </div> <script data-role="row-template" type="text/x-jquery-tmpl"> diff --git a/app/code/Magento/Weee/view/frontend/layout/catalog_product_prices.xml b/app/code/Magento/Weee/view/frontend/layout/catalog_product_prices.xml new file mode 100644 index 0000000000000000000000000000000000000000..51ab2f6f07df30ed61ef82d2a227999db66145d6 --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/layout/catalog_product_prices.xml @@ -0,0 +1,41 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="render.product.prices"> + <arguments> + <argument name="default" xsi:type="array"> + <item name="adjustments" xsi:type="array"> + <item name="default" xsi:type="array"> + <item name="weee" xsi:type="array"> + <item name="adjustment_render_class" xsi:type="string">Magento\Weee\Pricing\Render\Adjustment</item> + <item name="adjustment_render_template" xsi:type="string">Magento_Weee::pricing/adjustment.phtml</item> + </item> + </item> + </item> + </argument> + </arguments> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Weee/view/frontend/pricing/adjustment.phtml b/app/code/Magento/Weee/view/frontend/pricing/adjustment.phtml new file mode 100644 index 0000000000000000000000000000000000000000..1376a6a37f7ea1b1def12cfcb12f3824391627d7 --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/pricing/adjustment.phtml @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package base_default + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var \Magento\Weee\Pricing\Render\Adjustment $this */ + +$weeeSeparator = $openBrace = $closeBrace = ''; +//if ($this->getZone() !== \Magento\Pricing\Render::ZONE_ITEM_OPTION) { + $openBrace = '('; + $closeBrace = ')'; +//} +?> + +<?php if ($this->showInclDescr()): // incl. + weee ?> + <span class="weee"><?php echo $openBrace ?> + <?php foreach ($this->getWeeeTaxAttributes() as $weeeTaxAttribute): ?> + <?php echo $weeeSeparator; ?> + <?php echo $this->renderWeeeTaxAttribute($weeeTaxAttribute); ?> + <?php $weeeSeparator = ' + '; ?> + <?php endforeach; ?> + <?php echo $closeBrace ?></span> +<?php elseif ($this->showExclDescrIncl()): // excl. + weee + final ?> + <?php echo $openBrace ?> + <?php foreach ($this->getWeeeTaxAttributes() as $weeeTaxAttribute): ?> + <span class="weee"> + <?php echo $this->renderWeeeTaxAttribute($weeeTaxAttribute); ?> + </span> + <?php endforeach; ?> + <?php echo $closeBrace ?> +<?php endif; ?> diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php index 91faf20a0b9844cb3bb6682bc2be8b19e46d6e1d..5bebfcdb718cd4cd1c82d8f86de1fd29828163da 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php @@ -44,7 +44,7 @@ class DesignAbstraction extends \Magento\View\Element\Html\Select protected $_themesFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -52,14 +52,14 @@ class DesignAbstraction extends \Magento\View\Element\Html\Select * @param \Magento\View\Element\Context $context * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param array $data */ public function __construct( \Magento\View\Element\Context $context, \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, array $data = array() ) { $this->_layoutProcessorFactory = $layoutProcessorFactory; diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php index 5f832abb221997f4eab437e6576e4c994c43cd11..5df810afd0df5a82c662a7b4dc5d40ef733f7ed3 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php @@ -340,7 +340,7 @@ class Instance extends \Magento\Backend\App\Action public function blocksAction() { $this->_objectManager->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->emulateAreaCode( 'frontend', array($this, 'renderPageContainers') diff --git a/app/code/Magento/Widget/Helper/Data.php b/app/code/Magento/Widget/Helper/Data.php index 06b6c2847f35c67414cd667c95e4096fa9780ddf..bc0668f6cdb4dd1fa8ea97cf36d56849f32f83bc 100644 --- a/app/code/Magento/Widget/Helper/Data.php +++ b/app/code/Magento/Widget/Helper/Data.php @@ -33,6 +33,6 @@ */ namespace Magento\Widget\Helper; -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { } diff --git a/app/code/Magento/Widget/Model/Config/FileResolver.php b/app/code/Magento/Widget/Model/Config/FileResolver.php index 65406b204e4f57c372bbc3befc3569cf469ad6dc..538bde6bffbf2477d39c42b7759c64d741b455cf 100644 --- a/app/code/Magento/Widget/Model/Config/FileResolver.php +++ b/app/code/Magento/Widget/Model/Config/FileResolver.php @@ -50,17 +50,17 @@ class FileResolver implements \Magento\Config\FileResolverInterface protected $modulesDirectory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Module\Dir\Reader $moduleReader * @param \Magento\Config\FileIteratorFactory $iteratorFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Module\Dir\Reader $moduleReader, \Magento\Config\FileIteratorFactory $iteratorFactory ) { - $this->themesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::THEMES_DIR); - $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->themesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::THEMES_DIR); + $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->iteratorFactory = $iteratorFactory; $this->_moduleReader = $moduleReader; } diff --git a/app/code/Magento/Widget/Model/Template/Filter.php b/app/code/Magento/Widget/Model/Template/Filter.php index 7e94ad5f1f320b43790ed2dbcc93072232806c4d..aad0aa65e4740d99837ca76b32ca25088cace7d9 100644 --- a/app/code/Magento/Widget/Model/Template/Filter.php +++ b/app/code/Magento/Widget/Model/Template/Filter.php @@ -45,12 +45,12 @@ class Filter extends \Magento\Cms\Model\Template\Filter * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\View\Url $viewUrl - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Core\Model\VariableFactory $coreVariableFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\View\LayoutInterface $layout * @param \Magento\View\LayoutFactory $layoutFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Widget\Model\Resource\Widget $widgetResource * @param \Magento\Widget\Model\Widget $widget */ @@ -59,12 +59,12 @@ class Filter extends \Magento\Cms\Model\Template\Filter \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\View\Url $viewUrl, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Core\Model\VariableFactory $coreVariableFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\View\LayoutInterface $layout, \Magento\View\LayoutFactory $layoutFactory, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Widget\Model\Resource\Widget $widgetResource, \Magento\Widget\Model\Widget $widget ) { diff --git a/app/code/Magento/Widget/Model/Widget.php b/app/code/Magento/Widget/Model/Widget.php index 2b1070d744e8b5cb5e464e7a58336f86e6b4216d..70f83186c65160b34e83b493c9828fd4f08d0937 100644 --- a/app/code/Magento/Widget/Model/Widget.php +++ b/app/code/Magento/Widget/Model/Widget.php @@ -41,7 +41,7 @@ class Widget protected $_dataStorage; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_configCacheType; diff --git a/app/code/Magento/Widget/Model/Widget/Instance.php b/app/code/Magento/Widget/Model/Widget/Instance.php index 66090c5e3a5300b4002fad368c316d820a682289..8f38aabefa0ed621c985b50aabccbf7544ca5854 100644 --- a/app/code/Magento/Widget/Model/Widget/Instance.php +++ b/app/code/Magento/Widget/Model/Widget/Instance.php @@ -101,7 +101,7 @@ class Instance extends \Magento\Model\AbstractModel protected $_namespaceResolver; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -130,13 +130,13 @@ class Instance extends \Magento\Model\AbstractModel * @param \Magento\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList + * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\Widget\Model\Config\Reader $reader * @param \Magento\Widget\Model\Widget $widgetModel * @param \Magento\Widget\Model\NamespaceResolver $namespaceResolver * @param \Magento\Math\Random $mathRandom - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string[] $relatedCacheTypes @@ -147,13 +147,13 @@ class Instance extends \Magento\Model\AbstractModel \Magento\Registry $registry, \Magento\Escaper $escaper, \Magento\View\FileSystem $viewFileSystem, - \Magento\App\Cache\TypeListInterface $cacheTypeList, + \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\Catalog\Model\Product\Type $productType, \Magento\Widget\Model\Config\Reader $reader, \Magento\Widget\Model\Widget $widgetModel, \Magento\Widget\Model\NamespaceResolver $namespaceResolver, \Magento\Math\Random $mathRandom, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $relatedCacheTypes = array(), @@ -167,7 +167,7 @@ class Instance extends \Magento\Model\AbstractModel $this->_reader = $reader; $this->_widgetModel = $widgetModel; $this->mathRandom = $mathRandom; - $this->_directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->_directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_namespaceResolver = $namespaceResolver; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -216,7 +216,7 @@ class Instance extends \Magento\Model\AbstractModel if ($pageGroupData['page_id']) { $pageGroupIds[] = $pageGroupData['page_id']; } - if ($pageGroup['page_group'] == 'pages') { + if (in_array($pageGroup['page_group'], array('pages', 'page_layouts'))) { $layoutHandle = $pageGroupData['layout_handle']; } else { $layoutHandle = $this->_layoutHandles[$pageGroup['page_group']]; diff --git a/app/code/Magento/Widget/etc/adminhtml/routes.xml b/app/code/Magento/Widget/etc/adminhtml/routes.xml index 2e43d6f8616fd42910ad5d3d21a8815f7b619b02..61a4461d973026518e9ba4fc4b071c4f07a441e9 100644 --- a/app/code/Magento/Widget/etc/adminhtml/routes.xml +++ b/app/code/Magento/Widget/etc/adminhtml/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Widget" before="Magento_Adminhtml" /> diff --git a/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml index 42601a3fc1507f75d5528c3d328c793ce925764f..b40eded226a67cf545086e0eb477275f6d7a0df9 100644 --- a/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/instance/edit/layout.phtml @@ -226,7 +226,7 @@ var WidgetInstance = { additional.position = data.position; additional.for_value = data.for_value; additional.template = ''; - if (data.group == 'pages') { + if (data.group == 'pages' || data.group == 'page_layouts') { layoutSelect = pageGroup.down('select#layout_handle'); if (layoutSelect) { for (var i = 0; i < layoutSelect.options.length; i++) { diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml index 74a88f4e458d46ea0e91c2065d65dc0642cc4150..87d5ee2854b601990e26ddf39d0f1073d84653f4 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_block.xml @@ -45,21 +45,20 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="instance_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Widget ID</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">instance_id</argument> + <argument name="column_css_class" xsi:type="string">col-id</argument> + <argument name="header_css_class" xsi:type="string">col-id</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="title"> <arguments> <argument name="header" xsi:type="string" translate="true">Widget Instance</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">title</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="type"> <arguments> <argument name="header" xsi:type="string" translate="true">Type</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">instance_type</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Widget\Model\Resource\Widget\Instance\Options\Types"/> @@ -68,7 +67,6 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="theme_id"> <arguments> <argument name="header" xsi:type="string" translate="true">Design Theme</argument> - <argument name="align" xsi:type="string">left</argument> <argument name="index" xsi:type="string">theme_id</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Widget\Model\Resource\Widget\Instance\Options\ThemeId"/> @@ -78,9 +76,7 @@ <block class="Magento\Backend\Block\Widget\Grid\Column" as="sort_order"> <arguments> <argument name="header" xsi:type="string" translate="true">Sort Order</argument> - <argument name="align" xsi:type="string">center</argument> <argument name="index" xsi:type="string">sort_order</argument> - <argument name="width" xsi:type="string">100</argument> </arguments> </block> </block> diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php index 27e896736812bc1318610c87383c5138a38de5cc..8419df450a4cce179a86d96ec32324068b977ae9 100644 --- a/app/code/Magento/Wishlist/Block/AbstractBlock.php +++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php @@ -51,7 +51,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd protected $_wishlist; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -62,14 +62,14 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd /** * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param array $data * @param array $priceBlockTypes */ public function __construct( \Magento\Catalog\Block\Product\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\ProductFactory $productFactory, array $data = array(), array $priceBlockTypes = array() diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php index 6dbefdbb1dfdaab1d0c8c98a1d8bb0cd40f8d7ba..339f20f6dd86376cd000a3d1b057d6d239fe3e72 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php @@ -55,7 +55,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock /** * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool * @param \Magento\Data\Form\FormKey $formKey @@ -64,7 +64,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock */ public function __construct( \Magento\Catalog\Block\Product\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool, \Magento\Data\Form\FormKey $formKey, diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php index 9148bbf2ac9da96d1240a6ba9ed01188b1cf2624..c8da2ab2a3cb797c0639c7206281526a88bbc4ef 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php @@ -46,4 +46,14 @@ class Cart extends \Magento\Wishlist\Block\Customer\Wishlist\Item\Column $qty = $item->getQty(); return $qty ? $qty : 1; } + + /** + * Return product for current item + * + * @return \Magento\Catalog\Model\Product + */ + public function getProductItem() + { + return $this->getItem()->getProduct(); + } } diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php index 5a50c00c83932563771da6d77bca818b66f320f0..389cbd7ab22eaadfa0c37488aed43c69ca5e1400 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -54,7 +54,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock /** * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool * @param array $data @@ -62,7 +62,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock */ public function __construct( \Magento\Catalog\Block\Product\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool, array $data = array(), diff --git a/app/code/Magento/Wishlist/Block/Share/Wishlist.php b/app/code/Magento/Wishlist/Block/Share/Wishlist.php index 7f4329ddd501663cbbfb05b1b66aa631a2f0a2dd..04061a839460668c9a715824213fe5509afaa339 100644 --- a/app/code/Magento/Wishlist/Block/Share/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Share/Wishlist.php @@ -50,7 +50,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock /** * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\App\Http\Context $httpContext + * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService * @param array $data @@ -58,7 +58,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock */ public function __construct( \Magento\Catalog\Block\Product\Context $context, - \Magento\App\Http\Context $httpContext, + \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Customer\Service\V1\CustomerAccountServiceInterface $customerAccountService, array $data = array(), diff --git a/app/code/Magento/Wishlist/Controller/AbstractController.php b/app/code/Magento/Wishlist/Controller/AbstractController.php index d4ef7c3545cce552ddcc10f5b2f49733fdde0167..23ac62aaafbd7e7269982596e3391c22e49fa5a3 100644 --- a/app/code/Magento/Wishlist/Controller/AbstractController.php +++ b/app/code/Magento/Wishlist/Controller/AbstractController.php @@ -25,12 +25,12 @@ */ namespace Magento\Wishlist\Controller; -use Magento\App\Action\Context; +use Magento\Framework\App\Action\Context; /** * Wishlist Abstract Front Controller Action */ -abstract class AbstractController extends \Magento\App\Action\Action +abstract class AbstractController extends \Magento\Framework\App\Action\Action { /** * Filter to convert localized values to internal ones diff --git a/app/code/Magento/Wishlist/Controller/Index.php b/app/code/Magento/Wishlist/Controller/Index.php index 8ccb4be6a816b8c4c095673790a294735c4f1c1c..26f30fe7a6e3294f448c0f33403716d25d36b2fd 100644 --- a/app/code/Magento/Wishlist/Controller/Index.php +++ b/app/code/Magento/Wishlist/Controller/Index.php @@ -34,15 +34,15 @@ */ namespace Magento\Wishlist\Controller; -use Magento\App\Action\NotFoundException; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\Action\NotFoundException; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; class Index extends \Magento\Wishlist\Controller\AbstractController implements \Magento\Catalog\Controller\Product\View\ViewInterface { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_fileResponseFactory; @@ -81,23 +81,23 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements protected $_customerHelperView; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Registry $coreRegistry * @param \Magento\Wishlist\Model\Config $wishlistConfig - * @param \Magento\App\Response\Http\FileFactory $fileResponseFactory + * @param \Magento\Framework\App\Response\Http\FileFactory $fileResponseFactory * @param \Magento\Mail\Template\TransportBuilder $transportBuilder * @param \Magento\Translate\Inline\StateInterface $inlineTranslation * @param \Magento\Customer\Helper\View $customerHelperView */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, \Magento\Customer\Model\Session $customerSession, \Magento\Registry $coreRegistry, \Magento\Wishlist\Model\Config $wishlistConfig, - \Magento\App\Response\Http\FileFactory $fileResponseFactory, + \Magento\Framework\App\Response\Http\FileFactory $fileResponseFactory, \Magento\Mail\Template\TransportBuilder $transportBuilder, \Magento\Translate\Inline\StateInterface $inlineTranslation, \Magento\Customer\Helper\View $customerHelperView @@ -114,7 +114,7 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements /** * @param RequestInterface $request * @return ResponseInterface - * @throws \Magento\App\Action\NotFoundException + * @throws \Magento\Framework\App\Action\NotFoundException */ public function dispatch(RequestInterface $request) { @@ -132,7 +132,7 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements $customerSession->setBeforeWishlistRequest($request->getParams()); } if (!$this->_objectManager->get( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->isSetFlag( 'wishlist/general/active' ) @@ -776,7 +776,7 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements $sharingCode = $wishlist->getSharingCode(); try { - $scopeConfig = $this->_objectManager->get('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $storeManager = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface'); foreach ($emails as $email) { $transport = $this->_transportBuilder->setTemplateIdentifier( @@ -879,9 +879,9 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements try { $info = unserialize($option->getValue()); $filePath = $this->_objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ) . $info['quote_path']; $secretKey = $this->getRequest()->getParam('key'); @@ -889,7 +889,7 @@ class Index extends \Magento\Wishlist\Controller\AbstractController implements $this->_fileResponseFactory->create( $info['title'], array('value' => $filePath, 'type' => 'filename'), - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); } } catch (\Exception $e) { diff --git a/app/code/Magento/Wishlist/Controller/Shared.php b/app/code/Magento/Wishlist/Controller/Shared.php index ca38865099698cbc2687337b94af87f3be398d3e..467a91c2a8fa0dc6272d10111bd3038d85e53cdf 100644 --- a/app/code/Magento/Wishlist/Controller/Shared.php +++ b/app/code/Magento/Wishlist/Controller/Shared.php @@ -44,13 +44,13 @@ class Shared extends AbstractController protected $_coreRegistry = null; /** - * @param \Magento\App\Action\Context $context + * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Registry $coreRegistry */ public function __construct( - \Magento\App\Action\Context $context, + \Magento\Framework\App\Action\Context $context, \Magento\Core\App\Action\FormKeyValidator $formKeyValidator, \Magento\Customer\Model\Session $customerSession, \Magento\Registry $coreRegistry diff --git a/app/code/Magento/Wishlist/Helper/Data.php b/app/code/Magento/Wishlist/Helper/Data.php index 1fed400207a877ca927a8f3190e2a00527617d0c..c2876d925d2c8e4c2b2c2e33915bc6f66859fab1 100644 --- a/app/code/Magento/Wishlist/Helper/Data.php +++ b/app/code/Magento/Wishlist/Helper/Data.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +namespace Magento\Wishlist\Helper; /** * Wishlist Data Helper @@ -32,9 +32,7 @@ * @package Magento_Wishlist * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Wishlist\Helper; - -class Data extends \Magento\App\Helper\AbstractHelper +class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * Config key 'Display Wishlist Summary' @@ -91,7 +89,7 @@ class Data extends \Magento\App\Helper\AbstractHelper /** * Core store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -121,10 +119,10 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_customerViewHelper; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Registry $coreRegistry - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -132,10 +130,10 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Customer\Helper\View $customerViewHelper */ public function __construct( - \Magento\App\Helper\Context $context, + \Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Registry $coreRegistry, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, @@ -398,16 +396,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function getAddToCartUrl($item) { - $continueUrl = $this->_coreData->urlEncode( - $this->_getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true, '_scope_to_url' => true)) - ); - - $urlParamName = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; - $params = array( - 'item' => is_string($item) ? $item : $item->getWishlistItemId(), - $urlParamName => $continueUrl - ); - return $this->_getUrlStore($item)->getUrl('wishlist/index/cart', $params); + return $this->_getUrlStore($item)->getUrl('wishlist/index/cart', $this->_getCartUrlParameters($item)); } /** @@ -417,17 +406,24 @@ class Data extends \Magento\App\Helper\AbstractHelper * @return string */ public function getSharedAddToCartUrl($item) + { + return $this->_getUrlStore($item)->getUrl('wishlist/shared/cart', $this->_getCartUrlParameters($item)); + } + + /** + * @param string|\Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item + * @return array + */ + protected function _getCartUrlParameters($item) { $continueUrl = $this->_coreData->urlEncode( $this->_getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true, '_scope_to_url' => true)) ); - $urlParamName = \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED; - $params = array( + return array( 'item' => is_string($item) ? $item : $item->getWishlistItemId(), - $urlParamName => $continueUrl + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $continueUrl ); - return $this->_getUrlStore($item)->getUrl('wishlist/shared/cart', $params); } /** diff --git a/app/code/Magento/Wishlist/Model/Config.php b/app/code/Magento/Wishlist/Model/Config.php index fe617aebbf47b31aa06dd7e20de88d21d165881d..a1597943f248988773797ad47e61f70a4bcd1dd8 100644 --- a/app/code/Magento/Wishlist/Model/Config.php +++ b/app/code/Magento/Wishlist/Model/Config.php @@ -53,12 +53,12 @@ class Config private $_sharingEmailLimit; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Catalog\Model\Attribute\Config $attributeConfig ) { diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php index 19e7ee2c01bd40017eab5f21e7caba24de5a28a3..9a389aca9e8cba89d018a97bf6fbe7fd9feee297 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php @@ -127,7 +127,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio protected $_productVisibility; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_coreResource; @@ -152,7 +152,7 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio protected $_catalogAttrFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -167,13 +167,13 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Wishlist\Model\Config $wishlistConfig * @param \Magento\Catalog\Model\Product\Visibility $productVisibility - * @param \Magento\App\Resource $coreResource + * @param \Magento\Framework\App\Resource $coreResource * @param \Magento\Wishlist\Model\Resource\Item\Option\CollectionFactory $optionCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory * @param \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory * @param \Magento\Wishlist\Model\Resource\Item $resource - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Zend_Db_Adapter_Abstract $connection * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -189,13 +189,13 @@ class Collection extends \Magento\Model\Resource\Db\Collection\AbstractCollectio \Magento\Stdlib\DateTime\DateTime $date, \Magento\Wishlist\Model\Config $wishlistConfig, \Magento\Catalog\Model\Product\Visibility $productVisibility, - \Magento\App\Resource $coreResource, + \Magento\Framework\App\Resource $coreResource, \Magento\Wishlist\Model\Resource\Item\Option\CollectionFactory $optionCollectionFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory, \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory, \Magento\Wishlist\Model\Resource\Item $resource, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, $connection = null ) { $this->_inventoryData = $catalogInventoryData; diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php index 42abee23be3f352f05966288add45bc750bed281..c662547ed259e0f93d04c21d28fc9607ab5d31f0 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php @@ -49,13 +49,13 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection * @param \Magento\Stdlib\DateTime\DateTime $date * @param \Magento\Wishlist\Model\Config $wishlistConfig * @param \Magento\Catalog\Model\Product\Visibility $productVisibility - * @param \Magento\App\Resource $coreResource + * @param \Magento\Framework\App\Resource $coreResource * @param \Magento\Wishlist\Model\Resource\Item\Option\CollectionFactory $optionCollectionFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory * @param \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory * @param \Magento\Wishlist\Model\Resource\Item $resource - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Registry $registry * @param \Zend_Db_Adapter_Abstract $connection * @@ -72,13 +72,13 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection \Magento\Stdlib\DateTime\DateTime $date, \Magento\Wishlist\Model\Config $wishlistConfig, \Magento\Catalog\Model\Product\Visibility $productVisibility, - \Magento\App\Resource $coreResource, + \Magento\Framework\App\Resource $coreResource, \Magento\Wishlist\Model\Resource\Item\Option\CollectionFactory $optionCollectionFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory, \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory, \Magento\Wishlist\Model\Resource\Item $resource, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Registry $registry, $connection = null ) { diff --git a/app/code/Magento/Wishlist/etc/frontend/routes.xml b/app/code/Magento/Wishlist/etc/frontend/routes.xml index 7be958810f60a5d32779c237f441177072879a5d..a3e2deb348c692cb5df285dd3f58b73b4ea06a7a 100644 --- a/app/code/Magento/Wishlist/etc/frontend/routes.xml +++ b/app/code/Magento/Wishlist/etc/frontend/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="standard"> <route id="wishlist" frontName="wishlist"> <module name="Magento_Wishlist" /> diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml index d8a20c24c63e42dd669acf9e003330494418a3ff..c332e65801a75159c69b6dba274dd3b6b7aa453c 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml @@ -53,6 +53,8 @@ <argument name="id" xsi:type="string">product_name</argument> <argument name="index" xsi:type="string">product_name</argument> <argument name="renderer" xsi:type="string">Magento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Item</argument> + <argument name="column_css_class" xsi:type="string">col-name</argument> + <argument name="header_css_class" xsi:type="string">col-name</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="description"> @@ -68,7 +70,6 @@ <argument name="header" xsi:type="string" translate="true">Quantity</argument> <argument name="index" xsi:type="string">qty</argument> <argument name="type" xsi:type="string">number</argument> - <argument name="width" xsi:type="string">60px</argument> <argument name="id" xsi:type="string">qty</argument> </arguments> </block> @@ -77,7 +78,6 @@ <argument name="header" xsi:type="string" translate="true">Add Locale</argument> <argument name="index" xsi:type="string">store_id</argument> <argument name="type" xsi:type="string">store</argument> - <argument name="width" xsi:type="string">160px</argument> </arguments> </block> <block class="Magento\Backend\Block\Widget\Grid\Column" as="added_at"> diff --git a/app/code/Magento/Wishlist/view/frontend/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/js/add-to-wishlist.js index 8a8b20e7ee76c524d1878490e8181c7c94b8c575..76d71f60a5a9425cbf9fb3acd7d736ff0cab559a 100644 --- a/app/code/Magento/Wishlist/view/frontend/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/js/add-to-wishlist.js @@ -28,17 +28,20 @@ configurableInfo: '.super-attribute-select', groupedInfo: '#super-product-table input', downloadableInfo: '#downloadable-links-list input', - customOptionsInfo: '.product-custom-option' + customOptionsInfo: '.product-custom-option', + qtyInfo: '#qty' }, _create: function () { this._bind(); }, _bind: function() { var changeCustomOption = 'change ' + this.options.customOptionsInfo, + changeQty = 'change ' + this.options.qtyInfo, changeProductInfo = 'change ' + this.options[this.options.productType + 'Info'], events = {}; events[changeCustomOption] = '_updateWishlistData'; events[changeProductInfo] = '_updateWishlistData'; + events[changeQty] = '_updateWishlistData'; this._on(events); }, _updateWishlistData: function(event) { diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml index 450fd3d9f0b5b3a8073c831dbaa9cd6956ed7a58..736ea4b4bafed7a0953410c444a09d25562823f9 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_index.xml @@ -45,6 +45,13 @@ <argument name="title" translate="true" xsi:type="string">Add to Cart</argument> </arguments> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Options" name="customer.wishlist.item.options" cacheable="false"/> + <block class="Magento\Catalog\Pricing\Render" name="product.price.render.wishlist"> + <arguments> + <argument name="price_render" xsi:type="string">product.price.render.default</argument> + <argument name="price_type_code" xsi:type="string">final_price</argument> + <argument name="zone" xsi:type="string">item_list</argument> + </arguments> + </block> </block> <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Remove" name="customer.wishlist.item.remove" template="item/column/remove.phtml" cacheable="false"> <arguments> diff --git a/app/code/Magento/Wishlist/view/frontend/options_list.phtml b/app/code/Magento/Wishlist/view/frontend/options_list.phtml index 1818a1779f059188ecb4b0aa2b1422b4329e5d01..ceee15251bb98ae08655e09029b669c8a4b65a92 100644 --- a/app/code/Magento/Wishlist/view/frontend/options_list.phtml +++ b/app/code/Magento/Wishlist/view/frontend/options_list.phtml @@ -27,9 +27,10 @@ <?php $options = $this->getOptionList(); ?> <?php if ($options): ?> -<div class="truncated" data-mage-init='{"truncateOptions":[]}'> - <div class="truncated full value"> - <p><?php echo __('Options Details'); ?></p> +<div class="tooltip box"> + <span class="action details tooltip toggle"><?php echo __('View Details') ?></span> + <div class="tooltip content"> + <strong class="subtitle"><?php echo __('Options Details'); ?></strong> <dl> <?php foreach ($options as $option): ?> <dt class="label"><?php echo $this->escapeHtml($option['label']) ?></dt> @@ -43,6 +44,5 @@ <?php endforeach; ?> </dl> </div> - <a href="#" onclick="return false;" class="action details"><?php echo __('View Details') ?></a> </div> <?php endif ?> diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_Backend/css/source/module.less index df219953fb79bc7e5d3ef90c480d70989906c537..69a1c5a06fe9146a3ae8b16001663b0ef4288384 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/css/source/module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/css/source/module.less @@ -90,6 +90,9 @@ text-align: left; position: relative; z-index: 1; + &.active { + z-index: 999; + } } &-action { color: @primary7; @@ -266,36 +269,37 @@ vertical-align: top; width: 100%; background-color: #fff; - border: 1px solid #ccc; - border-radius: 3px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.mage-suggest:after { - position: absolute; - top: 3px; - right: 3px; - bottom: 0; - width: 22px; - text-align: center; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e01f'; // search icon - font-size: 18px; - color: #b2b2b2; -} - -.mage-suggest input[type="search"], -.mage-suggest input.search { - width: 100%; - border: none; - background: none; - padding-right: 30px; + border: 1px solid #ada89e; + border-radius: 2px; + &:after { + position: absolute; + top: 3px; + right: 3px; + bottom: 0; + width: 22px; + text-align: center; + font-family: 'MUI-Icons'; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + content: '\e01f'; // search icon + font-size: 18px; + color: #b2b2b2; + } + input[type="search"], + input.search { + width: 100%; + border: none; + background: none; + padding-right: 30px; + } + &.category-select { + input[type="search"], + input.search { + height: 26px; + } + } } .mage-suggest-dropdown { @@ -308,17 +312,46 @@ background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); z-index: 990; -} - -.mage-suggest-dropdown ul { - margin: 0; - padding: 0; - list-style: none; -} - -.mage-suggest-dropdown li { - border-bottom: 1px solid #e5e5e5; - padding: 0; + ul { + margin: 0; + padding: 0; + list-style: none; + } + li { + border-bottom: 1px solid #e5e5e5; + padding: 0; + a { + display: block; + &.ui-state-focus { + background: #f5f5f5; + } + } + } + li a, + .jstree li a:hover, + .jstree .jstree-hovered, + .jstree .jstree-clicked { + padding: 6px 12px 5px; + text-decoration: none; + color: #333; + } + .jstree { + li a:hover, + jstree-hovered, + .jstree-clicked { + border: none; + } + li { + border-bottom: 0; + a { + display: inline-block; + } + } + .mage-suggest-selected > a { + color: #000000; + background: #F1FFEB; + } + } } .field-category_ids .mage-suggest-dropdown, @@ -327,42 +360,6 @@ overflow: auto; } -.mage-suggest-dropdown li a { - display: block; -} - -.mage-suggest-dropdown li a, -.mage-suggest-dropdown .jstree li a:hover, -.mage-suggest-dropdown .jstree .jstree-hovered, -.mage-suggest-dropdown .jstree .jstree-clicked { - padding: 6px 12px 5px; - text-decoration: none; - color: #333; -} - -.mage-suggest-dropdown .jstree li a:hover, -.mage-suggest-dropdown .jstree .jstree-hovered, -.mage-suggest-dropdown .jstree .jstree-clicked { - border: none; -} - -.mage-suggest-dropdown li a.ui-state-focus { - background: #f5f5f5; -} - -.mage-suggest-dropdown .jstree li { - border-bottom: 0; -} - -.mage-suggest-dropdown .jstree li a { - display: inline-block; -} - -.mage-suggest-dropdown .jstree .mage-suggest-selected > a { - color: #000000; - background: #F1FFEB; -} - .mage-suggest-dropdown .jstree .mage-suggest-selected > a:hover, .mage-suggest-dropdown .jstree .mage-suggest-selected > .jstree-hovered, .mage-suggest-dropdown .jstree .mage-suggest-selected > .jstree-clicked, @@ -425,71 +422,67 @@ width: 221px; } -.suggest-expandable .mage-suggest { - border: none; -} - -.suggest-expandable .mage-suggest:after { - top: 6px; - right: 6px; -} - -.suggest-expandable .mage-suggest-inner .title { - margin: 0; - padding: 0 10px 4px; - text-transform: uppercase; - color: #a6a098; - font-size: 12px; - border-bottom: 1px solid #e5e5e5; -} - -.suggest-expandable .mage-suggest-inner > input[type="search"], -.suggest-expandable .mage-suggest-inner > input.search { - position: relative; - margin: 6px 5px 5px; - padding-right: 20px; - border: 1px solid #ccc; - width: 211px; - z-index: 1; -} - -.suggest-expandable .mage-suggest-inner > input.ui-autocomplete-loading, -.suggest-expandable .mage-suggest-inner > input.mage-suggest-state-loading { - background: #fff url(../mui/images/ajax-loader-small.gif) no-repeat 190px 50%; -} - -.suggest-expandable .mage-suggest { - border-radius: 3px 3px 0 0; -} - -.suggest-expandable .mage-suggest-dropdown { - margin-top: 0; - border-top: 0; - border-radius: 0 0 3px 3px; - max-height: 300px; - overflow: auto; - width: 100%; - float: left; -} - -.suggest-expandable .mage-suggest-dropdown ul { - margin: 0; - padding: 0; - list-style: none; +.suggest-expandable { + .mage-suggest { + border: none; + border-radius: 3px 3px 0 0; + &:after { + top: 6px; + right: 6px; + } + } + .mage-suggest-inner { + .title { + margin: 0; + padding: 0 10px 4px; + text-transform: uppercase; + color: #a6a098; + font-size: 12px; + border-bottom: 1px solid #e5e5e5; + } + > input[type="search"], + > input.search { + position: relative; + margin: 6px 5px 5px; + padding-right: 20px; + border: 1px solid #ada89e; + width: 211px; + z-index: 1; + } + > input.ui-autocomplete-loading, + > input.mage-suggest-state-loading { + background: #fff url("@{baseDir}mui/images/ajax-loader-small.gif") no-repeat 190px 50%; + } + } + .mage-suggest-dropdown { + margin-top: 0; + border-top: 0; + border-radius: 0 0 3px 3px; + max-height: 300px; + overflow: auto; + width: 100%; + float: left; + ul { + margin: 0; + padding: 0; + list-style: none; + } + } } -.suggest-expandable .action-show-all, -.suggest-expandable .action-show-all:hover, -.suggest-expandable .action-show-all:active, -.suggest-expandable .action-show-all:focus, -.suggest-expandable .action-show-all[disabled] { - border-top: 1px solid #e5e5e5; - display: block; - width: 100%; - padding: 8px 10px 10px; - text-align: left; - font: 12px/1.333 Arial, Verdana, sans-serif; - color: #676056; +.suggest-expandable .action-show-all { + &:hover, + &:active, + &:focus, + &[disabled] { + border-top: 1px solid #e5e5e5; + display: block; + width: 100%; + padding: 8px 10px 10px; + text-align: left; + font: 12px/1.333 Arial, Verdana, sans-serif; + color: #676056; + } } .product-actions .suggest-expandable { diff --git a/app/design/adminhtml/Magento/backend/Magento_Catalog/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_Catalog/css/source/module.less new file mode 100644 index 0000000000000000000000000000000000000000..f107b302f13c388cee49c6d30efc27607dd51c3e --- /dev/null +++ b/app/design/adminhtml/Magento/backend/Magento_Catalog/css/source/module.less @@ -0,0 +1,38 @@ +// /** +// // * Magento +// * +// * NOTICE OF LICENSE +// * +// * This source file is subject to the Academic Free License (AFL 3.0) +// * that is bundled with this package in the file LICENSE_AFL.txt. +// * It is also available through the world-wide-web at this URL: +// * http://opensource.org/licenses/afl-3.0.php +// * If you did not receive a copy of the license and are unable to +// * obtain it through the world-wide-web, please send an email +// * to license@magentocommerce.com so we can send you a copy immediately. +// * +// * DISCLAIMER +// * +// * Do not edit or add to this file if you wish to upgrade Magento to newer +// * versions in the future. If you wish to customize Magento for your +// * needs please refer to http://www.magentocommerce.com for more information. +// * +// * @category design +// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) +// * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +// */ + +.catalog-category-edit { + .col-2-left-layout:before { + display: none; + } +} +.category-content { + .ui-tabs-panel .fieldset { + padding-top: 40px; + .legend { + display: none; + } + } +} + diff --git a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/css/source/module.less index fa7c75866c99b80168216cfd02ffd1a3ed12bf82..22def56b7b7aa3bc2c09a5a42bcd5d08846e913b 100644 --- a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/css/source/module.less +++ b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/css/source/module.less @@ -35,10 +35,10 @@ ); .action.toggle { - padding: 0 8px; - border: 1px solid #ccc; + padding: 1px 8px; + border: 1px solid #ada89e; background: #fff; - border-radius: 0 4px 4px 0; + border-radius: 0 2px 2px 0; &:after { width: 14px; @@ -62,6 +62,8 @@ .dropdown-split( @_dropdown-split-list-pointer: false ); + display: block; + width: 50px; .action.toggle { padding: 0 2px; diff --git a/app/design/adminhtml/Magento/backend/Magento_Theme/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_Theme/css/source/module.less index d61868bc56c39c96f3f6e974d72dffa41d131ea4..fcc6ba94394335bafdfcf019348376be7b70f061 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Theme/css/source/module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Theme/css/source/module.less @@ -164,12 +164,320 @@ body { } } +// +// Page main actions +//-------------------------------------- +.page-main-actions { + .clearfix(); + background: #e0dace; + color: @page-main-action-color; + padding: 15px; + margin-left: auto; + margin-right: auto; + .box-sizing(); + .page-actions { + float: right; + .page-actions-buttons { + float: right; + display: flex; + justify-content: flex-end; + } + button { + margin-left: 13px; + //flex-shrink: 0; + &.primary { + // &:not(:last-child) { + // float: right; + // } + float: right; + order: 2; + } + &.save:not(.primary) { + // &:not(:last-child) { + // float: right; + // } + float: right; + order: 1; + } + &.back, + &.action-back, + &.delete { + .button-reset(); + margin: 0 13px; + .ie & { + margin-top: 6px; + } + } + &.delete { + color: #e22626; + float: left; + order: -1; + } + &.back, + &.action-back { + float: left; + order: -1; + .icon-font( + @_icon-font-content: @icon-arrow-left-thin, + @_icon-font-line-height: normal, + @_icon-font-margin: 0 2px 0 0 + ); + } + } + .actions-split { + margin-left: 13px; + // &:not(:last-child) { + // float: right; + // } + float: right; + order: 2; + button { + &.primary { + float: left; + } + } + .dropdown-menu { + text-align: left; + } + } + // Fixed page actions + &.fixed { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 998; + padding: 0; + background: -moz-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(245, 242, 237, 1)), color-stop(56%, rgba(245, 242, 237, 1)), color-stop(100%, rgba(245, 242, 237, 0))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* W3C */ + background: #e0dace; + .page-actions-inner { + position: relative; + padding-top: 15px; + padding-bottom: 15px; + min-height: 36px; + text-align: right; + .clearfix(); + .box-sizing(); + &:before { + text-align: left; + content: attr(data-title); + float: left; + font-size: 20px; + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .lt-ie10 & { + background: #f5f2ed; + } + } + } + } + .store-switcher { + margin-top: 5px; + } +} + +// +// Store switcher +//------------------------------------- + +.store-switcher { + display: inline-block; + font-size: 13px; + .label { + margin-right: 5px; + } + .actions.dropdown { + .dropdown( + @_options-selector : ~".dropdown-menu", + @_dropdown-list-border: 1px #ada89e solid, + @_dropdown-list-pointer: false, + @_icon-font-line-height: 20px, + @_icon-font-color: @page-main-action-color, + @_icon-font-color-hover: @page-main-action-color, + @_icon-font-color-active: @page-main-action-color, + @_dropdown-list-item-hover: transparent, + @_dropdown-list-item-padding: 0 + ); + .action.toggle { + .button-reset(); + color: @color-link; + line-height: normal; + vertical-align: middle; + } + ul.dropdown-menu { + margin-top: 4px; + padding-top: 5px; + left: 0; + min-width: 195px; + li { + border: 0; + cursor: default; + &:hover { + cursor: default; + } + a, + span { + padding: 5px 13px; + display: block; + color: @page-main-action-color; + } + a { + text-decoration: none; + &:hover { + background: #edf9fb; + } + } + span { + color: #ababab; + cursor: default; + } + &.current { + span { + color: @page-main-action-color; + background: #eee; + } + } + } + .store-switcher-store { + a, + span { + padding-left: 26px; + } + } + .store-switcher-store-view { + a, + span { + padding-left: 39px; + } + } + .dropdown-toolbar { + border-top: 1px #ededed solid; + margin-top: 10px; + a { + .icon-font( + @_icon-font-content: @icon-settings, + @_icon-font-size: 20px, + @_icon-font-line-height: normal, + @_icon-font-vertical-align: text-top, + @_icon-font-margin: 0 3px 0 -4px + ); + display: block; + } + } + } + } +} + +// +// Tooltip +//------------------------------------- +.tooltip { + display: inline-block; + margin-left: 5px; + .help span, + .help a { + width: 16px; + height: 16px; + text-align: center; + background: rgba(194,186,169,.5); + cursor: pointer; + &:hover { + background: rgba(194,186,169,1); + } + border-radius: 10px; + vertical-align: middle; + .icon-font( + @_icon-font: @font-family-base, + @_icon-font-content: '?', + @_icon-font-size: 13px, + @_icon-font-line-height: 16px, + @_icon-font-color: #5a534a, + @_icon-font-text-hide: true, + @_icon-font-vertical-align: top + ); + &:before { + font-weight: 700; + } + } + //TODO Tooltips + .tooltip-content { + display: none; + position: absolute; + max-width: 200px; + margin-top: 10px; + margin-left: -19px; + padding: 4px 8px; + border-radius: 3px; + background: #000; + background: rgba(49, 48, 43, .8); + color: #fff; + text-shadow: none; + z-index: 20; + &:before { + content: ''; + position: absolute; + width: 0; + height: 0; + top: -5px; + left: 20px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000; + opacity: .8; + } + &.loading { + position: absolute; + &:before { + border-bottom-color: rgba(0, 0, 0, .3); + } + } + } + &:hover > .tooltip-content { + display: block; + } +} + +// +// Buttons +//-------------------------------------- +button { + border-radius: 2px; + .button(); + &.primary { + .button-primary(); + } +} + +.actions-split { + button { + margin-left: 0!important; + } + .dropdown-split( + @_toggle-selector: ~".action-toggle", + @_button-selector: ~".action-default", + @_options-selector : ~".dropdown-menu", + @_dropdown-split-button-border-radius-fix: true + ); + vertical-align: middle; +} + .page-content { &:extend(._layout-width all); - margin-bottom:20px; .clearer(); } +.page-wrapper > .page-content { + margin-bottom: 20px; +} + .page-footer { &-wrapper { background-color: @color-light; @@ -177,7 +485,9 @@ body { } padding: 15px 0; &:extend(._layout-width all); + .clearer(); } + .footer-legal { float:right; width: 550px; @@ -216,7 +526,6 @@ body { } .page-content { margin-bottom: 90px; - } .page-footer-wrapper { position: absolute; @@ -224,4 +533,3 @@ body { width: 100%; } } - diff --git a/app/design/adminhtml/Magento/backend/css/admin.css b/app/design/adminhtml/Magento/backend/css/admin.css deleted file mode 100644 index 197a1281b2280c406708eea34d61d5b68897ecda..0000000000000000000000000000000000000000 --- a/app/design/adminhtml/Magento/backend/css/admin.css +++ /dev/null @@ -1,4119 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -@font-face { - font-family: 'admin-icons'; - src: url('../fonts/icons/admin-icons.eot'); - src: url('../fonts/icons/admin-icons.eot?#iefix') format('embedded-opentype'), url('../fonts/icons/admin-icons.svg#admin-icons') format('svg'), url('../fonts/icons/admin-icons.woff') format('woff'), url('../fonts/icons/admin-icons.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'MUI-Icons'; - src: url('../mui/fonts/MUI-Icons.eot'); - src: url('../mui/fonts/MUI-Icons.eot?#iefix') format('embedded-opentype'), url('../mui/fonts/MUI-Icons.svg#MUI-Icons') format('svg'), url('../mui/fonts/MUI-Icons.woff') format('woff'), url('../mui/fonts/MUI-Icons.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} -/* @import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600,700 <http://fonts.googleapis.com/css?family=Open+Sans:400italic%2c400%2c600%2c700>); */ -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url(//themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 600; - src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(//themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNSnhCUOGz7vYGh680lGh-uXM.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 700; - src: local('Open Sans Bold'), local('OpenSans-Bold'), url(//themes.googleusercontent.com/static/fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: italic; - font-weight: 400; - src: local('Open Sans Italic'), local('OpenSans-Italic'), url(//themes.googleusercontent.com/static/fonts/opensans/v6/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff) format('woff'); -} -h1 { - color: #676056; - font: 400 28px/1.2 'Open Sans', sans-serif; -} -h2 { - color: #676056; - font: 400 20px/1.2 'Open Sans', sans-serif; -} -h3 { - color: #676056; - font: 600 16px/1.2 'Open Sans', sans-serif; -} -h4 { - color: #676056; - font: 600 14px/1.2 'Open Sans', sans-serif; -} -h5 { - color: #676056; - font: 600 13px/1.2 'Open Sans', sans-serif; -} -h6 { - color: #676056; - font: 600 12px/1.2 'Open Sans', sans-serif; -} -a { - display: inline; - color: #026294; - text-decoration: none; -} -a:visited, -a:active { - color: #026294; -} -a:focus, -a:hover { - color: #026294; - text-decoration: underline; -} -body, -html { - height: 100%; - min-height: 100%; -} -body { - background: #f2ebde; -} -.DefaultButton, -.PrimaryButton, -.PrimarySplitButton > .action-toggle.primary { - font: 14px/19px 'Open Sans', sans-serif; - font-weight: 500; - background: #f2ebde; - border: 1px solid #ada89e; - color: #676056; - display: inline-block; - padding: 5px 14px; - text-align: center; - text-decoration: none; - vertical-align: top; - cursor: pointer; - border-radius: 2px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.DefaultButton:hover, -.DefaultButton:focus, -.DefaultButton:active, -.PrimaryButton:hover, -.PrimaryButton:focus, -.PrimaryButton:active, -.PrimarySplitButton > .action-toggle.primary:hover, -.PrimarySplitButton > .action-toggle.primary:focus, -.PrimarySplitButton > .action-toggle.primary:active { - text-decoration: none; - background: #cac3b4; - color: #676056; -} -.DefaultButton:active, -.PrimaryButton:active, -.PrimarySplitButton > .action-toggle.primary:active { - border: 1px solid #989287; -} -.DefaultButton:visited, -.PrimaryButton:visited, -.PrimarySplitButton > .action-toggle.primary:visited { - color: #676056; -} -.DefaultButton[disabled], -.DefaultButton.disabled, -.PrimaryButton[disabled], -.PrimaryButton.disabled, -.PrimarySplitButton > .action-toggle.primary[disabled], -.PrimarySplitButton > .action-toggle.primary.disabled { - cursor: not-allowed; - opacity: 0.5; - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); -} -.DefaultButton[disabled]:hover, -.DefaultButton.disabled:hover, -.DefaultButton[disabled]:active, -.DefaultButton.disabled:active, -.PrimaryButton[disabled]:hover, -.PrimaryButton.disabled:hover, -.PrimaryButton[disabled]:active, -.PrimaryButton.disabled:active, -.PrimarySplitButton > .action-toggle.primary[disabled]:hover, -.PrimarySplitButton > .action-toggle.primary.disabled:hover, -.PrimarySplitButton > .action-toggle.primary[disabled]:active, -.PrimarySplitButton > .action-toggle.primary.disabled:active { - color: #676056; - background: #f2ebde; - border: 1px solid #ada89e; -} -.PrimaryButton, -.PrimarySplitButton > .action-toggle.primary { - color: #fff; - background: #007dbd; - border: 1px solid #0574ad; -} -.PrimaryButton:focus, -.PrimaryButton:hover, -.PrimarySplitButton > .action-toggle.primary:focus, -.PrimarySplitButton > .action-toggle.primary:hover { - color: #fff; - background: #026294; - border: 1px solid #026294; -} -.PrimaryButton:active, -.PrimarySplitButton > .action-toggle.primary:active { - color: #fff; - background: #026294; - border: 1px solid #004c74; -} -.PrimaryButton:visited, -.PrimarySplitButton > .action-toggle.primary:visited { - color: #fff; -} -.PrimaryButton[disabled]:hover, -.PrimaryButton.disabled:hover, -.PrimaryButton[disabled]:active, -.PrimaryButton.disabled:active, -.PrimarySplitButton > .action-toggle.primary[disabled]:hover, -.PrimarySplitButton > .action-toggle.primary.disabled:hover, -.PrimarySplitButton > .action-toggle.primary[disabled]:active, -.PrimarySplitButton > .action-toggle.primary.disabled:active { - color: #fff; - background: #007dbd; - border: 1px solid #0574ad; -} -.PrimarySplitButton.btn-round .action-default.primary { - border-radius: 2px 0 0 2px; -} -.PrimarySplitButton.btn-round .action-default.primary:focus { - outline: none; -} -.PrimarySplitButton > .action-default.primary { - border-radius: 2px 0 0 2px; -} -.PrimarySplitButton > .action-default.primary:focus { - outline: none; -} -.PrimarySplitButton > .action-toggle.primary { - overflow: hidden; - z-index: 1; - padding: 0; - border-radius: 0 2px 2px 0; - font-size: 15px; - width: 30px; - height: 31px; - line-height: 30px; - margin-left: -1px; - position: relative; - z-index: 2; - filter: none; -} -.PrimarySplitButton > .action-toggle.primary:focus { - outline: none; -} -.PrimarySplitButton > .action-toggle.primary:before { - text-align: center; -} -.PrimarySplitButton .dropdown-menu { - left: 0; - right: auto; - z-index: 1; -} -.PrimarySplitButton .dropdown-menu > li > .item { - padding: 9px 10px 10px; -} -.PrimarySplitButton.active > .action-toggle.primary, -.PrimarySplitButton.active > .action-toggle.primary:hover { - background: #026294; - border: 1px solid #004c74; -} -.dont-use-this-class-big-size { - font-size: 18px; - line-height: 24px; - padding: 8px 19px; -} -/* - Reset 'button view' for actions --------------------------------------- */ -.customer-current-activity .action-refresh, -.pager .action-next, -.pager .action-previous, -.pager .action-next:hover, -.pager .action-previous:hover, -.pager .action-next.disabled:focus, -.pager .action-previous.disabled:focus, -.pager .action-next.disabled:active, -.pager .action-previous.disabled:active, -.data-table .action-.delete, -.data-table .action-.delete:hover, -.data-table .action-.delete:active, -.data-table .action-.delete.active, -.data-table .action-delete, -.data-table .action-delete:hover, -.data-table .action-delete:active, -.data-table .action-delete.active, -.data-table .action-locked, -.data-table .action-locked:hover, -.data-table .action-locked:active, -.data-table .action-locked.active, -.data-table .action-locked[disabled], -#product-variations-matrix .action-choose, -#product-variations-matrix .action-choose:hover, -#product-variations-matrix .action-choose:active, -#product-variations-matrix .action-choose.active, -#product-variations-matrix .action-choose[disabled], -.action-manage-images, -.action-manage-images:hover, -.action-manage-images:active, -.action-manage-images.active, -.action-manage-images[disabled], -.image-panel .action-close, -.image-panel .action-close:hover, -.image-panel .action-close:active, -.image-panel .action-close.active, -.image-panel .action-close[disabled], -.image-panel-controls .action-remove, -.image-panel-controls .action-remove:hover, -.image-panel-controls .action-remove:active, -.image-panel-controls .action-remove.active, -.image-panel-controls .action-remove[disabled], -.vde-image-sizing .action-connect, -.vde-image-sizing .action-connect:hover, -.vde-image-sizing .action-connect:active, -.vde-image-sizing .action-connect.active, -.vde-image-sizing .action-connect[disabled], -.suggest-expandable .action-show-all, -.suggest-expandable .action-show-all:hover, -.suggest-expandable .action-show-all:active, -.suggest-expandable .action-show-all.active, -.suggest-expandable .action-show-all[disabled], -.custom-file > .action-add, -.custom-file > .action-add:hover, -.custom-file > .action-add:active, -.custom-file > .action-add.active, -.custom-file > .action-add[disabled], -.vde-tools-header .action-close, -.vde-tools-header .action-close:hover, -.vde-tools-header .action-close:active, -.vde-tools-header .action-close.active, -.image .action-delete, -.image .action-delete:hover, -.image .action-delete:active, -.image .action-delete.active, -.fieldset-wrapper-title .actions .action-delete, -.fieldset-wrapper-title .actions .action-delete:hover, -.fieldset-wrapper-title .actions .action-delete:active, -.fieldset-wrapper-title .actions .action-delete.active, -.address-list-item-actions .action-delete, -.address-list-item-actions .action-delete:hover, -.address-list-item-actions .action-delete:active, -.address-list-item-actions .action-delete.active, -.notification .action-close, -.notification .action-close:hover, -.notification .action-close:active, -.notification .action-close.active, -.page-login .action-forgotpassword, -.page-login .action-forgotpassword:hover, -.page-login .action-forgotpassword:active, -.page-login .action-forgotpassword.active, -.page-login .action-back, -.page-login .action-back:hover, -.page-login .action-back:active, -.page-login .action-back.active, -.attribute-popup .page-actions #reset, -.attribute-popup .page-actions #reset:hover, -.attribute-popup .page-actions #reset:active, -.attribute-popup .page-actions #reset.active, -.attribute-popup .page-actions #reset[disabled] { - border: none; - border-radius: 0; - background: none; - margin: 0; - padding: 0; - box-shadow: none; - text-shadow: none; - filter: none; -} -.attribute-popup .messages { - margin: 0 15px; -} -.data-table .action-.delete[disabled], -.data-table .action-delete[disabled], -.data-table .action-locked[disabled], -#product-variations-matrix .action-choose[disabled], -.image-panel .action-close[disabled], -.image-panel-controls .action-remove[disabled], -.suggest-expandable .action-show-all[disabled], -#store-view-window [class^='action-close'], -#store-view-window [class^='action-close']:hover, -#store-view-window [class^='action-close']:active, -#store-view-window [class^='action-close'].active, -#store-view-window [class^='action-close'][disabled], -.custom-file > .action-add[disabled], -.image .action-delete, -.image .action-delete:hover, -.image .action-delete:active, -.image .action-delete.active, -.fieldset-wrapper-title .actions .action-delete, -.fieldset-wrapper-title .actions .action-delete:hover, -.fieldset-wrapper-title .actions .action-delete:active, -.fieldset-wrapper-title .actions .action-delete.active, -.address-list-item-actions .action-delete, -.address-list-item-actions .action-delete:hover, -.address-list-item-actions .action-delete:active, -.address-list-item-actions .action-delete.active, -.notification .action-close, -.notification .action-close:hover, -.notification .action-close:active, -.notification .action-close.active { - border: none; - border-radius: 0; - background: none; - margin: 0; - padding: 0; - box-shadow: none; - text-shadow: none; - filter: none; -} -.fade.critical-notification { - display: block; -} -.fade.critical-notification .popup { - top: 200px; -} -.data-table .action-.delete[disabled], -.data-table .action-delete[disabled], -.data-table .action-locked[disabled], -#product-variations-matrix .action-choose[disabled], -.image-panel .action-close[disabled], -.image-panel-controls .action-remove[disabled], -.suggest-expandable .action-show-all[disabled], -#store-view-window [class^='action-close'], -#store-view-window [class^='action-close']:hover, -#store-view-window [class^='action-close']:active, -#store-view-window [class^='action-close'].active, -#store-view-window [class^='action-close'][disabled], -.custom-file > .action-add[disabled], -.vde-tools-header .action-close[disabled], -.vde-image-sizing .action-reset, -.vde-image-sizing .action-reset:hover, -.vde-image-sizing .action-reset:active, -.vde-image-sizing .action-reset.active, -.vde-image-sizing .action-reset[disabled], -.image .action-delete[disabled], -.fieldset-wrapper-title .actions .action-delete[disabled], -.address-list-item-actions .action-delete[disabled], -.notifications [class^="action-"], -.notifications [class^="action-"]:hover, -.notifications [class^="action-"]:active, -.notifications [class^="action-"].active, -.notifications [class^="action-"][disabled], -.notification .action-close, -.notification .action-close:hover, -.notification .action-close:active, -.notification .action-close.active, -.notification .action-close[disabled] { - border: 0; - border-radius: 0; - background: none; - margin: 0; - padding: 0; - box-shadow: none; - text-shadow: none; - filter: none; -} -.vde-image-sizing .action-connect, -.vde-image-sizing .action-connect:hover, -.vde-image-sizing .action-connect:active, -.vde-image-sizing .action-connect.active, -.vde-image-sizing .action-connect[disabled], -.vde-tab-data .action-download, -.vde-tab-data .action-download:hover, -.vde-tab-data .action-download:active, -.vde-tab-data .action-download.active, -.vde-tab-data .action-download[disabled], -.vde-tab-data .action-delete, -.vde-tab-data .action-delete:hover, -.vde-tab-data .action-delete:active, -.vde-tab-data .action-delete.active, -.vde-tab-data .action-delete[disabled], -.vde-tab-data .action-edit, -.vde-tab-data .action-edit:hover, -.vde-tab-data .action-edit:active, -.vde-tab-data .action-edit.active, -.vde-tab-data .action-edit[disabled] { - border: none; - border-radius: 0; - background: none; - margin: 0; - padding: 0; - box-shadow: none; - text-shadow: none; -} -/* - Actions as links --------------------------------------- */ -.notification-entry-dialog .action-cancel, -.attribute-popup .page-actions #reset { - background: none; - border: none; - color: #6d665e; - font-weight: normal; - font-size: 12px; - cursor: pointer; - text-decoration: underline; -} -.notification-entry-dialog .action-cancel:hover, -.attribute-popup .page-actions #reset:hover { - color: #000; - border-bottom-color: #000; - filter: none; -} -/* - Fileupload button --------------------------------------- */ -.action-upload { - position: relative; -} -.action-upload > input[type="file"] { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - opacity: 0; - font-size: 10em; -} -/* - Dropdown menu --------------------------------------- */ -.dropdown-menu, -.ui-autocomplete { - position: absolute; - display: none; - list-style: none; - min-width: 100px; - margin: 1px 0 0 0; - padding: 0; - right: 0; - top: 100%; - border: 1px solid #cac2b5; - background: #fff; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - z-index: 990; -} -.dropdown-menu > li, -.ui-autocomplete > li { - padding: 5px; - border-bottom: 1px solid #e5e5e5; -} -.dropdown-menu > li.selected, -.ui-autocomplete > li.selected { - background: #eef8fc; -} -.dropdown-menu > li:hover, -.ui-autocomplete > li:hover { - background: #eef8fc; -} -.dropdown-menu > li:last-child, -.ui-autocomplete > li:last-child { - border-bottom: none; -} -.dropdown-menu > li > .item, -.ui-autocomplete > li > .item { - cursor: pointer; -} -.dropdown-menu-top { - margin: 0 0 3px 0; - top: auto; - bottom: 100%; -} -.ui-autocomplete { - right: auto; -} -.ui-autocomplete > li { - padding: 0; -} -.ui-autocomplete > li > a { - display: block; - padding: 5px; -} -.ui-autocomplete > li > a.level-0 { - padding-left: 5px !important; -} -.ui-autocomplete .ui-state-focus { - background: #f5f5f5; -} -.active .dropdown-menu { - display: block; -} -/* - Actions Dropdown --------------------------------------- */ -.action-dropdown { - text-align: left; - position: relative; - display: inline-block; -} -.action-dropdown > [class^='action-'] { - float: left; - border-radius: 0; -} -.action-dropdown > .action-default { - border-radius: 5px 0 0 5px; -} -.action-dropdown > .action-toggle { - border-left: 1px solid #c5c0b9; - border-radius: 0 5px 5px 0; - margin-left: -1px; - padding: 4px 7px; -} -.action-dropdown > .action-toggle > span { - display: none; -} -.action-dropdown > .action-toggle:before { - display: block; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02c'; - /* arrow down */ - font-size: 11px; -} -.action-dropdown > .action-toggle.active:before { - content: '\e029'; - /* arrow up */ -} -.action-dropdown > .action-toggle.primary { - border-left: 1px solid #e1721d; -} -.action-dropdown > .action-toggle.primary:hover { - background: #e2701a; - margin-left: -1px; -} -.action-dropdown.active .dropdown-menu { - display: block; - white-space: nowrap; -} -.action-dropdown.active .dropdown-menu > li { - padding: 0; -} -.action-dropdown .dropdown-menu > li > .item { - display: block; - padding: 6px 10px 5px; - color: #333; - text-decoration: none; -} -/* - Action delete icon --------------------------------------- */ -/* TODO: replase ".action-.delete" to ".action-delete" after buttons refactoring */ -.data-table .action-.delete span, -.data-table .action-delete span, -.data-table .action-locked span, -.image .action-delete span, -.fieldset-wrapper-title .actions .action-delete span, -.address-list-item-actions .action-delete span { - display: none; -} -.data-table .action-.delete:before, -.data-table .action-delete:before, -.image .action-delete:before, -.fieldset-wrapper-title .actions .action-delete:before, -.address-list-item-actions .action-delete:before { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - font-size: 18px; - -webkit-font-smoothing: antialiased; - content: '\e07f'; - /* delete icon */ - color: #b7b3ad; -} -/* - Locked action icon --------------------------------------- */ -.data-table .action-locked:before { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - font-size: 20px; - -webkit-font-smoothing: antialiased; - content: '\e03e'; - /* lock icon */ - color: #b7b3ad; -} -.data-table .action-.delete:hover:before, -.data-table .action-delete:hover:before, -.data-table .action-locked:hover:before, -.image .action-delete:hover:before, -.fieldset-wrapper-title .actions .action-delete:hover:before, -.address-list-item-actions .action-delete:hover:before { - color: #7e7e7e; -} -.data-table input.action-.delete[type="button"], -.data-table input.action-.delete[type="submit"], -.data-table input.action-.delete[type="reset"], -.data-table button.action-.delete, -.data-table input.action-.delete[type="button"]:visited, -.data-table input.action-.delete[type="submit"]:visited, -.data-table input.action-.delete[type="reset"]:visited, -.data-table button.action-.delete:visited, -.data-table input.action-.delete[type="button"]:hover, -.data-table input.action-.delete[type="submit"]:hover, -.data-table input.action-.delete[type="reset"]:hover, -.data-table button.action-.delete:hover, -.data-table input.action-.delete[type="button"]:active, -.data-table input.action-.delete[type="submit"]:active, -.data-table input.action-.delete[type="reset"]:active, -.data-table button.action-.delete:active { - background: transparent; - padding: 3px 7px 0; -} -.data-table input.action-.delete[type=button]:hover:before, -.data-table input.action-.delete[type=submit]:hover:before, -.data-table input.action-.delete[type=reset]:hover:before, -.data-table button.action-.delete:hover:before, -.data-table input.action-.delete[type=button]:focus:before, -.data-table input.action-.delete[type=submit]:focus:before, -.data-table input.action-.delete[type=reset]:focus:before, -.data-table button.action-.delete:focus:before { - background: transparent; - color: #a5a29d; -} -/* - Forms --------------------------------------- */ -fieldset { - border: 1px solid #ccc; - padding: 20px; -} -legend { - padding: 0 10px; - margin: 0 -10px; -} -fieldset legend + br { - display: none; -} -label { - display: inline-block; -} -label > input[type="radio"], -label > input[type="checkbox"] { - margin: -3px 3px 0 0; - vertical-align: middle; -} -input[type=text], -input[type=password], -input[type=datetime], -input[type=datetime-local], -input[type=date], -input[type=month], -input[type=time], -input[type=week], -input[type=number], -input[type=range], -input[type=email], -input[type=url], -input[type=search], -input.search, -input[type=tel], -input[type=color], -textarea, -.input-text { - display: inline-block; - padding: 4px; - margin: 0; - background-color: #fff; - height: 28px; - color: #676056; - font-size: 14px; - font-weight: 400; - border: 1px solid #ccc; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - border-radius: 4px; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -} -textarea, -.input-text { - height: auto; -} -textarea { - resize: vertical; -} -select { - height: 28px; - padding: 4px 4px 5px; - margin: 0 0 8px; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} -select[multiple], -select[size] { - height: auto; -} -input[type=text]:focus, -input[type=password]:focus, -input[type=datetime]:focus, -input[type=datetime-local]:focus, -input[type=date]:focus, -input[type=month]:focus, -input[type=time]:focus, -input[type=week]:focus, -input[type=number]:focus, -input[type=range]:focus, -input[type=email]:focus, -input[type=url]:focus, -input[type=search]:focus, -input.search:focus, -input[type=tel]:focus, -input[type=color]:focus, -textarea:focus, -select:focus { - outline: 0; - border-color: #75b9f0; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); -} -input[type="radio"], -input[type="checkbox"] { - margin: 3px 0; - line-height: normal; -} -input[disabled], -select[disabled], -textarea[disabled], -input[readonly], -select[readonly], -textarea[readonly] { - cursor: not-allowed; - background-color: #fff; - border-color: #eee; - box-shadow: none; - color: #999; -} -select[disabled].multiselect > option[selected] { - color: #fff; - background: #6d6d6d; -} -textarea:-moz-placeholder, -input:-moz-placeholder { - color: #999 !important; - font-style: italic; -} -option.placeholder { - color: #999 !important; - font-style: italic !important; -} -:-ms-input-placeholder { - color: #999 !important; - font-style: italic; -} -::-webkit-input-placeholder { - color: #999 !important; -} -:-moz-placeholder { - color: #999 !important; -} -.form-inline .control { - width: 100%; -} -.form-inline .label { - width: 20%; - padding-top: 6px; -} -.form-inline .label ~ .control { - width: 60%; -} -.form-inline .no-label .control { - margin-left: 20%; - width: 60%; -} -fieldset.field [class^='fields-group-'] .field .control { - width: auto; - margin: 0 0 0 20px; -} -.form-inline .field-service { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - float: left; - width: 20%; - padding: 7px 0 0 15px; - color: #999; - font-size: 12px; - letter-spacing: 0.05em; -} -.form-inline .field-service[value-scope]:before { - content: attr(value-scope) !important; - white-space: nowrap; - display: block; - margin-bottom: 5px; -} -.form-inline .field-service .checkbox { - margin: 0; - vertical-align: middle; -} -.control > input { - width: 100%; -} -.control > input[type="button"] { - width: auto; -} -.control > input.hasDatepicker { - width: 160px; -} -.control > input[type="radio"], -.control > input[type="checkbox"], -.control > input[type="file"] { - width: auto; -} -.control > table { - width: 100%; -} -.multi-input { - margin: 0 0 20px; -} -.multi-input > input { - width: 100%; -} -.control .input-file { - margin-top: 4px; -} -/* TODO: remove styles for images when images will be replaced by font icons */ -.control .hasDatepicker + img { - margin: -3px 0 0 5px; - vertical-align: middle; -} -.nobr { - white-space: nowrap; -} -/* - Form Validation --------------------------------------- */ -label.mage-error { - display: block; - color: red; - text-align: left; - clear: both; - margin: 3px 0 0 0; -} -textarea.mage-error, -select.mage-error, -input.mage-error { - border-color: #fa7973 !important; - box-shadow: 0 0 8px rgba(250, 121, 115, 0.6) !important; -} -input.mage-error ~ .addafter { - border-color: #fa7973 !important; - box-shadow: 0 0 8px rgba(250, 121, 115, 0.6) !important; -} -/* - Forms for Store Scope --------------------------------------- */ -.form-inline .field-store_id .label + .control, -.form-inline .field-store_ids .label + .control, -.form-inline .field-website_ids .label + .control, -.form-inline .field-website_id .label + .control, -.form-inline .field-select_stores .label + .control, -.form-inline .field-stores .label + .control { - width: auto; -} -/* - Forms styles --------------------------------------- */ -.page-content-inner { - position: relative; - background: #f5f2ed; - border: 1px solid #b7b2a6; - border-radius: 5px; - padding: 20px; -} -.fieldset-wrapper, -.fieldset { - background: #fff; - border: 1px solid #eae6e0; - border-radius: 5px; - margin: 0 0 8px; - padding: 5px 18px 18px; - position: relative; -} -.fieldset-wrapper > .fieldset-wrapper-title, -.fieldset > .legend { - position: static; - float: left; - width: 100%; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - padding: 0; - border-bottom: 1px solid #ededed; - margin: 0 0 18px; -} -.fieldset-wrapper > .fieldset-wrapper-title { - float: none; -} -.fieldset-wrapper > .fieldset-wrapper-title .title, -.fieldset > .legend span { - color: #676056; - font-size: 20px; - font-weight: 400; - padding: 7px 0 10px; - display: inline-block; -} -/* Collapsable fieldset-wrapper */ -.collapsable-wrapper { - padding-bottom: 2px; -} -.collapsable-wrapper.opened { - padding-bottom: 18px; -} -.collapsable-wrapper > .fieldset-wrapper-title { - border-bottom: none; - margin-bottom: 0; -} -.collapsable-wrapper.opened > .fieldset-wrapper-title { - border-bottom: 1px solid #ededed; - margin-bottom: 18px; -} -.collapsable-wrapper .fieldset-wrapper-title > .title { - position: relative; - padding-left: 22px; - cursor: pointer; - float: left; -} -.collapsable-wrapper .fieldset-wrapper-title > .title:before { - position: absolute; - left: 0; - top: 7px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02a'; - /* arrow right icon */ - color: #b2b0ad; -} -.collapsable-wrapper.opened > .fieldset-wrapper-title > .title:before { - content: '\e02c'; - /* arrow down icon */ -} -.collapsable-wrapper .fieldset-wrapper-title > .title:hover:before { - color: #7e7e7e; -} -/* Fieldset styles in another fieldset */ -.fieldset .fieldset-wrapper, -.fieldset-wrapper .fieldset-wrapper { - border-color: #cccbca; - padding: 0; -} -.fieldset .fieldset-wrapper .fieldset-wrapper-title, -.fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title { - background: #f4f2ef; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y0ZjJlZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZWViZTYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f2ef), color-stop(100%, #eeebe6)); - background: -webkit-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -o-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -ms-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: linear-gradient(to bottom, #f4f2ef 0%, #eeebe6 100%); - padding: 0 18px; - border-radius: 5px; -} -.fieldset .fieldset-wrapper.opened .fieldset-wrapper-title, -.fieldset-wrapper .fieldset-wrapper.opened .fieldset-wrapper-title { - border-radius: 5px 5px 0 0; - border-bottom: 1px solid #cccbca; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - min-height: 39px; -} -.fieldset .fieldset-wrapper .fieldset-wrapper-title .actions, -.fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title .actions { - padding: 10px 2px 0 0; -} -.fieldset .fieldset-wrapper .fieldset-wrapper-title .title, -.fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title .title { - padding-top: 9px; - padding-bottom: 8px; - color: #555; - font: normal 16px/1.333 Arial, Verdana, sans-serif; -} -.fieldset .fieldset-wrapper .fieldset-wrapper-title .title:before, -.fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title .title:before { - top: 9px; -} -.fieldset-wrapper-content .fieldset > .title { - margin-top: 0; - padding-left: 22px; -} -.fieldset-wrapper .draggable-handle, -.fieldset .draggable-handle { - width: 8px; - height: 14px; - line-height: 14px; - background: url(Magento_Backend::images/draggable-handle-vertical.gif) no-repeat 0 0; - cursor: ns-resize; - color: #b2b0ad; -} -.fieldset-wrapper-title > .draggable-handle { - position: absolute; - left: 10px; - top: 12px; -} -.fieldset .fieldset-wrapper .fieldset-wrapper-content, -.fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-content { - padding: 0 10px; -} -/* Sortable fieldsets */ -.ui-sortable .entry-edit .fieldset-wrapper-title, -#product_options_container_top .fieldset-wrapper-title { - padding-left: 30px; -} -.fieldset-wrapper-title > .actions, -.fieldset .legend > .actions { - float: right; - padding-top: 8px; -} -.fieldset > .legend + br { - display: block; - height: 0; - overflow: hidden; - clear: left; -} -.fieldset-wrapper .fieldset, -.fieldset .fieldset { - background: transparent; - padding: 9px 0; - border: none; - border-radius: 0; - margin: 0 0 29px; -} -.fieldset .comment { - margin: 0 0 29px 10px; -} -.fieldset .field { - margin: 0 0 29px; -} -.with-note .note, -.field .note { - color: #676056; - font-size: 12px; - font-weight: 400; -} -.fieldset .field .options-list { - list-style: none; - margin: 0; - padding: 0; -} -.fieldset .field .options-list input[type="checkbox"], -.fieldset .field .options-list input[type="radio"] { - margin-right: 5px; -} -[class^="fields-group-"] .field { - margin-bottom: 0; -} -.fieldset-wrapper .fieldset:last-child, -.fieldset .fieldset:last-child, -.fieldset .field:last-child { - margin-bottom: 0; -} -.fieldset .label { - color: #676056; - font-size: 13px; - font-weight: 600; -} -.fieldset .control .label { - color: #676056; - font-size: 14px; - font-weight: 400; -} -.field.required > .label:after { - color: #e22626; - font-size: 13px; - font-weight: 400; -} -.with-addon .textarea { - margin: 0 0 6px; -} -.fieldset .control .textarea, -.fieldset .control .addon .textarea { - border-radius: 4px; - width: 100%; -} -.fieldset > .field > input[type="checkbox"] { - margin-top: 12px; -} -.fieldset-alt { - position: relative; - display: table-row; - border: 0; - padding: 0; - margin-bottom: 20px; - width: 100%; -} -.fieldset-alt > .field { - display: table-cell; - vertical-align: top; - padding-right: 4%; -} -.fieldset-alt > .field.no-display { - display: none; -} -.fieldset-alt .field > .label { - display: block; - width: 100%; - clear: both; - text-align: left; - margin: 0 0 10px; -} -.fieldset-alt .label + .control { - width: 100%; -} -.fieldset-alt .field-option-title { - width: 50%; -} -.fieldset .tooltip .help { - margin: 7px 0 0 15px; -} -.fieldset-alt .field-option-store-view { - width: 20%; -} -.fieldset-alt .field-option-input-type { - width: 20%; -} -.fieldset-alt .field-option-input-type select { - width: 100%; -} -.fieldset-alt .field-option-req { - width: 105px; - white-space: nowrap; -} -.fieldset-alt .field-option-req .control { - position: relative; - top: 32px; -} -.fieldset-alt .field-option-position, -.fieldset-alt .field-option-position .control { - width: 60px; -} -/* "Use default" checkbox */ -.use-default-control { - display: none; -} -.use-default-label { - cursor: pointer; - text-decoration: underline; - font-size: 11px; - color: #a29c94; -} -.use-default-label:hover { - color: #7e7e7e; -} -/* - Custom Multiselect --------------------------------------- */ -.multiselect-alt { - margin: 0; - padding: 0; - list-style: none; - border: 1px solid #ccc; - border-radius: 5px; - color: #333; -} -.multiselect-alt .item { - position: relative; - border-top: 1px solid #fff; - cursor: pointer; -} -.multiselect-alt .item:first-child { - border-top: 0; -} -.multiselect-alt .item.selected { - background: #d7ebf5; -} -.multiselect-alt .item.selected:hover { - background: #afdef2; -} -.multiselect-alt label { - display: block; - cursor: pointer; - padding: 6px 25px 5px; -} -.multiselect-alt .item.selected label:before { - position: absolute; - left: 8px; - top: 1px; - bottom: 0; - width: 10px; - line-height: 28px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e01e'; - /* checked icon */ - text-align: center; - color: #7ba4b1; - font-size: 9px; - text-shadow: 0 -1px 1px #60727b; -} -.multiselect-alt input[type="checkbox"] { - width: 0; - height: 0; - opacity: 0; - margin: 0; - padding: 0; -} -/* - Form item with table --------------------------------------- */ -.with-table .label { - float: none; - text-align: left; - width: 100%; -} -.with-table .control { - clear: left; - float: none; - width: 100%; -} -/* - Form currency label --------------------------------------- */ -.addon input { - border-width: 1px 0 1px 1px; -} -.addon input:focus ~ .addafter { - border-color: #75b9f0; - box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); -} -.addon input ~ .addafter strong { - display: inline-block; - background: #fff; - line-height: 24px; - margin: 0 3px 0 -2px; - padding-left: 4px; - padding-right: 4px; - position: relative; - font-size: 12px; - top: 0; -} -.addon input:focus ~ .addafter strong { - margin-top: 0; -} -.addon .addafter { - background: none; - color: #a6a6a6; - border-width: 1px 1px 1px 0; - border-radius: 4px 4px 0 0; - padding: 0; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.075) inset; -} -.field .control input[type='text'][disabled], -.field .control input[type='text'][disabled] ~ .addafter, -.field .control select[disabled], -.field .control select[disabled] ~ .addafter { - background-color: #fff; - border-color: #eee; - box-shadow: none; - color: #999; -} -.field .control input[type='text'][disabled] ~ .addafter strong, -.field .control select[disabled] ~ .addafter strong { - background-color: #fff; -} -.field.type-price .addon, -.field-price .addon, -.field-special_price .addon, -.field-msrp .addon { - direction: rtl; -} -.field.type-price .addon > *, -.field-price .addon > *, -.field-special_price .addon > *, -.field-msrp .addon > * { - direction: ltr; -} -.field.type-price .addon .addafter, -.field-price .addon .addafter, -.field-special_price .addon .addafter, -.field-msrp .addon .addafter { - border-width: 1px 0 1px 1px; - border-radius: 4px 0 0 4px; -} -.field.type-price .addon input:first-child, -.field-price .addon input:first-child, -.field-special_price .addon input:first-child, -.field-msrp .addon input:first-child { - border-radius: 0 4px 4px 0; -} -.field.type-price input, -.field-price input, -.field-special_price input, -.field-msrp input { - border-width: 1px 1px 1px 0; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.075) inset; -} -.field.type-price input:focus, -.field-price input:focus, -.field-special_price input:focus, -.field-msrp input:focus { - box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); -} -.field.type-price input:focus ~ label.addafter, -.field-price input:focus ~ label.addafter, -.field-special_price input:focus ~ label.addafter, -.field-msrp input:focus ~ label.addafter { - box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); -} -.field.type-price input ~ label.addafter strong, -.field-price input ~ label.addafter strong, -.field-special_price input ~ label.addafter strong, -.field-msrp input ~ label.addafter strong { - margin-left: 2px; - margin-right: -2px; -} -/* - Calendar --------------------------------------- */ -.ui-datepicker { - z-index: 998 !important; -} -.ui-datepicker .ui-datepicker-calendar td { - padding: 0; -} -.ui-datepicker .ui-datepicker-calendar th { - background: #efefef; - border: 1px solid #cfcfcf; - padding: 4px; - color: #676056; - font-weight: bold; -} -.ui-datepicker-calendar tbody tr td, -.ui-datepicker-calendar tbody tr:nth-child(2n+1) td { - background: #fff; -} -.ui-datepicker .ui-datepicker-prev span, -.ui-datepicker .ui-datepicker-next span { - margin-top: -1px; -} -/* - Details element --------------------------------------- */ -summary { - cursor: pointer; - display: inline-block; -} -.no-details details > * { - display: none; -} -.no-details details > summary:before { - float: left; - width: 20px; - content: 'â–º '; -} -.no-details details.open > summary:before { - content: 'â–¼ '; -} -.no-details details summary { - display: block; -} -/* - Blockquotes --------------------------------------- */ -blockquote { - border-left: 2px solid #ccc; - padding-left: 5px; -} -blockquote small:before { - content: '\2014 \00A0'; -} -/* - Addresses --------------------------------------- */ -address { - font-style: normal; -} -/* - Tables --------------------------------------- */ -table > caption { - margin-bottom: 5px; -} -table tfoot, -table th { - background: #e6e6e6; -} -table tfoot, -table thead { - background: #666158; - color: #cac3b4; -} -table thead.active { - /*background:#F37B21;*/ -} -table th { - text-align: left; - background: transparent; - font-weight: normal; -} -table th, -table td { - border: 1px solid #C0BBAF; - padding: 6px 10px 7px; -} -table tbody tr td { - background: #F5F2ED; - color: #676056; - padding-top: 12px; -} -table tbody tr:not(:last-child) td { - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; -} -table .dropdown-menu li { - padding: 7px 15px; - line-height: 14px; - cursor: pointer; -} -table tbody tr td:first-child input[type="checkbox"] { - margin: 0; -} -table tbody tr:nth-child(odd) td, -table tbody tr:nth-child(odd) th { - background-color: #E6E3DE; -} -table tbody tr.selected td, -table tbody tr.selected th { - border: 1px solid #C0BBAF; -} -table tbody tr.selected td, -table tbody tr.selected th, -table tbody tr:hover td, -table tbody tr:hover th, -table tbody tr:nth-child(odd):hover td, -table tbody tr:nth-child(odd):hover th { - background-color: #fff; -} -/* - X-tree styles --------------------------------------- */ -.x-tree-node .leaf .x-tree-node-icon { - background-image: url(../images/fam_leaf.png); -} -.x-tree-node .system-leaf .x-tree-node-icon { - background-image: url(../images/fam_application_form_delete.png); -} -.x-tree-node-ct { - overflow: hidden; -} -/* - Styles for "js" tooltip with positionings --------------------------------------- */ -.tipsy { - padding: 11px; -} -.tipsy-inner { - padding: 12px 15px; - max-width: 185px; - background: #faf8f6; - border: 1px solid #dcd8ce; - box-shadow: 0 2px 5px rgba(49, 48, 43, 0.4); -} -.tipsy-inner .error { - width: 158px; -} -.tipsy-inner .error h5 { - color: #be0a0a; - font-size: 16px; - font-weight: 500; - margin: 0 0 6px 0; -} -.tipsy-inner .error p { - color: #676056; - line-height: 1.5; - margin: 0; -} -.tipsy-e .tipsy-arrow { - top: 50%; - left: 1px; - margin-top: -10px; - border-top: 10px solid transparent; - border-right: 10px solid #dcd8ce; - border-bottom: 10px solid transparent; - border-left: none; -} -.tipsy-w .tipsy-arrow { - top: 50%; - right: 0; - margin-top: -10px; - border-top: 10px solid transparent; - border-right: none; - border-bottom: 10px solid transparent; - border-left: 10px solid #dcd8ce; -} -.tipsy-n .tipsy-arrow, -.tipsy-ne .tipsy-arrow, -.tipsy-nw .tipsy-arrow { - bottom: 1px; - border-top: 10px solid #dcd8ce; - border-right: 10px solid transparent; - border-bottom: none; - border-left: 10px solid transparent; -} -.tipsy-ne .tipsy-arrow { - left: 16px; -} -.tipsy-nw .tipsy-arrow { - right: 16px; -} -.tipsy-s .tipsy-arrow, -.tipsy-se .tipsy-arrow, -.tipsy-sw .tipsy-arrow { - top: 1px; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - border-bottom: 10px solid #dcd8ce; - border-top: none; -} -.tipsy-se .tipsy-arrow { - left: 16px; -} -.tipsy-sw .tipsy-arrow { - right: 16px; -} -.tipsy-arrow:after, -.tipsy-arrow:before { - position: absolute; - width: 0; - height: 0; - content: ''; -} -.tipsy-e .tipsy-arrow:after { - top: -5px; - left: 2px; - margin-top: -4px; - border-top: 9px solid transparent; - border-right: 9px solid #faf8f6; - border-bottom: 9px solid transparent; -} -.tipsy-e .tipsy-arrow:before { - top: -8px; - margin-top: 0; - border-top: 10px solid transparent; - border-right: 10px solid rgba(49, 48, 43, 0.1); - border-bottom: 10px solid transparent; -} -.tipsy-w .tipsy-arrow:after { - top: -5px; - left: -12px; - margin-top: -4px; - border-top: 9px solid transparent; - border-right: none; - border-bottom: 9px solid transparent; - border-left: 9px solid #faf8f6; -} -.tipsy-w .tipsy-arrow:before { - top: -8px; - left: -10px; - margin-top: 0; - border-top: 10px solid transparent; - border-right: none; - border-bottom: 10px solid transparent; - border-left: 10px solid rgba(49, 48, 43, 0.1); -} -.tipsy-n .tipsy-arrow:after, -.tipsy-ne .tipsy-arrow:after, -.tipsy-nw .tipsy-arrow:after { - margin-top: -4px; - left: -9px; - top: -7px; - border-top: 9px solid #faf8f6; - border-right: 9px solid transparent; - border-left: 9px solid transparent; -} -.tipsy-n .tipsy-arrow:before, -.tipsy-ne .tipsy-arrow:before, -.tipsy-nw .tipsy-arrow:before { - left: -10px; - top: -8px; - margin-top: 0; - border-top: 10px solid rgba(49, 48, 43, 0.1); - border-right: 10px solid transparent; - border-left: 10px solid transparent; -} -.tipsy-s .tipsy-arrow:after, -.tipsy-sw .tipsy-arrow:after, -.tipsy-se .tipsy-arrow:after { - left: -9px; - top: 6px; - margin-top: -4px; - border-top: none; - border-right: 9px solid transparent; - border-bottom: 9px solid #faf8f6; - border-left: 9px solid transparent; -} -.tipsy-inner dl { - margin: 0; -} -.tipsy-inner dt { - margin: 0 0 4px; - font-size: 16px; - font-weight: 400; - color: #f47b20; -} -.tipsy-inner dd { - margin: 0; - color: #676056; - font-size: 12px; - line-height: 18px; - font-family: Arial, Helvetica, sans-serif; -} -/* - Popups --------------------------------------- */ -.fade .popup { - padding: 0; - border: 5px solid #969288; - border-radius: 8px; -} -.wrapper-popup { - padding: 0 10px; -} -.fade .popup .popup-inner { - padding: 20px; - border-radius: 3px; -} -.fade .popup .popup-title { - margin: 0 0 10px; -} -.popup-loading { - position: fixed; - z-index: 1003; - width: 200px; - background: rgba(255, 255, 255, 0.8); - left: 50%; - top: 40%; - margin-left: -100px; - color: #d85909; - border-color: #d85909; - font-size: 14px; - font-weight: bold; - text-align: center; - padding: 100px 0 10px; -} -.popup-loading:after { - position: absolute; - left: 50%; - top: 40%; - background-image: url(../mui/images/ajax-loader-big.gif); - width: 64px; - height: 64px; - margin: -32px 0 0 -32px; - content: ''; - z-index: 2; -} -/* Loading mask */ -.loading-old, -.loading-mask { - background: rgba(255, 255, 255, 0.4); - z-index: 999; -} -.loading-old, -.loading-mask { - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; -} -.loading-old .loader, -.loading-mask .loader { - position: absolute; - margin: auto; - left: 0; - top: 0; - right: 0; - bottom: 0; - width: 160px; - height: 160px; - color: #5e5b56; - font-size: 14px; - font-weight: bold; - text-align: center; - background: #e5e2dd url(../mui/images/ajax-loader-big.gif) no-repeat 50% 30%; - border-radius: 5px; - opacity: .95; -} -.loading-mask img { - display: none; -} -.loading-old p, -.loading-mask p { - margin-top: 118px; -} -/* Backup popup */ -/* TODO: remove after backups page js refactoring */ -.backup-dialog { - margin-top: inherit !important; -} -/* - Login page --------------------------------------- */ -.page-login { - height: 100%; -} -.page-login .wrapper { - min-height: 100%; - padding: 0; -} -.page-login .wrapper-inner { - overflow: auto; - padding-bottom: 140px; -} -.page-login .footer { - clear: both; - height: 100px; - margin-top: -100px; - position: relative; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} -.page-login .footer-content { - max-width: none; - min-width: 0; -} -.page-login .footer-copyright { - text-align: left; -} -.page-login .form-login { - width: 280px; - margin: 160px auto 60px; - padding: 30px 25px; - border: 1px solid #e3ded5; - border-radius: 5px; - background: #f7f2ec; -} -.page-login .fieldset { - background: transparent; - border: 0; - border-radius: 0; - margin: 0; - padding: 0; -} -.page-login .fieldset > .legend { - border-bottom: 0; - margin-bottom: 15px; -} -.page-login .fieldset > .legend span { - font-size: 32px; - line-height: 32px; - padding: 0; - color: #8a847c; - display: inline; -} -.page-login .fieldset .field { - margin: 0 0 13px; -} -.page-login .form-inline .label { - width: auto; - padding: 0; - margin-bottom: 13px; -} -.page-login .field-username label, -.page-login .field-password label, -.page-login .field-confirmation label { - display: none; -} -.page-login .form-inline .label + .control { - width: auto; - float: none; -} -.page-login .header { - margin-bottom: 30px; - background: transparent; - padding: 0; - z-index: auto; - position: static; -} -.page-login .header .logo { - display: block; - width: 262px; - height: 64px; - text-indent: -999em; - background: url(Magento_Backend::images/logo-magento.png) no-repeat; -} -.page-login button { - border-radius: 2px; -} -.page-login button:not(.primary) { - background-image: none; - background-color: #f7f3eb; - padding: 0 13px; - color: #676056; - border: 1px solid #ada89e; - cursor: pointer; - display: inline-block; - font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: 500; - line-height: 26px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - margin: 0; - vertical-align: middle; -} -.page-login button:not(.primary):focus, -.page-login button:not(.primary):active { - background-color: #cac3b4; - border: 1px solid #989287; - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -.page-login button:not(.primary):hover { - background-color: #cac3b4; -} -.page-login button:not(.primary).disabled, -.page-login button:not(.primary)[disabled] { - cursor: default; - pointer-events: none; - opacity: 0.5; -} -.page-login button.primary { - background-image: none; - background-color: #007dbd; - padding: 0 13px; - color: #ffffff; - border: 1px solid #0a6c9f; - cursor: pointer; - display: inline-block; - font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: 500; - line-height: 26px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - vertical-align: middle; -} -.page-login button.primary:focus, -.page-login button.primary:active { - background-color: #026294; - border: 1px solid #004c74; - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; - color: #ffffff; -} -.page-login button.primary:hover { - background-color: #026294; - border: 1px solid #026294; -} -.page-login button.primary.disabled, -.page-login button.primary[disabled] { - cursor: default; - pointer-events: none; - opacity: 0.5; -} -.page-login .form-actions { - padding: 0; - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.page-login .actions, -.page-login .links { - display: inline-block; - vertical-align: middle; -} -.page-login input[type=text], -.page-login input[type=password] { - border-color: #cac3b4; - font-size: 18px; - padding: 12px 12px 14px; - height: auto; -} -.page-login :-ms-input-placeholder { - color: #bebab1 !important; -} -.page-login ::-webkit-input-placeholder { - color: #bebab1 !important; -} -.page-login :-moz-placeholder { - color: #bebab1 !important; -} -.page-login button.action-login, -.page-login button.action-retrieve { - font-size: 22px; - padding: 14px 22px 16px; -} -.page-login button.action-retrieve, -.page-login button.action-reset { - font-size: 18px; - padding: 10px 17px 10px; -} -.page-login .action-forgotpassword, -.page-login .action-back { - font-size: 12px; - color: #1c8bb8; - text-decoration: underline; - position: absolute; - left: 0; - bottom: -70px; -} -.page-login .action-forgotpassword:hover, -.page-login .action-back:hover { - text-decoration: none; -} -/* - Page title --------------------------------------- */ -.page-title { - position: relative; - margin: 20px 0; -} -.page-title-inner > .title { - color: #676056; - font-size: 28px; - font-weight: 400; - display: inline-block; - margin: 0; - width: 100%; - word-wrap: break-word; -} -.page-title-inner .title > h3 { - margin: 0; -} -.page-title-inner .actions { - float: right; -} -.page-title-inner .actions form { - display: inline-block; -} -/* - Messages (Global) --------------------------------------- */ -.wrapper > .message { - padding: 0 20px; -} -.page-content > #messages { - max-width: 1300px; - min-width: 960px; - margin: 0 auto; -} -.messages { - margin: 20px 0; -} -.messages > .message:last-child { - margin-bottom: 0; -} -.messages.license { - font-size: 20px; - line-height: 1.2; - margin: 20px auto; - max-width: 1300px; - min-width: 960px; - padding: 0 20px; -} -.message { - background: #f9f5ec; - border-bottom: 1px solid #c7c2b6; - border-radius: 5px; - color: #676056; - margin: 20px 0; - padding: 10px 26px 10px 35px; - position: relative; - text-shadow: none; -} -.message:before { - position: absolute; - left: 11px; - top: 50%; - margin-top: -11px; - background: none; - text-shadow: none; - width: auto; - height: auto; - border: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - font-size: 16px; - line-height: inherit; - content: '\e046'; - /* icon-info */ - color: #d87e34; -} -.message.error { - color: #963535; - border-color: #963535; - background: #f3dcd8; -} -.message.error:before { - content: '\e069'; - color: #963535; -} -.message.success { - border-color: #ceceb6; - background: #e4eecb; - color: #185b00; -} -.message.success:before { - content: '\e067'; - color: #185b00; -} -.messages-inbox { - float: right; -} -.messages-inbox .critical { - color: red; -} -/* System Messages */ -.message-system { - padding: 0; -} -.message-system:before { - display: none; -} -.message-system .message-inner { - position: relative; - min-width: 960px; - max-width: 1300px; - margin: 0 auto; -} -.message-system .message-inner:before { - background: none; - border: 0; - content: '\e006'; - /* notification icon */ - color: #6e685e; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - speak: none; - -webkit-font-smoothing: antialiased; - height: auto; - left: 8px; - margin-top: -10px; - position: absolute; - text-shadow: none; - top: 50%; - width: auto; - font-size: 16px; -} -.message-system .message-content { - padding: 10px 26px 10px 32px; -} -/* - No-javaScript-Enabled message --------------------------------------- */ -.message-noscript { - background: #ff9; - padding: 0; - border: 0; - box-shadow: 0 1px 2px #46433d; - z-index: 994; -} -.message-noscript:before { - content: ''; -} -.message-noscript .message-content { - margin: 0 auto; - max-width: 1300px; - min-width: 960px; - padding: 3px 0; - position: relative; - text-align: center; -} -.message-noscript .message-content:before { - position: relative; - background: none; - text-shadow: none; - width: auto; - height: auto; - vertical-align: middle; - border: 0; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - font-size: 32px; - speak: none; - -webkit-font-smoothing: antialiased; - content: '\e006'; - /* notification icon */ - color: #6e685e; -} -.message-demo-mode { - background: #d75f07; - border: 0; - color: #fff; - text-align: center; - padding: 5px 0; - box-shadow: 0 1px 2px #46433d; - z-index: 993; -} -.message-demo-mode:before { - content: ''; -} -.message-demo-mode .message-content { - margin: 0 auto; - max-width: 1300px; - min-width: 960px; - position: relative; - text-align: center; -} -.message-demo-mode .message-content:before { - position: relative; - background: none; - text-shadow: none; - width: auto; - height: auto; - vertical-align: middle; - border: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - font-size: 16px; - content: '\e006'; - /* notification icon */ -} -/* - Information message --------------------------------------- */ -.message-info, -.message.info { - background: #fffbf0; - border: 1px solid #d87e34; - margin-bottom: 20px; -} -.message-info:before, -.message.info:before { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e046'; - /* icon-info */ - color: #d87e34; -} -/* - Error message --------------------------------------- */ -.message-error, -.message.error { - color: #963535; - background: #f3dcd8; - border: 1px solid #963535; - margin-bottom: 20px; -} -.message-error:before, -.message.error:before { - content: '\e069'; - color: #963535; -} -/* - Store Switcher --------------------------------------- */ -.store-switcher-alt { - position: relative; - display: inline-block; -} -.store-switcher-alt .dropdown-menu { - white-space: nowrap; - margin-top: 2px; -} -.store-switcher-alt.active .dropdown-menu { - display: block; -} -.store-switcher-alt .dropdown-menu ul { - margin: 0; - padding: 0; - list-style: none; -} -.store-switcher-alt strong { - display: block; - font-size: 14px; - font-weight: 500; - line-height: 1.333; - color: #a6a098; - padding: 5px 10px; -} -.store-switcher-alt .store-selected { - font-size: 12px; - font-weight: 400; - line-height: 1.333; - color: #676056; - cursor: pointer; -} -.store-switcher-alt .store-selected:after { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02c'; - /* arrow down icon */ - color: #b3b0ad; - margin: 0 0 0 3px; - vertical-align: text-top; -} -.store-switcher-alt .store-switcher-website, -.store-switcher-alt .store-switcher-store { - padding: 0; -} -.store-switcher-alt .store-switcher-website:hover, -.store-switcher-alt .store-switcher-store:hover { - background: none; -} -.store-switcher-website { - margin: 5px 0 0; -} -.store-switcher-website > strong { - padding-left: 13px; -} -.store-switcher-store { - margin: 1px 0 0; -} -.store-switcher-store > strong { - padding-left: 20px; -} -.store-switcher-alt .store-switcher-store > ul { - margin-top: 1px; -} -.store-switcher-alt .store-switcher-store-view { - padding: 0; -} -.store-switcher-store-view:first-child { - border-top: 1px solid #e5e5e5; -} -.store-switcher-store-view > a { - display: block; - padding: 5px 15px 5px 24px; - color: #333; - font-size: 13px; - text-decoration: none; -} -.store-switcher-alt .store-switcher-all, -.store-switcher-alt .manage-stores { - padding: 0; -} -.store-switcher-alt .store-switcher-all > a, -.store-switcher-alt .manage-stores > a { - display: block; - padding: 8px 15px; - color: #676056; - text-decoration: none; - font-size: 12px; -} -/* - Page Structure --------------------------------------- */ -.page-title.complex .title { - float: left; - width: 70%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.page-title.complex .store-switcher-alt { - float: right; - margin: 12px 0 0; -} -.side-col { - position: relative; - width: 20%; -} -.main-col { - position: relative; - width: 80%; - padding: 0 20px 20px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} -.col-left { - float: left; -} -.col-right { - float: right; -} -.col-1-layout .main-col { - width: auto; -} -.col-2-left-layout .main-col, -.col-2-right-layout .side-col { - float: right; -} -.col-2-right-layout .main-col, -.col-2-left-layout .side-col { - float: left; -} -.col-2-left-layout, -.col-1-layout { - position: relative; - background: #f5f2ed; - border: 1px solid #d5d0ca; - margin: 0 auto; -} -.col-1-layout { - padding: 20px; -} -.col-2-left-layout:before { - position: absolute; - display: block; - left: 20%; - top: 0; - bottom: 0; - width: 6px; - margin-left: -7px; - content: ''; - background: -moz-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); - /* FF3.6+ */ - background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0.06))); - /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); - /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); - /* Opera 11.10+ */ - background: -ms-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); - /* IE10+ */ - background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); - /* W3C */ - z-index: 2; -} -/* Sidebar and main column vertical separator */ -.main-col:after, -.side-col:after { - position: absolute; - top: 0; - bottom: 0; - width: 1px; - background: #ded9d3; - content: ''; -} -.col-2-left-layout .side-col:after { - right: 0; -} -.col-2-right-layout .side-col:after { - left: 0; -} -.col-2-right-layout .main-col:after { - right: -1px; -} -.col-2-left-layout .main-col:after { - left: -1px; -} -.col-2-left-layout .main-col, -.col-2-right-layout .main-col { - min-width: 730px; -} -/* Sidebar title */ -/* TODO: temporary styles */ -.side-col h3 { - padding: 0 17px; - margin-top: 16px; -} -.side-col .ui-tabs h3 { - margin-bottom: 5px; - color: #524c44; - text-shadow: 0 1px 0 #fff; -} -/* - Universal Sidebar Tabs --------------------------------------- */ -.side-col .ui-tabs .ui-accordion-header { - position: relative; - margin: 10px 0 0; - padding: 5px 20px; - cursor: pointer; - color: #524c44; - text-shadow: 0 1px 0 #fff; -} -.side-col .ui-tabs .ui-accordion-header:focus { - outline: none; -} -.side-col .ui-accordion-header:before { - position: absolute; - left: 4px; - top: 7px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02a'; - /* arrow right icon */ - font-size: 14px; - color: #ada79e; -} -.side-col .ui-accordion-header:hover:before { - color: #777; -} -.side-col .ui-accordion-header-active:before { - content: '\e02c'; - /* arrow down icon */ -} -.side-col .tabs { - margin: 0 0 30px; - padding: 0; - list-style: none; - font-weight: 500; -} -.side-col > .ui-tabs > .tabs:first-child > li:first-child > a { - border-top-left-radius: 5px; -} -.side-col .tabs > li { - border-bottom: 1px solid #e5e1db; -} -.side-col .tabs > li:first-child { - border-top: 1px solid #e5e1db; -} -.side-col .tabs > li a { - position: relative; - display: block; - padding: 8px 18px; - text-decoration: none; - color: #676056; - -webkit-transition: background 0.3s ease-in-out; - -moz-transition: background 0.3s ease-in-out; - transition: background 0.3s ease-in-out; -} -.side-col .tabs > li a:active, -.side-col .tabs > li a:focus { - outline: none; -} -.side-col .tabs > li a:hover { - background: #fff; -} -.side-col .tabs > .ui-state-active a { - border-left: 3px solid #d87e34; - padding-left: 15px; - background: #dedcd8; - box-shadow: 0 1px 2px #ccc inset; -} -.side-col .tabs > .ui-state-active a:after, -.side-col .tabs > .ui-state-active a:before { - position: absolute; - top: 50%; - right: 0; - width: 14px; - margin-top: -14px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02b'; - /* left turned triangle icon */ - font-size: 22px; - color: #f5f2ed; - overflow: hidden; - z-index: 4; -} -.side-col .tabs > .ui-state-active a:before { - color: #bdbbb7; - margin-top: -13px; - z-index: 3; -} -.side-col .tabs span.error, -.side-col .tabs span.loader { - display: none; - position: absolute; - right: 12px; - top: 7px; - width: 16px; - height: 16px; - font-size: 16px; -} -.side-col .tab-item-link.changed { - font-style: italic; -} -.side-col .tab-item-link.error span.error, -.side-col .ui-tabs-loading span.loader { - display: block; -} -.side-col .tab-item-link.error span.error:after { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e006'; - /* warning icon */ - color: #d87e34; -} -.side-col .ui-tabs-loading span.loader:after { - background: url(../mui/images/ajax-loader-small.gif) no-repeat 50% 50%; - display: block; - content: ''; - width: 16px; - height: 16px; -} -/* TODO: styles for navigation on System > Configuration page */ -/* - Horizontal Tabs --------------------------------------- */ -.tabs-horiz { - list-style: none; - margin: 0; - padding: 3px 0 0; -} -.tabs-horiz > li { - float: left; - border: 1px solid #e9e4db; - border-bottom-width: 0; - margin: 0 -1px 0 0; -} -.tabs-horiz > li a { - position: relative; - display: block; - padding: 7px 18px 9px; - text-decoration: none; - font-size: 12px; - line-height: 1.666; - color: #676056; -} -.tabs-horiz > .ui-state-active a { - background: #fff; - border-top: 3px solid #f3771e; - margin-top: -3px; - box-shadow: 1px 0 3px #e9e4db; -} -/* - System -> Configuration page navigation in sidebar --------------------------------------- */ -.config-nav, -.config-nav .items { - margin: 0; - padding: 0; - list-style: none; -} -.config-nav-block:last-child { - margin-bottom: 30px; -} -.config-nav .item { - border-top: 1px solid #E5E1DB; -} -.config-nav .item:first-child { - border-top: 0; -} -.config-nav .title { - margin-bottom: 0; - text-transform: uppercase; - color: #444; - border: solid #CCC; - border-width: 1px 0; - opacity: .8; - padding: 7px 17px; - background: #E6E3DE; -} -.config-nav .item-nav { - display: block; - padding: 8px 18px; - text-decoration: none; - color: #676056; - -webkit-transition: background 0.3s ease-in-out; - -moz-transition: background 0.3s ease-in-out; - transition: background 0.3s ease-in-out; -} -.config-nav .item-nav:hover { - background: #fff; -} -.config-nav .item-nav.active { - position: relative; - border-left: 3px solid #d87e34; - padding-left: 15px; - background: #dedcd8; - box-shadow: 0 1px 2px #ccc inset; -} -.config-nav .item-nav.active:after { - position: absolute; - top: 50%; - right: 0; - width: 14px; - margin-top: -14px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02b'; - /* left turned triangle icon */ - font-size: 22px; - text-shadow: -1px 1px 0 #bdbbb7; - color: #f5f2ed; - overflow: hidden; - z-index: 3; -} -/* - Footer --------------------------------------- */ -.footer { - position: absolute; - left: 0; - right: 0; - bottom: 0; - color: #989288; - font-size: 11px; -} -.footer-content { - margin: 0 auto; - max-width: 1300px; - min-width: 960px; - padding: 20px; -} -/* - Switcher --------------------------------------- */ -.switcher { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - display: inline-block; - overflow: hidden; -} -.switcher input[type="checkbox"] { - position: absolute; - left: -999em; -} -.switcher-label { - color: #676056; - font-size: 13px; - font-weight: 600; - text-transform: uppercase; -} -.switcher-label:before { - content: attr(data-text-off); -} -.switcher-label:after { - display: inline-block; - margin-left: 10px; - vertical-align: bottom; - width: 34px; - height: 17px; - background: url(../images/switcher.png) no-repeat; - content: ''; -} -.switcher input[type="checkbox"]:focus + .switcher-label:after { - border-color: #75b9f0; -} -.switcher input[type="checkbox"]:checked + .switcher-label:after { - background-position: -34px 0; -} -.switcher input[type="checkbox"]:checked + .switcher-label:before { - content: attr(data-text-on); -} -/* - Content actions panel (with buttons, switchers...) --------------------------------------- */ -.page-actions .buttons-group { - vertical-align: top; - text-align: left; -} -.page-actions > .switcher { - display: inline-block; - vertical-align: top; - margin: 6px 10px 0 0; -} -.page-actions .store-switcher { - float: left; -} -.catalog-product-index .page-actions { - padding-top: 0; -} -/* TODO: refactor trees */ -.x-tree ul { - margin: 0; - padding: 0; -} -/* - Table Grid --------------------------------------- */ -/* Grid - General */ -.grid-container { - margin-bottom: 10px; -} -.grid { - border-bottom: 0; - color: #676056; - font-size: 13px; - font-weight: 400; - padding-bottom: .5em; -} -.grid table { - border-collapse: collapse; - border: none; - width: 100%; -} -.grid table.border { - border: 1px solid #c0bbaf; -} -.grid tbody { - background: #e6e3de; -} -.grid tr.even, -.grid tr.even tr { - background: #f5f2ed; -} -.grid tr.on-mouse { - cursor: pointer; -} -.grid tr.on-mouse td, -.grid table tbody tr.on-mouse:hover td, -.grid table tbody tr.on-mouse:hover th, -.grid table tbody tr.on-mouse:nth-child(odd):hover td, -.grid table tbody tr.on-mouse:nth-child(odd):hover th { - background-color: #fff; -} -/* Rows mouse-over */ -.grid tr.invalid { - background-color: #f5d6c7; -} -.grid th, -.grid td { - padding: 2px 4px 2px 4px; - vertical-align: top; -} -.grid th { - border: none; -} -.grid td.editable input.input-text { - width: 50px; - margin-left: 4px; -} -.grid td input.input-text { - width: 86%; -} -.grid td input.input-inactive { - background: #eee; -} -.grid table td { - border: solid #c0bbaf; - border-width: 0 1px 1px; - padding: 5px; -} -.grid table.border td { - background: #fff; -} -.grid table td.product { - text-align: right; -} -.grid table td.empty-text { - border: solid #c0bbaf; - border-width: 0 1px; - color: #676056; - font-size: 16px; - font-weight: 400; - text-align: center; - padding: 15px; -} -.grid table tr:last-child td.empty-text { - border-width: 0 1px 1px; -} -.grid table td.empty-text:hover { - background: #e6e3de; -} -.grid table td .action-select { - width: 100%; -} -.grid tbody.odd tr { - background: #fff; -} -.grid tbody.even tr { - background: #f6f6f6; -} -.grid tbody.odd tr td, -.grid tbody.even tr td { - border-bottom: 0; -} -.grid tbody.odd tr.border td, -.grid tbody.even tr.border td { - border-bottom: 1px solid #dadfe0; -} -/* - Grid - Pager and Buttons row --------------------------------------- */ -.grid-actions { - border: 1px solid #c0bbaf; - border-bottom: 0; - background: #f6f3ec; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f6f3ec), color-stop(100%, #edeae1)); - background: -webkit-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -o-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -ms-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: linear-gradient(to bottom, #f6f3ec 0%, #edeae1 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f3ec', endColorstr='#edeae1', GradientType=0); - padding: 7px 8px 8px; - position: relative; -} -[id$='Grid'] .separator { - padding: 0 4px; - color: #b9b9b9; -} -.grid-actions select { - margin: 0 5px; -} -.grid-actions .export, -.grid-actions .filter-actions { - float: right; - margin-left: 30px; -} -.grid-actions .filter-actions button { - float: left; - margin-left: 4px; -} -.grid-actions .pager { - color: #676056; - font-size: 13px; - font-weight: 400; -} -.grid-actions .pager select { - width: 5em; - margin: 0 4px; -} -.grid-actions .pager input.page { - width: 2em; -} -.pager .action-next, -.pager .action-previous { - display: inline-block; - position: relative; - text-indent: 100%; - overflow: hidden; - height: 16px; - width: 16px; - vertical-align: middle; - text-decoration: none; -} -.pager .action-next:after, -.pager .action-previous:after { - font-family: 'MUI-Icons'; - content: "\e02a"; - font-size: 16px; - color: #333; - position: absolute; - top: 0; - left: 0; - line-height: 1; - text-indent: 0; -} -.pager .action-previous:after { - content: "\e02b"; -} -.pager span.action-next:after, -.pager span.action-previous:after { - color: #7f7f7f; -} -.grid-actions .date { - float: left; - margin: 0 15px 0 0; - position: relative; -} -.grid-actions .date input { - margin: 0 5px; - width: 80px; -} -.grid-actions .required:after { - content: '*'; - color: #f00; -} -[class^=" reports-report-"] .grid-actions .required:after { - content: ''; -} -[class^=" reports-report-"] .grid-actions .required .label span:after { - content: '*'; - color: #f00; -} -.grid-actions img { - vertical-align: middle; - height: 22px; - width: 22px; -} -.grid-actions .pager img { - width: auto; - height: auto; -} -.grid-actions .validation-advice { - background: #f3dcd8; - border: 1px solid #963535; - border-radius: 3px; - color: #963535; - margin: 5px 0 0; - padding: 3px 7px; - position: absolute; - white-space: nowrap; - z-index: 5; -} -.grid-actions .validation-advice:before { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e029'; - /* user icon */ - position: absolute; - top: -12px; - left: 50%; - margin-left: -3px; -} -.grid-actions .link-feed { - white-space: nowrap; -} -.grid-actions input[type="text"].validation-failed { - border-color: #fa7973; - box-shadow: 0 0 8px rgba(250, 121, 115, 0.6); -} -/* - Grid - Headings --------------------------------------- */ -.grid tr.headings th { - color: #ffffff; - font-size: 13px; - font-weight: 700; - border-right: 1px solid #837f79; - padding: 0; - vertical-align: bottom; -} -.grid tr th:first-child { - border-left: 1px solid #837f79; -} -.grid tr.headings th > span { - display: block; - border-bottom: 2px solid transparent; - padding: 5px 5px 2px; - white-space: nowrap; -} -.grid tr.headings th:hover > span { - border-color: #504841; -} -.grid tr.headings th.no-link:hover > span, -.grid tr.headings th.col-select:hover > span { - border-color: transparent; -} -.grid tr.headings th a label { - display: block; - padding-right: 20px; -} -.grid tr.headings th a { - display: block; - color: #ffffff; - font-size: 13px; - font-weight: 700; - position: relative; - text-decoration: none; -} -.grid tr.headings th a:after { - display: none; - height: 8px; - width: 15px; - position: absolute; - bottom: 4px; - right: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - font-size: 20px; - line-height: 8px; - -webkit-font-smoothing: antialiased; - content: '\e038'; - /* arrow down icon */ - color: #8c8172; -} -.grid tr.headings th a:hover:after { - display: block; -} -.grid tr.headings th a.sort-arrow-desc:after { - color: #c7b299; - display: block; -} -.grid tr.headings th a.sort-arrow-asc:after { - color: #c7b299; - content: '\e035'; - /* arrow up icon */ - display: block; -} -.grid tr.headings th a.sort-arrow-desc:hover:after, -.grid tr.headings th a.sort-arrow-asc:hover:after { - color: #fff; -} -/* Grid - Filter */ -.grid .filter { - cursor: default; -} -.grid .filter th { - padding: 5px; - border-right: 1px solid #837F79; - vertical-align: top; - white-space: normal; -} -.grid .filter input.input-text { - background: #5e5a52; - border-radius: 2px; - border: none; - color: #bcb795; - padding: 0 5px; - height: 20px; - width: 99%; -} -.grid .filter input.input-text::-webkit-input-placeholder { - color: #858376 !important; - text-transform: lowercase; -} -.grid .filter input.input-text:-moz-placeholder { - color: #858376 !important; - text-transform: lowercase; -} -.grid .filter input.input-text::-moz-placeholder { - color: #858376 !important; - text-transform: lowercase; -} -:-ms-input-placeholder { - color: #858376 !important; - text-transform: lowercase; -} -.grid .filter select { - background: #5e5a52; - border-radius: 2px; - border: none; - color: #bcb795; - margin: 0; - padding: 0; - height: 20px; - width: 99%; -} -.grid td select { - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - padding: 4px 4px 5px; - text-align: left; -} -.grid .action-select { - background: #fff; - border: 1px solid #ccc; - margin: 0; -} -.grid .filter .range .range-line { - margin-bottom: 3px; -} -.grid .filter .range div.date { - min-width: 121px; -} -.grid .filter .range .date input { - margin-top: 0; - vertical-align: middle; - width: 80%; -} -.grid .filter .range select { - margin: 0; - color: #676056; - font-size: 11px; - font-weight: 400; - color: #bcb795; -} -.grid .filter .date { - position: relative; -} -.grid .filter .date img { - width: 15px; - height: 15px; - cursor: pointer; - vertical-align: middle; - margin-left: 5px; - position: relative; - z-index: 2; - opacity: 0; -} -.grid .filter .date:before { - position: absolute; - left: 80%; - top: 1px; - margin-left: 5px; - text-shadow: none; - width: 16px; - height: 16px; - line-height: 16px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - font-size: 16px; - content: '\e06a'; - /* icon calendar */ - color: #cac3b4; - z-index: 1; -} -.grid .head-massaction select { - width: 50px; -} -/* Grid - Mass Action */ -.massaction { - color: #cac3b4; - padding: 7px 8px; - background: #666158; - box-shadow: 0 1px 2px 0 #504d46 inset, 0 -1px 2px 0 #504d46 inset; - overflow: hidden; -} -.massaction ul { - list-style: none; - margin: 0; - padding: 6px 0 0; -} -.massaction li { - display: inline-block; -} -.massaction li:before { - color: #837F79; - content: '|'; - display: inline-block; - margin: 0 5px; -} -.massaction li:first-child:before { - display: none; -} -.massaction .entry-edit { - float: right; - display: inline-block; -} -.massaction .entry-edit fieldset { - margin: 0; - padding: 0; - background: none; - border: none; -} -.massaction .entry-edit fieldset select { - border-radius: 2px; - margin: 0; -} -.massaction .entry-edit fieldset select.validation-failed { - border: 1px dashed #eb340a; - background: #faebe7; -} -.massaction .entry-edit .field-row { - display: inline-block; - vertical-align: middle; -} -.massaction .entry-edit .outer-span .entry-edit { - float: none; -} -.massaction .entry-edit .field-row label { - color: #cac3b4; - line-height: 26px; - margin: 0 5px 0 20px; - padding: 0; - vertical-align: middle; - width: auto; - float: none; -} -.massaction .entry-edit .validation-advice { - display: none !important; -} -.massaction a { - color: #e7e2d7; - text-decoration: none; -} -.massaction a:hover { - color: #fff; -} -/* Grid Footer */ -.grid table tfoot tr { - background: #656156; -} -.grid table tfoot tr th, -.grid table tfoot tr td { - border-right: 1px solid #837f79; - line-height: 1.7em; - padding: 3px 10px; -} -.grid table tfoot tr th:first-child, -.grid table tfoot tr td:first-child { - border-left: 1px solid #837f79; -} -.grid table.border tfoot tr td { - background: #656156; -} -.grid .col-price, -.grid .col-number { - text-align: right; -} -/* Dynamic Grid */ -/* Used in pages like Catalog -> Attributes */ -.dynamic-grid th { - padding: 2px; - width: 100px; -} -.dynamic-grid td { - padding: 2px; -} -.dynamic-grid td input { - width: 94px; -} -tr.dynamic-grid td, -tr.dynamic-grid th { - padding: 2px 10px 2px 0; - width: auto; -} -tr.dynamic-grid input.input-text { - width: 154px; -} -.available { - color: #080; - font-weight: bold; -} -.not-available { - color: #800; -} -.categories-side-col { - padding: 0 3%; -} -/* - TODO: change ids to 'table.data' after refactoring of all templates for grids - Manage Products Grid --------------------------------------- */ -#cross_sell_product_grid table.data, -#up_sell_product_grid table.data, -#related_product_grid table.data, -#productGrid_table, -#setGrid_table, -#attributeGrid_table, -.ui-dialog .data { - word-wrap: break-word; - table-layout: fixed; -} -#cross_sell_product_grid table.data th, -#up_sell_product_grid table.data th, -#related_product_grid table.data th, -#productGrid_table th, -#setGrid_table th, -#attributeGrid_table th, -.ui-dialog .data th { - word-wrap: normal; - overflow: hidden; - vertical-align: top; -} -#cross_sell_product_grid table.data th > span, -#up_sell_product_grid table.data th > span, -#related_product_grid table.data th > span, -#productGrid_table th > span, -#customerGrid_table th > span, -#setGrid_table th > span, -#attributeGrid_table th > span, -.ui-dialog .data th > span { - white-space: normal; -} -table .col-draggable .draggable-handle { - position: relative; - top: 0; - float: left; -} -.grid table .col-id { - text-align: left; -} -/* - Data table --------------------------------------- */ -.data-table { - border-collapse: separate; - /* do not remove this! without this rule in FF when table has only 1 row bottom and side borders disappear*/ - width: 100%; -} -.data-table thead, -.data-table tfoot, -.data-table th, -.accordion .config .data-table thead th, -.accordion .config .data-table tfoot td { - background: #fff; - color: #676056; - font-size: 13px; - font-weight: 600; -} -.data-table th { - border-color: #c9c2b8; - border-width: 0 0 1px; - padding: 7px; -} -.data-table td, -.data-table tbody tr td, -.accordion .config .data-table td { - background: #fff; - padding: 5px 7px; - color: #676056; - font-size: 14px; - font-weight: 400; - vertical-align: middle; - border: solid #eae8e4; - border-width: 0 0 1px; -} -.data-table tbody tr.selected td, -.data-table tbody tr.selected th, -.data-table tbody tr:hover td, -.data-table tbody tr:hover th { - background: #fff; -} -.data-table tbody tr:nth-child(odd) td, -.data-table tbody tr:nth-child(odd):hover td, -.accordion .config .data-table tbody tr:nth-child(odd) td { - background: #fbfaf6; -} -.data-table tbody tr.odd td { - background: #fbfaf6; -} -.data-table tfoot tr:last-child td, -.data-table tfoot tr:last-child th, -.accordion .config .data-table tfoot tr:last-child td { - border: 0; -} -.data-table input[type="text"] { - width: 98%; - padding-left: 1%; - padding-right: 1%; -} -.data-table select { - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - border-radius: 4px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.data-table th.required-entry:after, -.data-table td.required-entry:after { - content: '*'; - color: red; -} -.data-table .col-actions .actions-split { - margin-top: 4px; -} -.data-table .col-actions .actions-split [class^='action-'] { - background: none; - border: 1px solid #c8c3b5; - padding: 3px 5px; - color: #bbb3a6; - font-size: 12px; -} -.data-table .col-actions .actions-split [class^='action-']:first-child { - border-right: 0; -} -.data-table .col-actions .actions-split .dropdown-menu { - margin-top: -1px; -} -.data-table .col-actions .actions-split .dropdown-menu a { - display: block; - color: #333; - text-decoration: none; -} -.data-table .col-actions .actions-split.active .action-toggle { - position: relative; - border-bottom-right-radius: 0; - box-shadow: none; - background: #fff; -} -.data-table .col-actions .actions-split.active .action-toggle:after { - position: absolute; - top: 100%; - left: 0; - right: 0; - height: 2px; - margin-top: -1px; - background: #fff; - content: ''; - z-index: 2; -} -.data-table .col-actions .actions-split.active .dropdown-menu { - border-top-right-radius: 0; -} -/* - Data table - alternative view --------------------------------------- */ -.customer-information .data-table, -.order-information .data-table, -.order-account-information .data-table, -.adminhtml-rma-new .data-table { - width: 100%; -} -.customer-information .data-table tbody tr th, -.order-information .data-table tbody tr th, -.order-account-information .data-table tbody tr th, -.adminhtml-rma-new .data-table tbody tr th, -.adminhtml-logging-details .log-details .data-table th, -[class^=" sales-transactions-"] .data-table tbody tr th, -[class^=" sales-"] .order-payment-method .data-table tbody tr th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th { - font-weight: bold; -} -.customer-information .data-table tbody tr td, -.customer-information .data-table tbody tr th, -.order-information .data-table tbody tr td, -.order-information .data-table tbody tr th, -.order-account-information .data-table tbody tr td, -.order-account-information .data-table tbody tr th, -.adminhtml-logging-details .log-details .data-table td, -.adminhtml-logging-details .log-details .data-table th, -[class^=" adminhtml-rma-"] .data-table tbody tr td, -[class^=" adminhtml-rma-"] .data-table tbody tr th, -[class^=" sales-transactions-"] .data-table tbody tr th, -[class^=" sales-transactions-"] .data-table tbody tr td, -[class^=" sales-"] .order-payment-method .data-table tbody tr th, -[class^=" sales-"] .order-payment-method .data-table tbody tr td, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr td { - background-color: #fff; - border: 0; - padding: 9px 10px 10px; - color: #666; - vertical-align: top; -} -.customer-information .data-table tbody tr:nth-child(2n+1) td, -.customer-information .data-table tbody tr:nth-child(2n+1) th, -.order-information .data-table tbody tr:nth-child(2n+1) td, -.order-information .data-table tbody tr:nth-child(2n+1) th, -.order-account-information .data-table tbody tr:nth-child(2n+1) td, -.order-account-information .data-table tbody tr:nth-child(2n+1) th, -.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) td, -.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) th, -[class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) td, -[class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) td, -[class^=" sales-"] .order-payment-method .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-"] .order-payment-method .data-table tbody tr:nth-child(2n+1) td, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr:nth-child(2n+1) td { - background-color: #fbfaf6; -} -/* - Content alignments in tables --------------------------------------- */ -/* left */ -.col-website, -.col-name, -.col-sku, -.col-color, -.col-size, -.col-product, -.col-comment, -.col-actions, -.col-status { - text-align: left; -} -/* center */ -.col-include, -.col-display, -.col-image, -.col-no-records, -.col-select, -.col-default, -.col-uqty { - text-align: center; -} -/* right */ -.col-qty, -.col-weight, -.col-price, -.col-price > input, -.col-id, -.col-total, -.col-average { - text-align: right; -} -/* - Attribute Information --------------------------------------- */ -.data-table .col-default { - white-space: nowrap; - text-align: center; - vertical-align: middle; -} -.data-table .col-delete { - text-align: center; - width: 32px; -} -.data-table .col-file { - white-space: nowrap; -} -.data-table .col-file input { - margin: 0 5px; - width: 40%; -} -.data-table .col-file input:first-child { - margin-left: 0; -} -/* - Website store views tree --------------------------------------- */ -.store-tree .website-name { - font-size: 14px; - font-weight: bold; -} -.store-tree .webiste-groups { - margin: 5px 0 20px 18px; -} -.store-tree .webiste-groups dt { - font-weight: bold; -} -.store-tree .webiste-groups dd { - margin: 5px 0 15px 15px; -} -.store-tree .webiste-groups dd > ul { - list-style: none; - margin: 0; - padding: 0; -} -.store-tree .webiste-groups dd > ul > li { - margin: 0 0 5px; -} -/* - Customer Reviews --------------------------------------- */ -.field-detailed_rating .control-value { - padding: 0; -} -.field-detailed_rating .nested { - padding: 0; -} -.field-detailed_rating .field-rating { - margin: 15px 0 0 0; -} -.field-detailed_rating .field-rating:first-child { - margin-top: 0; -} -.field-detailed_rating .field-rating .label { - width: 75px; -} -.field-detailed_rating .field-rating .control { - unicode-bidi: bidi-override; - direction: rtl; - width: 125px; -} -.field-detailed_rating input[type="radio"] { - display: none; -} -.field-detailed_rating .field-rating .control label { - color: #ccc; - cursor: pointer; - font-size: 18px; - float: right; - overflow: hidden; - white-space: nowrap; - width: 18px; - -webkit-transition: color 150ms linear; - -moz-transition: color 150ms linear; - -o-transition: color 150ms linear; - -ms-transition: color 150ms linear; - transition: color 150ms linear; -} -/* - Tree Store Scope --------------------------------------- */ -.tree-store-scope .buttons-set { - margin-bottom: 9px; -} -.tree-store-scope .buttons-set button { - margin-right: 4px; -} -.tree-store-scope .field { - margin: 0 0 5px; -} -.tree-store-scope [class^="field field-website_"] .label, -.tree-store-scope [class^="field field-group_"] .label, -.tree-store-scope [class^="field field-w_"] .label, -.tree-store-scope [class^="field field-sg_"] .label { - text-align: left; - font-size: 18px; - padding-right: 0; - width: auto; -} -.tree-store-scope [class^="field field-group_"] .label, -.tree-store-scope [class^="field field-sg_"] .label { - padding-left: 20px; -} -.tree-store-scope .field input[type="checkbox"] { - margin-right: 3px; - position: relative; - top: 2px; -} -.tree-store-scope .field .addafter { - display: inline-block; - padding-top: 6px; -} -.tree-store-scope .tooltip .help { - margin-top: 11px; -} -/* - Product Massaction page - TODO: css code below should be removed after element.html refactoring --------------------------------------- */ -.attributes-edit-form .attribute-change-checkbox { - white-space: nowrap; - display: block; -} -.attributes-edit-form .attribute-change-checkbox > label > input { - width: auto; -} -.attributes-edit-form .field:last-child, -.attributes-edit-form .field-name, -.attributes-edit-form .field.type-price, -.attributes-edit-form .field-price, -.attributes-edit-form .field-special_price, -.attributes-edit-form .field-meta_title, -.attributes-edit-form .field-visibility, -.attributes-edit-form .field-custom_design, -.attributes-edit-form .field-page_layout, -.attributes-edit-form .field-options_container, -.attributes-edit-form .field-country_of_manufacture, -.attributes-edit-form .field-msrp_display_actual_price_type, -.attributes-edit-form .field-tax_class_id, -.attributes-edit-form .field-is_returnable, -.attributes-edit-form .field-msrp, -.attributes-edit-form .field-gift_wrapping_price { - margin-bottom: 50px; -} -.attributes-edit-form .field .control { - position: relative; -} -.attributes-edit-form .field-name .attribute-change-checkbox, -.attributes-edit-form .field-meta_title .attribute-change-checkbox, -.attributes-edit-form .field-gift_wrapping_price .attribute-change-checkbox, -.attributes-edit-form .field .control select + .addafter { - position: absolute; - left: 0; - top: 35px; -} -.attributes-edit-form .field.type-price .attribute-change-checkbox, -.attributes-edit-form .field-price .attribute-change-checkbox, -.attributes-edit-form .field-special_price .attribute-change-checkbox, -.attributes-edit-form .field-msrp .attribute-change-checkbox { - position: absolute; - top: 35px; -} -.attributes-edit-form .field-special_from_date > .control .input-text, -.attributes-edit-form .field-special_to_date > .control .input-text, -.attributes-edit-form .field-news_from_date > .control .input-text, -.attributes-edit-form .field-news_to_date > .control .input-text, -.attributes-edit-form .field-custom_design_from > .control .input-text, -.attributes-edit-form .field-custom_design_to > .control .input-text { - border-width: 1px; - border-radius: 4px; - width: 130px; -} -.attributes-edit-form .field-special_from_date .attribute-change-checkbox, -.attributes-edit-form .field-special_to_date .attribute-change-checkbox, -.attributes-edit-form .field-news_from_date .attribute-change-checkbox, -.attributes-edit-form .field-news_to_date .attribute-change-checkbox, -.attributes-edit-form .field-custom_design_from .attribute-change-checkbox, -.attributes-edit-form .field-custom_design_to .attribute-change-checkbox { - margin-top: 5px; -} -.attributes-edit-form .field-weight .fields-group-2 .control { - width: 160px; -} -.attributes-edit-form .field-weight .fields-group-2 .control > input { - width: 130px; - float: left; -} -.attributes-edit-form .field-weight .fields-group-2 .control > input + .addafter { - position: absolute; - top: 35px; -} -.attributes-edit-form .field-weight .fields-group-2 .control .addafter strong { - line-height: 26px; -} -.attributes-edit-form .field .control select { - border-radius: 4px; -} -.attributes-edit-form .field-gift_message_available .addon > .select, -.attributes-edit-form .field-gift_wrapping_available .addon > .select { - margin-bottom: 25px; -} -.attributes-edit-form .field-gift_message_available .addon > input[type="checkbox"], -.attributes-edit-form .field-gift_wrapping_available .addon > input[type="checkbox"] { - width: auto; - margin-right: 5px; -} -/* - Widgets --------------------------------------- */ -.widget-layout-updates .fieldset-wrapper, -.widget-layout-updates .data-table { - margin: 0 0 18px; -} -.widget-layout-updates .fieldset-wrapper-title label { - padding: 10px 0 0; -} -.widget-layout-updates .fieldset-wrapper-title select { - margin: 3px 10px 5px; -} -.widget-layout-updates .fieldset-wrapper-title span, -.widget-layout-updates .fieldset-wrapper-title select { - vertical-align: middle; -} -.widget-layout-updates .data-table { - table-layout: fixed; -} -.widget-layout-updates .data-table, -.widget-layout-updates .data-table tr:nth-child(odd) td, -.widget-layout-updates .data-table tr:nth-child(odd):hover td { - background: none; - border: none; -} -.widget-layout-updates .data-table th, -.widget-layout-updates .data-table tbody td { - border: none; - padding: 5px 10px; -} -.widget-layout-updates .data-table select { - margin: 0; - max-width: 99%; - overflow: hidden; -} -.widget-layout-updates .chooser_container { - padding: 0 10px; - margin-bottom: 18px; -} -.widget-layout-updates .chooser_container p { - margin: 0 0 18px; -} -.widget-layout-updates .chooser_container p img, -.widget-layout-updates .chooser_container p input { - vertical-align: middle; -} -/* - Preview window --------------------------------------- */ -.preview-window { - background: #fff; -} -.preview-window .toolbar { - background: #f5f2ed; - padding: 20px; -} -.preview-window .toolbar .switcher { - margin: 0; -} -.preview-window .toolbar .switcher span { - background: none; - width: auto; -} -/* - Global 'No Products found' block --------------------------------------- */ -.no-products-message { - background: #fbfaf6; - padding: 12px; - text-align: center; - font-size: 12px; - color: #666; - margin-bottom: 13px; -} -/* - WYSIWYG --------------------------------------- */ -.action-wysiwyg { - margin: 10px 0; -} -#catalog-wysiwyg-editor .buttons-set { - margin-bottom: 9px; -} -#catalog-wysiwyg-editor .buttons-set button { - margin-right: 4px; -} -/* - Add Attribute Popup --------------------------------------- */ -#create_new_attribute { - overflow: hidden; -} -#create_new_attribute > .loading-mask { - left: -25px; - top: -50px; -} -.attribute-popup { - background: none; -} -.attribute-popup #edit_form > .fieldset > .legend { - display: none; -} -.attribute-popup .wrapper-popup { - padding: 0; - height: 511px; - overflow-x: hidden; - overflow-y: auto; -} -.attribute-popup .fieldset, -.attribute-popup .fieldset-wrapper { - border: none; - border-radius: 0; - padding: 4px 0 20px; - margin: 0 23px 20px; -} -.attribute-popup .fieldset-wrapper { - border-top: none; -} -.attribute-popup .fieldset-wrapper .fieldset-wrapper-title { - border-bottom: none; -} -.attribute-popup .fieldset-wrapper .fieldset-wrapper-content > .fieldset { - margin-left: 0; - margin-right: 0; -} -.attribute-popup .fieldset > .field > input[type="checkbox"] { - margin-top: 7px; -} -.attribute-popup .fieldset .label { - width: 35%; -} -.attribute-popup .collapsable-wrapper, -#manage-titles-wrapper .fieldset-wrapper-title { - margin-bottom: 0; - padding-bottom: 0; -} -.attribute-popup .collapsable-wrapper .fieldset-wrapper-title > .title:before { - color: #797269; - font-size: 14px; - top: 9px; -} -.attribute-popup form .entry-edit:first-child .fieldset { - border-bottom: 1px solid #dfdcd7; -} -.attribute-popup .fieldset .legend { - border: none; -} -.attribute-popup .page-actions { - position: fixed; - top: auto !important; - left: 0; - right: 0; - bottom: 0; - background: #fff; - padding: 27px 50px 25px 23px; - border-top: 1px solid #dfdcd7; -} -.attribute-popup .page-actions [class^='action-'] { - margin-left: 18px; -} -.attribute-popup #base_fieldset { - padding-top: 20px; -} -.attribute-popup #base_fieldset > .legend { - display: none; -} -.attribute-popup .page-actions #reset, -.attribute-popup .page-actions #reset:hover, -.attribute-popup .page-actions #reset:active, -.attribute-popup .page-actions #reset:focus { - float: right; - vertical-align: middle; - margin: 5px 0 0 18px; -} -.attribute-popup .page-actions-placeholder { - display: none; -} -.attribute-popup .page-actions.fixed .page-actions-inner { - background: #fff; - padding: 0; - min-width: 100%; - max-width: 100%; - min-height: 100%; - margin: 0; -} -.attribute-popup .footer { - display: none; -} -#manage-options-panel > .data-table { - clear: both; -} -.CustomGridView .col-1-layout { - padding: 0; - background: transparent; - border: 0; - border-radius: 0; - max-width: 1300px; - min-width: 960px; -} -.CustomGridAction .grid-actions { - border-radius: 5px 5px 0 0; - margin-top: 20px; - padding: 9px 16px 9px 65px; -} -.CustomGridAction .page-actions.fixed { - left: 0; - margin: 0; - padding: 0 21px; - position: fixed; -} -.CustomGridAction .page-actions { - position: absolute; - z-index: 2; - margin-top: 10px; - margin-left: 15px; - padding: 0; -} -.adminhtml-googleshopping-items-index .grid-title { - border: 1px solid #c0bbaf; - border-bottom: 0; - background: #f6f3ec; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f6f3ec), color-stop(100%, #edeae1)); - background: -webkit-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -o-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -ms-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: linear-gradient(to bottom, #f6f3ec 0%, #edeae1 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f3ec', endColorstr='#edeae1', GradientType=0); - padding: 7px 8px 8px; - position: relative; - float: none; -} -.adminhtml-googleshopping-items-index .grid { - padding-bottom: 25px; -} -.adminhtml-googleshopping-items-index .grid-title .title { - font-size: 18px; -} -.adminhtml-googleshopping-items-index .page-actions { - float: right; -} -.adminhtml-system-backup-index .page-actions.fixed, -.adminhtml-scheduled-operation-index .page-actions.fixed, -.adminhtml-system-currency-index .page-actions.fixed, -.adminhtml-system-currencysymbol-index .page-actions.fixed, -.adminhtml-cache-index .page-actions.fixed, -.adminhtml-system-store-index .page-actions.fixed, -.sales-order-status-index .page-actions.fixed { - background-image: none; - padding: 0 21px; - position: fixed; -} -.catalog-product-index .grid-actions { - padding-left: 90px; -} -.sidebar-actions { - padding: 14px 0; -} -.sidebar-actions button { - margin: 0 0 5px; -} -.sales-order-create-index .grid table .action-configure { - float: right; -} -.adminhtml-system-currency-index .import-service { - float: left; -} -.adminhtml-system-currency-index .page-actions.fixed .import-service { - display: inline-block; - float: none; -} -.fpt-item-container select { - width: 100%; -} -.fpt-item-container select:first-child { - margin-bottom: 8px; -} -.clearfix:before, -.clearfix:after, -[class$="-layout"]:after, -.footer-content:before, -.footer-content:after, -.page-title-inner:before, -.page-title-inner:after, -.tabs-horiz:before, -.tabs-horiz:after, -.actions-split:before, -.actions-split:after, -.page-create-order:before, -.page-create-order:after, -.order-addresses:before, -.order-addresses:after, -.order-methods:before, -.order-methods:after, -.order-summary:before, -.order-summary:after, -.order-methods:before, -.order-methods:after, -.grid-actions:before, -.grid-actions:after, -.fieldset-wrapper-title:before, -.fieldset-wrapper-title:after { - content: ""; - display: table; -} -.clearfix:after, -[class$="-layout"]:after, -.footer-content:after, -.page-title-inner:after, -.tabs-horiz:after, -.actions-split:after, -.page-create-order:after, -.order-addresses:after, -.order-methods:after, -.order-summary:after, -.order-methods:after, -.grid-actions:after, -.fieldset-wrapper-title:after { - clear: both; -} diff --git a/app/design/adminhtml/Magento/backend/less/styles/admin.less b/app/design/adminhtml/Magento/backend/css/admin.less similarity index 70% rename from app/design/adminhtml/Magento/backend/less/styles/admin.less rename to app/design/adminhtml/Magento/backend/css/admin.less index e465516ab3509347c958c6f3fe6e52bcaebda3d0..40733464ee9ad4c1be3e1e202151ed8feb7fedb5 100644 --- a/app/design/adminhtml/Magento/backend/less/styles/admin.less +++ b/app/design/adminhtml/Magento/backend/css/admin.less @@ -21,9 +21,11 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -@import "vars.less"; -@import "base.less"; -@import "../lib/buttons.less"; +/* Backend */ + +@import "../less/styles/vars.less"; +@import "../less/styles/base.less"; +@import "../less/lib/buttons.less"; .dont-use-this-class-big-size { font-size: 18px; @@ -35,14 +37,6 @@ Reset 'button view' for actions -------------------------------------- */ .customer-current-activity .action-refresh, -.pager .action-next, -.pager .action-previous, -.pager .action-next:hover, -.pager .action-previous:hover, -.pager .action-next.disabled:focus, -.pager .action-previous.disabled:focus, -.pager .action-next.disabled:active, -.pager .action-previous.disabled:active, .data-table .action-.delete, .data-table .action-.delete:hover, .data-table .action-.delete:active, @@ -590,14 +584,13 @@ textarea, padding: 4px; margin: 0; background-color: #fff; - height: 28px; + height: 30px; .style9(); - border: 1px solid #ccc; + border: 1px solid #ada89e; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; - border-radius: 4px; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + border-radius: 2px; } textarea, @@ -610,11 +603,11 @@ textarea { } select { - height: 28px; + height: 30px; padding: 4px 4px 5px; margin: 0 0 8px; - border: 1px solid #ccc; - border-radius: 4px; + border: 1px solid #ada89e; + border-radius: 2px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; @@ -837,9 +830,8 @@ input.mage-error ~ .addafter { .fieldset-wrapper, .fieldset { background: #fff; - border: 1px solid #eae6e0; - border-radius: 5px; - margin: 0 0 8px; + border: 0; + margin: 0 0 20px; padding: 5px 18px 18px; position: relative; } @@ -853,7 +845,7 @@ input.mage-error ~ .addafter { -webkit-box-sizing: border-box; box-sizing: border-box; padding: 0; - border-bottom: 1px solid #ededed; + border-bottom: 1px solid #cac3b4; margin: 0 0 18px; } @@ -868,77 +860,66 @@ input.mage-error ~ .addafter { display: inline-block; } -/* Collapsable fieldset-wrapper */ +// +// Collapsable fieldset-wrapper +//-------------------------------------- .collapsable-wrapper { padding-bottom: 2px; -} - -.collapsable-wrapper.opened { - padding-bottom: 18px; -} - -.collapsable-wrapper > .fieldset-wrapper-title { - border-bottom: none; - margin-bottom: 0; -} - -.collapsable-wrapper.opened > .fieldset-wrapper-title { - border-bottom: 1px solid #ededed; - margin-bottom: 18px; -} - -.collapsable-wrapper .fieldset-wrapper-title > .title { - position: relative; - padding-left: 22px; - cursor: pointer; - float: left; -} - -.collapsable-wrapper .fieldset-wrapper-title > .title:before { - position: absolute; - left: 0; - top: 7px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02a'; /* arrow right icon */ - color: #b2b0ad; -} - -.collapsable-wrapper.opened > .fieldset-wrapper-title > .title:before { - content: '\e02c'; /* arrow down icon */ -} - -.collapsable-wrapper .fieldset-wrapper-title > .title:hover:before { - color: #7e7e7e; + > .fieldset-wrapper-title { + border-bottom: 1px solid #cac3b4; + margin-bottom: 0; + > .title { + position: relative; + padding-left: 22px; + cursor: pointer; + float: left; + &:before { + position: absolute; + left: 0; + top: 11px; + font-family: 'MUI-Icons'; + font-size: 16px; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + content: '\e02a'; // arrow right icon + color: #b2b0ad; + } + &:hover:before { + color: #7e7e7e; + } + } + } + &.opened { + padding-bottom: 18px; + > .fieldset-wrapper-title { + //border-bottom: 1px solid #ededed; + margin-bottom: 18px; + > .title:before { + content: '\e02c'; // arrow down icon + } + } + } } /* Fieldset styles in another fieldset */ .fieldset .fieldset-wrapper, .fieldset-wrapper .fieldset-wrapper { - border-color: #cccbca; + border: 1px solid #cac3b4; + border-radius: 2px; padding: 0; } .fieldset .fieldset-wrapper .fieldset-wrapper-title, .fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title { - background: #f4f2ef; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y0ZjJlZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZWViZTYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f2ef), color-stop(100%, #eeebe6)); - background: -webkit-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -o-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: -ms-linear-gradient(top, #f4f2ef 0%, #eeebe6 100%); - background: linear-gradient(to bottom, #f4f2ef 0%, #eeebe6 100%); + background:#f7f3eb; padding: 0 18px; - border-radius: 5px; + border: 0; } .fieldset .fieldset-wrapper.opened .fieldset-wrapper-title, .fieldset-wrapper .fieldset-wrapper.opened .fieldset-wrapper-title { - border-radius: 5px 5px 0 0; border-bottom: 1px solid #cccbca; -webkit-touch-callout: none; -webkit-user-select: none; @@ -950,7 +931,7 @@ input.mage-error ~ .addafter { .fieldset .fieldset-wrapper .fieldset-wrapper-title .actions, .fieldset-wrapper .fieldset-wrapper .fieldset-wrapper-title .actions { - padding: 10px 2px 0 0; + padding: 6px 0 0 0; } .fieldset .fieldset-wrapper .fieldset-wrapper-title .title, @@ -1074,7 +1055,7 @@ input.mage-error ~ .addafter { .fieldset .control .textarea, .fieldset .control .addon .textarea { - border-radius: 4px; + border-radius: 2px; width: 100%; } @@ -1231,58 +1212,60 @@ input.mage-error ~ .addafter { padding: 0; } -/* - Form item with table --------------------------------------- */ - -.with-table .label { - float: none; - text-align: left; - width: 100%; -} - -.with-table .control { - clear: left; - float: none; - width: 100%; -} - -/* - Form currency label --------------------------------------- */ - -.addon input { - border-width: 1px 0 1px 1px; -} - -.addon input:focus ~ .addafter { - border-color: #75b9f0; - box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); -} - -.addon input ~ .addafter strong { - display: inline-block; - background: #fff; - line-height: 24px; - margin: 0 3px 0 -2px; - padding-left: 4px; - padding-right: 4px; - position: relative; - font-size: 12px; - top: 0; -} - -.addon input:focus ~ .addafter strong { - margin-top: 0; +// +// Form item with table +// -------------------------------------- + +.with-table { + .label { + float: none; + text-align: left; + width: 100%; + } + .control { + clear: left; + float: none; + width: 100%; + } } -.addon .addafter { - background: none; - color: #a6a6a6; - border-width: 1px 1px 1px 0; - border-radius: 4px 4px 0 0; - padding: 0; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.075) inset; +// +// Form currency label +// -------------------------------------- + +.addon { + input { + border-width: 1px 0 1px 1px; + ~ .addafter strong { + display: inline-block; + background: #fff; + line-height: 24px; + margin: 0 3px 0 -2px; + padding-left: 4px; + padding-right: 4px; + position: relative; + font-size: 12px; + top: 0; + } + &:focus ~ .addafter { + border-color: #75b9f0; + box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); + strong { + margin-top: 0; + } + } + } + .addafter { + background: none; + color: #a6a6a6; + border-width: 1px 1px 1px 0; + border-radius: 2px 2px 0 0; + padding: 0; + border-color: #ada89e; + } + .pager input { + border-width: 1px; + } } .field .control input[type='text'][disabled], @@ -1319,14 +1302,14 @@ input.mage-error ~ .addafter { .field-special_price .addon .addafter, .field-msrp .addon .addafter { border-width: 1px 0 1px 1px; - border-radius: 4px 0 0 4px; + border-radius: 2px 0 0 2px; } .field.type-price .addon input:first-child, .field-price .addon input:first-child, .field-special_price .addon input:first-child, .field-msrp .addon input:first-child { - border-radius: 0 4px 4px 0; + border-radius: 0 2px 2px 0; } .field.type-price input, @@ -1334,7 +1317,6 @@ input.mage-error ~ .addafter { .field-special_price input, .field-msrp input { border-width: 1px 1px 1px 0; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.075) inset; } .field.type-price input:focus, @@ -1433,80 +1415,6 @@ address { font-style: normal; } -/* - Tables --------------------------------------- */ -table > caption { - margin-bottom: 5px; -} - -table tfoot, -table th { - background: #e6e6e6; -} - -table tfoot, -table thead { - background: #666158; - color: #cac3b4; -} - -table thead.active { - /*background:#F37B21;*/ -} - -table th { - text-align: left; - background: transparent; - font-weight: normal; -} - -table th, -table td { - border: 1px solid #C0BBAF; - padding: 6px 10px 7px; -} - -table tbody tr td { - background: #F5F2ED; - color: @primary1; - padding-top: 12px; -} - -table tbody tr:not(:last-child) td { - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; -} - -table .dropdown-menu li { - padding: 7px 15px; - line-height: 14px; - cursor: pointer; -} - -table tbody tr td:first-child input[type="checkbox"] { - margin: 0; -} - -table tbody tr:nth-child(odd) td, -table tbody tr:nth-child(odd) th { - background-color: #E6E3DE; -} - -table tbody tr.selected td, -table tbody tr.selected th { - border: 1px solid #C0BBAF; -} - -table tbody tr.selected td, -table tbody tr.selected th, -table tbody tr:hover td, -table tbody tr:hover th, -table tbody tr:nth-child(odd):hover td, -table tbody tr:nth-child(odd):hover th { - background-color: #fff; -} - /* X-tree styles -------------------------------------- */ @@ -2110,7 +2018,10 @@ table tbody tr:nth-child(odd):hover th { } .page-content > .page-title { - + max-width: 1300px; + min-width: 960px; + margin-left: auto; + margin-right: auto; } .page-title-inner > .title { @@ -2494,6 +2405,7 @@ table tbody tr:nth-child(odd):hover th { } .side-col { + padding-bottom: 20px; position: relative; width: 20%; } @@ -2516,75 +2428,48 @@ table tbody tr:nth-child(odd):hover th { float: right; } -.col-1-layout .main-col { - width: auto; -} - -.col-2-left-layout .main-col, -.col-2-right-layout .side-col { - float: right; -} - -.col-2-right-layout .main-col, -.col-2-left-layout .side-col { - float: left; +.col-1-layout { + .main-col { + width: auto; + } } .col-2-left-layout, .col-1-layout { - position: relative; - background: #f5f2ed; - border: 1px solid #d5d0ca; + background: #f7f3eb; margin: 0 auto; + position: relative; } -.col-1-layout { - padding: 20px; -} - -.col-2-left-layout:before { - position: absolute; - display: block; - left: 20%; - top: 0; - bottom: 0; - width: 6px; - margin-left: -7px; - content: ''; - background: -moz-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0.06))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); /* IE10+ */ - background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%); /* W3C */ - z-index: 2; -} - -/* Sidebar and main column vertical separator */ -.main-col:after, -.side-col:after { - position: absolute; - top: 0; - bottom: 0; - width: 1px; - background: #ded9d3; - content: ''; -} - -.col-2-left-layout .side-col:after { - right: 0; -} - -.col-2-right-layout .side-col:after { - left: 0; -} - -.col-2-right-layout .main-col:after { - right: -1px; +.col-2-left-layout { + padding-top: 20px; + &:before { + position: absolute; + content: ""; + background-color: #fff; + right:0; + top: 0; + bottom: 0; + min-width: 730px; + width: 80%; + } + .main-col { + padding-right: 0; + padding-left: 0; + float: right; + } + .side-col { + float: left; + } } -.col-2-left-layout .main-col:after { - left: -1px; +.col-2-right-layout { + .side-col { + float: right; + } + .main-col { + float: left; + } } .col-2-left-layout .main-col, @@ -2705,7 +2590,7 @@ table tbody tr:nth-child(odd):hover th { -webkit-font-smoothing: antialiased; content: '\e02b'; /* left turned triangle icon */ font-size: 22px; - color: #f5f2ed; + color: #fff; overflow: hidden; z-index: 4; } @@ -2759,6 +2644,9 @@ table tbody tr:nth-child(odd):hover th { /* Horizontal Tabs -------------------------------------- */ +.ui-tabs { + clear: both; +} .tabs-horiz { list-style: none; margin: 0; @@ -2767,26 +2655,21 @@ table tbody tr:nth-child(odd):hover th { .tabs-horiz > li { float: left; - border: 1px solid #e9e4db; - border-bottom-width: 0; - margin: 0 -1px 0 0; + margin: 0 5px 0 0; } -.tabs-horiz > li a { +.tabs-horiz .ui-tabs-anchor { position: relative; display: block; - padding: 7px 18px 9px; text-decoration: none; - font-size: 12px; - line-height: 1.666; - color: #676056; + .style7(); + background: #e0dacf; + padding: 11px 15px 13px; + border-radius: 2px 2px 0 0; } -.tabs-horiz > .ui-state-active a { +.tabs-horiz > .ui-state-active .ui-tabs-anchor { background: #fff; - border-top: 3px solid #f3771e; - margin-top: -3px; - box-shadow: 1px 0 3px #e9e4db; } /* @@ -2862,7 +2745,7 @@ table tbody tr:nth-child(odd):hover th { content: '\e02b'; /* left turned triangle icon */ font-size: 22px; text-shadow: -1px 1px 0 #bdbbb7; - color: #f5f2ed; + color: #fff; overflow: hidden; z-index: 3; } @@ -2968,1113 +2851,172 @@ table tbody tr:nth-child(odd):hover th { padding-top: 0; } -/* TODO: refactor trees */ +[class^=" catalog-product-"] .store-scope .store-tree { + float: left; +} + +// TODO: refactor trees .x-tree ul { margin: 0; padding: 0; } -/* - Table Grid --------------------------------------- */ - -/* Grid - General */ -.grid-container { - margin-bottom: 10px; -} - -.grid { - border-bottom: 0; - .style18(); - padding-bottom: .5em; +.page-actions.fixed .page-actions-inner:before { + content: attr(data-title); + float: left; + font-size: 20px; + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } -.grid table { - border-collapse: collapse; - border: none; - width: 100%; +/* Dynamic Grid */ +/* Used in pages like Catalog -> Attributes */ +.dynamic-grid th { + padding: 2px; + width: 100px; } -.grid table.border { - border: 1px solid #c0bbaf; +.dynamic-grid td { + padding: 2px; } -.grid tbody { - background: #e6e3de; +.dynamic-grid td input { + width: 94px; } -.grid tr.even, .grid tr.even tr { - background: #f5f2ed; +tr.dynamic-grid td, +tr.dynamic-grid th { + padding: 2px 10px 2px 0; + width: auto; } -.grid tr.on-mouse { - cursor: pointer; +tr.dynamic-grid input.input-text { + width: 154px; } -.grid tr.on-mouse td, -.grid table tbody tr.on-mouse:hover td, -.grid table tbody tr.on-mouse:hover th, -.grid table tbody tr.on-mouse:nth-child(odd):hover td, -.grid table tbody tr.on-mouse:nth-child(odd):hover th { - background-color: #fff; +.available { + color: #080; + font-weight: bold; } -/* Rows mouse-over */ -.grid tr.invalid { - background-color: #f5d6c7; +.not-available { + color: #800; } -.grid th, .grid td { - padding: 2px 4px 2px 4px; - vertical-align: top; +.categories-side-col { + padding: 0 3%; } -.grid th { - border: none; +// +// Website store views tree +// -------------------------------------- +.store-tree { + .website-name { + font-size: 14px; + font-weight: bold; + } + .webiste-groups { + margin: 5px 0 20px 18px; + dt { + font-weight: bold; + } + dd { + margin: 5px 0 15px 15px; + > ul { + list-style: none; + margin: 0; + padding: 0; + > li { + margin: 0 0 5px; + } + } + } + } } -.grid td.editable input.input-text { - width: 50px; - margin-left: 4px; +// +// Customer Reviews +// -------------------------------------- +.field-detailed_rating { + .control-value { + padding: 0; + } + .nested { + padding: 0; + } + .field-rating { + margin: 15px 0 0 0; + &:first-child { + margin-top: 0; + } + .label { + width: 75px; + } + .control { + unicode-bidi: bidi-override; + direction: rtl; + width: 125px; + label { + color: #ccc; + cursor: pointer; + font-size: 18px; + float: right; + overflow: hidden; + white-space: nowrap; + width: 18px; + -webkit-transition: color 150ms linear; + -moz-transition: color 150ms linear; + -o-transition: color 150ms linear; + -ms-transition: color 150ms linear; + transition: color 150ms linear; + } + } + } + input[type="radio"] { + display: none; + } } -.grid td input.input-text { - width: 86%; -} - -.grid td input.input-inactive { - background: #eee; -} - -.grid table td { - border: solid #c0bbaf; - border-width: 0 1px 1px; - padding: 5px; -} - -.grid table.border td { - background: #fff; -} - -.grid table td.product { - text-align: right; -} - -.grid table td.empty-text { - border: solid #c0bbaf; - border-width: 0 1px; - .style7(); - text-align: center; - padding: 15px; -} -.grid table tr:last-child td.empty-text { - border-width: 0 1px 1px; -} - -.grid table td.empty-text:hover { - background: #e6e3de; -} - -.grid table td .action-select { - width: 100%; -} - -.grid tbody.odd tr { - background: #fff; -} - -.grid tbody.even tr { - background: #f6f6f6; -} - -.grid tbody.odd tr td, -.grid tbody.even tr td { - border-bottom: 0; -} - -.grid tbody.odd tr.border td, -.grid tbody.even tr.border td { - border-bottom: 1px solid #dadfe0; -} - -/* - Grid - Pager and Buttons row --------------------------------------- */ -.grid-actions { - border: 1px solid #c0bbaf; - border-bottom: 0; - background: rgb(246, 243, 236); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(246, 243, 236, 1)), color-stop(100%, rgba(237, 234, 225, 1))); - background: -webkit-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -o-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -ms-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: linear-gradient(to bottom, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f3ec', endColorstr='#edeae1', GradientType=0); - padding: 7px 8px 8px; - position: relative; -} - -[id$='Grid'] .separator { - padding: 0 4px; - color: #b9b9b9; -} - -.grid-actions select { - margin: 0 5px; -} - -.grid-actions .export, -.grid-actions .filter-actions { - float: right; - margin-left: 30px; -} - -.grid-actions .filter-actions button { - float: left; - margin-left: 4px; -} - -.grid-actions .pager { - .style18(); -} - -.grid-actions .pager select { - width: 5em; - margin: 0 4px; -} - -.grid-actions .pager input.page { - width: 2em; -} - -.pager .action-next, -.pager .action-previous { - display: inline-block; - position: relative; - text-indent: 100%; - overflow: hidden; - height: 16px; - width: 16px; - vertical-align: middle; - text-decoration: none; -} - -.pager .action-next:after, -.pager .action-previous:after { - font-family: 'MUI-Icons'; - content: "\e02a"; - font-size: 16px; - color: #333; - position: absolute; - top: 0; - left: 0; - line-height: 1; - text-indent: 0; -} - -.pager .action-previous:after { - content: "\e02b"; -} - -.pager span.action-next:after, -.pager span.action-previous:after { - color: #7f7f7f; -} - -.grid-actions .date { - float: left; - margin: 0 15px 0 0; - position: relative; -} - -.grid-actions .date input { - margin: 0 5px; - width: 80px; -} - -.grid-actions .required:after { - content: '*'; - color: #f00; -} - -[class^=" reports-report-"] { - .grid-actions .required:after { - content: ''; - } - .grid-actions .required .label span:after { - content: '*'; - color: #f00; - } -} - -.grid-actions img { - vertical-align: middle; - height: 22px; - width: 22px; -} - -.grid-actions .pager img { - width: auto; - height: auto; -} - -.grid-actions .validation-advice { - background: #f3dcd8; - border: 1px solid #963535; - border-radius: 3px; - color: #963535; - margin: 5px 0 0; - padding: 3px 7px; - position: absolute; - white-space: nowrap; - z-index: 5; -} - -.grid-actions .validation-advice:before { - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e029'; /* user icon */ - position: absolute; - top: -12px; - left: 50%; - margin-left: -3px; -} - -.grid-actions .link-feed { - white-space: nowrap; -} - -.grid-actions input[type="text"].validation-failed { - border-color: #fa7973; - box-shadow: 0 0 8px rgba(250, 121, 115, 0.6); -} - -/* - Grid - Headings --------------------------------------- */ -.grid tr.headings th { - .style29(); - border-right: 1px solid #837f79; - padding: 0; - vertical-align: bottom; -} - -.grid tr th:first-child { - border-left: 1px solid #837f79; -} - -.grid tr.headings th > span { - display: block; - border-bottom: 2px solid transparent; - padding: 5px 5px 2px; - white-space: nowrap; -} - -.grid tr.headings th:hover > span { - border-color: #504841; -} - -.grid tr.headings th.no-link:hover > span, -.grid tr.headings th.col-select:hover > span { - border-color: transparent; -} - -.grid tr.headings th a label { - display: block; - padding-right: 20px; -} - -.grid tr.headings th a { - display: block; - .style29(); - position: relative; - text-decoration: none; -} - -.grid tr.headings th a:after { - display: none; - height: 8px; - width: 15px; - position: absolute; - bottom: 4px; - right: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - font-size: 20px; - line-height: 8px; - -webkit-font-smoothing: antialiased; - content: '\e038'; /* arrow down icon */ - color: #8c8172; -} - -.grid tr.headings th a:hover:after { - display: block; -} - -.grid tr.headings th a.sort-arrow-desc:after { - color: #c7b299; - display: block; -} - -.grid tr.headings th a.sort-arrow-asc:after { - color: #c7b299; - content: '\e035'; /* arrow up icon */ - display: block; -} - -.grid tr.headings th a.sort-arrow-desc:hover:after, -.grid tr.headings th a.sort-arrow-asc:hover:after { - color: #fff; -} - -/* Grid - Filter */ -.grid .filter { - cursor: default; -} - -.grid .filter th { - padding: 5px; - border-right: 1px solid #837F79; - vertical-align: top; - white-space: normal; -} - -.grid .filter input.input-text { - background: #5e5a52; - border-radius: 2px; - border: none; - color: #bcb795; - padding: 0 5px; - height: 20px; - width: 99%; -} - -.grid .filter input.input-text::-webkit-input-placeholder { - color: #858376 !important; - text-transform: lowercase; -} - -.grid .filter input.input-text:-moz-placeholder { - color: #858376 !important; - text-transform: lowercase; -} - -.grid .filter input.input-text::-moz-placeholder { - color: #858376 !important; - text-transform: lowercase; -} - -:-ms-input-placeholder { - color: #858376 !important; - text-transform: lowercase; -} - -.grid .filter select { - background: #5e5a52; - border-radius: 2px; - border: none; - color: #bcb795; - margin: 0; - padding: 0; - height: 20px; - width: 99%; -} - -.grid td select { - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - padding: 4px 4px 5px; - text-align: left; -} - -.grid .action-select { - background: #fff; - border: 1px solid #ccc; - margin: 0; -} - -.grid .filter .range .range-line { - margin-bottom: 3px; -} - -.grid .filter .range div.date { - min-width: 121px; -} - -.grid .filter .range .date input { - margin-top: 0; - vertical-align: middle; - width: 80%; -} - -.grid .filter .range select { - margin: 0; - .style14(); - color: #bcb795; -} - -.grid .filter .date { - position: relative; -} - -.grid .filter .date img { - width: 15px; - height: 15px; - cursor: pointer; - vertical-align: middle; - margin-left: 5px; - position: relative; - z-index: 2; - opacity: 0; -} - -.grid .filter .date:before { - position: absolute; - left: 80%; - top: 1px; - margin-left: 5px; - text-shadow: none; - width: 16px; - height: 16px; - line-height: 16px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - font-size: 16px; - content: '\e06a'; /* icon calendar */ - color: #cac3b4; - z-index: 1; -} - -.grid .head-massaction select { - width: 50px; -} - -/* Grid - Mass Action */ -.massaction { - color: #cac3b4; - padding: 7px 8px; - background: #666158; - box-shadow: 0 1px 2px 0 #504d46 inset, 0 -1px 2px 0 #504d46 inset; - overflow: hidden; -} - -.massaction ul { - list-style: none; - margin: 0; - padding: 6px 0 0; -} - -.massaction li { - display: inline-block; -} - -.massaction li:before { - color: #837F79; - content: '|'; - display: inline-block; - margin: 0 5px; -} - -.massaction li:first-child:before { - display: none; -} - -.massaction .entry-edit { - float: right; - display: inline-block; -} - -.massaction .entry-edit fieldset { - margin: 0; - padding: 0; - background: none; - border: none; -} - -.massaction .entry-edit fieldset select { - border-radius: 2px; - margin: 0; -} - -.massaction .entry-edit fieldset select.validation-failed { - border: 1px dashed #eb340a; - background: #faebe7; -} - -.massaction .entry-edit .field-row { - display: inline-block; - vertical-align: middle; -} - -.massaction .entry-edit .outer-span .entry-edit { - float: none; -} - -.massaction .entry-edit .field-row label { - color: #cac3b4; - line-height: 26px; - margin: 0 5px 0 20px; - padding: 0; - vertical-align: middle; - width: auto; - float: none; -} - -.massaction .entry-edit .validation-advice { - display: none !important; -} - -.massaction a { - color: #e7e2d7; - text-decoration: none; -} - -.massaction a:hover { - color: #fff; -} - -/* Grid Footer */ -.grid table tfoot tr { - background: #656156; -} - -.grid table tfoot tr th, -.grid table tfoot tr td { - border-right: 1px solid #837f79; - line-height: 1.7em; - padding: 3px 10px; -} - -.grid table tfoot tr th:first-child, -.grid table tfoot tr td:first-child { - border-left: 1px solid #837f79; -} - -.grid table.border tfoot tr td { - background: #656156; -} - -.grid .col-price, -.grid .col-number { - text-align: right; -} - -/* Dynamic Grid */ -/* Used in pages like Catalog -> Attributes */ -.dynamic-grid th { - padding: 2px; - width: 100px; -} - -.dynamic-grid td { - padding: 2px; -} - -.dynamic-grid td input { - width: 94px; -} - -tr.dynamic-grid td, -tr.dynamic-grid th { - padding: 2px 10px 2px 0; - width: auto; -} - -tr.dynamic-grid input.input-text { - width: 154px; -} - -.available { - color: #080; - font-weight: bold; -} - -.not-available { - color: #800; -} - -.categories-side-col { - padding: 0 3%; -} - -/* - TODO: change ids to 'table.data' after refactoring of all templates for grids - Manage Products Grid --------------------------------------- */ -#cross_sell_product_grid table.data, -#up_sell_product_grid table.data, -#related_product_grid table.data, -#productGrid_table, -#setGrid_table, -#attributeGrid_table, -.ui-dialog .data { - word-wrap: break-word; - table-layout: fixed; -} - -#cross_sell_product_grid table.data th, -#up_sell_product_grid table.data th, -#related_product_grid table.data th, -#productGrid_table th, -#setGrid_table th, -#attributeGrid_table th, -.ui-dialog .data th { - word-wrap: normal; - overflow: hidden; - vertical-align: top; -} - -#cross_sell_product_grid table.data th > span, -#up_sell_product_grid table.data th > span, -#related_product_grid table.data th > span, -#productGrid_table th > span, -#customerGrid_table th > span, -#setGrid_table th > span, -#attributeGrid_table th > span, -.ui-dialog .data th > span { - white-space: normal; -} - -///* will be deleted after checking entire back-end -//table .col-draggable { -// width: 1%; -//} -// -//table .col-default, -//table .col-select, -//table .col-qty, -//table .col-actions, -//table .col-action, -//table .col-id, -//table .col-uqty.qty-box { -// width: 5%; -//} -// -//table .col-visibility, -//table .col-status, -//table .col-websites, -//table .col-position { -// width: 7%; -//} -// -//table .col-type, -//table .col-price, -//table .col-attr-name { -// width: 8%; -//} -// -//table .col-name, -//table .col-sku { -// width: 15%; -//} -// -//table .col-attribute_code, -//table .col-frontend_label { -// width: 25%; -//} -// -//.ui-dialog .selection-search table .col-select { -// width: 25%; -//} -//*/ - -table .col-draggable .draggable-handle { - position: relative; - top: 0; - float: left; -} - -.grid table .col-id { - text-align: left; -} - -/* - Data table --------------------------------------- */ -.data-table { - border-collapse: separate; /* do not remove this! without this rule in FF when table has only 1 row bottom and side borders disappear*/ - width: 100%; -} - -.data-table thead, -.data-table tfoot, -.data-table th, -.accordion .config .data-table thead th, -.accordion .config .data-table tfoot td { - background: #fff; - .style2(); -} - -.data-table th { - border-color: #c9c2b8; - border-width: 0 0 1px; - padding: 7px; -} - -.data-table td, -.data-table tbody tr td, -.accordion .config .data-table td { - background: #fff; - padding: 5px 7px; - .style9(); - vertical-align: middle; - border: solid #eae8e4; - border-width: 0 0 1px; -} - -.data-table tbody tr.selected td, -.data-table tbody tr.selected th, -.data-table tbody tr:hover td, -.data-table tbody tr:hover th { - background: #fff; -} - -.data-table tbody tr:nth-child(odd) td, -.data-table tbody tr:nth-child(odd):hover td, -.accordion .config .data-table tbody tr:nth-child(odd) td { - background: #fbfaf6; -} - -.data-table tbody tr.odd td { - background: #fbfaf6; -} - -.data-table tfoot tr:last-child td, -.data-table tfoot tr:last-child th, -.accordion .config .data-table tfoot tr:last-child td { - border: 0; -} - -.data-table input[type="text"] { - width: 98%; - padding-left: 1%; - padding-right: 1%; -} - -.data-table select { - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - border-radius: 4px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.data-table th.required-entry:after, -.data-table td.required-entry:after { - content: '*'; - color: red; -} - -.data-table .col-actions .actions-split { - margin-top: 4px; -} - -.data-table .col-actions .actions-split [class^='action-'] { - background: none; - border: 1px solid #c8c3b5; - padding: 3px 5px; - color: #bbb3a6; - font-size: 12px; -} - -.data-table .col-actions .actions-split [class^='action-']:first-child { - border-right: 0; -} - -.data-table .col-actions .actions-split .dropdown-menu { - margin-top: -1px; -} - -.data-table .col-actions .actions-split .dropdown-menu a { - display: block; - color: #333; - text-decoration: none; -} - -.data-table .col-actions .actions-split.active .action-toggle { - position: relative; - border-bottom-right-radius: 0; - box-shadow: none; - background: #fff; -} - -.data-table .col-actions .actions-split.active .action-toggle:after { - position: absolute; - top: 100%; - left: 0; - right: 0; - height: 2px; - margin-top: -1px; - background: #fff; - content: ''; - z-index: 2; -} - -.data-table .col-actions .actions-split.active .dropdown-menu { - border-top-right-radius: 0; -} - -/* - Data table - alternative view --------------------------------------- */ -.customer-information .data-table, -.order-information .data-table, -.order-account-information .data-table, -.adminhtml-rma-new .data-table { - width: 100%; -} - -.customer-information .data-table tbody tr th, -.order-information .data-table tbody tr th, -.order-account-information .data-table tbody tr th, -.adminhtml-rma-new .data-table tbody tr th, -.adminhtml-logging-details .log-details .data-table th, -[class^=" sales-transactions-"] .data-table tbody tr th, -[class^=" sales-"] .order-payment-method .data-table tbody tr th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th { - font-weight: bold; -} - -.customer-information .data-table tbody tr td, -.customer-information .data-table tbody tr th, -.order-information .data-table tbody tr td, -.order-information .data-table tbody tr th, -.order-account-information .data-table tbody tr td, -.order-account-information .data-table tbody tr th, -.adminhtml-logging-details .log-details .data-table td, -.adminhtml-logging-details .log-details .data-table th, -[class^=" adminhtml-rma-"] .data-table tbody tr td, -[class^=" adminhtml-rma-"] .data-table tbody tr th, -[class^=" sales-transactions-"] .data-table tbody tr th, -[class^=" sales-transactions-"] .data-table tbody tr td, -[class^=" sales-"] .order-payment-method .data-table tbody tr th, -[class^=" sales-"] .order-payment-method .data-table tbody tr td, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr td { - background-color: #fff; - border: 0; - padding: 9px 10px 10px; - color: #666; - vertical-align: top; -} - -.customer-information .data-table tbody tr:nth-child(2n+1) td, -.customer-information .data-table tbody tr:nth-child(2n+1) th, -.order-information .data-table tbody tr:nth-child(2n+1) td, -.order-information .data-table tbody tr:nth-child(2n+1) th, -.order-account-information .data-table tbody tr:nth-child(2n+1) td, -.order-account-information .data-table tbody tr:nth-child(2n+1) th, -.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) td, -.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) th, -[class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) td, -[class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) td, -[class^=" sales-"] .order-payment-method .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-"] .order-payment-method .data-table tbody tr:nth-child(2n+1) td, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr:nth-child(2n+1) th, -[class^=" sales-billing-agreement-"] .log-details .data-table tbody tr:nth-child(2n+1) td { - background-color: #fbfaf6; -} - -/* - Content alignments in tables --------------------------------------- */ - -/* left */ -.col-website, -.col-name, -.col-sku, -.col-color, -.col-size, -.col-product, -.col-comment, -.col-actions, -.col-status { - text-align: left; -} - -/* center */ -.col-include, -.col-display, -.col-image, -.col-no-records, -.col-select, -.col-default, -.col-uqty { - text-align: center; -} - -/* right */ -.col-qty, -.col-weight, -.col-price, -.col-price > input, -.col-id, -.col-total, -.col-average { - text-align: right; -} - -/* - Attribute Information --------------------------------------- */ -.data-table .col-default { - white-space: nowrap; - text-align: center; - vertical-align: middle; -} - -.data-table .col-delete { - text-align: center; - width: 32px; -} - -.data-table .col-file { - white-space: nowrap; -} - -.data-table .col-file input { - margin: 0 5px; - width: 40%; -} - -.data-table .col-file input:first-child { - margin-left: 0; -} - -/* - Website store views tree --------------------------------------- */ -.store-tree .website-name { - font-size: 14px; - font-weight: bold; -} - -.store-tree .webiste-groups { - margin: 5px 0 20px 18px; -} - -.store-tree .webiste-groups dt { - font-weight: bold; -} - -.store-tree .webiste-groups dd { - margin: 5px 0 15px 15px; -} - -.store-tree .webiste-groups dd > ul { - list-style: none; - margin: 0; - padding: 0; -} - -.store-tree .webiste-groups dd > ul > li { - margin: 0 0 5px; -} - -/* - Customer Reviews --------------------------------------- */ -.field-detailed_rating .control-value { - padding: 0; -} - -.field-detailed_rating .nested { - padding: 0; -} - -.field-detailed_rating .field-rating { - margin: 15px 0 0 0; -} - -.field-detailed_rating .field-rating:first-child { - margin-top: 0; -} - -.field-detailed_rating .field-rating .label { - width: 75px; -} - -.field-detailed_rating .field-rating .control { - unicode-bidi: bidi-override; - direction: rtl; - width: 125px; -} - -.field-detailed_rating input[type="radio"] { - display: none; -} - -.field-detailed_rating .field-rating .control label { - color: #ccc; - cursor: pointer; - font-size: 18px; - float: right; - overflow: hidden; - white-space: nowrap; - width: 18px; - -webkit-transition: color 150ms linear; - -moz-transition: color 150ms linear; - -o-transition: color 150ms linear; - -ms-transition: color 150ms linear; - transition: color 150ms linear; -} - -/* - Tree Store Scope --------------------------------------- */ -.tree-store-scope .buttons-set { - margin-bottom: 9px; -} - -.tree-store-scope .buttons-set button { - margin-right: 4px; -} - -.tree-store-scope .field { - margin: 0 0 5px; -} - -.tree-store-scope [class^="field field-website_"] .label, -.tree-store-scope [class^="field field-group_"] .label, -.tree-store-scope [class^="field field-w_"] .label, -.tree-store-scope [class^="field field-sg_"] .label { - text-align: left; - font-size: 18px; - padding-right: 0; - width: auto; -} - -.tree-store-scope [class^="field field-group_"] .label, -.tree-store-scope [class^="field field-sg_"] .label { - padding-left: 20px; -} - -.tree-store-scope .field input[type="checkbox"] { - margin-right: 3px; - position: relative; - top: 2px; -} - -.tree-store-scope .field .addafter { - display: inline-block; - padding-top: 6px; -} - -.tree-store-scope .tooltip .help { - margin-top: 11px; +// +// Tree Store Scope +// -------------------------------------- +.tree-store-scope { + .buttons-set { + margin-bottom: 9px; + button { + margin-right: 4px; + } + } + .field { + margin: 0 0 5px; + input[type="checkbox"] { + margin-right: 3px; + position: relative; + top: 2px; + } + .addafter { + display: inline-block; + padding-top: 6px; + } + } + [class^="field field-website_"] .label, + [class^="field field-group_"] .label, + [class^="field field-w_"] .label, + [class^="field field-sg_"] .label { + text-align: left; + font-size: 18px; + padding-right: 0; + width: auto; + } + [class^="field field-group_"] .label, + [class^="field field-sg_"] .label { + padding-left: 20px; + } + .tooltip .help { + margin-top: 11px; + } } /* @@ -4289,6 +3231,104 @@ table .col-draggable .draggable-handle { margin-right: 4px; } +/* + System Messages +-------------------------------------- */ +.message-system { + margin: 0 auto; + overflow: hidden; +} + +.message-system-inner { + background: #f7f3eb; + border: 1px solid #c0bbaf; + border-top: 0; + border-radius: 0 0 5px 5px; + float: right; + overflow: hidden; +} + +.message-system-unread .message-system-inner { + float: none; +} + +.message-system-list { + margin: 0; + padding: 0; + list-style: none; + float: left; +} + +.message-system .message-system-list { + width: 75%; +} + +.message-system-list li { + padding: 5px 13px 7px 36px; + position: relative; +} + +.message-system-short { + padding: 5px 13px 7px; + float: right; +} + +.message-system-short span { + display: inline-block; + margin-left: 7px; + border-left: 1px #d1ccc3 solid; +} + +.message-system-short span:first-child { + border: 0; + margin-left: 0; +} + +.message-system-short a { + padding-left: 27px; + position: relative; + height: 16px; +} + +.message-system .message-system-short a:before, +.message-system-list li:before { + font-family: 'MUI-Icons'; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + height: 16px; + width: 16px; + font-size: 16px; + line-height: 16px; + text-align: center; + position: absolute; + left: 7px; + top: 2px; +} + +.message-system-list li:before { + top: 5px; + left: 13px; +} + +.message-system .message-system-short .warning a:before, +.message-system-list li.warning:before { + content: "\e006"; + color: #f2a825; +} + +.message-system .message-system-short .error a:before, +.message-system-list li.error:before { + content: "\e086"; + font-family: 'MUI-Icons'; + color: #c00815; +} + +.ui-dialog .message-system-list { + margin-bottom: 25px; +} + /* Add Attribute Popup -------------------------------------- */ @@ -4434,12 +3474,7 @@ table .col-draggable .draggable-handle { // Custom grids view .CustomGridView { .col-1-layout { - padding: 0; background: transparent; - border: 0; - border-radius: 0; - max-width: 1300px; - min-width: 960px; } } @@ -4448,7 +3483,7 @@ table .col-draggable .draggable-handle { .grid-actions { border-radius: 5px 5px 0 0; margin-top: 20px; - padding: 9px 16px 9px 65px; + padding: 9px 15px; } .page-actions.fixed { left: 0; @@ -4586,29 +3621,8 @@ table .col-draggable .draggable-handle { // } // Custom page-actions view -.adminhtml-googleshopping-items-index .grid-title, -//.adminhtml-system-backup-index .page-actions, -//.adminhtml-scheduled-operation-index .page-actions, -//.adminhtml-system-currency-index .page-actions -//.adminhtml-system-currencysymbol-index .page-actions, -//.adminhtml-cache-index .page-actions, -//.adminhtml-system-store-index .page-actions, -//.sales-order-status-index .page-actions - { - border: 1px solid #c0bbaf; - border-bottom: 0; - background: rgb(246, 243, 236); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(246, 243, 236, 1)), color-stop(100%, rgba(237, 234, 225, 1))); - background: -webkit-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -o-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -ms-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: linear-gradient(to bottom, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#f6f3ec', endColorstr = '#edeae1', GradientType = 0); - padding: 7px 8px 8px; - position: relative; - float: none; +.adminhtml-googleshopping-items-index .grid-title { + padding: 15px; } .adminhtml-googleshopping-items-index .grid { @@ -4635,8 +3649,8 @@ table .col-draggable .draggable-handle { position: fixed; } -.catalog-product-index .grid-actions { - padding-left: 90px; +.adminhtml-cache-index .additional-cache-management { + margin-bottom: 0; } // .catalog-rule-promo-catalog-index .grid-actions { @@ -4656,14 +3670,6 @@ table .col-draggable .draggable-handle { margin: 0 0 5px; } -.sales-order-create-index .grid table .action-configure { - float: right; -} - -.adminhtml-system-currency-index .import-service { - float: left; -} - .adminhtml-system-currency-index .page-actions.fixed .import-service { display: inline-block; float: none; @@ -4677,6 +3683,85 @@ table .col-draggable .draggable-handle { } } +.eq-ie9 { + .col-1-layout, + .catalog-product-edit, + .sales-order-view, + .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, + .col-1-layout .data, + .sales-order-view .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; + } + } +} + + // Clearfix .clearfix:before, .clearfix:after, diff --git a/app/design/adminhtml/Magento/backend/css/header.css b/app/design/adminhtml/Magento/backend/css/header.css deleted file mode 100644 index 7ea154188d004d2ee803c5958ce263aa34492802..0000000000000000000000000000000000000000 --- a/app/design/adminhtml/Magento/backend/css/header.css +++ /dev/null @@ -1,710 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/* - Header --------------------------------------- */ -.header { - position: relative; - background: #f5f2ea; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y1ZjJlYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmMWVkZTMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f5f2ea 0%, #f1ede3 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f5f2ea), color-stop(100%, #f1ede3)); - background: -webkit-linear-gradient(top, #f5f2ea 0%, #f1ede3 100%); - background: -o-linear-gradient(top, #f5f2ea 0%, #f1ede3 100%); - background: -ms-linear-gradient(top, #f5f2ea 0%, #f1ede3 100%); - background: linear-gradient(to bottom, #f5f2ea 0%, #f1ede3 100%); - z-index: 992; - padding: 0 20px; -} -.header-inner { - min-width: 960px; - max-width: 1300px; - margin: 0 auto; - padding: 7px 0; -} -.header .logo { - display: block; - width: 109px; - height: 27px; - text-indent: -999em; - background: url(Magento_Backend::images/logo-magento-small.png) no-repeat; - margin: 0; -} -.header-panel { - float: right; - font-size: 12px; -} -/* - Header Dropdown --------------------------------------- */ -.header-panel .dropdown-menu { - display: none; - width: 195px; - margin: 8px -87px 0 0; - border: 0; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: 0 2px 7px 2px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 2px 7px 2px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 7px 2px rgba(0, 0, 0, 0.2); -} -.header-panel .dropdown-menu > li { - position: relative; - padding: 20px 30px 13px 18px; - background: #f7f3eb; - border-bottom: 1px solid #f7e4d0; - white-space: normal; -} -.header-panel .dropdown-menu > li:hover { - background: #fff; -} -.header-panel .dropdown-menu > li:first-child:hover:before, -.header-panel .dropdown-menu > li.first:hover:before { - color: #fff; -} -.header-panel .dropdown-menu > li a { - display: block; - text-decoration: none; - color: #8c867e; - margin: 0 0 10px; -} -.header-panel .dropdown-menu > li a:hover { - text-decoration: underline; -} -.header-panel .dropdown-menu > li:first-child, -.header-panel .dropdown-menu > li.first { - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} -.header-panel .dropdown-menu > li:last-child, -.header-panel .dropdown-menu > li.last { - border-bottom: 0; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-radius: 0 0 5px 5px; - border-radius: 0 0 5px 5px; -} -/* - Account --------------------------------------- */ -.header-panel .account { - position: relative; - float: left; - margin: 0 0 0 30px; - padding: 6px 0 0; -} -.header-panel .account > a { - color: #656057; - position: relative; - display: inline-block; - min-width: 20px; - text-decoration: none; - padding: 0 10px 0 0; -} -.header-panel .account > a:before { - position: absolute; - top: 2px; - right: 0; - bottom: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - font-size: 9px; - -webkit-font-smoothing: antialiased; - content: '\e02c'; - /* icon point down */ - -} -.header-panel .account img { - position: relative; - border-radius: 3px; - z-index: 1; -} -.no-js .header-panel .account:hover > a { - padding-bottom: 5px; - margin-bottom: -5px; -} -.header-panel .account.active .dropdown-menu, -.no-js .header-panel .account:hover .dropdown-menu, -.no-js .header-panel .account > a:focus + .dropdown-menu { - display: block; -} -/* - Link to store front --------------------------------------- */ -.header-panel .store-front { - color: #676056; - text-decoration: none; - position: relative; - padding: 6px 0 0 20px; - float: left; - margin: 0 0 0 30px; -} -.header-panel .store-front:before { - font-family: 'admin-icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e005'; - /* icon store info */ - - font-size: 17px; - position: absolute; - left: 0; - top: 4px; -} -/* - Messages --------------------------------------- */ -.header-panel .notifications { - position: relative; - float: left; - margin: 0 6px 0 21px; - padding: 9px 0 0; -} -.header-panel .notifications-icon { - position: relative; - display: inline-block; - height: 12px; - width: 17px; - text-decoration: none; - text-align: center; - background: #cac2b5; - box-shadow: 0 1px 0 #fff; - border-radius: 2px; -} -.header-panel .notifications-icon:hover, -.header-panel .notifications-icon:active { - background: #b0a798; -} -.header-panel .notifications-icon:before { - position: absolute; - left: 0; - right: 0; - bottom: -7px; - margin-top: -5px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02c'; - /* user icon */ - - font-size: 8px; - color: #cac2b5; - text-shadow: 0 1px 0 #fff; -} -.header-panel .notifications-icon:hover:before, -.header-panel .notifications-icon:active:before { - color: #b0a798; -} -.header-panel .notifications .value { - color: #ffffff; - font-size: 12px; - font-weight: 600; - line-height: 11px; - padding: 1px 3px; - min-width: 10px; - background: #f58220; - border: 1px solid #bd5100; - border-radius: 4px; - box-shadow: 0 1px 0 #31302b; - left: 6px; - top: -5px; - position: absolute; -} -.header-panel .notifications.active .dropdown-menu { - display: block; - margin-top: 12px; - border: 2px solid #676056; - width: 288px; - margin: 8px -52px 0 0; -} -.header-panel .dropdown-menu > li { - background: #fff; - border-bottom: 0; - position: relative; - padding: 13px 26px 14px 16px; - white-space: normal; -} -.header-panel .dropdown-menu > li:after { - border-bottom: 1px solid #f7e4d0; - display: block; - position: absolute; - bottom: 0; - left: 2px; - content: ''; - width: 284px; -} -.header-panel .dropdown-menu > li:last-child:after, -.header-panel .dropdown-menu > li.last:after { - display: none; -} -.header-panel .notifications > .dropdown-menu .notification-description { - max-height: 43px; - overflow: hidden; - display: block; - color: #676056; - font-size: 11px; - font-weight: 400; -} -.header-panel .notifications > .dropdown-menu .notification-entry { - display: none; -} -.header-panel .notifications .dropdown-menu:before, -.header-panel .notifications .dropdown-menu:after { - position: absolute; - width: 10px; - height: 10px; - right: 55px; - top: -10px; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - font-size: 13px; - speak: none; - -webkit-font-smoothing: antialiased; - content: '\e029'; - /* user icon */ - - color: #fff; - z-index: 2; -} -.header-panel .notifications .dropdown-menu:after { - color: #676056; - font-size: 17px; - height: 12px; - right: 57px; - top: -14px; - z-index: 1; -} -.header-panel .notifications > .dropdown-menu .notification-entry:first-child { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry:first-child + .notification-entry { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry:first-child + .notification-entry + .notification-entry { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry:first-child + .notification-entry + .notification-entry + .notification-entry { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry:first-child + .notification-entry + .notification-entry + .notification-entry + .notification-entry { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry:nth-child(-n+5) { - display: block; -} -.header-panel .notifications > .dropdown-menu .notification-entry .notification-dialog-content { - display: none; -} -/* - Notification entry dialog --------------------------------------- */ -.notification-entry-dialog .notification-dialog-content, -.notification-entry-dialog .ui-dialog-buttonpane { - background: #fefaf6; -} -.notification-entry-dialog .ui-dialog-titlebar { - background: #f9f1e8; -} -.notification-entry-dialog .ui-dialog-title { - font-size: 22px; - padding-left: 24px; -} -.notification-entry-dialog-critical .ui-dialog-titlebar { - background: #fee4d0; -} -.notification-entry-dialog-critical .ui-dialog-title { - padding-left: 54px; -} -.notification-entry-dialog-critical .ui-dialog-title:before { - content: "\e086"; - font-family: 'MUI-Icons'; - color: #c00815; - font-style: normal; - font-weight: normal; - font-size: 26px; - speak: none; - -webkit-font-smoothing: antialiased; - left: 21px; - position: absolute; - top: 16px; -} -.notification-entry-dialog .ui-dialog-titlebar-close:before { - font-size: 15px; -} -.notification-entry-dialog .notification-dialog-content { - padding-top: 19px; - padding-bottom: 16px; -} -.notification-entry-dialog .notification-dialog-content strong { - display: block; - color: #f58220; - font-size: 18px; - font-weight: 500; -} -.notification-entry-dialog .notification-dialog-content .notification-description { - display: block; - font-family: Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42; - padding: 3px 0 7px; -} -.notification-entry-dialog .notification-dialog-content time { - color: #8c867e; - font-size: 13px; - font-family: Helvetica, Arial, sans-serif; - position: absolute; - right: 17px; - bottom: 27px; - text-align: right; -} -.notification-entry-dialog .notification-dialog-content .actions { - margin-bottom: 22px; -} -.notification-entry-dialog .notification-dialog-content .actions a { - color: #676056; - position: relative; - margin-right: 20px; -} -.notification-entry-dialog .notification-dialog-content .actions a:after { - content: "\e084"; - font-family: 'MUI-Icons'; - color: #6a5f54; - font-size: 12px; - speak: none; - -webkit-font-smoothing: antialiased; - position: absolute; - right: -17px; - top: -2px; -} -.notification-entry-dialog .ui-dialog-buttonset { - text-align: left; -} -.notification-entry-dialog .ui-dialog-buttonpane { - margin: 0; - padding: 0 24px 22px; -} -.notification-entry-dialog .ui-dialog-buttonset button[class^="action-"] { - background-image: none; - margin: 0 16px 0 0; - vertical-align: middle; - text-shadow: none; - box-shadow: none; - border: 0; -} -.notification-entry-dialog .ui-dialog-buttonset .action-acknowledge { - background-color: #f47b20; - border: 0; - padding: 5px 15px; -} -.notification-entry-dialog .ui-dialog-buttonset .action-acknowledge:hover { - background-color: #e47821; -} -.notification-entry-dialog .ui-dialog-buttonset .action-cancel { - background-color: #dbd6ce; - border: 0; - padding: 5px 15px; -} -.notification-entry-dialog .ui-dialog-buttonset .action-cancel:hover { - background-color: #d3cdc4; -} -.header-panel .account > .dropdown-menu a, -.header-panel .search .autocomplete-results .title { - display: block; - color: #f58220; - font-size: 14px; - font-weight: 500; - margin-bottom: 5px; -} -.header-panel .notifications > .dropdown-menu li > strong { - display: block; - color: #026294; - font-size: 12px; - font-weight: 600; - max-height: 32px; - overflow: hidden; - line-height: 1.4; - margin-bottom: 4px; -} -.header-panel .notifications > .dropdown-menu li > strong:focus, -.header-panel .notifications > .dropdown-menu li > strong:hover { - text-decoration: underline; -} -.header-panel .notifications > .dropdown-menu li.notification-critical strong { - padding-left: 30px; - position: relative; -} -.header-panel .notifications > .dropdown-menu li.notification-critical > strong:before { - display: block; - content: "\e086"; - font-family: 'MUI-Icons'; - color: #c00815; - font-size: 19px; - speak: none; - -webkit-font-smoothing: antialiased; - position: absolute; - left: 0; - top: 5px; -} -.header-panel .notifications > .dropdown-menu > li:hover { - background: #f7f3eb; - cursor: pointer; - margin-top: -1px; - padding-top: 14px; - z-index: 2; -} -.header-panel .notifications > .dropdown-menu > li:first-child:hover, -.header-panel .notifications > .dropdown-menu > li.first:hover, -.header-panel .notifications > .dropdown-menu > li:last-child:hover, -.header-panel .notifications > .dropdown-menu > li.last:hover { - margin-top: 0; - padding-top: 13px; -} -.header-panel .dropdown-menu > li:hover:after { - display: none; -} -.header-panel .notifications > .dropdown-menu > li:hover .action-close { - display: block; -} -.header-panel .notifications > .dropdown-menu > .new, -.header-panel .notifications > .dropdown-menu > .new:hover { - background: #f47b20; - color: #fff; -} -.header-panel .notifications > .dropdown-menu > li.new:first-child:before, -.header-panel .notifications > .dropdown-menu > li.new.first:before, -.header-panel .notifications > .dropdown-menu > li.new:first-child:hover:before, -.header-panel .notifications > .dropdown-menu > li.new.first:hover:before { - color: #f47b20; -} -.header-panel .notifications > .dropdown-menu > .new strong, -.header-panel .notifications > .dropdown-menu > .new div, -.header-panel .notifications > .dropdown-menu > .new a, -.header-panel .notifications > .dropdown-menu > .new time, -.header-panel .notifications > .dropdown-menu .new .action-close:hover, -.header-panel .notifications > .dropdown-menu .new .action-close:focus { - color: #fff; -} -.header-panel .notifications > .dropdown-menu time { - color: #676056; - font-size: 11px; - font-weight: 400; - display: block; - margin-top: 7px; -} -.header-panel .notifications > .dropdown-menu a:focus ~ .action-close, -.header-panel .notifications > .dropdown-menu .action-close:focus { - display: block; -} -.header-panel .notifications > .dropdown-menu .action-close { - position: absolute; - display: none; - top: 8px; - right: 4px; - width: 20px; - height: 20px; - text-indent: -999em; - overflow: hidden; - color: #cac2b5; -} -.header-panel .notifications > .dropdown-menu .action-close:hover { - color: #b0a789; -} -.header-panel .notifications > .dropdown-menu .action-close:before { - display: block; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - font-size: 19px; - speak: none; - -webkit-font-smoothing: antialiased; - content: '\e07f'; - /* trashbin icon */ - - text-indent: 0; -} -.header .header-panel .notifications .dropdown-menu > li.last { - padding: 0; -} -.header .header-panel .notifications .action-more { - display: block; - background: #676056; - border: 0; - color: #f7f3eb; - font-size: 13px; - font-weight: bold; - height: 23px; - width: 100%; - line-height: 23px; - text-shadow: none; - text-align: center; - margin: 0; -} -.header .header-panel .notifications .action-more:hover { - text-decoration: none; -} -/* - Help --------------------------------------- */ -.header-panel .help { - float: left; - margin: 0 0 0 30px; - padding: 6px 0 0; -} -/* - Search --------------------------------------- */ -.search { - position: relative; - float: left; - margin: -4px 0 -5px 50px; -} -.search form { - position: relative; -} -.search input { - position: relative; - display: none; - width: 50px; - height: 36px; - line-height: 2; - margin: 0; - padding: 4px 25px 4px 4px; - background: #fff; -} -.header .search .ajax-loading:before { - display: block; - content: ''; - position: absolute; - top: 10px; - left: -20px; - margin: 0; - width: 16px; - height: 16px; - line-height: 16px; - background-image: url(../mui/images/ajax-loader-small.gif); -} -.header .search .mage-suggest { - border: none; -} -.header .search .mage-suggest::after { - content: ''; -} -.search .dropdown-menu { - display: block; - right: auto; - margin-right: 0; - width: 100%; -} -.autocomplete-results { - left: 0 !important; - right: 0; -} -.autocomplete-results .title { - display: block; -} -.autocomplete-results .type { - margin: 0 0 10px; -} -.header.active .search { - margin-left: 30px; -} -.header.active .search input { - display: inline-block; -} -.no-js .search input { - display: inline-block; - width: 350px; -} -.search button[type="submit"], -.search button[type="submit"]:hover, -.search button[type="submit"]:active, -.search button[type="submit"]:focus { - position: absolute; - top: 2px; - right: 0; - width: 32px; - height: 32px; - background: none; - border: none; - overflow: hidden; - text-indent: -999em; - color: #676056; - text-shadow: 0 1px 0 #fff; - box-shadow: none; - filter: none; -} -.search button[type="submit"]:hover, -.header.active .search button[type="submit"], -.header.active .search button[type="submit"]:hover, -.header.active .search button[type="submit"]:active, -.header.active .search button[type="submit"]:focus { - color: #201f1c; -} -.eq-ie9 .search button[type="submit"] { - top: 4px; -} -.search button[type="submit"]:before { - position: absolute; - display: block; - top: 0; - right: 0; - bottom: 0; - left: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e01f'; - /* user icon */ - - text-indent: 0; - font-size: 18px; - line-height: 1.7; - text-align: center; -} -/* - Clearfix --------------------------------------- */ -.header-panel:before, -.header-panel:after, -.header-inner:before, -.header-inner:after, -.clearfix:before, -.clearfix:after { - content: ""; - display: table; -} -.header-panel:after, -.header-inner:after, -.clearfix:after { - clear: both; -} diff --git a/app/design/adminhtml/Magento/backend/css/pages.css b/app/design/adminhtml/Magento/backend/css/pages.css deleted file mode 100644 index f8b90918ccb73785f8bc083d18371654376b5cb1..0000000000000000000000000000000000000000 --- a/app/design/adminhtml/Magento/backend/css/pages.css +++ /dev/null @@ -1,2817 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/* - Product Creation --------------------------------------- */ -[class^=" catalog-product-"] .page-actions .action-back.mage-error, -[class^=" newsletter-"] .page-actions .action-back.mage-error { - color: #b57c72; -} -.field-weight .control .field:first-child { - width: 36%; - margin-right: 15px; -} -#allow_open_amount { - margin-top: 8px; -} -.catalog-product-new .user-defined.type-select select, -.catalog-product-edit .user-defined.type-select select { - width: 100%; -} -#tab_content_downloadableInfo .data-table td { - vertical-align: top; -} -#tab_content_downloadableInfo .data-table td .row { - margin-bottom: 10px; -} -/* - Customer ----------------------------------------*/ -.customer-index-edit .grid tr.headings th > span { - white-space: normal; -} -#customer_info_tabs_account_content #_accountsendemail { - margin-top: 8px; -} -.customer-information:before, -.customer-information:after { - content: ""; - display: table; -} -.customer-information:after { - clear: both; -} -.customer-information .data-table, -.customer-information address { - width: 48.5%; -} -.customer-information .data-table { - float: left; - width: 48.5%; -} -.customer-information address { - padding-top: 4px; - line-height: 2.2; - float: right; -} -.address-list { - list-style: none; - width: 278px; - margin: 0 0 10px; - padding: 0; - float: left; -} -.address-list li { - border: 1px solid #d9d2ca; - background: #f7f2ec; - padding: 10px 10px 15px; - cursor: pointer; - margin-bottom: -1px; -} -.address-list li.ui-state-active { - background: #fff; - position: relative; - box-shadow: 0 1px 1px 0 #d9d2ca; - margin-left: -2px; - padding-left: 12px; -} -.address-list li.ui-state-active:before, -.address-list li.ui-state-active:after { - position: absolute; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - font-size: 18px; - color: #fff; - content: "\e02a"; - speak: none; - line-height: 11px; - width: 10px; - right: -9px; - text-indent: -6px; - top: 50%; - margin-top: -5px; - z-index: 2; -} -.address-list li.ui-state-active:before { - color: #d9d2ca; - right: -11px; - z-index: 1; -} -.address-list li.address-list-actions:before, -.address-list li.address-list-actions:after { - display: none; -} -.address-list li.address-list-actions { - padding: 20px 0 0 0; - border: 0; - background: none; - box-shadow: none; - cursor: default; -} -.address-list li.address-list-actions:first-child { - padding: 0; -} -.address-list .label { - float: none; - width: auto; - padding: 0 0 0 10px; -} -.address-list input[type="checkbox"] { - float: left; -} -.address-list address:first-line { - /* its not work if First Name and Last Name in two lines */ - font-weight: bold; -} -.address-list address { - margin: 0 20px 15px 0; - line-height: 1.5; -} -.address-list-item-actions { - float: right; -} -.address-list .action-edit { - display: none; -} -.address-list .field { - margin-bottom: 15px; -} -.ui-tabs-nav .address-list-item a { - text-decoration: none; - color: #676056; -} -.address-item-edit { - margin-left: 277px; -} -.address-item-edit-content { - border: 1px solid #dad1c8; - background: #fff; - box-shadow: 0 2px 1px 0 rgba(217, 210, 202, 0.5); - padding-left: 10px; -} -.address-item-edit-content .fieldset:last-child { - margin-bottom: 29px; -} -.address-item-edit .legend { - border-bottom: 0; - margin: 0 0 18px; - padding-left: 20%; -} -.address-item-edit .legend span { - padding-left: 0; -} -.address-item-edit-actions { - padding: 0 0 18px 20%; -} -/* - Configuration -> Design --------------------------------------- */ -#row_design_theme_ua_regexp .design_theme_ua_regexp { - float: left; - width: 100%; -} -#row_design_theme_ua_regexp .tooltip { - margin-top: 8px; -} -#row_design_theme_ua_regexp .note { - clear: both; -} -/* - Configuration -> Payment Methods --------------------------------------- */ -.adminhtml-system-config-edit .payflow-settings-notice .important-label { - color: #e22626; - font-size: 14px; - font-weight: 700; -} -.adminhtml-system-config-edit .payflow-settings-notice ul.options-list strong { - color: #676056; - font-size: 14px; - font-weight: 700; -} -/* - CMS -> Banners --------------------------------------- */ -/* Banner Properties */ -#banner_properties_customer_segment_ids { - min-width: 20%; -} -/* Content */ -.field-store_default_content .buttons-set { - margin-bottom: 9px; -} -.field-store_default_content .buttons-set button { - margin-right: 4px; -} -.field-store_0_content_use input[type="checkbox"] { - margin-right: 3px; - position: relative; - top: 2px; -} -/* - CMS -> Manage Hierarchy --------------------------------------- */ -.cms-hierarchy .cms-scope { - float: right; - margin-right: 25px; - position: relative; - top: 2px; -} -.cms-hierarchy #tree-container { - margin-top: 25px; - overflow: auto; - padding-bottom: 10px; -} -.cms-hierarchy .buttons-set { - margin-bottom: 10px; -} -.cms-hierarchy .cms-hierarchy-tree { - width: 48.93617020799999%; - float: left; - margin: 10px 0 8px 0; -} -.cms-hierarchy .cms-hierarchy-node { - width: 48.93617020799999%; - float: left; - margin: 10px 0 8px 2.127659574%; -} -.cms-hierarchy #cms_page_grid_container { - clear: both; -} -.cms-hierarchy .store-switcher { - position: relative; - top: 10px; -} -.cms-hierarchy .store-switcher label { - margin-right: 8px; -} -.cms-hierarchy-node #node_properties_fieldset #node_preview { - position: relative; - top: 6px; -} -.cms-hierarchy-node .form-inline .label { - width: 30%; -} -/* - CMS -> Widgets --------------------------------------- */ -#widget_instace_tabs_properties_section_content .widget-option-label { - margin-top: 6px; -} -/* - CMS -> Static Blocks --------------------------------------- */ -#buttonsblock_content.buttons-set { - margin-bottom: 9px; -} -#buttonsblock_content.buttons-set button { - margin-right: 4px; -} -/* - CMS -> Manage Content --------------------------------------- */ -/* Content */ -.cms-manage-content-actions .buttons-set { - margin-bottom: 9px; -} -.cms-manage-content-actions .buttons-set button { - margin-right: 4px; -} -.cms-manage-content-actions textarea { - width: 100%; -} -/* - System -> Action Log -> Report --------------------------------------- */ -.adminhtml-logging-details .log-details-grid table th { - border: 1px solid #c9c2b8; - border-width: 0 0 1px; - padding: 6px 10px 7px; - background: #fff; - color: #676056; - font-size: 13px; - font-weight: 600; -} -.adminhtml-logging-details .log-details-grid table th span { - border: 0; - padding: 0; -} -.adminhtml-logging-details .log-details-grid table td { - border: none; - padding: 6px 10px 7px; - background: #fff; -} -.adminhtml-logging-details .log-details-grid table tr:last-child td { - border: 1px solid #eae8e4; - border-width: 0 0 1px; -} -.adminhtml-logging-details .log-details-grid table tr.on-mouse { - cursor: inherit; -} -.adminhtml-logging-details .log-details-grid table tr:nth-child(odd) td, -.adminhtml-logging-details .log-details-grid table tr.on-mouse:nth-child(odd):hover td { - background: #fbfaf6; -} -/* - System -> Export --------------------------------------- */ -#export_filter_grid .grid td .input-text-range-date { - vertical-align: middle; -} -#export_filter_grid .grid td .ui-datepicker-trigger { - vertical-align: middle; - margin-left: 5px; -} -#export_filter_grid .grid select { - margin-bottom: 0; - width: 86%; -} -#export_filter_grid .grid table td:first-child, -#export_filter_grid .grid tr th:first-child { - border-left: 0; -} -#export_filter_grid .data thead { - border-left: 1px solid #837F79; -} -#export_filter_grid .data tbody { - border-left: 1px solid #c0bbaf; -} -/* - System -> Roles --------------------------------------- */ -#gws_container ul { - padding: 0; - margin: 0; - list-style: none; -} -#gws_container ul ul { - margin: .8em 0 .8em 1.4em; -} -#gws_container input[type="checkbox"] { - margin-right: 3px; - position: relative; - top: -1px; -} -/* - Reports --------------------------------------- */ -.reports-title .page-actions { - float: right; -} -.reports-title .store-switcher { - padding: 14px 0 18px; -} -.reports-content select { - width: 160px; -} -.reports-content input.hasDatepicker { - width: 133px; -} -/* TODO: refactor when validation design is ready */ -.reports-content .required .control { - position: relative; -} -.reports-content input.hasDatepicker + label.mage-error { - left: 0; - position: absolute; - top: 30px; -} -.reports-title:before, -.reports-title:after { - content: ""; - display: table; -} -.reports-title:after { - clear: both; -} -/* - Reports - Customer Reviews --------------------------------------- */ -.reports-report-review-customer .col-qty, -.reports-report-review-customer .col-actions { - width: 85px; -} -/* - Reports - Product Reviews --------------------------------------- */ -.reports-report-review-product .col-id { - width: 35px; -} -.reports-report-review-product .col-qty, -.reports-report-review-product .col-rating, -.reports-report-review-product .col-avg-rating, -.reports-report-review-product .col-actions { - text-align: right; - width: 85px; -} -.reports-report-review-product .col-date { - width: 140px; -} -.reports-report-review-product .col-rating { - width: 104px; -} -/* - Reports - New Accounts --------------------------------------- */ -.reports-report-customer-accounts .col-period { - white-space: nowrap; - width: 70px; -} -/* - Reports - Refresh Statistics --------------------------------------- */ -.reports-report-statistics-index .col-period { - white-space: nowrap; - width: 140px; -} -.reports-report-statistics-index .col-select { - width: 25px; -} -/* - Reports - Products Ordered --------------------------------------- */ -.reports-report-product-sold .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-product-sold .col-qty { - width: 110px; -} -/* - Reports - Customers by Orders Total --------------------------------------- */ -.reports-report-customer-totals .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-customer-totals .col-qty { - width: 65px; -} -.reports-report-customer-totals .col-rating { - width: 100px; -} -/* - Reports - Tag by popular --------------------------------------- */ -.reports-report-tag-popular .col-qty, -.reports-report-tag-popular .col-actions { - width: 80px; -} -/* - Reports - Tag by customer --------------------------------------- */ -.reports-report-tag-customer .col-id { - width: 35px; -} -.reports-report-tag-customer .col-qty, -.reports-report-tag-customer .col-actions { - width: 80px; -} -/* - Reports - Tag by product --------------------------------------- */ -.reports-report-tag-product .col-id { - width: 35px; -} -.reports-report-tag-product .col-actions { - width: 70px; -} -.reports-report-tag-product .col-unique-numbers, -.reports-report-tag-product .col-total-numbers { - text-align: right; - width: 95px; -} -/* - Reports - Customers by Number of Orders --------------------------------------- */ -.reports-report-customer-orders .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-customer-orders .col-qty, -.reports-report-customer-orders .col-average, -.reports-report-customer-orders .col-total { - width: 105px; -} -/* - Reports - Customers by Orders Total --------------------------------------- */ -.reports-report-customer-totals .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-customer-totals .col-qty, -.reports-report-customer-totals .col-average, -.reports-report-customer-totals .col-total { - width: 105px; -} -/* - Reports - Customer's wishlists --------------------------------------- */ -.adminhtml-report-customer-wishlist-wishlist .col-period { - width: 70px; -} -.adminhtml-report-customer-wishlist-wishlist .col-whishlist-qty, -.adminhtml-report-customer-wishlist-wishlist .col-available-qty, -.adminhtml-report-customer-wishlist-wishlist .col-qty-diff { - text-align: right; - width: 100px; -} -.adminhtml-report-customer-wishlist-wishlist .grid .range { - text-align: left; -} -/* - Reports - Most Viewed --------------------------------------- */ -.reports-report-product-viewed .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-product-viewed .col-qty, -.reports-report-product-viewed .col-price { - white-space: nowrap; - width: 80px; -} -/* - Reports - Search Terms --------------------------------------- */ -.reports-index-search .col-id { - width: 35px; -} -.reports-index-search th.col-results, -.reports-index-search th.col-hits { - text-align: left; - width: 117px; -} -.reports-index-search td.col-results, -.reports-index-search td.col-hits { - text-align: right; - width: 117px; -} -.reports-index-search .col-results .range-line:first-child, -.reports-index-search .col-hits .range-line:first-child { - float: left; - margin-right: 3px; -} -/* - Reports - Bestsellers --------------------------------------- */ -.reports-report-sales-bestsellers .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-bestsellers .col-qty, -.reports-report-sales-bestsellers .col-price { - width: 80px; -} -/* - Reports - Downloads --------------------------------------- */ -.reports-report-product-downloads .col-qty, -.reports-report-product-downloads .col-price { - width: 80px; -} -/* - Reports - Abandoned Carts --------------------------------------- */ -.reports-report-shopcart-abandoned .col-ip, -.reports-report-shopcart-abandoned .col-subtotal, -.reports-report-shopcart-abandoned .col-number, -.reports-report-shopcart-abandoned .col-coupon { - text-align: right; -} -.reports-report-shopcart-abandoned .col-ip { - width: 105px; -} -.reports-report-shopcart-abandoned .col-subtotal { - width: 65px; -} -/* - Reports - Products in Carts --------------------------------------- */ -.reports-report-shopcart-product .col-id { - width: 35px; -} -.reports-report-shopcart-product .col-carts, -.reports-report-shopcart-product .col-qty, -.reports-report-shopcart-product .col-price { - text-align: right; - width: 80px; -} -/* - Reports - Refunds --------------------------------------- */ -.reports-report-sales-refunded .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-refunded .col-ref-total, -.reports-report-sales-refunded .col-ref-online, -.reports-report-sales-refunded .col-ref-offline { - text-align: right; - width: 23%; -} -/* - Reports - Shipping --------------------------------------- */ -.reports-report-sales-shipping .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-shipping .col-qty, -.reports-report-sales-shipping .col-total-sales-shipping, -.reports-report-sales-shipping .col-total-shipping { - text-align: right; - width: 115px; -} -/* - Reports - Invoiced --------------------------------------- */ -.reports-report-sales-invoiced .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-invoiced .col-qty, -.reports-report-sales-invoiced .col-invoiced, -.reports-report-sales-invoiced .col-total-invoiced, -.reports-report-sales-invoiced .col-total-invoiced-paid, -.reports-report-sales-invoiced .col-total-invoiced-not-paid { - text-align: right; - width: 19%; -} -/* - Reports - Tax --------------------------------------- */ -.reports-report-sales-tax .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-tax .col-rate, -.reports-report-sales-tax .col-qty, -.reports-report-sales-tax .col-tax-amount { - text-align: right; - width: 105px; -} -/* - Reports - Orders --------------------------------------- */ -.reports-report-sales-sales .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-sales .col-orders, -.reports-report-sales-sales .col-sales-items, -.reports-report-sales-sales .col-sales-total, -.reports-report-sales-sales .col-invoiced, -.reports-report-sales-sales .col-refunded, -.reports-report-sales-sales .col-sales-tax, -.reports-report-sales-sales .col-sales-shipping, -.reports-report-sales-sales .col-sales-discount, -.reports-report-sales-sales .col-canceled { - text-align: right; - width: 10.5%; -} -/* - Reports - Coupons --------------------------------------- */ -/* TODO: re-check styles for coupons table after coupons functionality will have been repaired */ -.reports-report-sales-coupons .col-period { - white-space: nowrap; - width: 70px; -} -.reports-report-sales-coupons .col-sales, -.reports-report-sales-coupons .col-users, -.reports-report-sales-coupons .col-sales-discount, -.reports-report-sales-coupons .col-total-amount, -.reports-report-sales-coupons .col-subtotal, -.reports-report-sales-coupons .col-discount, -.reports-report-sales-coupons .col-total { - text-align: right; -} -/* - Reports - Low Stock --------------------------------------- */ -.reports-report-product-lowstock .col-qty { - width: 10%; -} -.reports-report-product-lowstock .range-line { - display: inline-block; -} -.reports-report-product-lowstock .col-product { - width: 65%; -} -.reports-report-product-lowstock .col-sku { - width: 25%; -} -/* - Reports - PayPal Settlement Reports --------------------------------------- */ -.adminhtml-paypal-reports-index .grid tr.headings th > span { - white-space: normal; -} -.adminhtml-paypal-reports-index .col-transaction_event_code { - max-width: 150px; -} -.adminhtml-paypal-reports-index .col-amount, -.adminhtml-paypal-reports-index .col-fee-amount { - text-align: right; -} -/* - Newsletter --------------------------------------- */ -/* - Newsletter Templates --------------------------------------- */ -.newsletter-template-index .col-id { - width: 35px; -} -.newsletter-template-index .col-actions { - width: 80px; -} -.newsletter-template-index .col-type { - width: 100px; -} -.newsletter-template-index .col-added, -.newsletter-template-index .col-updated { - width: 140px; -} -[class^=' newsletter-'] .buttons-set { - margin: 0 0 15px; -} -[class^=" newsletter-"] .buttons-set button { - margin-right: 4px; -} -/* - Newsletter - Queue --------------------------------------- */ -.newsletter-queue-index .col-id { - width: 35px; -} -.newsletter-queue-index .col-finish, -.newsletter-queue-index .col-start { - width: 130px; -} -.newsletter-queue-index .col-status, -.newsletter-queue-index .col-processed, -.newsletter-queue-index .col-recipients { - white-space: nowrap; - width: 85px; -} -.newsletter-queue-index td.col-processed, -.newsletter-queue-index td.col-recipients { - text-align: right; -} -.newsletter-queue-index .col-actions { - width: 80px; -} -/* - Newsletter - Subscribers --------------------------------------- */ -.newsletter-subscriber-index .col-id { - width: 35px; -} -.newsletter-subscriber-index .col-type { - width: 75px; -} -.newsletter-subscriber-index .col-status { - white-space: nowrap; - width: 85px; -} -/* - Newsletter - Problems --------------------------------------- */ -.newsletter-problem-index .col-select { - width: 25px; -} -.newsletter-problem-index .col-id { - width: 35px; -} -.newsletter-problem-index .col-start { - width: 130px; -} -.newsletter-problem-index .col-error-code { - width: 150px; -} -.table-fieldset-alt, -.type-options { - margin-bottom: 20px; -} -.table-fieldset-alt thead th, -.table-fieldset-alt tbody tr td { - border-width: 0; -} -.table-fieldset-alt tbody tr:nth-child(odd) td, -.table-fieldset-alt tbody tr:nth-child(odd):hover td { - background: #fff; -} -/* - System - Tax ---------------------------------------*/ -.tax-rate-popup .ui-dialog-content.ui-widget-content { - padding: 10px 10px 0; -} -.tax-rate-popup .fieldset { - margin: 0; -} -.tax-rate-popup .field { - margin-bottom: 20px; -} -.tax-rate-popup .field .label { - margin: 5px 0 0 0; - width: 26%; - padding: 0 20px 0 0; - float: left; - text-align: right; - box-sizing: content-box; - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - -ms-box-sizing: content-box; -} -.tax-rate-popup .field .control { - width: 58%; - margin: 0; - float: left; -} -.tax-rate-popup .field .control select, -.tax-rate-popup .field .control .input-text { - width: 100%; -} -.tax-rate-popup .field-rate .control .input-text { - width: 50%; -} -.tax-rate-popup .field-rate label.mage-error { - display: block; -} -.tax-rate-popup .tax-rate-titles-note-td { - margin-left: 26%; - padding-left: 20px; -} -.field-tax_rate, -.field-tax_customer_class, -.field-tax_product_class { - position: relative; -} -.mselect-hidden + .mage-error { - position: absolute; - top: 100%; -} -/* - Tags --------------------------------------- */ -.tag-title { - overflow: hidden; -} -.tag-title .page-actions { - float: right; -} -/* - Attribute Mapping --------------------------------------- */ -.field-attributes_box .control-value { - width: 100%; -} -.adminhtml-googleshopping-types-new #attribute_set { - padding: 0; -} -.adminhtml-googleshopping-types-new #gcontent_attributes_container { - margin-top: -6px; -} -/* - Sales --------------------------------------- */ -#order-totals strong { - color: #676056; - font-size: 14px; - font-weight: 700; -} -#order-shipping-method-summary a { - color: #007dbd; - font-size: 14px; - font-weight: 400; -} -#order-shipping-method-summary a:focus, -#order-shipping-method-summary a:hover { - text-decoration: underline; -} -.customer-current-activity { - float: left; - width: 22%; -} -.customer-current-activity-inner { - background: #fff; - border: 1px solid #eae6e0; - padding: 18px; - border-radius: 5px; -} -.order-details-existing-customer { - padding-left: 1%; - position: relative; - width: 77%; - float: right; -} -.order-billing-address, -.order-billing-method, -[class*="-order-"] .order-history, -[class*="-order-"] .order-comments-history, -[class*="-order-"] .order-information, -[class*="-order-"] .order-billing-address, -[class*="-order-"] .order-payment-method, -[class^=" adminhtml-rma-"] .order-comments-history, -[class^=" adminhtml-rma-"] .order-shipping-address, -[class^=" adminhtml-rma-"] .rma-request-details { - float: left; - width: 49.5%; -} -.order-shipping-address, -.order-shipping-method, -[class*="-order-"] .order-totals, -[class*="-order-"] .order-account-information, -[class*="-order-"] .order-shipping-address, -[class*="-order-"] .order-payment-method-virtual, -[class*="-order-"] .order-shipping-method, -[class^=" adminhtml-rma-"] .rma-confirmation, -[class^=" adminhtml-rma-"] .order-shipping-method, -[class^=" adminhtml-rma-"] .order-return-address { - float: right; - width: 49%; -} -[class*="-order-"] .order-card-validation { - width: 49.5%; - box-sizing: border-box; -} -[class*="-order-"] .order-card-validation .actions { - margin-top: 17px; -} -#order-data .order-account-information { - float: none; - width: auto; -} -[class^=" sales-"] .order-information .fieldset-wrapper > .fieldset-wrapper-title .title { - width: 100%; -} -#order-data .actions .action-add, -#order-data .actions .action-delete, -#order-customer-selector .actions .action-add { - margin: 0 0 0 20px; -} -#order-data .order-methods ul { - list-style: none; - margin: 0; - padding: 0; -} -#order-data .order-methods dl, -#order-data .order-methods dt, -#order-data .order-methods dd, -#order-data .payment-methods dl, -#order-data .payment-methods dt, -#order-data .payment-methods dd { - margin: 0; - padding: 0; -} -#order-data .order-methods dd + dt, -#order-data .payment-methods dd + dt { - margin-top: 17px; -} -#order-data .order-methods dt, -#order-data .payment-methods dt { - margin: 0 0 8px; -} -.order-coupons .box-left, -.order-gift-options .box-left { - float: left; - width: 49%; -} -.order-coupons .box-right, -.order-gift-options .box-right { - float: right; - width: 49%; -} -.order-gift-options .box-left:last-child, -.order-gift-options .fieldset-wrapper-title + .box-right { - float: none; - width: auto; -} -.order-gift-options fieldset { - border-radius: 5px; -} -.order-gift-options .gift-wrapping-form select { - margin-left: 10px; -} -.order-gift-options .giftmessage-entire-order textarea { - height: 6em; - width: 100%; -} -.order-gift-options .giftmessage-whole-order-container textarea { - height: 6em; - width: 100%; -} -.order-gift-options .giftmessage-whole-order-container .actions { - margin-left: 20%; -} -.ui-dialog.gift-options-popup .ui-dialog-content { - padding: 25px; -} -.ui-dialog.gift-options-popup .ui-dialog-content h4 { - margin: 0 0 17px; -} -.gift-options-tooltip { - background: #fff; - border-radius: 5px; - padding: 10px; - box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); -} -#order-data .box-left fieldset, -#order-data .box-right fieldset { - border-radius: 5px; -} -#order-data .order-items td[colspan="8"] { - border: 1px solid #c0bbaf; -} -.order-search-items thead th:nth-child(1) { - width: 60px; -} -.order-search-items thead th:nth-child(3) { - width: 80px; -} -.order-search-items thead th:nth-child(4) { - width: 100px; -} -.order-search-items thead th:nth-child(5) { - width: 55px; -} -.order-search-items thead th:nth-child(6) { - width: 1px; -} -.adminhtml-rma-new .order-totals, -.order-comments-history .order-comments-history, -[class^=" adminhtml-rma-"] .rma-comments-history { - float: none; - width: 100%; -} -[class*="-order-"] .order-billing-address .actions, -[class*="-order-"] .order-shipping-address .actions { - margin: 17px 0; -} -[class*="-order-"] .order-billing-address .control + label, -[class*="-order-"] .order-shipping-address .control + label { - margin: 17px 0 0; -} -.sales-order-create-index #order-message .messages .message, -.sales-order-edit-index #order-message .messages .message { - margin: 0 0 60px; -} -.sales-order-create-index thead .col-entity_id, -.sales-order-create-index .col-entity_id, -.sales-order-create-index .col-qty, -.checkout-index-index .col-qty { - width: 50px; -} -.sales-order-create-index .col-in_products, -.checkout-index-index .col-in_products { - text-align: center; -} -.sales-order-create-index .col-sku, -.sales-order-create-index .col-remove, -.checkout-index-index .col-remove { - width: 120px; -} -.sales-order-create-index .col-price { - width: 70px; -} -.sales-order-create-index .order-search-items .col-name, -.checkout-index-index #source_products_table .col-name { - width: 50%; -} -.sales-order-create-index .order-items.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-search-items.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-additional-area.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-errors .fieldset-wrapper-title, -.checkout-index-index .checkout-errors .fieldset-wrapper-title { - border-bottom: 0; - margin: 0; -} -.sales-order-create-index #order-data .fieldset-wrapper-title .actions .action-add { - margin-left: 0; - margin-right: 20px; -} -.sales-order-create-index .order-items.fieldset-wrapper .title, -.sales-order-create-index .order-additional-area.fieldset-wrapper .title, -.sales-order-create-index .order-search-items.fieldset-wrapper .title, -.sales-order-create-index .order-errors .title, -.checkout-index-index .checkout-errors .title { - border-bottom: 1px solid #ededed; - float: none; - margin: 0 0 18px; - width: 100%; -} -.sales-order-create-index .order-items.fieldset-wrapper .actions, -.sales-order-create-index .order-search-items.fieldset-wrapper .actions, -.sales-order-create-index #order-errors .actions, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions { - float: none; - border: 1px solid #c0bbaf; - border-bottom: 0; - background: #f6f3ec; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f6f3ec), color-stop(100%, #edeae1)); - background: -webkit-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -o-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: -ms-linear-gradient(top, #f6f3ec 0%, #edeae1 100%); - background: linear-gradient(to bottom, #f6f3ec 0%, #edeae1 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f3ec', endColorstr='#edeae1', GradientType=0); - margin: 0; - padding: 0 8px; - position: relative; -} -.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-add { - margin: 7px 8px 8px 0; -} -.sales-order-create-index .order-additional-area.fieldset-wrapper .actions { - float: none; - margin: 0 0 8px; - padding: 0; -} -.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-delete { - margin: 13px 0 0; -} -.sales-order-create-index .ui-dialog .downloadable.information .link .label { - margin-left: 0; -} -.sales-order-create-index .ui-dialog .downloadable.information .link .nested { - margin-left: 8px; -} -.sales-order-create-index .ui-dialog .fieldset.bundle .nested { - padding-left: 6px; -} -.sales-order-create-index .ui-dialog .fieldset.bundle .nested .field { - margin: 0 0 5px; -} -.sales-order-create-index .ui-dialog .fieldset.bundle .nested .label { - font-size: 13px; - margin: 0; -} -.sales-order-create-index .ui-dialog .fieldset.bundle .nested .qty .control { - display: inline-block; - margin: 0 0 0 10px; - width: 60px; -} -.sales-order-create-index .order-billing-method .payment-methods .fieldset { - padding: 0; - margin: 0; -} -.sales-order-create-index .order-billing-method .payment-methods .fieldset .field { - margin: 0 0 12px 0; -} -.tax.summary-total .summary-collapse { - cursor: pointer; - display: inline-block; -} -.tax.summary-total .summary-collapse:before { - content: "\e02d"; - color: #816063; - background: #f2ebde; - display: inline-block; - text-indent: 0; - font-size: 16px; - width: 16px; - height: 16px; - line-height: 16px; - overflow: hidden; - font-family: 'MUI-Icons'; - border: 1px solid #ada89e; - font-style: normal; - vertical-align: top; - margin-right: 7px; - font-weight: normal; - speak: none; - -webkit-font-smoothing: antialiased; - border-radius: 2px; -} -.tax.summary-total .summary-collapse:hover:before { - background: #cac3b4; -} -.tax.summary-total.show-details .summary-collapse:before { - content: "\e03a"; -} -tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) td, -tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(even) td, -tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(even) td { - background: #fbfaf6; -} -tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(odd) td, -tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(odd) td, -tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) td { - background: #fff; -} -/* ----------------------------------- */ -#order-data .page-actions { - padding-top: 0; -} -.create-order-sidebar-container > div + div { - border-top: 1px solid #ededed; - margin-top: 35px; -} -.create-order-sidebar-container > div .head h5 { - color: #676056; - font-size: 14px; - font-weight: 400; - margin: 17px 0 7px; -} -.customer-current-activity-inner > h4 { - color: #676056; - font-size: 20px; - font-weight: 400; - border-bottom: 1px solid #ededed; - margin-top: 0; - padding: 0 0 16px; -} -.customer-current-activity-inner .data-table th { - color: #676056; - font-size: 13px; - font-weight: 400; -} -.customer-current-activity-inner .data-table td { - color: #676056; - font-size: 12px; - font-weight: 400; -} -.customer-current-activity .action-refresh { - float: right; -} -.customer-current-activity .action-refresh, -.customer-current-activity .data-table .icon { - display: inline-block; - text-indent: 100%; - overflow: hidden; - height: 16px; - width: 16px; - white-space: nowrap; -} -.customer-current-activity .action-refresh:before, -.customer-current-activity .data-table .icon:before { - content: "\e010"; - color: #c3c2be; - display: block; - text-indent: 0; - font-size: 16px; - font-family: 'MUI-Icons'; - font-style: normal; - font-weight: normal; - speak: none; - -webkit-font-smoothing: antialiased; -} -.customer-current-activity .data-table .icon-remove:before { - content: "\e07f"; -} -.customer-current-activity .data-table .icon-add:before { - content: "\e071"; -} -.customer-current-activity .auto-scroll { - color: #676056; - font-size: 13px; - font-weight: 400; - overflow: auto; - max-height: 150px; -} -.customer-current-activity .auto-scroll + button { - margin: 22px 0 0; -} -.customer-current-activity .actions { - border-top: none; - margin: 20px 0 0; - padding: 0; -} -.overlay { - background: rgba(255, 255, 255, 0.5); - border-radius: 5px; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.overlay span { - color: #111; - font-weight: bold; - position: absolute; - top: 56px; - left: 0; - margin: 0 8px; - padding: 10px; - background: #ffffff; -} -/* - Order view --------------------------------------- */ -[class*="-order-"] .fieldset-wrapper-title .actions { - float: right; - font-size: 12px; - margin: 8px 20px 0 0; -} -[class*="-order-"] .fieldset-wrapper-title .actions a:link, -[class*="-order-"] .fieldset-wrapper-title .actions a:visited, -[class*="-order-"] .fieldset-wrapper-title .actions a:hover, -[class*="-order-"] .fieldset-wrapper-title .actions a:active { - color: #a29c94; -} -.order-comments-history fieldset { - border: 0; - margin: 0; - padding: 0; -} -.order-comments-history textarea, -.rma-history-form textarea { - height: 6em; - margin: 5px 0 10px; - resize: vertical; - width: 100%; -} -.order-comments-history input[type="checkbox"] { - margin-right: 5px; -} -.order-history-comments-options { - float: left; -} -.order-comments-history .actions { - float: right; -} -[class*="-order-"] .fieldset-wrapper address { - overflow: auto; -} -/* - Orders comments --------------------------------------- */ -.note-list { - list-style: none; - padding: 0; -} -.note-list li { - border-top: 1px solid #ededed; - padding: 9px 0; -} -.note-list li:first-child { - border: 0; - padding-top: 13px; -} -.note-list div { - font-size: 12px; -} -.note-list .note-list-date, -.note-list .note-list-status, -.note-list .note-list-customer span { - font-weight: bold; -} -.note-list .note-list-time, -.note-list .note-list-status { - border-right: 1px solid #676056; - padding: 0 5px 0 0; - margin: 0 5px 0 0; -} -.note-list .note-list-customer { - white-space: nowrap; -} -.note-list .note-list-comment { - margin: 5px 0 0; -} -.note-list .note-list-customer-notapplicable { - color: #d87e34; -} -.note-list .note-list-customer-notified { - color: #185b00; -} -.note-list .note-list-customer-not-notified { - color: #963535; -} -.checkout-agreement-index .col-id, -[class^=" sales-billing-"] .col-id, -[class^=" sales-transactions-"] .col-id { - width: 35px; -} -[class^=" adminhtml-order-shipment-"] .col-ship, -[class^=" sales-"] .col-return-to-stock, -.adminhtml-rma-new .col-select { - text-align: center; - width: 35px; -} -[class*="-order-"] .col-price-original, -[class*="-order-"] .col-tax-amount, -[class*="-order-"] .col-tax-percent, -[class*="-order-"] .col-discont, -[class*="-order-"] .col-total, -[class*="-order-"] .col-discount, -[class*="-order-"] .col-tax, -[class^=" sales-"] .col-refunded, -[class^=" adminhtml-rma-"] .col-order, -[class^=" adminhtml-rma-"] .col-required, -[class^=" adminhtml-rma-"] .col-system, -[class^=" adminhtml-rma-"] .col-visible-on-front, -.checkout-agreement-index .col-status, -.adminhtml-rma-item-attribute-edit .col-position { - text-align: right; - white-space: nowrap; - width: 50px; -} -[class*="-order-"] .col-subtotal, -[class*="-order-"] .col-price, -[class^=" adminhtml-rma-"] .col-price { - text-align: right; - width: 50px; -} -.sales-order-invoice-view .col-subtotal, -.sales-order-invoice-view .col-price { - width: 10%; -} -[class^=" sales-"] .col-actions, -[class^=" adminhtml-rma-"] .col-actions, -[class^=" adminhtml-rma-"] .col-default { - width: 50px; -} -[class^=" sales-"] .col-select, -[class^=" adminhtml-rma-"] .col-select { - width: 60px; -} -[class^=" sales-"] .col-qty, -[class*="-order-"] .col-qty-invoice, -[class*="-order-"] .col-ordered-qty, -[class^=" adminhtml-rma-"] .col-qty, -[class^=" adminhtml-rma-"] .col-condition { - width: 70px; -} -[class^=" sales-"] .col-refund, -[class^=" sales-transactions-"] .col-closed, -.sales-order-view .col-closed { - text-align: center; - width: 70px; -} -[class^=" sales-"] .col-order-number, -[class^=" sales-"] .col-invoice-number, -[class^=" sales-"] .col-memo-number, -[class^=" sales-"] .col-shipment-number, -[class^=" sales-"] .col-rma-number, -[class^=" sales-"] .col-status, -[class^=" adminhtml-rma-"] .col-order-number, -[class^=" adminhtml-rma-"] .col-rma-number, -[class^=" sales-transactions-"] .col-order-id, -.sales-order-view .col-refunded { - white-space: normal; - width: 75px; -} -[class^=" sales-"] .col-gtbase, -[class^=" sales-"] .col-gtpurchased { - text-align: right; - white-space: normal; - width: 75px; -} -[class^=" sales-"] .col-order-number, -[class^=" sales-"] .col-rma-number, -[class^=" adminhtml-rma-"] .col-order-number, -[class^=" adminhtml-rma-"] .col-rma-number { - text-align: left; -} -[class^=" adminhtml-rma-"] .col-status, -[class^=" adminhtml-rma-"] .col-reason, -[class^=" adminhtml-rma-"] .col-resolution, -[class^=" sales-transactions-"] .col-transaction-type, -.sales-order-view .col-memo { - width: 100px; -} -[class^=" sales-"] tr.headings .col-parent-transaction-id > span, -[class^=" sales-"] tr.headings .col-method > span, -[class^=" sales-"] tr.headings .col-transaction-id > span, -[class^=" sales-"] tr.headings .col-transaction-type > span, -[class^=" sales-"] tr.headings .col-gtbase > span, -[class^=" sales-"] tr.headings .col-gtpurchased > span, -[class*="-order-"] tr.headings .col-discont > span { - white-space: normal; -} -[class^=" sales-"] .col-period, -[class^=" adminhtml-rma-"] .col-period { - width: 150px; -} -[class^=" adminhtml-order-shipment-"] .col-carrier { - width: 190px; -} -.checkout-agreement-index .col-store-view { - white-space: nowrap; - width: 200px; -} -[class^=" sales-transactions-"] .log-details .data-table tbody tr th, -[class^=" sales-transactions-"] .col-key { - width: 22%; -} -.sales-order-index .col-1-layout table.data { - table-layout: fixed; - word-wrap: break-word; -} -[class^=" sales-"] .col-from-store { - width: 15%; -} -[class^=" sales-"] .col-2-left-layout .hor-scroll { - margin-bottom: -4px; - overflow: auto; - padding-bottom: 4px; - width: 100%; -} -[class*="-order-"] .order-totals .actions, -[class^=" adminhtml-rma-"] .col-qty, -[class^=" adminhtml-rma-"] .col-qty_ordered, -.sales-order-view .col-refunded { - text-align: right; -} -[class*="-order-"] .col-price .label, -[class*="-order-"] .col-subtotal .label { - display: inline-block; - min-width: 60px; - white-space: nowrap; -} -[class*="-order-"] .col-price .price-excl-tax .price, -[class*="-order-"] .col-price .price-incl-tax .price, -[class*="-order-"] .col-subtotal .price-excl-tax .price, -[class*="-order-"] .col-subtotal .price-incl-tax .price { - font-weight: bold; -} -[class*="-order-"] .grid .col-qty table, -[class*="-order-"] .grid .col-qty tbody, -[class*="-order-"] .grid .col-qty tr, -[class*="-order-"] .grid .col-qty td, -[class*="-order-"] .grid .col-ordered-qty table, -[class*="-order-"] .grid .col-ordered-qty tbody, -[class*="-order-"] .grid .col-ordered-qty tr, -[class*="-order-"] .grid .col-ordered-qty td { - background: none; - border: 0; -} -[class*="-order-"] .col-ordered-qty td { - padding: 0 5px 3px; -} -[class*="-order-"] .grid .product-title { - font-weight: bold; -} -[class*="-order-"] .item-options { - margin: 5px 0 5px 10px; -} -[class*="-order-"] .item-options dt { - font-weight: bold; -} -[class*="-order-"] .item-options dd { - margin: 0 0 0 10px; -} -.adminhtml-rma-item-attribute-edit .col-position input { - text-align: center; -} -.order-subtotal .label { - text-align: right; -} -.items-to-invoice { - border: 1px solid #c0bbaf; - margin-top: 13px; - width: 100%; -} -.items-to-invoice td, -table.items-to-invoice tbody tr:hover td { - background-color: #e6e3de; - border: 0; - text-align: center; -} -[class~=" -order-creditmemo-"] .no-items { - padding-top: 13px; - text-align: center; -} -.items-to-invoice .grand-total { - color: #19a3d1; - font-weight: bold; -} -.adminhtml-order-shipment-new .order-totals .fieldset-wrapper { - padding-top: 18px; -} -.adminhtml-order-shipment-new .actions { - float: right; -} -.creditmemo-totals .data-table input[type="text"] { - text-align: right; - width: 60px; -} -[class*="-order-"] .order-subtotal .label { - width: 80%; -} -.adminhtml-rma-new .rma-confirmation .actions { - margin-top: 10px; - text-align: right; -} -[class^=" adminhtml-rma-"] .rma-items th.col-qty span, -.adminhtml-rma-edit .rma-items th.col-qty span { - text-align: left; - white-space: normal; -} -.adminhtml-rma-edit .data-table .col-carrier, -[class^=" sales-billing-agreement-"] .log-details .data-table th { - width: 20%; -} -.adminhtml-rma-edit .data-table .col-title { - width: 35%; -} -.adminhtml-rma-edit .data-table .col-number { - width: 25%; -} -[class*="-order-"] .order-shipping-address .price, -.order-shipping-address .shipping-description-title { - font-weight: bold; -} -[class^=" adminhtml-rma-"] .col-actions a { - cursor: pointer; - white-space: nowrap; -} -[class^=" adminhtml-rma-"] .col-reason input[type="text"] { - margin: 5px 0 0; - width: 100%; -} -[class^=" adminhtml-rma-"] .col-actions .separator { - margin: 0 3px; -} -[class^=" sales-"] .order-payment-method .data-table { - margin-top: 15px; -} -[class^=" sales-"] .order-payment-currency { - margin-top: 15px; -} -[class^=" sales-"] .order-payment-additional { - margin-top: 15px; -} -[class^=" sales-"] .grid tbody td { - vertical-align: top; -} -[class^=" sales-"] .grid tbody.even tr td { - background: #e6e3de; -} -[class^=" sales-"] .grid tbody.odd tr td { - border-bottom: 0; - background: #f5f2ed; -} -[class^=" sales-"] .grid .data { - border-bottom: 1px solid #c0bbaf; -} -[class^=" sales-"] .grid td .option-label { - font-weight: bold; -} -[class^=" sales-"] .grid td .option-value { - margin: 0 0 0 10px; -} -.col-product .product_to_add { - float: right; -} -[class^=" adminhtml-extension-custom-"] #authors_fieldset .data-table td { - vertical-align: top; -} -/* - Packaging for Shipping Popup --------------------------------------- */ -#popup-window-mask, -.popup-window-mask { - background: rgba(0, 0, 0, 0.5); - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 999; -} -.packaging-window, -.packed-window { - background: #fff; - -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); - left: 50%; - margin: -200px 0 0 -471px; - position: fixed; - top: 50%; - width: 1000px; - z-index: 1000; -} -.packaging-window .entry-edit-head { - padding: 3px 5px; -} -.packaging-window .messages { - padding: 10px 26px 10px 32px; - border: 0; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - color: #963535; - text-shadow: none; - position: relative; - background: #f3dcd8; - border: 1px solid #963535; - margin-top: -1px; -} -.packaging-window .messages:before { - position: absolute; - left: 8px; - top: 50%; - margin-top: -11px; - background: none; - text-shadow: none; - width: auto; - height: auto; - border: 0; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - font-size: 16px; - content: '\e069'; - color: #963535; -} -.packaging-window .validation-failed { - background: #fef0ed; - border: 1px dashed #d6340e; -} -.packaging-window .packaging-content { - overflow: auto; - overflow-x: hidden; - height: auto !important; - max-height: 400px; -} -.packaging-window .package-options { - width: 100%; - border-top: 1px solid #ccc; - padding: 10px 0 0; - margin: 3px 0 0; -} -.packaging-window .package-options td { - vertical-align: middle; -} -.packaging-window .package-options .input-text { - width: 50px; -} -.packaging-window .package_prapare { - margin-bottom: 15px; -} -.packaging-window .package-options .customs-value { - width: 80px; -} -.packaging-window .package-options .options-weight { - width: 75px; -} -.packaging-window .package-options .options-units-weight { - width: 45px; -} -.packaging-window .package-options .options-units-dimensions { - width: 45px; -} -.packaging-window .package-options .options-content-type { - width: 120px; -} -.packaging-window .package-options input[type=text].disabled, -.packaging-window .package-options select.disabled { - background: #eee; -} -.packaging-window .package-options-contents { - border-top: 0; -} -.packaging-window .package-add-products { - margin: 20px 0 0; -} -.packaging-window .package-add-products .grid { - padding: 0; -} -.packaging-window .package-add-products .grid button { - vertical-align: middle; -} -.packaging-window .package-number { - font-weight: bold; -} -.packaging-window .package-number span { - margin-left: 5px; -} -.packed-window .entry-edit-head { - padding: 3px 5px; -} -.packed-window .packed-content { - padding: 10px 10px 0; - overflow: auto; - max-height: 400px; -} -.packed-window .package { - border-top: 1px solid #ededed; - margin-bottom: 30px; - padding: 10px; -} -.packed-window .package:first-child { - border-top: 0; -} -.package-info { - background: #e6e3de; - border: 1px solid #c0bbaf; -} -.package-info th { - font-weight: bold; -} -.packed-window .package-info table tbody tr td, -.packed-window .package-info table tbody tr th, -.package-info table tbody tr:nth-child(2n+1) td, -.package-info table tbody tr:nth-child(2n+1) th { - background: none; - border: 0; - padding: 5px 5px 2px; -} -.packed-window .package .grid { - padding: 0; -} -.packed-window .package-options { - width: 60%; -} -.packed-window .package-options td, -.packed-window .package-options th { - padding: 1px 0; -} -.grid .popup-window { - text-align: left; -} -.grid tr.on-mouse td .popup-window .data-table tbody tr:nth-child(2n+1) td, -.grid table tbody tr.on-mouse:nth-child(odd):hover td .popup-window .data-table tbody tr:nth-child(2n+1) td, -.grid table tbody tr.on-mouse:nth-child(odd):hover td .popup-window .data-table tbody tr:nth-child(2n+1):hover td, -.grid table tbody tr.on-mouse:nth-child(2n+1):hover td .popup-window .data-table tbody tr:nth-child(2n+1) td, -.grid table tbody tr.on-mouse:nth-child(2n+1):hover td .popup-window .data-table tbody tr:nth-child(2n+1):hover td, -.grid table tbody tr.on-mouse:hover td .popup-window .data-table tbody tr:nth-child(2n+1), -.grid table tbody tr.on-mouse:hover th .popup-window .data-table tbody tr:nth-child(2n+1) { - background-color: #fbfaf6; -} -.grid .popup-window { - text-align: left; -} -.popup-window-buttons-set { - text-align: right; - padding: 25px; -} -.popup-window-title { - background: #f3efea; - padding: 19px 20px; -} -.popup-window-title .title { - color: #676056; - display: block; - font-size: 20px; - line-height: 1; -} -.popup-window-title .actions { - float: right; -} -.popup-window-content { - padding: 25px 25px 0; -} -.popup-window-content > ul { - list-style: none; - padding: 0; -} -.packaging-window .col-weight { - text-align: left; - width: 60px; -} -.packaging-window .col-qty { - text-align: left; - width: 80px; -} -.packed-window .col-qty, -.packed-window .col-weight, -.packed-window .col-qty_ordered { - text-align: right; - width: 70px; -} -.packaging-window .col-select, -.packaging-window .col-measure { - text-align: center; - width: 35px; -} -.popup-fieldset-title .title { - color: #666; - display: inline-block; - font-size: 18px; - font-weight: normal; - padding: 7px 0 10px; -} -.popup-fieldset-title .actions { - float: right; -} -.packaging-window select { - margin-bottom: 0; -} -.packaging-window .col-width, -.packaging-window .col-height, -.packaging-window .col-length, -.packaging-window .data-table .col-total-weight input[type="text"] { - width: 60px; -} -.packaging-window .col-total-weight { - white-space: nowrap; - width: 100px; -} -.packaging-window .col-signature { - width: 160px; -} -.packaging-window .data-table .col-actions, -.packaging-window .col-total-weight { - white-space: nowrap; -} -.packaging-window .data-table .action-delete { - margin: 5px 0 0 5px; -} -.packaging-window .grid tr th { - border-bottom: 1px solid #c9c2b8; -} -.packaging-window .grid tr th:first-child, -.packaging-window .grid td:first-child, -.packaging-window .grid td:last-child { - border-left: 0; - border-right: 0; -} -.packaging-window .data-table .col-qty-edit { - white-space: nowrap; - width: 50px; -} -.packaging-window .data-table .col-qty-edit input[type="text"] { - width: 50px; -} -.sp-methods > dt { - font-weight: bold; -} -.sp-methods > dd { - margin: 5px 0 5px 15px; -} -.sp-methods > dd > ul { - list-style: none; - padding: 0; -} -[class*="-order-"] .order-billing-address .packaging-window .actions, -[class*="-order-"] .order-shipping-address .packaging-window .actions { - margin: 0; -} -/* - Popup Configuration Popup --------------------------------------- */ -#product_composite_configure_messages { - margin-left: 0 !important; - padding: 10px 15px; -} -.rma-popup, -.cms-popup { - background: #fff; - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); - cursor: default; - position: fixed; - left: 50%; - top: 50%; - z-index: 1000; -} -.rma-popup { - width: 540px; - margin: 0 0 0 -271px; -} -.rma-popup .entry-edit .fieldset { - border: none; -} -.rma-popup .validation-advice, -.rma-popup label.mage-error { - margin-left: 0; -} -.rma-popup .content { - background: #fff; - border-bottom: 1px solid #ccc; - max-height: 400px; - overflow: auto; -} -.rma-popup .content .grid { - padding: 0; -} -.rma-popup .content .grid table { - border-bottom: 1px solid #cbd3d4; -} -.rma-popup .product-options { - border-bottom: 1px solid #e7e7e7; - margin: 0 0 15px; - padding: 0 0 12px; -} -.rma-popup .product-options .required { - color: #333 !important; - font-weight: normal !important; -} -.rma-popup .product-options .required em { - color: #d40707; -} -.rma-popup .last-fieldset .product-options { - border: 0 none; - margin-bottom: 0; - padding-bottom: 0; -} -.rma-popup .buttons-set { - text-align: right; - margin: 0; - overflow: hidden; - padding: 7px 10px 8px; -} -.rma-popup .buttons-set { - width: 518px; -} -.cms-popup .buttons-set { - width: 289px; -} -.rma-popup .buttons-set button { - margin: 0 0 0 5px; -} -.grid .rma-popup .form-list tr, -.grid tr.even .rma-popup .form-list tr, -.grid tr.on-mouse .rma-popup .form-list tr { - background: #fff !important; -} -/* - URL rewrite --------------------------------------- */ -.adminhtml-urlrewrite-edit .field-url-rewrite-option-select .label { - width: auto; -} -/* - Shopping Cart Price Rule --------------------------------------- */ -.fieldset .field-coupon_code, -.fieldset .field-rule_use_auto_generation { - margin-bottom: 0; -} -.field-rule_use_auto_generation .label { - margin-left: 5px; -} -.field-rule_use_auto_generation .nested { - margin-bottom: 29px; -} -/* - Product Image Placeholders --------------------------------------- */ -#catalog_placeholder .input-file, -#catalog_placeholder .delete-image > input { - margin-right: 5px; -} -/* Permanent Redirect for old URL */ -.control > [name="product[url_key_create_redirect]"], -.control > [name="general[url_key_create_redirect]"] { - float: left; - margin: 8px 5px 0 0; -} -.control > [name="product[url_key_create_redirect]"] + .label, -.control > [name="general[url_key_create_redirect]"] + .label { - width: auto; -} -/* - New Product Attribute Set --------------------------------------- */ -.field-skeleton_set .select { - width: 100%; -} -#affected-attribute-set-form .fieldset .field { - margin-bottom: 12px; -} -#affected-attribute-set-form .fieldset .field:last-child { - margin-bottom: 0; -} -/* - Cache Management --------------------------------------- */ -.additional-cache-management .label { - margin-top: 5px; -} -/* - Currency Symbols --------------------------------------- */ -.adminhtml-system-currencysymbol-index th.col-symbol .required:after { - content: '*'; - margin-left: 3px; -} -.adminhtml-system-currencysymbol-index td.col-currency .label { - margin-top: 5px; -} -/* - Categories --------------------------------------- */ -.category-content .form-inline.permissions-custom-options .messages li { - margin-top: 0; -} -.category-content .form-inline.permissions-custom-options .data-table { - margin-bottom: 25px; -} -/* - Marketing - Email Reminders --------------------------------------- */ -.lt-1280 .adminhtml-reminder-edit #customerGrid .grid .filter .range div.date { - min-width: 0; -} -/* - Customers - Manage Shopping Cart --------------------------------------- */ -.checkout-index-index .products-search { - margin-top: 35px; -} -.checkout-index-index .products-search > .actions { - text-align: right; - margin: 10px 0; -} -.checkout-index-index .shopping-cart-items > .actions { - margin-bottom: 15px; -} -.checkout-index-index .shopping-cart-items .box-left, -.checkout-index-index .shopping-cart-items .box.right { - width: 49%; -} -.checkout-index-index .shopping-cart-items .box-left fieldset, -.checkout-index-index .shopping-cart-items .box.right fieldset { - border-radius: 5px; -} -.checkout-index-index .shopping-cart-items .box-left { - float: left; -} -.checkout-index-index .shopping-cart-items .box.right { - float: right; -} -.checkout-index-index .grid table .action-configure { - float: right; -} -/* - Clearfix --------------------------------------- */ -.shopping-cart-items:before, -.shopping-cart-items:after, -.image-panel:before, -.image-panel:after, -.images:before, -.images:after, -.tax-rate-popup .field:before, -.tax-rate-popup .field:after, -.clearfix:before, -.clearfix:after, -#tab_content_downloadableInfo .data-table td .row:before, -#tab_content_downloadableInfo .data-table td .row:after { - content: ""; - display: table; -} -.shopping-cart-items:after, -.image-panel:after, -.images:after, -.tax-rate-popup .field:after, -.clearfix:after, -#tab_content_downloadableInfo .data-table td .row:after { - clear: both; -} -.debug { - border: 1px solid red !important; -} -/* - Accordion -------------------------*/ -.accordion { - margin: 0 0 8px; - padding: 0; -} -.accordion > dt, -.accordion > dd.open, -.accordion .collapseable, -.section-config.active > .collapseable + input + fieldset, -.accordion .collapseable.open + input + fieldset { - background: #fff; - border: 1px solid #eae6e0; - border-radius: 5px; - margin: 0 0 8px; - padding: 5px 18px 2px; - position: relative; -} -.accordion > dt + dd { - display: none; -} -.accordion > dt.open, -.section-config.active > .collapseable, -.accordion .collapseable.open { - margin: 0; - border-bottom: 0; - border-radius: 5px 5px 0 0; -} -.section-config.active > .collapseable + input + fieldset, -.accordion > dt + dd.open, -.accordion .collapseable.open + input + fieldset { - padding: 25px 18px 18px; - display: block; - border-top: 0; - border-radius: 0 0 5px 5px; -} -.section-config > .collapseable > a, -.accordion > dt a, -.accordion .collapseable > a { - color: #676056; - font-size: 20px; - font-weight: 400; - display: block; - padding: 7px 0 10px 22px; - text-decoration: none; - position: relative; - cursor: pointer; -} -.section-config > .collapseable > a i, -.accordion > dt a i, -.accordion .collapseable > a i { - color: #676056; - font-size: 20px; - font-style: italic; - font-weight: 400; -} -.section-config.active > .collapseable > a, -.accordion .collapseable.open a, -.accordion dt.open a { - border-bottom: 1px solid #ededed; -} -.section-config > .collapseable > a:before, -.accordion > dt a:before, -.accordion .collapseable > a:before { - position: absolute; - left: 0; - top: 7px; - font-family: 'MUI-Icons'; - font-style: normal; - speak: none; - font-weight: normal; - -webkit-font-smoothing: antialiased; - content: '\e02a'; - /* arrow right icon */ - color: #b2b0ad; -} -.section-config.active > .collapseable > a:before, -.accordion > dt.open a:before, -.accordion .collapseable.open a:before { - content: '\e02c'; - /* arrow down icon */ -} -.section-config > .collapseable > a:hover:before, -.accordion > dt a:hover:before, -.accordion .collapseable > a:hover:before { - color: #7e7e7e; -} -/* PayPal connected */ -.section-config.complex .section-config.with-button { - padding: 20px 15px; - margin: 0 -30px 0 -15px; - border-bottom: 1px solid #eae6e0; -} -.section-config.complex tr:last-child .section-config.with-button { - border-bottom: 0; -} -.section-config.complex .section-config.with-button > .entry-edit-head { - padding: 0; - padding-left: 25px; - border: 0; -} -.section-config.complex .section-config.with-button.enabled > .entry-edit-head:before { - content: "\e01e"; - color: #fff; - background: #65940a; - font-family: "MUI-Icons"; - font-weight: normal; - padding: 3px; - font-size: 10px; - width: 10px; - height: 10px; - line-height: 10px; - overflow: hidden; - border-radius: 8px; - display: block; - float: left; - margin-left: -25px; - margin-top: 0; -} -.section-config.complex .section-config.with-button > .config { - margin: 10px -10px; - border: 1px solid #d1d0ce; - border-radius: 5px; - padding: 5px 0; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr > td { - padding: 0; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr > td > .section-config > .entry-edit-head { - border: 0; - border-radius: 0; - margin-bottom: 0; - padding: 5px 10px 2px; - border-bottom: 1px solid #d1d0ce; - background: transparent; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr:last-child > td > .section-config > .entry-edit-head { - border: 0; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr > td > .section-config > .entry-edit-head a { - border-bottom: 0; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr > td > .section-config > .config { - border: 0; - border-bottom: 1px solid #d1d0ce; - border-radius: 0; - margin: 0; - padding-bottom: 50px; -} -.section-config.complex .section-config.with-button > .config > table > tbody > tr:last-child > td > .section-config > .config { - border-bottom: 0; -} -.section-config .config h4 { - padding-left: 25%; - font-size: 18px; -} -.section-config .config td.label label.enabled:before { - content: "\e01e"; - color: #fff; - background: #65940a; - font-family: "MUI-Icons"; - font-weight: normal; - padding: 3px; - font-size: 10px; - width: 10px; - height: 10px; - line-height: 10px; - overflow: hidden; - border-radius: 8px; - display: block; - float: left; - margin-right: 5px; -} -.section-config.complex .section-config.with-button > .config:before { - content: ''; - height: 9px; - width: 20px; - overflow: hidden; - display: block; - position: absolute; - bottom: 100%; - left: 50%; - zoom: 1; - z-index: 2; - margin-left: -10px; - background: url(../images/subconfig-bg.png) no-repeat 0 0; -} -.section-config.config-advanced { - padding: 30px 0 0; -} -.section-config.config-advanced > .entry-edit-head { - border: 0; - padding: 0; - padding-left: 25%; -} -.section-config.config-advanced > .entry-edit-head a { - border: 0 !important; -} -.section-config.config-advanced > .config { - padding-left: 0!important; - padding-right: 0!important; - border: 0!important; - border-radius: 0!important; -} -.section-config.config-advanced > .entry-edit-head a { - margin-left: -22px; -} -.section-config.with-button .config-heading strong { - display: block; - color: #676056; - font-size: 14px; - font-weight: 700; - margin-bottom: 5px; -} -.section-config.with-button .config-heading .button-container { - margin: 15px 0 0; -} -.section-config.with-button .button-container { - line-height: 28px; -} -.section-config.with-button .button-container a { - margin-left: 20px; -} -.section-config.with-button .action-configure span { - display: block; - position: relative; - text-align: center; -} -.section-config.with-button .action-configure .state-opened { - visibility: hidden; - height: 0; - overflow: hidden; -} -.section-config.with-button .action-configure.open .state-opened { - visibility: visible; - height: auto; - overflow: auto; -} -.section-config.with-button .action-configure.open .state-closed { - visibility: hidden; - height: 0; - overflow: hidden; -} -.accordion > dt + dd { - display: none; -} -.accordion > dt + .open:empty { - background: #ffffff url(../mui/images/ajax-loader-big.gif) no-repeat center; - height: 100px; -} -/* TODO: arrange configuration tables */ -.accordion .collapseable.disabled { - background: #f1f1f1; -} -.accordion .collapseable.disabled > a { - cursor: not-allowed; -} -.accordion .collapseable.disabled > a:before { - content: ''; -} -.accordion .config { - border: 0; -} -.accordion .config .comment a { - color: #007dbd; - font-size: 14px; - font-weight: 400; -} -.accordion .config .comment a:focus, -.accordion .config .comment a:hover { - text-decoration: underline; -} -.accordion .config legend { - display: none; -} -.accordion .config table { - width: 100%; -} -.accordion .config .label { - float: none; - width: 25%; - text-align: right; - color: #676056; - font-size: 13px; - font-weight: 600; -} -.accordion .config .value .label { - padding: 6px 5px 0 15px; - vertical-align: top; - width: auto; -} -.accordion .config .value .label:first-child { - padding-left: 0; -} -.accordion .config .label label { - padding-top: 6px; -} -.accordion .config td { - background: none; - border: 0; - padding: 8px 15px 0 0; - vertical-align: top; -} -.accordion .paypal-selection-simplified { - padding-left: 30px; -} -.accordion .paypal-selection input[type="checkbox"] { - margin: -4px 7px 0 0; -} -.accordion .config input[type="text"], -.accordion .config input[type="password"], -.accordion .config select, -.accordion .config textarea { - width: 100%; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.accordion .config input.input-file { - margin-top: 4px; -} -.accordion .config select.select-date { - width: 20%; -} -.accordion .config .value { - width: 50%; - padding-right: 40px; -} -.accordion .config .value.with-tooltip { - padding-top: 5px; -} -.accordion .config .value.with-tooltip .tooltip { - position: relative; - top: 0; - left: 0; - right: 0; - bottom: 0; - margin: 0; - float: right; - margin-right: -20px; - margin-top: 6px; -} -.accordion .config .value.with-tooltip .tooltip-content { - padding: 18px; - margin: 0 -17px 10px 0; - right: 0; - bottom: 100%; - width: 239px; - max-width: 239px; - font-size: 13px; - line-height: 1.4; - background: #31302b; - background: rgba(49, 48, 43, 0.8); - border-radius: 5px; -} -.accordion .config .value.with-tooltip .tooltip-content:before { - content: ''; - position: absolute; - width: 0; - height: 0; - top: auto; - bottom: -5px; - left: auto; - right: 20px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 5px solid #31302b; - border-bottom: 0; - opacity: .8; -} -.accordion .config .value.with-tooltip .help { - position: relative; - width: auto; - margin: 0; -} -.accordion .config .scope-label { - color: #999; - font-size: 12px; - letter-spacing: 0.05em; - padding: 15px 15px 0 0; -} -.accordion .config .note { - color: #676056; - font-size: 12px; - font-weight: 400; - padding-left: 15px; - margin: 5px 0; -} -.accordion .config .note a { - color: #007dbd; - font-size: 12px; - font-weight: 400; -} -.accordion .config .note a:focus, -.accordion .config .note a:hover { - text-decoration: underline; -} -.accordion .config .note:before { - position: absolute; - margin: 4px 0 0 -14px; - content: ''; - display: inline-block; - vertical-align: top; - font-size: 0; - line-height: 0; - width: 0; - border-bottom: 5px solid #666; - border-left: 5px solid transparent; - border-right: 5px solid transparent; -} -.accordion .config .system-tooltip-box { - position: absolute; -} -.accordion .paypal-selection { - margin: 10px; - width: 98%; -} -.accordion .paypal-selection th { - padding: 6px 10px 7px; -} -.accordion .paypal-selection { - border-bottom: 2px solid #c0bbaf; -} -.accordion .paypal-payment-notice { - margin: 10px; -} -.accordion .custom-options { - border: 1px solid #999; - padding: 0 10px; - margin: 0 0 20px; -} -/* TODO: arrange range inputs width in tables */ -.grid td input.input-text-range { - width: 35%; -} -.grid td input.input-text-range-date { - width: 31%; -} -/* TODO: styles for required TH fields */ -th.required:after { - color: red; - content: "*"; - margin-left: 5px; -} -/* TODO: set color for messages in Cache Storage Management */ -.grid-severity-critical, -.grid-severity-major, -.grid-severity-notice, -.grid-severity-minor { - display: block; - border: 1px solid #c76f35; - background: #fffbf0; - text-align: center; -} -.grid-severity-critical { - border-color: #6e1313; - background: #f7bfbf; - color: #6e1313; -} -.grid-severity-major { - border-color: #963535; - background: #f3dcd8; - color: #963535; -} -.grid-severity-notice { - border-color: #185b00; - background: #e6ecc0; - color: #185b00; -} -/* - Sales --------------------------------------- */ -.order-items .entry-edit-head .form-buttons { - float: right; -} -.order-items .entry-edit-head .icon-head { - display: inline; -} -.order-items .entry-edit-head { - margin-bottom: 20px; -} -.order-items .entry-edit-head:before, -.order-items .entry-edit-head:after { - content: ""; - display: table; -} -.order-items .entry-edit-head:after { - clear: both; -} -/* - Import-export tax rates --------------------------------------- */ -.import-export-tax-rates input[type=file] { - margin-right: 10px; -} -.import-tax-rates, -.export-tax-rates { - float: left; - width: 48.9362%; -} -.export-tax-rates { - margin-left: 2.12766%; -} -.import-export-tax-rates:before, -.import-export-tax-rates:after { - content: ""; - display: table; -} -.import-export-tax-rates:after { - clear: both; -} -/* - Product --------------------------------------- */ -.tier { - margin: 20px 0 0; -} -/* - Edit attribute set --------------------------------------- */ -.attribute-set-col { - display: block; - float: left; - width: 100%; - margin-left: 2.127659574%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - width: 31.9149%; -} -.attribute-set-col:first-child { - margin-left: 0; -} -.attribute-set-tree { - margin-top: 5px; - overflow: auto; - height: 400px; - width: 100%; -} -.attribute-set:before, -.attribute-set:after { - content: ""; - display: table; -} -.attribute-set:after { - clear: both; -} -/* - Manage Categories --------------------------------------- */ -.catalog-category-edit .category-edit-title { - float: left; -} -/* - Catalog Price Rule --------------------------------------- */ -.rule-tree-wrapper { - line-height: 28px; -} -.rule-tree ul { - list-style: none; - padding-left: 16px; - border-left: dotted 1px #888; -} -.rule-tree li { - margin: 0 0 10px; -} -.rule-tree .x-tree ul { - padding-left: 0 !important; - border-left: none !important; -} -.rule-param .label { - color: #000; - float: none; - text-align: left; - padding: 0; - vertical-align: baseline; - width: auto; -} -.rule-param .label-disabled { - color: #eee; - cursor: default; - text-decoration: none; -} -.rule-chooser, -.rule-param .element, -.rule-param-edit .label { - display: none; -} -.rule-param input, -.rule-param select { - width: auto !important; - margin: 0; - min-width: 170px; -} -.rule-param-edit .element { - display: inline; -} -.rule-param-edit .element .addafter { - padding-left: 5px; -} -[class^="rule-param-"] img, -.rule-chooser-trigger img { - vertical-align: middle; -} -.rule-chooser { - border: solid 1px #CCC; - margin: 20px; - padding: 15px 10px 5px; -} -.rule-param-wait { - background: url(../mui/images/ajax-loader-small.gif) no-repeat left center; - padding-left: 20px; -} -/* - - URL Rewrite --------------------------------------- */ -.field-url-rewrite-option-select { - padding-top: 13px; -} -/* jstree */ -.jstree-default .disabled > a { - color: #a29c94; -} -/* File brouser */ diff --git a/app/design/adminhtml/Magento/backend/css/pages.less b/app/design/adminhtml/Magento/backend/css/pages.less new file mode 100644 index 0000000000000000000000000000000000000000..9818e97b3c1571076ef3885e8cfa19fd99667f60 --- /dev/null +++ b/app/design/adminhtml/Magento/backend/css/pages.less @@ -0,0 +1,2057 @@ +/** +// * Magento +// * +// * NOTICE OF LICENSE +// * +// * This source file is subject to the Academic Free License (AFL 3.0) +// * that is bundled with this package in the file LICENSE_AFL.txt. +// * It is also available through the world-wide-web at this URL: +// * http://opensource.org/licenses/afl-3.0.php +// * If you did not receive a copy of the license and are unable to +// * obtain it through the world-wide-web, please send an email +// * to license@magentocommerce.com so we can send you a copy immediately. +// * +// * DISCLAIMER +// * +// * Do not edit or add to this file if you wish to upgrade Magento to newer +// * versions in the future. If you wish to customize Magento for your +// * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +@import "../less/styles/vars.less"; + +/* + Product Creation +-------------------------------------- */ + +// /* Action "Back" as cross */ +// [class^=" catalog-product-"] .page-actions .action-back, +// [class^=" catalog-product-"] .page-actions .action-back:hover, +// [class^=" catalog-product-"] .page-actions .action-back:active, +// [class^=" newsletter-"] .page-actions .action-back, +// [class^=" newsletter-"] .page-actions .action-back:hover, +// [class^=" newsletter-"] .page-actions .action-back:active { +// overflow: hidden; +// padding: 5px 6px 3px; +// margin-left: 12px; +// color: #7a7976; +// } + +// .sales-order-create-index .page-actions-inner .cancel, +// .sales-order-create-index .page-actions-inner .cancel:hover, +// .sales-order-create-index .page-actions-inner .cancel:active { +// filter: none; +// border: 0; +// } + +// [class^=" catalog-product-"] .page-actions .action-back:hover, +// [class^=" newsletter-"] .page-actions .action-back:hover, +// .sales-order-create-index .page-actions-inner .cancel:hover { +// color: #000; +// } + +[class^=" catalog-product-"] .page-actions .action-back.mage-error, +[class^=" newsletter-"] .page-actions .action-back.mage-error { + color: #b57c72; +} + +// [class^=" catalog-product-"] .page-actions .action-back:before, +// [class^=" newsletter-"] .page-actions .action-back:before, +// .sales-order-create-index .page-actions-inner .cancel:before { +// display: inline-block; +// font-family: 'MUI-Icons'; +// font-style: normal; +// speak: none; +// font-weight: normal; +// -webkit-font-smoothing: antialiased; +// content: '\e07d'; /* close icon */ +// font-size: 16px; +// } + +// [class^=" catalog-product-"] .page-actions .action-back span, +// [class^=" newsletter-"] .page-actions .action-back span, +// .sales-order-create-index .page-actions-inner .cancel span { +// display: inline-block; +// overflow: hidden; +// text-indent: -999em; +// } + +// .page-actions .switcher { +// display: inline-block; +// vertical-align: top; +// margin: 6px 17px 6px 6px; +// } + +.field-weight .control .field:first-child { + width: 36%; + margin-right: 15px; +} + +#allow_open_amount { + margin-top: 8px; +} + +.catalog-product-new .user-defined.type-select select, +.catalog-product-edit .user-defined.type-select select { + width: 100%; +} + +#tab_content_downloadableInfo .data-table td { + vertical-align: top; + .row { + margin-bottom: 10px; + } +} + +/* + Customer +---------------------------------------*/ +.customer-index-edit .grid tr.headings th > span { + white-space: normal; +} + +#customer_info_tabs_account_content #_accountsendemail { + margin-top: 8px; +} + +.customer-information:before, +.customer-information:after { + content: ""; + display: table; +} + +.customer-information:after { + clear: both; +} + +.customer-information .data-table, +.customer-information address { + width: 48.5%; +} + +.customer-information .data-table { + float: left; + width: 48.5%; +} + +.customer-information address { + padding-top: 4px; + line-height: 2.2; + float: right; +} + +.address-list { + list-style: none; + width: 278px; + margin: 0 0 10px; + padding: 0; + float: left; +} + +.address-list li { + border: 1px solid #d9d2ca; + background: #f7f2ec; + padding: 10px 10px 15px; + cursor: pointer; + margin-bottom: -1px; +} + +.address-list li.ui-state-active { + background: #fff; + position: relative; + box-shadow: 0 1px 1px 0 rgba(217, 210, 202, 1); + margin-left: -2px; + padding-left: 12px; +} + +.address-list li.ui-state-active:before, +.address-list li.ui-state-active:after { + position: absolute; + font-family: 'MUI-Icons'; + font-style: normal; + font-weight: normal; + font-size: 18px; + color: #fff; + content: "\e02a"; + speak: none; + line-height: 11px; + width: 10px; + right: -9px; + text-indent: -6px; + top: 50%; + margin-top: -5px; + z-index: 2; +} + +.address-list li.ui-state-active:before { + color: #d9d2ca; + right: -11px; + z-index: 1; +} + +.address-list li.address-list-actions:before, +.address-list li.address-list-actions:after { + display: none; +} + +.address-list li.address-list-actions { + padding: 20px 0 0 0; + border: 0; + background: none; + box-shadow: none; + cursor: default; +} + +.address-list li.address-list-actions:first-child { + padding: 0; +} + +.address-list .label { + float: none; + width: auto; + padding: 0 0 0 10px; +} + +.address-list input[type="checkbox"] { + float: left; +} + +.address-list address:first-line { + /* its not work if First Name and Last Name in two lines */ + font-weight: bold; +} + +.address-list address { + margin: 0 20px 15px 0; + line-height: 1.5; +} + +.address-list-item-actions { + float: right; +} + +.address-list .action-edit { + display: none; +} + +.address-list .field { + margin-bottom: 15px; +} + +.ui-tabs-nav .address-list-item a { + text-decoration: none; + color: #676056; +} + +.address-item-edit { + margin-left: 277px; +} + +.address-item-edit-content { + border: 1px solid #dad1c8; + background: #fff; + box-shadow: 0 2px 1px 0 rgba(217, 210, 202, 0.5); + padding-left: 10px; +} + +.address-item-edit-content .fieldset:last-child { + margin-bottom: 29px; +} + +.address-item-edit .legend { + border-bottom: 0; + margin: 0 0 18px; + padding-left: 20%; +} + +.address-item-edit .legend span { + padding-left: 0; +} + +.address-item-edit-actions { + padding: 0 0 18px 20%; +} + +/* + Configuration -> Design +-------------------------------------- */ +#row_design_theme_ua_regexp .design_theme_ua_regexp { + float: left; + width: 100%; +} +#row_design_theme_ua_regexp .tooltip { + margin-top: 8px; +} +#row_design_theme_ua_regexp .note { + clear: both; +} + +/* + Configuration -> Payment Methods +-------------------------------------- */ +.adminhtml-system-config-edit .payflow-settings-notice .important-label { + .style32(); +} + +.adminhtml-system-config-edit .payflow-settings-notice ul.options-list strong { + .style28(); +} + +/* + CMS -> Banners +-------------------------------------- */ + +/* Banner Properties */ +#banner_properties_customer_segment_ids { + min-width: 20%; +} + +/* Content */ + +.field-store_default_content .buttons-set { + margin-bottom: 9px; +} + +.field-store_default_content .buttons-set button { + margin-right: 4px; +} + +.field-store_0_content_use input[type="checkbox"] { + margin-right: 3px; + position: relative; + top: 2px; +} + +/* + CMS -> Manage Hierarchy +-------------------------------------- */ + +.cms-hierarchy .cms-scope { + float: right; + margin-right: 25px; + position: relative; + top: 2px; +} + +.cms-hierarchy #tree-container { + margin-top: 25px; + overflow: auto; + padding-bottom: 10px; +} + +.cms-hierarchy .buttons-set { + margin-bottom: 10px; +} + +.cms-hierarchy .cms-hierarchy-tree { + width: 48.93617020799999%; + float: left; + margin: 10px 0 8px 0; +} + +.cms-hierarchy .cms-hierarchy-node { + width: 48.93617020799999%; + float: left; + margin: 10px 0 8px 2.127659574%; +} + +.cms-hierarchy #cms_page_grid_container { + clear: both; +} + +.cms-hierarchy .store-switcher { + position: relative; + top: 10px; +} + +.cms-hierarchy .store-switcher label { + margin-right: 8px; +} + +.cms-hierarchy-node #node_properties_fieldset #node_preview { + position: relative; + top: 6px; +} + +.cms-hierarchy-node .form-inline .label { + width: 30%; +} + +/* + CMS -> Widgets +-------------------------------------- */ + +#widget_instace_tabs_properties_section_content .widget-option-label { + margin-top: 6px; +} + +/* + CMS -> Static Blocks +-------------------------------------- */ + +#buttonsblock_content.buttons-set { + margin-bottom: 9px; +} + +#buttonsblock_content.buttons-set button { + margin-right: 4px; +} + +/* + CMS -> Manage Content +-------------------------------------- */ + +/* Content */ + +.cms-manage-content-actions .buttons-set { + margin-bottom: 9px; +} + +.cms-manage-content-actions .buttons-set button { + margin-right: 4px; +} + +.cms-manage-content-actions textarea { + width: 100%; +} + +/* + System -> Action Log -> Report +-------------------------------------- */ +.adminhtml-logging-details .log-details-grid table { + th { + border: 1px solid #c9c2b8; + border-width: 0 0 1px; + padding: 6px 10px 7px; + background: #fff; + .style2(); + + span { + border: 0; + padding: 0; + } + } + + td { + border: none; + padding: 6px 10px 7px; + background: #fff; + } + + tr:last-child td { + border: 1px solid #eae8e4; + border-width: 0 0 1px; + } + + tr.on-mouse { + cursor: inherit; + } + + tr:nth-child(odd) td, + tr.on-mouse:nth-child(odd):hover td { + background: #fbfaf6; + } +} + +// +// System -> Roles +// -------------------------------------- + +#gws_container ul { + padding: 0; + margin: 0; + list-style: none; +} + +#gws_container ul ul { + margin: .8em 0 .8em 1.4em; +} + +#gws_container input[type="checkbox"] { + margin-right: 3px; + position: relative; + top: -1px; +} + +// +// Reports +// -------------------------------------- */ +.reports-title .page-actions { + float: right; +} + +.reports-title .store-switcher { + padding: 14px 0 18px; +} + +.reports-content select { + width: 160px; +} + +.reports-content input.hasDatepicker { + width: 133px; +} + +.reports-content .required .control { + position: relative; +} + +.reports-content input.hasDatepicker + label.mage-error { + left: 0; + position: absolute; + top: 30px; +} + +.reports-title:before, +.reports-title:after { + content: ""; + display: table; +} + +.reports-title:after { + clear: both; +} + +// +// Reports - PayPal Settlement Reports +//-------------------------------------- + +.adminhtml-paypal-reports-index .grid tr.headings th > span { + white-space: normal; +} + +.adminhtml-paypal-reports-index .col-transaction_event_code { + max-width: 150px; +} + +.adminhtml-paypal-reports-index .col-amount, +.adminhtml-paypal-reports-index .col-fee-amount { + text-align: right; +} + +/* + Newsletter Templates +-------------------------------------- */ +.newsletter-template-index .col-id { + width: 35px; +} + +.newsletter-template-index .col-actions { + width: 80px; +} + +.newsletter-template-index .col-type { + width: 100px; +} + +.newsletter-template-index .col-added, +.newsletter-template-index .col-updated { + width: 140px; +} + +[class^=' newsletter-'] .buttons-set { + margin: 0 0 15px; +} + +[class^=" newsletter-"] .buttons-set button { + margin-right: 4px; +} + +/* + Newsletter - Queue +-------------------------------------- */ +.newsletter-queue-index .col-id { + width: 35px; +} + +.newsletter-queue-index .col-finish, +.newsletter-queue-index .col-start { + width: 130px; +} + +.newsletter-queue-index .col-status, +.newsletter-queue-index .col-processed, +.newsletter-queue-index .col-recipients { + white-space: nowrap; + width: 85px; +} + +.newsletter-queue-index td.col-processed, +.newsletter-queue-index td.col-recipients { + text-align: right; +} + +.newsletter-queue-index .col-actions { + width: 80px; +} + +/* + Newsletter - Subscribers +-------------------------------------- */ +.newsletter-subscriber-index .col-id { + width: 35px; +} + +.newsletter-subscriber-index .col-type { + width: 75px; +} + +.newsletter-subscriber-index .col-status { + white-space: nowrap; + width: 85px; +} + +/* + Newsletter - Problems +-------------------------------------- */ +.newsletter-problem-index .col-select { + width: 25px; +} + +.newsletter-problem-index .col-id { + width: 35px; +} + +.newsletter-problem-index .col-start { + width: 130px; +} + +.newsletter-problem-index .col-error-code { + width: 150px; +} + + +.table-fieldset-alt, +.type-options { + margin-bottom: 20px; +} + +.table-fieldset-alt thead th, +.table-fieldset-alt tbody tr td { + border-width: 0; +} + +.table-fieldset-alt tbody tr:nth-child(odd) td, +.table-fieldset-alt tbody tr:nth-child(odd):hover td { + background: #fff; +} + +/* + System - Tax +--------------------------------------*/ +.tax-rate-popup .ui-dialog-content.ui-widget-content { + padding: 10px 10px 0; +} + +.tax-rate-popup .fieldset { + margin: 0; +} + +.tax-rate-popup .field { + margin-bottom: 20px; +} + +.tax-rate-popup .field .label { + margin: 5px 0 0 0; + width: 26%; + padding: 0 20px 0 0; + float: left; + text-align: right; + box-sizing: content-box; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + -ms-box-sizing: content-box; +} + +.tax-rate-popup .field .control { + width: 58%; + margin: 0; + float: left; +} + +.tax-rate-popup .field .control select, +.tax-rate-popup .field .control .input-text { + width: 100%; +} + +.tax-rate-popup .field-rate .control .input-text { + width: 50%; +} + +.tax-rate-popup .field-rate label.mage-error { + display: block; +} + +.tax-rate-popup .tax-rate-titles-note-td { + margin-left: 26%; + padding-left: 20px; +} + +.field-tax_rate, +.field-tax_customer_class, +.field-tax_product_class { + position: relative; +} + +.mselect-hidden + .mage-error { + position: absolute; + top: 100%; +} + +/* + Tags +-------------------------------------- */ +.tag-title { + overflow: hidden; +} + +.tag-title .page-actions { + float: right; +} + +/* + Attribute Mapping +-------------------------------------- */ +.field-attributes_box .control-value { + width: 100%; +} + +.adminhtml-googleshopping-types-new #attribute_set { + padding: 0; +} + +.adminhtml-googleshopping-types-new #gcontent_attributes_container { + margin-top: -6px; +} + + +/* + Sales +-------------------------------------- */ + +#order-totals strong { + .style28(); +} + +#order-shipping-method-summary a { + .style3(); +} + +.order-sidebar { + float: left; + width: 22%; +} + +.customer-current-activity-inner { + padding: 18px; +} + +.order-currency { + padding: 18px; +} +.order-detail { +} +.order-details-existing-customer { + background: #fff; + padding-left: 0; + position: relative; + width: 77.9%; + float: right; +} + +.order-billing-address, +.order-billing-method, +[class*="-order-"] .order-history, +[class*="-order-"] .order-comments-history, +[class*="-order-"] .order-information, +[class*="-order-"] .order-billing-address, +[class*="-order-"] .order-payment-method, +[class^=" adminhtml-rma-"] .order-comments-history, +[class^=" adminhtml-rma-"] .order-shipping-address, +[class^=" adminhtml-rma-"] .rma-request-details { + float: left; + width: 49.5%; +} + +.order-shipping-address, +.order-shipping-method, +[class*="-order-"] .order-totals, +[class*="-order-"] .order-account-information, +[class*="-order-"] .order-shipping-address, +[class*="-order-"] .order-payment-method-virtual, +[class*="-order-"] .order-shipping-method, +[class^=" adminhtml-rma-"] .rma-confirmation, +[class^=" adminhtml-rma-"] .order-shipping-method, +[class^=" adminhtml-rma-"] .order-return-address { + float: right; + width: 49%; +} + +[class*="-order-"] { + .order-card-validation { + width: 49.5%; + box-sizing: border-box; + + .actions { + margin-top: 17px; + } + } + .order-totals { + .field.choice { + margin: 20px 0; + } + } +} + +#order-data .order-account-information { + float: none; + width: auto; +} + +[class^=" sales-"] .order-information .fieldset-wrapper > .fieldset-wrapper-title .title { + width: 100%; +} + +#order-data .actions .action-add, +#order-data .actions .action-delete, +#order-customer-selector .actions .action-add { + margin: 0 0 0 20px; +} + +#order-data .order-methods ul { + list-style: none; + margin: 0; + padding: 0; +} + +#order-data .order-methods dl, +#order-data .order-methods dt, +#order-data .order-methods dd, +#order-data .payment-methods dl, +#order-data .payment-methods dt, +#order-data .payment-methods dd { + margin: 0; + padding: 0; +} + +#order-data .order-methods dd + dt, +#order-data .payment-methods dd + dt { + margin-top: 17px; +} + +#order-data .order-methods dt, +#order-data .payment-methods dt { + margin: 0 0 8px; +} + +.order-coupons .box-left, +.order-gift-options .box-left { + float: left; + width: 49%; +} + +.order-coupons .box-right, +.order-gift-options .box-right { + float: right; + width: 49%; +} + +.order-gift-options .box-left:last-child, +.order-gift-options .fieldset-wrapper-title + .box-right { + float: none; + width: auto; +} + +.order-coupons .content { + .action- { + vertical-align: top; + } + input[type="text"] { + height: 28px; + } +} + +.order-gift-options { + fieldset { + border-radius: 5px; + } + + .gift-wrapping-form select { + margin-left: 10px; + } + + .giftmessage-entire-order textarea { + height: 6em; + width: 100%; + } + + .giftmessage-whole-order-container { + textarea { + height: 6em; + width: 100%; + } + .actions { + margin-left: 20%; + } + } +} + +.ui-dialog.gift-options-popup .ui-dialog-content { + padding: 25px; +} + +.ui-dialog.gift-options-popup .ui-dialog-content h4 { + margin: 0 0 17px; +} + +.gift-options-tooltip { + background: #fff; + border-radius: 5px; + padding: 10px; + box-shadow: 0 0 3px rgba(0, 0, 0, .3); +} + +#order-data .box-left fieldset, +#order-data .box-right fieldset { + border-radius: 5px; +} + +.adminhtml-rma-new .order-totals, +.order-comments-history .order-comments-history, +[class^=" adminhtml-rma-"] .rma-comments-history { + float: none; + width: 100%; +} + +[class*="-order-"] .order-billing-address .actions, +[class*="-order-"] .order-shipping-address .actions { + margin: 17px 0; +} + +[class*="-order-"] .order-billing-address .control + label, +[class*="-order-"] .order-shipping-address .control + label { + margin: 17px 0 0; +} + +.sales-order-create-index #order-message .messages .message, +.sales-order-edit-index #order-message .messages .message { + margin: 0 0 60px; +} + +// +// Sales -> Create Order +// -------------------------------------- +.sales-order-create-index { + +} + +.sales-order-create-index .order-items.fieldset-wrapper, +.sales-order-create-index .order-search-items.fieldset-wrapper, +.sales-order-create-index .order-additional-area.fieldset-wrapper, +.sales-order-create-index .order-errors, +.checkout-index-index .checkout-errors { + .fieldset-wrapper-title { + border-bottom: 0; + margin: 0; + } + .title { + border-bottom: 1px solid #cac3b4; + margin: 0 0 18px; + width: 100%; + } +} + +[class*="-order-"] { + .fieldset-wrapper-title { + .actions { + float: right; + padding: 0; + a:link, + a:visited, + a:hover, + a:active { + color: #a29c94; + } + } + } + .order-customer-selector .fieldset-wrapper-title .actions { + padding-top: 8px; + } + .order-details .fieldset-wrapper-title .actions { + padding-bottom: 15px; + } +} + +.sales-order-create-index { + // Configure product popup + .ui-dialog { + // Virtual and downloadable product + .downloadable.information .link { + .label { + margin-left: 0; + } + .nested { + margin-left: 8px; + } + } + // Bundle product + .fieldset.bundle { + .nested { + padding-left: 6px; + .field { + margin: 0 0 5px; + } + .label { + font-size: 13px; + margin: 0; + } + .qty .control { + display: inline-block; + margin: 0 0 0 10px; + width: 60px; + } + } + } + } + .order-billing-method { + .payment-methods { + .fieldset { + padding: 0; + margin: 0; + .field { + margin: 0 0 12px 0; + } + } + } + } + .grid .action-configure { + float: right; + &.disabled { + cursor: default; + opacity: 0.5; + &:hover { + text-decoration: none; + } + } + } + .order-items.fieldset-wrapper { + .clearfix(); + } +} + +.tax.summary-total .summary-collapse { + cursor: pointer; + display: inline-block; + &:before { + @iconsize: 16px; + content: "\e02d"; + color: #816063; + background: #f2ebde; + display: inline-block; + text-indent: 0; + font-size: @iconsize; + width:@iconsize; + height:@iconsize; + line-height: @iconsize; + overflow: hidden; + font-family: 'MUI-Icons'; + border:1px solid #ada89e; + font-style: normal; + vertical-align: top; + margin-right:7px; + font-weight: normal; + speak: none; + -webkit-font-smoothing: antialiased; + border-radius: 2px; + } + &:hover:before { + background: #cac3b4; + } +} +.tax.summary-total.show-details .summary-collapse:before { + content: "\e03a"; +} + +tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) td, +tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(even) td, +tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(even) td { + background: #fbfaf6; +} + +tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(odd) td, +tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(odd) td, +tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) td { + background: #fff; +} + +/* ----------------------------------- */ + +#order-data .page-actions { + padding-top: 0; +} + +// #order-data .store-switcher { +// margin: -46px 0 0; +// position: relative; +// width: 50%; +// } + +.create-order-sidebar-container > div + div { + border-top: 1px solid #cac3b4; + margin-top: 35px; +} + +.create-order-sidebar-container > div .head h5 { + .style9(); + margin: 17px 0 17px; +} + +.customer-current-activity-inner > h4 { + .style10(); + border-bottom: 1px solid #cac3b4; + margin-top: 0; + padding: 0 0 16px; +} + +.customer-current-activity-inner .auto-scroll { + margin-right: -18px; + margin-left: -18px; + .no-items { + padding: 5px 18px; + display: block; + } +} +.customer-current-activity-inner .data-table { + thead { + background-color: transparent; + } + thead th { + background-color: transparent; + .style18(); + border: 0; + &:first-child { + padding-left: 18px; + } + &:last-child { + padding-right: 18px; + } + } + tbody tr { + td { + background-color: transparent; + border: 0; + &:first-child { + padding-left: 18px; + } + &:first-child { + padding-right: 18px; + } + } + &:nth-child(2n + 1) td { + background: #e0dace; + } + } +} +.customer-current-activity .action-refresh { + float: right; +} + +.customer-current-activity .action-refresh, +.customer-current-activity .data-table .icon { + display: inline-block; + text-indent: 100%; + overflow: hidden; + height: 16px; + width: 16px; + line-height: 16px; + white-space: nowrap; +} + +.customer-current-activity .action-refresh:before, +.customer-current-activity .data-table .icon:before { + content: "\e010"; + color: #c3c2be; + display: block; + text-indent: 0; + font-size: 16px; + line-height: 16px; + font-family: 'MUI-Icons'; + font-style: normal; + font-weight: normal; + speak: none; + -webkit-font-smoothing: antialiased; +} + +.customer-current-activity .data-table .icon-remove:before { + content: "\e07f"; +} + +.customer-current-activity .data-table .icon-add:before { + content: "\e071"; +} + +.customer-current-activity .auto-scroll { + .style18(); + overflow: auto; + max-height: 150px; +} + +.customer-current-activity .auto-scroll + button { + margin: 22px 0 0; +} + +.customer-current-activity .actions { + border-top: none; + margin: 20px 0 0; + padding: 0; +} + +.overlay { + background: rgba(255, 255, 255, .5); + border-radius: 5px; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + + span { + color: #111; + font-weight: bold; + position: absolute; + top: 56px; + left: 0; + margin: 0 8px; + padding: 10px; + background: #ffffff; + } +} + +// +// Order view +// -------------------------------------- + +.order-comments-history fieldset { + border: 0; + margin: 0; + padding: 0; +} + +.order-comments-history textarea, +.rma-history-form textarea { + height: 6em; + margin: 5px 0 10px; + resize: vertical; + width: 100%; +} + +.order-comments-history input[type="checkbox"] { + margin-right: 5px; +} + +.order-history-comments-options { + float: left; +} + +.order-comments-history .actions { + float: right; +} + +[class*="-order-"] .fieldset-wrapper address { + overflow: auto; +} + +// +// Orders comments +//-------------------------------------- +.note-list { + list-style: none; + padding: 0; + li { + border-top: 1px solid #ededed; + padding: 9px 0; + &:first-child { + border: 0; + padding-top: 13px; + } + } + div { + font-size: 12px; + } + .note-list-date, + .note-list-status, + .note-list-customer span { + font-weight: bold; + } + .note-list-time, + .note-list-status { + border-right: 1px solid #676056; + padding: 0 5px 0 0; + margin: 0 5px 0 0; + } + .note-list-customer { + white-space: nowrap; + } + .note-list-comment { + margin: 5px 0 0; + } + .note-list-customer-notapplicable { + color: #d87e34; + } + .note-list-customer-notified { + color: #185b00; + } + .note-list-customer-not-notified { + color: #963535; + } +} + +[class^=" sales-"] tr.headings .col-parent-transaction-id > span, +[class^=" sales-"] tr.headings .col-method > span, +[class^=" sales-"] tr.headings .col-transaction-id > span, +[class^=" sales-"] tr.headings .col-transaction-type > span, +[class^=" sales-"] tr.headings .col-gtbase > span, +[class^=" sales-"] tr.headings .col-gtpurchased > span, +[class*="-order-"] tr.headings .col-discont > span { + white-space: normal; +} + +[class^=" sales-"] .col-2-left-layout .hor-scroll { + margin-bottom: -4px; + overflow: auto; + padding-bottom: 4px; + width: 100%; +} + +[class*="-order-"] .col-price .label, +[class*="-order-"] .col-subtotal .label { + display: inline-block; + min-width: 60px; + white-space: nowrap; +} + +[class*="-order-"] .item-options { + margin: 5px 0 5px 10px; + dt { + font-weight: bold; + } + dd { + margin: 0 0 0 10px; + } +} + +.adminhtml-rma-item-attribute-edit .col-position input { + text-align: center; +} + +.order-subtotal .label { + text-align: right; +} + +.items-to-invoice { + border: 1px solid #c0bbaf; + margin-top: 13px; + width: 100%; +} + +.items-to-invoice td, +table.items-to-invoice tbody tr:hover td { + background-color: #e6e3de; + border: 0; + text-align: center; +} + +[class~=" -order-creditmemo-"] .no-items { + padding-top: 13px; + text-align: center; +} + +.items-to-invoice .grand-total { + color: #19a3d1; + font-weight: bold; +} + +.adminhtml-order-shipment-new .order-totals .fieldset-wrapper { + padding-top: 18px; +} + +.creditmemo-totals .data-table input[type="text"] { + text-align: right; + width: 60px; +} + +[class*="-order-"] .order-subtotal .label { + width: 80%; +} + +[class^=" adminhtml-rma-"] .rma-items th.col-qty span, +.adminhtml-rma-edit .rma-items th.col-qty span { + text-align: left; + white-space: normal; +} + +.adminhtml-rma-edit .data-table .col-carrier, +[class^=" sales-billing-agreement-"] .log-details .data-table th { + width: 20%; +} + +.adminhtml-rma-edit .data-table .col-title { + width: 35%; +} + +.adminhtml-rma-edit .data-table .col-number { + width: 25%; +} + +[class*="-order-"] .order-shipping-address .price, +.order-shipping-address .shipping-description-title { + font-weight: bold; +} + +[class^=" adminhtml-rma-"] .col-actions a { + cursor: pointer; + white-space: nowrap; +} + +[class^=" adminhtml-rma-"] .col-reason input[type="text"] { + margin: 5px 0 0; + width: 100%; +} + +[class^=" adminhtml-rma-"] .col-actions .separator { + margin: 0 3px; +} + +[class^=" sales-"] .order-payment-method .data-table { + margin-top: 15px; +} + +[class^=" sales-"] .order-payment-currency { + margin-top: 15px; +} + +[class^=" sales-"] .grid .data { + border-bottom: 1px solid #c0bbaf; +} + +[class^=" sales-"] .grid td .option-label { + font-weight: bold; +} + +[class^=" sales-"] .grid td .option-value { + margin: 0 0 0 10px; +} + +.col-product .product_to_add { + float: right; +} + +[class^=" adminhtml-extension-custom-"] { + #authors_fieldset .data-table td { + vertical-align: top; + } +} + +// +// Orders refund +//-------------------------------------- +.field-refund-store-credit { + .input-text { + text-align: right; + width: 60px; + } +} + +// +// Packaging for Shipping Popup +// -------------------------------------- +#popup-window-mask, +.popup-window-mask { + background: rgba(0, 0, 0, 0.5); + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; +} + +.packaging-window, +.packed-window { + background: #fff; + -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, .4); + box-shadow: 0 3px 6px rgba(0, 0, 0, .4); + left: 50%; + margin: -200px 0 0 -471px; + position: fixed; + top: 50%; + width: 1000px; + z-index: 1000; +} + +.packaging-window .entry-edit-head { + padding: 3px 5px; +} + +.packaging-window .messages { + padding: 10px 26px 10px 32px; + border: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + color: #963535; + text-shadow: none; + position: relative; + background: #f3dcd8; + border: 1px solid #963535; + margin-top: -1px; +} + +.packaging-window .messages:before { + position: absolute; + left: 8px; + top: 50%; + margin-top: -11px; + background: none; + text-shadow: none; + width: auto; + height: auto; + border: 0; + font-family: 'MUI-Icons'; + font-style: normal; + speak: none; + font-weight: normal; + -webkit-font-smoothing: antialiased; + font-size: 16px; + content: '\e069'; + color: #963535; +} + +.packaging-window .validation-failed { + background: #fef0ed; + border: 1px dashed #d6340e; +} + +.packaging-window .packaging-content { + overflow: auto; + overflow-x: hidden; + height: auto !important; + max-height: 400px; +} + +.packaging-window .package-options { + width: 100%; + border-top: 1px solid #ccc; + padding: 10px 0 0; + margin: 3px 0 0; +} + +.packaging-window .package-options td { + vertical-align: middle; +} + +.packaging-window .package-options .input-text { + width: 50px; +} + +.packaging-window .package_prapare { + margin-bottom: 15px; +} + +.packaging-window .package-options .customs-value { + width: 80px; +} + +.packaging-window .package-options .options-weight { + width: 75px; +} + +.packaging-window .package-options .options-units-weight { + width: 45px; +} + +.packaging-window .package-options .options-units-dimensions { + width: 45px; +} + +.packaging-window .package-options .options-content-type { + width: 120px; +} + +.packaging-window .package-options input[type=text].disabled, +.packaging-window .package-options select.disabled { + background: #eee; +} + +.packaging-window .package-options-contents { + border-top: 0; +} + +.packaging-window .package-add-products { + margin: 20px 0 0; +} + +.packaging-window .package-add-products .grid { + padding: 0; +} + +.packaging-window .package-add-products .grid button { + vertical-align: middle; +} + +.packaging-window .package-number { + font-weight: bold; +} + +.packaging-window .package-number span { + margin-left: 5px; +} + +.packed-window .entry-edit-head { + padding: 3px 5px; +} + +.packed-window .packed-content { + padding: 10px 10px 0; + overflow: auto; + max-height: 400px; +} + +.packed-window .package { + border-top: 1px solid #ededed; + margin-bottom: 30px; + padding: 10px; +} + +.packed-window .package:first-child { + border-top: 0; +} + +.package-info { + background: #e6e3de; + border: 1px solid #c0bbaf; +} + +.package-info th { + font-weight: bold; +} + +.packed-window .package-info table tbody tr td, +.packed-window .package-info table tbody tr th, +.package-info table tbody tr:nth-child(2n+1) td, +.package-info table tbody tr:nth-child(2n+1) th { + background: none; + border: 0; + padding: 5px 5px 2px; +} + +.packed-window .package .grid { + padding: 0; +} + +.packed-window .package-options { + width: 60%; +} + +.packed-window .package-options td, +.packed-window .package-options th { + padding: 1px 0; +} + +.grid .popup-window { + text-align: left; +} + +.grid tr.on-mouse td .popup-window .data-table tbody tr:nth-child(2n+1) td, +.grid table tbody tr.on-mouse:nth-child(odd):hover td .popup-window .data-table tbody tr:nth-child(2n+1) td, +.grid table tbody tr.on-mouse:nth-child(odd):hover td .popup-window .data-table tbody tr:nth-child(2n+1):hover td, +.grid table tbody tr.on-mouse:nth-child(2n+1):hover td .popup-window .data-table tbody tr:nth-child(2n+1) td, +.grid table tbody tr.on-mouse:nth-child(2n+1):hover td .popup-window .data-table tbody tr:nth-child(2n+1):hover td, +.grid table tbody tr.on-mouse:hover td .popup-window .data-table tbody tr:nth-child(2n+1), +.grid table tbody tr.on-mouse:hover th .popup-window .data-table tbody tr:nth-child(2n+1) { + background-color: #fbfaf6; +} + +.grid .popup-window { + text-align: left; +} + +.popup-window-buttons-set { + text-align: right; + padding: 25px; +} + +.popup-window-title { + background: #f3efea; + padding: 19px 20px; +} + +.popup-window-title .title { + color: #676056; + display: block; + font-size: 20px; + line-height: 1; +} + +.popup-window-title .actions { + float: right; +} + +.popup-window-content { + padding: 25px 25px 0; +} + +.popup-window-content > ul { + list-style: none; + padding: 0; +} + +.packaging-window .col-weight { + text-align: left; + width: 60px; +} + +.packaging-window .col-qty { + text-align: left; + width: 80px; +} + +.packed-window .col-qty, +.packed-window .col-weight, +.packed-window .col-qty_ordered { + text-align: right; + width: 70px; +} + +.packaging-window .col-select, +.packaging-window .col-measure { + text-align: center; + width: 35px; +} + +.popup-fieldset-title .title { + color: #666; + display: inline-block; + font-size: 18px; + font-weight: normal; + padding: 7px 0 10px; +} + +.popup-fieldset-title .actions { + float: right; +} + +.packaging-window select { + margin-bottom: 0; +} + +.packaging-window .col-width, +.packaging-window .col-height, +.packaging-window .col-length, +.packaging-window .data-table .col-total-weight input[type="text"] { + width: 60px; +} + +.packaging-window .col-total-weight { + white-space: nowrap; + width: 100px; +} + +.packaging-window .col-signature { + width: 160px; +} + +.packaging-window .data-table .col-actions, +.packaging-window .col-total-weight { + white-space: nowrap; +} + +.packaging-window .data-table .action-delete { + margin: 5px 0 0 5px; +} + +.packaging-window .grid tr th { + border-bottom: 1px solid #c9c2b8; +} + +.packaging-window .grid tr th:first-child, +.packaging-window .grid td:first-child, +.packaging-window .grid td:last-child { + border-left: 0; + border-right: 0; +} + +.packaging-window .data-table .col-qty-edit { + white-space: nowrap; + width: 50px; +} + +.packaging-window .data-table .col-qty-edit input[type="text"] { + width: 50px; +} + +.sp-methods > dt { + font-weight: bold; +} + +.sp-methods > dd { + margin: 5px 0 5px 15px; +} + +.sp-methods > dd > ul { + list-style: none; + padding: 0; +} + +[class*="-order-"] .order-billing-address .packaging-window .actions, +[class*="-order-"] .order-shipping-address .packaging-window .actions { + margin: 0; +} + +/* + Popup Configuration Popup +-------------------------------------- */ +#product_composite_configure_messages { + margin-left: 0 !important; + padding: 10px 15px; +} + +.rma-popup, .cms-popup { + background: #fff; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); + cursor: default; + position: fixed; + left: 50%; + top: 50%; + z-index: 1000; +} + +.rma-popup { + width: 540px; + margin: 0 0 0 -271px; +} + +.rma-popup .entry-edit .fieldset { + border: none; +} + +.rma-popup .validation-advice, +.rma-popup label.mage-error { + margin-left: 0; +} + +.rma-popup .content { + background: #fff; + border-bottom: 1px solid #ccc; + max-height: 400px; + overflow: auto; +} + +.rma-popup .content .grid { + padding: 0; +} + +.rma-popup .content .grid table { + border-bottom: 1px solid #cbd3d4; +} + +.rma-popup .product-options { + border-bottom: 1px solid #e7e7e7; + margin: 0 0 15px; + padding: 0 0 12px; +} + +.rma-popup .product-options .required { + color: #333 !important; + font-weight: normal !important; +} + +.rma-popup .product-options .required em { + color: #d40707; +} + +.rma-popup .last-fieldset .product-options { + border: 0 none; + margin-bottom: 0; + padding-bottom: 0; +} + +.rma-popup .buttons-set { + text-align: right; + margin: 0; + overflow: hidden; + padding: 7px 10px 8px; +} + +.rma-popup .buttons-set { + width: 518px; +} + +.cms-popup .buttons-set { + width: 289px; +} + +.rma-popup .buttons-set button { + margin: 0 0 0 5px; +} + +.grid .rma-popup .form-list tr, +.grid tr.even .rma-popup .form-list tr, +.grid tr.on-mouse .rma-popup .form-list tr { + background: #fff !important; +} + +/* + URL rewrite +-------------------------------------- */ +.adminhtml-urlrewrite-edit .field-url-rewrite-option-select .label { + width: auto; +} + +/* + Shopping Cart Price Rule +-------------------------------------- */ +.fieldset .field-coupon_code, +.fieldset .field-rule_use_auto_generation { + margin-bottom: 0; +} + +.field-rule_use_auto_generation .label { + margin-left: 5px; +} + +.field-rule_use_auto_generation .nested { + margin-bottom: 29px; +} + +/* + Product Image Placeholders +-------------------------------------- */ +#catalog_placeholder .input-file, +#catalog_placeholder .delete-image > input { + margin-right: 5px; +} + +/* Permanent Redirect for old URL */ +.control > [name="product[url_key_create_redirect]"], +.control > [name="general[url_key_create_redirect]"] { + float: left; + margin: 8px 5px 0 0; +} + +.control > [name="product[url_key_create_redirect]"] + .label, +.control > [name="general[url_key_create_redirect]"] + .label { + width: auto; +} + +/* + New Product Attribute Set +-------------------------------------- */ +.field-skeleton_set .select { + width: 100%; +} + +#affected-attribute-set-form .fieldset .field { + margin-bottom: 12px; + + &:last-child { + margin-bottom: 0; + } +} + +/* + Cache Management +-------------------------------------- */ +.additional-cache-management .label { + margin-top: 5px; +} + +/* + Categories +-------------------------------------- */ +.category-content .form-inline.permissions-custom-options { + .messages { + li { + margin-top: 0; + } + } + .data-table { + margin-bottom: 25px; + } +} + +/* + Marketing - Email Reminders +-------------------------------------- */ +.lt-1280 .adminhtml-reminder-edit #customerGrid .grid .filter .range div.date { + min-width: 0; +} + +/* + Customers - Manage Shopping Cart +-------------------------------------- */ +.checkout-index-index { + .products-search { + margin-top: 35px; + > .actions { + text-align: right; + margin: 10px 0; + } + } + .shopping-cart-items { + > .actions { + margin-bottom: 15px; + } + .box-left, + .box.right { + width: 49%; + fieldset { + border-radius: 5px; + } + } + .box-left { + float: left; + } + .box.right { + float: right; + } + } + .grid table .action-configure { + float: right; + } +} + +/* + Clearfix +-------------------------------------- */ +.shopping-cart-items:before, +.shopping-cart-items:after, +.image-panel:before, +.image-panel:after, +.images:before, +.images:after, +.tax-rate-popup .field:before, +.tax-rate-popup .field:after, +.clearfix:before, +.clearfix:after, +#tab_content_downloadableInfo .data-table td .row:before, +#tab_content_downloadableInfo .data-table td .row:after { + content: ""; + display: table; +} + +.shopping-cart-items:after, +.image-panel:after, +.images:after, +.tax-rate-popup .field:after, +.clearfix:after, +#tab_content_downloadableInfo .data-table td .row:after { + clear: both; +} + +@import "../less/styles/debug.less"; diff --git a/app/design/adminhtml/Magento/backend/css/source/abstract.less b/app/design/adminhtml/Magento/backend/css/source/abstract.less index df0b0f4e72989d5ab5c7381975e6403c8376dcda..442ff06ac83d0e83f002d353999cd76a3c4764cf 100644 --- a/app/design/adminhtml/Magento/backend/css/source/abstract.less +++ b/app/design/adminhtml/Magento/backend/css/source/abstract.less @@ -28,3 +28,121 @@ .box-sizing(); width: 100%; } + +.visually-hidden { + .visually-hidden(); +} + +.validation-symbol { + &:after { + content: '*'; + color: @validation-color; + font-weight: normal; + margin-left: 3px; + } +} + +.validation-symbol-light { + &:after { + content: '*'; + color: @validation-color-light; + font-weight: normal; + margin-left: 3px; + } +} + +.ellipsis { + overflow: hidden; + text-overflow: ellipsis; +} + +.nowrap { + white-space: nowrap; +} + +.delete-first-last-border { + &:first-child { + border-left: 0; + } + &:last-child { + border-right: 0; + } +} + +.massaction-form-inline-label-reset { + .label { + padding: 0; + width: auto; + } +} + +// Table columns widths +.col-50 { + width: 50px; +} + +.col-70 { + width: 70px; +} + +.col-70-max { + max-width: 70px; + width: 70px; +} + +.col-150-max { + max-width: 150px; + width: 150px; +} + +.col-220-max { + max-width: 220px; + width: 220px; +} + +.col-110-max { + max-width: 110px; + width: 110px; +} + +.col-370-max { + max-width: 370px; + width: 370px; +} + +.col-570-max { + max-width: 570px; + width: 570px; +} + +.col-670-max { + max-width: 670px; + width: 670px; +} + +.col-auto { + width: auto; +} + +.col-40 { + width: 40px; +} + +.side-paddings-0 { + padding-left: 0; + padding-right: 0; +} + +.col-actions-links { + display: block; + margin: 0 0 3px; + white-space: nowrap; +} + +.data-table-td-max { + .data-table td { + &:extend(.ellipsis all); + max-width: 250px; + width: 250px; + } +} diff --git a/app/design/adminhtml/Magento/backend/css/source/dashboard.less b/app/design/adminhtml/Magento/backend/css/source/dashboard.less index 36abe4d86a2ddb39de0062a07f1a703df49ee792..8106a1df2b88273fa49f8de74aaaa4eb99bfd399 100644 --- a/app/design/adminhtml/Magento/backend/css/source/dashboard.less +++ b/app/design/adminhtml/Magento/backend/css/source/dashboard.less @@ -82,21 +82,6 @@ min-height: 40px; padding: 15px; } - .tabs-horiz > li { - border: none; - margin: 0 5px 0 0; - } - .ui-tabs-anchor { - .style7(); - background: #e0dacf; - padding: 7px 15px 9px; // resets global tab styles - border-radius: 2px 2px 0 0; - } - .ui-tabs-active .ui-tabs-anchor { - border-top: none; // resets global tab styles - margin-top: 0; // resets global tab styles - box-shadow: none; // resets global tab styles - } } .dashboard-store-stats { @@ -132,6 +117,12 @@ } } } + .dashboard-secondary & { + tr > td:first-child { + &:extend(.col-150-max all); + &:extend(.ellipsis all); + } + } } .dashboard-totals { @@ -167,6 +158,9 @@ width: 100%; thead { background: transparent; // resets global styles + tr { + background: none; + } } th, td { @@ -199,7 +193,14 @@ } } } + td.empty-text { // "no data" messages + text-align: center; + } .ui-tabs-panel & { background-color: @dashboard-tab-content-bg; + .col-name { + &:extend(.ellipsis all); + &:extend(.col-370-max all); + } } } diff --git a/app/design/adminhtml/Magento/backend/css/source/table.less b/app/design/adminhtml/Magento/backend/css/source/table.less new file mode 100644 index 0000000000000000000000000000000000000000..fd207398b4f7f1fb8a1f1e883c71465b0aa99ba3 --- /dev/null +++ b/app/design/adminhtml/Magento/backend/css/source/table.less @@ -0,0 +1,1583 @@ +// /** +// // * Magento +// * +// * NOTICE OF LICENSE +// * +// * This source file is subject to the Academic Free License (AFL 3.0) +// * that is bundled with this package in the file LICENSE_AFL.txt. +// * It is also available through the world-wide-web at this URL: +// * http://opensource.org/licenses/afl-3.0.php +// * If you did not receive a copy of the license and are unable to +// * obtain it through the world-wide-web, please send an email +// * to license@magentocommerce.com so we can send you a copy immediately. +// * +// * DISCLAIMER +// * +// * Do not edit or add to this file if you wish to upgrade Magento to newer +// * versions in the future. If you wish to customize Magento for your +// * needs please refer to http://www.magentocommerce.com for more information. +// * +// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) +// * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +// */ + +// +// Tables +// -------------------------------------- +table { + > caption { + margin-bottom: 5px; + } + + thead { + background: @grid-filters-bg; + color: @grid-headings-color; + .headings { + background: @grid-headings-bg; + } + a { + color: @grid-headings-color; + display: block; + label { + color: @grid-headings-color; + cursor: pointer; + display: block; + } + } + a:hover, + a:focus { + color: @grid-headings-color-darker; + text-decoration: none; + } + tr th { + &:extend(.delete-first-last-border all); + } + } + + tfoot { + background: @grid-tfoot-bg; + color: @grid-tfoot-color; + tr { + th, + td { + text-align: left; + &:extend(.delete-first-last-border all); + } + } + } + + th { + background: transparent; + border: solid @grid-headings-border; + border-width: 0 1px; + font-size: 14px; + padding: 6px 10px; + text-align: center; + } + + td { + border: solid @grid-td-border; + border-width: 0 1px; + padding: 6px 10px 7px; + vertical-align: top; + } + + tbody { + tr { + td { + background: @grid-td-light; + color: @grid-td-color; + padding-top: 12px; + &:first-child { + border-left: 0; + input[type="checkbox"] { + margin: 0; + } + } + &:last-child { + border-right: 0; + } + } + &:last-child th, + &:last-child td { + border-bottom-width: 1px; + } + &:nth-child(odd) td, + &:nth-child(odd) th { + background-color: @grid-td-dark; + } + } + &.even tr td { + background: @grid-td-light; + } + &.odd tr td { + background: @grid-td-dark; + } + } + + .dropdown-menu li { + padding: 7px 15px; + line-height: 14px; + cursor: pointer; + } + + th.required { + &:extend(.validation-symbol all); + } + + .col-draggable .draggable-handle { + float: left; + position: relative; + top: 0; + } +} + +// +// Grid table header filters and settings +//-------------------------------------- + +.not-sort { + padding-right: 10px; +} + +.sort-arrow-asc, +.sort-arrow-desc { + padding-right: 10px; + position: relative; + &:after { + right: -11px; + top: -1px; + position: absolute; + width: 23px; + } + &:hover:after { + color: @grid-headings-color-darker; + } +} + +.sort-arrow-asc { + .icon-font( + @icon-arrow-down-thin, + @_icon-font-color: @grid-headings-color, + @_icon-font-color-hover: @grid-headings-color-darker, + @_icon-font-size: 13px, + @_icon-font-position: after + ); +} + +.sort-arrow-desc { + .icon-font( + @icon-arrow-up-thin, + @_icon-font-color: @grid-headings-color, + @_icon-font-color-hover: @grid-headings-color-darker, + @_icon-font-size: 13px, + @_icon-font-position: after + ); +} + +.grid-actions, +.pager, +.massaction, +.filter { + .input-text, + select, + .select { + border-color: @grid-controls-border; + box-shadow: none; + border-radius: 1px; + height: 28px; + margin: 0 10px 0 0; + } +} + +// +// Table Filters +//-------------------------------------- +.filter { + th { + border: 0 solid @grid-filters-border; + padding: 6px 3px; + vertical-align: top; + } + .ui-datepicker-trigger { + cursor: pointer; + margin-top: 2px; + } + .input-text { + padding: 0 5px; + } + .range-line:not(:last-child) { + margin-bottom: 5px; + } + .date { + padding-right: 28px; + position: relative; + .hasDatepicker { + vertical-align: top; + width: 99%; + } + img { + cursor: pointer; + height: 25px; + width: 25px; + right: 0; + position: absolute; + vertical-align: middle; + z-index: 2; + opacity: 0; + } + .icon-font( + @icon-calendar, + @_icon-font-color: @grid-headings-color, + @_icon-font-color-hover: @grid-headings-color-darker, + @_icon-font-size: 42px, + @_icon-font-line-height: 30px + ); + &:before { + height: 29px; + margin-left: 5px; + position: absolute; + right: -3px; + top: -3px; + width: 35px; + } + } + + select { + border-color: @grid-headings-border; + margin: 0; + padding: 0; + width: 99%; + } + + input.input-text { + border-color: @grid-headings-border; + margin: 0; + width: 99%; + &::-webkit-input-placeholder { + color: @grid-filters-placeholder-color !important; + text-transform: lowercase; + } + &::-moz-placeholder { + color: @grid-filters-placeholder-color!important; + text-transform: lowercase; + } + &:-moz-placeholder { + color: @grid-filters-placeholder-color !important; + text-transform: lowercase; + } + &:-ms-input-placeholder { + color: @grid-filters-placeholder-color !important; + text-transform: lowercase; + } + } +} + +// +// Table Grid +//-------------------------------------- +.grid { + background: @grid-frame-bg; + .style18(); + padding: 15px; + + table { + width: 100%; + } + + tbody tr { + &.selected th, + &.selected td, + &:hover th, + &:hover td, + &:nth-child(odd):hover th, + &:nth-child(odd):hover td { + background-color: @grid-td-bg-hover; + cursor: pointer; + &.empty-text { + background-color: @grid-td-dark; + cursor: default; + } + } + } + + .empty-text { + font: @h2font; + text-align: center; + white-space: nowrap; + } + + th.required, + th .required { + &:extend(.validation-symbol-light all); + } + + // Dates and date ranges + td { + &.col-period, + &.col-date, + &.col-date_to, + &.col-date_from, + &.col-ended_at, + &.col-created_at, + &.col-updated_at, + &.col-customer_since, + &.col-session_start_time, + &.col-last_activity, + &.col-email, + &.col-name, + &.col-sku, + &.col-firstname, + &.col-lastname, + &.col-title, + &.col-label, + &.col-product, + &.col-set_name, + &.col-websites, + &.col-time, + &.col-billing_name, + &.col-shipping_name, + &.col-phone { + &:extend(.ellipsis all); + } + } + + .col-period, + .col-date, + .col-date_to, + .col-date_from, + .col-ended_at, + .col-created_at, + .col-updated_at, + .col-customer_since, + .col-session_start_time, + .col-last_activity, + // Email + .col-email, + // Total items + .col-items_total, + .col-firstname, + .col-lastname, + .col-status-default, + .col-websites, + .col-time, + .col-billing_name, + .col-shipping_name { + &:extend(.col-110-max all); + } + + .col-name, + .col-product { + &:extend(.col-370-max all); + } + + .col-sku { + max-width: 100px; + width: 100px; + } + + // Order ID, Invoice number + .col-order-number, + .col-real_order_id, + .col-invoice-number, + .col-increment_id, + .col-transaction-id, + .col-parent-transaction-id, + .col-reference_id, + // Status + .col-status, + .col-price, + .col-position, + .col-base_grand_total, + .col-grand_total, + .col-sort_order, + // Reports + .col-carts, + .col-priority, + .col-severity { + &:extend(.col-70 all); + } + + .col-phone { + &:extend(.col-70-max all); + } + + .col-action, + .col-actions, + .col-qty, + .col-purchases { + &:extend(.col-50 all); + } + + // Grid columns + .col-select, + .col-id, + .col-number { + &:extend(.col-40 all); + } + + .editable .input-text { + width: 65px; + } + + .col-actions { + .action-select { + background: @form-element-bg; + border-color: @grid-controls-border; + height: 28px; + margin: 0; + padding: 4px 4px 5px; + width: 80px; + } + } + + .col-position.editable { + white-space: nowrap; + .input-text { + margin: -7px 5px 0; + width: 70%; + } + } +} + +.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, +td.col-date_from, +td.col-ended_at, +td.col-created_at, +td.col-updated_at, +td.col-customer_since, +td.col-session_start_time, +td.col-time, +td.col-sku { + &:extend(.nowrap all); +} + +// +// Data table +//-------------------------------------- +.data-table { + border-collapse: separate; // do not remove this! without this rule in FF when table has only 1 row bottom and side borders disappear + width: 100%; + thead, + tfoot, + th { + background: @grid-td-light; + .style2(); + } + + th { + text-align: left; + } + + thead th { + border: solid @data-table-th-border-color; + border-width: 0 0 1px; + padding: 7px; + } + + td, + tbody tr th, + tbody tr td { + background: @data-table-td-bg; + border-width: 0; + padding: 5px 7px; + vertical-align: middle; + } + + tbody { + tr { + &:nth-child(odd) th, + &:nth-child(odd) td { + background: @data-table-td-bg-odd; + } + } + &.odd { + tr { + th, + td { + background: @data-table-td-bg-odd; + } + } + } + &.even { + tr { + th, + td { + background: @data-table-td-bg; + } + } + } + } + + tfoot { + tr { + &:last-child th, + &:last-child td { + border: 0; + } + } + } + + &.order-tables { + tbody { + td { + vertical-align: top; + } + &:hover tr { + th, + td { + background: @data-table-td-bg-hover; + } + } + } + + tfoot td { + background: @grid-tfoot-bg; + .style2(); + } + } + + .accordion .config & { + thead th, + tfoot td { + &:extend(.data-table thead all); + } + + td { + &:extend(.data-table td all); + } + + tbody tr:nth-child(odd) td { + &:extend(.data-table tbody tr:nth-child(odd) td); + } + + tfoot tr:last-child td { + &:extend(tfoot tr:last-child td all); + } + } + + input[type="text"] { + width: 98%; + padding-left: 1%; + padding-right: 1%; + } + + select { + margin: 0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + + th.required-entry, + td.required-entry { + &:extend(.validation-symbol all); + } + + .col-actions .actions-split { + margin-top: 4px; + [class^='action-'] { + background: none; + border: 1px solid #c8c3b5; + padding: 3px 5px; + color: #bbb3a6; + font-size: 12px; + &:first-child { + border-right: 0; + } + } + .dropdown-menu { + margin-top: -1px; + a { + display: block; + color: #333; + text-decoration: none; + } + } + &.active .action-toggle { + position: relative; + border-bottom-right-radius: 0; + box-shadow: none; + background: #fff; + &:after { + position: absolute; + top: 100%; + left: 0; + right: 0; + height: 2px; + margin-top: -1px; + background: #fff; + content: ''; + z-index: 2; + } + .dropdown-menu { + border-top-right-radius: 0; + } + } + } + + // + // Attribute Information + // -------------------------------------- + .col-default { + white-space: nowrap; + text-align: center; + vertical-align: middle; + } + + .col-delete { + text-align: center; + width: 32px; + } + + .col-file { + white-space: nowrap; + input { + margin: 0 5px; + width: 40%; + &:first-child { + margin-left: 0; + } + } + } + + .col-actions-add { + padding: 10px 0; + } +} + +// +// Grid - Pager and Buttons row +// -------------------------------------- +.grid-actions { + background: @grid-frame-bg; + font-size: 13px; + line-height: 28px; + padding: 10px 15px; + position: relative; + + .grid { + padding-top: 5px; + } + .export, + .filter-actions { + float: right; + margin-left: 10px; + vertical-align: top; + } + .import { + display: block; + vertical-align: top; + } + .action-reset { + .button-as-link(); + margin: 6px 10px 0 0; + vertical-align: top; + } + .import, + .export { + .label { + margin: 0 14px 0 0; + vertical-align: inherit; + } + } + .import, + .export, + .filter-actions { + .action- { + vertical-align: inherit; + } + } + .filter { + .date { + float: left; + margin: 0 15px 0 0; + position: relative; + &:before { + color: @color-middle; + top: 1px; + } + &:hover:before { + color: @color-dark; + } + } + .label { + margin: 0; + } + .hasDatepicker { + margin: 0 5px; + width: 80px; + } + .show-by { + .select { + margin-left: 5px; + padding: 4px 4px 5px; + vertical-align: top; + width: auto; + } + } + &.required { + &:after { + content: ''; + } + .label span { + &:extend(.validation-symbol all); + } + } + } + .required { + &:extend(.validation-symbol all); + } + img { + vertical-align: middle; + height: 22px; + width: 22px; + } + .validation-advice { + background: @validation-bg; + border: 1px solid @validation-color; + border-radius: 3px; + color: @validation-color; + margin: 5px 0 0; + padding: 3px 7px; + position: absolute; + white-space: nowrap; + z-index: 5; + &:before { + .arrow(up, 5px, @validation-color); + content: ''; + left: 50%; + margin-left: -5px; + position: absolute; + top: -11px; + } + } + input[type="text"].validation-failed { + border-color: @validation-color; + box-shadow: 0 0 8px @validation-color-rgba; + } + .link-feed { + white-space: nowrap; + } + .form-inline & { + &:extend(.massaction-form-inline-label-reset all); + } +} + +.pager { + font-size: 13px; + .grid & { + margin: 15px 0 0; + position: relative; + text-align: center; + } + .pages-total-found { + margin-right: 25px; + } + .view-pages .select { + margin: 0 5px; + } + .link-feed { + font-size: 12px; + margin: 7px 15px 0 0; + position: absolute; + right: 0; + top: 0; + } + .action-previous, + .action-next { + .button-as-link(); + line-height: 0.6; + overflow: hidden; + width: 20px; + &:before { + margin-left: -10px; + } + &.disabled { + opacity: 0.3; + } + } + .action-previous { + .icon-font( + @icon-prev, + @_icon-font-color: @pager-actions-color, + @_icon-font-color-hover: @pager-actions-color-hover, + @_icon-font-size: 40px, + @_icon-font-text-hide: true + ); + } + .action-next { + .icon-font( + @icon-next, + @_icon-font-color: @pager-actions-color, + @_icon-font-color-hover: @pager-actions-color-hover, + @_icon-font-size: 40px, + @_icon-font-text-hide: true + ); + } + .input-text { + height: 25px; + line-height: 16px; + margin-right: 5px; + text-align: center; + width: 25px; + vertical-align: top; + } + label.page { + &:extend(.visually-hidden all); + } + .pages-total { + line-height: 25px; + vertical-align: top; + } +} + +// +// Grid - Mass Action +// -------------------------------------- +.massaction { + background: @grid-frame-bg; + border-top: @grid-massaction-border; + font-size: 13px; + line-height: 28px; + padding: 15px 15px 0; + > .entry-edit { + float: right; + .field-row { + display: inline-block; + } + .validation-advice { + display: none !important; + } + .form-inline { + display: inline-block; + } + .label { + &:extend(.grid-actions .export .label); + padding: 0; + width: auto; + } + .action- { + &:extend(.grid-actions .export .action-); + vertical-align: top; + } + } + .select.validation-failed { + border: @validation-border; + background: @validation-bg; + } + .form-inline & { + &:extend(.massaction-form-inline-label-reset all); + } +} + +// +// Grid - status and severity +// -------------------------------------- +.grid-severity-critical, +.grid-severity-major, +.grid-severity-notice, +.grid-severity-minor { + background: @grid-severity-minor-bg; + border: 1px solid @grid-severity-minor-border; + color: @grid-severity-minor-color; + display: block; + padding: 0 3px; + font-weight: bold; + line-height: 17px; + text-transform: uppercase; + text-align: center; +} + +.grid-severity-critical, +.grid-severity-major { + border-color: @grid-severity-critical-border; + background: @grid-severity-critical-bg; + color: @grid-severity-critical-color; +} + +.grid-severity-notice { + border-color: @grid-severity-notice-border; + background: @grid-severity-notice-bg; + color: @grid-severity-notice-color; +} + +// +// Inputs and selects in tables +// -------------------------------------- +.grid, +.data-table { + tbody { + td, + th { + input[type="text"], + .input-text, + select, + .select { + width: 99%; + } + } + } +} + +// +// Grids for pages +// -------------------------------------- +.ui-tabs-panel { + .grid .col-sku { + max-width: 150px; + width: 150px; + } +} + +.col-indexer_status, +.col-indexer_mode { + width: 160px; +} + +.fieldset-wrapper { + .grid-actions + .grid { + padding-top: 15px; + } + .grid-actions { + padding: 10px 0 0; + } + .grid { + padding: 0; + } +} + +.accordion .grid { + padding: 0; +} + +.ui-dialog-content { + .grid-actions, + .grid { + padding-left: 0; + padding-right: 0; + } +} + +// +// Sales +// -------------------------------------- +[class^=' sales-order-'] .grid .col-name { + &:extend(.col-220-max all); +} + +.sales-order-view .grid { + .col-name { + &:extend(.col-150-max all); + } + .col-period { + &:extend(.col-70-max all); + } +} + +.sales-order-index .grid .col-name { + &:extend(.col-110-max all); +} + +.sales-order-create-index { + .col-phone { + &:extend(.col-70-max all); + } + .col-in_products { + &:extend(.col-70); + } +} + +.product-options .grouped-items-table { + .col-name, + .col-sku { + &:extend(.ellipsis all); + &:extend(.col-110-max all); + } +} + +// +// Sales -> Qty - table +//-------------------------------------- +.qty-table { + td { + border: 0; + padding: 0 5px 3px; + } +} + +// +// Sales -> Create Order +//-------------------------------------- + +.sales-order-create-index { + .grid, + .grid-actions { + &:extend(.side-paddings-0); + } + .sales-order-create-index .grid table .action-configure { + float: right; + } + .data-table { + .border td { + padding-bottom: 15px; + } + .col-product { + &:extend(.ellipsis all); + &:extend(.col-150-max all); + } + } + .actions.update { + margin: 10px 0; + } +} + +.order-account-information { + &:extend(.data-table-td-max all); +} + +// +// Sales -> View order +//-------------------------------------- + +[class^=' sales-order-view'] { + .grid .col-customer_name { + &:extend(.col-110-max all); + } +} + +// +// Sales -> Create Shipment +//-------------------------------------- + +.adminhtml-order-shipment-new .grid .col-product { + max-width: 770px; + width: 770px; +} + +// +// Sales -> Return +//-------------------------------------- + +[class^=' adminhtml-rma-'] { + .fieldset-wrapper .data-table td { + &:extend(.ellipsis all); + &:extend(.col-670-max); + } + .grid { + .col-product_sku { + &:extend(.ellipsis all); + &:extend(.col-70-max all); + } + .col-name, + .col-product { + &:extend(.col-150-max all); + } + .col-product_name { + &:extend(.ellipsis all); + &:extend(.col-110-max all); + } + .col-reason { + &:extend(.ellipsis all); + &:extend(.col-70-max all); + a { + display: block; + } + } + } + .col-actions { + a { + &:extend(.col-actions-links); + } + } + .rma-request-details { + &:extend(.data-table-td-max all); + } +} + +.adminhtml-rma-edit { + .col-product, + .col-sku { + &:extend(.col-70-max all); + } +} + +// +// Products +// -------------------------------------- +.catalog-product-index { + .grid .col-name { + &:extend(.col-110-max all); + } +} + +.catalog-product-edit .ui-tabs-panel .grid { + .hor-scroll { + overflow-x: auto; + } + .col-name, + .col-type, + .col-sku { + &:extend(.col-70-max all); + } + .col-price, + .col-position { + &:extend(.col-50 all); + } +} + +.catalog-product-review-index { + .grid { + .col-name, + .col-title { + &:extend(.col-110-max all); + } + } +} + +// +// Products -> Categories +// -------------------------------------- +.catalog-category-edit { + .grid { + .col-name { + &:extend(.col-220-max all); + } + } +} + +// +// Customer +// -------------------------------------- +.customer-index-index { + .grid { + .col-name { + max-width: 90px; + width: 90px; + } + .col-customer_since, + .col-billing_country_id { + &:extend(.col-70-max all); + } + .col-billing_region { + width: 70px; + } + } +} + +[class^=' customer-index-'] { + .fieldset-wrapper, + .accordion { + .grid .col-created_at { + &:extend(.col-70-max all); + } + } + .col-action a { + &:extend(.col-actions-links); + } +} + +.customer-index-edit { + .ui-tabs-panel .grid .col-name { + &:extend(.col-110-max all); + } +} + +// +// Customer -> Customer Segments +// -------------------------------------- +.col-grid_segment_name { + &:extend(.col-570-max all); + &:extend(.ellipsis all); +} + +// +// Marketing -> Catalog Event +// -------------------------------------- +.adminhtml-catalog-event-index .col-category { + &:extend(.ellipsis all); + &:extend(.col-220-max all); +} + +// +// Marketing -> Search Terms +// -------------------------------------- +[class^=' catalog-search'] { + .col-search_query, + .col-synonym_for, + .col-redirect { + &:extend(.ellipsis all); + &:extend(.col-150-max all); + } +} + +// +// Marketing -> URL Redirects +// -------------------------------------- +.adminhtml-urlrewrite-index .col-request_path { + &:extend(.ellipsis all); + &:extend(.col-150-max all); +} + +// +// Marketing -> Reviews +// -------------------------------------- +.review-product-index { + .grid { + .hor-scroll { + overflow-x: auto; + } + .col-name { + &:extend(.col-110-max all); + } + } +} + +// +// Content -> Pages +// -------------------------------------- +.adminhtml-cms-page-index { + .col-title, + .col-identifier { + &:extend(.ellipsis all); + &:extend(.col-110-max all); + } +} + +// +// Content -> Hierarchy +// -------------------------------------- +.adminhtml-cms-hierarchy-index { + .col-title, + .col-identifier { + &:extend(.ellipsis all); + max-width: 410px; + width: 410px; + } +} + +// +// Content -> Banners +// -------------------------------------- +.col-banner_name { + &:extend(.col-370-max all); + &:extend(.ellipsis all); +} +.adminhtml-banner-edit { + .grid .col-name { + &:extend(.col-220-max all); + } +} + +// +// Content -> Frontend Apps +// -------------------------------------- +.adminhtml-widget-instance-index { + .col-title { + &:extend(.col-370-max all); + &:extend(.ellipsis all); + } +} +.adminhtml-widget-instance-edit { + .grid-chooser .control { + margin-top: -19px; + width: 80%; + .eq-ie9 & { + margin-top: -18px; + } + .grid-actions { + padding: 0 0 15px; + } + .grid { + padding: 0; + } + .addon { + input:last-child, + select:last-child{ + border-radius: 0; + } + } + } +} + +// +// Reports -> Low Stock +// -------------------------------------- +.reports-report-product-lowstock { + .grid { + .col-name { + &:extend(.col-670-max all); + } + .col-sku { + &:extend(.col-220-max all); + } + } +} + +.reports-report-shopcart-product, +.reports-report-review-customer { + .grid .col-name { + &:extend(.col-670-max all); + } +} +.reports-report-shopcart-abandoned { + .grid .col-name { + &:extend(.col-150-max all); + } +} + +// +// Reports +// -------------------------------------- +[class^=' reports-'] [class^='col-total'], +[class^=' reports-'] [class^='col-average'], +[class^=' reports-'] [class^='col-ref-'], +[class^=' reports-'] [class^='col-rate'], +[class^=' reports-'] [class^='col-tax-amount'] { + &:extend(.col-70 all); +} + +.reports-report-sales-invoiced, +.reports-report-sales-refunde { + .grid .col-period { + &:extend(.col-auto all); + } +} + +// +// Reports -> Search Terms +// -------------------------------------- +.reports-index-search .col-query_text { + &:extend(.col-570-max all); + &:extend(.ellipsis all); +} + +// +// Reports -> Ordered Products Report +// -------------------------------------- +.reports-report-product-sold .grid .col-name { + max-width: 720px; + width: 720px; +} + +// +// Reports -> Newsletter Problem Reports +// -------------------------------------- +.newsletter-problem-index .grid { + .col-name, + .col-subject, + .col-product { + &:extend(.col-220-max all); + } +} + + +// +// Stroes -> Tax rules +// -------------------------------------- +.tax-rule-index { + .grid .col-title { + &:extend(.col-150-max all); + } +} + +// +// Stores -> Returns Attributes +// -------------------------------------- +.adminhtml-rma-item-attribute-index { + .grid { + .col-label { + &:extend(.col-220-max all); + } + .col-attr-code { + &:extend(.ellipsis); + &:extend(.col-150-max all); + } + } +} + +// +// Stores -> All Stores +// -------------------------------------- +.adminhtml-system-store-index .grid td { + &:extend(.ellipsis all); + max-width: 310px; +} + +// +// Stores -> Currency +// -------------------------------------- +.adminhtml-system-currency-index { + .grid { + padding-top: 0; + } + .col-currency-edit-rate { + min-width: 40px; + } + .col-base-currency { + font-weight: bold; + } + .old-rate { + display: block; + margin-top: 3px; + text-align: center; + } + .hor-scroll { + overflow-x: auto; + min-width: 970px; + } +} + +// +// Stores -> Currency symbol +// -------------------------------------- +.adminhtml-system-currencysymbol-index { + .col-currency { + width: 35%; + } + .grid .input-text { + margin: 0 10px 0 0; + width: 50%; + } +} + +// +// Stores -> Customer attributes +// -------------------------------------- +[class^=' adminhtml-customer-'], +.adminhtml-rma-item-attribute-index { + .col-label { + &:extend(.col-370-max all); + } + .col-required, + .col-system, + .col-is_visible, + .col-sort_order { + &:extend(.col-70 all); + } +} + +// +// Stores -> Product Attribute +// -------------------------------------- +.catalog-product-attribute-index { + .col-attr-code, + .col-label { + &:extend(.col-110-max all); + &:extend(.ellipsis); + } + [class^=' col-is_'], + .col-required, + .col-system { + &:extend(.col-70 all); + } +} + +.catalog-product-set-index .col-set_name { + max-width: 930px; + width: 930px; +} + +// +// System -> Export +// -------------------------------------- +.adminhtml-export-index { + .grid-actions, + .grid { + &:extend(.side-paddings-0); + } + .col-label, + .col-code { + &:extend(.col-220-max all); + } + .col-code { + &:extend(.ellipsis all); + } + .grid { + td { + vertical-align: middle; + } + .input-text-range { + margin: 0 10px 0 5px; + width: 37%; + } + .input-text-range-date { + margin: 0 5px; + width: 32%; + } + } + .ui-datepicker-trigger { + display: inline-block; + margin: -3px 10px 0 0; + vertical-align: middle; + } +} + +// +// System -> Scheduled Imports/Exports +// -------------------------------------- +.adminhtml-scheduled-operation-index .grid .col-name { + &:extend(.col-220-max all); +} + +// +// System -> Report +// -------------------------------------- +.adminhtml-logging-index .grid .col-fullaction { + &:extend(.ellipsis all); + &:extend(.col-220-max all); +} + +// +// System -> Notifications +// -------------------------------------- +.adminhtml-notification-index .col-actions a { + &:extend(.col-actions-links); +} + +.adminhtml-process-list .col-action a, +.adminhtml-process-list .col-mode { + &:extend(.nowrap all); +} + +.adminhtml-notification-index, +.adminhtml-cache-index, +.adminhtml-process-list, +.indexer-indexer-list { + .col-select { + width: 10px; + } +} + +// +// System -> Locked Users +// -------------------------------------- +.adminhtml-locks-index .grid .col-name { + &:extend(.col-570 all); +} + +// +// System -> Custom Variables +// -------------------------------------- +.adminhtml-system-variable-index { + .grid .col-code { + &:extend(.col-370-max all); + &:extend(.ellipsis all); + } +} + +.adminhtml-logging-index .grid .col-info { + &:extend(.col-110-max all); + &:extend(.ellipsis all); +} diff --git a/app/design/adminhtml/Magento/backend/css/source/theme.less b/app/design/adminhtml/Magento/backend/css/source/theme.less index da3a7a40baf7ef442db278cf009c03bd23a0a10d..28442d5f03c26ca57fef636fff21ea5132765af6 100644 --- a/app/design/adminhtml/Magento/backend/css/source/theme.less +++ b/app/design/adminhtml/Magento/backend/css/source/theme.less @@ -24,6 +24,7 @@ // Override default variables @font-family-base: 'Open Sans', @font-family-sans-serif; +@col-layout-bg: #f6f3eb; // Introduce new theme specific variables @@ -45,7 +46,7 @@ @button-font-size: 13px; @button-height: 26px; @button-color: #645D53; -@button-background: #f7f3eb; +@button-background: #f2ebde; @button-border: 1px solid #ada89e; @button-background-hover: #cac3b4; @button-color-hover: ''; @@ -64,296 +65,69 @@ @button-primary-background-active: @button-primary-background-hover; @button-primary-border-active: 1px solid #004c74; + +// +// Form elements +//-------------------------------------- +@form-element-bg: #fff; + // -// Buttons +// Validation //-------------------------------------- -button { - border-radius: 2px; - .button(); - &.primary { - .button-primary(); - } -} +@validation-color: #e22626; +@validation-color-rgba: rgba(226, 38, 38, 0.6); +@validation-bg: #f9d4d4; +@validation-border: 1px dashed @validation-color; +@validation-color-light: #f9d4d4; // for asterisk on <th> elements of grid tables // -// Page main actions +// Grid //-------------------------------------- -.page-main-actions { - .clearfix(); - background: #e0dace; - color: @page-main-action-color; - padding: 15px; - margin-left: auto; - margin-right: auto; - .box-sizing(); - .page-actions { - float: right; - .page-actions-buttons { - float: right; - display: flex; - justify-content: flex-end; - } - button { - margin-left: 13px; - //flex-shrink: 0; - &.primary { - // &:not(:last-child) { - // float: right; - // } - float: right; - order: 2; - } - &.save:not(.primary) { - // &:not(:last-child) { - // float: right; - // } - float: right; - order: 1; - } - &.back, - &.action-back, - &.delete { - .button-reset(); - margin: 0 13px; - .ie & { - margin-top: 6px; - } - } - &.delete { - color: #e22626; - float: left; - order: -1; - } - &.back, - &.action-back { - float: left; - order: -1; - .icon-font( - @_icon-font-content: @icon-arrow-left-thin, - @_icon-font-line-height: normal, - @_icon-font-margin: 0 2px 0 0 - ); - } - } - .actions-split { - margin-left: 13px; - // &:not(:last-child) { - // float: right; - // } - float: right; - order: 2; - button { - &.primary { - float: left; - } - } - } - // Fixed page actions - &.fixed { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 998; - padding: 0; - background: -moz-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(245, 242, 237, 1)), color-stop(56%, rgba(245, 242, 237, 1)), color-stop(100%, rgba(245, 242, 237, 0))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* IE10+ */ - background: linear-gradient(to bottom, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); /* W3C */ - .page-actions-inner { - position: relative; - padding-top: 15px; - padding-bottom: 15px; - min-height: 36px; - text-align: right; - .clearfix(); - .box-sizing(); - &:before { - text-align: left; - content: attr(data-title); - float: left; - font-size: 20px; - max-width: 50%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - .lt-ie10 & { - background: #f5f2ed; - } - } - } - } - .store-switcher { - margin-top: 5px; - } -} -.store-switcher { - display: inline-block; - font-size: 13px; - .label { - margin-right: 5px; - } - .actions.dropdown { - .dropdown( - @_options-selector : ~".dropdown-menu", - @_dropdown-list-border: 1px #ada89e solid, - @_dropdown-list-pointer: false, - @_icon-font-line-height: 20px, - @_icon-font-color: @page-main-action-color, - @_icon-font-color-hover: @page-main-action-color, - @_icon-font-color-active: @page-main-action-color, - @_dropdown-list-item-hover: transparent, - @_dropdown-list-item-padding: 0 - ); - .action.toggle { - .button-reset(); - color: @color-link; - line-height: normal; - vertical-align: middle; - } - ul.dropdown-menu { - margin-top: 4px; - padding-top: 5px; - left: 0; - min-width: 195px; - li { - border: 0; - cursor: default; - &:hover { - cursor: default; - } - a, - span { - padding: 5px 13px; - display: block; - color: @page-main-action-color; - } - a { - text-decoration: none; - &:hover { - background: #edf9fb; - } - } - span { - color: #ababab; - cursor: default; - } - &.current { - span { - color: @page-main-action-color; - background: #eee; - } - } - } - .store-switcher-store { - a, - span { - padding-left: 26px; - } - } - .store-switcher-store-view { - a, - span { - padding-left: 39px; - } - } - .dropdown-toolbar { - border-top: 1px #ededed solid; - margin-top: 10px; - a { - .icon-font( - @_icon-font-content: @icon-settings, - @_icon-font-size: 20px, - @_icon-font-line-height: normal, - @_icon-font-vertical-align: text-top, - @_icon-font-margin: 0 3px 0 -4px - ); - display: block; - } - } - } - } -} +@grid-frame-bg: #fff; +@grid-controls-border: #989287; + +@grid-headings-color: #f7f3eb; +@grid-headings-color-darker: darken(@grid-headings-color, 20%); +@grid-headings-bg: #807a6e; +@grid-headings-border: #cac3b4; + +@grid-filters-color: #f7f3eb; +@grid-filters-bg: @color-middle; +@grid-filters-border: @grid-filters-bg; +@grid-filters-placeholder-color: #989287; + +@grid-massaction-border: 1px solid #f2ebde; + +@grid-td-color: @color-middle; +@grid-td-light: #fff; +@grid-td-dark: #f7f3eb; +@grid-td-border: @grid-headings-border; +@grid-td-bg-hover: #f2ebde; + +@grid-tfoot-color: @grid-td-color; +@grid-tfoot-bg: #f2ebde; + +@grid-severity-critical-color: #e22626; +@grid-severity-critical-bg: #f9d4d4; +@grid-severity-critical-border: @grid-severity-critical-color; + +@grid-severity-notice-color: #185b00; +@grid-severity-notice-bg: #d0e5a9; +@grid-severity-notice-border: #5b8116; + +@grid-severity-minor-color: #ed4f2e; +@grid-severity-minor-bg: #feeee1; +@grid-severity-minor-border: @grid-severity-minor-color; + +// Pager +@pager-actions-color: @primary3; +@pager-actions-color-hover: @primary5; -.tooltip { - display: inline-block; - margin-left: 5px; - .help span, - .help a { - width: 16px; - height: 16px; - text-align: center; - background: rgba(194,186,169,.5); - cursor: pointer; - &:hover { - background: rgba(194,186,169,1); - } - border-radius: 10px; - vertical-align: middle; - .icon-font( - @_icon-font: @font-family-base, - @_icon-font-content: '?', - @_icon-font-size: 13px, - @_icon-font-line-height: 16px, - @_icon-font-color: #5a534a, - @_icon-font-text-hide: true, - @_icon-font-vertical-align: top - ); - &:before { - font-weight: 700; - } - } - //TODO Tooltips - .tooltip-content { - display: none; - position: absolute; - max-width: 200px; - margin-top: 10px; - margin-left: -19px; - padding: 4px 8px; - border-radius: 3px; - background: #000; - background: rgba(49, 48, 43, .8); - color: #fff; - text-shadow: none; - z-index: 20; - &:before { - content: ''; - position: absolute; - width: 0; - height: 0; - top: -5px; - left: 20px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-bottom: 5px solid #000; - opacity: .8; - } - &.loading { - position: absolute; - &:before { - border-bottom-color: rgba(0, 0, 0, .3); - } - } - } - &:hover > .tooltip-content { - display: block; - } -} +// Data-table +@data-table-th-border-color: #c9c2b8; +@data-table-td-border-color: #eae8e4; +@data-table-td-bg: @grid-td-light; +@data-table-td-bg-odd: #fbfaf6; -.actions-split { - button { - margin-left: 0!important; - } - .dropdown-split( - @_toggle-selector: ~".action-toggle", - @_button-selector: ~".action-default", - @_options-selector : ~".dropdown-menu", - @_dropdown-split-button-border-radius-fix: true - ); - vertical-align: middle; -} +@data-table-td-bg-hover: #f7f3eb; diff --git a/app/design/adminhtml/Magento/backend/css/styles.less b/app/design/adminhtml/Magento/backend/css/styles.less index 0c7ae7b261918812b10e6bd8c793ca50356f51be..47983cc820a5e3bb44a56dee6d6c0f7dbdc84b96 100644 --- a/app/design/adminhtml/Magento/backend/css/styles.less +++ b/app/design/adminhtml/Magento/backend/css/styles.less @@ -30,6 +30,7 @@ @import "source/lib/lib.less"; // Import all lib files @import "../less/styles/vars.less"; @import "source/theme.less"; // import theme styles +@import "source/table.less"; // import theme styles @baseDir: "../"; //default diff --git a/app/design/adminhtml/Magento/backend/less/styles/debug.less b/app/design/adminhtml/Magento/backend/less/styles/debug.less index 5465813bea296f2e1d31db8d98b7efbd03580fac..cc6426649f04d51b2a17fd9e33d7bf32497ce06f 100644 --- a/app/design/adminhtml/Magento/backend/less/styles/debug.less +++ b/app/design/adminhtml/Magento/backend/less/styles/debug.less @@ -42,9 +42,6 @@ .section-config.active > .collapseable + input + fieldset, .accordion .collapseable.open + input + fieldset { background: #fff; - border: 1px solid #eae6e0; - border-radius: 5px; - margin: 0 0 8px; padding: 5px 18px 2px; position: relative; } @@ -65,6 +62,7 @@ .accordion .collapseable.open + input + fieldset { padding: 25px 18px 18px; display: block; + margin-left: 0; border-top: 0; border-radius: 0 0 5px 5px; } @@ -78,6 +76,7 @@ text-decoration: none; position: relative; cursor: pointer; + border-bottom: 1px solid #cac3b4; } .section-config > .collapseable > a i, @@ -89,17 +88,18 @@ .section-config.active > .collapseable > a, .accordion .collapseable.open a, .accordion dt.open a { - border-bottom: 1px solid #ededed; + /*border-bottom: 1px solid #ededed;*/ } .section-config > .collapseable > a:before, .accordion > dt a:before, .accordion .collapseable > a:before { position: absolute; left: 0; - top: 7px; + top: 11px; font-family: 'MUI-Icons'; font-style: normal; speak: none; + font-size: 16px; font-weight: normal; -webkit-font-smoothing: antialiased; content: '\e02a'; /* arrow right icon */ @@ -158,7 +158,7 @@ .section-config.complex .section-config.with-button > .config { margin:10px -10px; border:1px solid #d1d0ce; - border-radius: 5px; + border-radius: 0; padding:5px 0; } .section-config.complex .section-config.with-button > .config > table > tbody > tr > td { @@ -173,6 +173,12 @@ border-bottom:1px solid #d1d0ce; background: transparent; } +.section-config.complex .section-config.with-button > .config > table > tbody > tr > td > .section-config > .entry-edit-head > a { + padding-left: 22px; +} +.section-config.complex .section-config.with-button > .config > table > tbody > tr > td > .section-config > .entry-edit-head > a:before { + left: 0; +} .section-config.complex .section-config.with-button > .config > table > tbody > tr:last-child > td > .section-config > .entry-edit-head { border:0; } @@ -495,51 +501,6 @@ margin: 0 0 20px; } -/* TODO: arrange range inputs width in tables */ -.grid td input.input-text-range { - width: 35%; -} - -.grid td input.input-text-range-date { - width: 31%; -} - -/* TODO: styles for required TH fields */ -th.required:after { - color: red; - content: "*"; - margin-left: 5px; -} - -/* TODO: set color for messages in Cache Storage Management */ -.grid-severity-critical, -.grid-severity-major, -.grid-severity-notice, -.grid-severity-minor { - display: block; - border: 1px solid #c76f35; - background: #fffbf0; - text-align: center; -} - -.grid-severity-critical { - border-color: #6e1313; - background: #f7bfbf; - color: #6e1313; -} - -.grid-severity-major { - border-color: #963535; - background: #f3dcd8; - color: #963535; -} - -.grid-severity-notice { - border-color: #185b00; - background: #e6ecc0; - color: #185b00; -} - /* Sales -------------------------------------- */ diff --git a/app/design/adminhtml/Magento/backend/less/styles/pages.less b/app/design/adminhtml/Magento/backend/less/styles/pages.less index 13b6df76e0b18d5289a112f9ef1c1436bd391191..53d103577bb7f2b6f2c8a656e8a4aa1a4149b4be 100644 --- a/app/design/adminhtml/Magento/backend/less/styles/pages.less +++ b/app/design/adminhtml/Magento/backend/less/styles/pages.less @@ -456,40 +456,9 @@ } } -/* - System -> Export --------------------------------------- */ - -#export_filter_grid .grid td .input-text-range-date { - vertical-align: middle; -} - -#export_filter_grid .grid td .ui-datepicker-trigger { - vertical-align: middle; - margin-left: 5px; -} - -#export_filter_grid .grid select { - margin-bottom: 0; - width: 86%; -} - -#export_filter_grid .grid table td:first-child, -#export_filter_grid .grid tr th:first-child { - border-left: 0; -} - -#export_filter_grid .data thead { - border-left: 1px solid #837F79; -} - -#export_filter_grid .data tbody { - border-left: 1px solid #c0bbaf; -} - -/* - System -> Roles --------------------------------------- */ +// +// System -> Roles +// -------------------------------------- #gws_container ul { padding: 0; @@ -507,9 +476,9 @@ top: -1px; } -/* - Reports --------------------------------------- */ +// +// Reports +// -------------------------------------- */ .reports-title .page-actions { float: right; } @@ -526,7 +495,6 @@ width: 133px; } -/* TODO: refactor when validation design is ready */ .reports-content .required .control { position: relative; } @@ -543,398 +511,13 @@ display: table; } -.reports-title:after { - clear: both; -} - -/* - Reports - Customer Reviews --------------------------------------- */ -.reports-report-review-customer .col-qty, -.reports-report-review-customer .col-actions { - width: 85px; -} - -/* - Reports - Product Reviews --------------------------------------- */ - -.reports-report-review-product .col-id { - width: 35px; -} - -.reports-report-review-product .col-qty, -.reports-report-review-product .col-rating, -.reports-report-review-product .col-avg-rating, -.reports-report-review-product .col-actions { - text-align: right; - width: 85px; -} - -.reports-report-review-product .col-date { - width: 140px; -} - -.reports-report-review-product .col-rating { - width: 104px; -} - -/* - Reports - New Accounts --------------------------------------- */ - -.reports-report-customer-accounts .col-period { - white-space: nowrap; - width: 70px; -} - -/* - Reports - Refresh Statistics --------------------------------------- */ - -.reports-report-statistics-index .col-period { - white-space: nowrap; - width: 140px; -} - -.reports-report-statistics-index .col-select { - width: 25px; -} - -/* - Reports - Products Ordered --------------------------------------- */ -.reports-report-product-sold .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-product-sold .col-qty { - width: 110px; -} - -/* - Reports - Customers by Orders Total --------------------------------------- */ -.reports-report-customer-totals .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-customer-totals .col-qty { - width: 65px; -} - -.reports-report-customer-totals .col-rating { - width: 100px; -} - -/* - Reports - Tag by popular --------------------------------------- */ -.reports-report-tag-popular .col-qty, -.reports-report-tag-popular .col-actions { - width: 80px; -} - -/* - Reports - Tag by customer --------------------------------------- */ -.reports-report-tag-customer .col-id { - width: 35px; -} - -.reports-report-tag-customer .col-qty, -.reports-report-tag-customer .col-actions { - width: 80px; -} - -/* - Reports - Tag by product --------------------------------------- */ -.reports-report-tag-product .col-id { - width: 35px; -} - -.reports-report-tag-product .col-actions { - width: 70px; -} - -.reports-report-tag-product .col-unique-numbers, -.reports-report-tag-product .col-total-numbers { - text-align: right; - width: 95px -} - -/* - Reports - Customers by Number of Orders --------------------------------------- */ -.reports-report-customer-orders .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-customer-orders .col-qty, -.reports-report-customer-orders .col-average, -.reports-report-customer-orders .col-total { - width: 105px; -} - -/* - Reports - Customers by Orders Total --------------------------------------- */ -.reports-report-customer-totals .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-customer-totals .col-qty, -.reports-report-customer-totals .col-average, -.reports-report-customer-totals .col-total { - width: 105px; -} - -/* - Reports - Customer's wishlists --------------------------------------- */ -.adminhtml-report-customer-wishlist-wishlist .col-period { - width: 70px; -} - -.adminhtml-report-customer-wishlist-wishlist .col-whishlist-qty, -.adminhtml-report-customer-wishlist-wishlist .col-available-qty, -.adminhtml-report-customer-wishlist-wishlist .col-qty-diff { - text-align: right; - width: 100px; -} - -.adminhtml-report-customer-wishlist-wishlist .grid .range { - text-align: left; -} - -/* - Reports - Most Viewed --------------------------------------- */ -.reports-report-product-viewed .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-product-viewed .col-qty, -.reports-report-product-viewed .col-price { - white-space: nowrap; - width: 80px; -} - -/* - Reports - Search Terms --------------------------------------- */ -.reports-index-search .col-id { - width: 35px; -} - -.reports-index-search th.col-results, -.reports-index-search th.col-hits { - text-align: left; - width: 117px; -} - -.reports-index-search td.col-results, -.reports-index-search td.col-hits { - text-align: right; - width: 117px; -} - -.reports-index-search .col-results .range-line:first-child, -.reports-index-search .col-hits .range-line:first-child { - float: left; - margin-right: 3px; -} - -/* - Reports - Bestsellers --------------------------------------- */ - -.reports-report-sales-bestsellers .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-bestsellers .col-qty, -.reports-report-sales-bestsellers .col-price { - width: 80px; -} - -/* - Reports - Downloads --------------------------------------- */ -.reports-report-product-downloads .col-qty, -.reports-report-product-downloads .col-price { - width: 80px; -} - -/* - Reports - Abandoned Carts --------------------------------------- */ - -.reports-report-shopcart-abandoned .col-ip, -.reports-report-shopcart-abandoned .col-subtotal, -.reports-report-shopcart-abandoned .col-number, -.reports-report-shopcart-abandoned .col-coupon { - text-align: right; -} - -.reports-report-shopcart-abandoned .col-ip { - width: 105px; -} - -.reports-report-shopcart-abandoned .col-subtotal { - width: 65px; -} - -/* - Reports - Products in Carts --------------------------------------- */ -.reports-report-shopcart-product .col-id { - width: 35px; -} - -.reports-report-shopcart-product .col-carts, -.reports-report-shopcart-product .col-qty, -.reports-report-shopcart-product .col-price { - text-align: right; - width: 80px; -} - -/* - Reports - Refunds --------------------------------------- */ - -.reports-report-sales-refunded .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-refunded .col-ref-total, -.reports-report-sales-refunded .col-ref-online, -.reports-report-sales-refunded .col-ref-offline { - text-align: right; - width: 23%; -} - -/* - Reports - Shipping --------------------------------------- */ - -.reports-report-sales-shipping .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-shipping .col-qty, -.reports-report-sales-shipping .col-total-sales-shipping, -.reports-report-sales-shipping .col-total-shipping { - text-align: right; - width: 115px; -} - -/* - Reports - Invoiced --------------------------------------- */ - -.reports-report-sales-invoiced .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-invoiced .col-qty, -.reports-report-sales-invoiced .col-invoiced, -.reports-report-sales-invoiced .col-total-invoiced, -.reports-report-sales-invoiced .col-total-invoiced-paid, -.reports-report-sales-invoiced .col-total-invoiced-not-paid { - text-align: right; - width: 19%; -} - -/* - Reports - Tax --------------------------------------- */ - -.reports-report-sales-tax .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-tax .col-rate, -.reports-report-sales-tax .col-qty, -.reports-report-sales-tax .col-tax-amount { - text-align: right; - width: 105px; -} - -/* - Reports - Orders --------------------------------------- */ -.reports-report-sales-sales .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-sales .col-orders, -.reports-report-sales-sales .col-sales-items, -.reports-report-sales-sales .col-sales-total, -.reports-report-sales-sales .col-invoiced, -.reports-report-sales-sales .col-refunded, -.reports-report-sales-sales .col-sales-tax, -.reports-report-sales-sales .col-sales-shipping, -.reports-report-sales-sales .col-sales-discount, -.reports-report-sales-sales .col-canceled { - text-align: right; - width: 10.5%; -} - -/* - Reports - Coupons --------------------------------------- */ -/* TODO: re-check styles for coupons table after coupons functionality will have been repaired */ -.reports-report-sales-coupons .col-period { - white-space: nowrap; - width: 70px; -} - -.reports-report-sales-coupons .col-sales, -.reports-report-sales-coupons .col-users, -.reports-report-sales-coupons .col-sales-discount, -.reports-report-sales-coupons .col-total-amount, -.reports-report-sales-coupons .col-subtotal, -.reports-report-sales-coupons .col-discount, -.reports-report-sales-coupons .col-total { - text-align: right; -} - -/* - Reports - Low Stock --------------------------------------- */ - -.reports-report-product-lowstock .col-qty { - width: 10%; -} - -.reports-report-product-lowstock .range-line { - display: inline-block; -} - -.reports-report-product-lowstock .col-product { - width: 65%; -} - -.reports-report-product-lowstock .col-sku { - width: 25%; +.reports-title:after { + clear: both; } -/* - Reports - PayPal Settlement Reports --------------------------------------- */ +// +// Reports - PayPal Settlement Reports +//-------------------------------------- .adminhtml-paypal-reports-index .grid tr.headings th > span { white-space: normal; @@ -949,13 +532,6 @@ text-align: right; } -/* - Newsletter --------------------------------------- */ -// [class^=" newsletter-"] .page-actions .action-back { -// float: right; -// } - /* Newsletter Templates -------------------------------------- */ @@ -1164,22 +740,25 @@ .style3(); } -.customer-current-activity { +.order-sidebar { float: left; width: 22%; } .customer-current-activity-inner { - background: #fff; - border: 1px solid #eae6e0; padding: 18px; - border-radius: 5px; } +.order-currency { + padding: 18px; +} +.order-detail { +} .order-details-existing-customer { - padding-left: 1%; + background: #fff; + padding-left: 0; position: relative; - width: 77%; + width: 77.9%; float: right; } @@ -1324,30 +903,6 @@ border-radius: 5px; } -#order-data .order-items td[colspan="8"] { - border: 1px solid #c0bbaf; -} - -.order-search-items thead th:nth-child(1) { - width: 60px; -} - -.order-search-items thead th:nth-child(3) { - width: 80px; -} - -.order-search-items thead th:nth-child(4) { - width: 100px; -} - -.order-search-items thead th:nth-child(5) { - width: 55px; -} - -.order-search-items thead th:nth-child(6) { - width: 1px; -} - .adminhtml-rma-new .order-totals, .order-comments-history .order-comments-history, [class^=" adminhtml-rma-"] .rma-comments-history { @@ -1365,106 +920,50 @@ margin: 17px 0 0; } -// .sales-order-create-index .page-actions-inner .cancel, -// .sales-order-create-index .page-actions-inner .cancel:hover, -// .sales-order-create-index .page-actions-inner .cancel:active { -// float: right; -// margin: 0 0 0 12px; -// padding: 3px 0 3px 6px; -// } - .sales-order-create-index #order-message .messages .message, .sales-order-edit-index #order-message .messages .message { margin: 0 0 60px; } -.sales-order-create-index thead .col-entity_id, -.sales-order-create-index .col-entity_id, -.sales-order-create-index .col-qty, -.checkout-index-index .col-qty { - width: 50px; -} - -.sales-order-create-index .col-in_products, -.checkout-index-index .col-in_products { - text-align: center; -} - -.sales-order-create-index .col-sku, -.sales-order-create-index .col-remove, -.checkout-index-index .col-remove { - width: 120px; -} - -.sales-order-create-index .col-price { - width: 70px; -} - -.sales-order-create-index .order-search-items .col-name, -.checkout-index-index #source_products_table .col-name { - width: 50%; -} - -.sales-order-create-index .order-items.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-search-items.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-additional-area.fieldset-wrapper .fieldset-wrapper-title, -.sales-order-create-index .order-errors .fieldset-wrapper-title, -.checkout-index-index .checkout-errors .fieldset-wrapper-title { - border-bottom: 0; - margin: 0; -} - -.sales-order-create-index #order-data .fieldset-wrapper-title .actions .action-add { - margin-left: 0; - margin-right: 20px; -} - -.sales-order-create-index .order-items.fieldset-wrapper .title, -.sales-order-create-index .order-additional-area.fieldset-wrapper .title, -.sales-order-create-index .order-search-items.fieldset-wrapper .title, -.sales-order-create-index .order-errors .title, -.checkout-index-index .checkout-errors .title { - border-bottom: 1px solid #ededed; - float: none; - margin: 0 0 18px; - width: 100%; -} - -.sales-order-create-index .order-items.fieldset-wrapper .actions, -.sales-order-create-index .order-search-items.fieldset-wrapper .actions, -.sales-order-create-index #order-errors .actions, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions { - float: none; - border: 1px solid #c0bbaf; - border-bottom: 0; - background: rgb(246, 243, 236); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y2ZjNlYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZGVhZTEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(246, 243, 236, 1)), color-stop(100%, rgba(237, 234, 225, 1))); - background: -webkit-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -o-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: -ms-linear-gradient(top, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - background: linear-gradient(to bottom, rgba(246, 243, 236, 1) 0%, rgba(237, 234, 225, 1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f3ec', endColorstr='#edeae1', GradientType=0); - margin: 0; - padding: 0 8px; - position: relative; -} +// +// Sales -> Create Order +// -------------------------------------- +.sales-order-create-index { -.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-add { - margin: 7px 8px 8px 0; } -.sales-order-create-index .order-additional-area.fieldset-wrapper .actions { - float: none; - margin: 0 0 8px; - padding: 0; +.sales-order-create-index .order-items.fieldset-wrapper, +.sales-order-create-index .order-search-items.fieldset-wrapper, +.sales-order-create-index .order-additional-area.fieldset-wrapper, +.sales-order-create-index .order-errors, +.checkout-index-index .checkout-errors { + .fieldset-wrapper-title { + border-bottom: 0; + margin: 0; + } + .title { + border-bottom: 1px solid #cac3b4; + margin: 0 0 18px; + width: 100%; + } } -.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete, -.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-delete { - margin: 13px 0 0; +[class*="-order-"] { + .fieldset-wrapper-title { + .actions { + float: right; + padding: 0; + a:link, + a:visited, + a:hover, + a:active { + color: #a29c94; + } + } + } + .order-details .fieldset-wrapper-title .actions { + padding-bottom: 15px; + } } .sales-order-create-index { @@ -1509,6 +1008,19 @@ } } } + .grid .action-configure { + float: right; + &.disabled { + cursor: default; + opacity: 0.5; + &:hover { + text-decoration: none; + } + } + } + .order-items.fieldset-wrapper { + .clearfix(); + } } .tax.summary-total .summary-collapse { @@ -1569,30 +1081,61 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d // } .create-order-sidebar-container > div + div { - border-top: 1px solid #ededed; + border-top: 1px solid #cac3b4; margin-top: 35px; } .create-order-sidebar-container > div .head h5 { .style9(); - margin: 17px 0 7px; + margin: 17px 0 17px; } .customer-current-activity-inner > h4 { .style10(); - border-bottom: 1px solid #ededed; + border-bottom: 1px solid #cac3b4; margin-top: 0; padding: 0 0 16px; } -.customer-current-activity-inner .data-table th { - .style18(); +.customer-current-activity-inner .auto-scroll { + margin-right: -18px; + margin-left: -18px; + .no-items { + padding: 5px 18px; + display: block; + } } - -.customer-current-activity-inner .data-table td { - .style19(); +.customer-current-activity-inner .data-table { + thead { + background-color: transparent; + } + thead th { + background-color: transparent; + .style18(); + border: 0; + &:first-child { + padding-left: 18px; + } + &:last-child { + padding-right: 18px; + } + } + tbody tr { + td { + background-color: transparent; + border: 0; + &:first-child { + padding-left: 18px; + } + &:first-child { + padding-right: 18px; + } + } + &:nth-child(2n + 1) td { + background: #e0dace; + } + } } - .customer-current-activity .action-refresh { float: right; } @@ -1604,6 +1147,7 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d overflow: hidden; height: 16px; width: 16px; + line-height: 16px; white-space: nowrap; } @@ -1614,6 +1158,7 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d display: block; text-indent: 0; font-size: 16px; + line-height: 16px; font-family: 'MUI-Icons'; font-style: normal; font-weight: normal; @@ -1666,21 +1211,9 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d } } -/* - Order view --------------------------------------- */ -[class*="-order-"] .fieldset-wrapper-title .actions { - float: right; - font-size: 12px; - margin: 8px 20px 0 0; -} - -[class*="-order-"] .fieldset-wrapper-title .actions a:link, -[class*="-order-"] .fieldset-wrapper-title .actions a:visited, -[class*="-order-"] .fieldset-wrapper-title .actions a:hover, -[class*="-order-"] .fieldset-wrapper-title .actions a:active { - color: #a29c94; -} +// +// Order view +// -------------------------------------- .order-comments-history fieldset { border: 0; @@ -1712,166 +1245,49 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d overflow: auto; } -/* - Orders comments --------------------------------------- */ +// +// Orders comments +//-------------------------------------- .note-list { list-style: none; padding: 0; -} - -.note-list li { - border-top: 1px solid #ededed; - padding: 9px 0; -} - -.note-list li:first-child { - border: 0; - padding-top: 13px; -} - -.note-list div { - font-size: 12px; -} - -.note-list .note-list-date, -.note-list .note-list-status, -.note-list .note-list-customer span { - font-weight: bold; -} - -.note-list .note-list-time, -.note-list .note-list-status { - border-right: 1px solid #676056; - padding: 0 5px 0 0; - margin: 0 5px 0 0; -} - -.note-list .note-list-customer { - white-space: nowrap; -} - -.note-list .note-list-comment { - margin: 5px 0 0; -} - -.note-list .note-list-customer-notapplicable { - color: #d87e34; -} - -.note-list .note-list-customer-notified { - color: #185b00; -} - -.note-list .note-list-customer-not-notified { - color: #963535; -} - - -.checkout-agreement-index .col-id, -[class^=" sales-billing-"] .col-id, -[class^=" sales-transactions-"] .col-id { - width: 35px; -} - -[class^=" adminhtml-order-shipment-"] .col-ship, -[class^=" sales-"] .col-return-to-stock, -.adminhtml-rma-new .col-select { - text-align: center; - width: 35px; -} - -[class*="-order-"] .col-price-original, -[class*="-order-"] .col-tax-amount, -[class*="-order-"] .col-tax-percent, -[class*="-order-"] .col-discont, -[class*="-order-"] .col-total, -[class*="-order-"] .col-discount, -[class*="-order-"] .col-tax, -[class^=" sales-"] .col-refunded, -[class^=" adminhtml-rma-"] .col-order, -[class^=" adminhtml-rma-"] .col-required, -[class^=" adminhtml-rma-"] .col-system, -[class^=" adminhtml-rma-"] .col-visible-on-front, -.checkout-agreement-index .col-status, -.adminhtml-rma-item-attribute-edit .col-position { - text-align: right; - white-space: nowrap; - width: 50px; -} - -[class*="-order-"] .col-subtotal, -[class*="-order-"] .col-price, -[class^=" adminhtml-rma-"] .col-price { - text-align: right; - width: 50px; -} - -.sales-order-invoice-view .col-subtotal, -.sales-order-invoice-view .col-price { - width: 10%; -} - -[class^=" sales-"] .col-actions, -[class^=" adminhtml-rma-"] .col-actions, -[class^=" adminhtml-rma-"] .col-default { - width: 50px; -} - -[class^=" sales-"] .col-select, -[class^=" adminhtml-rma-"] .col-select { - width: 60px; -} - -[class^=" sales-"] .col-qty, -[class*="-order-"] .col-qty-invoice, -[class*="-order-"] .col-ordered-qty, -[class^=" adminhtml-rma-"] .col-qty, -[class^=" adminhtml-rma-"] .col-condition { - width: 70px; -} - -[class^=" sales-"] .col-refund, -[class^=" sales-transactions-"] .col-closed, -.sales-order-view .col-closed { - text-align: center; - width: 70px; -} - -[class^=" sales-"] .col-order-number, -[class^=" sales-"] .col-invoice-number, -[class^=" sales-"] .col-memo-number, -[class^=" sales-"] .col-shipment-number, -[class^=" sales-"] .col-rma-number, -[class^=" sales-"] .col-status, -[class^=" adminhtml-rma-"] .col-order-number, -[class^=" adminhtml-rma-"] .col-rma-number, -[class^=" sales-transactions-"] .col-order-id, -.sales-order-view .col-refunded { - white-space: normal; - width: 75px; -} - -[class^=" sales-"] .col-gtbase, -[class^=" sales-"] .col-gtpurchased { - text-align: right; - white-space: normal; - width: 75px; -} - -[class^=" sales-"] .col-order-number, -[class^=" sales-"] .col-rma-number, -[class^=" adminhtml-rma-"] .col-order-number, -[class^=" adminhtml-rma-"] .col-rma-number { - text-align: left; -} - -[class^=" adminhtml-rma-"] .col-status, -[class^=" adminhtml-rma-"] .col-reason, -[class^=" adminhtml-rma-"] .col-resolution, -[class^=" sales-transactions-"] .col-transaction-type, -.sales-order-view .col-memo { - width: 100px; + li { + border-top: 1px solid #ededed; + padding: 9px 0; + &:first-child { + border: 0; + padding-top: 13px; + } + } + div { + font-size: 12px; + } + .note-list-date, + .note-list-status, + .note-list-customer span { + font-weight: bold; + } + .note-list-time, + .note-list-status { + border-right: 1px solid #676056; + padding: 0 5px 0 0; + margin: 0 5px 0 0; + } + .note-list-customer { + white-space: nowrap; + } + .note-list-comment { + margin: 5px 0 0; + } + .note-list-customer-notapplicable { + color: #d87e34; + } + .note-list-customer-notified { + color: #185b00; + } + .note-list-customer-not-notified { + color: #963535; + } } [class^=" sales-"] tr.headings .col-parent-transaction-id > span, @@ -1884,34 +1300,6 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d white-space: normal; } -[class^=" sales-"] .col-period, -[class^=" adminhtml-rma-"] .col-period { - width: 150px; -} - -[class^=" adminhtml-order-shipment-"] .col-carrier { - width: 190px; -} - -.checkout-agreement-index .col-store-view { - white-space: nowrap; - width: 200px; -} - -[class^=" sales-transactions-"] .log-details .data-table tbody tr th, -[class^=" sales-transactions-"] .col-key { - width: 22%; -} - -.sales-order-index .col-1-layout table.data { - table-layout: fixed; - word-wrap: break-word; -} - -[class^=" sales-"] .col-from-store { - width: 15%; -} - [class^=" sales-"] .col-2-left-layout .hor-scroll { margin-bottom: -4px; overflow: auto; @@ -1919,13 +1307,6 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d width: 100%; } -[class*="-order-"] .order-totals .actions, -[class^=" adminhtml-rma-"] .col-qty, -[class^=" adminhtml-rma-"] .col-qty_ordered, -.sales-order-view .col-refunded { - text-align: right; -} - [class*="-order-"] .col-price .label, [class*="-order-"] .col-subtotal .label { display: inline-block; @@ -1933,43 +1314,14 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d white-space: nowrap; } -[class*="-order-"] .col-price .price-excl-tax .price, -[class*="-order-"] .col-price .price-incl-tax .price, -[class*="-order-"] .col-subtotal .price-excl-tax .price, -[class*="-order-"] .col-subtotal .price-incl-tax .price { - font-weight: bold; -} - -[class*="-order-"] .grid .col-qty table, -[class*="-order-"] .grid .col-qty tbody, -[class*="-order-"] .grid .col-qty tr, -[class*="-order-"] .grid .col-qty td, -[class*="-order-"] .grid .col-ordered-qty table, -[class*="-order-"] .grid .col-ordered-qty tbody, -[class*="-order-"] .grid .col-ordered-qty tr, -[class*="-order-"] .grid .col-ordered-qty td { - background: none; - border: 0; -} - -[class*="-order-"] .col-ordered-qty td { - padding: 0 5px 3px; -} - -[class*="-order-"] .grid .product-title { - font-weight: bold; -} - [class*="-order-"] .item-options { margin: 5px 0 5px 10px; -} - -[class*="-order-"] .item-options dt { - font-weight: bold; -} - -[class*="-order-"] .item-options dd { - margin: 0 0 0 10px; + dt { + font-weight: bold; + } + dd { + margin: 0 0 0 10px; + } } .adminhtml-rma-item-attribute-edit .col-position input { @@ -2071,23 +1423,6 @@ table.items-to-invoice tbody tr:hover td { margin-top: 15px; } -[class^=" sales-"] .order-payment-additional { - margin-top: 15px; -} - -[class^=" sales-"] .grid tbody td { - vertical-align: top; -} - -[class^=" sales-"] .grid tbody.even tr td { - background: #e6e3de; -} - -[class^=" sales-"] .grid tbody.odd tr td { - border-bottom: 0; - background: #f5f2ed; -} - [class^=" sales-"] .grid .data { border-bottom: 1px solid #c0bbaf; } @@ -2616,18 +1951,6 @@ table.items-to-invoice tbody tr:hover td { margin-top: 5px; } -/* - Currency Symbols --------------------------------------- */ -.adminhtml-system-currencysymbol-index th.col-symbol .required:after { - content: '*'; - margin-left: 3px; -} - -.adminhtml-system-currencysymbol-index td.col-currency .label { - margin-top: 5px; -} - /* Categories -------------------------------------- */ diff --git a/app/design/adminhtml/Magento/backend/less/vars.less b/app/design/adminhtml/Magento/backend/less/vars.less deleted file mode 100644 index d6353e4bba6ba667aa3e3de954037249e988839c..0000000000000000000000000000000000000000 --- a/app/design/adminhtml/Magento/backend/less/vars.less +++ /dev/null @@ -1,87 +0,0 @@ -// /** -// // * Magento -// * -// * NOTICE OF LICENSE -// * -// * This source file is subject to the Academic Free License (AFL 3.0) -// * that is bundled with this package in the file LICENSE_AFL.txt. -// * It is also available through the world-wide-web at this URL: -// * http://opensource.org/licenses/afl-3.0.php -// * If you did not receive a copy of the license and are unable to -// * obtain it through the world-wide-web, please send an email -// * to license@magentocommerce.com so we can send you a copy immediately. -// * -// * DISCLAIMER -// * -// * Do not edit or add to this file if you wish to upgrade Magento to newer -// * versions in the future. If you wish to customize Magento for your -// * needs please refer to http://www.magentocommerce.com for more information. -// * -// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) -// * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -// */ - -@baseDir: ~".."; - -// Primary colors -@primary1: #676056; -@primary2: #ed4f2e; -@primary3: #026294; -@primary4: #fff; -@primary5: #007dbd; -@primary6: #e22626; -@primary7: #f2ebde; -@primary8: #31302b; -@primary9: #ef672f; - -// Buttons -// Default Buttons -@defaultButton1: #f2ebde; -@defaultButton2: #ada89e; -@defaultButton3: #676056; -@defaultButton4: #cac3b4; -@defaultButton5: #989287; - -// Primary Buttons -@primaryButton1: #007dbd; -@primaryButton2: #0574ad; -@primaryButton3: #026294; -@primaryButton4: #004c74; - -// Links -@linkColor: @primary3; -@linkColor2: @primary4; - -// Base font -@baseFont: 'Open Sans', sans-serif; -@baseFontSize: 14px; -@baseFontWeight: 400; -@baseFontWeightSemibold: 600; -@baseFontWeightBold: 700; -@baseLineHeight: 1.33; -@baseColor: @primary1; - -// Headings -// H1 -@h1color: @primary1; -@h1font: 400 28px/1.2 @baseFont; - -// H2 -@h2color: @primary1; -@h2font: 400 20px/1.2 @baseFont; - -// H3 -@h3color: @primary1; -@h3font: 600 16px/1.2 @baseFont; - -// H4 -@h4color: @primary1; -@h4font: 600 14px/1.2 @baseFont; - -// H5 -@h5color: @primary1; -@h5font: 600 13px/1.2 @baseFont; - -// H6 -@h6color: @primary1; -@h6font: 600 12px/1.2 @baseFont; diff --git a/app/design/adminhtml/Magento/backend/mui/base.css b/app/design/adminhtml/Magento/backend/mui/base.css index 6427dec572f06eb96724811eb6bdc74c71867dc2..210ff9cd67c9c360910c1ec85a4e5ba7860ea7d0 100644 --- a/app/design/adminhtml/Magento/backend/mui/base.css +++ b/app/design/adminhtml/Magento/backend/mui/base.css @@ -209,35 +209,3 @@ blockquote { blockquote small:before { content: '\2014 \00A0'; } - -/* - Tables --------------------------------------- */ -table > caption { - margin-bottom: 5px; -} - -table tfoot, -table th { - background: #e6e6e6; -} - -table th, -table td { - border: 1px solid #ccc; - padding: 10px 15px; -} - -table tbody tr td { - background: #fff; -} - -table tbody tr:nth-child(odd) td, -table tbody tr:nth-child(odd) th { - background-color: #f9f9f9; -} - -table tbody tr:hover td, -table tbody tr:hover th { - background-color: #fff9e4; -} diff --git a/app/design/adminhtml/Magento/backend/mui/elements.css b/app/design/adminhtml/Magento/backend/mui/elements.css index 15a429cba47413dfc43942b938bb1b40140c7111..0a6530e097d268912ff8ab88519aa42a747de13d 100644 --- a/app/design/adminhtml/Magento/backend/mui/elements.css +++ b/app/design/adminhtml/Magento/backend/mui/elements.css @@ -24,9 +24,9 @@ /* Close btn -------------------------------------- */ -.close:before { +/*.close:before { content: '\00D7\00A0'; -} +}*/ /* Tooltips @@ -1067,10 +1067,6 @@ table.loading:after { border: 1px solid #b8b8b8; } -.popup-header, -.popup-content { -} - .popup-header { font-weight: bold; } @@ -1092,6 +1088,10 @@ table.loading:after { padding-left: 5px; } +.popup .close:before { + content: '\00D7\00A0'; +} + .popup-system { padding: 0; background: #fff; diff --git a/app/design/adminhtml/Magento/backend/mui/form.css b/app/design/adminhtml/Magento/backend/mui/form.css index 6ce72832d61c9643ea9426c6ad81cb9fab479632..e266d2317bc6855a6c740357a234f098c1778ff8 100644 --- a/app/design/adminhtml/Magento/backend/mui/form.css +++ b/app/design/adminhtml/Magento/backend/mui/form.css @@ -66,7 +66,6 @@ .control select, .control textarea { margin: 0; - border-radius: 4px; } /* @@ -157,14 +156,14 @@ span.required { .addon select:first-child, .addon input:first-child, .addon .addbefore:first-child { - border-radius: 4px 0 0 4px; + border-radius: 2px 0 0 2px; } .addon textarea:last-child, .addon select:last-child, .addon input:last-child, .addon .addafter:last-child { - border-radius: 0 4px 4px 0; + border-radius: 0 2px 2px 0; } .addon .addbefore, diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Catalog/css/source/module.less index 3974c009cd675476bd595c2c4b30e15bb7aae2d8..c450fa703e7a3238cbc79e8e4e8c49882a8b1ebb 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/css/source/module.less @@ -182,17 +182,27 @@ } .block.filter { + .title { + margin-bottom: 20px; + strong { + font-size: 18px; + } + } .subtitle { - display: block; - .heading(h5); + display: none; } .options { margin: 0; > dt { - .heading(h5); + .heading(h4); + margin: 0 0 10px 0; } > dd { - margin: 0 0 @indent-l-base; + margin: 0 0 25px; + + .item { + margin-bottom: 3px; + } } .count { color: @text-color-muted; @@ -208,27 +218,27 @@ &:extend(.reset-list all); } .filtered { + .items { + margin: 15px 0; + } .item { position: relative; - padding-left: 25px; + padding-left: 22px; + margin-bottom: 6px; + .label { font-weight: @font-weight-bold; } .action.remove { + &:extend(.remove-button-for-blocks all); + position: absolute; - top: -4px; - left: 0; - .icon-font( - @icon-remove, - @_icon-font-size: 28px, - @_icon-font-line-height: 1, - @_icon-font-color: @text-color-muted - ); - .icon-text-hide(); + left: -6px; + top: 0; } } & + .actions { - margin-bottom: @indent-l-base; + margin-bottom: 35px; } } } @@ -396,7 +406,7 @@ .price-excluding-tax, .price-including-tax { white-space: nowrap; - display: inline-block; + display: block; } /* diff --git a/app/design/frontend/Magento/blank/Magento_CatalogSearch/css/source/module.less b/app/design/frontend/Magento/blank/Magento_CatalogSearch/css/source/module.less index 43a6ffdabb4c816d8d06be647abda45be8d4e076..50676fab7a9ee90b20cd90b417225d9c17b89fb0 100644 --- a/app/design/frontend/Magento/blank/Magento_CatalogSearch/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_CatalogSearch/css/source/module.less @@ -22,12 +22,18 @@ // * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) // */ +@autocomplete-background: #fff; +@autocomplete-border: 1px solid @form-element-input-border-color; +@autocomplete-item-border: 1px solid #e5e5e5; +@autocomplete-item-hover: #e8e8e8; +@autocomplete-item-amount-color: #999; + .block.search { float: right; padding-left: 15px; position: relative; width: 250px; - z-index: 1; + z-index: 4; input { padding-right: 35px; } @@ -46,7 +52,8 @@ @_button-margin: 3px, @_button-icon-use: true, @_button-font-content: @icon-search, - @_button-icon-font-text-hide: true + @_button-icon-font-text-hide: true, + @_button-icon-font-color: #8b8b8b ); .button-reset(); } @@ -55,6 +62,87 @@ position: absolute; } } +.search.autocomplete { + position: absolute; + top: 31px; + left: 15px; + z-index: 3; + background: @autocomplete-background; + border: @autocomplete-border; + border-top: 0; + overflow: hidden; + display: none; + .box-sizing(); + ul { + li { + border-top: @autocomplete-item-border; + cursor: pointer; + padding: 5px 40px 5px 10px; + margin: 0; + position: relative; + text-align: left; + white-space: normal; + &:first-child { + border-top: none; + } + &:hover { + background: @autocomplete-item-hover; + } + .amount { + color: @autocomplete-item-amount-color; + position: absolute; + right: 7px; + top: 5px; + } + } + } +} + +.form.search.advanced { + .fields.range { + .field { + &.no-label:before { + padding: 0; + height: 0; + } + &:first-child { + position: relative; + .control { + padding-right: 25px; + &:after { + content: ' \2013 '; + display: inline-block; + text-align: center; + width: 25px; + position: absolute; + right: 0; + top: 6px; + } + } + } + &:last-child { + position: relative; + input { + width: 88%; + } + div.mage-error[generated] { + position: absolute; + top: 32px; + left: 0; + } + } + } + } + .group.price { + .addon { + .addafter { + border: none; + padding-top: 6px; + vertical-align: top; + } + } + } +} .responsive(@break) when (@break = @mobile) { .block.search { @@ -63,7 +151,6 @@ padding: 0; position: relative; width: 100%; - z-index: 4; .action.search { display: none; } @@ -100,4 +187,9 @@ position: absolute; } } + .search.autocomplete { + top: 100%; + margin-top: -15px; + left: 0; + } } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Checkout/css/source/module.less index 130cb32a492e1ba745ca2a58cb3dd6eae761f2aa..8566adbcb21d89347517902106e971a79ba7f095 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/css/source/module.less @@ -133,11 +133,17 @@ .action.quote, .action.apply, .action.cancel { - .box-sizing(); border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; } + .actions.toolbar { + .primary { + button { + .button-revert-secondary-color(); + } + } + } } &.totals { @@ -342,6 +348,7 @@ &.content { padding: 20px 25px 40px; position: relative; + height: auto !important; .addresses .control { margin: 20px 0 30px; } @@ -513,6 +520,15 @@ &:extend(.action-toolbar-reset-margin all); } } + .extra-options-container { + .price.box { + font-weight: normal; + margin-left: 20px; + &.no-display { + display: none; + } + } + } } // @@ -532,7 +548,10 @@ } } .subtitle { - margin-bottom: 15px; + .heading(h3); + display: inline-block; + margin-top: 0; + font-weight: 500; } > .content > .actions { margin-top: 10px; @@ -547,6 +566,7 @@ .minicart.wrapper { float: right; order:3; + margin-left: 30px; .dropdown( @_toggle-selector: ~".action.showcart", @_options-selector: ~".block.minicart", @@ -556,31 +576,31 @@ @_dropdown-list-item-hover: false, @_icon-font-position: before, @_icon-font-size: 35px, - @_icon-font-line-height: 33px + @_icon-font-line-height: 33px, + @_icon-font-color: @color-primary, + @_icon-font-color-hover: @color-primary, + @_icon-font-color-active: @color-primary ); .action.showcart { - .text { - .visually-hidden(); - } - white-space: nowrap; - .counter.qty { - overflow:hidden; - margin: 3px 0 0; - padding:0 3px; - clip: none; - display: inline-block; - white-space: normal; - min-width: 20px; - max-width: 2em; - background: @color-active; - text-align: center; - color: #fff; - line-height: 26px; - height: 26px; - border-radius: 2px; - &.empty:before { - content: "0"; - } + .text { + .visually-hidden(); + } + white-space: nowrap; + .counter.qty { + overflow:hidden; + margin: 3px 0 0; + padding:0 3px; + clip: none; + display: inline-block; + white-space: normal; + min-width: 20px; + max-width: 2em; + background: @color-active; + text-align: center; + color: #fff; + line-height: 26px; + height: 26px; + border-radius: 2px; } } .block.minicart { diff --git a/app/design/frontend/Magento/blank/Magento_Customer/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Customer/css/source/module.less index 0be730e1dda641d45467d035fdfcd85e804454ed..276c8ef94c7881259e27bec00ec9353c5c0d74f0 100644 --- a/app/design/frontend/Magento/blank/Magento_Customer/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Customer/css/source/module.less @@ -80,6 +80,16 @@ } } +.address.billing, +.address.shipping, +.box.information, +.box.newsletter { + address, + p { + line-height: 26px; + } +} + // // Responsive //-------------------------------------- diff --git a/app/design/frontend/Magento/blank/Magento_Newsletter/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Newsletter/css/source/module.less index 8cbd3c3e1fc62a72317244347b72e166df70bfb3..aea6950105fddeddef67c825917d5e11ff78b5ba 100644 --- a/app/design/frontend/Magento/blank/Magento_Newsletter/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Newsletter/css/source/module.less @@ -39,7 +39,8 @@ .icon-font( @icon-envelope, @_icon-font-size: 35px, - @_icon-font-line-height: 33px + @_icon-font-line-height: 33px, + @_icon-font-color: #c6c6c6 ); &:before { position: absolute; diff --git a/app/design/frontend/Magento/blank/Magento_Review/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Review/css/source/module.less index 33b1afb102c0c3bf346e2bd7a0da8599601f9966..b582e2bc3616d4507a51328ceae28d50651b3a85 100644 --- a/app/design/frontend/Magento/blank/Magento_Review/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Review/css/source/module.less @@ -29,17 +29,13 @@ .block { &.add.review { + margin-bottom: @indent-xl-base; > .title { .heading(h2); } - fieldset { - .form-fieldset( - @_margin: 0, - @_legend-margin: 0 0 10px - ); - } .legend { .heading(h3); + margin: 0 0 @indent-base; } .field.rating { display: table-row; @@ -53,9 +49,6 @@ vertical-align: top; } } - .form.actions { - margin-left: @form-field-type-inline-label-width; - } } &.reviews.list { > .title { @@ -88,11 +81,12 @@ .product.reviews.summary { display: table; - margin-left: -@indent-xs-base; &.empty { margin-left: 0; } .rating.summary { + position: relative; + left: -@indent-xs-base; display: table-cell; vertical-align: middle; } diff --git a/app/design/frontend/Magento/blank/Magento_Theme/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Theme/css/source/module.less index 54c9185628755a22ebac300181cc74cc9c0c6038..633c7b79a68b8d0183af457c8ff08784358b79a3 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Theme/css/source/module.less @@ -158,9 +158,20 @@ body { ul { .list-reset-styles(0, 0 50px 0 0); } - .links { + .links, + .switcher.store { display: inline-block; vertical-align: top; + margin-bottom: 20px; + } + .switcher.store { + padding-right: 50px; + float: none; + margin: 0 0 30px 0; + + ul { + padding-right: 0; + } } .block { float: right; diff --git a/app/design/frontend/Magento/blank/Magento_Wishlist/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Wishlist/css/source/module.less index f0923b91f37c8dc4952a6efda0822d3241177247..e706bdd8ad803ae6279d8051cdc34abe3add86d4 100644 --- a/app/design/frontend/Magento/blank/Magento_Wishlist/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Wishlist/css/source/module.less @@ -35,6 +35,16 @@ } } -.data.table.wishlist .box.tocart .qty { - &:extend(.input-qty all); +.data.table.wishlist { + .product.name { + display: inline-block; + margin-bottom: @indent-s-base; + } + .box.tocart { + margin: @indent-s-base 0; + .qty { + vertical-align: middle; + &:extend(.input-qty all); + } + } } diff --git a/app/design/frontend/Magento/blank/css/source/abstract.less b/app/design/frontend/Magento/blank/css/source/abstract.less index 5406ec14049067f001b26a3f155dfe354b788c94..db29546c53a7d656099ecd0de3633c8304934231 100644 --- a/app/design/frontend/Magento/blank/css/source/abstract.less +++ b/app/design/frontend/Magento/blank/css/source/abstract.less @@ -128,6 +128,7 @@ margin: 0 10px 5px 0; } dd { + float: left; display: inline-block; margin: 0 0 5px; } @@ -173,9 +174,9 @@ //-------------------------------------- .login-block-title { strong { - .heading(h3); + font-weight: 500; } - padding-bottom: 15px; + padding-bottom: 12px; margin-bottom: 15px; border-bottom: 1px solid @color-secondary; } diff --git a/app/design/frontend/Magento/blank/css/source/actions-toolbar.less b/app/design/frontend/Magento/blank/css/source/actions-toolbar.less index 8363926c2d79dc74bae4037f5254d2aaf9e607ab..975b3c94d9438af159eec5f75cf4670a42f3a635 100644 --- a/app/design/frontend/Magento/blank/css/source/actions-toolbar.less +++ b/app/design/frontend/Magento/blank/css/source/actions-toolbar.less @@ -44,7 +44,7 @@ } } -.form { +form { .actions.toolbar { margin-left: @form-field-type-inline-label-width; } diff --git a/app/design/frontend/Magento/blank/css/source/forms.less b/app/design/frontend/Magento/blank/css/source/forms.less index 7a2ba59ba1bba518c0b80c7135e2397c9a8bf4ab..aa588edbe093262eeee3cb284b42634d33fc0239 100644 --- a/app/design/frontend/Magento/blank/css/source/forms.less +++ b/app/design/frontend/Magento/blank/css/source/forms.less @@ -53,6 +53,10 @@ } } +div.mage-error[generated] { + margin-top: 7px; +} + // TEMP .field .tooltip { diff --git a/app/design/frontend/Magento/blank/css/source/theme.less b/app/design/frontend/Magento/blank/css/source/theme.less index 2cf83f969b973bac0b134a3e1f91010b5d4e07bc..642480e231f80ac518e5e4af204577b6866ef413 100644 --- a/app/design/frontend/Magento/blank/css/source/theme.less +++ b/app/design/frontend/Magento/blank/css/source/theme.less @@ -80,13 +80,6 @@ } } -.truncated.full.value { - display: none; - &.show { - display: block; - } -} - //My account .layout-2-left.account { .column.sidebar { @@ -156,16 +149,26 @@ padding: 0; margin: 0; .nav.item { - margin: 2px 0 0; + margin: 3px 0 0; &:first-child { margin-top: 0; } - padding: 0 18px 0 15px; - line-height: 30px; - border-left: 3px solid transparent; + a, + strong { + display: block; + padding: 0 18px 0 15px; + line-height: 30px; + border-left: 3px solid transparent; + } + a { + text-decoration: none; + &:hover { + background: #e8e8e8; + } + } &.current { - border-color: #ff5501; strong { + border-color: #ff5501; font-weight: normal; } } @@ -385,3 +388,8 @@ &:extend(.product-link all); } } + +// Calendar +.ui-datepicker td { + padding: 0; +} \ No newline at end of file diff --git a/app/design/frontend/Magento/blank/css/source/tooltips.less b/app/design/frontend/Magento/blank/css/source/tooltips.less index a57a19552481f505f720d29af16218efe11d5d65..85a6b7cc20a11b58fabe23ee24dc01931314ea0d 100644 --- a/app/design/frontend/Magento/blank/css/source/tooltips.less +++ b/app/design/frontend/Magento/blank/css/source/tooltips.less @@ -22,3 +22,30 @@ // * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) // */ +.tooltip.box { + .tooltip( + @_tooltip-position: bottom, + @_tooltip-selector-content: ~".tooltip.content", + @_tooltip-selector-toggle: ~".tooltip.toggle" + ); + .tooltip.content { + dl { + margin-bottom: 0; + } + .subtitle { + display: inline-block; + margin-bottom: 15px; + font-size: 16px; + font-weight: 500; + } + .label { + margin-top: @indent-s-base; + &:first-child { + margin-top: 0; + } + } + .values { + margin: 0; + } + } +} diff --git a/app/design/frontend/Magento/plushe/js/theme.js b/app/design/frontend/Magento/plushe/js/theme.js index cddb70afa7de6e6647802582efe35639b71cf2d0..a56c6586f05bd9386fd6912a6a3cee11f8a8c36e 100644 --- a/app/design/frontend/Magento/plushe/js/theme.js +++ b/app/design/frontend/Magento/plushe/js/theme.js @@ -61,7 +61,9 @@ for (var i=perpage; i < items.length; i++) { $(items[i + page*perpage]).addClass('hidden'); }; - console.log(i); + if (window.console) { + console.log(i); + } previous.removeAttr('disabled'); if (page == pages) { next.attr('disabled', 'disabled'); diff --git a/app/design/install/Magento/basic/css/boxes.css b/app/design/install/Magento/basic/css/boxes.css index 758d9d8315b16a6da08ebfcc32f4295731e30f4a..534558699b8a9138a94fc6efc277f77425c00b60 100644 --- a/app/design/install/Magento/basic/css/boxes.css +++ b/app/design/install/Magento/basic/css/boxes.css @@ -149,42 +149,27 @@ p.required { } - /********************** Messages */ -.success { color:#3d6611; } -.error { color:#df280a; } -.success, .error { font-weight:bold; } -.error-msg, .success-msg, .notice-msg, .note-msg { - min-height:23px !important; - margin-bottom:1em !important; - border-style:solid !important; - border-width:1px !important; - background-repeat:no-repeat !important; - background-position:10px 10px !important; - padding:8px 8px 8px 32px !important; - font-size:.95em !important; - font-weight:bold !important; - } -.error-msg li, .success-msg li, .notice-msg li {margin-bottom:.2em; } -.error-msg { - border-color:#f16048; - color:#df280a; - background-color:#faebe7; - background-image:url(../images/error_msg_icon.gif); - } -.success-msg { - border-color:#446423; - color:#3d6611; - background-color:#eff5ea; - background-image:url(../images/success_msg_icon.gif); - } -.notice-msg, .note-msg { - border-color:#fcd344; - color:#3d6611; - background-color:#fafaec; - background-image:url(../images/note_msg_icon.gif); - } - +.messages { width:100%; overflow:hidden; text-align:left; margin-top:10px; } +.messages .message { padding:10px 17px; position:relative; } +.messages .message a { text-decoration:underline; } +.messages .message a:hover { text-decoration:none; } + +.messages .message.error, +.messages .message.success, +.messages .message.note, +.messages .message.notice { border-style:solid !important; border-width:1px !important; font-size:12px !important; } + +.messages .message.error { border-color:#e9581f; background-color:#fff5f3; color:#d91a00; } +.messages .message.error a { color:#d91a00; } + +.messages .message.success { border-color:#446423; background-color:#eff5ea; color:#3d6611; } +.messages .message.success a { color:#3d6611; } + +.messages .message.note, +.messages .message.notice { border-color:#fcd344; background-color:#fafaec; color:#3d6611; } +.messages .message.note a, +.messages .message.notice a { color:#3d6611; } /********************** Headings */ diff --git a/app/etc/di.xml b/app/etc/di.xml index 95f0abbfbe81caeb59ddc56e4ba799adac32504a..f01312468ee4e8f2fff21c1ab46f04439d842699 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -24,15 +24,15 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../lib/Magento/ObjectManager/etc/config.xsd"> - <preference for="Magento\App\RequestInterface" type="Magento\App\Request\Http" /> - <preference for="Magento\App\Request\PathInfoProcessorInterface" type="Magento\Store\App\Request\PathInfoProcessor" /> - <preference for="Magento\App\ResponseInterface" type="Magento\App\Response\Http" /> - <preference for="Magento\App\RouterListInterface" type="Magento\App\RouterList" /> - <preference for="Magento\App\FrontControllerInterface" type="Magento\App\FrontController" /> + <preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http" /> + <preference for="Magento\Framework\App\Request\PathInfoProcessorInterface" type="Magento\Store\App\Request\PathInfoProcessor" /> + <preference for="Magento\Framework\App\ResponseInterface" type="Magento\Framework\App\Response\Http" /> + <preference for="Magento\Framework\App\RouterListInterface" type="Magento\Framework\App\RouterList" /> + <preference for="Magento\Framework\App\FrontControllerInterface" type="Magento\Framework\App\FrontController" /> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\Updater" /> - <preference for="Magento\App\CacheInterface" type="Magento\App\Cache\Proxy" /> - <preference for="Magento\App\Cache\StateInterface" type="Magento\App\Cache\State" /> - <preference for="Magento\App\Cache\TypeListInterface" type="Magento\App\Cache\TypeList" /> + <preference for="Magento\Framework\App\CacheInterface" type="Magento\Framework\App\Cache\Proxy" /> + <preference for="Magento\Framework\App\Cache\StateInterface" type="Magento\Framework\App\Cache\State" /> + <preference for="Magento\Framework\App\Cache\TypeListInterface" type="Magento\Framework\App\Cache\TypeList" /> <preference for="Magento\Store\Model\StoreManagerInterface" type="Magento\Store\Model\StoreManager" /> <preference for="Magento\View\DesignInterface" type="Magento\Core\Model\View\Design\Proxy" /> <preference for="Magento\View\Design\ThemeInterface" type="Magento\Core\Model\Theme" /> @@ -48,9 +48,9 @@ <preference for="Magento\UrlInterface" type="Magento\Url" /> <preference for="Magento\Data\Collection\Db\FetchStrategyInterface" type="Magento\Data\Collection\Db\FetchStrategy\Query" /> <preference for="Magento\Config\ScopeInterface" type="Magento\Config\Scope" /> - <preference for="Magento\Config\FileResolverInterface" type="Magento\App\Config\FileResolver" /> - <preference for="Magento\Config\CacheInterface" type="Magento\App\Cache\Type\Config" /> - <preference for="Magento\Config\ValidationStateInterface" type="Magento\App\Arguments\ValidationState" /> + <preference for="Magento\Config\FileResolverInterface" type="Magento\Framework\App\Config\FileResolver" /> + <preference for="Magento\Config\CacheInterface" type="Magento\Framework\App\Cache\Type\Config" /> + <preference for="Magento\Config\ValidationStateInterface" type="Magento\Framework\App\Arguments\ValidationState" /> <preference for="Magento\Module\ModuleListInterface" type="Magento\Module\ModuleList" /> <preference for="Magento\Event\ConfigInterface" type="Magento\Event\Config" /> <preference for="Magento\Event\InvokerInterface" type="Magento\Event\Invoker\InvokerDefault" /> @@ -59,9 +59,9 @@ <preference for="Magento\View\LayoutInterface" type="Magento\View\Layout" /> <preference for="Magento\View\Layout\ProcessorInterface" type="Magento\Core\Model\Layout\Merge" /> <preference for="Magento\View\Url\ConfigInterface" type="Magento\Core\Model\View\Url\Config" /> - <preference for="Magento\App\Route\ConfigInterface" type="Magento\App\Route\Config" /> - <preference for="Magento\App\Resource\ConfigInterface" type="Magento\App\Resource\Config\Proxy" /> - <preference for="Magento\App\Cache\State\OptionsInterface" type="Magento\App\Cache\State\Options" /> + <preference for="Magento\Framework\App\Route\ConfigInterface" type="Magento\Framework\App\Route\Config" /> + <preference for="Magento\Framework\App\Resource\ConfigInterface" type="Magento\Framework\App\Resource\Config\Proxy" /> + <preference for="Magento\Framework\App\Cache\State\OptionsInterface" type="Magento\Framework\App\Cache\State\Options" /> <preference for="Magento\Oauth\OauthInterface" type="Magento\Oauth\Oauth"/> <preference for="Magento\View\Design\Theme\Domain\PhysicalInterface" type="Magento\Core\Model\Theme\Domain\Physical" /> <preference for="Magento\View\Design\Theme\Domain\VirtualInterface" type="Magento\Core\Model\Theme\Domain\Virtual" /> @@ -69,7 +69,7 @@ <preference for="Magento\Json\EncoderInterface" type="Magento\Json\Encoder" /> <preference for="Magento\Json\DecoderInterface" type="Magento\Json\Decoder" /> <preference for="Magento\Message\ManagerInterface" type="Magento\Message\Manager" /> - <preference for="Magento\App\Config\ValueInterface" type="Magento\App\Config\Value" /> + <preference for="Magento\Framework\App\Config\ValueInterface" type="Magento\Framework\App\Config\Value" /> <preference for="Magento\Module\DependencyManagerInterface" type="Magento\Module\DependencyManager" /> <preference for="Magento\Interception\Chain" type="Magento\Interception\Chain\Chain" /> <preference for="Magento\Module\Output\ConfigInterface" type="Magento\Module\Output\Config" /> @@ -93,18 +93,19 @@ </arguments> </type> <type name="Magento\Service\V1\Data\FilterBuilder" shared="false" /> + <type name="Magento\Service\V1\Data\SearchCriteriaBuilder" shared="false" /> <type name="Magento\Message\Manager"> <arguments> <argument name="session" xsi:type="object">Magento\Message\Session\Proxy</argument> </arguments> </type> <type name="Magento\View\BlockPool" shared="false" /> - <type name="Magento\App\Request\Http"> + <type name="Magento\Framework\App\Request\Http"> <arguments> <argument name="pathInfoProcessor" xsi:type="object">Magento\Store\App\Request\PathInfoProcessor\Proxy</argument> </arguments> </type> - <preference for="Magento\Error\HandlerInterface" type="Magento\App\Error\Handler" /> + <preference for="Magento\Error\HandlerInterface" type="Magento\Framework\App\Error\Handler" /> <preference for="Magento\Session\SaveHandlerInterface" type="Magento\Session\SaveHandler" /> <type name="Magento\Session\SaveHandler"> <arguments> @@ -123,25 +124,25 @@ <argument name="defaultScope" xsi:type="string">global</argument> </arguments> </virtualType> - <type name="Magento\App\State"> + <type name="Magento\Framework\App\State"> <arguments> - <argument name="installDate" xsi:type="init_parameter">Magento\App\State::PARAM_INSTALL_DATE</argument> - <argument name="mode" xsi:type="init_parameter">Magento\App\State::PARAM_MODE</argument> + <argument name="installDate" xsi:type="init_parameter">Magento\Framework\App\State::PARAM_INSTALL_DATE</argument> + <argument name="mode" xsi:type="init_parameter">Magento\Framework\App\State::PARAM_MODE</argument> </arguments> </type> <type name="Magento\Module\FrontController\Plugin\Install"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> </arguments> </type> - <type name="Magento\App\Arguments\ValidationState"> + <type name="Magento\Framework\App\Arguments\ValidationState"> <arguments> - <argument name="appMode" xsi:type="init_parameter">Magento\App\State::PARAM_MODE</argument> + <argument name="appMode" xsi:type="init_parameter">Magento\Framework\App\State::PARAM_MODE</argument> </arguments> </type> - <type name="Magento\App\Arguments\Loader"> + <type name="Magento\Framework\App\Arguments\Loader"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> </arguments> </type> <type name="Magento\Module\Declaration\Reader\Filesystem"> @@ -149,9 +150,9 @@ <argument name="allowedModules" xsi:type="init_parameter">Magento\Module\Declaration\Reader\Filesystem::PARAM_ALLOWED_MODULES</argument> </arguments> </type> - <type name="Magento\App\Cache\Frontend\Factory"> + <type name="Magento\Framework\App\Cache\Frontend\Factory"> <arguments> - <argument name="enforcedOptions" xsi:type="init_parameter">Magento\App\Cache\Frontend\Factory::PARAM_CACHE_FORCED_OPTIONS</argument> + <argument name="enforcedOptions" xsi:type="init_parameter">Magento\Framework\App\Cache\Frontend\Factory::PARAM_CACHE_FORCED_OPTIONS</argument> <argument name="decorators" xsi:type="array"> <item name="tag" xsi:type="array"> <item name="class" xsi:type="string">Magento\Cache\Frontend\Decorator\TagScope</item> @@ -160,12 +161,12 @@ </item> </item> </argument> - <argument name="resource" xsi:type="object">Magento\App\Resource\Proxy</argument> + <argument name="resource" xsi:type="object">Magento\Framework\App\Resource\Proxy</argument> </arguments> </type> - <type name="Magento\App\Cache\State"> + <type name="Magento\Framework\App\Cache\State"> <arguments> - <argument name="banAll" xsi:type="init_parameter">Magento\App\Cache\State::PARAM_BAN_CACHE</argument> + <argument name="banAll" xsi:type="init_parameter">Magento\Framework\App\Cache\State::PARAM_BAN_CACHE</argument> </arguments> </type> <type name="Magento\Store\Model\StoreManager"> @@ -176,13 +177,13 @@ </type> <type name="Magento\Translate"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Translate</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Translate</argument> <argument name="locale" xsi:type="object">Magento\Locale\Resolver\Proxy</argument> <argument name="translate" xsi:type="object">Magento\Translate\ResourceInterface\Proxy</argument> - <argument name="request" xsi:type="object">Magento\App\Request\Http\Proxy</argument> + <argument name="request" xsi:type="object">Magento\Framework\App\Request\Http\Proxy</argument> </arguments> </type> - <type name="Magento\App\Helper\Context"> + <type name="Magento\Framework\App\Helper\Context"> <arguments> <argument name="translateInline" xsi:type="object">Magento\Translate\InlineInterface\Proxy</argument> </arguments> @@ -194,14 +195,14 @@ </arguments> </type> <type name="Magento\Acl" shared="false" /> - <type name="Magento\App\ObjectManager\ConfigLoader"> + <type name="Magento\Framework\App\ObjectManager\ConfigLoader"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> </arguments> </type> - <type name="Magento\App\ObjectManager\ConfigCache"> + <type name="Magento\Framework\App\ObjectManager\ConfigCache"> <arguments> - <argument name="cacheFrontend" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cacheFrontend" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> </arguments> </type> <type name="Magento\Cache\Config\Reader"> @@ -216,14 +217,14 @@ </type> <type name="Magento\Interception\Config\Config"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> <argument name="reader" xsi:type="object">Magento\ObjectManager\Config\Reader\Dom</argument> <argument name="cacheId" xsi:type="string">interception</argument> </arguments> </type> <type name="Magento\Interception\PluginList\PluginList"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config</argument> <argument name="reader" xsi:type="object">Magento\ObjectManager\Config\Reader\Dom</argument> <argument name="cacheId" xsi:type="string">plugin-list</argument> <argument name="scopePriorityScheme" xsi:type="array"> @@ -231,26 +232,26 @@ </argument> </arguments> </type> - <type name="Magento\App\Resource"> + <type name="Magento\Framework\App\Resource"> <arguments> - <argument name="tablePrefix" xsi:type="init_parameter">Magento\App\Resource::PARAM_TABLE_PREFIX</argument> + <argument name="tablePrefix" xsi:type="init_parameter">Magento\Framework\App\Resource::PARAM_TABLE_PREFIX</argument> </arguments> </type> - <type name="Magento\App\Resource\Config"> + <type name="Magento\Framework\App\Resource\Config"> <arguments> - <argument name="cache" xsi:type="object">Magento\App\Cache\Type\Config\Proxy</argument> - <argument name="initialResources" xsi:type="init_parameter">Magento\App\Resource\Config::PARAM_INITIAL_RESOURCES</argument> + <argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Config\Proxy</argument> + <argument name="initialResources" xsi:type="init_parameter">Magento\Framework\App\Resource\Config::PARAM_INITIAL_RESOURCES</argument> </arguments> </type> - <type name="Magento\App\Resource\Config\Reader"> + <type name="Magento\Framework\App\Resource\Config\Reader"> <arguments> - <argument name="fileResolver" xsi:type="object">Magento\App\Config\FileResolver\Proxy</argument> + <argument name="fileResolver" xsi:type="object">Magento\Framework\App\Config\FileResolver\Proxy</argument> </arguments> </type> <type name="Magento\Config\Scope"> <arguments> <argument name="defaultScope" xsi:type="string">primary</argument> - <argument name="areaList" xsi:type="object">Magento\App\AreaList\Proxy</argument> + <argument name="areaList" xsi:type="object">Magento\Framework\App\AreaList\Proxy</argument> </arguments> </type> <type name="Magento\Url"> @@ -263,24 +264,24 @@ <argument name="fileUrlMap" xsi:type="array"> <item name="urlLib" xsi:type="array"> <item name="key" xsi:type="const">Magento\UrlInterface::URL_TYPE_LIB</item> - <item name="value" xsi:type="const">Magento\App\Filesystem::PUB_LIB_DIR</item> + <item name="value" xsi:type="const">Magento\Framework\App\Filesystem::PUB_LIB_DIR</item> </item> <item name="urlMedia" xsi:type="array"> <item name="key" xsi:type="const">Magento\UrlInterface::URL_TYPE_MEDIA</item> - <item name="value" xsi:type="const">Magento\App\Filesystem::MEDIA_DIR</item> + <item name="value" xsi:type="const">Magento\Framework\App\Filesystem::MEDIA_DIR</item> </item> <item name="urlStatic" xsi:type="array"> <item name="key" xsi:type="const">Magento\UrlInterface::URL_TYPE_STATIC</item> - <item name="value" xsi:type="const">Magento\App\Filesystem::STATIC_VIEW_DIR</item> + <item name="value" xsi:type="const">Magento\Framework\App\Filesystem::STATIC_VIEW_DIR</item> </item> <item name="urlCache" xsi:type="array"> <item name="key" xsi:type="const">Magento\UrlInterface::URL_TYPE_CACHE</item> - <item name="value" xsi:type="const">Magento\App\Filesystem::PUB_VIEW_CACHE_DIR</item> + <item name="value" xsi:type="const">Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR</item> </item> </argument> </arguments> </type> - <type name="Magento\App\Filesystem"> + <type name="Magento\Framework\App\Filesystem"> <arguments> <argument name="fileReadFactory" xsi:type="object">Magento\Filesystem\File\ReadFactory</argument> <argument name="fileWriteFactory" xsi:type="object">Magento\Filesystem\File\WriteFactory</argument> @@ -363,7 +364,7 @@ </argument> </arguments> </type> - <type name="Magento\App\Cache\Frontend\Pool"> + <type name="Magento\Framework\App\Cache\Frontend\Pool"> <arguments> <argument name="frontendSettings" xsi:type="array"> <item name="page_cache" xsi:type="array"> @@ -374,7 +375,7 @@ </argument> </arguments> </type> - <type name="Magento\App\Cache\Type\FrontendPool"> + <type name="Magento\Framework\App\Cache\Type\FrontendPool"> <arguments> <argument name="typeFrontendMap" xsi:type="array"> <item name="full_page" xsi:type="string">page_cache</item> @@ -386,4 +387,5 @@ <argument name="parser" xsi:type="object">Magento\Translate\Inline\ParserInterface\Proxy</argument> </arguments> </type> + <type name="Magento\View\Layout\ScheduledStructure" shared="false" /> </config> diff --git a/dev/shell/indexer.php b/dev/shell/indexer.php index 77ca46bfc710be78cdb3abc942d3a90998d25e09..17d2a76491a3524a7a351fb6e96474e10a5c6ade 100644 --- a/dev/shell/indexer.php +++ b/dev/shell/indexer.php @@ -32,5 +32,5 @@ $params = array( StoreManager::PARAM_RUN_TYPE => 'store' ); -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); $entryPoint->run('Magento\Index\App\Shell', array('entryFileName' => basename(__FILE__))); diff --git a/dev/shell/install.php b/dev/shell/install.php index 7a9b8c8894e78f9e4e00e68ac1fd80b73932cf1a..ac17c6763db9d92017bcfbe3f7dc467e39c6289c 100644 --- a/dev/shell/install.php +++ b/dev/shell/install.php @@ -94,5 +94,5 @@ INSTALLSCHEME; define('BARE_BOOTSTRAP', 1); require_once __DIR__ . '/../../app/bootstrap.php'; -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $_SERVER); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $_SERVER); $entryPoint->run('Magento\Install\App\Console', array('arguments' => $args)); diff --git a/dev/shell/log.php b/dev/shell/log.php index bf74a70daa4dd8f30da743fda42c0ec70feb2400..05478614d015a2d06ddd098f7b66c61050ffb929 100644 --- a/dev/shell/log.php +++ b/dev/shell/log.php @@ -32,5 +32,5 @@ $params = array( StoreManager::PARAM_RUN_TYPE => 'store' ); -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); $entryPoint->run('Magento\Log\App\Shell', array('entryFileName' => basename(__FILE__))); diff --git a/dev/shell/newindexer.php b/dev/shell/newindexer.php index d4d7ce6562954db7d4465926829096d601d7018b..b82fbdcb57d35db54a55a46bfd7606a7207d5634 100644 --- a/dev/shell/newindexer.php +++ b/dev/shell/newindexer.php @@ -32,5 +32,5 @@ $params = array( StoreManager::PARAM_RUN_TYPE => 'store' ); -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); $entryPoint->run('Magento\Indexer\App\Shell', array('entryFileName' => basename(__FILE__))); diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index 94335c31172f8510ec1b37008ea47641ae3e1196..254a34c99be218e7ff363c9bf0e42b896fb7dbd1 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -65,8 +65,8 @@ class ConfigFixture $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $result = null; if ($scopeCode !== false) { - /** @var \Magento\App\Config\ScopeConfigInterface $scopeConfig */ - $scopeConfig = $objectManager->get('Magento\App\Config\ScopeConfigInterface'); + /** @var \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ + $scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $result = $scopeConfig->getValue( $configPath, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, @@ -90,16 +90,16 @@ class ConfigFixture if (strpos($configPath, 'default/') === 0) { $configPath = substr($configPath, 8); $objectManager->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( $configPath, $value, - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); } } else { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( $configPath, $value, diff --git a/dev/tests/integration/framework/Magento/TestFramework/App/Arguments/Proxy.php b/dev/tests/integration/framework/Magento/TestFramework/App/Arguments/Proxy.php index 824762ae91d3921ffb701cbdd27795b738df3254..cae084563cb7986274dd65eae724a96087b7ea5b 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/App/Arguments/Proxy.php +++ b/dev/tests/integration/framework/Magento/TestFramework/App/Arguments/Proxy.php @@ -24,23 +24,23 @@ namespace Magento\TestFramework\App\Arguments; /** - * Proxy class for \Magento\App\Arguments + * Proxy class for \Magento\Framework\App\Arguments */ -class Proxy extends \Magento\App\Arguments +class Proxy extends \Magento\Framework\App\Arguments { /** * Proxied instance * - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $subject; /** * Proxy constructor * - * @param \Magento\App\Arguments $subject + * @param \Magento\Framework\App\Arguments $subject */ - public function __construct(\Magento\App\Arguments $subject) + public function __construct(\Magento\Framework\App\Arguments $subject) { $this->setSubject($subject); } @@ -48,9 +48,9 @@ class Proxy extends \Magento\App\Arguments /** * Set new subject to be proxied * - * @param \Magento\App\Arguments $subject + * @param \Magento\Framework\App\Arguments $subject */ - public function setSubject(\Magento\App\Arguments $subject) + public function setSubject(\Magento\Framework\App\Arguments $subject) { $this->subject = $subject; } diff --git a/dev/tests/integration/framework/Magento/TestFramework/App/Filesystem/DirectoryList.php b/dev/tests/integration/framework/Magento/TestFramework/App/Filesystem/DirectoryList.php index 03f298412157ce03414f76a938f8e96ddf287eea..755d6dacf96a9c6618406fc94a8ef57a0c656449 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/App/Filesystem/DirectoryList.php +++ b/dev/tests/integration/framework/Magento/TestFramework/App/Filesystem/DirectoryList.php @@ -23,7 +23,7 @@ */ namespace Magento\TestFramework\App\Filesystem; -class DirectoryList extends \Magento\App\Filesystem\DirectoryList +class DirectoryList extends \Magento\Framework\App\Filesystem\DirectoryList { /** * Check whether configured directory diff --git a/dev/tests/integration/framework/Magento/TestFramework/App/State.php b/dev/tests/integration/framework/Magento/TestFramework/App/State.php index 094b509948874f6be03bd86844ea9e5389835093..52fbb2a2b3225e8d5b8fe082167e4ef46f7b9d32 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/App/State.php +++ b/dev/tests/integration/framework/Magento/TestFramework/App/State.php @@ -30,7 +30,7 @@ */ namespace Magento\TestFramework\App; -class State extends \Magento\App\State +class State extends \Magento\Framework\App\State { /** * {@inheritdoc} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 237f60f66b1e77b09056887444e164dbebbfbea6..0b0556ae2e2e38517798b8aa341d7ee9302f33b5 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -26,8 +26,8 @@ */ namespace Magento\TestFramework; -use Magento\App\Filesystem; -use Magento\App\Filesystem\DirectoryList; +use Magento\Framework\App\Filesystem; +use Magento\Framework\App\Filesystem\DirectoryList; /** * Encapsulates application installation, initialization and uninstall @@ -154,7 +154,7 @@ class Application Filesystem::GENERATION_DIR => array('path' => $generationDir), Filesystem::CACHE_DIR => array('path' => $installDir . '/cache') ), - \Magento\App\State::PARAM_MODE => $appMode + \Magento\Framework\App\State::PARAM_MODE => $appMode ); $this->_factory = new \Magento\TestFramework\ObjectManagerFactory(); } @@ -205,7 +205,7 @@ class Application public function initialize($overriddenParams = array()) { $overriddenParams['base_dir'] = BP; - $overriddenParams[\Magento\App\State::PARAM_MODE] = $this->_appMode; + $overriddenParams[\Magento\Framework\App\State::PARAM_MODE] = $this->_appMode; $overriddenParams = $this->_customizeParams($overriddenParams); /** @var \Magento\TestFramework\ObjectManager $objectManager */ @@ -221,17 +221,17 @@ class Application ) ? $overriddenParams[Filesystem::PARAM_APP_DIRS] : array(); $directoryList = new \Magento\TestFramework\App\Filesystem\DirectoryList(BP, $directories); - $objectManager->addSharedInstance($directoryList, 'Magento\App\Filesystem\DirectoryList'); + $objectManager->addSharedInstance($directoryList, 'Magento\Framework\App\Filesystem\DirectoryList'); $objectManager->addSharedInstance($directoryList, 'Magento\Filesystem\DirectoryList'); - $objectManager->removeSharedInstance('Magento\App\Filesystem'); - $objectManager->removeSharedInstance('Magento\App\Filesystem\DirectoryList\Verification'); + $objectManager->removeSharedInstance('Magento\Framework\App\Filesystem'); + $objectManager->removeSharedInstance('Magento\Framework\App\Filesystem\DirectoryList\Verification'); Helper\Bootstrap::setObjectManager($objectManager); $objectManager->configure( array( 'preferences' => array( - 'Magento\App\State' => 'Magento\TestFramework\App\State' + 'Magento\Framework\App\State' => 'Magento\TestFramework\App\State' ) ) ); @@ -254,17 +254,17 @@ class Application $this->loadArea(\Magento\TestFramework\Application::DEFAULT_APP_AREA); \Magento\Phrase::setRenderer($objectManager->get('Magento\Phrase\RendererInterface')); - /** @var \Magento\App\Filesystem\DirectoryList\Verification $verification */ - $verification = $objectManager->get('Magento\App\Filesystem\DirectoryList\Verification'); + /** @var \Magento\Framework\App\Filesystem\DirectoryList\Verification $verification */ + $verification = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList\Verification'); $verification->createAndVerifyDirectories(); - $directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); - $directoryListConfig = $objectManager->get('Magento\App\Filesystem\DirectoryList\Configuration'); + $directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); + $directoryListConfig = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList\Configuration'); $directoryListConfig->configure($directoryList); $directories = isset( - $overriddenParams[\Magento\App\Filesystem::PARAM_APP_DIRS] - ) ? $overriddenParams[\Magento\App\Filesystem::PARAM_APP_DIRS] : array(); + $overriddenParams[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS] + ) ? $overriddenParams[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS] : array(); foreach ($directories as $code => $configOverrides) { $config = array_merge($directoryList->getConfig($code), $configOverrides); $directoryList->addDirectory($code, $config); @@ -288,8 +288,8 @@ class Application public function run() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Http $app */ - $app = $objectManager->get('Magento\App\Http'); + /** @var \Magento\Framework\App\Http $app */ + $app = $objectManager->get('Magento\Framework\App\Http'); $response = $app->launch(); $response->sendResponse(); } @@ -345,7 +345,7 @@ class Application /* Initialize an application in non-installed mode */ $this->initialize(); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea('install')->load(\Magento\Core\Model\App\Area::PART_CONFIG); /* Run all install and data-install scripts */ @@ -355,13 +355,13 @@ class Application $updater->updateData(); /* Enable configuration cache by default in order to improve tests performance */ - /** @var $cacheState \Magento\App\Cache\StateInterface */ + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Cache\StateInterface' + 'Magento\Framework\App\Cache\StateInterface' ); - $cacheState->setEnabled(\Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, true); - $cacheState->setEnabled(\Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, true); - $cacheState->setEnabled(\Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER, true); + $cacheState->setEnabled(\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, true); + $cacheState->setEnabled(\Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, true); + $cacheState->setEnabled(\Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER, true); $cacheState->setEnabled(\Magento\Eav\Model\Cache\Type::TYPE_IDENTIFIER, true); $cacheState->persist(); @@ -379,8 +379,8 @@ class Application /* Switch an application to installed mode */ $this->initialize(); //hot fix for \Magento\Catalog\Model\Product\Attribute\Backend\SkuTest::testGenerateUniqueLongSku - /** @var $appState \Magento\App\State */ - $appState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State'); + /** @var $appState \Magento\Framework\App\State */ + $appState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State'); $appState->setInstallDate(date('r', strtotime('now'))); } @@ -508,12 +508,12 @@ class Application $scope->setCurrentScope($areaCode); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\ObjectManager\ConfigLoader' + 'Magento\Framework\App\ObjectManager\ConfigLoader' )->load( $areaCode ) ); - $app = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList'); + $app = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList'); if ($areaCode == \Magento\TestFramework\Application::DEFAULT_APP_AREA) { $app->getArea($areaCode)->load(\Magento\Core\Model\App\Area::PART_CONFIG); } else { diff --git a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php index 963135e34d0f587b26b0f4b7ce441dc559203d98..338e4699ba660a74faba347ace2360d855292b36 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php @@ -119,7 +119,7 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb */ protected function _getDefaultsExtraFileName() { - return rtrim($this->_varPath, '\\/') . DIRECTORY_SEPARATOR . self::DEFAULTS_EXTRA_FILE_NAME; + return rtrim($this->_varPath, '\\/') . '/' . self::DEFAULTS_EXTRA_FILE_NAME; } /** diff --git a/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php b/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php index 578ec00453211af19e7ebf8d85f49de28f3a83bd..16e6a2dd0247b0df11c4286d18218c0bd70e0391 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php @@ -138,8 +138,8 @@ class Transaction */ protected function _getAdapter($connectionName = 'core_write') { - /** @var $resource \Magento\App\Resource */ - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + /** @var $resource \Magento\Framework\App\Resource */ + $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); return $resource->getConnection($connectionName); } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Helper/Bootstrap.php b/dev/tests/integration/framework/Magento/TestFramework/Helper/Bootstrap.php index 024c4cf05cbf8b5b47a94632980f687f849733a5..9d0b316c0ca08f0274c1d5b2912e7851e9a693a9 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Helper/Bootstrap.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Helper/Bootstrap.php @@ -184,7 +184,7 @@ class Bootstrap */ public function loadArea($areaCode) { - self::$_objectManager->get('Magento\App\State')->setAreaCode($areaCode); - self::$_objectManager->get('Magento\App\AreaList')->getArea($areaCode)->load(); + self::$_objectManager->get('Magento\Framework\App\State')->setAreaCode($areaCode); + self::$_objectManager->get('Magento\Framework\App\AreaList')->getArea($areaCode)->load(); } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager.php index d7f11e1f93267ef773843c327be41024ab560095..f149a34599947d8b8f044bb055a93affcec46baf 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager.php @@ -25,7 +25,7 @@ */ namespace Magento\TestFramework; -class ObjectManager extends \Magento\App\ObjectManager +class ObjectManager extends \Magento\Framework\App\ObjectManager { /** * Classes with xml properties to explicitly call __destruct() due to https://bugs.php.net/bug.php?id=62468 @@ -38,7 +38,7 @@ class ObjectManager extends \Magento\App\ObjectManager * @var array */ protected $persistedInstances = array( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', 'Magento\Config\Scope', 'Magento\ObjectManager\Relations', 'Magento\ObjectManager\Config', @@ -61,8 +61,8 @@ class ObjectManager extends \Magento\App\ObjectManager } } - \Magento\App\Config\Base::destroy(); - $sharedInstances = array('Magento\ObjectManager' => $this, 'Magento\App\ObjectManager' => $this); + \Magento\Framework\App\Config\Base::destroy(); + $sharedInstances = array('Magento\ObjectManager' => $this, 'Magento\Framework\App\ObjectManager' => $this); foreach ($this->persistedInstances as $persistedClass) { if (isset($this->_sharedInstances[$persistedClass])) { $sharedInstances[$persistedClass] = $this->_sharedInstances[$persistedClass]; diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php index 202e6159d12c4d265fa600d2dbf5a1db078e3bdb..a44a42f56018bd769ee2d216f744a0862a01f8ba 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php @@ -29,7 +29,7 @@ namespace Magento\TestFramework; * @package Magento\TestFramework * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory +class ObjectManagerFactory extends \Magento\Framework\App\ObjectManagerFactory { /** * Locator class name @@ -61,13 +61,15 @@ class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory * Override the parent method and return proxied instance instead, so that we can reset the actual app arguments * instance for all its clients at any time * - * @param \Magento\App\Filesystem\DirectoryList $directoryList + * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList * @param array $arguments * @return App\Arguments\Proxy * @throws \Magento\Exception */ - protected function createAppArguments(\Magento\App\Filesystem\DirectoryList $directoryList, array $arguments) - { + protected function createAppArguments( + \Magento\Framework\App\Filesystem\DirectoryList $directoryList, + array $arguments + ) { if ($this->appArgumentsProxy) { // Framework constraint: this is ambiguous situation, because it is not clear what to do with older instance throw new \Magento\Exception('Only one creation of application arguments is supported'); @@ -87,24 +89,26 @@ class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory */ public function restore(ObjectManager $objectManager, $rootDir, array $arguments) { - $directories = isset( - $arguments[\Magento\App\Filesystem::PARAM_APP_DIRS] - ) ? $arguments[\Magento\App\Filesystem::PARAM_APP_DIRS] : array(); + $directories = isset($arguments[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS]) + ? $arguments[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS] + : array(); $directoryList = new \Magento\TestFramework\App\Filesystem\DirectoryList($rootDir, $directories); \Magento\TestFramework\ObjectManager::setInstance($objectManager); $objectManager->configure($this->_primaryConfigData); - $objectManager->addSharedInstance($directoryList, 'Magento\App\Filesystem\DirectoryList'); + $objectManager->addSharedInstance($directoryList, 'Magento\Framework\App\Filesystem\DirectoryList'); $objectManager->addSharedInstance($directoryList, 'Magento\Filesystem\DirectoryList'); $appArguments = parent::createAppArguments($directoryList, $arguments); $this->appArgumentsProxy->setSubject($appArguments); $this->factory->setArguments($appArguments->get()); - $objectManager->addSharedInstance($appArguments, 'Magento\App\Arguments'); + $objectManager->addSharedInstance($appArguments, 'Magento\Framework\App\Arguments'); $objectManager->get('Magento\Interception\PluginList')->reset(); - $objectManager->configure($objectManager->get('Magento\App\ObjectManager\ConfigLoader')->load('global')); + $objectManager->configure( + $objectManager->get('Magento\Framework\App\ObjectManager\ConfigLoader')->load('global') + ); return $objectManager; } @@ -112,13 +116,13 @@ class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory /** * Load primary config * - * @param \Magento\App\Filesystem\DirectoryList $directoryList + * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList * @param mixed $argumentMapper * @param string $appMode * @return array */ protected function _loadPrimaryConfig( - \Magento\App\Filesystem\DirectoryList $directoryList, + \Magento\Framework\App\Filesystem\DirectoryList $directoryList, $argumentMapper, $appMode ) { @@ -138,10 +142,10 @@ class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory $this->_primaryConfigData['preferences'], [ 'Magento\Stdlib\Cookie' => 'Magento\TestFramework\Cookie', - 'Magento\App\RequestInterface' => 'Magento\TestFramework\Request', - 'Magento\App\Request\Http' => 'Magento\TestFramework\Request', - 'Magento\App\ResponseInterface' => 'Magento\TestFramework\Response', - 'Magento\App\Response\Http' => 'Magento\TestFramework\Response', + 'Magento\Framework\App\RequestInterface' => 'Magento\TestFramework\Request', + 'Magento\Framework\App\Request\Http' => 'Magento\TestFramework\Request', + 'Magento\Framework\App\ResponseInterface' => 'Magento\TestFramework\Response', + 'Magento\Framework\App\Response\Http' => 'Magento\TestFramework\Response', 'Magento\Interception\PluginList' => 'Magento\TestFramework\Interception\PluginList', 'Magento\Interception\ObjectManager\Config' => 'Magento\TestFramework\ObjectManager\Config', 'Magento\View\LayoutInterface' => 'Magento\TestFramework\View\Layout' diff --git a/dev/tests/integration/framework/Magento/TestFramework/Request.php b/dev/tests/integration/framework/Magento/TestFramework/Request.php index e6aa9fd9b403e62760ae1cb1424656c79ccbf34e..ca54da0ce6ccddad8f56e823d0c91f2e56af4ebc 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Request.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Request.php @@ -30,7 +30,7 @@ */ namespace Magento\TestFramework; -class Request extends \Magento\App\Request\Http +class Request extends \Magento\Framework\App\Request\Http { /** * Server super-global mock diff --git a/dev/tests/integration/framework/Magento/TestFramework/Response.php b/dev/tests/integration/framework/Magento/TestFramework/Response.php index f6706c8d7a053196c0fc518813d9a847fbbb5373..c131bd188b5dfb3b2cccb52d9f1672caedfaa8a0 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Response.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Response.php @@ -34,7 +34,7 @@ namespace Magento\TestFramework; * @package Magento\TestFramework * @SuppressWarnings(PHPMD.LongVariable) */ -class Response extends \Magento\App\Response\Http +class Response extends \Magento\Framework\App\Response\Http { /** * @inherit diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php index 378817d828f6eefa87a4a53fae6345481c166425..00d72e56fea683e5235793036de93488efa60e4d 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php @@ -55,7 +55,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase if (!empty($xmlFiles)) { $this->_fileResolverMock = $this->getMockBuilder( - 'Magento\App\Arguments\FileResolver\Primary' + 'Magento\Framework\App\Arguments\FileResolver\Primary' )->disableOriginalConstructor()->getMock(); /* Enable Validation regardles of MAGE_MODE */ @@ -73,8 +73,8 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase ) ); - $filesystem = $this->_objectManager->get('Magento\App\Filesystem'); - $modulesDir = $filesystem->getPath(\Magento\App\Filesystem::MODULES_DIR); + $filesystem = $this->_objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->_schemaFile = $modulesDir . $this->_getXsdPath(); } } @@ -151,9 +151,9 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $directory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryRead( - \Magento\App\Filesystem::MODULES_DIR + \Magento\Framework\App\Filesystem::MODULES_DIR ); return $objectManager->get( '\Magento\Config\FileIteratorFactory' diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php index 7edc1aa8fce5c717258e5384a72e5dd8988a6a7f..180e44a2cce363a51a63b92c63006ba836aaba2e 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php @@ -80,8 +80,8 @@ abstract class AbstractController extends \PHPUnit_Framework_TestCase { $this->_assertSessionErrors = false; $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->_objectManager->removeSharedInstance('Magento\App\ResponseInterface'); - $this->_objectManager->removeSharedInstance('Magento\App\RequestInterface'); + $this->_objectManager->removeSharedInstance('Magento\Framework\App\ResponseInterface'); + $this->_objectManager->removeSharedInstance('Magento\Framework\App\RequestInterface'); } protected function tearDown() @@ -121,7 +121,7 @@ abstract class AbstractController extends \PHPUnit_Framework_TestCase public function getRequest() { if (!$this->_request) { - $this->_request = $this->_objectManager->get('Magento\App\RequestInterface'); + $this->_request = $this->_objectManager->get('Magento\Framework\App\RequestInterface'); } return $this->_request; } @@ -134,7 +134,7 @@ abstract class AbstractController extends \PHPUnit_Framework_TestCase public function getResponse() { if (!$this->_response) { - $this->_response = $this->_objectManager->get('Magento\App\ResponseInterface'); + $this->_response = $this->_objectManager->get('Magento\Framework\App\ResponseInterface'); } return $this->_response; } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php index cd167d865450d86a9aceb5ad70e1bdb059cc12b1..8bf54ec1b4065defd943e7701361885f711a2e25 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php @@ -46,7 +46,7 @@ class StaticProperties */ protected static $_classesToSkip = array( 'Mage', - 'Magento\App\ObjectManager', + 'Magento\Framework\App\ObjectManager', 'Magento\TestFramework\Helper\Bootstrap', 'Magento\TestFramework\Event\Magento', 'Magento\TestFramework\Event\PhpUnit', diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/Arguments/ProxyTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/Arguments/ProxyTest.php index b86e77b51421420b456b077056b70559f5acdad5..6471cd940aee67f94388de9aaaa5b9055cccda28 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/Arguments/ProxyTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/Arguments/ProxyTest.php @@ -34,7 +34,7 @@ class ProxyTest extends \PHPUnit_Framework_TestCase */ public function testProxiedMethods($method, $params) { - $subject = $this->getMock('\Magento\App\Arguments', array(), array(), '', false); + $subject = $this->getMock('\Magento\Framework\App\Arguments', array(), array(), '', false); $invocation = $subject->expects($this->once())->method($method); $invocation = call_user_func_array(array($invocation, 'with'), $params); $expectedResult = new \stdClass(); @@ -63,10 +63,10 @@ class ProxyTest extends \PHPUnit_Framework_TestCase public function testSetSubject() { - $subject1 = $this->getMock('\Magento\App\Arguments', array(), array(), '', false); + $subject1 = $this->getMock('\Magento\Framework\App\Arguments', array(), array(), '', false); $subject1->expects($this->once())->method('get'); - $subject2 = $this->getMock('\Magento\App\Arguments', array(), array(), '', false); + $subject2 = $this->getMock('\Magento\Framework\App\Arguments', array(), array(), '', false); $subject2->expects($this->once())->method('get'); $object = new \Magento\TestFramework\App\Arguments\Proxy($subject1); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php index 5f9aeb143437964ab059d90b6729ab95f07b1474..89c4d83e51eed3219ece06b1a56e1c97b5969692 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php @@ -26,7 +26,7 @@ */ namespace Magento\Test; -use Magento\App\State; +use Magento\Framework\App\State; class ApplicationTest extends \PHPUnit_Framework_TestCase { @@ -39,9 +39,9 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase { $dbInstance = $this->getMockForAbstractClass('Magento\TestFramework\Db\AbstractDb', array(), '', false); $installDir = '/install/dir'; - $appMode = \Magento\App\State::MODE_DEVELOPER; - $directoryList = new \Magento\App\Filesystem\DirectoryList(BP); - $filesystem = new \Magento\App\Filesystem( + $appMode = \Magento\Framework\App\State::MODE_DEVELOPER; + $directoryList = new \Magento\Framework\App\Filesystem\DirectoryList(BP); + $filesystem = new \Magento\Framework\App\Filesystem( $directoryList, new \Magento\Filesystem\Directory\ReadFactory(), new \Magento\Filesystem\Directory\WriteFactory(), @@ -65,13 +65,13 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $initParams = $object->getInitParams(); $this->assertInternalType('array', $initParams, 'Wrong initialization parameters type'); $this->assertArrayHasKey( - \Magento\App\Filesystem::PARAM_APP_DIRS, + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS, $initParams, 'Directories are not configured' ); $this->assertArrayHasKey(State::PARAM_MODE, $initParams, 'Application mode is not configured'); $this->assertEquals( - \Magento\App\State::MODE_DEVELOPER, + \Magento\Framework\App\State::MODE_DEVELOPER, $initParams[State::PARAM_MODE], 'Wrong application mode configured' ); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php index 758657d6b8b4179c5ba393c4b8aa113dd735d483..b6caccebacc23236c44624506ad3cafec9c8633f 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php @@ -53,9 +53,9 @@ class BootstrapTest extends \PHPUnit_Framework_TestCase * @var array */ protected $_fixtureInitParams = array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::CONFIG_DIR => array('path' => __DIR__), - \Magento\App\Filesystem::VAR_DIR => array('path' => __DIR__) + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => __DIR__), + \Magento\Framework\App\Filesystem::VAR_DIR => array('path' => __DIR__) ) ); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php index bb9e4d0c434856a60d7ff6089c845ec4c73b62e3..fcf61a4b9a151b61682720e1a6c7eee8baf7e3e5 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php @@ -44,17 +44,17 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase $resource = new \stdClass(); $instanceConfig = new \Magento\TestFramework\ObjectManager\Config(); $verification = $this->getMock( - 'Magento\App\Filesystem\DirectoryList\Verification', + 'Magento\Framework\App\Filesystem\DirectoryList\Verification', array(), array(), '', false ); - $cache = $this->getMock('Magento\App\CacheInterface'); - $configLoader = $this->getMock('Magento\App\ObjectManager\ConfigLoader', array(), array(), '', false); - $configCache = $this->getMock('Magento\App\ObjectManager\ConfigCache', array(), array(), '', false); + $cache = $this->getMock('Magento\Framework\App\CacheInterface'); + $configLoader = $this->getMock('Magento\Framework\App\ObjectManager\ConfigLoader', array(), array(), '', false); + $configCache = $this->getMock('Magento\Framework\App\ObjectManager\ConfigCache', array(), array(), '', false); $primaryLoaderMock = $this->getMock( - 'Magento\App\ObjectManager\ConfigLoader\Primary', + 'Magento\Framework\App\ObjectManager\ConfigLoader\Primary', array(), array(), '', @@ -75,17 +75,19 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase $factory, $instanceConfig, array( - 'Magento\App\Filesystem\DirectoryList\Verification' => $verification, - 'Magento\App\Cache\Type\Config' => $cache, - 'Magento\App\ObjectManager\ConfigLoader' => $configLoader, - 'Magento\App\ObjectManager\ConfigCache' => $configCache, + 'Magento\Framework\App\Filesystem\DirectoryList\Verification' => $verification, + 'Magento\Framework\App\Cache\Type\Config' => $cache, + 'Magento\Framework\App\ObjectManager\ConfigLoader' => $configLoader, + 'Magento\Framework\App\ObjectManager\ConfigCache' => $configCache, 'Magento\Config\ReaderInterface' => $this->getMock('Magento\Config\ReaderInterface'), 'Magento\Config\ScopeInterface' => $this->getMock('Magento\Config\ScopeInterface'), 'Magento\Config\CacheInterface' => $this->getMock('Magento\Config\CacheInterface'), 'Magento\Cache\FrontendInterface' => $this->getMock('Magento\Cache\FrontendInterface'), - 'Magento\App\Resource' => $this->getMock('Magento\App\Resource', array(), array(), '', false), - 'Magento\App\Resource\Config' => $this->getMock( - 'Magento\App\Resource\Config', + 'Magento\Framework\App\Resource' => $this->getMockBuilder('Magento\Framework\App\Resource') + ->disableOriginalConstructor() + ->getMock(), + 'Magento\Framework\App\Resource\Config' => $this->getMock( + 'Magento\Framework\App\Resource\Config', array(), array(), '', @@ -95,13 +97,13 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase $primaryLoaderMock ); - $model->addSharedInstance($resource, 'Magento\App\Resource'); + $model->addSharedInstance($resource, 'Magento\Framework\App\Resource'); $instance1 = $model->get('Magento\Object'); $this->assertSame($instance1, $model->get('Magento\Object')); $this->assertSame($model, $model->clearCache()); $this->assertSame($model, $model->get('Magento\ObjectManager')); - $this->assertSame($resource, $model->get('Magento\App\Resource')); + $this->assertSame($resource, $model->get('Magento\Framework\App\Resource')); $this->assertNotSame($instance1, $model->get('Magento\Object')); } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index b8d0f00dceda02ca8883693822b538e64adfaf7e..0291dd0ed0634cd204f4de2ceb868060c5cd2a97 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -36,8 +36,8 @@ class RequestTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_model = new \Magento\TestFramework\Request( - $this->getMock('Magento\App\Route\ConfigInterface', array(), array(), '', false), - $this->getMock('Magento\App\Request\PathInfoProcessorInterface', array(), array(), '', false) + $this->getMock('Magento\Framework\App\Route\ConfigInterface', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', array(), array(), '', false) ); } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php index 8ff0fd0274287434bd4aef924e18e22acb6eb901..88aa611d6daf020a6ef9b0b8932b2ce1e5c7859c 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php @@ -32,7 +32,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase { $response = new \Magento\TestFramework\Response( $this->getMock('\Magento\Stdlib\Cookie', array(), array(), '', false), - $this->getMock('Magento\App\Http\Context', array(), array(), '', false) + $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false) ); $this->assertTrue($response->canSendHeaders()); $this->assertTrue($response->canSendHeaders(false)); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php index be4d999c8bebec798570fd0130c9c24f90524bec..990c25dd41c01714ca74df8df289e7ab0691017b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php @@ -40,12 +40,12 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon { $this->messageManager = $this->getMock('\Magento\Message\Manager', array(), array(), '', false); $request = new \Magento\TestFramework\Request( - $this->getMock('\Magento\App\Route\ConfigInterface', array(), array(), '', false), - $this->getMock('Magento\App\Request\PathInfoProcessorInterface', array(), array(), '', false) + $this->getMock('\Magento\Framework\App\Route\ConfigInterface', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', array(), array(), '', false) ); $response = new \Magento\TestFramework\Response( $this->getMock('\Magento\Stdlib\Cookie', array(), array(), '', false), - $this->getMock('Magento\App\Http\Context', array(), array(), '', false) + $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false) ); $this->_objectManager = $this->getMock( @@ -60,8 +60,8 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon ->will( $this->returnValueMap( array( - array('Magento\App\RequestInterface', $request), - array('Magento\App\ResponseInterface', $response), + array('Magento\Framework\App\RequestInterface', $request), + array('Magento\Framework\App\ResponseInterface', $response), array('Magento\Message\Manager', $this->messageManager), ) ) @@ -134,7 +134,7 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon public function testAssertRedirect() { /* - * Prevent calling \Magento\App\Response\Http::setRedirect() because it dispatches event, + * Prevent calling \Magento\Framework\App\Response\Http::setRedirect() because it dispatches event, * which requires fully initialized application environment intentionally not available * for unit tests */ diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 5a86dc97dace22309ac0f49edf7bba0fb3f11bde..74a23e3636f763acc044973514e2c5b15d3e04e2 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -55,7 +55,7 @@ <includePath>.;testsuite</includePath> <ini name="date.timezone" value="America/Los_Angeles"/> <ini name="xdebug.max_nesting_level" value="200"/> - <ini name="memory_limit" value="4096M"/> + <ini name="memory_limit" value="256M"/> <!-- Local XML configuration file ('.dist' extension will be added, if the specified file doesn't exist) --> <const name="TESTS_LOCAL_CONFIG_FILE" value="etc/local-mysql.xml"/> <!-- Semicolon-separated 'glob' patterns, that match global XML configuration files --> diff --git a/dev/tests/integration/testsuite/Magento/Backend/App/Router/DefaultRouterTest.php b/dev/tests/integration/testsuite/Magento/Backend/App/Router/DefaultRouterTest.php index c602175983e26ec011412cdc211abcbace468f26..3670466b0777f4ae741d8125e01c31f0418bb761 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/App/Router/DefaultRouterTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/App/Router/DefaultRouterTest.php @@ -49,7 +49,7 @@ class DefaultRouterTest extends \PHPUnit_Framework_TestCase public function testRouterCanProcessRequestsWithProperPathInfo() { - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects($this->once())->method('getPathInfo')->will($this->returnValue('backend/admin/dashboard')); $this->assertInstanceOf('Magento\Backend\Controller\Adminhtml\Dashboard', $this->model->match($request)); @@ -93,13 +93,13 @@ class DefaultRouterTest extends \PHPUnit_Framework_TestCase ); $routeConfig = $this->getMock( - 'Magento\App\Route\Config', + 'Magento\Framework\App\Route\Config', array('_getRoutes'), array( - 'reader' => $this->objectManager->get('Magento\App\Route\Config\Reader'), + 'reader' => $this->objectManager->get('Magento\Framework\App\Route\Config\Reader'), 'cache' => $this->objectManager->get('Magento\Config\CacheInterface'), 'configScope' => $this->objectManager->get('Magento\Config\ScopeInterface'), - 'areaList' => $this->objectManager->get('Magento\App\AreaList'), + 'areaList' => $this->objectManager->get('Magento\Framework\App\AreaList'), 'cacheId' => 'RoutesConfig' ) ); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php index 4bae3a11133bb30f1ca65eb47676116c96f5b315..c1730e753de49905397389e463ab2191d93bf030 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Magento\Backend\Block\System\Config; -use Magento\App\Cache\State; +use Magento\Framework\App\Cache\State; /** * @magentoAppArea adminhtml @@ -258,16 +258,17 @@ class FormTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Config\ScopeInterface') ->setCurrentScope(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); $fileResolverMock = $this->getMockBuilder( - 'Magento\App\Config\FileResolver' + 'Magento\Framework\App\Config\FileResolver' )->disableOriginalConstructor()->getMock(); - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); /** @var $directory \Magento\Filesystem\Directory\Read */ - $directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $fileIteratorFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Config\FileIteratorFactory' ); @@ -314,10 +315,10 @@ class FormTest extends \PHPUnit_Framework_TestCase public function testInitFormAddsFieldsets() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\ResponseInterface' + 'Magento\Framework\App\ResponseInterface' )->headersSentThrowsException = false; \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setParam( 'section', 'general' diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Variable/EditTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Variable/EditTest.php index 2125f44d147decf3f0da72650c1f92a144a4a6fb..8a90c62c02574fb2c2108269017c18f45d8fabf4 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Variable/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Variable/EditTest.php @@ -48,7 +48,7 @@ class EditTest extends \PHPUnit_Framework_TestCase $variable = $objectManager->create('Magento\Core\Model\Variable')->setData($data)->save(); $objectManager->get('Magento\Registry')->register('current_variable', $variable); - $objectManager->get('Magento\App\RequestInterface')->setParam('variable_id', $variable->getId()); + $objectManager->get('Magento\Framework\App\RequestInterface')->setParam('variable_id', $variable->getId()); $block = $objectManager->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php index c9bef05ad7c686a63b1f14850b69bfaf1cad2729..5fd015d38799e6ced96f0d7d0a95acdbce394284 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php @@ -70,8 +70,8 @@ class MassactionTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( StoreManager::PARAM_RUN_CODE => 'admin', StoreManager::PARAM_RUN_TYPE => 'store', - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/../../_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/../../_files/design') ), )); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php index 981010ff896b6bce92cabd6d26ed8ba6ac7ecf6e..667b23307557c6d66fb87aff510844996a3f5f78 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php @@ -117,7 +117,10 @@ class GridTest extends \PHPUnit_Framework_TestCase protected function _getColumnSetMock() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $directoryList = $objectManager->create('Magento\App\Filesystem\DirectoryList', array('root' => __DIR__)); + $directoryList = $objectManager->create( + 'Magento\Framework\App\Filesystem\DirectoryList', + array('root' => __DIR__) + ); return $this->getMock( 'Magento\Backend\Block\Widget\Grid\ColumnSet', array(), @@ -126,7 +129,7 @@ class GridTest extends \PHPUnit_Framework_TestCase 'Magento\View\Element\Template\Context', array( 'filesystem' => $objectManager->create( - '\Magento\App\Filesystem', + '\Magento\Framework\App\Filesystem', array('directoryList' => $directoryList) ) ) diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/backend_theme.php b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/backend_theme.php index f0e47ab05bacbb1e0be51358c01a645618ed730b..f2c8f7edaa79e860af8da22d38a72c9d970a2850 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/backend_theme.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/backend_theme.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $registration \Magento\Core\Model\Theme\Registration */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); $registration = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php index 369e00ff6c94dc3c778abacd6373f1fe9743b6b9..1c32a82756eee29b35ffcb3203e9afa493812c11 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php @@ -128,7 +128,8 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController $this->dispatch('backend/admin/index/index'); - $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\ResponseInterface'); + $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\ResponseInterface'); $code = $response->getHttpResponseCode(); $this->assertTrue($code >= 300 && $code < 400, 'Incorrect response code'); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php index f58afbce67a63aab44bc38c74dae351b45f93c95..80f9db5ac02ebea70e00eca9deb4a63357c93dc6 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php @@ -36,13 +36,13 @@ class CacheTest extends \Magento\Backend\Utility\Controller { $this->dispatch('backend/admin/cache/flushAll'); - /** @var $cache \Magento\App\Cache */ - $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache'); - /** @var $cachePool \Magento\App\Cache\Frontend\Pool */ + /** @var $cache \Magento\Framework\App\Cache */ + $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); + /** @var $cachePool \Magento\Framework\App\Cache\Frontend\Pool */ $this->assertFalse($cache->load('APPLICATION_FIXTURE')); $cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\Frontend\Pool' + 'Magento\Framework\App\Cache\Frontend\Pool' ); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { @@ -58,13 +58,13 @@ class CacheTest extends \Magento\Backend\Utility\Controller { $this->dispatch('backend/admin/cache/flushSystem'); - /** @var $cache \Magento\App\Cache */ - $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache'); - /** @var $cachePool \Magento\App\Cache\Frontend\Pool */ + /** @var $cache \Magento\Framework\App\Cache */ + $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); + /** @var $cachePool \Magento\Framework\App\Cache\Frontend\Pool */ $this->assertFalse($cache->load('APPLICATION_FIXTURE')); $cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\Frontend\Pool' + 'Magento\Framework\App\Cache\Frontend\Pool' ); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { @@ -85,14 +85,14 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToEnable)); $this->dispatch('backend/admin/cache/massEnable'); - /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ + /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\App\Cache\StateInterface */ + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\StateInterface' + 'Magento\Framework\App\Cache\StateInterface' ); foreach ($types as $type) { if (in_array($type, $typesToEnable)) { @@ -113,14 +113,14 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToDisable)); $this->dispatch('backend/admin/cache/massDisable'); - /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ + /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\App\Cache\StateInterface */ + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\StateInterface' + 'Magento\Framework\App\Cache\StateInterface' ); foreach ($types as $type) { if (in_array($type, $typesToDisable)) { @@ -141,9 +141,9 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->getRequest()->setParams(array('types' => $typesToRefresh)); $this->dispatch('backend/admin/cache/massRefresh'); - /** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ + /** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $invalidatedTypes = array_keys($cacheTypeList->getInvalidated()); $failed = array_intersect($typesToRefresh, $invalidatedTypes); @@ -159,9 +159,9 @@ class CacheTest extends \Magento\Backend\Utility\Controller 'no types' => array(array()), 'existing types' => array( array( - \Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\App\Cache\Type\Layout::TYPE_IDENTIFIER, - \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER + \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER ) ) ); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Backend/Helper/DataTest.php index 473eeaba72ccfcecd5644f77a9a8614cd81bba75..2add22c953d82f11e93cfc3ace0d138c886b5550 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Helper/DataTest.php @@ -98,7 +98,7 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testPageHelpUrl() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setControllerModule( 'dummy' )->setControllerName( diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Admin/RobotsTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Admin/RobotsTest.php index 5ec4a6b4f3b4c0532fdc296e6216623f64ede4cf..7d16f19c1d7a7308567d1cb2e07e69b74d44b50a 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Admin/RobotsTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Config/Backend/Admin/RobotsTest.php @@ -53,9 +53,9 @@ class RobotsTest extends \PHPUnit_Framework_TestCase $this->model->setPath('design/search_engine_robots/custom_instructions'); $this->model->afterLoad(); $this->rootDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryRead( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php index 80b160fd4dc25fcc5c3906c9b99f233283535dbc..d3483b52c9d0d5ba6859388c01ea56ea74ddd016 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php @@ -88,7 +88,8 @@ class ResolverTest extends \PHPUnit_Framework_TestCase */ public function testSetLocaleWithRequestLocale() { - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\RequestInterface'); $request->setPost(array('locale' => 'de_DE')); $this->_checkSetLocale('de_DE'); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/ObserverTest.php index 27961d87326dbebf7d69effd55992c20054602e0..038f13d2472a057a72951106c12e754fc8b5d200 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/ObserverTest.php @@ -48,7 +48,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase { $this->markTestSkipped('Skipped because of authentication process moved into base controller.'); - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\RequestInterface'); $this->assertEmpty($request->getRouteName()); $this->assertEmpty($request->getControllerName()); $this->assertEmpty($request->getActionName()); @@ -71,7 +72,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $observer = $this->_buildObserver(); $this->_model->actionPreDispatchAdmin($observer); - $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\ResponseInterface'); + $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\ResponseInterface'); $code = $response->getHttpResponseCode(); $this->assertTrue($code >= 300 && $code < 400); @@ -92,7 +94,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $observer = $this->_buildObserver(); $this->_model->actionPreDispatchAdmin($observer); - $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\ResponseInterface'); + $response = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\ResponseInterface'); $code = $response->getHttpResponseCode(); $this->assertFalse($code >= 300 && $code < 400); @@ -109,7 +112,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ protected function _buildObserver() { - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\RequestInterface'); $request->setPost( 'login', array( diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Search/CustomerTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Search/CustomerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..185aaaa8b34bf20e28fc698652449964e2204ecc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Search/CustomerTest.php @@ -0,0 +1,139 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Backend\Model\Search; + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * @magentoAppArea adminhtml + */ +class CustomerTest extends \PHPUnit_Framework_TestCase +{ + /** + * @magentoDataFixture Magento/Customer/_files/three_customers.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + * @dataProvider loadDataProvider + */ + public function testLoad($query, $limit, $start, $expectedResult) + { + /** Preconditions */ + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Backend\Model\Search\Customer $customerSearch */ + $customerSearch = $objectManager->create('Magento\Backend\Model\Search\Customer'); + $customerSearch->setQuery($query); + $customerSearch->setLimit($limit); + $customerSearch->setStart($start); + $customerSearch->load(); + + /** SUT Execution */ + $searchResults = $customerSearch->getResults(); + + /** Ensure that search results are correct */ + $this->assertCount(count($expectedResult), $searchResults, 'Quantity of search result items is invalid.'); + foreach ($expectedResult as $itemIndex => $expectedItem) { + /** Validate URL to item */ + $customerId = substr($expectedItem['id'], 11); // 'customer/1/' is added to all actual customer IDs + $this->assertContains( + "customer/index/edit/id/$customerId", + $searchResults[$itemIndex]['url'], + 'Item URL is invalid.' + ); + unset($searchResults[$itemIndex]['url']); + + /** Validate other item data */ + $this->assertEquals($expectedItem, $searchResults[$itemIndex], "Data of item #$itemIndex is invalid."); + } + } + + public static function loadDataProvider() + { + return [ + 'All items, first page' => [ + 'Firstname', + 2, // Items on page + 1, // Page number + [ + [ + 'id' => 'customer/1/1', + 'type' => 'Customer', + 'name' => 'Firstname Lastname', + 'description' => 'CompanyName' + ], + [ + 'id' => 'customer/1/2', + 'type' => 'Customer', + 'name' => 'Firstname2 Lastname2', + 'description' => null + ] + ] + ], + 'All items, second page' => [ + 'Firstname', + 2, // Items on page + 2, // Page number + [ + [ + 'id' => 'customer/1/3', + 'type' => 'Customer', + 'name' => 'Firstname3 Lastname3', + 'description' => null + ] + ] + ], + 'Search by last name, second item only' => [ + 'Lastname2', + 10, // Items on page + 1, // Page number + [ + [ + 'id' => 'customer/1/2', + 'type' => 'Customer', + 'name' => 'Firstname2 Lastname2', + 'description' => null + ] + ] + ], + 'No results' => [ + 'NotExistingCustomerName', + 10, // Items on page + 1, // Page number + [] + ], + 'Search by company name, first item only' => [ + 'CompanyName', + 10, // Items on page + 1, // Page number + [ + [ + 'id' => 'customer/1/1', + 'type' => 'Customer', + 'name' => 'Firstname Lastname', + 'description' => 'CompanyName' + ], + ] + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Session/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Session/QuoteTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9f9253b68db001897bd5f714672ff945be577a51 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Session/QuoteTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Backend\Model\Session; + +/** + * @magentoAppArea adminhtml + */ +class QuoteTest extends \PHPUnit_Framework_TestCase +{ + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoAppIsolation enabled + */ + public function testGetQuote() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $fixtureCustomerId = 1; + /** @var \Magento\Backend\Model\Session\Quote $backendQuoteSession */ + $backendQuoteSession = $objectManager->get('Magento\Backend\Model\Session\Quote'); + $backendQuoteSession->setCustomerId($fixtureCustomerId); + /** @var \Magento\Backend\Model\Session\Quote $quoteSession */ + $quoteSession = $objectManager->create('Magento\Backend\Model\Session\Quote'); + $quoteSession->setEntity(new \Magento\Object()); + + /** SUT execution */ + $quote = $quoteSession->getQuote(); + + /** Ensure that customer data was added to quote correctly */ + $this->assertEquals('Firstname', $quote->getCustomerFirstname(), 'Customer data was set to quote incorrectly.'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Translate/InlineTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Translate/InlineTest.php index 94bf9bc3708edab7c693d5e8acfc9581b9c5f806..dfc59e49ecc382cc8cf4147d0863727d4b15f782 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/Translate/InlineTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Translate/InlineTest.php @@ -27,8 +27,6 @@ namespace Magento\Backend\Model\Translate; /** - * Test class for \Magento\Backend\Model\Translate\Inline. - * * @magentoAppArea adminhtml */ class InlineTest extends \PHPUnit_Framework_TestCase @@ -47,7 +45,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase /** * @magentoAdminConfigFixture dev/translate_inline/active_admin 1 - * @covers \Magento\Backend\Model\Translate\Inline::_getAjaxUrl + * @covers \Magento\Translate\Inline::getAjaxUrl */ public function testAjaxUrl() { diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php index d6293a9a9f8e55723178426907e1a3ff5b99256c..2a254d449732f1b21def4340c6502c827b1351e7 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php @@ -67,8 +67,9 @@ class UrlTest extends \PHPUnit_Framework_TestCase */ public function testGetSecretKey($routeName, $controller, $action, $expectedHash) { - /** @var $request \Magento\App\RequestInterface */ - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + /** @var $request \Magento\Framework\App\RequestInterface */ + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); $request->setControllerName( 'default_controller' )->setActionName( @@ -154,8 +155,9 @@ class UrlTest extends \PHPUnit_Framework_TestCase /** @var $encryptor \Magento\Encryption\EncryptorInterface */ $encryptor = $objectManager->get('Magento\Encryption\EncryptorInterface'); - /** @var $request \Magento\App\Request\Http */ - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + /** @var $request \Magento\Framework\App\Request\Http */ + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); $request->setControllerName('controller')->setActionName('action'); $request->initForward()->setControllerName(uniqid())->setActionName(uniqid()); $this->_model->setRequest($request); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/_files/no_robots_txt.php b/dev/tests/integration/testsuite/Magento/Backend/Model/_files/no_robots_txt.php index 63f352a0f0165c3c7cd6034f8e41de199421e89b..20a269dd3c72b26c49de7abc5a50912ab1e9ca41 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/_files/no_robots_txt.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/_files/no_robots_txt.php @@ -27,9 +27,9 @@ /** @var \Magento\Filesystem\Directory\Write $rootDirectory */ $rootDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); if ($rootDirectory->isExist('robots.txt')) { $rootDirectory->delete('robots.txt'); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/_files/robots_txt.php b/dev/tests/integration/testsuite/Magento/Backend/Model/_files/robots_txt.php index 4d5d52d92f22040a0cf14d7c1ae5f6fde6fa961b..f33f8f2d36093035a9b165f9ac8460b1e5ac3a68 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/_files/robots_txt.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/_files/robots_txt.php @@ -26,8 +26,8 @@ */ /** @var \Magento\Filesystem\Directory\Write $rootDirectory */ $rootDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ); $rootDirectory->copyFile($rootDirectory->getRelativePath(__DIR__ . '/robots.txt'), 'robots.txt'); diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php index 4f67cf5c3d958f6bda6d73539c99f4ab4f582913..074aecafadfd6de30ff6cbae166788c56b74ee32 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php @@ -22,14 +22,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $types = array_keys($cacheTypeList->getTypes()); -/** @var $cacheState \Magento\App\Cache\StateInterface */ -$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\StateInterface'); +/** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ +$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Cache\StateInterface'); foreach ($types as $type) { $cacheState->setEnabled($type, false); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php index 7a9114c1635215541a782e2f5dcf3b88ca8f4f4d..854514cc6a3a5550f19452197f4e1544dbe212e3 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php @@ -22,14 +22,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $types = array_keys($cacheTypeList->getTypes()); -/** @var $cacheState \Magento\App\Cache\StateInterface */ -$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\StateInterface'); +/** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ +$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Cache\StateInterface'); foreach ($types as $type) { $cacheState->setEnabled($type, true); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_invalidated.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_invalidated.php index 17f9fd336272b4f7a527ca7de9f4974ffcd4ba83..a85b5c708d62cf1208820612d9393ba6f0f1ead5 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_invalidated.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_invalidated.php @@ -22,8 +22,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ +/** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $cacheTypeList->invalidate(array_keys($cacheTypeList->getTypes())); diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/application_cache.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/application_cache.php index c65a2a8ffb3b16887da9704b97fa7c77daeafa3f..aa5ab3323e6212257891275eb3b7047935cfb25e 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/application_cache.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/application_cache.php @@ -22,6 +22,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\App\Cache */ -$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache'); +/** @var $cache \Magento\Framework\App\Cache */ +$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); $cache->save('application data', 'APPLICATION_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/empty_storage.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/empty_storage.php index f7bae433aecf0fc7172963721378b3800094570f..fce9b2d79f9eda07db2ed6b9d9b7629bb35fcbdb 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/empty_storage.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/empty_storage.php @@ -22,6 +22,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\App\Cache */ -$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache'); +/** @var $cache \Magento\Framework\App\Cache */ +$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); $cache->clean(); diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/non_application_cache.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/non_application_cache.php index 3d1a0d43dd34443de57130aa69b3d66a10ceecc2..bf3812ab1bae36407312a1c00089d7b60c2cf360 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/non_application_cache.php +++ b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/non_application_cache.php @@ -22,8 +22,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cachePool \Magento\App\Cache\Frontend\Pool */ -$cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache\Frontend\Pool'); +/** @var $cachePool \Magento\Framework\App\Cache\Frontend\Pool */ +$cachePool = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Cache\Frontend\Pool'); /** @var $cacheFrontend \Magento\Cache\FrontendInterface */ foreach ($cachePool as $cacheFrontend) { $cacheFrontend->getBackend()->save('non-application cache data', 'NON_APPLICATION_FIXTURE', array('SOME_TAG')); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php index 74003dfeaeafa3b8662544dbeb5553be5e303808..358eb3c2583bd3eeec1d2d19fb5cbe5df4c28b5f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php @@ -38,7 +38,8 @@ class TabsTest extends \PHPUnit_Framework_TestCase public function testPrepareLayout() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); + $objectManager->get('Magento\Framework\App\State') + ->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $objectManager->get('Magento\View\DesignInterface')->setDefaultDesignTheme(); /** @var $product \Magento\Catalog\Model\Product */ $product = $objectManager->create('Magento\Catalog\Model\Product'); @@ -46,7 +47,7 @@ class TabsTest extends \PHPUnit_Framework_TestCase // fixture $objectManager->get('Magento\Registry')->register('product', $product); - $objectManager->get('Magento\App\State')->setAreaCode('nonexisting'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('nonexisting'); /** @var $layout \Magento\View\Layout */ $layout = $objectManager->get('Magento\View\LayoutInterface'); $layout->addBlock('Magento\View\Element\Text', 'head'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/AbstractTest.php index 6ec246b9117f67799404872cf2fef147b8b39095..3b40616284d91174fff82e3608157b4fa997f4dc 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/AbstractTest.php @@ -68,7 +68,8 @@ class AbstractTest extends \PHPUnit_Framework_TestCase self::$_isStubClass = true; } - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDefaultDesignTheme(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php index ca172647dc61bb90c322501eba1d472c99742af3..34e07e383d9b620b5dba1de1a2cea628bf4c72a3 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php @@ -40,7 +40,8 @@ class ListTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php index 1786d6fb5433dd7f2d29278ac1f82973e4c68344..576962477212588adc17c648f1a61669cbabf911 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php @@ -42,7 +42,7 @@ class NewTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea(\Magento\Core\Model\App\Area::AREA_FRONTEND); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Http\Context' + 'Magento\Framework\App\Http\Context' )->setValue( \Magento\Customer\Helper\Data::CONTEXT_GROUP, \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID, diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/SendTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/SendTest.php index 96d9d0ac5f332b54a1505eada9b12482c19d8e3a..c8c7d9d2ebd8592656f78f5780e9b44e2152e277 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/SendTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/SendTest.php @@ -41,7 +41,7 @@ class SendTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->customerSession = $objectManager->get('Magento\Customer\Model\Session'); $this->block = $objectManager->get('Magento\View\LayoutInterface') diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ImageTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ImageTest.php index 896d4938122dbcd1cb83930a8b8ccd7f24897fa9..1e78857b34a29659163b735a4b71ae44a5e0427d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ImageTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ImageTest.php @@ -49,9 +49,9 @@ class ImageTest extends \PHPUnit_Framework_TestCase $config = $objectManager->get('Magento\Catalog\Model\Product\Media\Config'); /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); // image fixtures @@ -99,9 +99,9 @@ class ImageTest extends \PHPUnit_Framework_TestCase $config = $objectManager->get('Magento\Catalog\Model\Product\Media\Config'); /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $mediaDirectory->delete($config->getBaseMediaPath()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php index 8c228f0b96ecede0290519984546050c47954643..4672335099c67b6f5b41f5729b1678e6c534f7ef 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php @@ -49,8 +49,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); - $objectManager->get('Magento\App\Http\Context') + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\Http\Context') ->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); $objectManager->get('Magento\View\DesignInterface') ->setDefaultDesignTheme(); @@ -65,7 +65,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase ) ); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Action\Context', + 'Magento\Framework\App\Action\Context', $arguments ); $this->_controller = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php index 18bede4a3147855b6d8018e6e2375fa474289f87..57d3b6c28769e9400c63738d6dee20a83dc75350 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php @@ -35,7 +35,8 @@ class ProductTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Catalog\Helper\Product' ); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest.php index 80a357eab8ec6f8a45ed27ddd34e60832690060f..8f729e8374a1e0e045a8f718e66f182ed082bc37 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest.php @@ -64,7 +64,7 @@ class CategoryImageTest extends \PHPUnit_Framework_TestCase protected function tearDown() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/log/active', $this->_oldLogActive, @@ -74,7 +74,7 @@ class CategoryImageTest extends \PHPUnit_Framework_TestCase $this->_oldLogActive = null; \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/log/exception_file', $this->_oldExceptionFile, diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest/StubZendLogWriterStreamTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest/StubZendLogWriterStreamTest.php index ba193db46568d5c0baece073a40ae07842a92655..1d86fb8d2b3cc21a568a06843c87331ecc53c8b2 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest/StubZendLogWriterStreamTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/CategoryImageTest/StubZendLogWriterStreamTest.php @@ -28,7 +28,7 @@ namespace Magento\Catalog\Model\Category\CategoryImageTest; \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/log/active', 1, @@ -36,7 +36,7 @@ namespace Magento\Catalog\Model\Category\CategoryImageTest; ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/log/exception_file', 'save_category_without_image.log', diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php index 4d7e45a7d4beba9d4e7be3d6e08a413c169a8726..b8d0a8c10aa562290f0d8f82cdcfee46a7cf3639 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php @@ -80,7 +80,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase /** @var $request \Magento\TestFramework\Request */ $request = $objectManager->get('Magento\TestFramework\Request'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Action\Action', + 'Magento\Framework\App\Action\Action', array( 'request' => $request, 'response' => \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( @@ -99,10 +99,10 @@ class ItemTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var $request \Magento\TestFramework\Request */ - $request = $objectManager->create('Magento\App\RequestInterface'); + $request = $objectManager->create('Magento\Framework\App\RequestInterface'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setRoutingInfo( array('requested_route' => 'x', 'requested_controller' => 'y', 'requested_action' => 'z') ); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php index 3410b20536ac676a8a6a3b435c0c6bbb2209c7f2..b924be887800cc2f10d153108ddb2792ab59fa45 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php @@ -53,9 +53,9 @@ class MediaTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $config = $objectManager->get('Magento\Catalog\Model\Product\Media\Config'); $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); self::$_mediaTmpDir = $mediaDirectory->getAbsolutePath($config->getBaseTmpMediaPath()); @@ -78,9 +78,9 @@ class MediaTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); if ($mediaDirectory->isExist($config->getBaseMediaPath())) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTest.php index abc83afbef278e87533e8be349245369574e6429..49a862dacf7df2283b49397a11b4c1a0a4f3ccb6 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTest.php @@ -44,7 +44,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $eventManager = $this->getMock('Magento\Event\ManagerInterface', array('dispatch'), array(), '', false); $coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $fileStorageDb = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $registry = $this->getMock('Magento\Registry', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $this->_model = $this->getMockForAbstractClass( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php index 2817953b53a861350661079734061495fac0780a..4983cec4b12b136fab190ad64b36c1f69904d2a3 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php @@ -269,9 +269,9 @@ class ProductGettersTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $config = $objectManager->get('Magento\Catalog\Model\Product\Media\Config'); $mediaDirectory->delete($config->getBaseMediaPath()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php index 46bf76a925e3d3f86b6cb251298f4732a9f6a801..3af8113004152f0d43f035b2c38005709713c729 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php @@ -56,9 +56,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); if ($mediaDirectory->isExist($config->getBaseMediaPath())) { @@ -111,7 +111,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase public function testCleanCache() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\CacheInterface' + 'Magento\Framework\App\CacheInterface' )->save( 'test', 'catalog_product_999', @@ -121,7 +121,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase $this->_model->setId(999)->cleanCache(); $this->assertFalse( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\CacheInterface' + 'Magento\Framework\App\CacheInterface' )->load( 'catalog_product_999' ) @@ -157,9 +157,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $mediaDirectory->create($config->getBaseTmpMediaPath()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image.php index 227a3dcafb26129f094140b879acab8067e4ddbd..3393b2516ec6dd88bc041e02b61ee7c5525d7d5d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image.php @@ -26,7 +26,8 @@ */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$mediaPath = $objectManager->get('Magento\App\Filesystem')->getPath(\Magento\App\Filesystem::MEDIA_DIR); +$mediaPath = $objectManager->get('Magento\Framework\App\Filesystem') + ->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR); $additionalPath = $objectManager->get('Magento\Catalog\Model\Product\Media\Config')->getBaseMediaPath(); $dir = $mediaPath . '/' . $additionalPath . '/m/a'; if (!is_dir($dir)) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image_rollback.php index 20a8d63cb52af220b5ec0979d8633ade65c7b1ae..18463137199a3ba094990ada90163852837164fc 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_image_rollback.php @@ -32,9 +32,9 @@ $config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ $mediaDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $mediaDirectory->delete($config->getBaseMediaPath()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/controllers/_files/products.php b/dev/tests/integration/testsuite/Magento/Catalog/controllers/_files/products.php index 9757dedd5611515814ad3ceaef8d13114842297b..fb0c680c9edf936fd594b26fb4ddf251b31a4d09 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/controllers/_files/products.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/controllers/_files/products.php @@ -31,7 +31,8 @@ $obectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var \Magento\Catalog\Model\Product\Media\Config $config */ $config = $obectManager->get('Magento\Catalog\Model\Product\Media\Config'); /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ -$mediaDirectory = $obectManager->get('Magento\App\Filesystem')->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); +$mediaDirectory = $obectManager->get('Magento\Framework\App\Filesystem') + ->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $baseTmpMediaPath = $config->getBaseTmpMediaPath(); $mediaDirectory->create($baseTmpMediaPath); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php index 5e4f6056537bc4771081085a21f6c43490e8d694..4731a6702c4973ab2822559e01af336036eb3d85 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php @@ -72,9 +72,9 @@ class DataTest extends \PHPUnit_Framework_TestCase 'Magento\CatalogSearch\Helper\Data', array('getQueryText'), array( - $objectManager->get('Magento\App\Helper\Context'), + $objectManager->get('Magento\Framework\App\Helper\Context'), $objectManager->get('Magento\Stdlib\String'), - $objectManager->get('Magento\App\Config\ScopeConfigInterface'), + $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\CatalogSearch\Model\QueryFactory'), $objectManager->get('Magento\Escaper'), $objectManager->get('Magento\Filter\FilterManager') diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php index 1285a29091676a4b05ef18e3343915b9fa916699..56e14a9fa646b4bf48d415497986dc71f30e0a57 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php @@ -32,7 +32,8 @@ class SidebarTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/BillingTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/BillingTest.php index 85e4de4745979d898ed65281c73e98badef3e99a..7826fa172b45005c432d6ad08bd1ca2857d8814c 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/BillingTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/BillingTest.php @@ -81,7 +81,7 @@ class BillingTest extends \PHPUnit_Framework_TestCase $checkoutSession->setQuoteId($quote->getId()); $checkoutSession->setLoadInactive(true); - $objectManager->get('Magento\App\Http\Context') + $objectManager->get('Magento\Framework\App\Http\Context') ->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, true, false); $this->_block = $objectManager->get('Magento\View\LayoutInterface') ->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php index 93b6985a8d35a7960f048e56350f0adeb6f1cb77..dc4013df630e81388e78993631034b987ce1f244 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php @@ -37,7 +37,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase { $this->markTestIncomplete('MAGETWO-3393'); $this->_model = new \Magento\Cms\Controller\Router( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\ActionFactory'), + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\ActionFactory'), new \Magento\Event\ManagerInterfaceStub( $this->getMockForAbstractClass('Magento\Event\InvokerInterface'), $this->getMock('Magento\Event\Config', array(), array(), '', false), @@ -45,7 +45,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase $this->getMock('Magento\Event\ObserverFactory', array(), array(), '', false) ), \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\UrlInterface'), - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\StateInterface'), + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\StateInterface'), \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Cms\Model\PageFactory'), \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Store\Model\StoreManagerInterface' @@ -62,11 +62,12 @@ class RouterTest extends \PHPUnit_Framework_TestCase public function testMatch() { $this->markTestIncomplete('MAGETWO-3393'); - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); //Open Node $request->setPathInfo('parent_node'); $controller = $this->_model->match($request); - $this->assertInstanceOf('Magento\App\Action\Redirect', $controller); + $this->assertInstanceOf('Magento\Framework\App\Action\Redirect', $controller); } } /** diff --git a/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php index a9c6fd95e90ec3618327ecc1dbf16fecd7ee14b4..a31f071cc0495c4b534cc7a4f904368f516c8381 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php @@ -40,15 +40,15 @@ class PageTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $httpContext = $objectManager->get('Magento\App\Http\Context'); + $httpContext = $objectManager->get('Magento\Framework\App\Http\Context'); $httpContext->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $arguments = array( 'request' => $objectManager->get('Magento\TestFramework\Request'), 'response' => $objectManager->get('Magento\TestFramework\Response') ); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Action\Context', + 'Magento\Framework\App\Action\Context', $arguments ); $page = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Cms\Model\Page'); @@ -58,7 +58,7 @@ class PageTest extends \PHPUnit_Framework_TestCase $pageHelper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Cms\Helper\Page'); $result = $pageHelper->renderPage( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Action\Action', + 'Magento\Framework\App\Action\Action', array('context' => $context) ), $page->getId() diff --git a/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php b/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php index a6fdabeb88ae4f4cf4260bb15e7aa8d780332c01..3df51f368b84b6d4ccba4731022028e18e3a14e0 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php @@ -28,9 +28,9 @@ class ImagesTest extends \PHPUnit_Framework_TestCase public function testGetStorageRoot() { $path = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Cms\Helper\Wysiwyg\Images' diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index f80ee946af097f438a32edc454318985a4fa0124..ffdb299f4ba3479526b60e59693e2941c18506f2 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -86,7 +86,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase public function testGetThumbsPath() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $filesystem = $objectManager->get('Magento\App\Filesystem'); + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); $session = $objectManager->get('Magento\Backend\Model\Session'); $backendUrl = $objectManager->get('Magento\Backend\Model\UrlInterface'); $imageFactory = $objectManager->get('Magento\Image\AdapterFactory'); @@ -114,7 +114,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase $uploaderFactory ); $this->assertStringStartsWith( - str_replace('\\', '/', $filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR)), + str_replace('\\', '/', $filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR)), $model->getThumbsPath() ); } diff --git a/dev/tests/integration/testsuite/Magento/Code/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Code/GeneratorTest.php index e06c5110c98b855a4f3113865664ab34d9a60b86..1ab38ef5c17ced762f9dd7093adb782b5df18555 100644 --- a/dev/tests/integration/testsuite/Magento/Code/GeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/Code/GeneratorTest.php @@ -67,9 +67,9 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase $this->_includePath = get_include_path(); $this->varDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); $generationDirectory = $this->varDirectory->getAbsolutePath('generation'); diff --git a/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceInterceptor.php b/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceInterceptor.php index 286fea8ced045c9e5320372c0de81bd44ed63ddd..92d7813fc4f40bcebdead32ebd5d32ff663ef15b 100644 --- a/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceInterceptor.php +++ b/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceInterceptor.php @@ -78,7 +78,7 @@ class Interceptor extends \Magento\Code\GeneratorTest\SourceClassWithNamespace public function __wakeup() { - $this->pluginLocator = \Magento\App\ObjectManager::getInstance(); + $this->pluginLocator = \Magento\Framework\App\ObjectManager::getInstance(); $this->pluginList = $this->pluginLocator->get('Magento\Interception\PluginList'); $this->chain = $this->pluginLocator->get('Magento\Interception\Chain'); $this->subjectType = get_parent_class($this); diff --git a/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceProxy.php b/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceProxy.php index 52b3e3a31682899bd75764e8301d3aa30c1473dd..e872ce6a927a9a5596e7eb0605503c86b326fa76 100644 --- a/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceProxy.php +++ b/dev/tests/integration/testsuite/Magento/Code/_expected/SourceClassWithNamespaceProxy.php @@ -82,7 +82,7 @@ class Proxy extends \Magento\Code\GeneratorTest\SourceClassWithNamespace */ public function __wakeup() { - $this->_objectManager = \Magento\App\ObjectManager::getInstance(); + $this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** diff --git a/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f08aeeeed2d4594c75c2c0cfe90b0f499df79e64 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php @@ -0,0 +1,79 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Contact\Helper; + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test for Magento\Contact\Helper\Data + * + * @magentoDataFixture Magento/Customer/_files/customer.php + */ +class DataTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Data + */ + protected $contactsHelper; + + /** + * @var \Magento\Customer\Model\Session + */ + protected $customerSession; + + /** + * Setup customer data + */ + protected function setUp() + { + $customerIdFromFixture = 1; + $this->contactsHelper = Bootstrap::getObjectManager()->create('Magento\Contact\Helper\Data'); + $this->customerSession = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session'); + /** + * @var $customerService \Magento\Customer\Service\V1\CustomerAccountServiceInterface + */ + $customerService = Bootstrap::getObjectManager() + ->create('Magento\Customer\Service\V1\CustomerAccountServiceInterface'); + $customerData = $customerService->getCustomer($customerIdFromFixture); + $this->customerSession->setCustomerDataObject($customerData); + } + + /** + * Verify if username is set in session + */ + public function testGetUserName() + { + $this->assertEquals('Firstname Lastname', $this->contactsHelper->getUserName()); + } + + /** + * Verify if user email is set in session + */ + public function testGetEmail() + { + $this->assertEquals('customer@example.com', $this->contactsHelper->getUserEmail()); + } + +} diff --git a/dev/tests/integration/testsuite/Magento/Core/App/Router/BaseTest.php b/dev/tests/integration/testsuite/Magento/Core/App/Router/BaseTest.php index a8c06053cf0615c543a0e9a50b50abdfab9b6c88..d6e36b58b712d373fc7a4f0286ea32624f3d0fcb 100644 --- a/dev/tests/integration/testsuite/Magento/Core/App/Router/BaseTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/App/Router/BaseTest.php @@ -56,9 +56,9 @@ class BaseTest extends \PHPUnit_Framework_TestCase /** @var $request \Magento\TestFramework\Request */ $request = $objectManager->get('Magento\TestFramework\Request'); - $this->assertInstanceOf('Magento\App\ActionInterface', $this->_model->match($request)); + $this->assertInstanceOf('Magento\Framework\App\ActionInterface', $this->_model->match($request)); $request->setRequestUri('core/index/index'); - $this->assertInstanceOf('Magento\App\ActionInterface', $this->_model->match($request)); + $this->assertInstanceOf('Magento\Framework\App\ActionInterface', $this->_model->match($request)); $request->setPathInfo( 'not_exists/not_exists/not_exists' diff --git a/dev/tests/integration/testsuite/Magento/Core/Helper/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Core/Helper/AbstractTest.php index 9d06000fa1760b78c777746969827ad2d6a0a1f5..cdeeedc9db5166cf55ecd63e7dc5a95a07af8978 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Helper/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Helper/AbstractTest.php @@ -29,20 +29,25 @@ namespace Magento\Core\Helper; class AbstractTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Helper\AbstractHelper|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Helper\AbstractHelper|PHPUnit_Framework_MockObject_MockObject */ protected $_helper = null; protected function setUp() { - $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Helper\Context'); - $this->_helper = $this->getMock('Magento\App\Helper\AbstractHelper', array('_getModuleName'), array($context)); + $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Helper\Context'); + $this->_helper = $this->getMock( + 'Magento\Framework\App\Helper\AbstractHelper', + array('_getModuleName'), + array($context) + ); $this->_helper->expects($this->any())->method('_getModuleName')->will($this->returnValue('Magento_Core')); } /** - * @covers \Magento\App\Helper\AbstractHelper::isModuleEnabled - * @covers \Magento\App\Helper\AbstractHelper::isModuleOutputEnabled + * @covers \Magento\Framework\App\Helper\AbstractHelper::isModuleEnabled + * @covers \Magento\Framework\App\Helper\AbstractHelper::isModuleOutputEnabled */ public function testIsModuleEnabled() { diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/App/AreaTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/App/AreaTest.php index cdd09c0cec4955ccf63d0b8756b734eeb0232db3..41b2e0cc23179279a69ec5da7353c8b1ada2b8a1 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/App/AreaTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/App/AreaTest.php @@ -35,13 +35,14 @@ class AreaTest extends \PHPUnit_Framework_TestCase public static function tearDownAfterClass() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\CacheInterface')-> - clean(array(\Magento\Core\Model\Design::CACHE_TAG)); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\CacheInterface') + ->clean(array(\Magento\Core\Model\Design::CACHE_TAG)); } protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); /** @var $_model \Magento\Core\Model\App\Area */ $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Core\Model\App\Area', diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php index bdf6958c58eab4295909757be617c42caa4a6ad2..91ded17102c84db074df9ee999383c40e17f9229 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php @@ -51,7 +51,8 @@ class DesignTest extends \PHPUnit_Framework_TestCase */ public function testChangeDesign() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\View\DesignInterface'); $storeId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Store\Model\StoreManagerInterface' @@ -131,7 +132,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase $design->loadChange($storeId, $date); $cachedDesign = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\CacheInterface' + 'Magento\Framework\App\CacheInterface' )->load( $cacheId ); @@ -147,7 +148,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase $design->loadChange($storeId, $date); $cachedDesign = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\CacheInterface' + 'Magento\Framework\App\CacheInterface' )->load( $cacheId ); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/File/StorageTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/File/StorageTest.php index c1ff7edbcd3b01d2a09012f8a2fd5f42999ca192..bac96f96edc3e5af5479e8252aef3699cd50f7e6 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/File/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/File/StorageTest.php @@ -44,9 +44,9 @@ class StorageTest extends \PHPUnit_Framework_TestCase $this->assertArrayHasKey('update_time', $config); $this->assertEquals( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ), $config['media_directory'] ); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/ObserverTest.php index d5ccdd5ca942478b49342d4e8f7f0352260b7670..33b973b6444e58b8631d6fd2065cf890354a7d79 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/ObserverTest.php @@ -66,7 +66,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase array( $this->_objectManager->create('Magento\Core\Model\Resource\Theme\Data\CollectionFactory'), $this->_objectManager->create('Magento\Core\Model\Theme\Data\Collection'), - $this->_objectManager->create('Magento\App\Filesystem') + $this->_objectManager->create('Magento\Framework\App\Filesystem') ) ); $themeRegistration->expects($this->once())->method('register')->with($this->equalTo($pattern)); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php index d7946ab5431549874930e3f31c412aaf90f4a1f6..ca5e4a4fc9eae6e55f7897a695c7776117e8e787 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php @@ -67,11 +67,11 @@ class UpdateTest extends \PHPUnit_Framework_TestCase */ public function testSaveAfterClearCache() { - /** @var $appCache \Magento\App\Cache */ - $appCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache'); - /** @var \Magento\App\Cache\Type\Layout $layoutCache */ + /** @var $appCache \Magento\Framework\App\Cache */ + $appCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache'); + /** @var \Magento\Framework\App\Cache\Type\Layout $layoutCache */ $layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Cache\Type\Layout' + 'Magento\Framework\App\Cache\Type\Layout' ); $this->assertNotEmpty($appCache->load('APPLICATION_FIXTURE')); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php index 4755ee4c6b123ffc74e104573d2099a30aa07ce6..bffc4f07805e7c7f248a75d81093a7be8370170a 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/CollectionTest.php @@ -40,16 +40,18 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( - 'root' => \Magento\App\Filesystem::ROOT_DIR, + 'root' => \Magento\Framework\App\Filesystem::ROOT_DIR, 'directories' => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => dirname(__DIR__) . '/_files/design' + ) ) ) ); $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('directoryList' => $directoryList) ); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php index 9e38fe746a427145b7cf29784d51ad82c69c4987..c83bb0566c042771680799192d6b43f1181b6822 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Theme/RegistrationTest.php @@ -45,17 +45,19 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => dirname(__DIR__) . '/_files/design' + ) ) ) ); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\AreaList') + $objectManager->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); - $objectManager->get('Magento\App\State') + $objectManager->get('Magento\Framework\App\State') ->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $this->_theme = $objectManager ->create('Magento\View\Design\ThemeInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php index 1a2eeb8744ea49974f8fdaa9db0e45992c2410db..6f49ff28bcd47c9a3bdaf2bab78e8f22e394ea87 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php @@ -54,21 +54,22 @@ class DesignTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $themeDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $themeDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $themeDir->delete('theme/frontend'); $themeDir->delete('theme/_merged'); - $pubLibPath = $filesystem->getPath(\Magento\App\Filesystem::PUB_LIB_DIR); + $pubLibPath = $filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_LIB_DIR); copy($pubLibPath . '/prototype/prototype.js', $pubLibPath . '/prototype/prototype.min.js'); } public static function tearDownAfterClass() { - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - $pubLibPath = $filesystem->getPath(\Magento\App\Filesystem::PUB_LIB_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + $pubLibPath = $filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_LIB_DIR); unlink($pubLibPath . '/prototype/prototype.min.js'); } @@ -79,7 +80,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase $this->_viewFileSystem = $objectManager->create('Magento\View\FileSystem'); $this->_viewConfig = $objectManager->create('Magento\View\ConfigInterface'); $this->_viewUrl = $objectManager->create('Magento\View\Url'); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); } /** @@ -91,8 +92,10 @@ class DesignTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => realpath(__DIR__ . '/../_files/design')) + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => realpath(__DIR__ . '/../_files/design') + ) ) ) ); @@ -108,14 +111,16 @@ class DesignTest extends \PHPUnit_Framework_TestCase public function testSetGetArea() { $this->assertEquals(\Magento\View\DesignInterface::DEFAULT_AREA, $this->_model->getArea()); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('test'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('test'); $this->assertEquals('test', $this->_model->getArea()); } public function testSetDesignTheme() { $this->_model->setDesignTheme('test_test'); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('test'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('test'); $this->assertEquals('test', $this->_model->getArea()); $this->assertEquals(null, $this->_model->getDesignTheme()->getThemePath()); } @@ -228,9 +233,10 @@ class DesignTest extends \PHPUnit_Framework_TestCase 'Magento\View\DesignInterface' )->getDesignTheme(); $customConfigFile = $theme->getCustomization()->getCustomViewConfigPath(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $relativePath = $directory->getRelativePath($customConfigFile); try { $directory->writeFile( @@ -262,7 +268,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase public function testGetViewUrl($appMode, $file, $result) { $currentAppMode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->getMode(); if ($currentAppMode != $appMode) { $this->markTestSkipped("Implemented to be run in {$appMode} mode"); @@ -284,7 +290,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase public function testGetViewUrlSigned($appMode, $file, $result) { $currentAppMode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->getMode(); if ($currentAppMode != $appMode) { $this->markTestSkipped("Implemented to be run in {$appMode} mode"); @@ -306,32 +312,32 @@ class DesignTest extends \PHPUnit_Framework_TestCase { return array( array( - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'Magento_Theme::favicon.ico', 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/favicon.ico' ), array( - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'prototype/prototype.js', 'http://localhost/pub/lib/prototype/prototype.js' ), array( - \Magento\App\State::MODE_DEVELOPER, + \Magento\Framework\App\State::MODE_DEVELOPER, 'Magento_Theme::menu.js', 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/menu.js' ), array( - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'Magento_Theme::menu.js', 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/menu.js' ), array( - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'Magento_Catalog::widgets.css', 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Catalog/widgets.css' ), array( - \Magento\App\State::MODE_DEVELOPER, + \Magento\Framework\App\State::MODE_DEVELOPER, 'Magento_Catalog::widgets.css', 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Catalog/widgets.css' ) @@ -341,9 +347,9 @@ class DesignTest extends \PHPUnit_Framework_TestCase public function testGetPublicFileUrl() { $pubLibFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::PUB_LIB_DIR + \Magento\Framework\App\Filesystem::PUB_LIB_DIR ) . '/jquery/jquery.js'; $actualResult = $this->_viewUrl->getPublicFileUrl($pubLibFile); $this->assertStringEndsWith('/jquery/jquery.js', $actualResult); @@ -355,9 +361,9 @@ class DesignTest extends \PHPUnit_Framework_TestCase public function testGetPublicFileUrlSigned() { $pubLibFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::PUB_LIB_DIR + \Magento\Framework\App\Filesystem::PUB_LIB_DIR ) . '/jquery/jquery.js'; $actualResult = $this->_viewUrl->getPublicFileUrl($pubLibFile); $this->assertStringMatchesFormat('%a/jquery/jquery.js?%d', $actualResult); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/themes.php index 0f27598254d34534998fc09398ce4b1d64489e18..d79c3b6e3d3a3ec983484e4b9cab229ab9904833 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/themes.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/themes.php @@ -24,12 +24,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => realpath(__DIR__)), + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => realpath(__DIR__)), ), )); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php b/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php index 71a1977c9a2756bcd9e2ab22e6069242ac99e2a9..7bdf4d55a451c90f025ee197cbfcf21ea63ec16e 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/config_cache.php @@ -22,6 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var \Magento\App\Cache\Type\Config $layoutCache */ -$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\Type\Config'); +/** @var \Magento\Framework\App\Cache\Type\Config $layoutCache */ +$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Cache\Type\Config'); $layoutCache->save('fixture config cache data', 'CONFIG_CACHE_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php b/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php index fc434b9964c05bb7fce9081a55ac626928703c52..8347e0d3e2bbbd156ad90c8d50dac5e1754efe97 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/design_change_rollback.php @@ -22,6 +22,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var $cache \Magento\App\Cache */ -$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Cache'); +/** @var $cache \Magento\Framework\App\Cache */ +$cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); $cache->clean(array(\Magento\Core\Model\Design::CACHE_TAG)); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php b/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php index dbfc4c09dc1ad95c0728a5ee2aa64d6d22d77e73..852c2a3a65e0626010a2d5970a6b394dd5714cc8 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/layout_cache.php @@ -22,6 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var \Magento\App\Cache\Type\Layout $layoutCache */ -$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Cache\Type\Layout'); +/** @var \Magento\Framework\App\Cache\Type\Layout $layoutCache */ +$layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Cache\Type\Layout'); $layoutCache->save('fixture layout cache data', 'LAYOUT_CACHE_FIXTURE'); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php b/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php index 14503047369b9800b2bc69b719b6e89b0b4d21d8..9a7e37056bcfcf7fe9b90de59b0df9ff522956b8 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/layout_update.php @@ -27,7 +27,7 @@ /** @var $objectManager \Magento\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\App\AreaList') +$objectManager->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); /** @var $theme \Magento\View\Design\ThemeInterface */ diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change.php b/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change.php index 1d68e592624563276b617e266e45fc25bb7c378c..c522ca942abdeef4509e3f4a13854c6c3b043656 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change.php @@ -24,7 +24,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); $designDir = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppInstallDir() . '/media_for_change'; @@ -46,8 +46,8 @@ foreach ($files as $file) { $appInstallDir = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppInstallDir(); \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => "{$appInstallDir}/media_for_change") + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => "{$appInstallDir}/media_for_change") ) ) ); diff --git a/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change_rollback.php b/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change_rollback.php index 4f19184e4f2c275130c1248e1115fb48d40d5b5a..dfbab00fd749a6334d41fd387775baea2d994ce2 100644 --- a/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Core/_files/media_for_change_rollback.php @@ -30,8 +30,8 @@ $themeDirectory = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getApp \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::VAR_DIR => array('path' => $themeDirectory) + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::VAR_DIR => array('path' => $themeDirectory) ) ) ); @@ -39,8 +39,8 @@ $themeDirectory = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getApp $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var $directoryWrite \Magento\Filesystem\Directory\Write */ $directoryWrite = $objectManager->create( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); $directoryWrite->delete(); diff --git a/dev/tests/integration/testsuite/Magento/Cron/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Cron/Model/ObserverTest.php index e00fbd91cb3bcc1aefde18fd8f913266cf6b8332..58cc59034cd5a915e73ae0b51e45c139509b63d7 100644 --- a/dev/tests/integration/testsuite/Magento/Cron/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Cron/Model/ObserverTest.php @@ -32,7 +32,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea('crontab') ->load(\Magento\Core\Model\App\Area::PART_CONFIG); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Css/PreProcessor/CacheTest.php b/dev/tests/integration/testsuite/Magento/Css/PreProcessor/CacheTest.php index 91de5b4686491a3b3c0de078cb79e5724a6860c6..d8aa3bad4c709e0ab91a467f58f8800e4f3d54e2 100644 --- a/dev/tests/integration/testsuite/Magento/Css/PreProcessor/CacheTest.php +++ b/dev/tests/integration/testsuite/Magento/Css/PreProcessor/CacheTest.php @@ -51,8 +51,8 @@ class CacheTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::PUB_LIB_DIR => array('path' => __DIR__ . '/_files/cache/lib') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::PUB_LIB_DIR => array('path' => __DIR__ . '/_files/cache/lib') ) ) ); @@ -72,7 +72,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase array('filePath' => 'oyejorge.css', 'allowDuplication' => false, 'viewParams' => $this->getDesignParams()) ); - $targetDirectory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::TMP_DIR); + $targetDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::TMP_DIR); /** * cache was not initialize yet and return empty value @@ -113,7 +113,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase protected function clearCache() { /** @var \Magento\Filesystem\Directory\WriteInterface $mapsDirectory */ - $mapsDirectory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $mapsDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); if ($mapsDirectory->isDirectory(Storage::MAPS_DIR)) { $mapsDirectory->delete(Storage::MAPS_DIR); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php index 88e36b6fefb16d581180192da10d6d7ccbd97a56..103c77358bf0f7700bd711169a7780d4bbeb85f9 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Block\Account\Dashboard; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; @@ -51,7 +52,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase '', array('customerSession' => $this->_customerSession) ); - $this->objectManager->get('Magento\App\ViewInterface')->setIsLayoutLoaded(true); + $this->objectManager->get('Magento\Framework\App\ViewInterface')->setIsLayoutLoaded(true); } protected function tearDown() @@ -108,7 +109,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase public function getPrimaryShippingAddressHtmlDataProvider() { - $expected = "John Smith<br/>\n\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" + $expected = "John Smith<br/>\nCompanyName<br />\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" . "\nUnited States<br/>\nT: 3468676\n\n"; return array( @@ -135,7 +136,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase public function getPrimaryBillingAddressHtmlDataProvider() { - $expected = "John Smith<br/>\n\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" + $expected = "John Smith<br/>\nCompanyName<br />\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" . "\nUnited States<br/>\nT: 3468676\n\n"; return [ '0' => [0, 'You have not set a default billing address.'], diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/HelloTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/HelloTest.php index 5c9c39797ed7a763f1905025a3bd044d1414be7d..de5515f69081e0ce2ce5ae9d5375ffbb8302836b 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/HelloTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/HelloTest.php @@ -45,7 +45,7 @@ class HelloTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->customerSession = $objectManager->get('Magento\Customer\Model\Session'); $this->block = $objectManager->get( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php index 0e11e7ab7c17ed2da558ea39adc008bf5e47a2e0..a165b7927cc15f12e991f33936479b5508209381 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php @@ -65,6 +65,12 @@ class DashboardTest extends \PHPUnit_Framework_TestCase public function tearDown() { $this->customerSession->unsCustomerId(); + + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); } /** diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php index ddc4ca6d44a49c819d43112ade919cab863ae3e4..5fce18909b9504ee6ac3ec8af39b523fd8663cea 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Block\Address; use Magento\Customer\Service\V1\CustomerAccountServiceInterface; @@ -61,6 +62,15 @@ class BookTest extends \PHPUnit_Framework_TestCase ); } + protected function tearDown() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = $objectManager->get('Magento\Customer\Model\CustomerRegistry'); + // Cleanup customer from registry + $customerRegistry->remove(1); + } + public function testGetAddressEditUrl() { $this->assertEquals( @@ -127,7 +137,7 @@ class BookTest extends \PHPUnit_Framework_TestCase */ public function testGetAddressHtml() { - $expected = "John Smith<br/>\n\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" . + $expected = "John Smith<br/>\nCompanyName<br />\nGreen str, 67<br />\n\n\n\nCityM, Alabama, 75477<br/>" . "\nUnited States<br/>\nT: 3468676\n\n"; $address = Bootstrap::getObjectManager()->get( 'Magento\Customer\Service\V1\CustomerAddressServiceInterface' diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php index 33e147350f982f153d2e83eae4340b924f771776..8c4f6a07d62ed8e52500bb32df06ecd740e388f6 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php @@ -51,7 +51,7 @@ class EditTest extends \PHPUnit_Framework_TestCase $this->_requestId = $this->_context->getRequest()->getParam('id'); $this->_context->getRequest()->setParam('id', '1'); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); /** @var $layout \Magento\View\Layout */ $layout = $objectManager->get('Magento\View\LayoutInterface'); @@ -68,8 +68,19 @@ class EditTest extends \PHPUnit_Framework_TestCase protected function tearDown() { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_customerSession->unsCustomerId(); $this->_context->getRequest()->setParam('id', $this->_requestId); + /** @var \Magento\Customer\Model\AddressRegistry $addressRegistry */ + $addressRegistry = $objectManager->get('Magento\Customer\Model\AddressRegistry'); + //Cleanup address from registry + $addressRegistry->remove(1); + $addressRegistry->remove(2); + + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = $objectManager->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); } /** diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php index 1e7a77320ff6efde070f60a30432f3232adb49ad..5c298a5127570f6331c38f98ddd7a2581d25d3ed 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php @@ -79,6 +79,10 @@ class AccountTest extends \PHPUnit_Framework_TestCase public function tearDown() { $this->coreRegistry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID); + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = $this->objectManager->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); } /** diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 0912e070daf5b2476c0fd5097b58abcd41b2c7d3..46286e2e1ef219af62cba06cd17b93e2614f025a 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -51,7 +51,7 @@ class NewsletterTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->block = $objectManager->get( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/OrdersTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/OrdersTest.php index 8e45b32a60f619c4feae6bdc7addc940f8710ff2..f352126a8e11d91a8475cc1622f167ebc97a244d 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/OrdersTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/OrdersTest.php @@ -53,7 +53,7 @@ class OrdersTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, 1); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php index 9db71112bdd06773ade2fa60d17ac60d444036fc..b954b5edbe0014b74e678827f2e74d9be5171753 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/CartTest.php @@ -53,7 +53,7 @@ class CartTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, 1); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/OrdersTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/OrdersTest.php index 881d5a59fca09417b3aa7e3d3bcbc187e8a96193..20926c134844402942f225408cb06c7eca3cae46 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/OrdersTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/OrdersTest.php @@ -53,7 +53,7 @@ class OrdersTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, 1); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/SalesTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/SalesTest.php index eb280f3000da6a1f03880407fc33093933f42c57..9dd260a33ba6703c71f41d9511fa984a11a80b4c 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/SalesTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/SalesTest.php @@ -62,7 +62,7 @@ class SalesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, 1); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/ViewTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/ViewTest.php index 216bbc24b834b998bec2f6faf172e8545aa950bb..96396fcb46d5144bf631ea8a271baa4c65196c61 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/ViewTest.php @@ -32,6 +32,7 @@ use Magento\Customer\Service\V1\Data\CustomerBuilder; /** * Magento\Customer\Block\Adminhtml\Edit\Tab\View * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @magentoAppArea adminhtml */ class ViewTest extends \PHPUnit_Framework_TestCase @@ -54,27 +55,30 @@ class ViewTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Store\Model\StoreManagerInterface */ private $_storeManager; + /** @var \Magento\ObjectManager */ + private $_objectManager; + /** @var View */ private $_block; public function setUp() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->_storeManager = $objectManager->get('Magento\Store\Model\StoreManager'); - $this->_context = $objectManager->get( + $this->_storeManager = $this->_objectManager->get('Magento\Store\Model\StoreManager'); + $this->_context = $this->_objectManager->get( 'Magento\Backend\Block\Template\Context', array('storeManager' => $this->_storeManager) ); - $this->_customerBuilder = $objectManager->get('Magento\Customer\Service\V1\Data\CustomerBuilder'); - $this->_coreRegistry = $objectManager->get('Magento\Registry'); - $this->_customerAccountService = $objectManager->get( + $this->_customerBuilder = $this->_objectManager->get('Magento\Customer\Service\V1\Data\CustomerBuilder'); + $this->_coreRegistry = $this->_objectManager->get('Magento\Registry'); + $this->_customerAccountService = $this->_objectManager->get( 'Magento\Customer\Service\V1\CustomerAccountServiceInterface' ); - $this->_groupService = $objectManager->get('Magento\Customer\Service\V1\CustomerGroupServiceInterface'); + $this->_groupService = $this->_objectManager->get('Magento\Customer\Service\V1\CustomerGroupServiceInterface'); - $this->_block = $objectManager->get( + $this->_block = $this->_objectManager->get( 'Magento\View\LayoutInterface' )->createBlock( 'Magento\Customer\Block\Adminhtml\Edit\Tab\View', @@ -156,9 +160,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Stdlib\DateTime\TimezoneInterface $defaultTimeZonePath */ - $defaultTimeZonePath = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Stdlib\DateTime\TimezoneInterface' - )->getDefaultTimezonePath(); + $defaultTimeZonePath = $this->_objectManager->get('Magento\Stdlib\DateTime\TimezoneInterface') + ->getDefaultTimezonePath(); $timezone = $this->_context->getScopeConfig()->getValue( $defaultTimeZonePath, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, @@ -191,8 +194,12 @@ class ViewTest extends \PHPUnit_Framework_TestCase )->setEmail( 'email@email.com' )->create(); - $id = $this->_customerAccountService->saveCustomer($customer); - $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $id); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Service\V1\Data\CustomerDetailsBuilder $customerDetailsBuilder */ + $customerDetailsBuilder = $objectManager->create('Magento\Customer\Service\V1\Data\CustomerDetailsBuilder'); + $customerDetails = $customerDetailsBuilder->setCustomer($customer)->create(); + $customer = $this->_customerAccountService->createCustomer($customerDetails); + $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customer->getId()); $this->assertEquals('Confirmation Not Required', $this->_block->getIsConfirmedStatus()); } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/TabsTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/TabsTest.php index c1a1d56c6507471f55c590150381c7eaa9a54923..295c19d9258f00c2d87cd621fc30ec0e14186656 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/TabsTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/TabsTest.php @@ -69,7 +69,7 @@ class TabsTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->context = $objectManager->get('Magento\Backend\Block\Template\Context'); $this->customerAccountService = $objectManager->get( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/EditTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/EditTest.php index 484a1c49acb6d5d2a594a38129657808332606a2..abb4233ff68bfe8e4521720f6cb00c277a0441cf 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/EditTest.php @@ -61,7 +61,7 @@ class EditTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('adminhtml'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('adminhtml'); $this->coreRegistry = $objectManager->get('Magento\Registry'); $this->coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, self::$customerId); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/Edit/FormTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/Edit/FormTest.php index b919b5c8f1256e2320e49f50fbe239f9088fe746..abfe2f108427ef7ccc9993babfcda0504a0c4eec 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/Edit/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/Edit/FormTest.php @@ -28,7 +28,7 @@ use Magento\Backend\App\Area\FrontNameResolver; use Magento\Customer\Controller\RegistryConstants; use Magento\Customer\Service\V1\Data\CustomerGroup; use Magento\Service\V1\Data\FilterBuilder; -use Magento\Customer\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Service\V1\Data\SearchCriteriaBuilder; use Magento\TestFramework\Helper\Bootstrap; /** @@ -106,9 +106,10 @@ class FormTest extends \PHPUnit_Framework_TestCase */ public function testGetFormExistInCustomGroup() { + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteria */ $searchCriteria = Bootstrap::getObjectManager() - ->create('Magento\Customer\Service\V1\Data\SearchCriteriaBuilder') - ->addFilter((new FilterBuilder())->setField('code')->setValue('custom_group')->create())->create(); + ->create('Magento\Service\V1\Data\SearchCriteriaBuilder') + ->addFilter([(new FilterBuilder())->setField('code')->setValue('custom_group')->create()])->create(); /** @var CustomerGroup $customerGroup */ $customerGroup = $this->customerGroupService->searchGroups($searchCriteria)->getItems()[0]; $this->registry->register(RegistryConstants::CURRENT_GROUP_ID, $customerGroup->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/EditTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/EditTest.php index 3b2511b7ed35ccab61588766ee9ef2f38948ec30..392b0f104fbf9ee4e6f89f1465064dc83f668455 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Group/EditTest.php @@ -28,7 +28,7 @@ use Magento\Backend\App\Area\FrontNameResolver; use Magento\Customer\Controller\RegistryConstants; use Magento\Customer\Service\V1\Data\CustomerGroup; use Magento\Service\V1\Data\FilterBuilder; -use Magento\Customer\Service\V1\Data\SearchCriteriaBuilder; +use Magento\Service\V1\Data\SearchCriteriaBuilder; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\AbstractController; @@ -97,9 +97,10 @@ class EditTest extends AbstractController */ public function testDeleteButtonExistInCustomGroup() { + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchCriteria */ $searchCriteria = Bootstrap::getObjectManager() - ->create('Magento\Customer\Service\V1\Data\SearchCriteriaBuilder') - ->addFilter((new FilterBuilder())->setField('code')->setValue('custom_group')->create())->create(); + ->create('Magento\Service\V1\Data\SearchCriteriaBuilder') + ->addFilter([(new FilterBuilder())->setField('code')->setValue('custom_group')->create()])->create(); /** @var CustomerGroup $customerGroup */ $customerGroup = $this->customerGroupService->searchGroups($searchCriteria)->getItems()[0]; $this->getRequest()->setParam('id', $customerGroup->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/GenderTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/GenderTest.php index f9c7e2918400174a676ea7abb31c47333c8df42f..fb927f6e915771ab413d72d737d17119edc11f21 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/GenderTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/GenderTest.php @@ -40,7 +40,7 @@ class GenderTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->_block = $objectManager->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php index dda668b166865f70d296e59d5df97f67ff52c7ee..224d758f12a3b6923d45677ffc5ff196288f985c 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Widget/NameTest.php @@ -36,7 +36,7 @@ class NameTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->_block = $objectManager->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php index 27f83d53fd942aa152b9289fe481a9e3f67a7cb2..7515c4ea85500e852e6e20c5aa2fd657465ccb16 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php @@ -31,7 +31,6 @@ class AddressTest extends \Magento\TestFramework\TestCase\AbstractController protected function setUp() { parent::setUp(); - $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Customer\Model\Session', diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/AddressRegistryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..50d70c67cd547177dda1c5111ab17f1899388b76 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressRegistryTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Test for \Magento\Customer\Model\AddressRegistry + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +class AddressRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Model\AddressRegistry + */ + protected $_model; + + protected function setUp() + { + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\AddressRegistry'); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + */ + public function testRetrieve() + { + $addressId = 1; + $address = $this->_model->retrieve($addressId); + $this->assertInstanceOf('\Magento\Customer\Model\Address', $address); + $this->assertEquals($addressId, $address->getId()); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + */ + public function testRetrieveCached() + { + $addressId = 1; + $addressBeforeDeletion = $this->_model->retrieve($addressId); + $address2 = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\Address'); + $address2->load($addressId) + ->delete(); + $addressAfterDeletion = $this->_model->retrieve($addressId); + $this->assertEquals($addressBeforeDeletion, $addressAfterDeletion); + $this->assertInstanceOf('\Magento\Customer\Model\Address', $addressAfterDeletion); + $this->assertEquals($addressId, $addressAfterDeletion->getId()); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveException() + { + $addressId = 1; + $this->_model->retrieve($addressId); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRemove() + { + $addressId = 1; + $address = $this->_model->retrieve($addressId); + $this->assertInstanceOf('\Magento\Customer\Model\Address', $address); + $address->delete(); + $this->_model->remove($addressId); + $this->_model->retrieve($addressId); + } +} \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerRegistryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f47669a95e3c32ab4e7b73b545f51b42df0f0bb8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerRegistryTest.php @@ -0,0 +1,143 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +use Magento\Exception\NoSuchEntityException; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test for \Magento\Customer\Model\CustomerRegistry + */ +class CustomerRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Model\CustomerRegistry + */ + protected $_model; + + /**#@+ + * Data set in customer fixture + */ + const CUSTOMER_ID = 1; + const CUSTOMER_EMAIL = 'customer@example.com'; + const WEBSITE_ID = 1; + + /** + * Initialize SUT + */ + protected function setUp() + { + $this->_model = Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\CustomerRegistry'); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testRetrieve() + { + $customer = $this->_model->retrieve(self::CUSTOMER_ID); + $this->assertInstanceOf('\Magento\Customer\Model\Customer', $customer); + $this->assertEquals(self::CUSTOMER_ID, $customer->getId()); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testRetrieveByEmail() + { + $customer = $this->_model->retrieveByEmail('customer@example.com', self::WEBSITE_ID); + $this->assertInstanceOf('\Magento\Customer\Model\Customer', $customer); + $this->assertEquals(self::CUSTOMER_EMAIL, $customer->getEmail()); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoAppArea adminhtml + */ + public function testRetrieveCached() + { + //Setup customer in the id and email registries + $customerBeforeDeletion = $this->_model->retrieve(self::CUSTOMER_ID); + //Delete the customer from db + Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer')->load(self::CUSTOMER_ID)->delete(); + //Verify presence of Customer in registry + $this->assertEquals($customerBeforeDeletion, $this->_model->retrieve(self::CUSTOMER_ID)); + //Verify presence of Customer in email registry + $this->assertEquals($customerBeforeDeletion, $this->_model + ->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID)); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + * @expectedExceptionMessage No such entity with customerId = 1 + */ + public function testRetrieveException() + { + $this->_model->retrieve(self::CUSTOMER_ID); + } + + public function testRetrieveEmailException() + { + try { + $this->_model->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->fail("NoSuchEntityException was not thrown as expected."); + } catch (NoSuchEntityException $e) { + $expectedParams = [ + 'email' => 'customer@example.com', + 'websiteId' => '1', + ]; + $this->assertEquals($expectedParams, $e->getParams()); + } + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @expectedException \Magento\Exception\NoSuchEntityException + * @magentoAppArea adminhtml + */ + public function testRemove() + { + $customer = $this->_model->retrieve(self::CUSTOMER_ID); + $this->assertInstanceOf('\Magento\Customer\Model\Customer', $customer); + $customer->delete(); + $this->_model->remove(self::CUSTOMER_ID); + $this->_model->retrieve(self::CUSTOMER_ID); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @expectedException \Magento\Exception\NoSuchEntityException + * @magentoAppArea adminhtml + */ + public function testRemoveByEmail() + { + $customer = $this->_model->retrieve(self::CUSTOMER_ID); + $this->assertInstanceOf('\Magento\Customer\Model\Customer', $customer); + $customer->delete(); + $this->_model->removeByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->_model->retrieveByEmail(self::CUSTOMER_EMAIL, $customer->getWebsiteId()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/GroupRegistryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/GroupRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..53f4967b05d3fc9afdeafcf17524ec8643c420e4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/GroupRegistryTest.php @@ -0,0 +1,128 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +/** + * Test for \Magento\Customer\Model\GroupRegistry + */ +class GroupRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * The group code from the fixture data. + */ + const GROUP_CODE = 'custom_group'; + + /** + * @var \Magento\Customer\Model\GroupRegistry + */ + protected $_model; + + protected function setUp() + { + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\GroupRegistry'); + } + + /** + * Find the group with a given code. + * + * @param string $code + * @return int + */ + protected function _findGroupIdWithCode($code) + { + $groupService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Service\V1\CustomerGroupService'); + foreach ($groupService->getGroups() as $group) { + if ($group->getCode() === $code) { + return $group->getId(); + } + } + + return -1; + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer_group.php + */ + public function testRetrieve() + { + $groupId = $this->_findGroupIdWithCode(self::GROUP_CODE); + $group = $this->_model->retrieve($groupId); + $this->assertInstanceOf('\Magento\Customer\Model\Group', $group); + $this->assertEquals($groupId, $group->getId()); + } + + /** + * Ensure can retrieve group with id 0 which is a valid group ID. + */ + public function testRetrieveGroup0() + { + $groupId = 0; + $group = $this->_model->retrieve($groupId); + $this->assertInstanceOf('\Magento\Customer\Model\Group', $group); + $this->assertEquals($groupId, $group->getId()); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer_group.php + */ + public function testRetrieveCached() + { + $groupId = $this->_findGroupIdWithCode(self::GROUP_CODE); + $groupBeforeDeletion = $this->_model->retrieve($groupId); + $group2 = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\Group'); + $group2->load($groupId) + ->delete(); + $groupAfterDeletion = $this->_model->retrieve($groupId); + $this->assertEquals($groupBeforeDeletion, $groupAfterDeletion); + $this->assertInstanceOf('\Magento\Customer\Model\Group', $groupAfterDeletion); + $this->assertEquals($groupId, $groupAfterDeletion->getId()); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveException() + { + $groupId = $this->_findGroupIdWithCode(self::GROUP_CODE); + $this->_model->retrieve($groupId); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer_group.php + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRemove() + { + $groupId = $this->_findGroupIdWithCode(self::GROUP_CODE); + $group = $this->_model->retrieve($groupId); + $this->assertInstanceOf('\Magento\Customer\Model\Group', $group); + $group->delete(); + $this->_model->remove($groupId); + $this->_model->retrieve($groupId); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormFactoryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormFactoryTest.php index 09878c0707dfcab97f12f1b6dda11b7ebd5ee596..50cc43aa0fdbe5ac826c3e5c12e668588dd38415 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormFactoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormFactoryTest.php @@ -75,8 +75,8 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('\Magento\Customer\Model\Metadata\Form', $form); $this->assertNotEmpty($form->getAttributes()); - /** @var \Magento\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->get('Magento\App\RequestInterface'); + /** @var \Magento\Framework\App\RequestInterface $request */ + $request = Bootstrap::getObjectManager()->get('Magento\Framework\App\RequestInterface'); $request->setParams($this->_requestData); $this->assertEquals($this->_expectedData, $form->restoreData($form->extractData($request))); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php index 5825ff316ca8d5b065e0b1f6932e0671d39fa458..a74671b8dd0d4b4aa5590c39e50984f0e3704d21 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/FormTest.php @@ -35,7 +35,7 @@ class FormTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $_attributes; - /** @var \Magento\App\RequestInterface */ + /** @var \Magento\Framework\App\RequestInterface */ protected $_request; /** @var array */ @@ -90,7 +90,7 @@ class FormTest extends \PHPUnit_Framework_TestCase 'region_id' => 12, 'region' => 'California' ); - $this->_request = $objectManager->get('Magento\App\RequestInterface'); + $this->_request = $objectManager->get('Magento\Framework\App\RequestInterface'); $this->_request->setParams($requestData); $this->_expected = array_merge($this->_attributes, $requestData); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php index 9f0f439d26d2d2077fabf5cf5d99de09a54c47ce..31de9aebdee9582d6eb2a788c9261b6f01efa36a 100755 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php @@ -6,6 +6,7 @@ use Magento\Exception\InputException; use Magento\Exception\NoSuchEntityException; use Magento\Exception\StateException; use Magento\Service\V1\Data\FilterBuilder; +use Magento\Service\V1\Data\SearchCriteria; use Magento\TestFramework\Helper\Bootstrap; /** @@ -108,6 +109,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_expectedAddresses = [$address, $address2]; } + /** + * Clean up shared dependencies + */ + protected function tearDown() + { + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = $this->_objectManager->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); + } + /** * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php @@ -232,11 +244,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase try { $this->_customerAccountService->activateCustomer('1234' . $customerModel->getId(), $key); $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'customerId' => '12341', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -315,11 +327,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase try { $this->_customerAccountService->validateResetPasswordLinkToken(4200, $resetToken); $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'customerId' => '4200', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -352,7 +364,18 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase { $email = 'customer@example.com'; - $this->_customerAccountService->initiatePasswordReset($email, 1, CustomerAccountServiceInterface::EMAIL_RESET); + $this->_customerAccountService->initiatePasswordReset($email, CustomerAccountServiceInterface::EMAIL_RESET, 1); + } + + /** + * @magentoAppArea frontend + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testSendPasswordResetLinkDefaultWebsite() + { + $email = 'customer@example.com'; + + $this->_customerAccountService->initiatePasswordReset($email, CustomerAccountServiceInterface::EMAIL_RESET); } /** @@ -364,14 +387,37 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $email = 'foo@example.com'; try { - $this->_customerAccountService->initiatePasswordReset($email, 0, - CustomerAccountServiceInterface::EMAIL_RESET); + $this->_customerAccountService->initiatePasswordReset( + $email, + CustomerAccountServiceInterface::EMAIL_RESET, + 0 + ); $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'email' => $email, 'websiteId' => 0, ]; + $this->assertEquals($expectedParams, $e->getParams()); + } + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * + */ + public function testSendPasswordResetLinkBadEmailDefaultWebsite() + { + $email = 'foo@example.com'; + + try { + $this->_customerAccountService->initiatePasswordReset( + $email, + CustomerAccountServiceInterface::EMAIL_RESET + ); + $this->fail('Expected exception not thrown.'); + } catch (NoSuchEntityException $nsee) { + $expectedParams = array('email' => $email, 'websiteId' => 1); $this->assertEquals($expectedParams, $nsee->getParams()); } } @@ -443,11 +489,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase try { $this->_customerAccountService->resetPassword(4200, $resetToken, $password); $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'customerId' => '4200', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -497,12 +543,12 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase { try { $this->_customerAccountService->resendConfirmation('customer@needAconfirmation.com', 'notAWebsiteId'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'email' => 'customer@needAconfirmation.com', 'websiteId' => 'notAWebsiteId', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -514,12 +560,12 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase try { $this->_customerAccountService->resendConfirmation('wrongemail@example.com', 1); $this->fail('Expected exception not thrown.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'email' => 'wrongemail@example.com', 'websiteId' => '1', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -637,7 +683,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php */ - public function testSaveCustomer() + public function testUpdateCustomer() { $existingCustId = 1; @@ -657,19 +703,15 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase )); $this->_customerBuilder->populateWithArray($customerData); $modifiedCustomer = $this->_customerBuilder->create(); - - $returnedCustomerId = $this->_customerAccountService->saveCustomer($modifiedCustomer, 'aPassword'); - $this->assertEquals($existingCustId, $returnedCustomerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($modifiedCustomer)->create(); + $this->_customerAccountService->updateCustomer($customerDetails); $customerAfter = $this->_customerAccountService->getCustomer($existingCustId); $this->assertEquals($email, $customerAfter->getEmail()); $this->assertEquals($firstName, $customerAfter->getFirstname()); $this->assertEquals($lastname, $customerAfter->getLastname()); $this->assertEquals('Admin', $customerAfter->getCreatedIn()); - $this->_customerAccountService->authenticate( - $customerAfter->getEmail(), - 'aPassword', - true - ); + $passwordFromFixture = 'password'; + $this->_customerAccountService->authenticate($customerAfter->getEmail(), $passwordFromFixture); $attributesBefore = \Magento\Service\DataObjectConverter::toFlatArray($customerBefore); $attributesAfter = \Magento\Service\DataObjectConverter::toFlatArray($customerAfter); // ignore 'updated_at' @@ -696,7 +738,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php */ - public function testSaveCustomerWithoutChangingPassword() + public function testUpdateCustomerWithoutChangingPassword() { $existingCustId = 1; @@ -717,8 +759,8 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerBuilder->populateWithArray($customerData); $modifiedCustomer = $this->_customerBuilder->create(); - $returnedCustomerId = $this->_customerAccountService->saveCustomer($modifiedCustomer); - $this->assertEquals($existingCustId, $returnedCustomerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($modifiedCustomer)->create(); + $this->_customerAccountService->updateCustomer($customerDetails); $customerAfter = $this->_customerAccountService->getCustomer($existingCustId); $this->assertEquals($email, $customerAfter->getEmail()); $this->assertEquals($firstName, $customerAfter->getFirstname()); @@ -761,7 +803,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php */ - public function testSaveCustomerPasswordCannotSetThroughAttributeSetting() + public function testUpdateCustomerPasswordCannotSetThroughAttributeSetting() { $existingCustId = 1; @@ -782,9 +824,8 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerBuilder->populateWithArray($customerData); $modifiedCustomer = $this->_customerBuilder->create(); - - $returnedCustomerId = $this->_customerAccountService->saveCustomer($modifiedCustomer); - $this->assertEquals($existingCustId, $returnedCustomerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($modifiedCustomer)->create(); + $this->_customerAccountService->updateCustomer($customerDetails); $customerAfter = $this->_customerAccountService->getCustomer($existingCustId); $this->assertEquals($email, $customerAfter->getEmail()); $this->assertEquals($firstName, $customerAfter->getFirstname()); @@ -826,17 +867,13 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoDbIsolation enabled */ - public function testSaveCustomerException() + public function testCreateCustomerException() { - $customerData = [ - 'id' => 1, - 'password' => 'aPassword' - ]; - $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); try { - $this->_customerAccountService->saveCustomer($customerEntity); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); + $this->_customerAccountService->createCustomer($customerDetails); $this->fail('Expected exception not thrown'); } catch (InputException $ie) { $expectedParams = [ @@ -863,31 +900,31 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDbIsolation enabled */ - public function testSaveNonexistingCustomer() + public function testCreateNonexistingCustomer() { $existingCustId = 1; $existingCustomer = $this->_customerAccountService->getCustomer($existingCustId); - $newCustId = 2; $email = 'savecustomer@example.com'; $firstName = 'Firstsave'; $lastName = 'Lastsave'; $customerData = array_merge($existingCustomer->__toArray(), [ - 'id' => $newCustId, 'email' => $email, 'firstname' => $firstName, 'lastname' => $lastName, - 'created_in' => 'Admin' + 'created_in' => 'Admin', + 'id' => null ] ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); - $customerId = $this->_customerAccountService->saveCustomer($customerEntity, 'aPassword'); - $this->assertEquals($newCustId, $customerId); - $customerAfter = $this->_customerAccountService->getCustomer($customerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); + $customerAfter = $this->_customerAccountService->createCustomer($customerDetails, 'aPassword'); + $this->assertGreaterThan(0, $customerAfter->getId()); $this->assertEquals($email, $customerAfter->getEmail()); $this->assertEquals($firstName, $customerAfter->getFirstname()); $this->assertEquals($lastName, $customerAfter->getLastname()); @@ -930,7 +967,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoDbIsolation enabled */ - public function testSaveCustomerInServiceVsInModel() + public function testCreateCustomerInServiceVsInModel() { $email = 'email@example.com'; $email2 = 'email2@example.com'; @@ -959,9 +996,10 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ->setLastname($lastname) ->setGroupId($groupId); $newCustomerEntity = $this->_customerBuilder->create(); - $customerId = $this->_customerAccountService->saveCustomer($newCustomerEntity, $password); - $this->assertNotNull($customerId); - $savedCustomer = $this->_customerAccountService->getCustomer($customerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($newCustomerEntity)->create(); + $customerData = $this->_customerAccountService->createCustomer($customerDetails, $password); + $this->assertNotNull($customerData->getId()); + $savedCustomer = $this->_customerAccountService->getCustomer($customerData->getId()); $dataInService = \Magento\Service\DataObjectConverter::toFlatArray($savedCustomer); $expectedDifferences = ['created_at', 'updated_at', 'email', 'is_active', 'entity_id', 'entity_type_id', 'password_hash', 'attribute_set_id', 'disable_auto_group_change', 'confirmation', @@ -984,7 +1022,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoDbIsolation enabled */ - public function testSaveNewCustomer() + public function testCreateNewCustomer() { $email = 'email@example.com'; $storeId = 1; @@ -998,9 +1036,9 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ->setLastname($lastname) ->setGroupId($groupId); $newCustomerEntity = $this->_customerBuilder->create(); - $customerId = $this->_customerAccountService->saveCustomer($newCustomerEntity, 'aPassword'); - $this->assertNotNull($customerId); - $savedCustomer = $this->_customerAccountService->getCustomer($customerId); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($newCustomerEntity)->create(); + $savedCustomer = $this->_customerAccountService->createCustomer($customerDetails, 'aPassword'); + $this->assertNotNull($savedCustomer->getId()); $this->assertEquals($email, $savedCustomer->getEmail()); $this->assertEquals($storeId, $savedCustomer->getStoreId()); $this->assertEquals($firstname, $savedCustomer->getFirstname()); @@ -1013,7 +1051,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase * @magentoAppArea frontend * @magentoDataFixture Magento/Customer/_files/customer.php */ - public function testSaveNewCustomerFromClone() + public function testCreateNewCustomerFromClone() { $email = 'savecustomer@example.com'; $firstName = 'Firstsave'; @@ -1026,15 +1064,16 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase 'email' => $email, 'firstname' => $firstName, 'lastname' => $lastname, - 'created_in' => 'Admin' + 'created_in' => 'Admin', + 'id' => null ] ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); - $customerId = $this->_customerAccountService->saveCustomer($customerEntity, 'aPassword'); - $this->assertNotEmpty($customerId); - $customer = $this->_customerAccountService->getCustomer($customerId); + $customer = $this->_customerAccountService->createCustomer($customerDetails, 'aPassword'); + $this->assertNotEmpty($customer->getId()); $this->assertEquals($email, $customer->getEmail()); $this->assertEquals($firstName, $customer->getFirstname()); $this->assertEquals($lastname, $customer->getLastname()); @@ -1049,7 +1088,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoDbIsolation enabled */ - public function testSaveCustomerNewThenUpdateFirstName() + public function testCreateCustomerNewThenUpdateFirstName() { $email = 'first_last@example.com'; $storeId = 1; @@ -1063,13 +1102,16 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ->setLastname($lastname) ->setGroupId($groupId); $newCustomerEntity = $this->_customerBuilder->create(); - $customerId = $this->_customerAccountService->saveCustomer($newCustomerEntity, 'aPassword'); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($newCustomerEntity)->create(); + + $customer = $this->_customerAccountService->createCustomer($customerDetails, 'aPassword'); - $this->_customerBuilder->populate($this->_customerAccountService->getCustomer($customerId)); + $this->_customerBuilder->populate($customer); $this->_customerBuilder->setFirstname('Tested'); - $this->_customerAccountService->saveCustomer($this->_customerBuilder->create()); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($this->_customerBuilder->create())->create(); + $this->_customerAccountService->updateCustomer($customerDetails); - $customer = $this->_customerAccountService->getCustomer($customerId); + $customer = $this->_customerAccountService->getCustomer($customer->getId()); $this->assertEquals('Tested', $customer->getFirstname()); $this->assertEquals($lastname, $customer->getLastname()); @@ -1097,12 +1139,12 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase // No fixture, so customer with id 1 shouldn't exist, exception should be thrown $this->_customerAccountService->getCustomer(1); $this->fail('Did not throw expected exception.'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = [ 'customerId' => '1', ]; - $this->assertEquals($expectedParams, $nsee->getParams()); - $this->assertEquals('No such entity with customerId = 1', $nsee->getMessage()); + $this->assertEquals($expectedParams, $e->getParams()); + $this->assertEquals('No such entity with customerId = 1', $e->getMessage()); } } @@ -1132,7 +1174,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @param \Magento\Service\V1\Data\Filter[] $filters - * @param \Magento\Service\V1\Data\Filter[] $orGroup + * @param \Magento\Service\V1\Data\Filter[] $filterGroup * @param array $expectedResult array of expected results indexed by ID * * @dataProvider searchCustomersDataProvider @@ -1140,16 +1182,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase * @magentoDataFixture Magento/Customer/_files/three_customers.php * @magentoDbIsolation enabled */ - public function testSearchCustomers($filters, $orGroup, $expectedResult) + public function testSearchCustomers($filters, $filterGroup, $expectedResult) { + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = Bootstrap::getObjectManager()->create( - 'Magento\Customer\Service\V1\Data\SearchCriteriaBuilder' + 'Magento\Service\V1\Data\SearchCriteriaBuilder' ); foreach ($filters as $filter) { - $searchBuilder->addFilter($filter); + $searchBuilder->addFilter([$filter]); } - if (!is_null($orGroup)) { - $searchBuilder->addOrGroup($orGroup); + if (!is_null($filterGroup)) { + $searchBuilder->addFilter($filterGroup); } $searchResults = $this->_customerAccountService->searchCustomers($searchBuilder->create()); @@ -1214,17 +1257,18 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ public function testSearchCustomersOrder() { + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = Bootstrap::getObjectManager() - ->create('Magento\Customer\Service\V1\Data\SearchCriteriaBuilder'); + ->create('Magento\Service\V1\Data\SearchCriteriaBuilder'); // Filter for 'firstname' like 'First' $filterBuilder = new FilterBuilder(); $firstnameFilter = $filterBuilder-> setField('firstname')->setConditionType('like')->setValue('First%')->create(); - $searchBuilder->addFilter($firstnameFilter); + $searchBuilder->addFilter([$firstnameFilter]); // Search ascending order - $searchBuilder->addSortOrder('lastname', Data\SearchCriteria::SORT_ASC); + $searchBuilder->addSortOrder('lastname', SearchCriteria::SORT_ASC); $searchResults = $this->_customerAccountService->searchCustomers($searchBuilder->create()); $this->assertEquals(3, $searchResults->getTotalCount()); $this->assertEquals('Lastname', $searchResults->getItems()[0]->getCustomer()->getLastname()); @@ -1232,7 +1276,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Lastname3', $searchResults->getItems()[2]->getCustomer()->getLastname()); // Search descending order - $searchBuilder->addSortOrder('lastname', Data\SearchCriteria::SORT_DESC); + $searchBuilder->addSortOrder('lastname', SearchCriteria::SORT_DESC); $searchResults = $this->_customerAccountService->searchCustomers($searchBuilder->create()); $this->assertEquals('Lastname3', $searchResults->getItems()[0]->getCustomer()->getLastname()); $this->assertEquals('Lastname2', $searchResults->getItems()[1]->getCustomer()->getLastname()); @@ -1331,12 +1375,18 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @magentoDataFixture Magento/Customer/_files/customer.php - * @expectedException \Magento\Model\Exception - * @expectedExceptionMessage Customer website ID must be specified when using the website scope */ public function testIsEmailAvailableNoWebsiteSpecified() { - $this->_customerAccountService->isEmailAvailable('customer@example.com', null); + $this->assertFalse($this->_customerAccountService->isEmailAvailable('customer@example.com')); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testIsEmailAvailableNoWebsiteSpecifiedNonExistent() + { + $this->assertTrue($this->_customerAccountService->isEmailAvailable('nonexistent@example.com')); } public function testIsEmailAvailableNonExistentEmail() diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php index bbbcd6ef4f377563e927f348ae9e3e4a89d22da5..92483a5b09fc35d8085583f598455125adfa6880 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1; use Magento\Exception\InputException; @@ -59,64 +60,55 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $this->_addressBuilder = $this->_objectManager->create('Magento\Customer\Service\V1\Data\AddressBuilder'); $this->_customerBuilder = $this->_objectManager->create('Magento\Customer\Service\V1\Data\CustomerBuilder'); - $this->_addressBuilder->setId( - 1 - )->setCountryId( - 'US' - )->setCustomerId( - 1 - )->setDefaultBilling( - true - )->setDefaultShipping( - true - )->setPostcode( - '75477' - )->setRegion( - (new V1\Data\RegionBuilder())->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)->create() - )->setStreet( - array('Green str, 67') - )->setTelephone( - '3468676' - )->setCity( - 'CityM' - )->setFirstname( - 'John' - )->setLastname( - 'Smith' - ); + $region = (new \Magento\Customer\Service\V1\Data\RegionBuilder()) + ->setRegionCode('AL') + ->setRegion('Alabama') + ->setRegionId(1) + ->create(); + $this->_addressBuilder + ->setId(1) + ->setCountryId('US') + ->setCustomerId(1) + ->setDefaultBilling(true) + ->setDefaultShipping(true) + ->setPostcode('75477') + ->setRegion($region) + ->setStreet(array('Green str, 67')) + ->setTelephone('3468676') + ->setCity('CityM') + ->setFirstname('John') + ->setLastname('Smith') + ->setCompany('CompanyName'); $address = $this->_addressBuilder->create(); /* XXX: would it be better to have a clear method for this? */ - $this->_addressBuilder->setId( - 2 - )->setCountryId( - 'US' - )->setCustomerId( - 1 - )->setDefaultBilling( - false - )->setDefaultShipping( - false - )->setPostcode( - '47676' - )->setRegion( - (new V1\Data\RegionBuilder())->setRegionCode('AL')->setRegion('Alabama')->setRegionId(1)->create() - )->setStreet( - array('Black str, 48') - )->setCity( - 'CityX' - )->setTelephone( - '3234676' - )->setFirstname( - 'John' - )->setLastname( - 'Smith' - ); + $this->_addressBuilder + ->setId(2) + ->setCountryId('US') + ->setCustomerId(1) + ->setDefaultBilling(false) + ->setDefaultShipping(false) + ->setPostcode('47676') + ->setRegion($region) + ->setStreet(array('Black str, 48')) + ->setCity('CityX') + ->setTelephone('3234676') + ->setFirstname('John') + ->setLastname('Smith'); + $address2 = $this->_addressBuilder->create(); $this->_expectedAddresses = array($address, $address2); } + protected function tearDown() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\AddressRegistry $addressRegistry */ + $customerRegistry = $objectManager->get('Magento\Customer\Model\CustomerRegistry'); + $customerRegistry->remove(1); + } + /** * @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/Customer/_files/customer_address.php @@ -481,10 +473,12 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase try { $this->_service->saveAddresses(4200, array($proposedAddress)); $this->fail('Expected exception not thrown'); - } catch (NoSuchEntityException $nsee) { - $expectedParams = array('customerId' => '4200'); - $this->assertEquals($expectedParams, $nsee->getParams()); - $this->assertEquals('No such entity with customerId = 4200', $nsee->getMessage()); + } catch (NoSuchEntityException $e) { + $expectedParams = [ + 'customerId' => '4200', + ]; + $this->assertEquals($expectedParams, $e->getParams()); + $this->assertEquals('No such entity with customerId = 4200', $e->getMessage()); } } @@ -494,10 +488,10 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase try { $this->_service->saveAddresses('this_is_not_a_valid_id', array($proposedAddress)); $this->fail('Expected exception not thrown'); - } catch (NoSuchEntityException $nsee) { + } catch (NoSuchEntityException $e) { $expectedParams = array('customerId' => 'this_is_not_a_valid_id'); - $this->assertEquals($expectedParams, $nsee->getParams()); - $this->assertEquals('No such entity with customerId = this_is_not_a_valid_id', $nsee->getMessage()); + $this->assertEquals($expectedParams, $e->getParams()); + $this->assertEquals('No such entity with customerId = this_is_not_a_valid_id', $e->getMessage()); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerGroupServiceTest.php b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerGroupServiceTest.php index ce02c72fd0d329dddf55eed411da93950fdf0d1b..3fad12043f2f87b240036b37cb3a8b0536e02c65 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerGroupServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Service/V1/CustomerGroupServiceTest.php @@ -25,9 +25,12 @@ */ namespace Magento\Customer\Service\V1; +use Magento\Customer\Service\V1\Data\CustomerGroup; use Magento\Service\V1\Data\FilterBuilder; +use Magento\Store\Model\ScopeInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\Service\V1\Data\Filter; +use Magento\Customer\Model\Group; class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase { @@ -44,7 +47,7 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_objectManager = Bootstrap::getObjectManager(); $this->_groupService = $this->_objectManager->get('Magento\Customer\Service\V1\CustomerGroupServiceInterface'); } @@ -60,7 +63,7 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase public static function tearDownAfterClass() { /** @var \Magento\Customer\Service\V1\CustomerGroupServiceInterface $customerGroupService */ - $customerGroupService = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $customerGroupService = Bootstrap::getObjectManager()->get( 'Magento\Customer\Service\V1\CustomerGroupServiceInterface' ); foreach ($customerGroupService->getGroups() as $group) { @@ -120,10 +123,10 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase */ public function testGetGroup($testGroup) { - $group = $this->_groupService->getGroup($testGroup['id']); - $this->assertEquals($testGroup['id'], $group->getId()); - $this->assertEquals($testGroup['code'], $group->getCode()); - $this->assertEquals($testGroup['tax_class_id'], $group->getTaxClassId()); + $group = $this->_groupService->getGroup($testGroup[CustomerGroup::ID]); + $this->assertEquals($testGroup[CustomerGroup::ID], $group->getId()); + $this->assertEquals($testGroup[CustomerGroup::CODE], $group->getCode()); + $this->assertEquals($testGroup[CustomerGroup::TAX_CLASS_ID], $group->getTaxClassId()); } /** @@ -131,10 +134,10 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase */ public function getGroupsDataProvider() { - return [ [['id' => 0, 'code' => 'NOT LOGGED IN', 'tax_class_id' => 3]], - [['id' => 1, 'code' => 'General', 'tax_class_id' => 3]], - [['id' => 2, 'code' => 'Wholesale', 'tax_class_id' => 3]], - [['id' => 3, 'code' => 'Retailer', 'tax_class_id' => 3]], + return [ [[CustomerGroup::ID => 0, CustomerGroup::CODE => 'NOT LOGGED IN', CustomerGroup::TAX_CLASS_ID => 3]], + [[CustomerGroup::ID => 1, CustomerGroup::CODE => 'General', CustomerGroup::TAX_CLASS_ID => 3]], + [[CustomerGroup::ID => 2, CustomerGroup::CODE => 'Wholesale', CustomerGroup::TAX_CLASS_ID => 3]], + [[CustomerGroup::ID => 3, CustomerGroup::CODE => 'Retailer', CustomerGroup::TAX_CLASS_ID => 3]], ]; } @@ -170,30 +173,83 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase $this->assertEquals($updates->getTaxClassId(), $updatedGroup->getTaxClassId()); } + + /** + * @param $testGroup + * @param $storeId + * + * @dataProvider getDefaultGroupDataProvider + */ + public function testGetDefaultGroupWithStoreId($testGroup, $storeId) + { + $this->assertDefaultGroupMatches($testGroup, $storeId); + } + + + /** + * @return array + * + */ + public function getDefaultGroupDataProvider() + { + /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ + $storeManager = Bootstrap::getObjectManager()->get('Magento\Store\Model\StoreManagerInterface'); + $defaultStoreId = $storeManager->getStore()->getId(); + return [ + 'no store id' => [['id' => 1, 'code' => 'General', 'tax_class_id' => 3], null], + 'default store id' => [['id' => 1, 'code' => 'General', 'tax_class_id' => 3], $defaultStoreId], + ]; + } + + /** + * @magentoDataFixture Magento/Core/_files/second_third_store.php + */ + public function testGetDefaultGroupWithNonDefaultStoreId() + { /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ + $storeManager = Bootstrap::getObjectManager()->get('Magento\Store\Model\StoreManagerInterface'); + $nonDefaultStore = $storeManager->getStore('secondstore'); + $nonDefaultStoreId = $nonDefaultStore->getId(); + /** @var \Magento\Framework\App\MutableScopeConfig $scopeConfig */ + $scopeConfig = $this->_objectManager->get('Magento\Framework\App\MutableScopeConfig'); + $scopeConfig->setValue(Group::XML_PATH_DEFAULT_ID, 2, ScopeInterface::SCOPE_STORE, 'secondstore'); + $testGroup = ['id' => 2, 'code' => 'Wholesale', 'tax_class_id' => 3]; + $this->assertDefaultGroupMatches($testGroup, $nonDefaultStoreId); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testGetDefaultGroupWithInvalidStoreId() + { + $storeId = 1234567; + $this->_groupService->getDefaultGroup($storeId); + } + /** * @param Filter[] $filters - * @param Filter[] $orGroup + * @param Filter[] $filterGroup * @param array $expectedResult array of expected results indexed by ID * * @dataProvider searchGroupsDataProvider */ - public function testSearchGroups($filters, $orGroup, $expectedResult) + public function testSearchGroups($filters, $filterGroup, $expectedResult) { + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = Bootstrap::getObjectManager() - ->create('Magento\Customer\Service\V1\Data\SearchCriteriaBuilder'); + ->create('Magento\Service\V1\Data\SearchCriteriaBuilder'); foreach ($filters as $filter) { - $searchBuilder->addFilter($filter); + $searchBuilder->addFilter([$filter]); } - if (!is_null($orGroup)) { - $searchBuilder->addOrGroup($orGroup); + if (!is_null($filterGroup)) { + $searchBuilder->addFilter($filterGroup); } $searchResults = $this->_groupService->searchGroups($searchBuilder->create()); - /** @var $item Data\CustomerGroup*/ + /** @var $item Data\CustomerGroup */ foreach ($searchResults->getItems() as $item) { - $this->assertEquals($expectedResult[$item->getId()]['code'], $item->getCode()); - $this->assertEquals($expectedResult[$item->getId()]['tax_class_id'], $item->getTaxClassId()); + $this->assertEquals($expectedResult[$item->getId()][CustomerGroup::CODE], $item->getCode()); + $this->assertEquals($expectedResult[$item->getId()][CustomerGroup::TAX_CLASS_ID], $item->getTaxClassId()); unset($expectedResult[$item->getId()]); } } @@ -202,38 +258,53 @@ class CustomerGroupServiceTest extends \PHPUnit_Framework_TestCase { return [ 'eq' => [ - [(new FilterBuilder())->setField('code')->setValue('General')->create()], + [(new FilterBuilder())->setField(CustomerGroup::CODE)->setValue('General')->create()], null, - [1 => ['code' => 'General', 'tax_class_id' => 3]] + [1 => [CustomerGroup::CODE => 'General', CustomerGroup::TAX_CLASS_ID => 3]] ], 'and' => [ [ - (new FilterBuilder())->setField('code')->setValue('General')->create(), - (new FilterBuilder())->setField('tax_class_id')->setValue('3')->create(), - (new FilterBuilder())->setField('id')->setValue('1')->create(), + (new FilterBuilder())->setField(CustomerGroup::CODE)->setValue('General')->create(), + (new FilterBuilder())->setField(CustomerGroup::TAX_CLASS_ID)->setValue('3')->create(), + (new FilterBuilder())->setField(CustomerGroup::ID)->setValue('1')->create(), ], [], - [1 => ['code' => 'General', 'tax_class_id' => 3]] + [1 => [CustomerGroup::CODE => 'General', CustomerGroup::TAX_CLASS_ID => 3]] ], 'or' => [ [], [ - (new FilterBuilder())->setField('code')->setValue('General')->create(), - (new FilterBuilder())->setField('code')->setValue('Wholesale')->create(), + (new FilterBuilder())->setField(CustomerGroup::CODE)->setValue('General')->create(), + (new FilterBuilder())->setField(CustomerGroup::CODE)->setValue('Wholesale')->create(), ], [ - 1 => ['code' => 'General', 'tax_class_id' => 3], - 2 => ['code' => 'Wholesale', 'tax_class_id' => 3] + 1 => [CustomerGroup::CODE => 'General', CustomerGroup::TAX_CLASS_ID => 3], + 2 => [CustomerGroup::CODE => 'Wholesale', CustomerGroup::TAX_CLASS_ID => 3] ] ], 'like' => [ - [(new FilterBuilder())->setField('code')->setValue('er')->setConditionType('like')->create()], + [ + (new FilterBuilder())->setField(CustomerGroup::CODE)->setValue('er')->setConditionType('like') + ->create() + ], [], [ - 1 => ['code' => 'General', 'tax_class_id' => 3], - 3 => ['code' => 'Retailer', 'tax_class_id' => 3] + 1 => [CustomerGroup::CODE => 'General', CustomerGroup::TAX_CLASS_ID => 3], + 3 => [CustomerGroup::CODE => 'Retailer', CustomerGroup::TAX_CLASS_ID => 3] ] ], ]; } + + /** + * @param $testGroup + * @param $storeId + */ + private function assertDefaultGroupMatches($testGroup, $storeId) + { + $group = $this->_groupService->getDefaultGroup($storeId); + $this->assertEquals($testGroup['id'], $group->getId()); + $this->assertEquals($testGroup['code'], $group->getCode()); + $this->assertEquals($testGroup['tax_class_id'], $group->getTaxClassId()); + } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address.php index 1836ecf7baade44fa730cc7c9471630d40773438..9bf3f77d90d4ba2dcfeade341004632b1c447303 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_address.php @@ -36,6 +36,7 @@ $customerAddress->setData( 'postcode' => 75477, 'country_id' => 'US', 'city' => 'CityM', + 'company' => 'CompanyName', 'street' => array('Green str, 67'), 'lastname' => 'Smith', 'firstname' => 'John', @@ -46,3 +47,7 @@ $customerAddress->setData( 1 ); $customerAddress->save(); + +/** @var \Magento\Customer\Model\Customer $customer */ +$customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer'); +$customer->load(1)->save(); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_two_addresses.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_two_addresses.php index 03d6b38f91fd1749b35ef6d592b263e81e2f8045..d3785e8ff9fac3925b1a3a0053e187b46b1cde05 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_two_addresses.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_two_addresses.php @@ -27,9 +27,8 @@ require 'customer_address.php'; /** @var \Magento\Customer\Model\Address $customerAddress */ -$customerAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Customer\Model\Address' -); +$customerAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Customer\Model\Address'); $customerAddress->isObjectNew(true); $customerAddress->setData( array( @@ -49,3 +48,4 @@ $customerAddress->setData( 1 ); $customerAddress->save(); + diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/three_customers.php b/dev/tests/integration/testsuite/Magento/Customer/_files/three_customers.php index 2850f524b626ea9de3de7a74f7be26ac743f14f5..bc369324e549a043b609e14ebd67e5ba85266704 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/three_customers.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/three_customers.php @@ -23,100 +23,55 @@ */ $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer'); /** @var Magento\Customer\Model\Customer $customer */ -$customer->setWebsiteId( - 1 -)->setId( - 1 -)->setEntityTypeId( - 1 -)->setAttributeSetId( - 1 -)->setEmail( - 'customer@search.example.com' -)->setPassword( - 'password' -)->setGroupId( - 1 -)->setStoreId( - 1 -)->setIsActive( - 1 -)->setFirstname( - 'Firstname' -)->setLastname( - 'Lastname' -)->setDefaultBilling( - 1 -)->setDefaultShipping( - 1 -)->setCreatedAt( - '2014-02-28 15:52:26' -); +$customer->setWebsiteId(1) + ->setId(1) + ->setEntityTypeId(1) + ->setAttributeSetId(1) + ->setEmail('customer@search.example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('Firstname') + ->setLastname('Lastname') + ->setDefaultBilling(1) + ->setDefaultShipping(1) + ->setCreatedAt('2014-02-28 15:52:26'); $customer->isObjectNew(true); $customer->save(); $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer'); -$customer->setWebsiteId( - 1 -)->setEntityId( - 2 -)->setEntityTypeId( - 1 -)->setAttributeSetId( - 0 -)->setEmail( - 'customer2@search.example.com' -)->setPassword( - 'password' -)->setGroupId( - 1 -)->setStoreId( - 1 -)->setIsActive( - 1 -)->setFirstname( - 'Firstname2' -)->setLastname( - 'Lastname2' -)->setDefaultBilling( - 1 -)->setDefaultShipping( - 1 -)->setCreatedAt( - '2010-02-28 15:52:26' -); +$customer->setWebsiteId(1) + ->setEntityId(2) + ->setEntityTypeId(1) + ->setAttributeSetId(0) + ->setEmail('customer2@search.example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('Firstname2') + ->setLastname('Lastname2') + ->setDefaultBilling(2) + ->setDefaultShipping(2) + ->setCreatedAt('2010-02-28 15:52:26'); $customer->isObjectNew(true); $customer->save(); $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Customer\Model\Customer'); -$customer->setWebsiteId( - 1 -)->setEntityId( - 3 -)->setEntityTypeId( - 1 -)->setAttributeSetId( - 0 -)->setEmail( - 'customer3@search.example.com' -)->setPassword( - 'password' -)->setGroupId( - 1 -)->setStoreId( - 1 -)->setIsActive( - 1 -)->setFirstname( - 'Firstname3' -)->setLastname( - 'Lastname3' -)->setDefaultBilling( - 1 -)->setDefaultShipping( - 1 -)->setCreatedAt( - '2012-02-28 15:52:26' -); +$customer->setWebsiteId(1) + ->setEntityId(3) + ->setEntityTypeId(1) + ->setAttributeSetId(0) + ->setEmail('customer3@search.example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('Firstname3') + ->setLastname('Lastname3') + ->setDefaultBilling(3) + ->setDefaultShipping(3) + ->setCreatedAt('2012-02-28 15:52:26'); $customer->isObjectNew(true); $customer->save(); diff --git a/dev/tests/integration/testsuite/Magento/DB/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Magento/DB/Adapter/Pdo/MysqlTest.php index 026971a57df4c167d0663dccf37e2c7b810fe8e8..832b76dae910aacc2de56ff081721c2f79cc76c2 100644 --- a/dev/tests/integration/testsuite/Magento/DB/Adapter/Pdo/MysqlTest.php +++ b/dev/tests/integration/testsuite/Magento/DB/Adapter/Pdo/MysqlTest.php @@ -132,8 +132,8 @@ class MysqlTest extends \PHPUnit_Framework_TestCase protected function _getDbAdapter() { if (is_null($this->_dbAdapter)) { - /** @var $coreResource \Magento\App\Resource */ - $coreResource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + /** @var $coreResource \Magento\Framework\App\Resource */ + $coreResource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); $this->_dbAdapter = $coreResource->getConnection('default_setup'); } return $this->_dbAdapter; diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php index 788bf0a7eabf80e61b72e49b8818727d6b15669a..afbee750b8d2f4105cc6b51695a1a2034a2546a4 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Config/QuickStylesTest.php @@ -49,12 +49,12 @@ class QuickStylesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem\DirectoryList $directoryList */ - $directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); + /** @var \Magento\Framework\App\Filesystem\DirectoryList $directoryList */ + $directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); $path = str_replace($directoryList->getRoot(), '', str_replace('\\', '/', __DIR__) . '/../_files/design'); - $directoryList->addDirectory(\Magento\App\Filesystem::THEMES_DIR, array('path' => ltrim($path, '/'))); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::THEMES_DIR, array('path' => ltrim($path, '/'))); $this->_design = $objectManager->get('Magento\View\DesignInterface'); - $objectManager->get('Magento\App\State')->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); + $objectManager->get('Magento\Framework\App\State')->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); $this->_design->setDesignTheme('vendor_test'); $this->_viewFileSystem = $objectManager->get('Magento\View\FileSystem'); $quickStylesPath = $this->_viewFileSystem->getFilename('Magento_DesignEditor::controls/quick_styles.xml'); diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Editor/Tools/Controls/ConfigurationTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Editor/Tools/Controls/ConfigurationTest.php index 529969439708679ef2c9bdf5fde9b67fd721a9b6..d7dffa237a9c5916dccea8c4867e89c1bf9baca9 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Editor/Tools/Controls/ConfigurationTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Editor/Tools/Controls/ConfigurationTest.php @@ -44,7 +44,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); + $objectManager->get('Magento\Framework\App\State')->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); $this->_design = $objectManager->get('Magento\View\DesignInterface'); $this->_design->setDesignTheme('vendor_test_child'); $this->_configFactory = $objectManager->create('Magento\DesignEditor\Model\Editor\Tools\Controls\Factory'); @@ -60,18 +60,18 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase public function testLoadConfigurations($type, $controlName, $controlData) { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $relativePath = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryRead( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->getRelativePath( __DIR__ . '/../../../_files/design' ); - /** @var \Magento\App\Filesystem\DirectoryList $directoryList */ - $directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); - $directoryList->addDirectory(\Magento\App\Filesystem::ROOT_DIR, array('path' => $relativePath)); - $directoryList->addDirectory(\Magento\App\Filesystem::THEMES_DIR, array('path' => $relativePath)); + /** @var \Magento\Framework\App\Filesystem\DirectoryList $directoryList */ + $directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::ROOT_DIR, array('path' => $relativePath)); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::THEMES_DIR, array('path' => $relativePath)); $designTheme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->getDesignTheme(); diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Translate/InlineTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Translate/InlineTest.php index e68347494e1c3407aa534730110521371ab9e19b..e07c09f8c0b482229e20c42319c33db547251e4c 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Translate/InlineTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/Translate/InlineTest.php @@ -34,7 +34,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -45,7 +45,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDesignTheme( @@ -58,7 +59,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_model = $objectManager->get('Magento\DesignEditor\Model\Translate\Inline'); - $this->_request = $objectManager->get('Magento\App\RequestInterface'); + $this->_request = $objectManager->get('Magento\Framework\App\RequestInterface'); $this->_request->setParam('translation_mode', 'text'); $this->_helperData = $objectManager->get('Magento\DesignEditor\Helper\Data'); @@ -68,7 +69,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase public function testObjectCreation() { $this->assertInstanceOf('Magento\DesignEditor\Model\Translate\Inline', $this->_model); - $this->assertInstanceOf('Magento\App\RequestInterface', $this->_request); + $this->assertInstanceOf('Magento\Framework\App\RequestInterface', $this->_request); $this->assertInstanceOf('Magento\DesignEditor\Helper\Data', $this->_helperData); } diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/_files/design/themes.php index f93fc4b0bfe4a79e7a3aad1a6e1e477b2194f5ca..131b0beb3c253dc51b344e9a885cb1950087ba85 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/_files/design/themes.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/_files/design/themes.php @@ -27,16 +27,16 @@ \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/design') ) ) ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\App\State') + ->get('Magento\Framework\App\State') ->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php index eb98cdb54a9cdc5cfe2d92144462266824b581e9..60219fe2f6f238fab43d9c04b67e944a27199c16 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php @@ -107,8 +107,10 @@ class FilterTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => dirname(__DIR__) . '/_files/design' + ) ) ) ); @@ -127,7 +129,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase $collection = $objectManager->create('Magento\Core\Model\Resource\Theme\Collection'); $themeId = $collection->getThemeByFullPath('frontend/test_default')->getId(); $objectManager->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\View\DesignInterface::XML_PATH_THEME_ID, $themeId, diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index 37641617f6b675280898b02b0edda8f3bfcc161b..cca3b679a911114a0b3c3a3af37db962647fa7f5 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -57,15 +57,15 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Registry'), $objectManager->get('Magento\Core\Model\App\Emulation'), $objectManager->get('Magento\Store\Model\StoreManager'), - $objectManager->create('Magento\App\Filesystem'), + $objectManager->create('Magento\Framework\App\Filesystem'), $objectManager->create('Magento\View\Url'), $objectManager->create('Magento\View\FileSystem'), - $objectManager->create('Magento\App\Config\ScopeConfigInterface'), + $objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\Email\Model\Template\FilterFactory'), $objectManager->get('Magento\Email\Model\Template\Config') ) )->getMock(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->_model->expects($this->any())->method('_getMail')->will($this->returnCallback(array($this, 'getMail'))); $this->_model->setSenderName('sender')->setSenderEmail('sender@example.com')->setTemplateSubject('Subject'); } @@ -115,7 +115,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetProcessedTemplate() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Core\Model\App\Area::AREA_FRONTEND )->load(); @@ -147,7 +147,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase ); $theme->load('Magento/plushe', 'theme_path'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\View\DesignInterface::XML_PATH_THEME_ID, $theme->getId(), @@ -163,7 +163,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetProcessedTemplateDesignChange() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Core\Model\App\Area::AREA_FRONTEND )->load(); @@ -181,7 +181,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetProcessedTemplateSubject() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Core\Model\App\Area::AREA_FRONTEND )->load(); @@ -208,7 +208,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetDefaultEmailLogo() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Core\Model\App\Area::AREA_FRONTEND )->load(); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/themes.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/themes.php index de6263e690b1d0c072ce7f051577d09b828e5893..78b8a6e13d31949633fb1aa65da6adbe50fadb48 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/themes.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/themes.php @@ -23,13 +23,13 @@ */ \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') ) ) ); $objectManger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManger->get('Magento\App\AreaList') +$objectManger->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php index d5e01b26f7a820f8e448105897541dea96c08e86..e05a1feeaa63053b4202ea1a754f7eb1ae4fbc07 100644 --- a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php +++ b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php @@ -306,7 +306,7 @@ class ReadTest extends \PHPUnit_Framework_TestCase $directoryFactory = $objectManager->create('Magento\Filesystem\Directory\ReadFactory'); return $directoryFactory->create( $config, - new \Magento\Filesystem\DriverFactory($objectManager->get('Magento\App\Filesystem\DirectoryList')) + new \Magento\Filesystem\DriverFactory($objectManager->get('Magento\Framework\App\Filesystem\DirectoryList')) ); } diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php index 0a7e135be489067ebdccc3ace415794c130fbc8c..f33befb138df54c555bd2be056d3527392e33cc9 100644 --- a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php +++ b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/WriteTest.php @@ -393,7 +393,7 @@ class WriteTest extends \PHPUnit_Framework_TestCase $directoryFactory = $objectManager->create('Magento\Filesystem\Directory\WriteFactory'); $directory = $directoryFactory->create( $config, - new \Magento\Filesystem\DriverFactory($objectManager->get('Magento\App\Filesystem\DirectoryList')) + new \Magento\Filesystem\DriverFactory($objectManager->get('Magento\Framework\App\Filesystem\DirectoryList')) ); $this->testDirectories[] = $directory; return $directory; diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/FilesystemTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/FilesystemTest.php index 71415e1fbf4fa55e6880c57bcc124c52ea858950..84408088c287da067bd27fb2f36e7704a29b6400 100644 --- a/dev/tests/integration/testsuite/Magento/Filesystem/FilesystemTest.php +++ b/dev/tests/integration/testsuite/Magento/Filesystem/FilesystemTest.php @@ -36,13 +36,13 @@ use Magento\TestFramework\Helper\Bootstrap; class FilesystemTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; protected function setUp() { - $this->filesystem = Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); + $this->filesystem = Bootstrap::getObjectManager()->create('Magento\Framework\App\Filesystem'); } /** @@ -50,7 +50,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ public function testGetDirectoryReadInstance() { - $dir = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::VAR_DIR); + $dir = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::VAR_DIR); $this->assertInstanceOf('\Magento\Filesystem\Directory\Read', $dir); } @@ -59,7 +59,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ public function testGetDirectoryWriteInstance() { - $dir = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $dir = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->assertInstanceOf('\Magento\Filesystem\Directory\Write', $dir); } @@ -70,7 +70,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ public function testGetDirectoryWriteException() { - $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::THEMES_DIR); + $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::THEMES_DIR); } /** @@ -78,6 +78,6 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ public function testGetUri() { - $this->assertContains('media', $this->filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR)); + $this->assertContains('media', $this->filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR)); } } diff --git a/dev/tests/integration/testsuite/Magento/App/Cache/State/OptionsTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php similarity index 92% rename from dev/tests/integration/testsuite/Magento/App/Cache/State/OptionsTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php index ca0f04841ba07f21f7cf34f78e4c74a4a4f95ce7..9806ce72cca8c4e10fb071aedc951830f43aa0bd 100644 --- a/dev/tests/integration/testsuite/Magento/App/Cache/State/OptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php @@ -22,12 +22,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\State; +namespace Magento\Framework\App\Cache\State; class OptionsTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cache\State\Options + * @var \Magento\Framework\App\Cache\State\Options */ protected $_model; @@ -39,19 +39,19 @@ class OptionsTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\State\Options' + 'Magento\Framework\App\Cache\State\Options' ); } public function testGetTable() { $this->_resourceMock = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('tablePrefix' => 'prefix_') ); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\State\Options', + 'Magento\Framework\App\Cache\State\Options', array('resource' => $this->_resourceMock) ); $this->assertEquals('prefix_core_cache_option', $this->_model->getTable('core_cache_option')); diff --git a/dev/tests/integration/testsuite/Magento/App/Config/BaseTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Config/BaseTest.php similarity index 87% rename from dev/tests/integration/testsuite/Magento/App/Config/BaseTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/Config/BaseTest.php index 4d0552bf25d1c24682a7b41d774ff50ad50d74fe..206b7d174d87313a7aeae153ebf5505b6d0200ad 100644 --- a/dev/tests/integration/testsuite/Magento/App/Config/BaseTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Config/BaseTest.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class BaseTest extends \PHPUnit_Framework_TestCase { @@ -33,10 +33,10 @@ class BaseTest extends \PHPUnit_Framework_TestCase <root><key>value</key></root> XML; $config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Config\Base', + 'Magento\Framework\App\Config\Base', array('sourceData' => $xml) ); - $this->assertInstanceOf('Magento\App\Config\Element', $config->getNode('key')); + $this->assertInstanceOf('Magento\Framework\App\Config\Element', $config->getNode('key')); } } diff --git a/dev/tests/integration/testsuite/Magento/App/Config/DataTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Config/DataTest.php similarity index 91% rename from dev/tests/integration/testsuite/Magento/App/Config/DataTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/Config/DataTest.php index 508180f768b82b17a93122f2fdae9c765b97e6db..f7117cb8f35adbff903c7571366cf4df5625e20d 100644 --- a/dev/tests/integration/testsuite/Magento/App/Config/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Config/DataTest.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class DataTest extends \PHPUnit_Framework_TestCase { @@ -31,14 +31,14 @@ class DataTest extends \PHPUnit_Framework_TestCase const SAMPLE_VALUE = 'http://example.com/'; /** - * @var \Magento\App\Config\Value + * @var \Magento\Framework\App\Config\Value */ protected $_model; public static function setUpBeforeClass() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\Storage\WriterInterface' + 'Magento\Framework\App\Config\Storage\WriterInterface' )->save( self::SAMPLE_CONFIG_PATH, self::SAMPLE_VALUE @@ -49,7 +49,7 @@ class DataTest extends \PHPUnit_Framework_TestCase public static function tearDownAfterClass() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\Storage\WriterInterface' + 'Magento\Framework\App\Config\Storage\WriterInterface' )->delete( self::SAMPLE_CONFIG_PATH ); @@ -61,15 +61,15 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected static function _refreshConfiguration() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\CacheInterface') - ->clean(array(\Magento\App\Config::CACHE_TAG)); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\CacheInterface') + ->clean(array(\Magento\Framework\App\Config::CACHE_TAG)); \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(); } protected function setUp() { $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Config\Value' + 'Magento\Framework\App\Config\Value' ); } diff --git a/dev/tests/integration/testsuite/Magento/App/Config/ElementTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Config/ElementTest.php similarity index 94% rename from dev/tests/integration/testsuite/Magento/App/Config/ElementTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/Config/ElementTest.php index ec3b3f520e932217a8201d39e3fe7ebc22602fa0..db5e0517224a20602f0d44ff137e08c7c2acf044 100644 --- a/dev/tests/integration/testsuite/Magento/App/Config/ElementTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Config/ElementTest.php @@ -22,12 +22,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class ElementTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Element + * @var \Magento\Framework\App\Config\Element */ protected $_model; @@ -60,7 +60,7 @@ XML; * @TODO: Need to use ObjectManager instead 'new'. * On this moment we have next bug MAGETWO-4274 which blocker for this key. */ - $this->_model = new \Magento\App\Config\Element($xml); + $this->_model = new \Magento\Framework\App\Config\Element($xml); } public function testIs() diff --git a/dev/tests/integration/testsuite/Magento/App/FilesystemTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/FilesystemTest.php similarity index 83% rename from dev/tests/integration/testsuite/Magento/App/FilesystemTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/FilesystemTest.php index b5a3dc5ac97ed096bb33b565bf56602fda25a37b..6c72c5aeb028e24e1738ed3176acfd489ae0cd6d 100644 --- a/dev/tests/integration/testsuite/Magento/App/FilesystemTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/FilesystemTest.php @@ -1,6 +1,6 @@ <?php /** - * Test for \Magento\App\Filesystem + * Test for \Magento\Framework\App\Filesystem * * Magento * @@ -23,26 +23,26 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; use Magento\TestFramework\Helper\Bootstrap; /** * Class FilesystemTest - * Test for Magento\App\Filesystem class + * Test for Magento\Framework\App\Filesystem class * * @package Magento */ class FilesystemTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; protected function setUp() { - $this->filesystem = Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); + $this->filesystem = Bootstrap::getObjectManager()->create('Magento\Framework\App\Filesystem'); } /** @@ -50,6 +50,6 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ public function testGetPath() { - $this->assertContains('design', $this->filesystem->getPath(\Magento\App\Filesystem::THEMES_DIR)); + $this->assertContains('design', $this->filesystem->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR)); } } diff --git a/dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/FrontController/Plugin/InstallTest.php similarity index 95% rename from dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/FrontController/Plugin/InstallTest.php index fedfcf357ca61dc3b6b203acf110dd5423dc4b64..97e2bba0c5d2e8ea6b69c483f1d0e9262a059cd3 100644 --- a/dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/FrontController/Plugin/InstallTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\FrontController\Plugin; +namespace Magento\Framework\App\FrontController\Plugin; class InstallTest extends \Magento\TestFramework\TestCase\AbstractController { @@ -63,7 +63,7 @@ class InstallTest extends \Magento\TestFramework\TestCase\AbstractController $this->_model->getConnection()->dropTable($this->_model->getTable('adminnotification_inbox')); $this->_model->getConnection()->dropTable($this->_model->getTable('admin_system_messages')); /** @var \Magento\Cache\FrontendInterface $cache */ - $cache = $this->_objectManager->get('Magento\App\Cache\Type\Config'); + $cache = $this->_objectManager->get('Magento\Framework\App\Cache\Type\Config'); $cache->clean(); try { diff --git a/dev/tests/integration/testsuite/Magento/App/FrontControllerTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerTest.php similarity index 83% rename from dev/tests/integration/testsuite/Magento/App/FrontControllerTest.php rename to dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerTest.php index 0c912a3aa021bdb1c97d4574cafd99d9e67d3e12..2ee3484f28ddebeb80cd2e5b53adf66b23b5947f 100644 --- a/dev/tests/integration/testsuite/Magento/App/FrontControllerTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerTest.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -37,14 +37,14 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\FrontController + * @var \Magento\Framework\App\FrontController */ protected $_model; protected function setUp() { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->_model = $this->_objectManager->create('Magento\App\FrontController'); + $this->_model = $this->_objectManager->create('Magento\Framework\App\FrontController'); } public function testDispatch() @@ -53,8 +53,8 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Cant\'t test dispatch process without sending headers'); } $_SERVER['HTTP_HOST'] = 'localhost'; - $this->_objectManager->get('Magento\App\State')->setAreaCode('frontend'); - $request = $this->_objectManager->create('Magento\App\Request\Http'); + $this->_objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); + $request = $this->_objectManager->create('Magento\Framework\App\Request\Http'); /* empty action */ $request->setRequestUri('core/index/index'); $this->assertEmpty($this->_model->dispatch($request)->getBody()); diff --git a/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php b/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php index b5be33a24d18cb767688dcf0acbcca8e25f739d8..132a1021a9720e194e02fca7962538903b2194da 100644 --- a/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php +++ b/dev/tests/integration/testsuite/Magento/Image/Adapter/InterfaceTest.php @@ -564,9 +564,9 @@ class InterfaceTest extends \PHPUnit_Framework_TestCase { $adapter = $this->_getAdapter($adapterType); $path = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR ) . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf'; $adapter->createPngFromString('T', $path); $adapter->refreshImageDimensions(); diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php index 189c6168a9ab00f7a4fb140401abbb82f08432f7..7dfe0a60e75c0ed192da642875b4faa3da652375 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php @@ -33,7 +33,7 @@ namespace Magento\ImportExport\Model\Export; abstract class AbstractStubEntity extends \Magento\ImportExport\Model\Export\AbstractEntity { public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php index f758f720aaacef2346edb978a1b81758295f3a43..ad329415953d1a207e063db06cba29f6170c7d5e 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php @@ -81,7 +81,7 @@ class AbstractEavTest extends \PHPUnit_Framework_TestCase $this->returnValue($customerAttributes) ); $this->_model->__construct( - $objectManager->get('Magento\App\Config\ScopeConfigInterface'), + $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\Store\Model\StoreManager'), $objectManager->get('Magento\ImportExport\Model\Export\Factory'), $objectManager->get('Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory'), diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/ProductTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/ProductTest.php index 26bbd86e84e0100fdfd1d96a5e1467f694a27554..f24bee190001a86dcb55c0c91135cac673bf1bf2 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/Entity/ProductTest.php @@ -91,7 +91,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase */ public function testExportStockItemAttributesAreFilled() { - $filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $directoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $filesystemMock->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directoryMock)); diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php index c9649f0a47ada458e4e4006448f92969d73332c5..19e554eb1587831185a5debddcb7770cc224c759 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php @@ -46,7 +46,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase $this->_model = $this->getMockForAbstractClass( 'Magento\ImportExport\Model\Export\AbstractEntity', array( - $objectManager->get('Magento\App\Config\ScopeConfigInterface'), + $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\Store\Model\StoreManager'), $objectManager->get('Magento\ImportExport\Model\Export\Factory'), $objectManager->get('Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory') @@ -127,7 +127,7 @@ abstract class Stub_Magento_ImportExport_Model_Export_AbstractEntity extends \Magento\ImportExport\Model\Export\AbstractEntity { public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ImportExport\Model\Export\Factory $collectionFactory, \Magento\ImportExport\Model\Resource\CollectionByPagesIteratorFactory $resourceColFactory, diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php index 57f0cb8fcb4131288e1c57cbf9c8a95b60ad89cb..7138639415a4acc1027e0b8ce7f353194947fb9d 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php @@ -161,9 +161,9 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase ->loadArea(\Magento\Core\Model\App\Area::AREA_FRONTEND); // set entity adapter parameters $this->_entityAdapter->setParameters(array('behavior' => $behavior)); - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $this->_objectManager->create('Magento\App\Filesystem'); - $rootDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $this->_objectManager->create('Magento\Framework\App\Filesystem'); + $rootDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); // set fixture CSV file $result = $this->_entityAdapter->setSource( diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php index 0c3e669d3d9f2022bc7afe707862395e5b203d5c..5b00195111f709520d1e2f5eb990fcd6d71f1323 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php @@ -416,9 +416,9 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $filesystem = $objectManager->create('Magento\App\Filesystem'); + $filesystem = $objectManager->create('Magento\Framework\App\Filesystem'); - $directoryWrite = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $directoryWrite = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $result = $this->_entityAdapter->setSource( \Magento\ImportExport\Model\Import\Adapter::findAdapterFor($sourceFile, $directoryWrite) @@ -513,8 +513,8 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $filesystem = $objectManager->create('Magento\App\Filesystem'); - $directoryWrite = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = $objectManager->create('Magento\Framework\App\Filesystem'); + $directoryWrite = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $result = $this->_entityAdapter->setSource( \Magento\ImportExport\Model\Import\Adapter::findAdapterFor($sourceFile, $directoryWrite) )->isDataValid(); diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerImportTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerImportTest.php index 4525ed9cc4662ac81549d9885928d3604c26ae18..0d17de2beb976383bf57dc79f11b44f14bcecfff 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerImportTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerImportTest.php @@ -52,8 +52,9 @@ class CustomerImportTest extends \PHPUnit_Framework_TestCase 'Magento\ImportExport\Model\Import\Entity\Eav\Customer' ); - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $this->directoryWrite = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $this->directoryWrite = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); } /** diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php index 22da18cf8b0ce80fd30dddac297f6fc5a1939234..06b07b5d71be49ecf1c8a1effcaa8fda4a218d72 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/Entity/ProductTest.php @@ -107,8 +107,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase $productsBeforeImport[] = $product; } - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv( __DIR__ . '/_files/products_to_import.csv', @@ -154,8 +155,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase $stockItems[$productId] = $stockItem; } - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv( __DIR__ . '/_files/products_to_import.csv', $directory @@ -197,8 +199,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase // import data from CSV file $pathToFile = __DIR__ . '/_files/product_with_custom_options.csv'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv($pathToFile, $directory); $this->_model->setSource($source)->setParameters(array('behavior' => $behavior))->isDataValid(); @@ -262,8 +265,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase $productsBeforeImport[$product->getSku()] = $product; } - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv( __DIR__ . '/_files/products_to_import_with_datetime.csv', @@ -581,9 +585,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Filesystem\Directory\Write $mediaDirectory */ $mediaDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $mediaDirectory->create('import'); $dirPath = $mediaDirectory->getAbsolutePath('import'); @@ -597,9 +601,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Filesystem\Directory\Write $mediaDirectory */ $mediaDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR ); $mediaDirectory->delete('import'); $mediaDirectory->delete('catalog'); @@ -644,8 +648,10 @@ class ProductTest extends \PHPUnit_Framework_TestCase { // import data from CSV file $pathToFile = __DIR__ . '/_files/products_to_import_invalid_attribute_set.csv'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Framework\App\Filesystem' + ); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv($pathToFile, $directory); $this->_model->setSource( $source diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php index 461ab899c07b25f5b9975d9907bdd8a2c055f345..b1e771b52de2411cad54e7b448d34ea2a8ebb1f5 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php @@ -37,8 +37,9 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase */ public function testSaveValidatedBunches() { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $source = new \Magento\ImportExport\Model\Import\Source\Csv( __DIR__ . '/Entity/Eav/_files/customers_for_validation_test.csv', $directory @@ -53,10 +54,10 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase array( $objectManager->get('Magento\Core\Helper\Data'), $objectManager->get('Magento\Stdlib\String'), - $objectManager->get('Magento\App\Config\ScopeConfigInterface'), + $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\ImportExport\Model\ImportFactory'), $objectManager->get('Magento\ImportExport\Model\Resource\Helper'), - $objectManager->get('Magento\App\Resource') + $objectManager->get('Magento\Framework\App\Resource') ) ); $model->expects($this->any())->method('validateRow')->will($this->returnValue(true)); diff --git a/dev/tests/integration/testsuite/Magento/Index/Model/Process/FileTest.php b/dev/tests/integration/testsuite/Magento/Index/Model/Process/FileTest.php index cd3766b387f74611c73b42c6af8d0b78b61c0758..ce97aeccf5110c22ff37de984257a46055a2047e 100644 --- a/dev/tests/integration/testsuite/Magento/Index/Model/Process/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Index/Model/Process/FileTest.php @@ -61,8 +61,8 @@ class FileTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $filesystem = $this->_objectManager->create('Magento\App\Filesystem'); - $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $filesystem = $this->_objectManager->create('Magento\Framework\App\Filesystem'); + $this->_varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $fullFileName = $this->_varDirectory->getAbsolutePath(self::FILE_PATH); $this->_testFileHandler = fopen($fullFileName, 'w'); diff --git a/dev/tests/integration/testsuite/Magento/Install/Block/AdminTest.php b/dev/tests/integration/testsuite/Magento/Install/Block/AdminTest.php index a8901ffc57a29a75ade6e6e345cde731540d8186..30c8bf2516a0ea75d033fa8403a71bfc67a284ba 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Block/AdminTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Block/AdminTest.php @@ -39,7 +39,8 @@ class AdminTest extends \PHPUnit_Framework_TestCase $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Install\Model\Session'); $session->setAdminData(array_merge($preserve, $omit)); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('install'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('install'); /** @var $layout \Magento\View\LayoutInterface */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\View\Layout'); diff --git a/dev/tests/integration/testsuite/Magento/Install/Controller/WizardTest.php b/dev/tests/integration/testsuite/Magento/Install/Controller/WizardTest.php index 1448905fde90e6e153f4250113f851c285454dd6..5c13b4bf272b9dcf0b19851c82dcf598f2205b0e 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Controller/WizardTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Controller/WizardTest.php @@ -40,9 +40,10 @@ class WizardTest extends \Magento\TestFramework\TestCase\AbstractController public static function setUpBeforeClass() { - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - $varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + $varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $tmpDir = 'WizardTest'; $varDirectory->delete($tmpDir); // deliberately create a file instead of directory to emulate broken access to static directory @@ -56,13 +57,13 @@ class WizardTest extends \Magento\TestFramework\TestCase\AbstractController \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure( array( 'preferences' => array( - 'Magento\App\RequestInterface' => 'Magento\TestFramework\Request', - 'Magento\App\Response\Http' => 'Magento\TestFramework\Response' + 'Magento\Framework\App\RequestInterface' => 'Magento\TestFramework\Request', + 'Magento\Framework\App\Response\Http' => 'Magento\TestFramework\Response' ) ) ); - /** @var $appState \Magento\App\State */ - $appState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State'); + /** @var $appState \Magento\Framework\App\State */ + $appState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State'); $appState->setInstallDate(false); $this->dispatch('install/wizard'); $this->assertEquals(302, $this->getResponse()->getHttpResponseCode()); diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php index 2978ffa7a498e3acfa12abf906c06bf1e4933faf..fe5000c9138639bbb7a630813a396b788e473044 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Model/ConfigTest.php @@ -40,32 +40,32 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cacheTypeList \Magento\App\Cache\TypeListInterface */ + /** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Cache\TypeListInterface' + 'Magento\Framework\App\Cache\TypeListInterface' ); $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\App\Cache\StateInterface */ + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Cache\StateInterface' + 'Magento\Framework\App\Cache\StateInterface' ); foreach ($types as $type) { $cacheState->setEnabled($type, false); } $cacheState->persist(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $filesystem = $this->_objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => $this->_objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => BP, 'directories' => array( - \Magento\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files'), - \Magento\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files') + \Magento\Framework\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files'), + \Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files') ) ) ) @@ -98,9 +98,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ); $moduleReader->setModuleDir('Magento_Test', 'etc', __DIR__ . '/_files/Magento/Test/etc'); - /** @var \Magento\App\Config\FileResolver $fileResolver */ + /** @var \Magento\Framework\App\Config\FileResolver $fileResolver */ $fileResolver = $this->_objectManager->create( - 'Magento\App\Config\FileResolver', + 'Magento\Framework\App\Config\FileResolver', array('moduleReader' => $moduleReader) ); diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/Installer/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/Installer/ConfigTest.php index 3da15f07433295fdc1c73ad071d422e99018518f..8aae492f14300c39aea1791e300f10f3fcf61983 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Model/Installer/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Model/Installer/ConfigTest.php @@ -37,9 +37,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - self::$_varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + self::$_varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); self::$_tmpDir = self::$_varDirectory->getAbsolutePath('ConfigTest'); self::$_varDirectory->create(self::$_varDirectory->getRelativePath(self::$_tmpDir)); } @@ -54,7 +55,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase file_put_contents(self::$_tmpDir . '/local.xml.template', "test; {{date}}; {{base_url}}; {{unknown}}"); $expectedFile = self::$_tmpDir . '/local.xml'; - $request = $this->getMock('Magento\App\Request\Http', array('getDistroBaseUrl'), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array('getDistroBaseUrl'), array(), '', false); $request->expects($this->once())->method('getDistroBaseUrl')->will($this->returnValue('http://example.com/')); $expectedContents = "test; <![CDATA[d-d-d-d-d]]>; <![CDATA[http://example.com/]]>; {{unknown}}"; @@ -63,14 +64,17 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $directoryList = $objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => self::$_tmpDir, - 'directories' => array(\Magento\App\Filesystem::CONFIG_DIR => array('path' => self::$_tmpDir)) + 'directories' => array(\Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => self::$_tmpDir)) ) ); - $objectManager->get('\Magento\App\Filesystem\DirectoryList\Configuration')->configure($directoryList); - $filesystem = $objectManager->create('Magento\App\Filesystem', array('directoryList' => $directoryList)); + $objectManager->get('\Magento\Framework\App\Filesystem\DirectoryList\Configuration')->configure($directoryList); + $filesystem = $objectManager->create( + 'Magento\Framework\App\Filesystem', + array('directoryList' => $directoryList) + ); $model = $objectManager->create( 'Magento\Install\Model\Installer\Config', array('request' => $request, 'filesystem' => $filesystem) diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php index b4f2213adc424b501e2d2155187ab18901c61798..35aaaf917f6d60d0aba731806c65a93f8589817e 100644 --- a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php +++ b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php @@ -45,9 +45,10 @@ class InstallerTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - self::$_varDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + self::$_varDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); self::$_tmpDir = self::$_varDirectory->getAbsolutePath('InstallerTest'); self::$_tmpConfigFile = self::$_tmpDir . '/local.xml'; self::$_varDirectory->create(self::$_varDirectory->getRelativePath(self::$_tmpDir)); @@ -69,19 +70,22 @@ class InstallerTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $directoryList = $objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => __DIR__, - 'directories' => array(\Magento\App\Filesystem::CONFIG_DIR => array('path' => self::$_tmpDir)) + 'directories' => array(\Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => self::$_tmpDir)) ) ); - $objectManager->get('\Magento\App\Filesystem\DirectoryList\Configuration')->configure($directoryList); - $filesystem = $objectManager->create('Magento\App\Filesystem', array('directoryList' => $directoryList)); + $objectManager->get('\Magento\Framework\App\Filesystem\DirectoryList\Configuration')->configure($directoryList); + $filesystem = $objectManager->create( + 'Magento\Framework\App\Filesystem', + array('directoryList' => $directoryList) + ); if ($emulateConfig) { $installerConfig = new \Magento\Install\Model\Installer\Config( $objectManager->get('Magento\Install\Model\Installer'), - $objectManager->get('Magento\App\RequestInterface'), + $objectManager->get('Magento\Framework\App\RequestInterface'), $filesystem, $objectManager->get('Magento\Store\Model\StoreManager'), $objectManager->get('Magento\Message\Manager') @@ -193,13 +197,13 @@ class InstallerTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** - * @var $cache \Magento\App\Cache + * @var $cache \Magento\Framework\App\Cache */ - $cache = $objectManager->create('Magento\App\Cache'); + $cache = $objectManager->create('Magento\Framework\App\Cache'); /** - * @var $appState \Magento\App\State + * @var $appState \Magento\Framework\App\State */ - $appState = $objectManager->get('Magento\App\State'); + $appState = $objectManager->get('Magento\Framework\App\State'); $cache->save('testValue', 'testName'); $this->assertEquals('testValue', $cache->load('testName')); @@ -216,11 +220,11 @@ class InstallerTest extends \PHPUnit_Framework_TestCase 'In-memory application installation state was not changed right after finishing installation phase' ); - /** @var $cacheState \Magento\App\Cache\StateInterface */ - $cacheState = $objectManager->create('Magento\App\Cache\StateInterface'); + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = $objectManager->create('Magento\Framework\App\Cache\StateInterface'); - /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */ - $cacheTypeList = $objectManager->create('Magento\App\Cache\TypeListInterface'); + /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ + $cacheTypeList = $objectManager->create('Magento\Framework\App\Cache\TypeListInterface'); $types = array_keys($cacheTypeList->getTypes()); foreach ($types as $type) { $this->assertTrue( diff --git a/dev/tests/integration/testsuite/Magento/Interception/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Interception/GeneralTest.php index 35a7fb1be9e3e3611d3cf8b99117921acca67303..36adc2fa957a699a17c20788ece6550ab9b3600b 100644 --- a/dev/tests/integration/testsuite/Magento/Interception/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Interception/GeneralTest.php @@ -81,7 +81,7 @@ class GeneralTest extends \PHPUnit_Framework_TestCase ) ); - $areaList = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $areaList = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $areaList->expects($this->any())->method('getCodes')->will($this->returnValue(array())); $configScope = new \Magento\Config\Scope($areaList, 'global'); $cache = $this->getMock('Magento\Config\CacheInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Less/File/Source/AggregatedTest.php b/dev/tests/integration/testsuite/Magento/Less/File/Source/AggregatedTest.php index 8d4ca0ac58df68e6df3de863c2caf05df60213ac..e121f951f57fdf937a957eb6c67182f0bb52f8a0 100644 --- a/dev/tests/integration/testsuite/Magento/Less/File/Source/AggregatedTest.php +++ b/dev/tests/integration/testsuite/Magento/Less/File/Source/AggregatedTest.php @@ -39,27 +39,29 @@ class AggregatedTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::PUB_LIB_DIR => array('path' => dirname(dirname(__DIR__)) . '/_files/lib'), - \Magento\App\Filesystem::THEMES_DIR => array( + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::PUB_LIB_DIR => array( + 'path' => dirname(dirname(__DIR__)) . '/_files/lib' + ), + \Magento\Framework\App\Filesystem::THEMES_DIR => array( 'path' => dirname(dirname(__DIR__)) . '/_files/design' ) ) ) ); $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $this->objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); /** @var \Magento\Filesystem $filesystem */ $filesystem = $this->objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => $this->objectManager->create( 'Magento\Filesystem\DirectoryList', array( 'root' => BP, 'directories' => array( - \Magento\App\Filesystem::MODULES_DIR => array( + \Magento\Framework\App\Filesystem::MODULES_DIR => array( 'path' => dirname(dirname(__DIR__)) . '/_files/code' ) ) diff --git a/dev/tests/integration/testsuite/Magento/Less/PreProcessorTest.php b/dev/tests/integration/testsuite/Magento/Less/PreProcessorTest.php index 9ca9a831f446f7a0399abfb2a2d227fdea3f6591..4e7a9736f33068552b40867a85ee825bf5427d94 100644 --- a/dev/tests/integration/testsuite/Magento/Less/PreProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Less/PreProcessorTest.php @@ -34,14 +34,14 @@ class PreProcessorTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::PUB_LIB_DIR => array('path' => __DIR__ . '/_files/lib'), - \Magento\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::PUB_LIB_DIR => array('path' => __DIR__ . '/_files/lib'), + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/_files/design') ) ) ); $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $this->objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); } /** @@ -55,7 +55,7 @@ class PreProcessorTest extends \PHPUnit_Framework_TestCase $lessPreProcessor = $this->objectManager->create('Magento\Css\PreProcessor\Less'); /** @var $filesystem \Magento\Filesystem */ $filesystem = $this->objectManager->get('Magento\Filesystem'); - $targetDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::TMP_DIR); + $targetDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::TMP_DIR); $designParams = array('area' => 'frontend', 'theme' => 'test_pre_process'); /** @var \Magento\View\Service $viewService */ $viewService = $this->objectManager->get('Magento\View\Service'); diff --git a/dev/tests/integration/testsuite/Magento/Less/_files/themes.php b/dev/tests/integration/testsuite/Magento/Less/_files/themes.php index 3f3db4f663f7328326dfe0cf60237e7196f346a7..ae4f6c0cad2a66b50765a6107a0ae391cca51f06 100644 --- a/dev/tests/integration/testsuite/Magento/Less/_files/themes.php +++ b/dev/tests/integration/testsuite/Magento/Less/_files/themes.php @@ -23,13 +23,13 @@ */ \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/design') ) ) ); $objectManger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManger->get('Magento\App\State') +$objectManger->get('Magento\Framework\App\State') ->setAreaCode(\Magento\View\DesignInterface::DEFAULT_AREA); /** @var $registration \Magento\Core\Model\Theme\Registration */ diff --git a/dev/tests/integration/testsuite/Magento/Locale/ResolverTest.php b/dev/tests/integration/testsuite/Magento/Locale/ResolverTest.php index 2a6715f6ca90b70690b1c1c18edb5f9abab0f793..b1de2cce32cee9111898d0384e4dd7a4ad6f1c92 100644 --- a/dev/tests/integration/testsuite/Magento/Locale/ResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Locale/ResolverTest.php @@ -27,7 +27,7 @@ class ResolverTest extends \PHPUnit_Framework_TestCase { public function testGetLocale() { - $objectManager = \Magento\App\ObjectManager::getInstance(); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); \Zend_Locale_Data::removeCache(); $this->assertNull(\Zend_Locale_Data::getCache()); $model = $objectManager->create('Magento\Locale\ResolverInterface', array('locale' => 'some_locale')); diff --git a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/AbstractTest.php index 0c1dc4f3053b820f689d9c2df51315f3a328827d..e3abb0c910f4a073c882bb833ec19a38a6472cad 100644 --- a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/AbstractTest.php @@ -35,7 +35,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); $this->_model = $this->getMockForAbstractClass('Magento\Model\Resource\Db\AbstractDb', array('resource' => $resource) ); @@ -45,7 +45,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase { $resourceProperty = new \ReflectionProperty(get_class($this->_model), '_resources'); $resourceProperty->setAccessible(true); - $this->assertInstanceOf('Magento\App\Resource', $resourceProperty->getValue($this->_model)); + $this->assertInstanceOf('Magento\Framework\App\Resource', $resourceProperty->getValue($this->_model)); } public function testSetMainTable() @@ -69,7 +69,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $tableNameOrig ='store_website'; $tableSuffix = 'suffix'; $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('tablePrefix' => 'prefix_') ); diff --git a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/Collection/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/Collection/AbstractTest.php index d6657fcc93b3fe1411bb6882578b8fddff11ef1e..5d7d9e458e2de03de457a3d25c05d48a73b1b7b6 100644 --- a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/Collection/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/Collection/AbstractTest.php @@ -32,7 +32,8 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $resourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + $resourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Resource'); $resource = $this->getMockForAbstractClass( 'Magento\Model\Resource\Db\AbstractDb', array($resourceModel), diff --git a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/ProfilerTest.php b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/ProfilerTest.php index e66925ce7b856885722447219da047be9ae91590..744a6fb3112592697df5464aa67cfc5149d55481 100644 --- a/dev/tests/integration/testsuite/Magento/Model/Resource/Db/ProfilerTest.php +++ b/dev/tests/integration/testsuite/Magento/Model/Resource/Db/ProfilerTest.php @@ -28,7 +28,7 @@ namespace Magento\Model\Resource\Db; class ProfilerTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_model; @@ -51,7 +51,8 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Resource'); + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Resource'); } /** @@ -60,7 +61,7 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase protected function _getConnectionRead() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $localConfig = $objectManager->get('Magento\App\Arguments'); + $localConfig = $objectManager->get('Magento\Framework\App\Arguments'); $connectionConfig = $localConfig->getConnection('default'); $connectionConfig['profiler'] = array( 'class' => 'Magento\Model\Resource\Db\Profiler', @@ -82,8 +83,8 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase { $connection = $this->_getConnectionRead(); - /** @var \Magento\App\Resource $resource */ - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + /** @var \Magento\Framework\App\Resource $resource */ + $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); $testTableName = $resource->getTableName('core_resource'); $selectQuery = sprintf($selectQuery, $testTableName); @@ -145,8 +146,8 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase $this->fail("Expected exception didn't thrown!"); } - /** @var \Magento\App\Resource $resource */ - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Resource'); + /** @var \Magento\Framework\App\Resource $resource */ + $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); $testTableName = $resource->getTableName('core_resource'); $connection->query('SELECT * FROM ' . $testTableName); diff --git a/dev/tests/integration/testsuite/Magento/Model/ResourceTest.php b/dev/tests/integration/testsuite/Magento/Model/ResourceTest.php index 0f4dfd8ef6ac77b1685abc0f75cf34fcba4fb27e..b40ed92c0f6d5a7855b8c344bb387fa4fc7f4e3e 100644 --- a/dev/tests/integration/testsuite/Magento/Model/ResourceTest.php +++ b/dev/tests/integration/testsuite/Magento/Model/ResourceTest.php @@ -28,13 +28,14 @@ namespace Magento\Model; class ResourceTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_model; protected function setUp() { - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Resource'); + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Resource'); } public function testGetTableName() @@ -44,7 +45,7 @@ class ResourceTest extends \PHPUnit_Framework_TestCase $tableNameOrig = 'store_website'; $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('tablePrefix' => 'prefix_') ); diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php index e6433e3237cb79c71b97de99d579ee3318497464..1927205b840ba9d6258a37a21e8042602794aef7 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php @@ -21,6 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Multishipping\Block\Checkout\Address; use Magento\TestFramework\Helper\Bootstrap; @@ -55,7 +56,8 @@ class SelectTest extends \PHPUnit_Framework_TestCase $address = $addressService->getAddress($fixtureAddressId); $addressAsHtml = $this->_selectBlock->getAddressAsHtml($address); $this->assertEquals( - "John Smith<br/>Green str, 67<br />CityM, Alabama, 75477<br/>United States<br/>T: 3468676", + "John Smith<br/>CompanyName<br />Green str, 67<br />CityM, Alabama, 75477" + . "<br/>United States<br/>T: 3468676", str_replace("\n", '', $addressAsHtml), "Address was represented as HTML incorrectly" ); diff --git a/dev/tests/integration/testsuite/Magento/Mview/View/ChangelogTest.php b/dev/tests/integration/testsuite/Magento/Mview/View/ChangelogTest.php index 710a728f2fd0edd29e658a71a01a34ee897343de..2e48ec0c2f314918f2ad52484ac096d0f002064d 100644 --- a/dev/tests/integration/testsuite/Magento/Mview/View/ChangelogTest.php +++ b/dev/tests/integration/testsuite/Magento/Mview/View/ChangelogTest.php @@ -35,7 +35,7 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase protected $objectManager; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; @@ -54,7 +54,7 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->resource = $this->objectManager->get('Magento\App\Resource'); + $this->resource = $this->objectManager->get('Magento\Framework\App\Resource'); $this->connection = $this->resource->getConnection('core_write'); $this->model = $this->objectManager->create( diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php index da41c854b76af16ca5698a65ade7b35900e48a06..0890d7d0823c100451c7c9488de7a25b6926a6eb 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php @@ -43,6 +43,15 @@ class PluginTest extends \PHPUnit_Framework_TestCase ->get('Magento\Customer\Service\V1\CustomerAccountServiceInterface'); } + public function tearDown() + { + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); + } + /** * @magentoAppArea adminhtml * @magentoDataFixture Magento/Newsletter/_files/subscribers.php @@ -65,7 +74,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Service\V1\Data\CustomerDetailsBuilder $customerDetailsBuilder */ $customerDetailsBuilder = $objectManager->get('Magento\Customer\Service\V1\Data\CustomerDetailsBuilder'); $customerDetailsBuilder->setCustomer($customerBuilder->create()); - $createdCustomer = $this->accountService->createAccount($customerDetailsBuilder->create()); + $createdCustomer = $this->accountService->createCustomer($customerDetailsBuilder->create()); $subscriber->loadByEmail('customer_two@example.com'); $this->assertTrue($subscriber->isSubscribed()); @@ -90,7 +99,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Service\V1\Data\CustomerDetailsBuilder $customerDetailsBuilder */ $customerDetailsBuilder = $objectManager->get('Magento\Customer\Service\V1\Data\CustomerDetailsBuilder'); $customerDetailsBuilder->setCustomer($customerBuilder->create()); - $this->accountService->createAccount($customerDetailsBuilder->create()); + $this->accountService->createCustomer($customerDetailsBuilder->create()); $this->verifySubscriptionNotExist('customer@example.com'); } diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php index 735e14d41ddc17610084e474c29c467f6248199f..aa91e6a1888887135372d0a637e9d53c5525b967 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php @@ -38,8 +38,9 @@ class QueueTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode(\Magento\Core\Model\App\Area::AREA_FRONTEND); - $area = $objectManager->get('Magento\App\AreaList')->getArea(\Magento\Core\Model\App\Area::AREA_FRONTEND); + $objectManager->get('Magento\Framework\App\State')->setAreaCode(\Magento\Core\Model\App\Area::AREA_FRONTEND); + $area = $objectManager->get('Magento\Framework\App\AreaList') + ->getArea(\Magento\Core\Model\App\Area::AREA_FRONTEND); $area->load(); /** @var $filter \Magento\Newsletter\Model\Template\Filter */ diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php index e63c380322d0dd120bc1dafad7421b4414378c2e..c78140d95cf00f280c8f5455ad11c5317a29c6bc 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php @@ -57,7 +57,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->_model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); if ($store != 'default') { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\Core\Model\View\Design::XML_PATH_THEME_ID, $design, @@ -67,7 +67,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase } $this->_model->emulateDesign($store, 'frontend'); $processedTemplate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->emulateAreaCode( 'frontend', array($this->_model, 'getProcessedTemplate') @@ -101,7 +101,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->_model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); $this->_model->emulateDesign('default', $area); $processedTemplate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->emulateAreaCode( $area, array($this->_model, 'getProcessedTemplate') diff --git a/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php index 604be42a3a499eef3c3d19365e0646b635e47efd..4b9ed28b77b1ec0877469a85f9e836de36f4945a 100644 --- a/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Object/Copy/Config/ReaderTest.php @@ -38,17 +38,17 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $filesystem = $objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => $objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => BP, 'directories' => array( - \Magento\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files'), - \Magento\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files') + \Magento\Framework\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files'), + \Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files') ) ) ) @@ -78,9 +78,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase ); $moduleReader->setModuleDir('Magento_Test', 'etc', __DIR__ . '/_files/Magento/Test/etc'); - /** @var \Magento\App\Config\FileResolver $fileResolver */ + /** @var \Magento\Framework\App\Config\FileResolver $fileResolver */ $fileResolver = $objectManager->create( - 'Magento\App\Config\FileResolver', + 'Magento\Framework\App\Config\FileResolver', array('moduleReader' => $moduleReader) ); diff --git a/dev/tests/integration/testsuite/Magento/ObjectManager/Config/Reader/DomTest.php b/dev/tests/integration/testsuite/Magento/ObjectManager/Config/Reader/DomTest.php index c797930e8450e4691cc45f86e46051ed5c6983ec..cabbdf82da2e33cccbfbadd29606ed3963df307e 100644 --- a/dev/tests/integration/testsuite/Magento/ObjectManager/Config/Reader/DomTest.php +++ b/dev/tests/integration/testsuite/Magento/ObjectManager/Config/Reader/DomTest.php @@ -36,7 +36,7 @@ class DomTest extends \PHPUnit_Framework_TestCase protected $_fileList; /** - * @var \Magento\App\Arguments\FileResolver\Primary + * @var \Magento\Framework\App\Arguments\FileResolver\Primary */ protected $_fileResolverMock; @@ -46,7 +46,7 @@ class DomTest extends \PHPUnit_Framework_TestCase protected $_mergedConfig; /** - * @var \Magento\App\Arguments\ValidationState + * @var \Magento\Framework\App\Arguments\ValidationState */ protected $_validationState; @@ -69,7 +69,7 @@ class DomTest extends \PHPUnit_Framework_TestCase ); $this->_fileResolverMock = $this->getMock( - 'Magento\App\Arguments\FileResolver\Primary', + 'Magento\Framework\App\Arguments\FileResolver\Primary', array(), array(), '', @@ -79,7 +79,9 @@ class DomTest extends \PHPUnit_Framework_TestCase $this->_mapper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\ObjectManager\Config\Mapper\Dom' ); - $this->_validationState = new \Magento\App\Arguments\ValidationState(\Magento\App\State::MODE_DEFAULT); + $this->_validationState = new \Magento\Framework\App\Arguments\ValidationState( + \Magento\Framework\App\State::MODE_DEFAULT + ); $this->_schemaLocator = new \Magento\ObjectManager\Config\SchemaLocator(); $this->_mergedConfig = new \DOMDocument(); diff --git a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_merged.xml b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_merged.xml index cdfd6eb3c7166cccc7ac784e8c79f6bc6ae0ca27..2fdc22ad55133c240079b1c8f2f86b382061318b 100644 --- a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_merged.xml +++ b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_merged.xml @@ -26,9 +26,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\UpdaterOne" /> <preference for="Magento\Module\UpdaterInterfaceTwo" type="Magento\Module\UpdaterTwo"/> - <type name="Magento\App\Arguments\Loader" shared="false"> + <type name="Magento\Framework\App\Arguments\Loader" shared="false"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> <argument name="customConfig" xsi:type="object" shared="false">Magento\Core\Model\Config\Storage\Modules</argument> <argument name="customValue" xsi:type="string">someCustomValue</argument> <argument name="customComplexValue" xsi:type="array"> @@ -42,9 +42,9 @@ <plugin name="two" type="somePluginTwo" sortOrder="20" disabled="true"/> <plugin name="three" type="somePluginThree"/> </type> - <virtualType name="Magento\App\Arguments\LoaderVirtual" type="Magento\App\Arguments\Loader\Local" shared="true"> + <virtualType name="Magento\Framework\App\Arguments\LoaderVirtual" type="Magento\Framework\App\Arguments\Loader\Local" shared="true"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> <argument name="customConfig" xsi:type="object">Magento\Core\Model\Config\Storage\Modules</argument> <argument name="customValue" xsi:type="string">someValue</argument> <argument name="customComplexValue" xsi:type="array"> diff --git a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_one.xml b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_one.xml index 4752a3580c9c68938f7d02f422dab945c6216065..89bb53553cfc7c686f08c199ecef1874edced83f 100644 --- a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_one.xml +++ b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_one.xml @@ -25,9 +25,9 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\Updater" /> - <type name="Magento\App\Arguments\Loader"> + <type name="Magento\Framework\App\Arguments\Loader"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> <argument name="customConfig" xsi:type="object" shared="true">Magento\Core\Model\Config\Storage\Modules</argument> <argument name="customValue" xsi:type="string">someValue</argument> <argument name="customComplexValue" xsi:type="array"> @@ -38,9 +38,9 @@ <plugin name="one" type="somePluginOne"/> <plugin name="two" type="somePluginTwo" sortOrder="15"/> </type> - <virtualType name="Magento\App\Arguments\LoaderVirtual" type="Magento\App\Arguments\Loader\Local" shared="false"> + <virtualType name="Magento\Framework\App\Arguments\LoaderVirtual" type="Magento\Framework\App\Arguments\Loader\Local" shared="false"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> <argument name="customConfig" xsi:type="object">Magento\Core\Model\Config\Storage\Modules</argument> <argument name="customValue" xsi:type="string">someValue</argument> <argument name="customComplexValue" xsi:type="array"> diff --git a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_two.xml b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_two.xml index acf8151baedd15a19a68aa3b22d0b77637293216..f71941fdd16dbecc56b28a9783baebab50349727 100644 --- a/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_two.xml +++ b/dev/tests/integration/testsuite/Magento/ObjectManager/_files/config_two.xml @@ -26,9 +26,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <preference for="Magento\Module\UpdaterInterfaceTwo" type="Magento\Module\UpdaterTwo" /> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\UpdaterOne" /> - <type name="Magento\App\Arguments\Loader" shared="false"> + <type name="Magento\Framework\App\Arguments\Loader" shared="false"> <arguments> - <argument name="customFile" xsi:type="init_parameter">Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> + <argument name="customFile" xsi:type="init_parameter">Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE</argument> <argument name="newParam" xsi:type="string">paramValue</argument> <argument name="customConfig" xsi:type="object" shared="false">Magento\Core\Model\Config\Storage\Modules</argument> <argument name="customValue" xsi:type="string">someCustomValue</argument> @@ -40,7 +40,7 @@ <plugin name="two" type="somePluginTwo" sortOrder="20" disabled="true"/> <plugin name="one" sortOrder="800"/> </type> - <virtualType name="Magento\App\Arguments\LoaderVirtual" shared="true"> + <virtualType name="Magento\Framework\App\Arguments\LoaderVirtual" shared="true"> <plugin name="three" type="somePluginThree"/> <plugin name="two" type="somePluginTwo" sortOrder="20" disabled="true"/> <plugin name="one" sortOrder="800"/> diff --git a/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/TtlTest.php b/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/TtlTest.php index 3b553eddd8f03e3d651a5c499b535c152d12ecd7..ec1999c2b8367c4abdbdf6188b08e4d7cd32685e 100644 --- a/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/TtlTest.php +++ b/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/TtlTest.php @@ -34,14 +34,14 @@ class TtlTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; protected function setUp() { $this->_config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\App\Config\ScopeConfigInterface'); + ->create('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\PageCache\Model\System\Config\Backend\Ttl'); } diff --git a/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/VarnishTest.php b/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/VarnishTest.php index f111559995fed80bed1538ae1e85cdfdf6da3074..06f507fd27c1e3a76ba95f030a49db364d032562 100644 --- a/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/VarnishTest.php +++ b/dev/tests/integration/testsuite/Magento/PageCache/Model/System/Config/Backend/VarnishTest.php @@ -34,14 +34,14 @@ class VarnishTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Config\MutableScopeConfigInterface + * @var \Magento\Framework\App\Config\MutableScopeConfigInterface */ protected $_config; protected function setUp() { $this->_config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' ); $data = array( 'access_list' => 'localhost', diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php index 976b900585ac6e75c5c85d57f4fb020949314bf1..0a93edd942e8d8b186bac89fd72dd7639ea0d5cc 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php @@ -38,8 +38,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\App\Cache */ - $cache = $objectManager->create('Magento\App\Cache'); + /** @var $cache \Magento\Framework\App\Cache */ + $cache = $objectManager->create('Magento\Framework\App\Cache'); $cache->clean(); $this->_fileResolverMock = $this->getMockBuilder( 'Magento\Config\FileResolverInterface' diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php index 5fb605e057636d35351e7a206c21930a05f101cc..0d15e90650b1efab71f9be45bbda5c8707d83bf0 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php @@ -38,8 +38,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\App\Cache */ - $cache = $objectManager->create('Magento\App\Cache'); + /** @var $cache \Magento\Framework\App\Cache */ + $cache = $objectManager->create('Magento\Framework\App\Cache'); $cache->clean(); $fileResolverMock = $this->getMockBuilder( 'Magento\Config\FileResolverInterface' diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php index c6b7538c02224ad3c888de7641b79da25f1552bb..8136b871bc927a3f3b95995bb6df0cbe6f05d3c8 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php @@ -77,8 +77,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Sales\Model\Order\Status $status */ $status = $this->_objectManager->get('Magento\Sales\Model\Order\Status')->load($statusCode); - /** @var $scopeConfig \Magento\App\Config\ScopeConfigInterface */ - $scopeConfig = $this->_objectManager->get('Magento\App\Config\ScopeConfigInterface'); + /** @var $scopeConfig \Magento\Framework\App\Config\ScopeConfigInterface */ + $scopeConfig = $this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $defaultStatus = (string)$scopeConfig->getValue( 'payment/checkmo/order_status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE @@ -86,7 +86,12 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Core\Model\Resource\Config $config */ $config = $this->_objectManager->get('Magento\Core\Model\Resource\Config'); - $config->saveConfig('payment/checkmo/order_status', $statusCode, \Magento\App\ScopeInterface::SCOPE_DEFAULT, 0); + $config->saveConfig( + 'payment/checkmo/order_status', + $statusCode, + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + 0 + ); $this->_resetConfig(); @@ -128,8 +133,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->_resetConfig(); - /** @var $scopeConfig \Magento\App\Config\ScopeConfigInterface */ - $scopeConfig = $this->_objectManager->get('Magento\App\Config\ScopeConfigInterface'); + /** @var $scopeConfig \Magento\Framework\App\Config\ScopeConfigInterface */ + $scopeConfig = $this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $unassignedStatus = (string)$scopeConfig->getValue( 'payment/checkmo/order_status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE @@ -154,7 +159,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ protected function _resetConfig() { - $this->_objectManager->get('Magento\App\Config\ReinitableConfigInterface')->reinit(); + $this->_objectManager->get('Magento\Framework\App\Config\ReinitableConfigInterface')->reinit(); $this->_objectManager->create('Magento\Store\Model\StoreManagerInterface')->reinitStores(); } } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php index 38b8e7c382dca28c76d73887e1fe468904d2b6fb..1587a03b3652d2bd3eef92d15ffc8efa818ea23d 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php @@ -47,7 +47,7 @@ class AgreementTest extends \Magento\TestFramework\TestCase\AbstractController $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** Mock Request */ - $requestMock = $this->getMockForAbstractClass('Magento\App\RequestInterface', [], '', false); + $requestMock = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface', [], '', false); $requestMock ->expects($this->any()) ->method('getParam') @@ -105,7 +105,7 @@ class AgreementTest extends \Magento\TestFramework\TestCase\AbstractController ) ); $contextMock = $objectManager->create( - 'Magento\App\Action\Context', + 'Magento\Framework\App\Action\Context', [ 'objectManager' => $objectManagerMock, 'request' => $requestMock diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php index 778c608fd1d51715d68d9e5d24dfc1a5102222e6..f98f80b064bc716bf22aa67cdf5d526f56ce3831 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php @@ -66,7 +66,6 @@ class CheckoutTest extends \PHPUnit_Framework_TestCase $checkout->place('token'); $this->assertEquals(1, $quote->getCustomerId()); - $addressService->getAddresses($quote->getCustomerId()); $this->assertEquals(2, count($addressService->getAddresses($quote->getCustomerId()))); $this->assertEquals(1, $quote->getBillingAddress()->getCustomerAddressId()); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php index 6b7d8a4e22b3b8a2312fd8a798cc04007bfac636..a601ddf7bd988ae58f87d48a90e59bef5e13915c 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php @@ -38,7 +38,7 @@ class VoidTest extends \PHPUnit_Framework_TestCase $eventManager = $objectManager->get('Magento\Event\ManagerInterface'); $moduleList = $objectManager->get('Magento\Module\ModuleListInterface'); $paymentData = $objectManager->get('Magento\Payment\Helper\Data'); - $scopeConfig = $objectManager->get('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $logger = $objectManager->get('Magento\Logger'); $logAdapterFactory = $objectManager->get('Magento\Logger\AdapterFactory'); $localeDate = $objectManager->get('Magento\Stdlib\DateTime\TimezoneInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php index 8e6a005bed8af8c5e6bc7585ee1e32dc98d3380c..ac990dde5f78a72bca5c02e3365417bd9f46c685 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express.php @@ -23,14 +23,14 @@ */ \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'carriers/flatrate/active', 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'payment/paypal_express/active', 1, diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php index a84874f70c273bc0a56878331d6c53b2ab37703c..72a9700cda5e6e78c392285269663909e0fc6458 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_express_with_customer.php @@ -28,10 +28,10 @@ require __DIR__ . '/../../Customer/_files/customer_two_addresses.php'; \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\App\Config\MutableScopeConfigInterface') + ->get('Magento\Framework\App\Config\MutableScopeConfigInterface') ->setValue('carriers/flatrate/active', 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\App\Config\MutableScopeConfigInterface') + ->get('Magento\Framework\App\Config\MutableScopeConfigInterface') ->setValue('payment/paypal_express/active', 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); /** @var $product \Magento\Catalog\Model\Product */ @@ -104,4 +104,4 @@ $service->submitAllWithDataObject(); $order = $service->getOrder(); -$order->save(); \ No newline at end of file +$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php index 65c39dbda3ae0ac1095597768916f4c72b41592d..231953582f4132fd9d1de1b9ab6123471d13a2aa 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_payflow.php @@ -24,7 +24,7 @@ \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'carriers/flatrate/active', 1, diff --git a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php index d6905eaf202b4086266453b34e81013a9b838099..852f4ce78d9922862f3e4c688ef4c178ca22982c 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/_files/quote_payment_standard.php @@ -23,7 +23,7 @@ */ \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'carriers/flatrate/active', 1, diff --git a/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php index 2f95847d73fa875c53f5a168df6b1fcb16538122..1e264cd909eb458361630eead50b97f1be095888 100644 --- a/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Persistent/Model/Persistent/ConfigTest.php @@ -38,14 +38,16 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( - 'root' => \Magento\App\Filesystem::ROOT_DIR, - 'directories' => array(\Magento\App\Filesystem::MODULES_DIR => array('path' => dirname(__DIR__))) + 'root' => \Magento\Framework\App\Filesystem::ROOT_DIR, + 'directories' => array( + \Magento\Framework\App\Filesystem::MODULES_DIR => array('path' => dirname(__DIR__)) + ) ) ); $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('directoryList' => $directoryList) ); diff --git a/dev/tests/integration/testsuite/Magento/Profiler/Driver/Standard/Output/FirebugTest.php b/dev/tests/integration/testsuite/Magento/Profiler/Driver/Standard/Output/FirebugTest.php index 42779ded2dbacfc5cdf2db7b27821fda790658c4..38b6497fc220397903872890d0e67a6516a8981b 100644 --- a/dev/tests/integration/testsuite/Magento/Profiler/Driver/Standard/Output/FirebugTest.php +++ b/dev/tests/integration/testsuite/Magento/Profiler/Driver/Standard/Output/FirebugTest.php @@ -38,20 +38,20 @@ class FirebugTest extends \PHPUnit_Framework_TestCase protected $_response; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_request; protected function setUp() { $this->_response = $this->getMockBuilder( - '\Magento\App\Response\Http' + '\Magento\Framework\App\Response\Http' )->setMethods( array('canSendHeaders', 'sendHeaders') )->disableOriginalConstructor()->getMock(); $this->_response->expects($this->any())->method('canSendHeaders')->will($this->returnValue(true)); - $this->_request = $this->getMock('\Magento\App\Request\Http', array('getHeader'), array(), '', false); + $this->_request = $this->getMock('\Magento\Framework\App\Request\Http', array('getHeader'), array(), '', false); $this->_request->expects( $this->any() )->method( diff --git a/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Catalog/Product/View/PaymentTest.php b/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Catalog/Product/View/PaymentTest.php index 7c423dfe1591660679fd4a7868575c8c372fd18e..b51af313203c95f66307993e8542fd59d21d3f20 100644 --- a/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Catalog/Product/View/PaymentTest.php +++ b/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Catalog/Product/View/PaymentTest.php @@ -37,7 +37,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase { /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $product = $objectManager->create('Magento\Catalog\Model\Product'); $product->setIsRecurring('1'); diff --git a/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Payment/ViewTest.php b/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Payment/ViewTest.php index 967909560cbf2f9f0ecf58855cb8f507bcd463a9..afc0409e7dab8ae44d3f080509aeee30743583fb 100644 --- a/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Payment/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/RecurringPayment/Block/Payment/ViewTest.php @@ -70,7 +70,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase public function testToHtmlPropagatesUrl() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_block->setShouldPrepareInfoTabs(true); $childOne = $this->_layout->addBlock('Magento\View\Element\Text', 'child1', 'block'); $this->_layout->addToParentGroup('child1', 'info_tabs'); diff --git a/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/Adminhtml/RecurringPaymentTest.php b/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/Adminhtml/RecurringPaymentTest.php index 23c83f76d5c31d31ee31dda821a5d05fba8f2cdf..ac8bf1722200f1ca2e17e95f4bbde4bb0b96b5f7 100644 --- a/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/Adminhtml/RecurringPaymentTest.php +++ b/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/Adminhtml/RecurringPaymentTest.php @@ -21,13 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\RecurringPayment\Controller\Adminhtml; +use Magento\RecurringPayment\Controller\Adminhtml\RecurringPayment; + class RecurringPaymentTest extends \Magento\Backend\Utility\Controller { /** - * @magentoDataFixture Magento/Sales/_files/quote.php - * @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/RecurringPayment/_files/recurring_payment.php */ public function testCustomerGridAction() diff --git a/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/RecurringPaymentTest.php b/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/RecurringPaymentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7a711a944c1f1ade8a0fe7a8b4e151d66f17c402 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/RecurringPayment/Controller/RecurringPaymentTest.php @@ -0,0 +1,242 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\RecurringPayment\Controller; + +use Magento\RecurringPayment\Controller\Adminhtml\RecurringPayment; + +/** + * @magentoAppArea frontend + */ +class RecurringPaymentTest extends \Magento\TestFramework\TestCase\AbstractController +{ + /** + * Test if recurring payment is shown on the recurring payments grid (case with no recurring payments) + * + * This test is appropriate for dispatch() testing since it is executed implicitly. + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testPaymentsGridNoPayments() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $customerId = 1; + $customerSession->setCustomerId($customerId); + $coreRegistry = $objectManager->get('Magento\Registry'); + $this->assertNotEquals( + $customerId, + $coreRegistry->registry(\Magento\Customer\Controller\RegistryConstants::CURRENT_CUSTOMER_ID), + "Precondition failed: customer ID should have not been set to registry." + ); + + /** Execute SUT: dispatch() will be executed during any action invocation */ + $this->dispatch('sales/recurringPayment/index'); + + /** Ensure that customer ID was set to the registry correctly */ + $this->assertEquals( + $customerId, + $coreRegistry->registry(\Magento\Customer\Controller\RegistryConstants::CURRENT_CUSTOMER_ID), + "Customer ID should have been set to registry." + ); + /** Ensure that customer ID was set to the registry correctly */ + $this->assertContains( + 'There are no recurring payments yet', + $this->getResponse()->getBody(), + "No recurring payments are expected to be shown for current customer." + ); + } + + /** + * Test if recurring payment is shown on the recurring payments grid (case with recurring payment) + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/RecurringPayment/_files/recurring_payment.php + */ + public function testPaymentsGridWithPayments() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $customerId = 1; + $customerSession->setCustomerId($customerId); + + /** Execute SUT */ + $this->dispatch('sales/recurringPayment/index'); + + /** Ensure that customer ID was set to the registry correctly */ + $fixturePaymentExternalReferenceId = 'external-reference-1'; + $this->assertContains( + $fixturePaymentExternalReferenceId, + $this->getResponse()->getBody(), + "Fixture recurring payment is expected to be shown for current customer." + ); + } + + /** + * Test if orders related to recurring profile are filtered correctly by current customer (which has orders) + * + * @magentoDataFixture Magento/Sales/_files/order_with_customer.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testOrdersActionFilterByCustomerWithOrders() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** Preconditions */ + $fixtureCustomerId = 1; + /** Set filter by customer */ + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $customerSession->setCustomerId($fixtureCustomerId); + + /** Add relation between order and recurring payment */ + $fixtureOrderIncrementId = '100000001'; + /** @var \Magento\Sales\Model\Order $order */ + $order = $objectManager->create('Magento\Sales\Model\Order')->load($fixtureOrderIncrementId, 'increment_id'); + /** @var \Magento\RecurringPayment\Model\Payment $payment */ + $payment = $this->_createRecurringPayment($objectManager); + $payment->addOrderRelation($order->getId()); + $order->save(); + + $this->getRequest()->setParam(RecurringPayment::PARAM_PAYMENT, $payment->getId()); + + /** Execute SUT */ + $this->dispatch('sales/recurringPayment/orders'); + + /** Ensure that order related to recurring payment is shown on the grid */ + $this->assertContains( + 'Orders Based on This Payment', + $this->getResponse()->getBody(), + 'Orders related to current recurring payment for current customer are missing.' + ); + $this->assertContains( + $fixtureOrderIncrementId, + $this->getResponse()->getBody(), + 'Order related to current recurring payment for current customer is missing.' + ); + } + + /** + * Test if orders related to recurring profile are filtered correctly by current customer (with no orders) + * + * @magentoDataFixture Magento/Sales/_files/order_with_customer.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testOrdersActionFilterByCustomerWithoutOrders() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** Preconditions */ + /** Set filter by customer */ + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $customerSession->setCustomerId($this->_createSecondCustomer()->getId()); + + /** Add relation between order and recurring payment */ + $fixtureOrderIncrementId = '100000001'; + /** @var \Magento\Sales\Model\Order $order */ + $order = $objectManager->create('Magento\Sales\Model\Order')->load($fixtureOrderIncrementId, 'increment_id'); + /** @var \Magento\RecurringPayment\Model\Payment $payment */ + $payment = $this->_createRecurringPayment($objectManager); + $payment->addOrderRelation($order->getId()); + $order->save(); + + $this->getRequest()->setParam(RecurringPayment::PARAM_PAYMENT, $payment->getId()); + + /** Execute SUT */ + $this->dispatch('sales/recurringPayment/orders'); + + /** Ensure that order related to recurring payment is shown on the grid */ + $this->assertContains( + 'There are no orders yet', + $this->getResponse()->getBody(), + 'No orders should be shown as related to selected recurring payments for current customer.' + ); + $this->assertNotContains( + $fixtureOrderIncrementId, + $this->getResponse()->getBody(), + 'Order should be filtered out.' + ); + } + + /** + * Create new recurring payment (quote and customer should be created in fixtures). + * + * Note that magentoDbIsolation should be used in tests which execute this method. + * + * @return \Magento\RecurringPayment\Model\Payment + */ + protected function _createRecurringPayment() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $payment = $objectManager->create('Magento\RecurringPayment\Model\Payment'); + $payment + ->setQuote($objectManager->create('Magento\Sales\Model\Quote')->load(1)) + ->setPeriodUnit('year') + ->setPeriodFrequency(1) + ->setScheduleDescription('Test Schedule') + ->setBillingAmount(1) + ->setCurrencyCode('USD') + ->setMethodCode('paypal_express') + ->setInternalReferenceId('rp-1') + ->setReferenceId('external-reference-1') + ->setCustomerId(1) + ->save(); + $this->assertNotEmpty($payment->getId(), 'Precondition failed: payment was not created successfully.'); + return $payment; + } + + /** + * Create second customer. + * + * @return \Magento\Customer\Model\Customer + */ + protected function _createSecondCustomer() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $customer = $objectManager->create('Magento\Customer\Model\Customer'); + $customer + ->setWebsiteId(1) + ->setEntityId(2) + ->setEntityTypeId(1) + ->setAttributeSetId(0) + ->setEmail('customer_two@example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('Firstname') + ->setLastname('Lastname') + ->setDefaultBilling(1) + ->setDefaultShipping(1); + $customer->isObjectNew(true); + $customer->save(); + return $customer; + } +} diff --git a/dev/tests/integration/testsuite/Magento/RecurringPayment/_files/recurring_payment.php b/dev/tests/integration/testsuite/Magento/RecurringPayment/_files/recurring_payment.php index 0a60f0ca1ff00d81044f94d6ee0b7d59e106a234..57459d5707a26d402cdffc14cb5cd57db13c23c5 100644 --- a/dev/tests/integration/testsuite/Magento/RecurringPayment/_files/recurring_payment.php +++ b/dev/tests/integration/testsuite/Magento/RecurringPayment/_files/recurring_payment.php @@ -22,28 +22,21 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -// Requires Magento/Sales/_files/quote.php -// Requires Magento/Customer/_files/customer.php +require __DIR__ . '/../../Sales/_files/quote.php'; +require __DIR__ . '/../../Customer/_files/customer.php'; use Magento\TestFramework\Helper\Bootstrap; /** @var Magento\RecurringPayment\Model\Payment $payment */ $payment = Bootstrap::getObjectManager()->create('Magento\RecurringPayment\Model\Payment'); -$payment->setQuote( - Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote')->load(1) -)->setPeriodUnit( - 'year' -)->setPeriodFrequency( - 1 -)->setScheduleDescription( - 'Test Schedule' -)->setBillingAmount( - 1 -)->setCurrencyCode( - 'USD' -)->setMethodCode( - 'paypal_express' -)->setInternalReferenceId( - 'rp-1' -)->setCustomerId( - 1 -)->save(); +$payment + ->setQuote(Bootstrap::getObjectManager()->create('Magento\Sales\Model\Quote')->load(1)) + ->setPeriodUnit('year') + ->setPeriodFrequency(1) + ->setScheduleDescription('Test Schedule') + ->setBillingAmount(1) + ->setCurrencyCode('USD') + ->setMethodCode('paypal_express') + ->setInternalReferenceId('rp-1') + ->setReferenceId('external-reference-1') + ->setCustomerId(1) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Reports/_files/viewed_products.php b/dev/tests/integration/testsuite/Magento/Reports/_files/viewed_products.php index 132642503a6bc07f24551078846611dcbdd964e4..f818a4325cbbd1da8ea8898f8e79351b39793075 100644 --- a/dev/tests/integration/testsuite/Magento/Reports/_files/viewed_products.php +++ b/dev/tests/integration/testsuite/Magento/Reports/_files/viewed_products.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea('adminhtml') ->load(\Magento\Core\Model\App\Area::PART_CONFIG); diff --git a/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/MainTest.php b/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/MainTest.php index ab88f39e7f7c365059ecf5a887c0390e1005870f..65f50812f338b6dc88ce996bd5f0537a9c5e59e6 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/MainTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/MainTest.php @@ -36,7 +36,7 @@ class MainTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Service\V1\CustomerAccountService $service */ $service = $objectManager->create('Magento\Customer\Service\V1\CustomerAccountService'); $customer = $service->authenticate('customer@example.com', 'password'); - $request = $objectManager->get('Magento\App\RequestInterface'); + $request = $objectManager->get('Magento\Framework\App\RequestInterface'); $request->setParam('customerId', $customer->getId()); /** @var \Magento\View\LayoutInterface $layout */ $layout = $objectManager->get('Magento\View\LayoutInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php b/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php index edf9cb192e52e80d8c292fc7dce5a0fce3a86e7e..61470afafc1450b01e06a59fbd7f7b16a0745300 100644 --- a/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php +++ b/dev/tests/integration/testsuite/Magento/Rss/Block/WishlistTest.php @@ -65,8 +65,8 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist') ->loadByCustomerId($fixtureCustomerId); - /** @var \Magento\App\Helper\Context $contextHelper */ - $contextHelper = $this->_objectManager->create('Magento\App\Helper\Context'); + /** @var \Magento\Framework\App\Helper\Context $contextHelper */ + $contextHelper = $this->_objectManager->create('Magento\Framework\App\Helper\Context'); $wishlistHelper = $this->_objectManager->create('Magento\Rss\Helper\WishlistRss', [ @@ -83,7 +83,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase 'wishlistHelper' => $wishlistHelper ] ); - /** @var \Magento\App\Request\Http $request */ + /** @var \Magento\Framework\App\Request\Http $request */ $request = $contextHelper->getRequest(); $request->setParam('wishlist_id', $wishlist->getId()); $request->setParam('data', $this->_coreData->urlEncode($fixtureCustomerId)); diff --git a/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php b/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php index 88799cf4a052ed6ac79bd4b79f2d072eb393eaca..8a8ea3b53da117f42a86ff578428cf357f895f9f 100644 --- a/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php +++ b/dev/tests/integration/testsuite/Magento/Rss/Helper/WishlistRssTest.php @@ -44,7 +44,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Helper\Context + * @var \Magento\Framework\App\Helper\Context */ protected $_contextHelper; @@ -66,7 +66,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase $this->_customerSession = $this->_objectManager->create('Magento\Customer\Model\Session'); $this->_coreData = $this->_objectManager->create('Magento\Core\Helper\Data'); - $this->_contextHelper = $this->_objectManager->create('Magento\App\Helper\Context'); + $this->_contextHelper = $this->_objectManager->create('Magento\Framework\App\Helper\Context'); $request = $this->_contextHelper->getRequest(); $request->setParam('data', $this->_coreData->urlEncode($this->_fixtureCustomerId)); @@ -101,7 +101,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase ->loadByCustomerId($this->_fixtureCustomerId); $wishlist->load($wishlist->getId()); - /** @var \Magento\App\Request\Http $request */ + /** @var \Magento\Framework\App\Request\Http $request */ $request = $this->_contextHelper->getRequest(); $request->setParam('wishlist_id', $wishlist->getId()); @@ -119,7 +119,7 @@ class WishlistRssTest extends \PHPUnit_Framework_TestCase $wishlist = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist') ->loadByCustomerId($this->_fixtureCustomerId); - /** @var \Magento\App\Request\Http $request */ + /** @var \Magento\Framework\App\Request\Http $request */ $request = $this->_contextHelper->getRequest(); $request->setParam('wishlist_id', ''); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/FormTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/FormTest.php new file mode 100644 index 0000000000000000000000000000000000000000..842133cb2068160f87753271bde99045c6c3806e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/FormTest.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage; + +/** + * @magentoAppArea adminhtml + */ +class FormTest extends \PHPUnit_Framework_TestCase +{ + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoAppIsolation enabled + */ + public function testGetDefaultSenderWithCurrentCustomer() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $fixtureCustomerId = 1; + /** @var \Magento\Backend\Model\Session\Quote $backendQuoteSession */ + $backendQuoteSession = $objectManager->get('Magento\Backend\Model\Session\Quote'); + $backendQuoteSession->setCustomerId($fixtureCustomerId); + /** @var \Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage\Form $block */ + $block = $objectManager->create('Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage\Form'); + $block->setEntity(new \Magento\Object()); + + /** SUT execution and assertions */ + $this->assertEquals('Firstname Lastname', $block->getDefaultSender(), 'Sender name is invalid.'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php index f52a758c9b178707207ee329446e8f71a58c35f6..eb93148e2b653ab67dc5ab01fd84b2e8a88c6e5c 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php @@ -30,7 +30,8 @@ class TotalsTest extends \PHPUnit_Framework_TestCase { public function testToHtmlChildrenInitialized() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); /** @var $layout \Magento\View\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Reorder/SidebarTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Reorder/SidebarTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ef9877419cd85e3e0007017821dd9e6c17d6f2af --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Reorder/SidebarTest.php @@ -0,0 +1,114 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Block\Reorder; + +class SidebarTest extends \PHPUnit_Framework_TestCase +{ + /** + * @magentoDataFixture Magento/Sales/_files/order_with_customer.php + * @magentoAppIsolation enabled + */ + public function testInitOrdersCustomerWithOrder() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $fixtureCustomerId = 1; + $customerSession->setCustomerId($fixtureCustomerId); + /** @var \Magento\Framework\App\Http\Context $httpContext */ + $httpContext = $objectManager->get('Magento\Framework\App\Http\Context'); + $httpContext->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, true, false); + + /** Execute SUT implicitly: initOrders() is called in the construct */ + /** @var \Magento\Sales\Block\Reorder\Sidebar $sidebarBlock */ + $sidebarBlock = $objectManager->create('Magento\Sales\Block\Reorder\Sidebar'); + + /** Ensure that customer orders were selected for the block */ + $customerOrders = $sidebarBlock->getOrders(); + $this->assertEquals(1, $customerOrders->count(), 'Invalid orders quantity.'); + $order = $customerOrders->getFirstItem(); + $this->assertEquals($fixtureCustomerId, $order->getCustomerId(), 'Customer ID in order is invalid.'); + $fixtureOrderIncrementId = '100000001'; + $this->assertEquals($fixtureOrderIncrementId, $order->getIncrementId(), 'Order increment ID is invalid.'); + } + + /** + * @magentoDataFixture Magento/Sales/_files/order_with_customer.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + */ + public function testInitOrdersCustomerWithoutOrders() + { + /** Preconditions */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\Session $customerSession */ + $customerSession = $objectManager->get('Magento\Customer\Model\Session'); + $secondCustomer = $this->createSecondCustomer(); + $customerSession->setCustomerId($secondCustomer->getId()); + /** @var \Magento\Framework\App\Http\Context $httpContext */ + $httpContext = $objectManager->get('Magento\Framework\App\Http\Context'); + $httpContext->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, true, false); + + /** Execute SUT implicitly: initOrders() is called in the construct */ + /** @var \Magento\Sales\Block\Reorder\Sidebar $sidebarBlock */ + $sidebarBlock = $objectManager->create('Magento\Sales\Block\Reorder\Sidebar'); + + /** Ensure that customer orders were selected for the block */ + $customerOrders = $sidebarBlock->getOrders(); + $this->assertEquals(0, $customerOrders->count(), 'Filter by customer is applied to collection incorrectly.'); + } + + /* + * Create customer which does not have any orders associated with him. + * + * Please note that tests which use this method must have DB isolation enabled. + * + * @return \Magento\Customer\Model\Customer + */ + public function createSecondCustomer() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Customer\Model\Customer $customer */ + $customer = $objectManager->create('Magento\Customer\Model\Customer'); + $customer->setWebsiteId(1) + ->setEntityId(2) + ->setEntityTypeId(1) + ->setAttributeSetId(0) + ->setEmail('customer2@search.example.com') + ->setPassword('password') + ->setGroupId(1) + ->setStoreId(1) + ->setIsActive(1) + ->setFirstname('Firstname2') + ->setLastname('Lastname2') + ->setDefaultBilling(2) + ->setDefaultShipping(2) + ->setCreatedAt('2010-02-28 15:52:26'); + $customer->isObjectNew(true); + $customer->save(); + return $customer; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php index b7c94c44d7078e3bbdf285af62dbc12f786a9fea..ef6b3a4c4b28665d3f6e3e4077548ae37a36c3ef 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php @@ -176,8 +176,14 @@ class CreateTest extends \Magento\Backend\Utility\Controller $this->assertContains('>Quantity</label>', $body); $this->assertContains('>Test Configurable</label>', $body); $this->assertContains('"code":"test_configurable","label":"Test Configurable"', $body); - $this->assertContains('"label":"Option 1","price":"5","oldPrice":"5","products":[', $body); - $this->assertContains('"label":"Option 2","price":"5","oldPrice":"5","products":[', $body); + $this->assertContains( + '"label":"Option 1","price":"5","oldPrice":"5","inclTaxPrice":"5","exclTaxPrice":"5","products":[', + $body + ); + $this->assertContains( + '"label":"Option 2","price":"5","oldPrice":"5","inclTaxPrice":"5","exclTaxPrice":"5","products":[', + $body + ); $this->assertContains('"basePrice":"100","oldPrice":"100","productId":"1","chooseText":"Choose an Option..."', $body); } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/AbstractTest.php index a79a4c4a55e906c97b982bd5e035b52a077bb7c5..ef91fbe7bd22a749daca7a1bcaca8e74985007f6 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/AbstractTest.php @@ -46,7 +46,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testAfterCommitCallbackOrderGridNotInvoked() { $adapter = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Resource' + 'Magento\Framework\App\Resource' )->getConnection( 'core_write' ); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php index d004c7ed23ec7d0deeca4b0b65d7bd2bc8f263b7..a968ac5816568c6766cceea27a19288a54368869 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php @@ -33,7 +33,8 @@ class ShipmentTest extends \PHPUnit_Framework_TestCase */ public function testSendEmail() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order'); $order->loadByIncrementId('100000001'); $order->setCustomerEmail('customer@example.com'); @@ -65,7 +66,7 @@ class ShipmentTest extends \PHPUnit_Framework_TestCase public function testPackages() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $order = $objectManager->create('Magento\Sales\Model\Order'); $order->loadByIncrementId('100000001'); $order->setCustomerEmail('customer@example.com'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php index 0132193e22204b086fbb7fd5d824cd84d4f3b57a..615ef104c68af4cc36dc7d32f50612c71ca9a9af 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php @@ -68,6 +68,15 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->_address->setQuote($this->_quote); } + protected function tearDown() + { + /** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */ + $customerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Customer\Model\CustomerRegistry'); + //Cleanup customer from registry + $customerRegistry->remove(1); + } + /** * same_as_billing must be equal 0 if billing address is being saved * diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Service/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Service/QuoteTest.php index 08df0e13b14e3e7d8394c096369d961189c517e6..fa7ed6657786e87258ef7d097fc2b53347197e2c 100755 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Service/QuoteTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Service/QuoteTest.php @@ -123,7 +123,7 @@ class QuoteTest extends \PHPUnit_Framework_TestCase )->setAddresses( $this->getSampleAddressEntity() )->create(); - $customerData = $this->_customerAccountService->createAccount($customerDetails, 'password'); + $customerData = $this->_customerAccountService->createCustomer($customerDetails, 'password'); $existingCustomerId = $customerData->getId(); $customerData = $this->_customerBuilder->mergeDataObjectWithArray( diff --git a/dev/tests/integration/testsuite/Magento/Session/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Session/ConfigTest.php index 7308fe14c969354cf6f46fa7f66c73d20ec281ca..c8a21a43060f5d8923e5e750f8b2a7c2135790d4 100644 --- a/dev/tests/integration/testsuite/Magento/Session/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Session/ConfigTest.php @@ -67,7 +67,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { $this->assertEquals( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( 'session' ), diff --git a/dev/tests/integration/testsuite/Magento/Session/SaveHandler/DbTableTest.php b/dev/tests/integration/testsuite/Magento/Session/SaveHandler/DbTableTest.php index aa951fed95033190de9c775cfe1ee74cd8ab908f..19bf72fcfe0e2dbe1750a3425ea71a883a5fea56 100644 --- a/dev/tests/integration/testsuite/Magento/Session/SaveHandler/DbTableTest.php +++ b/dev/tests/integration/testsuite/Magento/Session/SaveHandler/DbTableTest.php @@ -101,8 +101,8 @@ class DbTableTest extends \PHPUnit_Framework_TestCase $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_model = $this->_objectManager->get('Magento\Session\SaveHandler\DbTable'); - /** @var $resource \Magento\App\Resource */ - $resource = $this->_objectManager->get('Magento\App\Resource'); + /** @var $resource \Magento\Framework\App\Resource */ + $resource = $this->_objectManager->get('Magento\Framework\App\Resource'); $this->_connection = $resource->getConnection('core_write'); $this->_sessionTable = $resource->getTableName('core_session'); diff --git a/dev/tests/integration/testsuite/Magento/Session/SessionManagerTest.php b/dev/tests/integration/testsuite/Magento/Session/SessionManagerTest.php index 16c38151c8bfc3762eab34987d67a3a87fae85e0..29f5c50965531bb41837b8d6c47474e09bfb9d40 100644 --- a/dev/tests/integration/testsuite/Magento/Session/SessionManagerTest.php +++ b/dev/tests/integration/testsuite/Magento/Session/SessionManagerTest.php @@ -47,7 +47,7 @@ class SessionManagerTest extends \PHPUnit_Framework_TestCase $this->_model = $objectManager->create( 'Magento\Session\SessionManager', array( - $objectManager->get('Magento\App\Request\Http'), + $objectManager->get('Magento\Framework\App\Request\Http'), $this->_sidResolver, $objectManager->get('Magento\Session\Config\ConfigInterface'), $objectManager->get('Magento\Session\SaveHandlerInterface'), diff --git a/dev/tests/integration/testsuite/Magento/Session/SidResolverTest.php b/dev/tests/integration/testsuite/Magento/Session/SidResolverTest.php index eafa759cebb35704e6d83da293c1c21c1e7867da..740a5d0e775a2866eb0c97315dd01b325b1704c5 100644 --- a/dev/tests/integration/testsuite/Magento/Session/SidResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Session/SidResolverTest.php @@ -42,7 +42,7 @@ class SidResolverTest extends \PHPUnit_Framework_TestCase protected $store; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -69,7 +69,7 @@ class SidResolverTest extends \PHPUnit_Framework_TestCase $this->session = $objectManager->get('Magento\Session\Generic'); $this->scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->setMethods( array('getValue') )->disableOriginalConstructor()->getMockForAbstractClass(); diff --git a/dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_products.php b/dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_products.php index dba60b7654a2e82aaada206e7b16ad7066767d23..8441162eea305737d23b68096151677cc838bb9d 100644 --- a/dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_products.php +++ b/dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_products.php @@ -31,9 +31,9 @@ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $config = $objectManager->get('Magento\Catalog\Model\Product\Media\Config'); /** @var \Magento\Filesystem\Directory\WriteInterface $mediaDirectory */ -$filesystem = $objectManager->get('Magento\App\Filesystem'); -$mediaPath = $filesystem->getPath(\Magento\App\Filesystem::MEDIA_DIR); -$mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); +$filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); +$mediaPath = $filesystem->getPath(\Magento\Framework\App\Filesystem::MEDIA_DIR); +$mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $baseTmpMediaPath = $config->getBaseTmpMediaPath(); $mediaDirectory->create($baseTmpMediaPath); diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php index 328d7b2f35971196e332068510a2a495c95cb66d..d75eb5ed1d759fea93e3cf2918a85470453370a6 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php @@ -51,16 +51,16 @@ class StoreTest extends \PHPUnit_Framework_TestCase 'registry' => $objectManager->get('Magento\Registry'), 'resource' => $objectManager->get('Magento\Store\Model\Resource\Store'), 'coreFileStorageDatabase' => $objectManager->get('Magento\Core\Helper\File\Storage\Database'), - 'configCacheType' => $objectManager->get('Magento\App\Cache\Type\Config'), + 'configCacheType' => $objectManager->get('Magento\Framework\App\Cache\Type\Config'), 'url' => $objectManager->get('Magento\Url'), - 'request' => $objectManager->get('Magento\App\RequestInterface'), + 'request' => $objectManager->get('Magento\Framework\App\RequestInterface'), 'configDataResource' => $objectManager->get('Magento\Core\Model\Resource\Config\Data'), - 'filesystem' => $objectManager->get('Magento\App\Filesystem'), - 'config' => $objectManager->get('Magento\App\Config\ReinitableConfigInterface'), + 'filesystem' => $objectManager->get('Magento\Framework\App\Filesystem'), + 'config' => $objectManager->get('Magento\Framework\App\Config\ReinitableConfigInterface'), 'storeManager' => $objectManager->get('Magento\Store\Model\StoreManager'), 'sidResolver' => $objectManager->get('Magento\Session\SidResolverInterface'), 'cookie' => $objectManager->get('Magento\Stdlib\Cookie'), - 'httpContext' => $objectManager->get('Magento\App\Http\Context') + 'httpContext' => $objectManager->get('Magento\Framework\App\Http\Context') ); return $this->getMock('Magento\Store\Model\Store', array('getUrl'), $this->_modelParams); @@ -125,14 +125,14 @@ class StoreTest extends \PHPUnit_Framework_TestCase /* config operations require store to be loaded */ $this->_model->load('default'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\Store\Model\Store::XML_PATH_USE_REWRITES, $useRewrites, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, $useStoreCode, @@ -187,8 +187,8 @@ class StoreTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::PUB_DIR => array('uri' => '') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::PUB_DIR => array('uri' => '') ) ) ); @@ -224,14 +224,14 @@ class StoreTest extends \PHPUnit_Framework_TestCase /* config operations require store to be loaded */ $this->_model->load('default'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\Store\Model\Store::XML_PATH_USE_REWRITES, false, \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( \Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, $useStoreCode, @@ -365,8 +365,8 @@ class StoreTest extends \PHPUnit_Framework_TestCase public function testIsUseStoreInUrl($isInstalled, $storeInUrl, $disableStoreInUrl, $expectedResult) { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $configMock = $this->getMock('Magento\App\Config\ReinitableConfigInterface'); - $appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false, false); + $configMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); + $appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false, false); $appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue($isInstalled)); $params = $this->_modelParams; diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php index cf3c30c6bc4c5a63e686c740300c404875974d71..6706fb04571d9c3bfa94e1ed812738bfc0c62c0b 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php @@ -37,7 +37,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase /** * @magentoDbIsolation enabled */ - public function testGetAssignedToObjects() + public function testIsAssignedToObjects() { /** @var $objectManager \Magento\TestFramework\ObjectManager */ $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -60,13 +60,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase /** @var $model \Magento\Tax\Model\TaxClass\Type\Customer */ $model = $this->_objectManager->create('Magento\Tax\Model\TaxClass\Type\Customer'); $model->setId($taxClassId); - /** @var $collection \Magento\Core\Model\Resource\Db\Collection\AbstractCollection */ - $collection = $model->getAssignedToObjects(); - $this->assertEquals($taxClassId, $collection->getFirstItem()->getData('tax_class_id')); - $this->assertEquals(self::GROUP_CODE, $collection->getFirstItem()->getData('customer_group_code')); - $dataObjectArray = $model->getAssignedDataObjects(); - $this->assertEquals($taxClassId, $dataObjectArray[0]->getTaxClassId()); - $this->assertEquals(self::GROUP_CODE, $dataObjectArray[0]->getCode()); + $this->assertTrue($model->isAssignedToObjects()); } } diff --git a/dev/tests/integration/testsuite/Magento/Tax/Pricing/AdjustmentTest.php b/dev/tests/integration/testsuite/Magento/Tax/Pricing/AdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a48390481e2838b765ce81e49d5eca3398206e18 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Tax/Pricing/AdjustmentTest.php @@ -0,0 +1,145 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Tax\Pricing; + +class AdjustmentTest extends \PHPUnit_Framework_TestCase +{ + /** + * @param $isShippingPriceExcludeTax + * @param $expectedResult + */ + protected function isIncludedInBasePricePrice($isShippingPriceExcludeTax, $expectedResult) + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Tax\Model\Config $config */ + $config = $objectManager->get('Magento\Tax\Model\Config'); + /** @var \Magento\Tax\Pricing\Adjustment $model */ + $model = $objectManager->create('Magento\Tax\Pricing\Adjustment'); + $config->setNeedUseShippingExcludeTax($isShippingPriceExcludeTax); + // Run tested method + $result = $model->isIncludedInBasePrice(); + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @param bool $isShippingPriceExcludeTax + * @param bool $expectedResult + * @magentoConfigFixture current_store tax/calculation/price_includes_tax 1 + * @dataProvider IsIncludedInBasePricePriceIncludeTaxEnabledDataProvider + */ + public function testIsIncludedInBasePricePriceIncludeTacEnabled($isShippingPriceExcludeTax, $expectedResult) + { + $this->isIncludedInBasePricePrice($isShippingPriceExcludeTax, $expectedResult); + } + + /** + * @param bool $isShippingPriceExcludeTax + * @param bool $expectedResult + * @magentoConfigFixture current_store tax/calculation/price_includes_tax 0 + * @dataProvider IsIncludedInBasePricePriceIncludeTaxDisabledDataProvider + */ + public function testIsIncludedInBasePricePriceIncludeTacDisabled($isShippingPriceExcludeTax, $expectedResult) + { + $this->isIncludedInBasePricePrice($isShippingPriceExcludeTax, $expectedResult); + } + + /** + * @return array + */ + public function IsIncludedInBasePricePriceIncludeTaxEnabledDataProvider() + { + return [ + [0, true], + [1, true], + ]; + } + + /** + * @return array + */ + public function IsIncludedInBasePricePriceIncludeTaxDisabledDataProvider() + { + return [ + [0, false], + [1, true], + ]; + } + + /** + * test template for isIncludedInDisplayPrice + * + * @param $expectedResult + */ + protected function isIncludedInDisplayPrice($expectedResult) + { + // Instantiate objects + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Tax\Pricing\Adjustment $model */ + $model = $objectManager->create('Magento\Tax\Pricing\Adjustment'); + // Run tested method + $result = $model->isIncludedInDisplayPrice(); + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store tax/display/type 1 + */ + public function testIsIncludedInDisplayPriceExcludingTax() + { + $this->isIncludedInDisplayPrice(false); + } + + /** + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store tax/display/type 2 + */ + public function testIsIncludedInDisplayPriceIncludingTax() + { + $this->isIncludedInDisplayPrice(true); + } + + /** + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store tax/display/type 3 + */ + public function testIsIncludedInDisplayPriceBoth() + { + $this->isIncludedInDisplayPrice(true); + } + + /** + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store tax/display/type 100500 + */ + public function testIsIncludedInDisplayPriceWrongValue() + { + $this->isIncludedInDisplayPrice(false); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php index bb8feac49f745f53382a0ca4597d9b2c22faf77d..f01954ac7d4dddac76835327b79b697d0a6d50c3 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php @@ -45,9 +45,9 @@ class AclConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_schemeFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::LIB_DIR + \Magento\Framework\App\Filesystem::LIB_DIR ) . '/Magento/Acl/etc/acl.xsd'; } @@ -74,9 +74,9 @@ class AclConfigFilesTest extends \PHPUnit_Framework_TestCase { $fileList = glob( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::APP_DIR + \Magento\Framework\App\Filesystem::APP_DIR ) . '/*/*/*/etc/adminhtml/acl.xml' ); $dataProviderResult = array(); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php index e3de637967cf08de10ad5a188bf62ec16090609c..f7c975609ac835c8c8cab1b4eb41240b97d8e246 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php @@ -47,7 +47,7 @@ class BlockInstantiationTest extends \Magento\TestFramework\TestCase\AbstractInt $area ); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Http\Context' + 'Magento\Framework\App\Http\Context' ); $context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); $context->setValue( @@ -142,7 +142,7 @@ class BlockInstantiationTest extends \Magento\TestFramework\TestCase\AbstractInt $area = 'adminhtml'; } \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE )->load( diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CrontabConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CrontabConfigFilesTest.php index 588cab5705bbd4bc038eca77ee73648b998394ad..3cf46e8f2b596823e599b937dd214e318d723059 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CrontabConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/CrontabConfigFilesTest.php @@ -27,7 +27,7 @@ class CrontabConfigFilesTest extends \PHPUnit_Framework_TestCase { /** * attributes represent merging rules - * copied from original class \Magento\App\Route\Config\Reader + * copied from original class \Magento\Framework\App\Route\Config\Reader * * @var array */ diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php index 72bdcd91c7cd5c784ec1d01c8d1cdbdced4af144..5779828e8778fc24a37b9c5a31ef805bd704b70e 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php @@ -47,9 +47,9 @@ class DiConfigFilesTest extends \PHPUnit_Framework_TestCase { //init primary configs $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $configDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::CONFIG_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $configDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::CONFIG_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); self::$_primaryFiles = $fileIteratorFactory->create( $configDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php index 7444cd8f8abf20bad18b16e2f051d0cf967f7a1d..0e41f4b7ebe95712a08bd46f300a97e31d6b8485 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php @@ -33,9 +33,9 @@ class EavAttributesConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php index ea0dfd939239bfa706e0ead4879291829f07b5f8..068ca7346be48413a303030b772aa8ed6160ba25 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php @@ -33,9 +33,9 @@ class ExportConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php index 3aafbd049de576a88735ec3a8dd69a7576d05563..3745bc71e9982c9b8830824a2b397948f3442ca7 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php @@ -33,9 +33,9 @@ class ImportConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php index 574ffc8c096ca7fa22c90020e1e55a264cc6f90e..67a2076721bfcffdf46dd627610981d31419303b 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php @@ -33,9 +33,9 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php index 4a8749404cfb30b11c87d9c93e9962c8b24b240c..f855e342805d4ccc6dd7f33072e5c54b36107646 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/MviewConfigFilesTest.php @@ -45,9 +45,9 @@ class MviewConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->schemeFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::LIB_DIR + \Magento\Framework\App\Filesystem::LIB_DIR ) . '/Magento/Mview/etc/mview.xsd'; } @@ -74,9 +74,9 @@ class MviewConfigFilesTest extends \PHPUnit_Framework_TestCase { $fileList = glob( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::APP_DIR + \Magento\Framework\App\Filesystem::APP_DIR ) . '/*/*/*/etc/mview.xml' ); $dataProviderResult = array(); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/NewIndexerConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/NewIndexerConfigFilesTest.php index 7cc6442b79859ad5f45675d0605854a8afe89411..788941eb464b2169bae69bcfb45e9a0c8483f6cf 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/NewIndexerConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/NewIndexerConfigFilesTest.php @@ -45,9 +45,9 @@ class NewIndexerConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->schemeFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::APP_DIR + \Magento\Framework\App\Filesystem::APP_DIR ) . '/code/Magento/Indexer/etc/indexer.xsd'; } @@ -74,9 +74,9 @@ class NewIndexerConfigFilesTest extends \PHPUnit_Framework_TestCase { $fileList = glob( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::APP_DIR + \Magento\Framework\App\Filesystem::APP_DIR ) . '/*/*/*/etc/indexer.xml' ); $dataProviderResult = array(); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php index 8398621de17ba42176d27fce034f16c7b579bc5d..a8028cbb7f9c4ddc65f7e7536fdb8f2a84649ef8 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php @@ -34,9 +34,9 @@ class ProductOptionsConfigFilesTest extends \PHPUnit_Framework_TestCase { //init primary configs $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php index c2ae155463cb7fa99079ed9d609a8324bee4a724..bc390d9e005f93b70755772289a1ab2689f696ea 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php @@ -33,9 +33,9 @@ class ProductTypesConfigFilesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php index e83d85a85829b5163aa5f2de4583320116b500f4..84ca175fc8cd83b64e256fc1fa84851f6504d869 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php @@ -26,16 +26,16 @@ namespace Magento\Test\Integrity\Modular; class ResourcesConfigFilesTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource\Config\Reader + * @var \Magento\Framework\App\Resource\Config\Reader */ protected $_model; protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $filesystem \Magento\App\Filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - $modulesDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + /** @var $filesystem \Magento\Framework\App\Filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory'); $xmlFiles = $fileIteratorFactory->create( $modulesDirectory, @@ -46,11 +46,11 @@ class ResourcesConfigFilesTest extends \PHPUnit_Framework_TestCase $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($xmlFiles)); $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface'); $validationStateMock->expects($this->any())->method('isValidated')->will($this->returnValue(true)); - $localConfigMock = $this->getMock('Magento\App\Arguments', array(), array(), '', false); + $localConfigMock = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); $localConfigMock->expects($this->any())->method('getConfiguration')->will($this->returnValue(array())); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_model = $objectManager->create( - 'Magento\App\Resource\Config\Reader', + 'Magento\Framework\App\Resource\Config\Reader', array( 'fileResolver' => $fileResolverMock, 'validationState' => $validationStateMock, diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php index baeaefdbce8a98f6affea3675f0ee3f82953a5ea..e36bf75deaf797972e70b59daa17066df05e4416 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/RouteConfigFilesTest.php @@ -27,7 +27,7 @@ class RouteConfigFilesTest extends \PHPUnit_Framework_TestCase { /** * attributes represent merging rules - * copied from original class \Magento\App\Route\Config\Reader + * copied from original class \Magento\Framework\App\Route\Config\Reader * @var array */ protected $_idAttributes = array( @@ -54,8 +54,8 @@ class RouteConfigFilesTest extends \PHPUnit_Framework_TestCase { global $magentoBaseDir; - $this->_schemaFile = $magentoBaseDir . '/lib/Magento/App/etc/routes.xsd'; - $this->_mergedSchemaFile = $magentoBaseDir . '/lib/Magento/App/etc/routes_merged.xsd'; + $this->_schemaFile = $magentoBaseDir . '/lib/Magento/Framework/App/etc/routes.xsd'; + $this->_mergedSchemaFile = $magentoBaseDir . '/lib/Magento/Framework/App/etc/routes_merged.xsd'; } public function testRouteConfigsValidation() diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SalesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SalesConfigFilesTest.php index fa5abf528052df666912a77fe60f27f834c4bf0f..7842d3d689cae32ed5968d844534c4ab151a78a6 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SalesConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SalesConfigFilesTest.php @@ -27,7 +27,7 @@ class SalesConfigFilesTest extends \PHPUnit_Framework_TestCase { /** * attributes represent merging rules - * copied from original namespace Magento\App\Route\Config; + * copied from original namespace Magento\Framework\App\Route\Config; * * class Reader * diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php index cb9ded784871e1ef5cf591d6e5684f3ade0b9dc1..21124cb1aca9dfacda02707603f817a671694a7a 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/SystemConfigFilesTest.php @@ -33,11 +33,12 @@ class SystemConfigFilesTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); // disable config caching to not pollute it - /** @var $cacheState \Magento\App\Cache\StateInterface */ - $cacheState = $objectManager->get('Magento\App\Cache\StateInterface'); - $cacheState->setEnabled(\Magento\App\Cache\Type\Config::TYPE_IDENTIFIER, false); + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = $objectManager->get('Magento\Framework\App\Cache\StateInterface'); + $cacheState->setEnabled(\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, false); - $modulesDir = $objectManager->get('Magento\App\Filesystem')->getPath(\Magento\App\Filesystem::MODULES_DIR); + $modulesDir = $objectManager->get('Magento\Framework\App\Filesystem') + ->getPath(\Magento\Framework\App\Filesystem::MODULES_DIR); $fileList = glob($modulesDir . '/*/*/etc/adminhtml/system.xml'); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php index f988569aaa52b04532245de055d700e7fcc1b492..40b39f834d569dcf20c6f2292573d7b5b4060df8 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php @@ -101,7 +101,7 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit } \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( $area )->load( @@ -113,12 +113,12 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit $area ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->setAreaCode( $area ); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Http\Context' + 'Magento\Framework\App\Http\Context' ); $context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); $context->setValue( diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php index 60bf94a54beb2592192453fbce311bba1d9f158e..2d1c284b8c1ed24b7b4d3b799ea2867677670f0c 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php @@ -37,9 +37,9 @@ class ViewConfigFilesTest extends \PHPUnit_Framework_TestCase $domConfig = new \Magento\Config\Dom($file); $result = $domConfig->validate( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::LIB_DIR + \Magento\Framework\App\Filesystem::LIB_DIR ) . '/Magento/Config/etc/view.xsd', $errors ); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php index 158eba67b8cbfd3258ae6013e53901f6d721981b..9c246c060b82a6a91f8cf945867f46431c6d5a27 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewFilesTest.php @@ -32,10 +32,10 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity { $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); $invoker( - /** - * @param string $application - * @param string $file - */ + /** + * @param string $application + * @param string $file + */ function ($application, $file) { \Magento\TestFramework\Helper\Bootstrap::getInstance() ->loadArea($application); @@ -45,6 +45,17 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity $result = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\FileSystem') ->getViewFile($file); + + $fileInfo = pathinfo($result); + if ($fileInfo['extension'] === 'css') { + if (!file_exists($result)) { + $file = str_replace('.css', '.less', $file); + $result = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\View\FileSystem') + ->getViewFile($file); + }; + } + $this->assertFileExists($result); }, $this->viewFilesFromModulesViewDataProvider() @@ -94,8 +105,8 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity continue; } foreach (new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($viewAppDir->getRealPath()) - ) as $fileInfo) { + new \RecursiveDirectoryIterator($viewAppDir->getRealPath()) + ) as $fileInfo) { $references = $this->_findReferencesToViewFile($fileInfo); if (!isset($files[$area])) { $files[$area] = $references; @@ -136,18 +147,18 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity { $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); $invoker( - /** - * getViewUrl() hard-coded in the php-files - * - * @param string $application - * @param string $file - */ + /** + * getViewUrl() hard-coded in the php-files + * + * @param string $application + * @param string $file + */ function ($application, $file) { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->setAreaCode( - $application - ); + $application + ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDefaultDesignTheme(); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php index 9489462dacbfb4d6b72219db1f2ef7ced789d45f..52dc44142ffc5fb6551c9f97f3aacb516ea1ddc5 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php @@ -39,7 +39,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity protected $viewFileSystem; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -47,7 +47,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager(); $this->viewFileSystem = $this->objectManager->get('Magento\View\FileSystem'); - $this->filesystem = $this->objectManager->get('Magento\App\Filesystem'); + $this->filesystem = $this->objectManager->get('Magento\Framework\App\Filesystem'); $this->objectManager->configure( array('preferences' => array('Magento\Core\Model\Theme' => 'Magento\Core\Model\Theme\Data')) ); @@ -73,7 +73,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity ); /** @var $lessPreProcessor \Magento\Less\PreProcessor */ $lessPreProcessor = $this->objectManager->create('Magento\Less\PreProcessor'); - $directoryRead = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directoryRead = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); /** * Solution for \Magento\View\Layout\File\Source\Base aggregator, it depends on theme and area */ @@ -114,7 +114,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity */ public function testViewFilesFromThemes() { - $directoryRead = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directoryRead = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); /** @var $viewService \Magento\View\Service */ $viewService = $this->objectManager->get('Magento\View\Service'); $invoker = new \Magento\TestFramework\Utility\AggregateInvoker($this); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php index 3c75b7a97ebe0265204adec0743d1b842daaf272..156bf3a5062b38efae73f75653b79f62c65d7971 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php @@ -41,7 +41,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase } $this->_validateConfigFile( $file, - $this->getPath(\Magento\App\Filesystem::LIB_DIR) . '/Magento/Config/etc/view.xsd' + $this->getPath(\Magento\Framework\App\Filesystem::LIB_DIR) . '/Magento/Config/etc/view.xsd' ); } @@ -51,7 +51,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function viewConfigFileDataProvider() { $result = array(); - $files = glob($this->getPath(\Magento\App\Filesystem::THEMES_DIR) . '/*/*/view.xml'); + $files = glob($this->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR) . '/*/*/view.xml'); foreach ($files as $file) { $result[$file] = array($file); } @@ -73,7 +73,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function themeConfigFileExistsDataProvider() { $result = array(); - $files = glob($this->getPath(\Magento\App\Filesystem::THEMES_DIR) . '/*/*/*', GLOB_ONLYDIR); + $files = glob($this->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR) . '/*/*/*', GLOB_ONLYDIR); foreach ($files as $themeDir) { $result[$themeDir] = array($themeDir); } @@ -88,7 +88,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase { $this->_validateConfigFile( $file, - $this->getPath(\Magento\App\Filesystem::LIB_DIR) . '/Magento/Config/etc/theme.xsd' + $this->getPath(\Magento\Framework\App\Filesystem::LIB_DIR) . '/Magento/Config/etc/theme.xsd' ); } @@ -112,7 +112,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase public function themeConfigFileDataProvider() { $result = array(); - $files = glob($this->getPath(\Magento\App\Filesystem::THEMES_DIR) . '/*/*/*/theme.xml'); + $files = glob($this->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR) . '/*/*/*/theme.xml'); foreach ($files as $file) { $result[$file] = array($file); } @@ -147,7 +147,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase protected function getPath($code) { return \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( $code ); diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php index fd0c92bd04360ab35c9553ee31570d13e720a7c5..09ed3169e6ea647f36bf624f715071c7b7c423d7 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/ProcessorTest.php @@ -60,8 +60,9 @@ class ProcessorTest extends \PHPUnit_Framework_TestCase } $this->_testDir = realpath(__DIR__ . '/_files') . '/'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - $this->_varDir = $filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) . '/references/'; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + $this->_varDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) . '/references/'; mkdir($this->_varDir, 0777, true); $this->_formatter = new Formatter(); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php index 48d4498e71dc35ed6c9532b52ce338f41b9b5987..5795e61409f41876ca2358153d8d7cf6d7056af5 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php @@ -35,7 +35,8 @@ class BreadcrumbsTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\LayoutInterface' )->createBlock( diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php index 023f65f0660a5ff06e59852e3ad60f5855ab375b..1677314ee4e10a41b2f54db5bb320e94d8afdb23 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php @@ -35,7 +35,8 @@ class FooterTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\DesignInterface'); $this->_theme = $design->setDefaultDesignTheme()->getDesignTheme(); } @@ -43,7 +44,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase public function testGetCacheKeyInfo() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $context = $objectManager->get('Magento\App\Http\Context'); + $context = $objectManager->get('Magento\Framework\App\Http\Context'); $context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); $block = $objectManager->get('Magento\View\LayoutInterface')->createBlock('Magento\Theme\Block\Html\Footer'); $storeId = $objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore()->getId(); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php index d4982cecf2cc9d058fb026589fd8714cc379f4ed..69d5f3f3c266da6e2c900cccc5a2b179dd21101a 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php @@ -35,7 +35,8 @@ class HeadTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDesignTheme( diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeaderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeaderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5c04d103b51cf79731923f9b36925f99f445e558 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeaderTest.php @@ -0,0 +1,92 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Theme\Block\Html; + +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test for Magento\Theme\Block\Html\Header + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoAppArea frontend + */ +class HeaderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Theme\Block\Html\Header + */ + protected $block; + + /** + * @var \Magento\Framework\App\Http\Context + */ + protected $context; + + /** + * Setup SUT + */ + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->context = $objectManager->get('Magento\Framework\App\Http\Context'); + $this->context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); + + //Setup customer session + $customerIdFromFixture = 1; + $customerSession = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session'); + /** + * @var $customerService \Magento\Customer\Service\V1\CustomerAccountServiceInterface + */ + $customerService = Bootstrap::getObjectManager() + ->create('Magento\Customer\Service\V1\CustomerAccountServiceInterface'); + $customerData = $customerService->getCustomer($customerIdFromFixture); + $customerSession->setCustomerDataObject($customerData); + + //Create block and inject customer session + $this->block = $objectManager->create( + 'Magento\Theme\Block\Html\Header', + ['customerSession' => $customerSession] + ); + + } + + /** + * Test default welcome message when customer is not logged in + */ + public function testGetWelcomeDefault() + { + $this->assertEquals('Default welcome msg!', $this->block->getWelcome()); + } + + /** + * Test welcome message when customer is logged in + */ + public function testGetWelcomeLoggedIn() + { + $this->context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, true, false); + $this->assertEquals('Welcome, Firstname Lastname!', $this->block->getWelcome()); + } + +} diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php index a45b1b81aa062a476d6d6fad360d37a147e6b892..a81b16d636cec107876037f26b0778b94c803c14 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php @@ -35,7 +35,7 @@ class HtmlTest extends \PHPUnit_Framework_TestCase public function testGetPrintLogoUrl($configData, $returnValue) { $scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $scopeConfig->expects($this->atLeastOnce())->method('getValue')->will($this->returnValueMap($configData)); @@ -45,15 +45,15 @@ class HtmlTest extends \PHPUnit_Framework_TestCase 'Magento\Url', array('getBaseUrl'), array( - $this->getMock('Magento\App\Route\ConfigInterface'), - $this->getMock('Magento\App\Request\Http', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Route\ConfigInterface'), + $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false), $securityInfoMock, $this->getMock('Magento\Url\ScopeResolverInterface', array(), array(), '', false), $this->getMock('Magento\Session\Generic', array(), array(), '', false), $this->getMock('Magento\Session\SidResolverInterface', array(), array(), '', false), $this->getMock('Magento\Url\RouteParamsResolverFactory', array(), array(), '', false), $this->getMock('Magento\Url\QueryParamsResolver', array(), array(), '', false), - $this->getMock('Magento\App\Config\ScopeConfigInterface', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', array(), array(), '', false), \Magento\Store\Model\ScopeInterface::SCOPE_STORE, array() ) diff --git a/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeControllerTest.php b/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeControllerTest.php index 27653999ae3dc83ec620077f8ec38f217ab6d409..b1e449931e201c822de16e3eca92e9a3560aee22 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeControllerTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeControllerTest.php @@ -31,14 +31,14 @@ namespace Magento\Theme\Controller\Adminhtml\System\Design; */ class ThemeControllerTest extends \Magento\Backend\Utility\Controller { - /** @var \Magento\App\Filesystem */ + /** @var \Magento\Framework\App\Filesystem */ protected $_filesystem; protected function setUp() { parent::setUp(); - $this->_filesystem = $this->_objectManager->get('Magento\App\Filesystem'); + $this->_filesystem = $this->_objectManager->get('Magento\Framework\App\Filesystem'); } /** @@ -57,10 +57,10 @@ class ThemeControllerTest extends \Magento\Backend\Utility\Controller ); $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem\DirectoryList' + 'Magento\Framework\App\Filesystem\DirectoryList' ); - /** @var $directoryList \Magento\App\Filesystem\DirectoryList */ - $directoryList->addDirectory(\Magento\App\Filesystem::SYS_TMP_DIR, array('path' => '/')); + /** @var $directoryList \Magento\Framework\App\Filesystem\DirectoryList */ + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::SYS_TMP_DIR, array('path' => '/')); $theme = $this->_objectManager->create('Magento\View\Design\ThemeInterface')->getCollection()->getFirstItem(); @@ -83,8 +83,8 @@ class ThemeControllerTest extends \Magento\Backend\Utility\Controller * Uploader can copy(upload) and then remove this temporary file. */ $fileName = __DIR__ . '/_files/simple-js-file.js'; - $varDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); - $rootDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $varDir = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); + $rootDir = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $destinationFilePath = 'simple-js-file.js'; $rootDir->copyFile($rootDir->getRelativePath($fileName), $destinationFilePath, $varDir); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php index df84f06f83d0b79550ec5133972731a01dfefc50..582020d13ef7db9fcd1de6070859f9b074db8ad5 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php @@ -38,8 +38,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\App\Cache */ - $cache = $objectManager->create('Magento\App\Cache'); + /** @var $cache \Magento\Framework\App\Cache */ + $cache = $objectManager->create('Magento\Framework\App\Cache'); $cache->clean(); $this->_fileResolverMock = $this->getMockBuilder( 'Magento\Config\FileResolverInterface' diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php index a9ead94253631217c4732ef90e906bb725112405..b7c1be80a352778595b51e7e8352a6cf850e1bcf 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php @@ -35,8 +35,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $cache \Magento\App\Cache */ - $cache = $objectManager->create('Magento\App\Cache'); + /** @var $cache \Magento\Framework\App\Cache */ + $cache = $objectManager->create('Magento\Framework\App\Cache'); $cache->clean(); $fileResolverMock = $this->getMockBuilder( 'Magento\Config\FileResolverInterface' diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php index 60986c964fde4864eee2059ba193b68d4c077a91..7c45bb3f54306d068e5a420eb0c55151be5bf5d3 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php @@ -32,7 +32,7 @@ namespace Magento\Theme\Model\Wysiwyg; class StorageTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject */ protected $_request; @@ -47,7 +47,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected $_helperStorage; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -71,7 +71,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem\DirectoryList' + 'Magento\Framework\App\Filesystem\DirectoryList' ); $dirPath = ltrim(str_replace($directoryList->getRoot(), '', str_replace('\\', '/', __DIR__)) . '/_files', '/'); @@ -85,22 +85,22 @@ class StorageTest extends \PHPUnit_Framework_TestCase '/' ); - $directoryList->addDirectory(\Magento\App\Filesystem::VAR_DIR, array('path' => $dirPath)); - $directoryList->addDirectory(\Magento\App\Filesystem::TMP_DIR, array('path' => $tmpDirPath)); - $directoryList->addDirectory(\Magento\App\Filesystem::MEDIA_DIR, array('path' => $tmpDirPath)); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::VAR_DIR, array('path' => $dirPath)); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::TMP_DIR, array('path' => $tmpDirPath)); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::MEDIA_DIR, array('path' => $tmpDirPath)); $this->_filesystem = $this->_objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('directoryList' => $directoryList) ); - $this->directoryVar = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); - $this->directoryTmp = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::TMP_DIR); + $this->directoryVar = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); + $this->directoryTmp = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::TMP_DIR); /** @var $theme \Magento\View\Design\ThemeInterface */ $theme = $this->_objectManager->create('Magento\View\Design\ThemeInterface')->getCollection()->getFirstItem(); - /** @var $request \Magento\App\Request\Http */ - $request = $this->_objectManager->get('Magento\App\Request\Http'); + /** @var $request \Magento\Framework\App\Request\Http */ + $request = $this->_objectManager->get('Magento\Framework\App\Request\Http'); $request->setParam(\Magento\Theme\Helper\Storage::PARAM_THEME_ID, $theme->getId()); $request->setParam( \Magento\Theme\Helper\Storage::PARAM_CONTENT_TYPE, diff --git a/dev/tests/integration/testsuite/Magento/Translate/InlineTest.php b/dev/tests/integration/testsuite/Magento/Translate/InlineTest.php index 531db272ec14d780a179e27700c3adbcf2aceaa2..ed257caac4b4ea0499431c127d7ad0c86a93b1ad 100644 --- a/dev/tests/integration/testsuite/Magento/Translate/InlineTest.php +++ b/dev/tests/integration/testsuite/Magento/Translate/InlineTest.php @@ -42,7 +42,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDesignTheme( @@ -67,7 +68,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase 'dev/translate_inline/active' ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/translate_inline/active', true, diff --git a/dev/tests/integration/testsuite/Magento/TranslateTest.php b/dev/tests/integration/testsuite/Magento/TranslateTest.php index 654b174a27d77e0eb6e7d28a7a3c2003aff9359c..76eec0847077d21f3a2e086afe8ae2ac64c03107 100644 --- a/dev/tests/integration/testsuite/Magento/TranslateTest.php +++ b/dev/tests/integration/testsuite/Magento/TranslateTest.php @@ -83,10 +83,10 @@ class TranslateTest extends \PHPUnit_Framework_TestCase array( $objectManager->get('Magento\Store\Model\StoreManagerInterface'), $objectManager->get('Magento\View\Design\Theme\FlyweightFactory'), - $objectManager->get('Magento\App\Config\ScopeConfigInterface'), + $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'), $objectManager->get('Magento\Core\Model\ThemeFactory'), $objectManager->get('Magento\Locale\ResolverInterface'), - $objectManager->get('Magento\App\State'), + $objectManager->get('Magento\Framework\App\State'), array('frontend' => 'test_default') ) ); @@ -106,8 +106,8 @@ class TranslateTest extends \PHPUnit_Framework_TestCase /** * @magentoDataFixture Magento/Translation/_files/db_translate.php * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php - * @covers \Magento\Backend\Model\Resource\Translate::_getStoreId - * @covers \Magento\Backend\Model\Resource\Translate\String::_getStoreId + * @covers \Magento\Translation\Model\Resource\Translate::getStoreId + * @covers \Magento\Translation\Model\Resource\String::getStoreId */ public function testLoadDataCaching() { diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php index 0620b378050636c4175e9ce738202b61635fedd3..578945e8b3ae39093bd22a9c6a11c492b5f0ec72 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php @@ -59,7 +59,7 @@ class InlineParserTest extends \PHPUnit_Framework_TestCase 'dev/translate_inline/active' ); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'dev/translate_inline/active', true, diff --git a/dev/tests/integration/testsuite/Magento/Translation/_files/db_translate_admin_store.php b/dev/tests/integration/testsuite/Magento/Translation/_files/db_translate_admin_store.php index 51ef0a7601d8a2c6d86c78625dee8e2fbf1fec23..a1c4c6db88329aeef2c59fa30b90ff2844fd6693 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/_files/db_translate_admin_store.php +++ b/dev/tests/integration/testsuite/Magento/Translation/_files/db_translate_admin_store.php @@ -23,7 +23,7 @@ */ \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\AreaList' + 'Magento\Framework\App\AreaList' )->getArea( \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE )->load( diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/UrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/UrlRewriteTest.php index 89dc94777f06422ea8b1d72e517eebdd9efcd239..568d29c1a080bff95c35b884cbe3b11c8b3a6e15 100644 --- a/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/UrlRewriteTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Model/UrlRewriteTest.php @@ -129,7 +129,7 @@ class UrlRewriteTest extends \PHPUnit_Framework_TestCase public function testRewrite() { $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setPathInfo( 'fancy/url.html' ); @@ -156,20 +156,23 @@ class UrlRewriteTest extends \PHPUnit_Framework_TestCase public function testRewriteNonExistingRecord() { - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); $this->assertFalse($this->_model->rewrite($request)); } public function testRewriteWrongStore() { - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); $_GET['___from_store'] = uniqid('store'); $this->assertFalse($this->_model->rewrite($request)); } public function testRewriteNonExistingRecordCorrectStore() { - $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\RequestInterface'); + $request = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\RequestInterface'); $_GET['___from_store'] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Store\Model\StoreManagerInterface' )->getDefaultStoreView()->getCode(); diff --git a/dev/tests/integration/testsuite/Magento/UrlTest.php b/dev/tests/integration/testsuite/Magento/UrlTest.php index 3a0266b041c32417333b927563f9a6bd66d4039b..55936e64f9c1e9591f7615c76c8877fcae7001d0 100644 --- a/dev/tests/integration/testsuite/Magento/UrlTest.php +++ b/dev/tests/integration/testsuite/Magento/UrlTest.php @@ -434,7 +434,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var $request \Magento\TestFramework\Request */ - $request = $objectManager->get('Magento\App\RequestInterface'); + $request = $objectManager->get('Magento\Framework\App\RequestInterface'); $request->setServer(array('HTTP_REFERER' => 'http://localhost/')); $this->assertTrue($this->_model->isOwnOriginUrl()); diff --git a/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/EditTest.php b/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/EditTest.php index 29ab14b923700f5702bdd6f9cc9a61e292524bbe..23be1732a36fd333cb5430ebf388248b781c8af7 100644 --- a/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/EditTest.php @@ -41,7 +41,7 @@ class EditTest extends \PHPUnit_Framework_TestCase $roleAdmin = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\User\Model\Role'); $roleAdmin->load(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, 'role_name'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setParam( 'rid', $roleAdmin->getId() diff --git a/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php b/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php index 64db1152d22f1521ded34b3d005f53ac22178fd4..3b66608b730fc928500ed2d253defedec2fa7e79 100644 --- a/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php @@ -45,25 +45,28 @@ class MergedTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $objectManager->get('Magento\App\Filesystem'); - self::$_themePublicDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::STATIC_VIEW_DIR); - self::$_viewPublicMergedDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $objectManager->get('Magento\Framework\App\Filesystem'); + self::$_themePublicDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); + self::$_viewPublicMergedDir = $filesystem->getDirectoryWrite( + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR + ); } protected function setUp() { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array( + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( 'path' => dirname(dirname(__DIR__)) . '/_files/design' ), - \Magento\App\Filesystem::PUB_DIR => array('path' => BP) + \Magento\Framework\App\Filesystem::PUB_DIR => array('path' => BP) ) ) ); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDesignTheme( diff --git a/dev/tests/integration/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php b/dev/tests/integration/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php index c20b090fbe18c27207c100fff94283be002187b6..06a0f1fa8eaf9b5d7c18004ebdcab56655b0477d 100644 --- a/dev/tests/integration/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php @@ -62,13 +62,15 @@ class FallbackTest extends \PHPUnit_Framework_TestCase { // Prepare config with directories $filesystem = Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => Bootstrap::getObjectManager()->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => $this->_baseDir, - 'directories' => array(\Magento\App\Filesystem::THEMES_DIR => array('path' => $this->_viewDir)) + 'directories' => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => $this->_viewDir) + ) ) ) ) @@ -112,7 +114,8 @@ class FallbackTest extends \PHPUnit_Framework_TestCase */ public function testGetFile($file, $area, $themePath, $module, $expectedFilename) { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode($area); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode($area); $model = $this->_buildModel($area, $themePath, null); $themeModel = $this->_getThemeModel($area, $themePath); @@ -190,7 +193,8 @@ class FallbackTest extends \PHPUnit_Framework_TestCase */ public function testGetI18nCsvFile($area, $themePath, $locale, $expectedFilename) { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode($area); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode($area); $model = $this->_buildModel($area, $themePath, $locale); $themeModel = $this->_getThemeModel($area, $themePath); @@ -237,7 +241,8 @@ class FallbackTest extends \PHPUnit_Framework_TestCase */ public function testGetViewFile($file, $area, $themePath, $locale, $module, $expectedFilename) { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode($area); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode($area); $model = $this->_buildModel(); $themeModel = $this->_getThemeModel($area, $themePath); diff --git a/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php b/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php index d726d1e54ac5164384844a3ad39bbb50ae1080e6..d3bab7f59ab3fe1f7e68f2896c0ce4087777d4a2 100644 --- a/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php @@ -26,7 +26,7 @@ */ namespace Magento\View\Element; -use Magento\App\Filesystem\DirectoryList; +use Magento\Framework\App\Filesystem\DirectoryList; /** * @magentoAppIsolation enabled @@ -47,7 +47,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase protected function setUp() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDefaultDesignTheme(); @@ -68,17 +69,17 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase public function testCssWithWrongImage() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $relativePath = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryRead( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->getRelativePath( __DIR__ . '/_files' ); - /** @var $directoryList \Magento\App\Filesystem\DirectoryList */ - $directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); - $directoryList->addDirectory(\Magento\App\Filesystem::THEMES_DIR, array('path' => $relativePath)); + /** @var $directoryList \Magento\Framework\App\Filesystem\DirectoryList */ + $directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); + $directoryList->addDirectory(\Magento\Framework\App\Filesystem::THEMES_DIR, array('path' => $relativePath)); $cssUrl = $this->_block->getViewFileUrl( 'css/wrong.css', @@ -89,7 +90,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase public function testGetRequest() { - $this->assertInstanceOf('Magento\App\RequestInterface', $this->_block->getRequest()); + $this->assertInstanceOf('Magento\Framework\App\RequestInterface', $this->_block->getRequest()); } /** diff --git a/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php b/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php index 331b7682e4d0a3e35cef1b348148732ddf4bc807..5b2c653413585d1bd1c3c9ccf2f1f5d5433ef019 100644 --- a/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php @@ -68,16 +68,17 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetArea() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->assertEquals('frontend', $this->_block->getArea()); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->setAreaCode( 'some_area' ); $this->assertEquals('some_area', $this->_block->getArea()); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->setAreaCode( 'another_area' ); @@ -90,7 +91,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase */ public function testToHtml() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('any area'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('any area'); $this->assertEmpty($this->_block->toHtml()); $this->_block->setTemplate(uniqid('invalid_filename.phtml')); $this->assertEmpty($this->_block->toHtml()); diff --git a/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php b/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php index 130fac93b190a1610d3a64f23a705b1da3edccb3..af8fec61eddc321a87748e0c0a2a1c7efde8a8d8 100644 --- a/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php +++ b/dev/tests/integration/testsuite/Magento/View/FileSystemTest.php @@ -39,14 +39,15 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array( + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( 'path' => dirname(__DIR__) . '/Core/Model/_files/design' ) ) ) ); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\View\FileSystem'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' diff --git a/dev/tests/integration/testsuite/Magento/View/PublicationTest.php b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php index 8fd28e5497ac4ff3f1bc0272f42e40edb72aaed2..85f1003cc65abb288935093740141edefb64c859 100644 --- a/dev/tests/integration/testsuite/Magento/View/PublicationTest.php +++ b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php @@ -49,7 +49,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->viewService = $objectManager->create('Magento\View\Service'); $this->fileSystem = $objectManager->create('Magento\View\FileSystem'); $this->viewUrl = $objectManager->create('Magento\View\Url'); @@ -59,8 +59,9 @@ class PublicationTest extends \PHPUnit_Framework_TestCase protected function tearDown() { /** @var Filesystem $filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\App\Filesystem'); - $publicDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::STATIC_VIEW_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Framework\App\Filesystem'); + $publicDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); $publicDir->delete('adminhtml'); $publicDir->delete('frontend'); $this->model = null; @@ -72,8 +73,9 @@ class PublicationTest extends \PHPUnit_Framework_TestCase public function testGetPublicDir() { /** @var $filesystem Filesystem */ - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Filesystem'); - $expectedPublicDir = $filesystem->getPath(\Magento\App\Filesystem::STATIC_VIEW_DIR); + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\Filesystem'); + $expectedPublicDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); $this->assertEquals($expectedPublicDir, $this->viewService->getPublicDir()); } @@ -420,8 +422,10 @@ class PublicationTest extends \PHPUnit_Framework_TestCase */ public function testPublishResourcesAndCssWhenChangedCssDevMode() { - $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->getMode(); - if ($mode != \Magento\App\State::MODE_DEVELOPER) { + $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\State') + ->getMode(); + if ($mode != \Magento\Framework\App\State::MODE_DEVELOPER) { $this->markTestSkipped('Valid in developer mode only'); } $this->_testPublishResourcesAndCssWhenChangedCss(true); @@ -435,8 +439,10 @@ class PublicationTest extends \PHPUnit_Framework_TestCase */ public function testNotPublishResourcesAndCssWhenChangedCssUsualMode() { - $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->getMode(); - if ($mode == \Magento\App\State::MODE_DEVELOPER) { + $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\State') + ->getMode(); + if ($mode == \Magento\Framework\App\State::MODE_DEVELOPER) { $this->markTestSkipped('Valid in non-developer mode only'); } $this->_testPublishResourcesAndCssWhenChangedCss(false); @@ -452,7 +458,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $appInstallDir = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppInstallDir(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->model = $objectManager->get('Magento\View\DesignInterface'); $this->model->setDesignTheme('test_default'); @@ -497,8 +503,10 @@ class PublicationTest extends \PHPUnit_Framework_TestCase */ public function testPublishChangedResourcesWhenUnchangedCssDevMode() { - $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->getMode(); - if ($mode != \Magento\App\State::MODE_DEVELOPER) { + $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\State') + ->getMode(); + if ($mode != \Magento\Framework\App\State::MODE_DEVELOPER) { $this->markTestSkipped('Valid in developer mode only'); } @@ -513,8 +521,10 @@ class PublicationTest extends \PHPUnit_Framework_TestCase */ public function testNotPublishChangedResourcesWhenUnchangedCssUsualMode() { - $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->getMode(); - if ($mode == \Magento\App\State::MODE_DEVELOPER) { + $mode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\Framework\App\State') + ->getMode(); + if ($mode == \Magento\Framework\App\State::MODE_DEVELOPER) { $this->markTestSkipped('Valid in non-developer mode only'); } @@ -531,14 +541,16 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $appInstallDir = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppInstallDir(); \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => "{$appInstallDir}/media_for_change") + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => "{$appInstallDir}/media_for_change" + ) ) ) ); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->model = $objectManager->get('Magento\View\DesignInterface'); $this->model->setDesignTheme('test_default'); @@ -581,15 +593,15 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array( + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( 'path' => dirname(__DIR__) . '/Core/Model/_files/design' ) ) ) ); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->get('Magento\App\State')->setAreaCode('frontend'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend'); if ($allowDuplication !== null) { $objectManager->configure( @@ -627,14 +639,14 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array( + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( 'path' => dirname(__DIR__) . '/Core/Model/_files/design/' ) ) ) ); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); @@ -687,9 +699,9 @@ class PublicationTest extends \PHPUnit_Framework_TestCase { $filePath = 'mage/mage.js'; $expectedFile = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::PUB_LIB_DIR + \Magento\Framework\App\Filesystem::PUB_LIB_DIR ) . '/' . $filePath; $this->assertFileExists($expectedFile, 'Please verify existence of public library file'); @@ -697,7 +709,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase $this->assertFileEquals($expectedFile, $actualFile); } } -class MockedFilesystem extends \Magento\App\Filesystem +class MockedFilesystem extends \Magento\Framework\App\Filesystem { /** * Re-write modules directory @@ -707,6 +719,6 @@ class MockedFilesystem extends \Magento\App\Filesystem */ public function getPath($code = self::ROOT_DIR) { - return $code == \Magento\App\Filesystem::MODULES_DIR ? __DIR__ . '/_files' : parent::getPath($code); + return $code == \Magento\Framework\App\Filesystem::MODULES_DIR ? __DIR__ . '/_files' : parent::getPath($code); } } diff --git a/dev/tests/integration/testsuite/Magento/View/Utility/Layout.php b/dev/tests/integration/testsuite/Magento/View/Utility/Layout.php index 6c9eff254363418055d8a324f62c59c0807e8629..8ee60d7a2730ee90cc6a0c9d58ad6d3b02f2d991 100644 --- a/dev/tests/integration/testsuite/Magento/View/Utility/Layout.php +++ b/dev/tests/integration/testsuite/Magento/View/Utility/Layout.php @@ -111,11 +111,11 @@ class Layout 'argumentParser' => $objectManager->get('Magento\View\Layout\Argument\Parser'), 'argumentInterpreter' => $objectManager->get('layoutArgumentInterpreter'), 'scheduledStructure' => $objectManager->create('Magento\View\Layout\ScheduledStructure', array()), - 'scopeConfig' => $objectManager->create('Magento\App\Config\ScopeConfigInterface'), - 'appState' => $objectManager->get('Magento\App\State'), + 'scopeConfig' => $objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'), + 'appState' => $objectManager->get('Magento\Framework\App\State'), 'messageManager' => $objectManager->get('Magento\Message\ManagerInterface'), 'themeResolver' => $objectManager->get('Magento\View\Design\Theme\ResolverInterface'), - 'scopeResolver' => $objectManager->get('Magento\App\ScopeResolverInterface'), + 'scopeResolver' => $objectManager->get('Magento\Framework\App\ScopeResolverInterface'), 'scopeType' => \Magento\Store\Model\ScopeInterface::SCOPE_STORE, ); } diff --git a/dev/tests/integration/testsuite/Magento/View/Utility/LayoutTest.php b/dev/tests/integration/testsuite/Magento/View/Utility/LayoutTest.php index dfdc3e5c2eff1600aface02ab75fbfbe9f05b173..da2f43afdfc7919f09a6642f92eefbd0c78a1789 100644 --- a/dev/tests/integration/testsuite/Magento/View/Utility/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Utility/LayoutTest.php @@ -34,8 +34,8 @@ class LayoutTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::APP_DIR => array('path' => BP . '/dev/tests/integration') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::APP_DIR => array('path' => BP . '/dev/tests/integration') ) ) ); diff --git a/dev/tests/integration/testsuite/Magento/View/_files/Magento/ModuleA/view/adminhtml/product/product.css b/dev/tests/integration/testsuite/Magento/View/_files/Magento/ModuleA/view/adminhtml/product/product.css index 323396a82393c836ebe0df07f50818b586c274db..796c5f665aa5d9d40afe2418f520f583c686b709 100644 --- a/dev/tests/integration/testsuite/Magento/View/_files/Magento/ModuleA/view/adminhtml/product/product.css +++ b/dev/tests/integration/testsuite/Magento/View/_files/Magento/ModuleA/view/adminhtml/product/product.css @@ -861,7 +861,7 @@ } .tiers_table .col-price { - width: 15%; + width: 16%; } .new-variation-set { diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php index 707147d3a095f4c4da37153013e7e03b5148dff9..448e6ab32e5dd70e4cab6c80a4eff0180c801c87 100644 --- a/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php @@ -24,7 +24,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure(array( diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php index 3e075aecba3d791aaeea2d57e1a2f1590f1c0e3d..66227bf9c836a1beaee93918136d452020b1cd02 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php @@ -21,72 +21,145 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -return array( - '\Magento\TestModule1\Service\V1\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule1\Service\V1\AllSoapAndRestInterface', - 'methods' => array( - 'item' => array( - 'httpMethod' => 'GET', - 'method' => 'item', - 'route' => '/:id', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource1') - ), - 'create' => array( - 'httpMethod' => 'POST', - 'method' => 'create', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource2') - ) - ), - 'baseUrl' => '/V1/testmodule1' - ), - '\Magento\TestModule1\Service\V2\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule1\Service\V2\AllSoapAndRestInterface', - 'methods' => array( - 'item' => array( - 'httpMethod' => 'GET', - 'method' => 'item', - 'route' => '/:id', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource1') - ), - 'create' => array( - 'httpMethod' => 'POST', - 'method' => 'create', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource1', 'Magento_TestModule1::resource2') - ), - 'delete' => array( - 'httpMethod' => 'DELETE', - 'method' => 'delete', - 'route' => '/:id', - 'isSecure' => true, - 'resources' => array('Magento_TestModule1::resource2') - ) - ), - 'baseUrl' => '/V2/testmodule1' - ), - '\Magento\TestModule2\Service\V2\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule2\Service\V2\AllSoapAndRestInterface', - 'methods' => array( - 'update' => array( - 'httpMethod' => 'PUT', - 'method' => 'update', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource1') - ), - 'delete' => array( - 'httpMethod' => 'DELETE', - 'method' => 'delete', - 'route' => '/:id', - 'isSecure' => true, - 'resources' => array('Magento_TestModule1::resource2') - ) - ), - 'baseUrl' => '/V2/testmodule2' - ) -); +return [ + 'services' => [ + 'Magento\TestModule1\Service\V1\AllSoapAndRestInterface' => [ + 'item' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + ], + 'secure' => false, + ], + 'create' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + ], + 'secure' => false, + ], + ], + 'Magento\TestModule1\Service\V2\AllSoapAndRestInterface' => [ + 'item' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'secure' => false, + ], + 'create' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'secure' => false, + ], + 'delete' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'secure' => false, + ], + 'update' => [ + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'secure' => false, + ], + ], + ], + 'routes' => [ + '/V1/testmodule1/:id' => [ + 'GET' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V1\AllSoapAndRestInterface', + 'method' => 'item', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + ], + 'parameters' => [ + ], + ], + ], + '/V2/testmodule1/:id' => [ + 'GET' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V2\AllSoapAndRestInterface', + 'method' => 'item', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'parameters' => [ + ], + ], + 'DELETE' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V2\AllSoapAndRestInterface', + 'method' => 'delete', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'parameters' => [ + ], + ], + 'PUT' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V2\AllSoapAndRestInterface', + 'method' => 'update', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'parameters' => [ + ], + ], + ], + '/V2/testmodule1' => [ + 'POST' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V2\AllSoapAndRestInterface', + 'method' => 'create', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + 'Magento_Test1::resource2' => true, + ], + 'parameters' => [ + 'id' => [ + 'force' => true, + 'value' => null, + ] + ], + ], + ], + '/V1/testmodule1' => [ + 'POST' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\TestModule1\Service\V1\AllSoapAndRestInterface', + 'method' => 'create', + ], + 'resources' => [ + 'Magento_Test1::resource1' => true, + ], + 'parameters' => [ + 'id' => [ + 'force' => true, + 'value' => null, + ] + ], + ], + ], + ], +]; diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml index 214fab6b9d6bc3baef0bd387e4e69a4b731d5369..fadec6d923fea6afc1b52469fa80bf0ebd0c95f7 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml @@ -23,14 +23,36 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> - <service class="\Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - - <service class="\Magento\TestModule1\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id</rest-route> - <rest-route httpMethod="POST" method="create" resources="Magento_TestModule1::resource1, Magento_TestModule1::resource2"></rest-route> - <rest-route httpMethod="DELETE" method="delete" isSecure="true" resources="Magento_TestModule1::resource2">/:id</rest-route> - </service> -</config> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/testmodule1/:id" method="GET"> + <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" method="item"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + </resources> + </route> + <route url="/V2/testmodule1/:id" method="GET"> + <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" method="item"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + <resource ref="Magento_Test1::resource2"/> + </resources> + </route> + <route url="/V2/testmodule1" method="POST"> + <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" method="create"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + <resource ref="Magento_Test1::resource2"/> + </resources> + <data> + <parameter name="id" force="true">null</parameter> + </data> + </route> + <route url="/V2/testmodule1/:id" method="DELETE"> + <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" method="delete"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + <resource ref="Magento_Test1::resource2"/> + </resources> + </route> +</routes> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml index b1017af6c166b8b27e303a97bf6a9415b9d930d3..d7e03951da45bb9baa1caa4c56de4c1787fedd12 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml @@ -23,14 +23,29 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> - <service class="\Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <!--Extension of service declared in webapiA.xml--> - <rest-route httpMethod="POST" method="create" resources="Magento_TestModule1::resource2"></rest-route> - </service> - - <service class="\Magento\TestModule2\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule2"> - <rest-route httpMethod="PUT" method="update" resources="Magento_TestModule1::resource1"></rest-route> - <rest-route httpMethod="DELETE" method="delete" isSecure="true" resources="Magento_TestModule1::resource2">/:id</rest-route> - </service> -</config> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/testmodule1" method="POST"> + <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" method="create"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + </resources> + <data> + <parameter name="id" force="true">null</parameter> + </data> + </route> + <route url="/V2/testmodule1/:id" method="PUT"> + <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" method="update"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + <resource ref="Magento_Test1::resource2"/> + </resources> + </route> + <route url="/V2/testmodule1/:id" method="DELETE"> + <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" method="delete"/> + <resources> + <resource ref="Magento_Test1::resource1"/> + <resource ref="Magento_Test1::resource2"/> + </resources> + </route> +</routes> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/PathProcessorTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/PathProcessorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fcc27c5a470db6d96c24204ddfaa964fae185c6c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/PathProcessorTest.php @@ -0,0 +1,71 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Webapi\Model; + +class PathProcessorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @var \Magento\Webapi\Model\PathProcessor + */ + protected $pathProcessor; + + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); + $this->pathProcessor = $objectManager->get('\Magento\Webapi\Model\PathProcessor'); + + } + + /** + * @magentoDataFixture Magento/Core/_files/store.php + */ + public function testProcessWithValidStoreCode() + { + $storeCode = 'fixturestore'; + $basePath = "rest/{$storeCode}"; + $path = $basePath . '/V1/customerAccounts/createCustomer'; + $resultPath = $this->pathProcessor->process($path); + $this->assertEquals(str_replace($basePath, "", $path), $resultPath); + $this->assertEquals($storeCode, $this->storeManager->getCurrentStore()); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + * @expectedExceptionMessage No such entity with storeCode = InvalidStorecode + */ + public function testProcessWithInValidStoreCode() + { + $storeCode = 'InvalidStorecode'; + $path = '/rest/' . $storeCode . '/V1/customerAccounts/createCustomer'; + $this->pathProcessor->process($path); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ServerTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ServerTest.php index e7c663c01026f0e77c36e834c29068206da66616..ef2dab6f43d25eddc290f74ce28b92c1eb784a45 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ServerTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Soap/ServerTest.php @@ -67,7 +67,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase 'Magento\Store\Model\Store' )->disableOriginalConstructor()->getMock(); - $this->_areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $this->_areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $this->_configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $this->_storeManagerMock->expects( $this->any() @@ -92,7 +92,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); parent::setUp(); } diff --git a/dev/tests/integration/testsuite/Magento/Webapi/ServiceNameCollisionTest.php b/dev/tests/integration/testsuite/Magento/Webapi/ServiceNameCollisionTest.php index c1c676f1950aa73491a4e89a0be5bc7fb5802570..3c5c9bc67351deb99e687b583f91e44c4917f71b 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/ServiceNameCollisionTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/ServiceNameCollisionTest.php @@ -46,7 +46,7 @@ class ServiceNameCollisionTest extends \PHPUnit_Framework_TestCase $webapiConfig = $objectManager->get('Magento\Webapi\Model\Config'); $serviceNames = array(); - foreach ($webapiConfig->getServices() as $serviceClassName => $serviceData) { + foreach (array_keys($webapiConfig->getServices()['services']) as $serviceClassName) { $newServiceName = $helper->getServiceName($serviceClassName); $this->assertFalse(in_array($newServiceName, $serviceNames)); $serviceNames[] = $newServiceName; diff --git a/dev/tests/integration/testsuite/Magento/Weee/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Weee/Model/ObserverTest.php index f91303bf64b59f151c681a9b75476498d555f4ac..1681cdbc42bb3baa8c41a4d6f74f388f17a15e6d 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Weee/Model/ObserverTest.php @@ -60,7 +60,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase foreach (array(\Magento\Weee\Model\Tax::DISPLAY_INCL, \Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR) as $mode) { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'tax/weee/display', $mode, @@ -79,7 +79,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL ) as $mode) { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\Config\MutableScopeConfigInterface' + 'Magento\Framework\App\Config\MutableScopeConfigInterface' )->setValue( 'tax/weee/display', $mode, diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php index 56c62d3af436655deeb5c8c7f4ceaf1a286302cc..b7d75acd16374f437aaabc13040ef53efc04b827 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php @@ -43,7 +43,7 @@ class DesignAbstractionTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $layoutUtility = new \Magento\View\Utility\Layout($this); - $appState = $objectManager->get('Magento\App\State'); + $appState = $objectManager->get('Magento\Framework\App\State'); $appState->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $processorMock = $this->getMock( 'Magento\View\Layout\Processor', diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/LayoutTest.php index c1f433399239e4e7fc6042a7e7c954d52a611129..1bed7457cf8dcd4a53f70d84bfabe2170a6443c8 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/LayoutTest.php @@ -64,7 +64,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testGetLayoutsChooser() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\State' + 'Magento\Framework\App\State' )->setAreaCode( \Magento\Core\Model\App\Area::AREA_FRONTEND ); diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/EditTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/EditTest.php index f6f819a50d780b9c090239a9abea8ba8c140b54a..5e013a9fc5cd13f313b23b7ea352bb3ad955e699 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/EditTest.php @@ -53,7 +53,7 @@ class EditTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Registry')->register('current_widget_instance', $widgetInstance); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->setParam( 'instance_id', $widgetInstance->getId() diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php index 12975e749bcad43ff4c781186afc0a1aa5f635da..f426b72726c191f136f7f017e2b8d4a98edcf44c 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php @@ -38,37 +38,37 @@ class DataTest extends \PHPUnit_Framework_TestCase protected $_configData; /** - * @var \Magento\App\Filesystem\DirectoryList + * @var \Magento\Framework\App\Filesystem\DirectoryList */ protected $directoryList; public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $filesystem = $objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => $objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => BP, 'directories' => array( - \Magento\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files/code'), - \Magento\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files/code'), - \Magento\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/_files/design') + \Magento\Framework\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files/code'), + \Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files/code'), + \Magento\Framework\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/_files/design') ) ) ) ) ); - $this->directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); + $this->directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); $dirPath = ltrim( str_replace($this->directoryList->getRoot(), '', str_replace('\\', '/', __DIR__)) . '/_files', '/' ); - $this->directoryList->addDirectory(\Magento\App\Filesystem::MODULES_DIR, array('path' => $dirPath)); + $this->directoryList->addDirectory(\Magento\Framework\App\Filesystem::MODULES_DIR, array('path' => $dirPath)); /** @var \Magento\Module\Declaration\FileResolver $modulesDeclarations */ $modulesDeclarations = $objectManager->create( diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/FileResolverTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/FileResolverTest.php index b3e74faf2887e01e71f6bfcd6899780da2ab965d..5ee05c6b24c463c4d73137d8bedb3aacb3c9f6cc 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/FileResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/FileResolverTest.php @@ -33,25 +33,27 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase private $_object; /** - * @var \Magento\App\Filesystem\DirectoryList + * @var \Magento\Framework\App\Filesystem\DirectoryList */ protected $directoryList; public function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\App\Filesystem $filesystem */ + /** @var \Magento\Framework\App\Filesystem $filesystem */ $filesystem = $objectManager->create( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array( 'directoryList' => $objectManager->create( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array( 'root' => BP, 'directories' => array( - \Magento\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files/code'), - \Magento\App\Filesystem::THEMES_DIR => array('path' => __DIR__ . '/_files/design'), - \Magento\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files/') + \Magento\Framework\App\Filesystem::MODULES_DIR => array('path' => __DIR__ . '/_files/code'), + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => __DIR__ . '/_files/design' + ), + \Magento\Framework\App\Filesystem::CONFIG_DIR => array('path' => __DIR__ . '/_files/') ) ) ) @@ -82,12 +84,12 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase array('moduleReader' => $moduleReader, 'filesystem' => $filesystem) ); - $this->directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); + $this->directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); $dirPath = ltrim( str_replace($this->directoryList->getRoot(), '', str_replace('\\', '/', __DIR__)) . '/_files', '/' ); - $this->directoryList->addDirectory(\Magento\App\Filesystem::MODULES_DIR, array('path' => $dirPath)); + $this->directoryList->addDirectory(\Magento\Framework\App\Filesystem::MODULES_DIR, array('path' => $dirPath)); } public function testGetDesign() diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php index a200426d04b3c3d351a492830e9d9af599c1f0ed..6c6dbbede183a185c64c57f3ca3da4516e0cd4e4 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php @@ -29,7 +29,7 @@ namespace Magento\Widget\Model\Config; class ReaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem\DirectoryList + * @var \Magento\Framework\App\Filesystem\DirectoryList */ protected $directoryList; @@ -42,16 +42,22 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); + $this->directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); $dirPath = ltrim( str_replace($this->directoryList->getRoot(), '', str_replace('\\', '/', __DIR__)) . '/_files', '/' ); - $this->directoryList->addDirectory(\Magento\App\Filesystem::MODULES_DIR, array('path' => $dirPath . '/code')); - $this->directoryList->addDirectory(\Magento\App\Filesystem::CONFIG_DIR, array('path' => $dirPath)); - $this->directoryList->addDirectory(\Magento\App\Filesystem::ROOT_DIR, array('path' => $dirPath)); + $this->directoryList->addDirectory( + \Magento\Framework\App\Filesystem::MODULES_DIR, + array('path' => $dirPath . '/code') + ); + $this->directoryList->addDirectory(\Magento\Framework\App\Filesystem::CONFIG_DIR, array('path' => $dirPath)); + $this->directoryList->addDirectory(\Magento\Framework\App\Filesystem::ROOT_DIR, array('path' => $dirPath)); - $filesystem = $objectManager->create('Magento\App\Filesystem', array('directoryList' => $this->directoryList)); + $filesystem = $objectManager->create( + 'Magento\Framework\App\Filesystem', + array('directoryList' => $this->directoryList) + ); /** @var \Magento\Module\Declaration\FileResolver $modulesDeclarations */ $modulesDeclarations = $objectManager->create( diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/InstanceTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/InstanceTest.php index 9ea4400b6e128d64ff5db14fb67bb7d7747565f5..15989d53b8de017cb2b03df01c5945cfdad2846c 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/InstanceTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Widget/InstanceTest.php @@ -49,7 +49,8 @@ class InstanceTest extends \PHPUnit_Framework_TestCase public function testSetThemeId() { - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\State') + ->setAreaCode('frontend'); $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\View\DesignInterface' )->setDefaultDesignTheme()->getDesignTheme(); diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/WidgetTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/WidgetTest.php index 4947fe7cbacdb04d3fe5ba1dedd6c6c4d1624114..f52eb3aff675494da8c4a3655b0c3b2839960941 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/WidgetTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/WidgetTest.php @@ -74,9 +74,9 @@ class WidgetTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\View\DesignInterface')->setDesignTheme('Magento/backend'); $expectedFilePath = "/adminhtml/Magento/backend/en_US/{$expectedFile}"; $expectedPubFile = $objectManager->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getPath( - \Magento\App\Filesystem::STATIC_VIEW_DIR + \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR ) . $expectedFilePath; if (file_exists($expectedPubFile)) { @@ -113,8 +113,10 @@ class WidgetTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize( array( - \Magento\App\Filesystem::PARAM_APP_DIRS => array( - \Magento\App\Filesystem::THEMES_DIR => array('path' => dirname(__DIR__) . '/_files/design') + \Magento\Framework\App\Filesystem::PARAM_APP_DIRS => array( + \Magento\Framework\App\Filesystem::THEMES_DIR => array( + 'path' => dirname(__DIR__) . '/_files/design' + ) ) ) ); diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/themes.php b/dev/tests/integration/testsuite/Magento/Widget/_files/themes.php index 34815b00ba9257a73b1da2eeb626be2147de3f12..c940265a0ecbb6d135d411358fa7a656e30edc39 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/_files/themes.php +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/themes.php @@ -24,7 +24,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\AreaList') +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) ->load(\Magento\Core\Model\App\Area::PART_CONFIG); /** @var $registration \Magento\Core\Model\Theme\Registration */ diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php index eee2825692a56cc65183423547f7543931ef4294..b5543e69bd3574d4a04cb1fc43d585ee65cb5284 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php @@ -40,7 +40,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase 'Magento\Wishlist\Block\AbstractBlock', array( $objectManager->get('Magento\Catalog\Block\Product\Context'), - $objectManager->get('Magento\App\Http\Context'), + $objectManager->get('Magento\Framework\App\Http\Context'), $objectManager->get('Magento\Catalog\Model\ProductFactory'), ) ); diff --git a/dev/tests/performance/framework/Magento/TestFramework/Application.php b/dev/tests/performance/framework/Magento/TestFramework/Application.php index 8b5486df62f92e0d0ca90c04c18aa11201923ce5..e7d8d4a8938b60e30c9e01099ff01ae195aebffd 100644 --- a/dev/tests/performance/framework/Magento/TestFramework/Application.php +++ b/dev/tests/performance/framework/Magento/TestFramework/Application.php @@ -190,9 +190,9 @@ class Application { /** @var \Magento\Filesystem\Directory\Write $varDirectory */ $varDirectory = $this->getObjectManager()->get( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->getDirectoryWrite( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR ); $varDirectory->changePermissions('', 0777); } @@ -205,7 +205,7 @@ class Application protected function _bootstrap() { $this->getObjectManager()->configure( - $this->getObjectManager()->get('Magento\App\ObjectManager\ConfigLoader')->load(self::AREA_CODE) + $this->getObjectManager()->get('Magento\Framework\App\ObjectManager\ConfigLoader')->load(self::AREA_CODE) ); $this->getObjectManager()->get('Magento\Config\ScopeInterface')->setCurrentScope(self::AREA_CODE); return $this; @@ -279,9 +279,9 @@ class Application public function getObjectManager() { if (!$this->_objectManager) { - $locatorFactory = new \Magento\App\ObjectManagerFactory(); + $locatorFactory = new \Magento\Framework\App\ObjectManagerFactory(); $this->_objectManager = $locatorFactory->create(BP, $_SERVER); - $this->_objectManager->get('Magento\App\State')->setAreaCode(self::AREA_CODE); + $this->_objectManager->get('Magento\Framework\App\State')->setAreaCode(self::AREA_CODE); } return $this->_objectManager; } diff --git a/dev/tests/performance/framework/Magento/TestFramework/Helper/Categories.php b/dev/tests/performance/framework/Magento/TestFramework/Helper/Categories.php index c94582d8200c0014fc1847167fcaa6c40453520f..280c295931d4f32a77fba53d7846ade1cc096d4d 100644 --- a/dev/tests/performance/framework/Magento/TestFramework/Helper/Categories.php +++ b/dev/tests/performance/framework/Magento/TestFramework/Helper/Categories.php @@ -104,7 +104,7 @@ class Categories protected function getObjectManager() { if (!$this->_objectManager) { - $locatorFactory = new \Magento\App\ObjectManagerFactory(); + $locatorFactory = new \Magento\Framework\App\ObjectManagerFactory(); $this->_objectManager = $locatorFactory->create(BP, $_SERVER); } return $this->_objectManager; diff --git a/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php b/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php index ee1764e16a6b7fae2cecace211fa9658e13498ca..efb327c8bcb64e6169c99c977aca7e90c2528985 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php @@ -25,17 +25,18 @@ /** @var \Magento\TestFramework\Application $this */ /** - * @var \Magento\App\Config\ValueInterface $configData + * @var \Magento\Framework\App\Config\ValueInterface $configData */ -$configData = $this->getObjectManager()->create('Magento\App\Config\ValueInterface'); +$configData = $this->getObjectManager()->create('Magento\Framework\App\Config\ValueInterface'); $configData->setPath( 'catalog/frontend/flat_catalog_category' )->setScope( - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )->setScopeId( 0 )->setValue( 1 )->save(); -$this->getObjectManager()->get('Magento\App\CacheInterface')->clean(array(\Magento\App\Config::CACHE_TAG)); +$this->getObjectManager()->get('Magento\Framework\App\CacheInterface') + ->clean(array(\Magento\Framework\App\Config::CACHE_TAG)); diff --git a/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php b/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php index 6f8f9e594a94e43f77c0b70f0377d41d35b8aeea..f4a6b05b8dbab0a303f3ab8315ece4edbcf6668b 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php @@ -25,17 +25,18 @@ /** @var \Magento\TestFramework\Application $this */ /** - * @var \Magento\App\Config\ValueInterface $configData + * @var \Magento\Framework\App\Config\ValueInterface $configData */ -$configData = $this->getObjectManager()->create('Magento\App\Config\ValueInterface'); +$configData = $this->getObjectManager()->create('Magento\Framework\App\Config\ValueInterface'); $configData->setPath( 'catalog/frontend/flat_catalog_product' )->setScope( - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )->setScopeId( 0 )->setValue( 1 )->save(); -$this->getObjectManager()->get('Magento\App\CacheInterface')->clean(array(\Magento\App\Config::CACHE_TAG)); +$this->getObjectManager()->get('Magento\Framework\App\CacheInterface') + ->clean(array(\Magento\Framework\App\Config::CACHE_TAG)); diff --git a/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php b/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php index 4efe847825915a2443b849bf538fc3eabbfc2c13..ea7d0c761374cab1be09aea9ee7563ef73af3cd4 100644 --- a/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php @@ -25,17 +25,18 @@ /** @var \Magento\TestFramework\Application $this */ /** - * @var \Magento\App\Config\ValueInterface $configData + * @var \Magento\Framework\App\Config\ValueInterface $configData */ -$configData = $this->getObjectManager()->create('Magento\App\Config\ValueInterface'); +$configData = $this->getObjectManager()->create('Magento\Framework\App\Config\ValueInterface'); $configData->setPath( 'carriers/flatrate/active' )->setScope( - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )->setScopeId( 0 )->setValue( 1 )->save(); -$this->getObjectManager()->get('Magento\App\CacheInterface')->clean(array(\Magento\App\Config::CACHE_TAG)); +$this->getObjectManager()->get('Magento\Framework\App\CacheInterface') + ->clean(array(\Magento\Framework\App\Config::CACHE_TAG)); diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php index d47d92c9aa028f9718cb91a92411342cbcfebd64..8c844276c1b2c5718d31bf0c60aedc37e5c5f2fd 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/AbstractConfig.php @@ -60,6 +60,10 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase public function testFileSchemaUsingPartialXml() { $xmlFile = $this->_getKnownValidPartialXml(); + if (is_null($xmlFile)) { + $this->markTestSkipped('No Partial File'); + return; + } $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() . $this->_getFileXsd(); $this->_validateFileExpectSuccess($xmlFile, $schema); } @@ -67,6 +71,10 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase public function testFileSchemaUsingInvalidXml($expectedErrors = null) { $xmlFile = $this->_getKnownInvalidPartialXml(); + if (is_null($xmlFile)) { + $this->markTestSkipped('No Partial File'); + return; + } $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() . $this->_getFileXsd(); $this->_validateFileExpectFailure($xmlFile, $schema, $expectedErrors); } @@ -74,6 +82,10 @@ abstract class AbstractConfig extends \PHPUnit_Framework_TestCase public function testSchemaUsingPartialXml($expectedErrors = null) { $xmlFile = $this->_getKnownValidPartialXml(); + if (is_null($xmlFile)) { + $this->markTestSkipped('No Partial File'); + return; + } $schema = \Magento\TestFramework\Utility\Files::init()->getPathToSource() . $this->_getXsd(); $this->_validateFileExpectFailure($xmlFile, $schema, $expectedErrors); } diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php b/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php index f6e808e2b3aa625297046a37aa4bddd1755c4cb4..c44d6fe87a63e7158b4b5aa3c2e2eb073c1613fb 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php +++ b/dev/tests/static/framework/Magento/TestFramework/Utility/Files.php @@ -620,7 +620,7 @@ class Files * of file names * Note that realpath() automatically changes directory separator to the OS-native */ - if (realpath($fullPath) == str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fullPath)) { + if (realpath($fullPath) == str_replace(array('/', '\\'), '/', $fullPath)) { $fileContent = file_get_contents($fullPath); if (strpos( $fileContent, diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php index 005f0a229e4750cb0439bf4d94475931e67d13bf..0745f02f5368bae2b5caf29d971ea440323460f9 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php @@ -98,7 +98,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase 'null' => new \Magento\Data\Argument\Interpreter\NullType(), 'object' => new \Magento\Data\Argument\Interpreter\Object($booleanUtils), 'const' => $constInterpreter, - 'init_parameter' => new \Magento\App\Arguments\ArgumentInterpreter($constInterpreter) + 'init_parameter' => new \Magento\Framework\App\Arguments\ArgumentInterpreter($constInterpreter) ], \Magento\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE ); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt index 2796e1b0d7f2d441719ca01744703abe2ad698ee..9e21e0ffbde1344df96e61a26df20726de83d86f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt @@ -58,17 +58,17 @@ lib/Magento/View/Element/Context.php lib/Magento/View/Element/Template/Context.php lib/Magento/View/Element/Redirect.php -lib/Magento/App/Module/ResourceResolver.php +lib/Magento/Framework/App/Module/ResourceResolver.php lib/Magento/Event/Invoker/InvokerDefault.php lib/Magento/Phrase/Renderer/Translate.php lib/Magento/Backup/Snapshot.php lib/Magento/Oauth/Exception.php -lib/Magento/App/Helper/AbstractHelper.php -lib/Magento/App/Helper/Context.php +lib/Magento/Framework/App/Helper/AbstractHelper.php +lib/Magento/Framework/App/Helper/Context.php lib/Magento/View/DesignLoader.php lib/Magento/Session/SidResolverInterface.php -lib/Magento/App/Filesystem/DirectoryList/Configuration.php +lib/Magento/Framework/App/Filesystem/DirectoryList/Configuration.php lib/Magento/Filesystem/Driver/Http.php diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/ConfigTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8aaa14f15163ed03d4191c2e1c0c94a9f35c6df2 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/ConfigTest.php @@ -0,0 +1,119 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Test\Integrity\Magento\Webapi\Model; + +use Magento\TestFramework\Integrity\AbstractConfig; + +/** + * Find webapi xml files and validate them + */ +class ConfigTest extends AbstractConfig +{ + public function testSchemaUsingInvalidXml($expectedErrors = null) + { + // @codingStandardsIgnoreStart + $expectedErrors = array( + "Element 'route', attribute 'method': [facet 'enumeration'] The value 'PATCH' is not an element of the set {'GET', 'PUT', 'POST', 'DELETE'}.", + "Element 'route', attribute 'method': 'PATCH' is not a valid value of the local atomic type.", + "Element 'service': The attribute 'method' is required but missing.", + "Element 'resource', attribute 'ref': [facet 'pattern'] The value 'a resource' is not accepted by the pattern '.+::.+(, ?.+::.+)*'.", + "Element 'resource', attribute 'ref': 'a resource' is not a valid value of the local atomic type.", + "Element 'data': Missing child element(s). Expected is ( parameter ).", + "Element 'route': Missing child element(s). Expected is ( service ).", + "Element 'route': Missing child element(s). Expected is ( resources ).", + ); + // @codingStandardsIgnoreEnd + parent::testSchemaUsingInvalidXml($expectedErrors); + } + + /** + * Returns the name of the xml files to validate + * + * @return string + */ + protected function _getXmlName() + { + return 'webapi.xml'; + } + + /** + * The location of a single valid complete xml file + * + * @return string + */ + protected function _getKnownValidXml() + { + return __DIR__ . '/_files/webapi.xml'; + } + + /** + * The location of a single known invalid complete xml file + * + * @return string + */ + protected function _getKnownInvalidXml() + { + return __DIR__ . '/_files/invalid_webapi.xml'; + } + + /** + * The location of a single known valid partial xml file + * + * @return string + */ + protected function _getKnownValidPartialXml() + { + return null; + } + + /** + * The location of a single known invalid partial xml file + * + * @return string + */ + protected function _getKnownInvalidPartialXml() + { + return null; + } + + /** + * Returns the name of the XSD file to be used to validate the XSD + * + * @return string + */ + protected function _getXsd() + { + return '/app/code/Magento/Webapi/etc/webapi.xsd'; + } + + /** + * Returns the name of the XSD file to be used to validate partial XML + * + * @return string + */ + protected function _getFileXsd() + { + return null; + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/invalid_webapi.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/invalid_webapi.xml new file mode 100644 index 0000000000000000000000000000000000000000..8eb07fa3318f52a677a9b1a5e6b88ef2d76a6bab --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/invalid_webapi.xml @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/customer/me" method="PATCH"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" /> + <resources> + <resource ref="a resource" /> + </resources> + <data> + </data> + </route> + <route url="/V1/customers" method="POST"/> + <route url="/V1/customers" method="PUT"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="foo" /> + </route> +</routes> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/webapi.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/webapi.xml new file mode 100644 index 0000000000000000000000000000000000000000..232668094d341ee5f63128d772519a86c16e8810 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Webapi/Model/_files/webapi.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/customers/me" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="getCustomer" /> + <resources> + <resource ref="Magento_Customer::customer_self" /> + </resources> + <data> + <parameter name="id" force="true">null</parameter> + </data> + </route> + <route url="/V1/customers/me" method="PUT" secure="true"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="updateCustomer" /> + <resources> + <resource ref="Magento_Customer::customer_self" /> + </resources> + <data> + <parameter name="id">null</parameter> + </data> + </route> + <route url="/V1/customers" method="POST"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="createCustomer" /> + <resources> + <resource ref="Magento_Customer::manage" /> + </resources> + </route> + <route url="/V1/customers/:id" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="getCustomer" /> + <resources> + <resource ref="Magento_Customer::read" /> + </resources> + </route> +</routes> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php index fa61754b98579ed7e03b61e01b6bedc1631d6be2..3f4e0f6d4f65ce530dca1beb72c2c2b34561af63 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php @@ -55,7 +55,7 @@ class ArgumentsTest extends \Magento\Test\Integrity\Phrase\AbstractTestCase $rootDir = \Magento\TestFramework\Utility\Files::init()->getPathToSource(); $this->blackList = array( // the file below is the only file where strings are translated without corresponding arguments - $rootDir . str_replace('/', DIRECTORY_SEPARATOR, '/app/code/Magento/Translation/Model/Js/DataProvider.php') + $rootDir . '/app/code/Magento/Translation/Model/Js/DataProvider.php' ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php index d9c274ffe8acec2a0c95b92ef4aa67fa9363df4b..82ceffc991c2c8c0455a90777cf013ed73d17386 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php @@ -337,7 +337,8 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase '/getOptions\(\)\s*->get(Base|App|Code|Design|Etc|Lib|Locale|Js|Media' . '|Var|Tmp|Cache|Log|Session|Upload|Export)?Dir\(/S', $content, - 'The class \Magento\Core\Model\Config\Options is obsolete. Replacement suggestion: \Magento\App\Filesystem' + 'The class \Magento\Core\Model\Config\Options is obsolete. ' + . 'Replacement suggestion: \Magento\Framework\App\Filesystem' ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index a56820c01a24448813b97f5a4631d532788cf589..01ae80983954f5ee8de843d7d1841c6f2c3e48a9 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -781,8 +781,8 @@ return array( array('Mage_Core_Controller_Magento_Router_Admin', 'Magento\Backend\App\Router\DefaultRouter'), array('Mage_Core_Model_Convert'), array('Mage_Core_Model_Config_Fieldset', 'Magento\Core\Model\Fieldset\Config'), - array('Mage_Core_Model_Config_Options', 'Magento\App\Filesystem'), - array('Magento\App\Dir', 'Magento\Filesystem'), + array('Mage_Core_Model_Config_Options', 'Magento\Framework\App\Filesystem'), + array('Magento\Framework\App\Dir', 'Magento\Filesystem'), array('Magento\Filesystem\Adapter\Local', 'Magento\Filesystem\Driver\File'), array('Magento\Filesystem\Adapter\Zlib', 'Magento\Filesystem\Driver\Zlib'), array('Magento\Filesystem\AdapterInterface'), @@ -1318,12 +1318,12 @@ return array( array('Magento\Backup'), array('Magento\Core\Controller\Front\Router'), array('Magento\Core\Controller\Request\HttpProxy'), - array('Magento\Core\Controller\Response\Http', 'Magento\App\Response\Http'), - array('Magento\Core\Controller\Varien\Action\Forward', 'Magento\App\Action\Forward'), - array('Magento\Core\Controller\Varien\Action\Redirect', 'Magento\App\Action\Redirect'), + array('Magento\Core\Controller\Response\Http', 'Magento\Framework\App\Response\Http'), + array('Magento\Core\Controller\Varien\Action\Forward', 'Magento\Framework\App\Action\Forward'), + array('Magento\Core\Controller\Varien\Action\Redirect', 'Magento\Framework\App\Action\Redirect'), array('Magento\Core\Controller\Varien\DispatchableInterface'), - array('Magento\Core\Controller\Varien\Front', 'Magento\App\FrontController'), - array('Magento\Core\Controller\FrontInterface', 'Magento\App\FrontControllerInterface'), + array('Magento\Core\Controller\Varien\Front', 'Magento\Framework\App\FrontController'), + array('Magento\Core\Controller\FrontInterface', 'Magento\Framework\App\FrontControllerInterface'), array('Magento\Core\Model\App\Handler'), array('Magento\Core\Model\App\Proxy'), array('Magento\Core\Model\Event\Config\SchemaLocator', 'Magento\Event\Config\SchemaLocator'), @@ -1584,7 +1584,7 @@ return array( array('Magento\Core\Model\Theme\Image', 'Magento\View\Design\Theme\Image'), array('Magento\Core\Model\Theme\FlyweightFactory', 'Magento\View\Design\Theme\FlyweightFactory'), array('Magento\Core\Model\Image\AdapterFactory', 'Magento\Image\AdapterFactory'), - array('Magento\Core\Model\EntryPoint\Cron', 'Magento\App\Cron'), + array('Magento\Core\Model\EntryPoint\Cron', 'Magento\Framework\App\Cron'), array( 'Magento\Checkout\Block\Cart\Item\Renderer\Grouped', 'Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped' @@ -1594,11 +1594,11 @@ return array( array('Magento\Index\Model\EntryPoint\Indexer', 'Magento\Index\App\Indexer'), array('Magento\Core\Model\Config\Modules\Reader', 'Magento\Module\Dir\Reader'), array('Magento\Data\Form\Factory', 'Magento\Data\FormFactory'), - array('Magento\App\Cache\Config', 'Magento\Cache\Config'), - array('Magento\App\Cache\Config\Converter', 'Magento\Cache\Config\Converter'), - array('Magento\App\Cache\Config\Data', 'Magento\Cache\Config\Data'), - array('Magento\App\Cache\Config\Reader', 'Magento\Cache\Config\Reader'), - array('Magento\App\Cache\Config\SchemaLocator', 'Magento\Cache\Config\SchemaLocator'), + array('Magento\Framework\App\Cache\Config', 'Magento\Cache\Config'), + array('Magento\Framework\App\Cache\Config\Converter', 'Magento\Cache\Config\Converter'), + array('Magento\Framework\App\Cache\Config\Data', 'Magento\Cache\Config\Data'), + array('Magento\Framework\App\Cache\Config\Reader', 'Magento\Cache\Config\Reader'), + array('Magento\Framework\App\Cache\Config\SchemaLocator', 'Magento\Cache\Config\SchemaLocator'), array('Magento\Core\Model\Fieldset\Config', 'Magento\Object\Copy\Config'), array('Magento\Core\Model\Fieldset\Config\Converter', 'Magento\Object\Copy\Config\Converter'), array('Magento\Core\Model\Fieldset\Config\Data', 'Magento\Object\Copy\Config\Data'), @@ -1606,8 +1606,8 @@ return array( array('Magento\Core\Model\Fieldset\Config\SchemaLocator', 'Magento\Object\Copy\Config\SchemaLocator'), array('Magento\Core\Model\ModuleManager', 'Magento\Module\Manager'), array('Magento\Core\Model\EntryPoint\Media', 'Magento\Core\App\Media'), - array('Magento\Core\Controller\Varien\Action', 'Magento\App\Action\Action'), - array('Magento\Core\Controller\Varien\Action\Context', 'Magento\App\Action\Context'), + array('Magento\Core\Controller\Varien\Action', 'Magento\Framework\App\Action\Action'), + array('Magento\Core\Controller\Varien\Action\Context', 'Magento\Framework\App\Action\Context'), array('Magento\Backend\Controller\AbstractAction', 'Magento\Backend\App\AbstractAction'), array('Magento\Backend\Controller\Context', 'Magento\Backend\App\Action\Context'), array('Magento\Backend\Controller\Adminhtml\Action', 'Magento\Backend\App\Action'), @@ -1633,9 +1633,9 @@ return array( array('Magento\Core\Block\Html\Link', 'Magento\View\Element\Html\Link'), array('Magento\Core\Block\Context', 'Magento\View\Element\Context'), array('Magento\Core\Model\Factory\Helper'), - array('Magento\App\Helper\HelperFactory'), - array('Magento\Core\Helper\AbstractHelper', 'Magento\App\Helper\AbstractHelper'), - array('Magento\Core\Helper\Context', 'Magento\App\Helper\Context'), + array('Magento\Framework\App\Helper\HelperFactory'), + array('Magento\Core\Helper\AbstractHelper', 'Magento\Framework\App\Helper\AbstractHelper'), + array('Magento\Core\Helper\Context', 'Magento\Framework\App\Helper\Context'), array('Magento\Adminhtml\Controller\Report\AbstractReport', 'Magento\Reports\Controller\Adminhtml\AbstractReport'), array('Magento\Adminhtml\Controller\Report\Customer', 'Magento\Reports\Controller\Adminhtml\Customer'), array('Magento\Adminhtml\Controller\Report\Product', 'Magento\Reports\Controller\Adminhtml\Product'), @@ -1731,7 +1731,7 @@ return array( array('Magento\Adminhtml\Block\Report\Shopcart\Product', 'Magento\Reports\Block\Adminhtml\Shopcart\Product'), array('Magento\Adminhtml\Block\Report\Wishlist\Grid', 'Magento\Reports\Block\Adminhtml\Wishlist\Grid'), array('Magento\Adminhtml\Block\Report\Wishlist', 'Magento\Reports\Block\Adminhtml\Wishlist'), - array('Magento\App\Dir\Verification', 'Magento\App\Filesystem\DirectoryList\Verification'), + array('Magento\Framework\App\Dir\Verification', 'Magento\Framework\App\Filesystem\DirectoryList\Verification'), array('Magento\Backend\Helper\Addresses'), array('Magento\Core\Model\Cookie', 'Magento\Stdlib\Cookie'), array('Magento\Core\Model\Logger', 'Magento\Logger'), @@ -1806,7 +1806,7 @@ return array( array('Magento\Catalog\Model\Resource\Convert'), array('Magento\Reminder\Model\Resource\HelperFactory'), array('Magento\Reminder\Model\Resource\Helper'), - array('Magento\Core\Model\ConfigInterface', 'Magento\App\Config\ScopeConfigInterface'), + array('Magento\Core\Model\ConfigInterface', 'Magento\Framework\App\Config\ScopeConfigInterface'), array('Magento\CatalogRule\Block\Adminhtml\Promo\Widget\Chooser'), array( 'Magento\Catalog\Model\Product\Attribute\Backend\Recurring', @@ -2013,7 +2013,7 @@ return array( ), array('Magento\Sales\Controller\Recurring\Profile', 'Magento\RecurringPayment\Controller\Payment'), array('Magento\Core\Model\Image\Adapter\Config', 'Magento\Image\Adapter\Config'), - array('Magento\Core\Model\AbstractShell', 'Magento\App\AbstractShell'), + array('Magento\Core\Model\AbstractShell', 'Magento\Framework\App\AbstractShell'), array('Magento\Core\Model\Calculator', 'Magento\Math\Calculator'), array('Magento\Core\Model\Log\Adapter', 'Magento\Logger\Adapter'), array('Magento\Core\Model\Input\Filter', 'Magento\Filter\Input'), @@ -2130,8 +2130,11 @@ return array( 'Magento\Usa\Model\Shipping\Carrier\AbstractCarrier\Source\Requesttype', 'Magento\Shipping\Model\Config\Source\Online\Requesttype' ), - ['Magento\PubSub'], - ['Magento\Outbound'], + array('Magento\Catalog\Helper\Product\Url', 'Magento\Filter\Translit'), + array('Magento\Catalog\Model\Product\Indexer\Price'), + array('Magento\Catalog\Model\Resource\Product\Indexer\Price'), + ['Magento\PubSub'], // unused library code which was removed + ['Magento\Outbound'], // unused library code which was removed array('Magento\Indexer\Model\Processor\CacheInvalidate', 'Magento\Indexer\Model\Processor\InvalidateCache'), array( 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Reviews', @@ -2147,7 +2150,7 @@ return array( ), array( 'Magento\LauncherInterface', - 'Magento\AppInterface', + 'Magento\Framework\AppInterface', ), array('Magento\Convert\ConvertException'), array('Magento\Convert\Container\AbstractContainer'), @@ -2163,12 +2166,11 @@ return array( ['Magento\Translation\Helper\Data'], ['Magento\Translate\Factory'], ['Magento\Backend\Model\Translate'], - ['Magento\Backend\Model\Resource\Translate'], - ['Magento\Backend\Model\Resource\Translate\String'], ['Magento\DesignEditor\Model\Translate\InlineVde', 'Magento\DesignEditor\Model\Translate\Inline'], - ['Magento\Backend\Model\Translate\Inline'], ['Magento\Backend\Model\Translate\Inline\ConfigFactory'], ['Magento\Translate\Inline\ConfigFactory'], + ['Magento\Bundle\Model\Price\Index'], + ['Magento\Bundle\Model\Resource\Price\Index'], array('Magento\Core\Model\Template', 'Magento\Email\Model\AbstractTemplate'), array('Magento\Core\Helper\Js'), array('Magento\Backend\Helper\Media\Js'), @@ -2204,12 +2206,10 @@ return array( 'Magento\Core\App\Request\RewriteService', 'Magento\UrlRewrite\App\Request\RewriteService' ), - ['Magento\Catalog\Model\Product\Indexer\Price'], - ['Magento\Catalog\Model\Resource\Product\Indexer\Price'], - ['Magento\App\ConfigInterface', 'Magento\App\Config\ScopeConfigInterface'], - ['Magento\Core\Model\Store\ConfigInterface', 'Magento\App\Config\ScopeConfigInterface'], - ['Magento\Core\Model\Store\Config', 'Magento\App\Config\ScopeConfigInterface'], - ['Magento\App\Locale\ScopeConfigInterface', 'Magento\App\Config\ScopeConfigInterface'], + ['Magento\Framework\App\ConfigInterface', 'Magento\Framework\App\Config\ScopeConfigInterface'], + ['Magento\Core\Model\Store\ConfigInterface', 'Magento\Framework\App\Config\ScopeConfigInterface'], + ['Magento\Core\Model\Store\Config', 'Magento\Framework\App\Config\ScopeConfigInterface'], + ['Magento\Framework\App\Locale\ScopeConfigInterface', 'Magento\Framework\App\Config\ScopeConfigInterface'], ['Magento\Core\App\Action\Plugin\StoreCheck', 'Magento\Store\App\Action\Plugin\StoreCheck'], [ 'Magento\Core\App\FrontController\Plugin\DispatchExceptionHandler', @@ -2249,9 +2249,9 @@ return array( ['Magento\Core\Model\System\Store', 'Magento\Store\Model\System\Store'], ['Magento\Core\Model\Website', 'Magento\Store\Model\Website'], ['Magento\Core\Model\Website\Factory', 'Magento\Store\Model\Website\Factory'], - ['Magento\App\ReinitableConfigInterface', 'Magento\App\Config\ReinitableConfigInterface'], - ['Magento\BaseScopeInterface', 'Magento\App\ScopeInterface'], - ['Magento\BaseScopeResolverInterface', 'Magento\App\ScopeResolverInterface'], + ['Magento\Framework\App\ReinitableConfigInterface', 'Magento\Framework\App\Config\ReinitableConfigInterface'], + ['Magento\BaseScopeInterface', 'Magento\Framework\App\ScopeInterface'], + ['Magento\BaseScopeResolverInterface', 'Magento\Framework\App\ScopeResolverInterface'], ['Magento\Locale\ScopeConfigInterface'], ['Magento\Core\Model\Module\Output\Config','Magento\Module\Output\Config'], ['Magento\Core\Model\Resource\Setup\Context','Magento\Module\Setup\Context'], @@ -2259,7 +2259,6 @@ return array( ['Magento\Core\Model\Resource\Setup\Generic'], ['Magento\Newsletter\Model\Resource\Setup'], ['Magento\SalesRule\Model\Resource\Setup'], - ['Magento\Catalog\Helper\Product\Url', 'Magento\Filter\Translit'], array('Magento\Core\Model\Session', 'Magento\Session\Generic'), array('Magento\Core\Model\Session\Config', 'Magento\Session\Config'), array('Magento\Core\Model\Session\SidResolver', 'Magento\Session\SidResolver'), @@ -2293,4 +2292,18 @@ return array( ['Magento\Rating\Model\Resource\Rating', 'Magento\Review\Model\Resource\Rating'], ['Magento\Rating\Model\Rating\Option', 'Magento\Review\Model\Rating\Option'], ['Magento\Rating\Model\Observer'], + array('Magento\Sales\Block\Adminhtml\Invoice\Grid'), + array('Magento\Sales\Block\Adminhtml\Shipment\Grid'), + array('Magento\Sales\Block\Adminhtml\Creditmemo\Grid'), + array('Magento\Sales\Block\Adminhtml\Transactions\Grid'), + array('Magento\Sales\Block\Adminhtml\Transactions\Child\Grid'), + ['Magento\Catalog\Model\PriceCurrency'], + [ + 'Magento\Framework\App\FrontController\Plugin\Clickjacking', + 'X-Frame-Options HTTP header setting moved to server configuration' + ], + ['Magento\Backend\Model\Translate\Inline', 'Magento\Translate\Inline'], + ['Magento\Backend\Model\Resource\Translate', 'Magento\Translation\Model\Resource\Translate'], + ['Magento\Backend\Model\Resource\Translate\String', 'Magento\Translation\Model\Resource\String'], + ['Magento\Core\Model\Layout', 'Magento\View\Layout'], ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_config_nodes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_config_nodes.php index da9e122609af0b3b2481d539b7019d3b42efcb73..65c92db0135b97f4c8f82d7d82963ad6665f755e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_config_nodes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_config_nodes.php @@ -50,7 +50,7 @@ return array( '/config/*[self::global|self::adminhtml|self::frontend]/di' => 'This configuration moved to di.xml file', '/config/*[self::global|self::adminhtml|self::frontend]/events' => 'This configuration moved to events.xml file', '/config/*[self::global|self::adminhtml|self::frontend]/routers' => 'Routes configuration moved to routes.xml file,' . - 'routers list can be set through Di configuration of \Magento\App\RouterList model', + 'routers list can be set through Di configuration of \Magento\Framework\App\RouterList model', '/config/global/importexport' => 'This configuration moved to import.xml and export.xml files', '/config/global/catalog/product/type' => 'This configuration moved to product_types.xml file', '/config/global/catalog/product/options' => 'This configuration moved to product_options.xml file', @@ -62,9 +62,9 @@ return array( '/config/global/salesrule' => 'This configuration moved to Di configuration of \Magento\SalesRule\Helper\Coupon', '/config/global/session' => 'This configuration moved to Di configuration of \Magento\Session\Validator', '/config/global/ignore_user_agents' => 'This configuration moved to Di configuration of \Magento\Log\Model\Visitor', - '/config/global/request' => 'This configuration moved to Di configuration of \Magento\App\RequestInterface', + '/config/global/request' => 'This configuration moved to Di configuration of \Magento\Framework\App\RequestInterface', '/config/global/secure_url' => 'This configuration moved to Di configuration of \Magento\Core\Model\Url\SecurityInfo', - '/config/global/dev' => 'This configuration moved to Di configuration of \Magento\App\Action\Context', + '/config/global/dev' => 'This configuration moved to Di configuration of \Magento\Framework\App\Action\Context', '/config/global/webapi' => 'This configuration moved to Di configuration of \Magento\Webapi\Controller\Request\Rest\Interpreter\Factory' . ' and \Magento\Webapi\Controller\Response\Rest\Renderer\Factory', '/config/global/cms' => 'This configuration moved to Di configuration of \Magento\Cms\Model\Wysiwyg\Images\Storage' . @@ -82,8 +82,8 @@ return array( '/config/global/catalog/product/attributes' => 'This configuration moved catalog_attributes.xml', '/config/global/eav_frontendclasses' => 'This configuration was removed. ' . 'Please pluginize \Magento\Eav\Helper\Data::getFrontendClasses to extend frontend classes list', - '/config/global/resources' => 'This configuration moved to Di configuration of \Magento\App\Resource', - '/config/global/resource' => 'This configuration moved to Di configuration of \Magento\App\Resource', + '/config/global/resources' => 'This configuration moved to Di configuration of \Magento\Framework\App\Resource', + '/config/global/resource' => 'This configuration moved to Di configuration of \Magento\Framework\App\Resource', '/config/*/events/core_block_abstract_to_html_after' => 'Event has been replaced with "core_layout_render_element"', '/config/*/events/catalog_controller_product_delete' => '', '/config//observers/*/args' => 'This was an undocumented and unused feature in event subscribers', diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index 3dedc2a4aef9ca0d5a0acdb1b61c0bc5c506d419..55659da47abad7a7b5ac43cfda3a8657f4f8210e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -26,12 +26,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( - array('ADMIN_STORE_ID', 'Magento\AppInterface'), + array('ADMIN_STORE_ID', 'Magento\Framework\AppInterface'), array('BACKORDERS_BELOW'), array('DS'), array('BACKORDERS_YES'), array('CACHE_TAG', 'Magento\Api\Model\Config', 'Magento_Api_Model_Cache_Type::CACHE_TAG'), - array('CACHE_TAG', 'Magento\AppInterface'), + array('CACHE_TAG', 'Magento\Framework\AppInterface'), array( 'CACHE_TAG', 'Magento\Model\Resource\Db\Collection\AbstractCollection', @@ -70,8 +70,8 @@ return array( 'Magento_Core_Model_Config_Resource::DEFAULT_WRITE_CONNECTION' ), array('DEFAULT_CURRENCY', 'Magento\Locale', 'Magento_Core_Model_LocaleInterface::DEFAULT_CURRENCY'), - array('DEFAULT_READ_CONNECTION', 'Magento\App\Resource\Config'), - array('DEFAULT_WRITE_CONNECTION', 'Magento\App\Resource\Config'), + array('DEFAULT_READ_CONNECTION', 'Magento\Framework\App\Resource\Config'), + array('DEFAULT_WRITE_CONNECTION', 'Magento\Framework\App\Resource\Config'), array('DEFAULT_ERROR_HANDLER', 'Mage'), array('DEFAULT_LOCALE', 'Magento\Locale', 'Magento_Core_Model_LocaleInterface::DEFAULT_LOCALE'), array('DEFAULT_THEME_NAME', 'Magento\Core\Model\Design\PackageInterface'), @@ -175,7 +175,7 @@ return array( array('XML_PATH_BACKEND_FRONTNAME', 'Mage_Backend_Helper_Data'), array('XML_PATH_CACHE_BETA_TYPES'), array('XML_PATH_CHECK_EXTENSIONS', 'Magento\Install\Model\Config'), - array('XML_PATH_CONNECTION_TYPE', 'Magento\App\Resource\Config'), + array('XML_PATH_CONNECTION_TYPE', 'Magento\Framework\App\Resource\Config'), array('XML_PATH_COUNTRY_DEFAULT', 'Magento\Paypal\Model\System\Config\Backend\MerchantCountry'), array( 'XML_PATH_DEBUG_TEMPLATE_HINTS', @@ -304,9 +304,9 @@ return array( 'Magento\Core\Model\Session\AbstractSession', 'Magento_Core_Model_Session_Validator::XML_PATH_USE_USER_AGENT' ), - array('XML_NODE_DIRECT_FRONT_NAMES', 'Magento\App\Request\Http'), + array('XML_NODE_DIRECT_FRONT_NAMES', 'Magento\Framework\App\Request\Http'), array('XML_NODE_USET_AGENT_SKIP', 'Magento\Core\Model\Session\AbstractSession'), - array('XML_PAGE_TYPE_RENDER_INHERITED', 'Magento\App\Action\Action'), + array('XML_PAGE_TYPE_RENDER_INHERITED', 'Magento\Framework\App\Action\Action'), array('XML_PATH_ALLOW_MAP_UPDATE', 'Magento\Core\Model\Design\FileResolution\StrategyPool'), array('XML_PATH_WEBAPI_REQUEST_INTERPRETERS', 'Magento\Webapi\Controller\Request\Rest\Interpreter\Factory'), array('XML_PATH_WEBAPI_RESPONSE_RENDERS', 'Magento\Webapi\Controller\Response\Rest\Renderer\Factor'), @@ -332,7 +332,7 @@ return array( array('XML_PATH_DISABLED_CACHE_TYPES', 'Magento\DesignEditor\Helper\Data'), array('XML_PATH_ENCRYPTION_MODEL', 'Magento\Core\Helper\Data'), array('CONFIG_KEY_PATH_TO_MAP_FILE', 'Magento\Module\Setup\Migration'), - array('XML_PATH_SKIP_PROCESS_MODULES_UPDATES', 'Magento\App\UpdaterInterface'), + array('XML_PATH_SKIP_PROCESS_MODULES_UPDATES', 'Magento\Framework\App\UpdaterInterface'), array('XML_PATH_IGNORE_DEV_MODE', 'Magento\Module\UpdaterInterface'), array('XML_PATH_SKIP_PROCESS_MODULES_UPDATES', 'Magento\Module\UpdaterInterface'), array('XML_PATH_USE_CUSTOM_ADMIN_PATH', 'Magento\Backend\Helper\Data'), @@ -536,27 +536,27 @@ return array( '\Magento\GroupedProduct\Model\Resource\Product\Link::LINK_TYPE_GROUPED' ), array('PARAM_APP_URIS', 'Magento\Filesystem'), - array('ROOT', '\Magento\Filesystem', '\Magento\App\Filesystem::ROOT_DIR'), - array('APP', '\Magento\Filesystem', '\Magento\App\Filesystem::APP_DIR'), - array('MODULES', '\Magento\Filesystem', '\Magento\App\Filesystem::MODULES_DIR'), - array('THEMES', '\Magento\Filesystem', '\Magento\App\Filesystem::THEMES_DIR'), - array('CONFIG', '\Magento\Filesystem', '\Magento\App\Filesystem::CONFIG_DIR'), - array('LIB', '\Magento\Filesystem', '\Magento\App\Filesystem::LIB_DIR'), - array('LOCALE', '\Magento\Filesystem', '\Magento\App\Filesystem::LOCALE_DIR'), - array('PUB', '\Magento\Filesystem', '\Magento\App\Filesystem::PUB_DIR'), - array('PUB_LIB', '\Magento\Filesystem', '\Magento\App\Filesystem::PUB_LIB_DIR'), - array('MEDIA', '\Magento\Filesystem', '\Magento\App\Filesystem::MEDIA_DIR'), - array('STATIC_VIEW', '\Magento\Filesystem', '\Magento\App\Filesystem::STATIC_VIEW_DIR'), - array('PUB_VIEW_CACHE', '\Magento\Filesystem', '\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR'), - array('VAR_DIR', '\Magento\Filesystem', '\Magento\App\Filesystem'), - array('TMP', '\Magento\Filesystem', '\Magento\App\Filesystem::TMP_DIR'), - array('CACHE', '\Magento\Filesystem', '\Magento\App\Filesystem::CACHE_DIR'), - array('LOG', '\Magento\Filesystem', '\Magento\App\Filesystem::LOG_DIR'), - array('SESSION', '\Magento\Filesystem', '\Magento\App\Filesystem::SESSION_DIR'), - array('DI', '\Magento\Filesystem', '\Magento\App\Filesystem::DI_DIR'), - array('GENERATION', '\Magento\Filesystem', '\Magento\App\Filesystem::GENERATION_DIR'), - array('UPLOAD', '\Magento\Filesystem', '\Magento\App\Filesystem::UPLOAD_DIR'), - array('SYS_TMP', '\Magento\Filesystem', '\Magento\App\Filesystem::SYS_TMP_DIR'), + array('ROOT', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::ROOT_DIR'), + array('APP', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::APP_DIR'), + array('MODULES', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::MODULES_DIR'), + array('THEMES', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::THEMES_DIR'), + array('CONFIG', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::CONFIG_DIR'), + array('LIB', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::LIB_DIR'), + array('LOCALE', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::LOCALE_DIR'), + array('PUB', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::PUB_DIR'), + array('PUB_LIB', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::PUB_LIB_DIR'), + array('MEDIA', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::MEDIA_DIR'), + array('STATIC_VIEW', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR'), + array('PUB_VIEW_CACHE', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR'), + array('VAR_DIR', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem'), + array('TMP', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::TMP_DIR'), + array('CACHE', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::CACHE_DIR'), + array('LOG', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::LOG_DIR'), + array('SESSION', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::SESSION_DIR'), + array('DI', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::DI_DIR'), + array('GENERATION', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::GENERATION_DIR'), + array('UPLOAD', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::UPLOAD_DIR'), + array('SYS_TMP', '\Magento\Filesystem', '\Magento\Framework\App\Filesystem::SYS_TMP_DIR'), array('LAYOUT_NAVIGATION_CLASS_NAME', 'Magento\DesignEditor\Model\State'), array( 'TYPE_CONFIGURABLE', diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 51dbfa295fe588c4ec81fcd863b07ac9d387b56f..58a7f88878eb3fdd67300ffafb75d3d2f0c4c503 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -47,7 +47,7 @@ return array( array('_beforeMove', 'Magento\Catalog\Model\Resource\Category\Tree'), array('_bytesToMbytes', 'Magento\Catalog\Model\Product\Option\Type\File'), array('_calculatePrice', 'Magento\Sales\Model\Quote\Item\AbstractItem'), - array('_canBeStoreCodeInUrl', 'Magento\App\Request\Http'), + array('_canBeStoreCodeInUrl', 'Magento\Framework\App\Request\Http'), array('_canShowField', 'Magento\Backend\Block\System\Config\Form'), array('_canUseCacheForInit', 'Magento\Core\Model\Config'), array('_canUseLocalModules'), @@ -80,7 +80,7 @@ return array( array('_getConfig', 'Magento\Theme\Helper\Layout'), array('_getCollapseState', 'Magento\Backend\Block\System\Config\Form\Fieldset', '_isCollapseState'), array('_getCollectionNames', 'Magento\Backend\Controller\Report\Sales'), - array('_getConnectionAdapterClassName', 'Magento\App\Resource'), + array('_getConnectionAdapterClassName', 'Magento\Framework\App\Resource'), array('_getConnenctionType', 'Magento\Install\Model\Installer\Db'), array('_getDateFromToHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'), array('_getDeclaredModuleFiles', 'Magento\Core\Model\Config'), @@ -101,7 +101,7 @@ return array( array('_getNumberFromToHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'), array('_getPathInScope', 'Magento\Core\Model\Config'), array('_getPriceFilter', 'Magento\LayeredNavigation\Block\Navigation'), - array('_getProcessor', 'Magento\App\Cache'), + array('_getProcessor', 'Magento\Framework\App\Cache'), array('_getProductQtyForCheck', 'Magento\CatalogInventory\Model\Observer'), array('_getPublicFileUrl', 'Magento\Core\Model\Design\Package', 'Magento_Core_Model_View_Url::getPublicFileUrl'), array('_getRangeByType', 'Magento\Log\Model\Resource\Visitor\Collection'), @@ -125,7 +125,7 @@ return array( array('_hookQueries', 'Magento\Core\Model\Resource\Setup'), array('_importAddress', 'Magento\Paypal\Model\Api\Nvp'), array('_inheritDesign', 'Magento\Catalog\Model\Design'), - array('_initLayoutMessages', 'Magento\App\Action\Action'), + array('_initLayoutMessages', 'Magento\Framework\App\Action\Action'), array('_initModulesPreNamespaces', 'Magento\Core\Model\Config'), array('_initOrder', 'Magento\Shipping\Block\Tracking\Popup'), array('_initShipment', 'Magento\Shipping\Block\Tracking\Popup'), @@ -233,7 +233,7 @@ return array( array('addLinkRel', 'Magento\Theme\Block\Html\Head'), array('addLogInLink', 'Magento\Customer\Block\Account\Link'), array('addModule', 'Magento\Core\App\Router\Base'), - array('addRouter', 'Magento\App\FrontController'), + array('addRouter', 'Magento\Framework\App\FrontController'), array('addOptionRenderer', 'Magento\Catalog\Block\Product\View\Options'), array('addPageHandles', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'), array('addPagerLimit', 'Magento\Catalog\Block\Product\ProductList\Toolbar'), @@ -302,7 +302,7 @@ return array( array('checkDateTime', 'Magento\Stdlib\DateTime\DateTime'), array('chooseTemplate', 'Magento\Checkout\Block\Cart'), array('cleanCache', 'Magento\Core\Model\Config'), - array('cleanDbRow', 'Magento\App\Resource'), + array('cleanDbRow', 'Magento\Framework\App\Resource'), array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package', 'Magento\View\Asset\MergeService'), array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\View\Asset\MergeService'), array('cleanMergedJsCss', 'Magento\Core\Model\Design\PackageInterface', 'Magento\View\Asset\MergeService'), @@ -310,7 +310,7 @@ return array( array( 'cleanVarSubFolders', '', - '\Magento\App\Filesystem::getDirectoryRead(\Magento\App\Filesystem::VAR_DIR)::search())' + '\Magento\Framework\App\Filesystem::getDirectoryRead(\Magento\Framework\App\Filesystem::VAR_DIR)::search())' ), array('cloneIndexTable', 'Magento\Index\Model\Resource\AbstractResource'), array('collectRoutes', 'Magento\Backend\App\Router\DefaultRouter'), @@ -343,9 +343,9 @@ return array( array('fetchItemsCount', 'Magento\Wishlist\Model\Resource\Wishlist'), array('fetchRuleRatesForCustomerTaxClass'), array('fetchUpdatesByHandle', 'Magento\Core\Model\Resource\Layout', 'Magento\Core\Model\Resource\Layout\Update'), - array('flush', 'Magento\App\Cache', 'Magento_Cache_FrontendInterface::clean()'), - array('flush', 'Magento\App\Cache\Proxy', 'Magento_Cache_FrontendInterface::clean()'), - array('flush', 'Magento\App\CacheInterface', 'Magento_Cache_FrontendInterface::clean()'), + array('flush', 'Magento\Framework\App\Cache', 'Magento_Cache_FrontendInterface::clean()'), + array('flush', 'Magento\Framework\App\Cache\Proxy', 'Magento_Cache_FrontendInterface::clean()'), + array('flush', 'Magento\Framework\App\CacheInterface', 'Magento_Cache_FrontendInterface::clean()'), array('forsedSave'), array('generateBlocks', '', 'generateElements()'), array('getAbsolutePath', '', 'normalizePath'), @@ -387,16 +387,16 @@ return array( array('getConfigAsXml', 'Magento\Widget\Model\Widget'), array('getConfigData', 'Magento\Cms\Model\Wysiwyg\Images\Storage'), array('getConfigDataModel', 'Magento\Core\Model\Config'), - array('getConnectionTypeInstance', 'Magento\App\Resource'), + array('getConnectionTypeInstance', 'Magento\Framework\App\Resource'), array('getContainers', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'), array('getCurrentUrl', 'Magento\Core\Helper\Url', 'Magento\Url'), array('getCustomerData', 'Magento\Sales\Block\Adminhtml\Order\Create\Form\Account'), array('getDataForSave', 'Magento\Wishlist\Model\Item'), array('getDataMaxSize'), array('getDataMaxSizeInBytes', 'Magento\Backend\Block\Media\Uploader', 'Magento_File_Size::getMaxFileSize()'), - array('getDbAdapter', 'Magento\App\Cache'), - array('getDbAdapter', 'Magento\App\Cache\Proxy'), - array('getDbAdapter', 'Magento\App\CacheInterface'), + array('getDbAdapter', 'Magento\Framework\App\Cache'), + array('getDbAdapter', 'Magento\Framework\App\Cache\Proxy'), + array('getDbAdapter', 'Magento\Framework\App\CacheInterface'), array( 'getDbVendorName', 'Magento\TestFramework\Bootstrap', @@ -491,7 +491,7 @@ return array( array('getOrderId', 'Magento\Checkout\Block\Onepage\Success'), array('getOrderId', 'Magento\Shipping\Block\Tracking\Popup'), array('getOriginalHeigh', '', 'getOriginalHeight'), - array('getOriginalRequest', 'Magento\App\Request\Http'), + array('getOriginalRequest', 'Magento\Framework\App\Request\Http'), array('getPackage', 'Magento\Widget\Model\Widget\Instance'), array('getPackageTheme', 'Magento\Widget\Model\Widget\Instance', 'getThemeId'), array('getPageHandleLabel', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'), @@ -557,8 +557,8 @@ return array( array('getResourceTypeConfig', 'Magento\Core\Model\Config'), array('getResTreeJson', 'Magento\User\Block\Role\Tab\Edit', 'getTree'), array('getResTreeJson', 'Magento\Backend\Block\Api\Tab\Rolesedit', 'getTree'), - array('getRouterByRoute', 'Magento\App\FrontController'), - array('getRouterByFrontName', 'Magento\App\FrontController'), + array('getRouterByRoute', 'Magento\Framework\App\FrontController'), + array('getRouterByFrontName', 'Magento\Framework\App\FrontController'), array('getRouters', 'Magento\Core\Model\Config'), array('getRowId', 'Magento\Sales\Block\Adminhtml\Order\Create\Customer\Grid'), array('getRowId', 'Magento\Backend\Block\Widget\Grid'), @@ -589,7 +589,7 @@ return array( array('getStore', 'Magento\Captcha\Helper\Data'), array('getStore', 'Magento\CatalogRule\Block\Adminhtml\Promo\Widget\Chooser\Sku'), array('getStoreButtonsHtml', 'Magento\Backend\Block\System\Config\Tabs'), - array('getStoreCodeFromPath', 'Magento\App\Request\Http'), + array('getStoreCodeFromPath', 'Magento\Framework\App\Request\Http'), array('getStoreCurrency', 'Magento\Sales\Model\Order'), array('getStoreSelectOptions', 'Magento\Backend\Block\System\Config\Tabs'), array('getStores', 'Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\AbstractOptions'), @@ -597,9 +597,9 @@ return array( array('getSuggestionsByQuery'), array('getSysTmpDir'), array('getTablePrefix', 'Magento\Core\Model\Config'), - array('getTagsByType', 'Magento\App\Cache', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), - array('getTagsByType', 'Magento\App\Cache\Proxy', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), - array('getTagsByType', 'Magento\App\CacheInterface', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), + array('getTagsByType', 'Magento\Framework\App\Cache', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), + array('getTagsByType', 'Magento\Framework\App\Cache\Proxy', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), + array('getTagsByType', 'Magento\Framework\App\CacheInterface', 'Magento_Cache_Frontend_Decorator_TagScope::getTag()'), array('getTaxAmount', 'Magento\Sales\Model\Quote\Item\AbstractItem'), array('getTaxRatesByProductClass', '', '_getAllRatesByProductClass'), array( @@ -662,7 +662,7 @@ return array( array('imageAction', 'Magento\Catalog\Controller\Product'), array('implodeStreetAddress', 'Magento\Customer\Model\Address\AbstractAddress'), array('importFromTextArray'), - array('init', 'Magento\App\FrontController'), + array('init', 'Magento\Framework\App\FrontController'), array('init', 'Magento\Core\Model\Config'), array('init', 'Magento\Webapi\Controller\Front'), array('initCache'), @@ -670,7 +670,7 @@ return array( array('initCurrentStore', 'Magento\Store\Model\Storage\Db', 'Magento\Store\Model\StorageFactory::_reinitStores'), array('initLabels', 'Magento\Catalog\Model\Resource\Eav\Attribute'), - array('initLayoutMessages', 'Magento\App\Action\Action'), + array('initLayoutMessages', 'Magento\Framework\App\Action\Action'), array('initSerializerBlock', 'Magento\Backend\Block\Catalog\Product\Edit\Tab\Ajax\Serializer'), array('initSerializerBlock', 'Magento\Backend\Block\Widget\Grid\Serializer'), array('insertProductPrice', 'Magento\Catalog\Model\Resource\Product\Attribute\Backend\Tierprice'), @@ -744,7 +744,7 @@ return array( array('processBeacon'), array('processBeforeVoid', 'Magento\Payment\Model\Method\AbstractMethod'), array('canUseForMultishipping', 'Magento\Payment\Model\Method\AbstractMethod'), - array('processRequest', 'Magento\App\Cache'), + array('processRequest', 'Magento\Framework\App\Cache'), array('processSubst', 'Magento\Store\Model\Store'), array('productEventAggregate'), array('publishRelatedViewFile', 'Magento\View\Publisher', '_publishRelatedViewFile'), @@ -768,9 +768,9 @@ return array( array('salesOrderPaymentPlaceEnd'), array('saveCache', 'Magento\Core\Model\Config'), array('saveConfig', 'Magento\Core\Model\Config'), - array('saveOptions', 'Magento\App\Cache'), - array('saveOptions', 'Magento\App\Cache\Proxy'), - array('saveOptions', 'Magento\App\CacheInterface'), + array('saveOptions', 'Magento\Framework\App\Cache'), + array('saveOptions', 'Magento\Framework\App\Cache\Proxy'), + array('saveOptions', 'Magento\Framework\App\CacheInterface'), array('saveRow__OLD'), array('saveSegmentCustomersFromSelect'), array('saveUseCache'), @@ -794,7 +794,7 @@ return array( array('setParentBlock'), array('setProduct', 'Magento\Catalog\Model\Product\Type\AbstractType'), array('setProfile', 'Magento\Convert\Container\AbstractContainer'), - array('setResourceConfig', 'Magento\App\Resource'), + array('setResourceConfig', 'Magento\Framework\App\Resource'), array('setSaveTemplateFlag', 'Magento\Newsletter\Model\Queue'), array('setScriptPath'), array('setScriptPath', 'Magento\View\Element\Template'), @@ -991,15 +991,15 @@ return array( array('_getProductType', 'Magento\Backend\Block\Catalog\Product\Edit\Tab\Super\Config\Matrix'), array('_getProductType', 'Magento\Backend\Block\Catalog\Product\Edit\Tab\Super\Config'), array('_getSession', 'Magento\Sales\Model\AdminOrder'), - array('setIsSerializable', 'Magento\App\State'), - array('getIsSerializable', 'Magento\App\State'), + array('setIsSerializable', 'Magento\Framework\App\State'), + array('getIsSerializable', 'Magento\Framework\App\State'), array('_getInventoryItemResource', 'Magento\Reports\Model\Resource\Product\Lowstock\Collection'), array('getMigrationInstance', 'Magento\Customer\Model\Resource\Setup', '$this->_migrationFactory->create()'), array('turnOnReadCommittedMode', 'Magento\Backup\Model\Resource\Db'), array('turnOnSerializableMode', 'Magento\Backup\Model\Resource\Db', 'prepareTransactionIsolationLevel'), array('_getResourceModel', '\Magento\Webapi\Model\Source\Acl\Role', '$this->_resource'), array('_getSession', '\Magento\GiftMessage\Model\Save', '$this->_session'), - array('run', '\Magento\AppInterface'), + array('run', '\Magento\Framework\AppInterface'), array('setModuleDir', 'Magento\Module\Dir\Reader'), array('setModuleDir', 'Magento\Core\Model\Config'), array('getAreaConfig', 'Magento\Core\Model\Config'), @@ -1018,11 +1018,11 @@ return array( array('validateKey', '\Magento\Core\Helper\Data', '\Magento\Encryption\EncryptorInterface'), array('validateHash', '\Magento\Core\Helper\Data'), array('getHash', '\Magento\Core\Helper\Data'), - array('escapeHtml', '\Magento\App\Helper\AbstractHelper', '\Magento\Escaper::escapeHtml'), - array('escapeUrl', '\Magento\App\Helper\AbstractHelper', '\Magento\Escaper::escapeUrl'), - array('jsQuoteEscape', '\Magento\App\Helper\AbstractHelper', '\Magento\Escaper::escapeJsQuote'), - array('quoteEscape', '\Magento\App\Helper\AbstractHelper', '\Magento\Escaper::escapeQuote'), - array('removeTags', '\Magento\App\Helper\AbstractHelper', '\Magento\Filter\FilterManager'), + array('escapeHtml', '\Magento\Framework\App\Helper\AbstractHelper', '\Magento\Escaper::escapeHtml'), + array('escapeUrl', '\Magento\Framework\App\Helper\AbstractHelper', '\Magento\Escaper::escapeUrl'), + array('jsQuoteEscape', '\Magento\Framework\App\Helper\AbstractHelper', '\Magento\Escaper::escapeJsQuote'), + array('quoteEscape', '\Magento\Framework\App\Helper\AbstractHelper', '\Magento\Escaper::escapeQuote'), + array('removeTags', '\Magento\Framework\App\Helper\AbstractHelper', '\Magento\Filter\FilterManager'), array('removeAccents', '\Magento\Core\Helper\Data', '\Magento\Filter\FilterManager'), array('splitWords', '\Magento\Core\Helper\String', '\Magento\Filter\FilterManager'), array('strlen', '\Magento\Core\Helper\String', '\Magento\Stdlib\String::strlen'), @@ -1086,6 +1086,8 @@ return array( array('copyFieldsetToTarget', 'Magento\Core\Helper\Data', 'Magento\Object\Copy::copyFieldsetToTarget'), array('formatDate', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale::formatDate'), array('formatTime', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale::formatTime'), + array('getCustomer', 'Magento\Backend\Model\Session\Quote', 'Magento\Backend\Model\Session\Quote::getCustomerId'), + array('setCustomer', 'Magento\Backend\Model\Session\Quote', 'Magento\Backend\Model\Session\Quote::setCustomerId'), array('_getConfigTimezone', '\Magento\Stdlib\DateTime\DateTime', '\Magento\Core\Model\Locale::getConfigTimezone'), array('_filterPostData', '\Magento\Checkout\Controller\Onepage'), array('_filterPostData', '\Magento\Customer\Controller\Account'), @@ -1107,17 +1109,17 @@ return array( array( '_redirectSuccess', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\Response\RedirectInterface::success' + '\Magento\Framework\App\Response\RedirectInterface::success' ), array( '_redirectUrl', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\Response\RedirectInterface::redirect' + '\Magento\Framework\App\Response\RedirectInterface::redirect' ), array( '_redirectError', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\Response\RedirectInterface::error' + '\Magento\Framework\App\Response\RedirectInterface::error' ), array('_redirectReferer', '\Magento\Core\Controller\Varien\Action'), array( @@ -1128,7 +1130,7 @@ return array( array( '_getRefererUrl', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\Response\RedirectInterface::getRefererUrl' + '\Magento\Framework\App\Response\RedirectInterface::getRefererUrl' ), array('_isUrlInternal', '\Magento\Core\Controller\Varien\Action'), array( @@ -1140,45 +1142,45 @@ return array( array('_initDesign', '\Magento\Core\Controller\Varien\Action', '\Magento\Core\Model\DesignLoader::load'), array('_firePreDispatchEvents', '\Magento\Core\Controller\Varien\Action'), array('_prepareDownloadResponse', '\Magento\Core\Controller\Varien\Action'), - array('_title', '\Magento\Core\Controller\Varien\Action', '\Magento\App\Action\Title::add'), + array('_title', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\Action\Title::add'), array('_renderTitles', '\Magento\Core\Controller\Varien\Action'), - array('getFlag', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ActionFlag::get'), - array('setFlag', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ActionFlag::set'), - array('loadLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ViewInterface::'), - array('addPageLayoutHandles', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ViewInterface::loadLayout'), + array('getFlag', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ActionFlag::get'), + array('setFlag', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ActionFlag::set'), + array('loadLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ViewInterface::'), + array('addPageLayoutHandles', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ViewInterface::loadLayout'), array( 'getDefaultLayoutHandle', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\ViewInterface::getDefaultLayoutHandle' + '\Magento\Framework\App\ViewInterface::getDefaultLayoutHandle' ), array( 'generateLayoutXml', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\ViewInterface::generateLayoutXml' + '\Magento\Framework\App\ViewInterface::generateLayoutXml' ), - array('renderLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ViewInterface::renderLayout'), - array('getLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\App\ViewInterface::getLayout'), + array('renderLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ViewInterface::renderLayout'), + array('getLayout', '\Magento\Core\Controller\Varien\Action', '\Magento\Framework\App\ViewInterface::getLayout'), array( 'loadLayoutUpdates', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\ViewInterface::loadLayoutUpdates' + '\Magento\Framework\App\ViewInterface::loadLayoutUpdates' ), array( 'generateLayoutBlocks', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\ViewInterface::generateLayoutBlocks' + '\Magento\Framework\App\ViewInterface::generateLayoutBlocks' ), array( 'addActionLayoutHandles', '\Magento\Core\Controller\Varien\Action', - '\Magento\App\ViewInterface::addActionLayoutHandles' + '\Magento\Framework\App\ViewInterface::addActionLayoutHandles' ), - array('getTranslator', '\Magento\App\Helper\Context'), + array('getTranslator', '\Magento\Framework\App\Helper\Context'), array('getTranslator', '\Magento\Core\Helper\Data'), - array('_loadCache', '\Magento\App\Helper\AbstractHelper'), - array('_saveCache', '\Magento\App\Helper\AbstractHelper'), - array('_removeCache', '\Magento\App\Helper\AbstractHelper'), - array('_cleanCache', '\Magento\App\Helper\AbstractHelper'), + array('_loadCache', '\Magento\Framework\App\Helper\AbstractHelper'), + array('_saveCache', '\Magento\Framework\App\Helper\AbstractHelper'), + array('_removeCache', '\Magento\Framework\App\Helper\AbstractHelper'), + array('_cleanCache', '\Magento\Framework\App\Helper\AbstractHelper'), array( 'changeQuoteCustomerGroupId', '\Magento\Sales\Model\Observer', @@ -1637,4 +1639,7 @@ return array( ['_getThemeInstance', 'Magento\View\Layout'], ['getArea', 'Magento\View\Layout'], ['setArea', 'Magento\View\Layout'], + ['getCustomer', 'Magento\Tax\Model\Calculation', 'Magento\Tax\Model\Calculation::getCustomerData'], + ['setCustomer', 'Magento\Tax\Model\Calculation', 'Magento\Tax\Model\Calculation::setCustomerData'], + ['setCustomer', 'Magento\Checkout\Model\Session', 'Magento\Checkout\Model\Session::setCustomerData'], ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php index e25728a5f50d6408c1aef26c5ea7897ece40d4f3..65eddcbe393d4fba1afd8ba9abb6247653f46cfe 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php @@ -30,7 +30,7 @@ return array( array('_addMinimalPrice', 'Magento\Catalog\Model\Resource\Product\Collection'), array('_alias', 'Magento\Core\Block\AbstractBlock'), array('_anonSuffix'), - array('_appMode', 'Magento\App\ObjectManager\ConfigLoader'), + array('_appMode', 'Magento\Framework\App\ObjectManager\ConfigLoader'), array('_baseDirCache', 'Magento\Core\Model\Config'), array('_cacheConf'), array('_cachedItemPriceBlocks'), @@ -46,7 +46,7 @@ return array( array('_configModel', 'Magento\Backend\Model\Menu\AbstractDirector'), array('_configuration', 'Magento\Index\Model\Lock\Storage', '_dirs'), array('_connectionConfig', 'Magento\Core\Model\Resource\Setup'), - array('_connectionTypes', 'Magento\App\Resource'), + array('_connectionTypes', 'Magento\Framework\App\Resource'), array('_currencyNameTable'), array('_customEtcDir', 'Magento\Core\Model\Config'), array('_customerFactory ', '\Magento\Sales\Block\Adminhtml\Billing\Agreement\View\Tab\Info'), @@ -55,10 +55,10 @@ return array( array('_defaultTemplates', 'Magento\Email\Model\Template'), array('_designProductSettingsApplied'), array('_directOutput', 'Magento\View\Layout'), - array('_dirs', 'Magento\App\Resource'), + array('_dirs', 'Magento\Framework\App\Resource'), array('_distroServerVars'), array('_entityIdsToIncrementIds'), - array('entities', 'Magento\App\Resource'), + array('entities', 'Magento\Framework\App\Resource'), array('_entityTypeIdsToTypes'), array('_factory', 'Magento\Backend\Model\Menu\Config'), array('_factory', 'Magento\Backend\Model\Menu\AbstractDirector', '_commandFactory'), @@ -72,11 +72,11 @@ return array( array('_loadDefault', 'Magento\Store\Model\Resource\Website\Collection'), array('_mapper', 'Magento\ObjectManager\Config\Reader\Dom'), array('_menu', 'Magento\Backend\Model\Menu\Builder'), - array('_modulesReader', 'Magento\App\ObjectManager\ConfigLoader'), + array('_modulesReader', 'Magento\Framework\App\ObjectManager\ConfigLoader'), array('_moduleReader', 'Magento\Backend\Model\Menu\Config'), array('_option', 'Magento\Captcha\Helper\Data', '_dirs'), array('_options', 'Magento\Core\Model\Config', 'Magento\Filesystem'), - array('_optionsMapping', null, '\Magento\App\Filesystem::getPath($nodeKey)'), + array('_optionsMapping', null, '\Magento\Framework\App\Filesystem::getPath($nodeKey)'), array('_order', 'Magento\Checkout\Block\Onepage\Success'), array('_order_id'), array('_parent', 'Magento\Core\Block\AbstractBlock'), @@ -85,7 +85,7 @@ return array( array('_queriesHooked', 'Magento\Core\Model\Resource\Setup'), array('_quoteImporter', 'Magento\Paypal\Model\Express\Checkout'), array('_ratingOptionTable', 'Magento\Review\Model\Resource\Rating\Option\Collection'), - array('_readerFactory', 'Magento\App\ObjectManager\ConfigLoader'), + array('_readerFactory', 'Magento\Framework\App\ObjectManager\ConfigLoader'), array('_recurringPaymentProfiles', '\Magento\Paypal\Model\Api\AbstractApi'), array('_resourceConfig', 'Magento\Core\Model\Resource\Setup'), array('_saveTemplateFlag', 'Magento\Newsletter\Model\Queue'), @@ -190,7 +190,7 @@ return array( array('_dirModel', 'Magento\Downloadable\Controller\Adminhtml\Downloadable\File'), array('_dirModel', 'Magento\Downloadable\Model\Link'), array('_dirModel', 'Magento\Downloadable\Model\Sample'), - array('_dir', 'Magento\App\Dir'), + array('_dir', 'Magento\Framework\App\Dir'), array('_baseDir', 'Magento\Backup\Model\Fs\Collection'), array('_filesystem', 'Magento\Backup\Model\Fs\Collection'), array('_dir', 'Magento\Backup\Model\Fs\Collection'), @@ -198,13 +198,15 @@ return array( array('_dirs', 'Magento\Core\Helper\Theme'), array('_dirs', 'Magento\Model\Resource\Type\Db\Pdo\Mysql'), array('_filesystem', 'Magento\GiftWrapping\Model\Wrapping'), + array('_customer', 'Magento\Backend\Model\Session\Quote'), + array('_customerFactory', 'Magento\Backend\Model\Session\Quote'), array('_dirs', 'Magento\Index\Model\Lock\Storage'), array('_filesystem', 'Magento\Index\Model\Lock\Storage'), array('_coreDir', 'Magento\Sales\Model\Order\Pdf\AbstractPdf'), array('_coreDir', 'Magento\ScheduledImportExport\Model\Scheduled\Operation'), array('_dir', 'Magento\Store\App\FrontController\Plugin\DispatchExceptionHandler'), array('_dirs', 'Magento\Core\Block\Template'), - array('_applicationDirs', 'Magento\App\Config\FileResolver'), + array('_applicationDirs', 'Magento\Framework\App\Config\FileResolver'), array('_dir', 'Magento\Core\Model\File\Storage'), array('_dir', 'Magento\Locale\Hierarchy\Config\FileResolver'), array('_dirs', 'Magento\Core\Block\Template\Context'), @@ -312,8 +314,8 @@ return array( ['_placeholderRender', 'Magento\Translate'], ['_canUseInline', 'Magento\Translate'], ['_eventManager', 'Magento\Translate'], - ['_inlineFactory', 'Magento\App\Helper\Context', 'translateInline'], - ['_inlineFactory', 'Magento\App\Helper\AbstractHelper', 'translateInline'], + ['_inlineFactory', 'Magento\Framework\App\Helper\Context', 'translateInline'], + ['_inlineFactory', 'Magento\Framework\App\Helper\AbstractHelper', 'translateInline'], ['_storeManager', 'Magento\Translation\Model\Resource\Translate'], ['_storeManager', 'Magento\Translation\Model\Resource\String'], ['_isVdeRequest', 'Magento\DesignEditor\Helper\Data'], diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt index 773ae4e63caea7f3fbfe06b4481709199a01f863..04f530160613c323f465d36987ad0bb3c525861c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt @@ -36,7 +36,7 @@ dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php dev/tests/unit/testsuite/Magento/Session/ConfigTest.php dev/tests/unit/testsuite/Magento/View/TemplateEngine/_files dev/tools/Magento/Tools/I18n/Zend -lib/Magento/App/Config/Element.php +lib/Magento/Framework/App/Config/Element.php lib/Magento/Archive lib/Magento/Autoload/Simple.php lib/Magento/Backup diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index 12d5c4fca627778c8411b24ac5345cc05a9b392a..3f88a75c9c5b2bdae09149b1b1b0fd75a7819246 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -104,7 +104,7 @@ lib/Magento/Acl lib/PEAR lib/phpseclib lib/Magento/Convert -lib/Magento/App/Config +lib/Magento/Framework/App/Config Magento/Cron/Model Magento/SalesRule/Model/Resource/Report/Rule Magento/SalesRule/Model/Resource/Rule diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index a69b437523b7548f2d844567417e8ebfc5c9925d..2ab241d024d8104ec355a8b40af080dbe73b57bb 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -129,12 +129,12 @@ lib/Magento/Convert lib/Magento/Exception lib/Magento/Stdlib/DateTime.php lib/Magento/Object.php -lib/Magento/App +lib/Magento/Framework/App lib/Magento/Data/Argument lib/Magento/ObjectManager lib/Magento/Service lib/Magento/Url/SecurityInfoInterface.php lib/Magento/View -lib/Magento/App/AbstractShell.php +lib/Magento/Framework/App/AbstractShell.php lib/Magento/Locale/Validator.php -lib/Magento/App/Config +lib/Magento/Framework/App/Config diff --git a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php index bb83f2e796faefe180923fc1707e0fab44c62782..87b052ccf0baf3e8af0ee6b8678dc845cb5753a2 100644 --- a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php +++ b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php @@ -98,26 +98,26 @@ class Adminhtml extends \PHPUnit_Framework_TestCase $this->_sidResolver = $this->_makeMock('Magento\Session\SidResolver'); $this->_translatorMock = $this->_makeMock('Magento\TranslateInterface'); $this->_layoutMock = $this->_makeMock('Magento\View\Layout'); - $this->_requestMock = $this->_makeMock('Magento\App\RequestInterface'); + $this->_requestMock = $this->_makeMock('Magento\Framework\App\RequestInterface'); $this->_messagesMock = $this->_makeMock('Magento\View\Element\Messages'); $this->_urlMock = $this->_makeMock('Magento\UrlInterface'); $this->_eventManagerMock = $this->_makeMock('Magento\Event\ManagerInterface'); - $this->_controllerMock = $this->_makeMock('Magento\App\FrontController'); + $this->_controllerMock = $this->_makeMock('Magento\Framework\App\FrontController'); $this->_loggerMock = $this->_makeMock('Magento\Logger'); - $this->_filesystemMock = $this->_makeMock('Magento\App\Filesystem'); - $this->_cacheMock = $this->_makeMock('Magento\App\CacheInterface'); - $this->_scopeConfigMock = $this->_makeMock('Magento\App\Config\ScopeConfigInterface'); + $this->_filesystemMock = $this->_makeMock('Magento\Framework\App\Filesystem'); + $this->_cacheMock = $this->_makeMock('Magento\Framework\App\CacheInterface'); + $this->_scopeConfigMock = $this->_makeMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_storeManagerMock = $this->_makeMock('Magento\Store\Model\StoreManager'); $viewUrlMock = $this->_makeMock('Magento\View\Url'); $viewConfigMock = $this->_makeMock('Magento\View\ConfigInterface'); $viewFileSystemMock = $this->_makeMock('Magento\View\FileSystem'); $templatePoolMock = $this->_makeMock('Magento\View\TemplateEnginePool'); $authorizationMock = $this->_makeMock('Magento\AuthorizationInterface'); - $cacheStateMock = $this->_makeMock('Magento\App\Cache\StateInterface'); + $cacheStateMock = $this->_makeMock('Magento\Framework\App\Cache\StateInterface'); $escaperMock = $this->_makeMock('Magento\Escaper'); $filterManagerMock = $this->_makeMock('Magento\Filter\FilterManager'); $backendSessionMock = $this->_makeMock('Magento\Backend\Model\Session'); - $appState = $this->_makeMock('Magento\App\State'); + $appState = $this->_makeMock('Magento\Framework\App\State'); $this->_mathMock = $this->_makeMock('Magento\Math\Random'); $this->_formKey = $this->_makeMock('Magento\Data\Form\FormKey'); diff --git a/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php b/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php index f25395e73acfa5e727b007bfd225f9ebd0286d42..b2d89559203a5df4781932c370fd4fa5fd2bf354 100644 --- a/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php +++ b/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php @@ -34,14 +34,14 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase * @var array */ protected $_blockDependencies = array( - 'request' => 'Magento\App\RequestInterface', + 'request' => 'Magento\Framework\App\RequestInterface', 'layout' => 'Magento\View\LayoutInterface', 'eventManager' => 'Magento\Event\ManagerInterface', 'translator' => 'Magento\TranslateInterface', - 'cache' => 'Magento\App\CacheInterface', + 'cache' => 'Magento\Framework\App\CacheInterface', 'design' => 'Magento\View\DesignInterface', 'session' => 'Magento\Session\SessionManagerInterface', - 'scopeConfig' => 'Magento\App\Config\ScopeConfigInterface' + 'scopeConfig' => 'Magento\Framework\App\Config\ScopeConfigInterface' ); /** @@ -51,7 +51,7 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase */ protected $_modelDependencies = array( 'eventManager' => 'Magento\Event\ManagerInterface', - 'cacheManager' => 'Magento\App\CacheInterface', + 'cacheManager' => 'Magento\Framework\App\CacheInterface', 'resource' => 'Magento\Model\Resource\AbstractResource', 'resourceCollection' => 'Magento\Data\Collection\Db' ); @@ -70,8 +70,8 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase } $area = 'frontend'; - /** @var $appStateMock \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject */ - $appStateMock = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); + /** @var $appStateMock \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ + $appStateMock = $this->getMock('Magento\Framework\App\State', array('getAreaCode'), array(), '', false); $appStateMock->expects($this->once())->method('getAreaCode')->will($this->returnValue($area)); $context = $objectManager->getObject('Magento\View\Element\Template\Context'); @@ -90,9 +90,9 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase public function testGetModel() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - /** @var $model \Magento\App\Config\ValueInterface */ - $model = $objectManager->getObject('Magento\App\Config\Value'); - $this->assertInstanceOf('Magento\App\Config\Value', $model); + /** @var $model \Magento\Framework\App\Config\ValueInterface */ + $model = $objectManager->getObject('Magento\Framework\App\Config\Value'); + $this->assertInstanceOf('Magento\Framework\App\Config\Value', $model); foreach ($this->_modelDependencies as $propertyName => $propertyType) { $this->assertAttributeInstanceOf($propertyType, '_' . $propertyName, $model); } @@ -108,7 +108,7 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase $resourceMock->expects($this->once())->method('_getReadAdapter')->will($this->returnValue(false)); $resourceMock->expects($this->any())->method('getIdFieldName')->will($this->returnValue('id')); $arguments = array('resource' => $resourceMock); - $model = $objectManager->getObject('Magento\App\Config\Value', $arguments); + $model = $objectManager->getObject('Magento\Framework\App\Config\Value', $arguments); $this->assertFalse($model->getResource()->getDataVersion('test')); } } diff --git a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/BaseurlTest.php b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/BaseurlTest.php index 9d1bf7dd185c04084b03f96fecd771bbc3a722c3..853acec24f0e246863b049da08d7d153987bda01 100644 --- a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/BaseurlTest.php +++ b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/BaseurlTest.php @@ -63,19 +63,19 @@ class BaseurlTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_configMock = $this->getMock('Magento\App\Config', array(), array(), '', false); + $this->_configMock = $this->getMock('Magento\Framework\App\Config', array(), array(), '', false); $this->_urlBuilderMock = $this->getMock('Magento\UrlInterface'); $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $configFactoryMock = $this->getMock( - 'Magento\App\Config\ValueFactory', + 'Magento\Framework\App\Config\ValueFactory', array('create'), array(), '', false ); $this->_configDataMock = $this->getMock( - 'Magento\App\Config\Value', + 'Magento\Framework\App\Config\Value', array('getScope', 'getScopeId', 'getCollection', '__sleep', '__wakeup'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php index 107ec0682093e5d8eb5326c3e92565dab442f0bb..2037b86259f67ca0f6d498985ca6f73e9d904fa3 100644 --- a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php +++ b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/CacheOutdatedTest.php @@ -52,7 +52,7 @@ class CacheOutdatedTest extends \PHPUnit_Framework_TestCase { $this->_authorizationMock = $this->getMock('Magento\AuthorizationInterface'); $this->_urlInterfaceMock = $this->getMock('Magento\UrlInterface'); - $this->_cacheTypeListMock = $this->getMock('Magento\App\Cache\TypeListInterface'); + $this->_cacheTypeListMock = $this->getMock('Magento\Framework\App\Cache\TypeListInterface'); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $arguments = array( diff --git a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/SecurityTest.php b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/SecurityTest.php index 84b580f1f4c996a5affbb268e4eec7851cb61b36..39d92ab5db2f1bd82e07646a51ae9a34056be8a2 100644 --- a/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/SecurityTest.php +++ b/dev/tests/unit/testsuite/Magento/AdminNotification/Model/System/Message/SecurityTest.php @@ -53,8 +53,8 @@ class SecurityTest extends \PHPUnit_Framework_TestCase protected function setUp() { //Prepare objects for constructor - $this->_cacheMock = $this->getMock('Magento\App\CacheInterface'); - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_cacheMock = $this->getMock('Magento\Framework\App\CacheInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_curlFactoryMock = $this->getMock( 'Magento\HTTP\Adapter\CurlFactory', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/App/FrontController/Plugin/ClickjackingTest.php b/dev/tests/unit/testsuite/Magento/App/FrontController/Plugin/ClickjackingTest.php deleted file mode 100644 index 645d8c58de8d2720847096f395f8cd4440d53e76..0000000000000000000000000000000000000000 --- a/dev/tests/unit/testsuite/Magento/App/FrontController/Plugin/ClickjackingTest.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\App\FrontController\Plugin; - -class ClickjackingTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Magento\App\FrontController\Plugin\Clickjacking - */ - protected $plugin; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $responseMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $subjectMock; - - protected function setUp() - { - $this->responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); - $this->subjectMock = $this->getMock('Magento\App\FrontController', array(), array(), '', false); - $this->plugin = new \Magento\App\FrontController\Plugin\Clickjacking(); - } - - public function testAfterDispatchIfHeaderExist() - { - $this->responseMock->expects( - $this->once() - )->method( - 'getHeader' - )->with( - 'X-Frame-Options' - )->will( - $this->returnValue(false) - ); - $this->responseMock->expects( - $this->once() - )->method( - 'setHeader' - )->with( - 'X-Frame-Options', - 'SAMEORIGIN' - )->will( - $this->returnValue($this->responseMock) - ); - $this->assertEquals( - $this->responseMock, - $this->plugin->afterDispatch($this->subjectMock, $this->responseMock) - ); - } - - public function testAfterDispatchIfHeaderNotExist() - { - $this->responseMock->expects( - $this->once() - )->method( - 'getHeader' - )->with( - 'X-Frame-Options' - )->will( - $this->returnValue(true) - ); - $this->responseMock->expects($this->never())->method('setHeader'); - $this->assertEquals( - $this->responseMock, - $this->plugin->afterDispatch($this->subjectMock, $this->responseMock) - ); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php index 176590187191c1e90a6c98cd975c2a6fe90f871d..7aa1298b309e7de5b125bba5aa8c820e7d9ef66b 100644 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php +++ b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/BackendTest.php @@ -43,7 +43,7 @@ class BackendTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_urlBuilder = $this->getMock('Magento\Backend\Model\Url', array('getUrl'), array(), '', false); - $contextMock = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $contextMock = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $contextMock->expects($this->any())->method('getUrlBuilder')->will($this->returnValue($this->_urlBuilder)); $this->_orderFactory = $this->getMock('Magento\Sales\Model\OrderFactory', array('create'), array(), '', false); $this->_model = new Backend( diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php index c042bccc9e24b22dbe74753ffe02d2db7557151f..4700c80dda69d7cb878dda36466d9a9d01c59e0a 100644 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Authorizenet/Model/Directpost/ObserverTest.php @@ -101,7 +101,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase ); $request = new \Magento\Object(); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $controller = $this->getMock( 'Magento\Checkout\Controller\Action', array('getRequest', 'getResponse'), diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/AuthenticationTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/AuthenticationTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9105fcfb096666c4b4897ec6be6772a238d5404c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/AuthenticationTest.php @@ -0,0 +1,106 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Backend\App\Action\Plugin; + +use Magento\TestFramework\Helper\ObjectManager; + +/** + * Class AuthenticationTest + * @package Magento\Backend\App\Action\Plugin + */ +class AuthenticationTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Backend\Model\Auth | \PHPUnit_Framework_MockObject_MockObject + */ + protected $auth; + + /** + * @var Authentication + */ + protected $plugin; + + protected function setUp() + { + $this->auth = $this->getMock( + 'Magento\Backend\Model\Auth', + ['getUser', 'isLoggedIn', 'getAuthStorage'], + [], + '', + false + ); + $objectManager= new ObjectManager($this); + $this->plugin = $objectManager->getObject( + 'Magento\Backend\App\Action\Plugin\Authentication', + ['auth' => $this->auth] + ); + } + + protected function tearDown() + { + $this->auth = null; + $this->plugin = null; + } + + public function testAroundDispatchProlongStorage() + { + $subject = $this->getMock('Magento\Backend\Controller\Adminhtml\Index', [], [], '', false); + $request = $this->getMock('\Magento\Framework\App\Request\Http', ['getActionName'], [], '', false); + $user = $this->getMock('Magento\User\Model\User', ['reload', '__wakeup'], [], '', false); + $storage = $this->getMock('Magento\Backend\Model\Auth\Session', ['prolong', 'refreshAcl'], [], '', false); + + $expectedResult = 'expectedResult'; + $action = 'index'; + $loggedIn = true; + + $this->auth->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($user)); + $this->auth->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue($loggedIn)); + $this->auth->expects($this->any()) + ->method('getAuthStorage') + ->will($this->returnValue($storage)); + + + $request->expects($this->once()) + ->method('getActionName') + ->will($this->returnValue($action)); + + $user->expects($this->once()) + ->method('reload'); + + $storage->expects($this->at(0)) + ->method('prolong'); + $storage->expects($this->at(1)) + ->method('refreshAcl'); + + $proceed = function ($request) use ($expectedResult) { + return $expectedResult; + }; + + $this->assertEquals($expectedResult, $this->plugin->aroundDispatch($subject, $proceed, $request)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/MassactionKeyTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/MassactionKeyTest.php index 919ee935e2af45a39ecf4a4b63a27c0f452b60b7..97cfd50caadaf79a1c384191a56fe3b5ac536d3a 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/MassactionKeyTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/App/Action/Plugin/MassactionKeyTest.php @@ -51,7 +51,7 @@ class MassactionKeyTest extends \PHPUnit_Framework_TestCase return 'Expected'; }; $this->subjectMock = $this->getMock('Magento\Backend\App\AbstractAction', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->plugin = new \Magento\Backend\App\Action\Plugin\MassactionKey(); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/Area/Request/PathInfoProcessorTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/Area/Request/PathInfoProcessorTest.php index 4a749f50eb98e39b58491343176d1435cb231902..d5938708a903527a5706b57183a885f7a112b20b 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/App/Area/Request/PathInfoProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/App/Area/Request/PathInfoProcessorTest.php @@ -52,7 +52,7 @@ class PathInfoProcessorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('\Magento\App\RequestInterface'); + $this->_requestMock = $this->getMock('\Magento\Framework\App\RequestInterface'); $this->_subjectMock = $this->getMock( '\Magento\Store\App\Request\PathInfoProcessor', array(), diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/ConfigTest.php index 3a3a268d4753eafee1492fd8956b69f5a1ae2bee..4e3390eb8e6d304f59c748d86a2e1d0872ab3f40 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/App/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/App/ConfigTest.php @@ -26,7 +26,7 @@ namespace Magento\Backend\App; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject */ protected $sectionPool; @@ -38,7 +38,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->sectionPool = $this->getMock( - 'Magento\App\Config\ScopePool', + 'Magento\Framework\App\Config\ScopePool', array('getScope', 'clean'), array(), '', @@ -140,10 +140,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase * Get ConfigData mock * * @param $mockedMethod - * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\Data + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\Data */ protected function getConfigDataMock($mockedMethod) { - return $this->getMock('Magento\App\Config\Data', array($mockedMethod), array(), '', false); + return $this->getMock('Magento\Framework\App\Config\Data', array($mockedMethod), array(), '', false); } } diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/Response/Http/FileFactoryTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/Response/Http/FileFactoryTest.php index 52ec4821a3ecc2d60511d20e0aa7a4d57c38aeeb..98a7db2730828c127cb04a40ff9d71081f01a6be 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/App/Response/Http/FileFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/App/Response/Http/FileFactoryTest.php @@ -26,7 +26,7 @@ namespace Magento\Backend\App\Response\Http; class FileFactoryTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_model; @@ -53,7 +53,13 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_responseMock = $this->getMock('Magento\App\Response\Http', array('setRedirect'), array(), '', false); + $this->_responseMock = $this->getMock( + 'Magento\Framework\App\Response\Http', + array('setRedirect'), + array(), + '', + false + ); $this->_responseMock->expects( $this->any() )->method( @@ -84,8 +90,11 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase public function testCreate() { $authStorageMock = $this->getMock( - 'Magento\Backend\Model\Auth\StorageInterface', - array('isFirstPageAfterLogin', 'processLogout', 'processLogin ') + 'Magento\Backend\Model\Auth\Session', + array('isFirstPageAfterLogin', 'processLogout', 'processLogin'), + array(), + '', + false ); $this->_authMock->expects($this->once())->method('getAuthStorage')->will($this->returnValue($authStorageMock)); $authStorageMock->expects($this->once())->method('isFirstPageAfterLogin')->will($this->returnValue(true)); diff --git a/dev/tests/unit/testsuite/Magento/Backend/App/Router/NoRouteHandlerTest.php b/dev/tests/unit/testsuite/Magento/Backend/App/Router/NoRouteHandlerTest.php index b20448c0468966495e80dbf63a879d9e13fd3db0..ca53ace5113bfe9d1ba7aec337fd62bd5b2ff2cc 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/App/Router/NoRouteHandlerTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/App/Router/NoRouteHandlerTest.php @@ -47,8 +47,8 @@ class NoRouteHandlerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_routeConfigMock = $this->getMock('\Magento\App\Route\ConfigInterface'); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_routeConfigMock = $this->getMock('\Magento\Framework\App\Route\ConfigInterface'); $this->_helperMock = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false); $this->_helperMock->expects($this->any())->method('getAreaFrontName')->will($this->returnValue('backend')); $this->_model = new \Magento\Backend\App\Router\NoRouteHandler($this->_helperMock, $this->_routeConfigMock); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php index bb1518a82f235a55961ed0d122642c0562fdd3ff..1240755f6b04400ffbad8578b28ae69aba8e0fbd 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php @@ -38,13 +38,13 @@ class ResetTest extends \PHPUnit_Framework_TestCase private $_resetRobotsBlock; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $configMock; protected function setUp() { - $this->configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $context = $objectHelper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/EditTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/EditTest.php index 20deb6a7e5968e7d5e00cf1e553fcef68c04b9ec..49a203fae90f1e862313d91b1764d4b9ad82a203 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/EditTest.php @@ -69,7 +69,14 @@ class EditTest extends \PHPUnit_Framework_TestCase false ); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false, false); + $this->_requestMock = $this->getMock( + 'Magento\Framework\App\RequestInterface', + array(), + array(), + '', + false, + false + ); $this->_requestMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/Form/FieldsetTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/Form/FieldsetTest.php index b0c04e5465b4a88c2d6917c4cfec4507ed60210e..2c18e652043ccd3cc2f15e2be200bd1f3c638d8e 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/Form/FieldsetTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/Form/FieldsetTest.php @@ -70,7 +70,14 @@ class FieldsetTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false, false); + $this->_requestMock = $this->getMock( + 'Magento\Framework\App\RequestInterface', + array(), + array(), + '', + false, + false + ); $this->_urlModelMock = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false, false); $this->_layoutMock = $this->getMock('Magento\View\Layout', array(), array(), '', false, false); $groupMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/FormTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/FormTest.php index e600b154a0d1064a2a4b63149d782ae1de230459..303904a0a31fba8a6db2ba71d620df14e8fd786e 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/FormTest.php @@ -88,7 +88,7 @@ class FormTest extends \PHPUnit_Framework_TestCase false ); - $requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false, false); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false, false); $requestParams = array( array('website', '', 'website_code'), array('section', '', 'section_code'), @@ -131,7 +131,7 @@ class FormTest extends \PHPUnit_Framework_TestCase false, false ); - $this->_coreConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_coreConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_backendConfigMock = $this->getMock('Magento\Backend\Model\Config', array(), array(), '', false, false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/TabsTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/TabsTest.php index de9cb90a1e23f164f7cfe237e7e43c3fdd7d0b18..b4c14d594c7051c720a9e21d8c72ff70c6e6afd4 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/TabsTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/System/Config/TabsTest.php @@ -50,7 +50,7 @@ class TabsTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->_requestMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/Column/Renderer/CurrencyTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/Column/Renderer/CurrencyTest.php index a828791950a1d88dc62d3e258e0785a4748fe9b6..bbc279feabf60b194d929e8e74e69bd6e070fae6 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/Column/Renderer/CurrencyTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/Column/Renderer/CurrencyTest.php @@ -72,7 +72,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase { $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->_localeMock = $this->getMock('Magento\Locale\CurrencyInterface'); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->_curLocatorMock = $this->getMock( 'Magento\Directory\Model\Currency\DefaultLocator', diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php index a6b512f65daf4fc7cf0a77f614181020dd52a815..33de6fc20d11bb362729d54b4596be18c2a58245 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/MassactionTest.php @@ -95,7 +95,7 @@ class MassactionTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->_gridMock) ); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_urlModelMock = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php index 8e182e95e6de0e8b86a0af3e7320c414f2f7dbfa..e43fd841aa5647b52b1a7e9f620189601f1df089 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php @@ -28,8 +28,8 @@ class CacheTest extends \PHPUnit_Framework_TestCase public function testCleanMediaAction() { // Wire object with mocks - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $objectManager = $this->getMock('Magento\ObjectManager'); $backendHelper = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/DashboardTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/DashboardTest.php index afff0a5fca13004eb002bbbb0a19415c7f6e1c44..3323eee1ba5fe5ba2f4a99cf98fb1265b0bd3b24 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/DashboardTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/DashboardTest.php @@ -42,8 +42,8 @@ class DashboardTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $this->_objectManager = $this->getMock('Magento\ObjectManager'); } @@ -67,7 +67,7 @@ class DashboardTest extends \PHPUnit_Framework_TestCase $this->returnValue(urlencode(base64_encode(json_encode(array(1))))) ); $this->_request->expects($this->at(1))->method('getParam')->with('h')->will($this->returnValue($fixture)); - $tunnelResponse = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $tunnelResponse = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $httpClient = $this->getMock( 'Magento\HTTP\ZendClient', array('setUri', 'setParameterGet', 'setConfig', 'request', 'getHeaders') @@ -239,22 +239,25 @@ class DashboardTest extends \PHPUnit_Framework_TestCase /** * Create the tested object * - * @param Magento\App\Request\Http $request - * @param \Magento\App\Response\Http|null $response + * @param \Magento\Framework\App\Request\Http $request + * @param \Magento\Framework\App\Response\Http|null $response * @return \Magento\Backend\Controller\Adminhtml\Dashboard|PHPUnit_Framework_MockObject_MockObject */ protected function _factory($request, $response = null) { if (!$response) { - /** @var $response \Magento\App\ResponseInterface|PHPUnit_Framework_MockObject_MockObject */ - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + /** @var $response \Magento\Framework\App\ResponseInterface|PHPUnit_Framework_MockObject_MockObject */ + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $response->headersSentThrowsException = false; } $rewriteFactory = $this->getMock( 'Magento\UrlRewrite\Model\UrlRewriteFactory', array('create'), array(), '', false ); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $varienFront = $helper->getObject('Magento\App\FrontController', array('rewriteFactory' => $rewriteFactory)); + $varienFront = $helper->getObject( + 'Magento\Framework\App\FrontController', + array('rewriteFactory' => $rewriteFactory) + ); $arguments = array( 'request' => $request, diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/AccountTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/AccountTest.php index bb124e970808720fd267feea701a02d18eeb4c10..e951449e810d4198397e27c5928636f794b24d4c 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/AccountTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/AccountTest.php @@ -31,10 +31,10 @@ class AccountTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Backend\Controller\Adminhtml\System\Account */ protected $_controller; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\RequestInterface */ + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\RequestInterface */ protected $_requestMock; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\ResponseInterface */ + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\ResponseInterface */ protected $_responseMock; /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\ObjectManager\ObjectManager */ @@ -64,12 +64,12 @@ class AccountTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_requestMock = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->setMethods( array('getOriginalPathInfo') )->getMock(); $this->_responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->setMethods( array() )->getMock(); @@ -79,7 +79,7 @@ class AccountTest extends \PHPUnit_Framework_TestCase array('get', 'create') )->getMock(); $frontControllerMock = $this->getMockBuilder( - 'Magento\App\FrontController' + 'Magento\Framework\App\FrontController' )->disableOriginalConstructor()->getMock(); $this->_helperMock = $this->getMockBuilder( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php index 04da08219a817c89013d106a3ad08b8320848983..d73e424d86ac0f4634cb8820547a7005cedbaf5b 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/System/Config/SaveTest.php @@ -75,8 +75,15 @@ class SaveTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false, false); - $this->_responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false, false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false, false); + $this->_responseMock = $this->getMock( + 'Magento\Framework\App\Response\Http', + array(), + array(), + '', + false, + false + ); $configStructureMock = $this->getMock( 'Magento\Backend\Model\Config\Structure', @@ -124,7 +131,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase false ); - $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Layout', array(), array(), '', false); + $this->_cacheMock = $this->getMock('Magento\Framework\App\Cache\Type\Layout', array(), array(), '', false); $configStructureMock->expects( $this->any() diff --git a/dev/tests/unit/testsuite/Magento/Backend/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Backend/Helper/DataTest.php index 762a044ab7fe3192d134525f4563084dbe400004..1ffc04a25a8403237891011197479b2df5fa1f55 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Helper/DataTest.php @@ -48,14 +48,14 @@ class DataTest extends \PHPUnit_Framework_TestCase false ); $this->_helper = new \Magento\Backend\Helper\Data( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false, false), - $this->getMock('\Magento\App\Route\Config', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false, false), + $this->getMock('\Magento\Framework\App\Route\Config', array(), array(), '', false), $this->getMock('Magento\Locale\ResolverInterface'), $this->getMock('\Magento\Backend\Model\Url', array(), array(), '', false), $this->getMock('\Magento\Backend\Model\Auth', array(), array(), '', false), $this->_frontResolverMock, $this->getMock('\Magento\Math\Random', array(), array(), '', false), - $this->getMock('\Magento\App\RequestInterface') + $this->getMock('\Magento\Framework\App\RequestInterface') ); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Auth/SessionTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Auth/SessionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..66cf16e2b3d3f461b7ac8f66d3633bd0c6ed17ac --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Auth/SessionTest.php @@ -0,0 +1,151 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Backend\Model\Auth; + +use Magento\TestFramework\Helper\ObjectManager; + +/** + * Class SessionTest + * @package Magento\Backend\Model\Auth\Session + */ +class SessionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Backend\App\Config | \PHPUnit_Framework_MockObject_MockObject + */ + protected $config; + + /** + * @var \Magento\Session\Config | \PHPUnit_Framework_MockObject_MockObject + */ + protected $sessionConfig; + + /** + * @var \Magento\Stdlib\Cookie | \PHPUnit_Framework_MockObject_MockObject + */ + protected $cookie; + + /** + * @var \Magento\Session\Storage | \PHPUnit_Framework_MockObject_MockObject + */ + protected $storage; + + /** + * @var Session + */ + protected $session; + + protected function setUp() + { + $this->config = $this->getMock('Magento\Backend\App\Config', ['getValue'], [], '', false); + $this->cookie = $this->getMock('Magento\Stdlib\Cookie', ['get', 'set'], [], '', false); + $this->storage = $this->getMock('Magento\Session\Storage', ['getUser'], [], '', false); + $this->sessionConfig = $this->getMock( + 'Magento\Session\Config', + ['getCookiePath', 'getCookieDomain', 'getCookieSecure', 'getCookieHttpOnly'], + [], + '', + false + ); + $objectManager= new ObjectManager($this); + $this->session = $objectManager->getObject( + 'Magento\Backend\Model\Auth\Session', + [ + 'config' => $this->config, + 'sessionConfig' => $this->sessionConfig, + 'cookie' => $this->cookie, + 'storage' => $this->storage + ] + ); + } + + protected function tearDown() + { + $this->config = null; + $this->sessionConfig = null; + $this->session = null; + } + + public function testIsLoggedInPositive() + { + $lifetime = 900; + $user = $this->getMock('Magento\User\Model\User', ['getId', '__wakeup'], [], '', false); + $user->expects($this->once()) + ->method('getId') + ->will($this->returnValue(1)); + + $this->session->setUpdatedAt(time() + $lifetime); // Emulate just updated session + + $this->storage->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($user)); + + $this->config->expects($this->once()) + ->method('getValue') + ->with(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME) + ->will($this->returnValue($lifetime)); + + $this->assertTrue($this->session->isLoggedIn()); + } + + public function testProlong() + { + $name = session_name(); + $cookie = 'cookie'; + $lifetime = 900; + $path = '/'; + $domain = 'magento2'; + $secure = true; + $httpOnly = true; + + $this->cookie->expects($this->once()) + ->method('get') + ->with($name) + ->will($this->returnValue($cookie)); + $this->cookie->expects($this->once()) + ->method('set') + ->with($name, $cookie, $lifetime, $path, $domain, $secure, $httpOnly); + + $this->config->expects($this->once()) + ->method('getValue') + ->with(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME) + ->will($this->returnValue($lifetime)); + $this->sessionConfig->expects($this->once()) + ->method('getCookiePath') + ->will($this->returnValue($path)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieDomain') + ->will($this->returnValue($domain)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieSecure') + ->will($this->returnValue($secure)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieHttpOnly') + ->will($this->returnValue($httpOnly)); + + $this->session->prolong(); + + $this->assertLessThanOrEqual(time(), $this->session->getUpdatedAt()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/AuthTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/AuthTest.php index 7914a74d33aed19f2b02daeb263fd16646341898..2a80fa5afc72eab122a4c2496ded46b28aa7476b 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/AuthTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/AuthTest.php @@ -23,6 +23,12 @@ */ namespace Magento\Backend\Model; +use Magento\TestFramework\Helper\ObjectManager; + +/** + * Class AuthTest + * @package Magento\Backend\Model + */ class AuthTest extends \PHPUnit_Framework_TestCase { /** @@ -50,13 +56,14 @@ class AuthTest extends \PHPUnit_Framework_TestCase $this->_eventManagerMock = $this->getMock('\Magento\Event\ManagerInterface'); $this->_credentialStorage = $this->getMock('\Magento\Backend\Model\Auth\Credential\StorageInterface'); $this->_modelFactoryMock = $this->getMock('\Magento\Core\Model\Factory', array(), array(), '', false); - $this->_model = new \Magento\Backend\Model\Auth( - $this->_eventManagerMock, - $this->getMock('\Magento\Backend\Helper\Data', array(), array(), '', false), - $this->getMock('\Magento\Backend\Model\Auth\StorageInterface'), - $this->_credentialStorage, - $this->getMock('\Magento\App\Config\ScopeConfigInterface'), - $this->_modelFactoryMock + $objectManager= new ObjectManager($this); + $this->_model = $objectManager->getObject( + 'Magento\Backend\Model\Auth', + [ + 'eventManager' => $this->_eventManagerMock, + 'credentialStorage' => $this->_credentialStorage, + 'modelFactory' => $this->_modelFactoryMock + ] ); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php index 60966b9a5f9d7e581fcc1eaba946ae2b09e6d4d3..766e1b4435412f6129b17099dd030b51411caae2 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php @@ -28,8 +28,8 @@ class BaseurlTest extends \PHPUnit_Framework_TestCase public function testSaveMergedJsCssMustBeCleaned() { $eventDispatcher = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); - $appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $cacheManager = $this->getMock('Magento\App\CacheInterface'); + $appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $cacheManager = $this->getMock('Magento\Framework\App\CacheInterface'); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $actionValidatorMock = $this->getMock( 'Magento\Model\ActionValidator\RemoveAction', @@ -52,7 +52,7 @@ class BaseurlTest extends \PHPUnit_Framework_TestCase $resourceCollection = $this->getMock('Magento\Data\Collection\Db', array(), array(), '', false); $mergeService = $this->getMock('Magento\View\Asset\MergeService', array(), array(), '', false); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); - $coreConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $coreConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $model = $this->getMock( 'Magento\Backend\Model\Config\Backend\Baseurl', diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/EncryptedTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/EncryptedTest.php index 374d898591473519d0605b4c978eabed4a2e7018..9f5e3cfd5398b697b516a52943fa097b0ec08df5 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/EncryptedTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/EncryptedTest.php @@ -66,7 +66,7 @@ class EncryptedTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_helperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_encryptorMock = $this->getMock('Magento\Encryption\EncryptorInterface', array(), array(), '', false); $this->_model = $helper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php index c2591ae6c2733195c8443de97afde5d92de54995..07710dad57fe89dc45fd264082efd66959ebe0d2 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php @@ -28,8 +28,8 @@ class SecureTest extends \PHPUnit_Framework_TestCase public function testSaveMergedJsCssMustBeCleaned() { $eventDispatcher = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); - $appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $cacheManager = $this->getMock('Magento\App\CacheInterface'); + $appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $cacheManager = $this->getMock('Magento\Framework\App\CacheInterface'); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $actionValidatorMock = $this->getMock( '\Magento\Model\ActionValidator\RemoveAction', @@ -51,7 +51,7 @@ class SecureTest extends \PHPUnit_Framework_TestCase $resourceCollection = $this->getMock('Magento\Data\Collection\Db', array(), array(), '', false); $mergeService = $this->getMock('Magento\View\Asset\MergeService', array(), array(), '', false); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); - $coreConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $coreConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $model = $this->getMock( 'Magento\Backend\Model\Config\Backend\Secure', diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/LoaderTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/LoaderTest.php index fc4490773ae6a404d5cfe5e553c85345dd76f836..d1e8794ceb324144a2e547e4498685a3f95a296b 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/LoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/LoaderTest.php @@ -46,7 +46,7 @@ class LoaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_configValueFactory = $this->getMock( - 'Magento\App\Config\ValueFactory', + 'Magento\Framework\App\Config\ValueFactory', array('create', 'getCollection'), array(), '', @@ -73,7 +73,7 @@ class LoaderTest extends \PHPUnit_Framework_TestCase $this->returnSelf() ); - $configDataMock = $this->getMock('Magento\App\Config\Value', array(), array(), '', false); + $configDataMock = $this->getMock('Magento\Framework\App\Config\Value', array(), array(), '', false); $this->_configValueFactory->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/ScopeDefinerTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/ScopeDefinerTest.php index 7495f9e44ddbb3c26e50fe7a21fb6626435f79ff..bae16aae0d84bba92a0baa59abf7baf4917e2096 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/ScopeDefinerTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/ScopeDefinerTest.php @@ -40,13 +40,13 @@ class ScopeDefinerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->_model = new \Magento\Backend\Model\Config\ScopeDefiner($this->_requestMock); } public function testGetScopeReturnsDefaultScopeIfNoScopeDataIsSpecified() { - $this->assertEquals(\Magento\App\ScopeInterface::SCOPE_DEFAULT, $this->_model->getScope()); + $this->assertEquals(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $this->_model->getScope()); } public function testGetScopeReturnsStoreScopeIfStoreIsSpecified() diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Storage/Media/DatabaseTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Storage/Media/DatabaseTest.php index aae7f0f0d56fe91640d4fcf479adad7185ddfec8..2316250ff98983b013c343e6f6da5f77cad9abbd 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Storage/Media/DatabaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Storage/Media/DatabaseTest.php @@ -37,13 +37,13 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase protected $mediaDatabase; /** - * @var \Magento\App\Arguments|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Arguments|\PHPUnit_Framework_MockObject_MockObject */ protected $configMock; protected function setUp() { - $this->configMock = $this->getMock('Magento\App\Arguments', array(), array(), '', false); + $this->configMock = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); $this->configMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/AbstractElementTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/AbstractElementTest.php index c1faa24a5717d58c3c6977e53997ec9403cf92f4..9e85bbc406482ad49a40b959db361483e4f889b0 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/AbstractElementTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/AbstractElementTest.php @@ -98,7 +98,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( array('showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0), - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); $this->assertTrue($this->_model->isVisible()); } @@ -108,7 +108,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( array('hide_in_single_store_mode' => 1, 'showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0), - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); $this->assertFalse($this->_model->isVisible()); } @@ -121,7 +121,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( array('showInDefault' => 0, 'showInStore' => 0, 'showInWebsite' => 0), - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ); $this->assertFalse($this->_model->isVisible()); } @@ -142,7 +142,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase return array( array( array('showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0), - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ), array( array('showInDefault' => 0, 'showInStore' => 1, 'showInWebsite' => 0), @@ -171,7 +171,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase return array( array( array('showInDefault' => 0, 'showInStore' => 1, 'showInWebsite' => 1), - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ), array( array('showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 1), diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/Dependency/MapperTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/Dependency/MapperTest.php index bc6e99344b85fe1e64227265138a61bea7133abf..fa6acee78d85f5b554335e7e10872878cf809e23 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/Dependency/MapperTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/Dependency/MapperTest.php @@ -94,7 +94,7 @@ class MapperTest extends \PHPUnit_Framework_TestCase array('create') )->disableOriginalConstructor()->getMock(); $this->_scopeConfigMock = $this->getMockBuilder( - '\Magento\App\Config\ScopeConfigInterface' + '\Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->_model = new \Magento\Backend\Model\Config\Structure\Element\Dependency\Mapper( $this->_configStructureMock, diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/GroupTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/GroupTest.php index 5fd6f34042d422f5fe3b6281b55600ec3886c9d7..4a4a914efbd7c4f4710079a4ccb7f704f82e04ec 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/GroupTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Structure/Element/GroupTest.php @@ -116,7 +116,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase public function testGetCloneModelCreatesCloneModel() { - $cloneModel = $this->getMock('Magento\App\Config\ValueInterface', array(), array(), '', false); + $cloneModel = $this->getMock('Magento\Framework\App\Config\ValueInterface', array(), array(), '', false); $this->_depMapperMock = $this->getMock( 'Magento\Backend\Model\Config\Structure\Element\Dependency\Mapper', array(), diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/ConfigTest.php index 5f0343979d18ae5c92166442aaaa9ac53dc4c1c2..9106793a44246e21c2b3ab3245d27227aa14cb87 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/ConfigTest.php @@ -49,7 +49,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_transFactoryMock; /** - * @var \Magento\App\Config\ReinitableConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ReinitableConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_appConfigMock; @@ -111,7 +111,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_appConfigMock = $this->getMock('Magento\App\Config\ReinitableConfigInterface'); + $this->_appConfigMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); $this->_configLoaderMock = $this->getMock( 'Magento\Backend\Model\Config\Loader', array('getConfigByPath'), @@ -120,7 +120,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase false ); $this->_dataFactoryMock = $this->getMock( - 'Magento\App\Config\ValueFactory', + 'Magento\Framework\App\Config\ValueFactory', array(), array(), '', @@ -248,7 +248,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_model->setGroups(array('1' => array('fields' => array('key' => array('data'))))); $backendModel = $this->getMock( - 'Magento\App\Config\Value', + 'Magento\Framework\App\Config\Value', array('setPath', 'addData', '__sleep', '__wakeup'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php index 24ea3fb9024cbdc4dd806c9e2a7ffe5b09877a50..86d37720cd5d9264e57bf02d9ec8bb3fe2a64da8 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php @@ -75,7 +75,13 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_cacheInstanceMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); + $this->_cacheInstanceMock = $this->getMock( + 'Magento\Framework\App\Cache\Type\Config', + array(), + array(), + '', + false + ); $this->_directorMock = $this->getMock( 'Magento\Backend\Model\Menu\AbstractDirector', @@ -124,11 +130,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_menuFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->_menuMock)); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_configReaderMock->expects($this->any())->method('read')->will($this->returnValue(array())); - $appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array('getAreaCode'), array(), '', false); $appState->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php index 8982729bd61a2e74be7ecda8a7272233d0a03220..2bf217d5332c0b3b48f35cb428ab85b23e9c8ea9 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php @@ -84,7 +84,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_aclMock = $this->getMock('Magento\AuthorizationInterface'); - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_menuFactoryMock = $this->getMock( 'Magento\Backend\Model\MenuFactory', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php index 74b857f42a0371fc12215eca8136dd889644927b..2e4218d795f3166ccfc83135003dc80ba9c7b024 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/SessionTest.php @@ -43,7 +43,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); include __DIR__ . '/_files/session_backend_mock.php'; - $requestMock = $helper->getObject('Magento\App\Request\Http'); + $requestMock = $helper->getObject('Magento\Framework\App\Request\Http'); $helper->getObject('Magento\Backend\Model\Session', array('request' => $requestMock)); $this->assertTrue(self::$sessionStart); $this->assertTrue(self::$registerShutdownFunction); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php index 19bf38732381b3244f3a51c6778fd17ac50e8415..14d68ac1db26e8bf29e8400a778843d3adb916b7 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php @@ -134,7 +134,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_areaFrontName) ); - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_scopeConfigMock->expects( $this->any() )->method( @@ -210,7 +210,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase ) ); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_model->setRequest($this->_requestMock); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php index b1279fc4f478c01aa9b6a6d1d7e11f31544660c0..fcf0bef026a1c5c7d1527c2a5ede5afea2267bd9 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/ViewTest.php @@ -49,7 +49,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase array( 'aclFilter' => $aclFilter, 'layout' => $this->_layoutMock, - 'request' => $this->getMock('Magento\App\Request\Http', array(), array(), '', false) + 'request' => $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false) ) ); } diff --git a/dev/tests/unit/testsuite/Magento/Backup/MediaTest.php b/dev/tests/unit/testsuite/Magento/Backup/MediaTest.php index 9709df797d1e22da7eea843adddbc696adb451ff..bfbc62c89df686f785bdc1bc75e390f948bc1e99 100644 --- a/dev/tests/unit/testsuite/Magento/Backup/MediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Backup/MediaTest.php @@ -34,7 +34,7 @@ require_once __DIR__ . '/_files/io.php'; class MediaTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystemMock; @@ -69,7 +69,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase $this->_backupDbMock->expects($this->any())->method('create')->will($this->returnValue(true)); - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_backupFactoryMock = $this->getMock('Magento\Backup\Factory', array(), array(), '', false); $this->_backupFactoryMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Backup/Model/Fs/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Backup/Model/Fs/CollectionTest.php index 88ac52d5521ffcac9ebca73671fe8d8f1fff9c20..d1e3d471978599b01a163cb3143e7834527d9760 100644 --- a/dev/tests/unit/testsuite/Magento/Backup/Model/Fs/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Backup/Model/Fs/CollectionTest.php @@ -31,7 +31,9 @@ class CollectionTest extends \PHPUnit_Framework_TestCase public function testConstructor() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $filesystem = $this->getMockBuilder('\Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('\Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $directoryWrite = $this->getMockBuilder( '\Magento\Filesystem\Directory\WriteInterface' )->disableOriginalConstructor()->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Backup/NomediaTest.php b/dev/tests/unit/testsuite/Magento/Backup/NomediaTest.php index 8d0d51a2d5f280434a1b3769949d1d75b6a5310a..1c036e207d19c2defd51ebdaa642600cb0b36800 100644 --- a/dev/tests/unit/testsuite/Magento/Backup/NomediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Backup/NomediaTest.php @@ -34,7 +34,7 @@ require_once __DIR__ . '/_files/io.php'; class NomediaTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystemMock; @@ -69,7 +69,7 @@ class NomediaTest extends \PHPUnit_Framework_TestCase $this->_backupDbMock->expects($this->any())->method('create')->will($this->returnValue(true)); - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_backupFactoryMock = $this->getMock('Magento\Backup\Factory', array(), array(), '', false); $this->_backupFactoryMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Backup/SnapshotTest.php b/dev/tests/unit/testsuite/Magento/Backup/SnapshotTest.php index 55250795eafd2407d4f7691182e8e1ddde8517ed..8405448335ff32f4a19b604e9aa2fc842bffaa00 100644 --- a/dev/tests/unit/testsuite/Magento/Backup/SnapshotTest.php +++ b/dev/tests/unit/testsuite/Magento/Backup/SnapshotTest.php @@ -30,7 +30,7 @@ class SnapshotTest extends \PHPUnit_Framework_TestCase { public function testGetDbBackupFilename() { - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $backupFactory = $this->getMock('Magento\Backup\Factory', array(), array(), '', false); $manager = $this->getMock( 'Magento\Backup\Snapshot', diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php index 0238e211f8e65fb6521b203328b0d67e8fdad902..a67802b8ab1dc55915228fd519b1058c0dfda0f5 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php @@ -28,37 +28,61 @@ class OptionTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option */ - protected $_block; + protected $block; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $product; + + /** + * @var \Magento\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; protected function setUp() { - $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->product = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['getPriceInfo', 'hasPreconfiguredValues', 'getPreconfiguredValues', '__wakeup']) + ->getMock(); - $this->_block = $objectManagerHelper->getObject( - '\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option' - ); + $registry = $this->getMockBuilder('Magento\Registry') + ->disableOriginalConstructor() + ->getMock(); - $product = $this->getMock( - '\Magento\Catalog\Model\Product', - array('hasPreconfiguredValues', 'getPreconfiguredValues', '__wakeup'), - array(), - '', - false - ); - $product->expects($this->atLeastOnce())->method('hasPreconfiguredValues')->will($this->returnValue(true)); - $product->expects( - $this->atLeastOnce() - )->method( - 'getPreconfiguredValues' - )->will( - $this->returnValue(new \Magento\Object(array('bundle_option' => array(15 => 315, 16 => 316)))) - ); + $registry->expects($this->once()) + ->method('registry') + ->with('current_product') + ->will($this->returnValue($this->product)); + + + $this->layout = $this->getMock('Magento\View\LayoutInterface'); + + $context = $this->getMockBuilder('Magento\View\Element\Template\Context') + ->disableOriginalConstructor() + ->getMock(); + $context->expects($this->atLeastOnce()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); - $this->_block->setData('product', $product); + + $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->block = $objectManagerHelper->getObject( + '\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option', + ['registry' => $registry, 'context' => $context] + ); } public function testSetOption() { + $this->product->expects($this->atLeastOnce()) + ->method('hasPreconfiguredValues') + ->will($this->returnValue(true)); + $this->product->expects($this->atLeastOnce()) + ->method('getPreconfiguredValues') + ->will($this->returnValue(new \Magento\Object(array('bundle_option' => array(15 => 315, 16 => 316))))); + $option = $this->getMock('\Magento\Bundle\Model\Option', array(), array(), '', false); $option->expects($this->any())->method('getId')->will($this->returnValue(15)); @@ -74,13 +98,60 @@ class OptionTest extends \PHPUnit_Framework_TestCase ); $selection->expects($this->atLeastOnce())->method('getSelectionId')->will($this->returnValue(315)); - $this->assertSame($this->_block, $this->_block->setOption($option)); - $this->assertTrue($this->_block->isSelected($selection)); + $this->assertSame($this->block, $this->block->setOption($option)); + $this->assertTrue($this->block->isSelected($selection)); - $this->_block->setOption($otherOption); + $this->block->setOption($otherOption); $this->assertFalse( - $this->_block->isSelected($selection), + $this->block->isSelected($selection), 'Selected value should change after new option is set' ); } + + public function testRenderPriceString() + { + $includeContainer = false; + $priceHtml = 'price-html'; + + $selection = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + $bundlePrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice') + ->disableOriginalConstructor() + ->getMock(); + + $priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + $amount = $this->getMock('Magento\Pricing\Amount\AmountInterface'); + + $priceRenderBlock = $this->getMockBuilder('Magento\Pricing\Render') + ->disableOriginalConstructor() + ->setMethods(['renderAmount']) + ->getMock(); + + $this->product->expects($this->atLeastOnce()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfo)); + + $priceInfo->expects($this->atLeastOnce()) + ->method('getPrice') + ->with('bundle_option') + ->will($this->returnValue($bundlePrice)); + + $bundlePrice->expects($this->atLeastOnce()) + ->method('getOptionSelectionAmount') + ->with($selection) + ->will($this->returnValue($amount)); + + $this->layout->expects($this->atLeastOnce()) + ->method('getBlock') + ->with('product.price.render.default') + ->will($this->returnValue($priceRenderBlock)); + + $priceRenderBlock->expects($this->atLeastOnce()) + ->method('renderAmount') + ->with($amount, $bundlePrice, $selection, ['include_container' => $includeContainer]) + ->will($this->returnValue($priceHtml)); + + $this->assertEquals($priceHtml, $this->block->renderPriceString($selection, $includeContainer)); + } } diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php index d7014f07e0282b37501307c61eeecd3e04f6d833..4982dc0ca6ba9da74c29c4ccee3146f3eb2f9795 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php @@ -49,7 +49,7 @@ class BundleTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $methods = array( 'getCompositeReadonly', 'setBundleOptionsData', diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Adjustment/CalculatorTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Adjustment/CalculatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f8fa38d2d6da84773d0ef050bfb13819736e21cb --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Adjustment/CalculatorTest.php @@ -0,0 +1,393 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Bundle + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Adjustment; + +use Magento\Bundle\Pricing\Price; +use Magento\Bundle\Model\Product\Price as ProductPrice; + +/** + * Test for \Magento\Bundle\Pricing\Adjustment\Calculator + */ +class CalculatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableItem; + + /** + * @var \Magento\Pricing\Price\PriceInterface[]|\PHPUnit_Framework_MockObject_MockObject[] + */ + protected $priceMocks = []; + + /** + * @var float + */ + protected $baseAmount = 50.; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $baseCalculator; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $amountFactory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $selectionFactory; + + /** + * @var Calculator + */ + protected $model; + + protected function setUp() + { + $this->saleableItem = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface', [], [], '', true); + $priceInfo->expects($this->any())->method('getPrice')->will($this->returnCallback(function ($type) { + if (!isset($this->priceMocks[$type])) { + throw new \PHPUnit_Framework_ExpectationFailedException('Unexpected type of price model'); + } + return $this->priceMocks[$type]; + })); + $this->saleableItem->expects($this->any())->method('getPriceInfo')->will($this->returnValue($priceInfo)); + + + $this->baseCalculator = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + $this->amountFactory = $this->getMock('Magento\Pricing\Amount\AmountFactory', [], [], '', false); + $this->selectionFactory = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleSelectionFactory') + ->disableOriginalConstructor() + ->getMock(); + + $factoryCallback = $this->returnCallback(function () { + list(, $selectionMock) = func_get_args(); + $bundlePrice = $this->getMockBuilder('\Magento\Bundle\Pricing\Price\BundleSelectionPriceInterface') + ->setMethods(['getAmount']) + ->getMock(); + $bundlePrice->expects($this->any())->method('getAmount') + ->will($this->returnValue($selectionMock->getAmountMock())); + return $bundlePrice; + }); + $this->selectionFactory->expects($this->any())->method('create')->will($factoryCallback); + + $this->model = new Calculator($this->baseCalculator, $this->amountFactory, $this->selectionFactory); + } + + protected function tearDown() + { + $this->priceMocks = []; + } + + /** + * @dataProvider dataProviderForGetterAmount + */ + public function testGetterAmount($amountForBundle, $optionList, $expectedResult) + { + $this->baseCalculator->expects($this->atLeastOnce())->method('getAmount') + ->with($this->baseAmount, $this->saleableItem) + ->will($this->returnValue($this->createAmountMock($amountForBundle))); + + $options = []; + foreach ($optionList as $optionData) { + $options[] = $this->createOptionMock($optionData); + } + $price = $this->getMock('Magento\Bundle\Pricing\Price\BundleOptionPrice', [], [], '', false); + $price->expects($this->atLeastOnce())->method('getOptions')->will($this->returnValue($options)); + $this->priceMocks[Price\BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION] = $price; + + // Price type of saleable items + $this->saleableItem->expects($this->any())->method('getPriceType')->will($this->returnValue( + ProductPrice::PRICE_TYPE_FIXED + )); + + $this->amountFactory->expects($this->atLeastOnce())->method('create') + ->with($expectedResult['fullAmount'], $expectedResult['adjustments']); + if ($expectedResult['isMinAmount']) { + $this->model->getAmount($this->baseAmount, $this->saleableItem); + } else { + $this->model->getMaxAmount($this->baseAmount, $this->saleableItem); + } + } + + /** + * Create amount mock + * + * @param array $amountData + * @return \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected function createAmountMock($amountData) + { + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Pricing\Amount\Base $amount */ + $amount = $this->getMock('Magento\Pricing\Amount\Base', [], [], '', false); + $amount->expects($this->any())->method('getAdjustmentAmounts') + ->will($this->returnValue($amountData['adjustmentsAmounts'])); + $amount->expects($this->any())->method('getValue')->will($this->returnValue($amountData['amount'])); + return $amount; + } + + /** + * Create option mock + * + * @param array $optionData + * @return \Magento\Bundle\Model\Option|\PHPUnit_Framework_MockObject_MockObject + */ + protected function createOptionMock($optionData) + { + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Bundle\Model\Option $option */ + $option = $this->getMock('Magento\Bundle\Model\Option', ['isMultiSelection', '__wakeup'], [], '', false); + $option->expects($this->any())->method('isMultiSelection') + ->will($this->returnValue($optionData['isMultiSelection'])); + $selections = []; + foreach ($optionData['selections'] as $selectionData) { + $selections[] = $this->createSelectionMock($selectionData); + } + $option->setData($optionData['data']); + $option->setData('selections', $selections); + return $option; + } + + /** + * Create selection product mock + * + * @param array $selectionData + * @return \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected function createSelectionMock($selectionData) + { + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product $selection */ + $selection = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['isSalable', '__wakeup', 'getAmountMock']) + ->disableOriginalConstructor() + ->getMock(); + // All items are saleable + $selection->expects($this->any())->method('isSalable')->will($this->returnValue(true)); + $selection->setData($selectionData['data']); + // Virtual method to bind a creation of amount mock through factory + $amountMock = $this->createAmountMock($selectionData['amount']); + $selection->expects($this->any())->method('getAmountMock')->will($this->returnValue($amountMock)); + return $selection; + } + + /** + * @return array + */ + public function dataProviderForGetterAmount() + { + return [ + // first case with minimal amount + 'case with getting minimal amount' => $this->getCaseWithMinAmount(), + + // second case with maximum amount + 'case with getting maximum amount' => $this->getCaseWithMaxAmount(), + + // third case without saleable items + 'case without saleable items' => $this->getCaseWithoutSaleableItems() + ]; + } + + /** + * Array for data provider dataProviderForGetterAmount for case 'case with getting minimal amount' + * + * @return array + */ + protected function getCaseWithMinAmount() + { + return [ + 'amountForBundle' => [ + 'adjustmentsAmounts' => ['tax' => 102], + 'amount' => 782 + ], + 'optionList' => [ + // first option with single choice of product + [ + 'isMultiSelection' => false, + 'data' => [ + 'title' => 'test option 1', + 'default_title' => 'test option 1', + 'type' => 'select', + 'option_id' => '1', + 'position' => '0', + 'required' => '1', + ], + 'selections' => [ + 'first product selection' => [ + 'data' => ['price' => 70.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 8, 'weee' => 10], + 'amount' => 18 + ] + ], + 'second product selection' => [ + 'data' => ['price' => 80.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 18], + 'amount' => 28 + ] + ], + 'third product selection with the lowest price' => [ + 'data' => ['price' => 50.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 8, 'weee' => 10], + 'amount' => 8 + ] + ] + ] + ], + ], + 'expectedResult' => [ + 'isMinAmount' => true, + 'fullAmount' => 790., + 'adjustments' => ['tax' => 110, 'weee' => 10] + ] + ]; + } + + /** + * Array for data provider dataProviderForGetterAmount for case 'case with getting maximum amount' + * + * @return array + */ + protected function getCaseWithMaxAmount() + { + return [ + 'amountForBundle' => [ + 'adjustmentsAmounts' => ['tax' => 102], + 'amount' => 782 + ], + 'optionList' => [ + // first option with single choice of product + [ + 'isMultiSelection' => false, + 'data' => [ + 'title' => 'test option 1', + 'default_title' => 'test option 1', + 'type' => 'select', + 'option_id' => '1', + 'position' => '0', + 'required' => '1', + ], + 'selections' => [ + 'first product selection' => [ + 'data' => ['price' => 50.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 8, 'weee' => 10], + 'amount' => 8 + ] + ], + 'second product selection' => [ + 'data' => ['price' => 80.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 18], + 'amount' => 8 + ] + ] + ] + ], + // second option with multiselection + [ + 'isMultiSelection' => true, + 'data' => [ + 'title' => 'test option 2', + 'default_title' => 'test option 2', + 'type' => 'select', + 'option_id' => '2', + 'position' => '1', + 'required' => '1', + ], + 'selections' => [ + 'first product selection' => [ + 'data' => ['price' => 20.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 8], + 'amount' => 8 + ] + ], + 'second product selection' => [ + 'data' => ['price' => 110.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 28], + 'amount' => 28 + ] + ], + 'third product selection' => [ + 'data' => ['price' => 50.], + 'amount' => [ + 'adjustmentsAmounts' => ['tax' => 18], + 'amount' => 18 + ] + ], + ] + ] + ], + 'expectedResult' => [ + 'isMinAmount' => false, + 'fullAmount' => 844., + 'adjustments' => ['tax' => 164, 'weee' => 10] + ] + ]; + } + + /** + * Array for data provider dataProviderForGetterAmount for case 'case without saleable items' + * + * @return array + */ + protected function getCaseWithoutSaleableItems() + { + return [ + 'amountForBundle' => [ + 'adjustmentsAmounts' => ['tax' => 102], + 'amount' => 782 + ], + 'optionList' => [ + // first option with single choice of product + [ + 'isMultiSelection' => false, + 'data' => [ + 'title' => 'test option 1', + 'default_title' => 'test option 1', + 'type' => 'select', + 'option_id' => '1', + 'position' => '0', + 'required' => '1', + ], + 'selections' => [] + ], + ], + 'expectedResult' => [ + 'isMinAmount' => true, + 'fullAmount' => 782., + 'adjustments' => ['tax' => 102] + ] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BasePriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BasePriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..af80adb77332e54f703e4f15cc6cddc3a540f8da --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BasePriceTest.php @@ -0,0 +1,123 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Catalog\Pricing\Price as CatalogPrice; + +class BasePriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var BasePrice + */ + protected $model; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleable; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var float + */ + protected $quantity; + + public function setUp() + { + $this->quantity = 1.5; + + $this->saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + + $this->saleable->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject('Magento\Bundle\Pricing\Price\BasePrice', [ + 'salableItem' => $this->saleable, + 'quantity' => $this->quantity + ]); + } + + /** + * @covers \Magento\Bundle\Pricing\Price\BasePrice::applyDiscount + * @covers \Magento\Bundle\Pricing\Price\BasePrice::getValue + */ + public function testGetValue() + { + $priceValues = [115, 90, 75]; + $tearPriceValue = 15; + $groupPriceValue = 10; + $specialPriceValue = 40; + $result = 45; + + $pricesIncludedInBase = []; + foreach ($priceValues as $priceValue) { + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $price->expects($this->atLeastOnce()) + ->method('getValue') + ->will($this->returnValue($priceValue)); + $pricesIncludedInBase[] = $price; + } + + $this->priceInfo->expects($this->once()) + ->method('getPricesIncludedInBase') + ->will($this->returnValue($pricesIncludedInBase)); + + $tearPrice = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $tearPrice->expects($this->atLeastOnce()) + ->method('getValue') + ->will($this->returnValue($tearPriceValue)); + + $groupPrice = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $groupPrice->expects($this->atLeastOnce()) + ->method('getValue') + ->will($this->returnValue($groupPriceValue)); + + $specialPrice = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $specialPrice->expects($this->atLeastOnce()) + ->method('getValue') + ->will($this->returnValue($specialPriceValue)); + + $this->priceInfo->expects($this->any()) + ->method('getPrice') + ->will($this->returnValueMap([ + [CatalogPrice\TierPriceInterface::PRICE_TYPE_TIER, $this->quantity, $tearPrice], + [CatalogPrice\GroupPriceInterface::PRICE_TYPE_GROUP, $this->quantity, $groupPrice], + [CatalogPrice\SpecialPriceInterface::PRICE_TYPE_SPECIAL, $this->quantity, $specialPrice], + ])); + + $this->assertEquals($result, $this->model->getValue()); + $this->assertEquals($result, $this->model->getValue()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionFactoryTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionFactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b7588d60731cb95b8fdd4c126b95c1c47dbc2848 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionFactoryTest.php @@ -0,0 +1,108 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class BundleSelectionFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Bundle\Pricing\Price\BundleSelectionFactory */ + protected $bundleSelectionFactory; + + /** @var ObjectManagerHelper */ + protected $objectManagerHelper; + + /** @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject */ + protected $objectManagerMock; + + /** @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $bundleMock; + + /** @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $selectionMock; + + protected function setUp() + { + $this->bundleMock = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $this->selectionMock = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + + $this->objectManagerMock = $this->getMock('Magento\ObjectManager'); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->bundleSelectionFactory = $this->objectManagerHelper->getObject( + 'Magento\Bundle\Pricing\Price\BundleSelectionFactory', + [ + 'objectManager' => $this->objectManagerMock + ] + ); + } + + public function testCreate() + { + $result = $this->getMock('Magento\Bundle\Pricing\Price\BundleSelectionPriceInterface'); + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with( + $this->equalTo(BundleSelectionFactory::SELECTION_CLASS_DEFAULT), + $this->equalTo( + [ + 'test' => 'some value', + 'bundleProduct' => $this->bundleMock, + 'salableItem' => $this->selectionMock, + 'quantity' => 2. + ] + ) + ) + ->will($this->returnValue($result)); + $this->assertSame( + $result, + $this->bundleSelectionFactory + ->create($this->bundleMock, $this->selectionMock, 2., ['test' => 'some value']) + ); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testCreateException() + { + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with( + $this->equalTo(BundleSelectionFactory::SELECTION_CLASS_DEFAULT), + $this->equalTo( + [ + 'test' => 'some value', + 'bundleProduct' => $this->bundleMock, + 'salableItem' => $this->selectionMock, + 'quantity' => 2. + ] + ) + ) + ->will($this->returnValue(new \stdClass())); + $this->bundleSelectionFactory->create($this->bundleMock, $this->selectionMock, 2., ['test' => 'some value']); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c264bfa0dd70e44e37a1c7a26ba23cf3c44bf5ab --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php @@ -0,0 +1,264 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Catalog\Pricing\Price as CatalogPrice; + +/** + * Class BundleSelectionPriceTest + * + * @package Magento\Bundle\Pricing\Price + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class BundleSelectionPriceTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Bundle\Pricing\Price\BundleSelectionPrice */ + protected $bundleSelectionPrice; + + /** @var ObjectManagerHelper */ + protected $objectManagerHelper; + + /** @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $saleableInterfaceMock; + + /** @var float */ + protected $quantity = 1.; + + /** @var \Magento\Pricing\Adjustment\CalculatorInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $calculatorInterfaceMock; + + /** @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject */ + protected $productMock; + + /** @var \Magento\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $managerInterfaceMock; + + /** @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $priceInfoMock; + + /** @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject */ + protected $basePriceMock; + + /** @var \Magento\Catalog\Pricing\Price\FinalPrice|\PHPUnit_Framework_MockObject_MockObject */ + protected $finalPriceMock; + + /** @var \Magento\Catalog\Pricing\Price\RegularPrice|\PHPUnit_Framework_MockObject_MockObject */ + protected $regularPriceMock; + + /** @var float */ + protected $finalPriceValue; + + /** @var float */ + protected $regularPriceValue; + + /** @var float */ + protected $expectedResult; + + protected function prepare() + { + $this->saleableInterfaceMock = $this->getMock( + 'Magento\Catalog\Model\Product', + [ + 'getPriceInfo', + 'getSelectionPriceType', + 'getSelectionPriceValue', + '__wakeup', + '__sleep' + ], + [], + '', + false + ); + $this->calculatorInterfaceMock = $this->getMock('Magento\Pricing\Adjustment\CalculatorInterface'); + $this->productMock = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getPriceType', 'setFinalPrice', 'getQty', 'getData', 'getPriceInfo', '__wakeup', '__sleep'], + [], + '', + false, + false + ); + + $this->managerInterfaceMock = $this->getMock('Magento\Event\ManagerInterface'); + + $this->priceInfoMock = $this->getMock('\Magento\Pricing\PriceInfoInterface'); + $this->priceInfoMock->expects($this->atLeastOnce()) + ->method('getPrice') + ->will($this->returnCallback(array($this, 'getPriceCallback'))); + + $this->productMock->expects($this->atLeastOnce()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + + $this->saleableInterfaceMock->expects($this->atLeastOnce()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + } + + /** + * @param string $priceType + * @return \PHPUnit_Framework_MockObject_MockObject + */ + public function getPriceCallback($priceType) + { + switch ($priceType) { + case CatalogPrice\BasePrice::PRICE_TYPE_BASE_PRICE: + $this->basePriceMock = $this->getMock('Magento\Bundle\Pricing\Price\BasePrice', [], [], '', false); + $this->basePriceMock->expects($this->once()) + ->method('applyDiscount') + ->with($this->expectedResult) + ->will($this->returnArgument(0)); + return $this->basePriceMock; + case CatalogPrice\FinalPriceInterface::PRICE_TYPE_FINAL: + $this->finalPriceMock = $this->getMock( + 'Magento\Catalog\Pricing\Price\FinalPrice', + [], + [], + '', + false + ); + $this->finalPriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($this->finalPriceValue)); + return $this->finalPriceMock; + case CatalogPrice\RegularPrice::PRICE_TYPE_PRICE_DEFAULT: + $this->regularPriceMock = $this->getMock( + 'Magento\Catalog\Pricing\Price\RegularPrice', + [], + [], + '', + false + ); + $this->regularPriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($this->regularPriceValue)); + return $this->regularPriceMock; + default: + break; + } + $this->fail('Price mock was not found'); + } + + /** + * @param string $bundlePriceType + * @param array $selectionData + * @param float $expectedResult + * @dataProvider getValueDataProvider + */ + public function testGetValue($bundlePriceType, $selectionData, $expectedResult) + { + $this->prepare(); + $this->expectedResult = $expectedResult; + $this->productMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($bundlePriceType)); + + if (isset($selectionData['getSelectionPriceType'])) { + $this->saleableInterfaceMock->expects($this->once()) + ->method('getSelectionPriceType') + ->will($this->returnValue($selectionData['getSelectionPriceType'])); + if ($selectionData['getSelectionPriceType']) { + $this->regularPriceValue = $selectionData['regularPriceValue']; + $this->productMock->expects($this->once()) + ->method('setFinalPrice') + ->with($this->equalTo($selectionData['regularPriceValue'])) + ->will($this->returnSelf()); + $this->productMock->expects($this->once()) + ->method('getQty') + ->will($this->returnValue($selectionData['bundleQty'])); + + $this->productMock->expects($this->once()) + ->method('getData') + ->with($this->equalTo('final_price')) + ->will($this->returnValue($selectionData['finalPrice'])); + + $this->managerInterfaceMock->expects($this->once()) + ->method('dispatch') + ->with( + $this->equalTo('catalog_product_get_final_price'), + $this->equalTo(['product' => $this->productMock, 'qty' => $selectionData['bundleQty']]) + ) + ->will($this->returnSelf()); + } + $this->quantity = $selectionData['bundleQty']; + $this->saleableInterfaceMock->expects($this->once()) + ->method('getSelectionPriceValue') + ->will($this->returnValue($selectionData['selectionPriceValue'])); + } else { + $this->finalPriceValue = $expectedResult; + } + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->bundleSelectionPrice = $this->objectManagerHelper->getObject( + 'Magento\Bundle\Pricing\Price\BundleSelectionPrice', + [ + 'salableItem' => $this->saleableInterfaceMock, + 'quantity' => $this->quantity, + 'calculator' => $this->calculatorInterfaceMock, + 'bundleProduct' => $this->productMock, + 'eventManager' => $this->managerInterfaceMock + ] + ); + + $this->assertSame($expectedResult, $this->bundleSelectionPrice->getValue()); + // test value caching + $this->assertSame($expectedResult, $this->bundleSelectionPrice->getValue()); + } + + /** + * @return array + */ + public function getValueDataProvider() + { + return [ + 'dynamic bundle' => [ + 'bundle type' => 0, + 'selection data' => [], + 'expected result' => 3.3 + ], + 'fixed bundle - percent price' => [ + 'bundle type' => 1, + 'selection data' => [ + 'getSelectionPriceType' => true, + 'regularPriceValue' => 4., + 'bundleQty' => 3., + 'finalPrice' => 100, + 'selectionPriceValue' => 10. + ], + 'expected result' => 10. + ], + 'fixed bundle - fixed price' => [ + 'bundle type' => 1, + 'selection data' => [ + 'getSelectionPriceType' => false, + 'bundleQty' => 2., + 'selectionPriceValue' => 10. + ], + 'expected result' => 20. + ], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fc0a036850fb16a9668164040ec2c5649e764a1b --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/FinalPriceTest.php @@ -0,0 +1,160 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + +class FinalPriceTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Bundle\Pricing\Price\FinalPrice */ + protected $finalPrice; + + /** @var ObjectManagerHelper */ + protected $objectManagerHelper; + + /** @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $saleableInterfaceMock; + + /** @var float */ + protected $quantity = 1.; + + /** @var float*/ + protected $baseAmount; + + /** @var \Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $bundleCalculatorMock; + + /** @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $priceInfoMock; + + /** @var \Magento\Bundle\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject */ + protected $basePriceMock; + + /** @var BundleOptionPrice|\PHPUnit_Framework_MockObject_MockObject */ + protected $bundleOptionMock; + + /** + * @return void + */ + protected function prepareMock() + { + $this->saleableInterfaceMock = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $this->bundleCalculatorMock = $this->getMock('Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface'); + + $this->basePriceMock = $this->getMock('Magento\Bundle\Pricing\Price\BasePrice', [], [], '', false); + $this->basePriceMock->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($this->baseAmount)); + + $this->bundleOptionMock = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice') + ->disableOriginalConstructor() + ->getMock(); + + $this->priceInfoMock = $this->getMock('\Magento\Pricing\PriceInfoInterface'); + $this->priceInfoMock->expects($this->atLeastOnce()) + ->method('getPrice') + ->will($this->returnValueMap([ + [\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE, null, $this->basePriceMock], + [BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION, $this->quantity, $this->bundleOptionMock] + ])); + + $this->saleableInterfaceMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->finalPrice = $this->objectManagerHelper->getObject( + 'Magento\Bundle\Pricing\Price\FinalPrice', + [ + 'salableItem' => $this->saleableInterfaceMock, + 'quantity' => $this->quantity, + 'calculator' => $this->bundleCalculatorMock + ] + ); + } + + /** + * @dataProvider getValueDataProvider + */ + public function testGetValue($baseAmount, $discountValue, $result) + { + $this->baseAmount = $baseAmount; + $optionsValue = rand(1, 10); + $this->prepareMock(); + $this->bundleOptionMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($optionsValue)); + + $this->basePriceMock->expects($this->once())->method('applyDiscount') + ->with($this->equalTo($optionsValue)) + ->will($this->returnValue($discountValue)); + + $this->assertSame($result, $this->finalPrice->getValue()); + } + + /** + * @return array + */ + public function getValueDataProvider() + { + return [ + [false, false, 0], + [0, 1.2, 1.2], + [1, 2, 3] + ]; + } + + /** + * @dataProvider getValueDataProvider + */ + public function testGetMaximalPrice($baseAmount) + { + $result = rand(1, 10); + $this->baseAmount = $baseAmount; + $this->prepareMock(); + + $this->bundleCalculatorMock->expects($this->once()) + ->method('getMaxAmount') + ->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock)) + ->will($this->returnValue($result)); + $this->assertSame($result, $this->finalPrice->getMaximalPrice()); + } + + /** + * @dataProvider getValueDataProvider + */ + public function testGetMinimalPrice($baseAmount) + { + $result = rand(1, 10); + $this->baseAmount = $baseAmount; + $this->prepareMock(); + + $this->bundleCalculatorMock->expects($this->once()) + ->method('getAmount') + ->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock)) + ->will($this->returnValue($result)); + $this->assertSame($result, $this->finalPrice->getMinimalPrice()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/GroupPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/GroupPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9a736111234c52092697eff9d931577967f1870b --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/GroupPriceTest.php @@ -0,0 +1,109 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Bundle + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Price; + +class GroupPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var GroupPrice + */ + protected $model; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleable; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + public function setUp() + { + $this->saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getPriceInfo', 'getCustomerGroupId', 'getData', '__wakeup']) + ->disableOriginalConstructor() + ->getMock(); + + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + + $this->saleable->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject('Magento\Bundle\Pricing\Price\GroupPrice', [ + 'salableItem' => $this->saleable + ]); + } + + /** + * @param float $basePrice + * @param [] $storedGroupPrice + * @param float $value + * @dataProvider getValueDataProvider + */ + public function testGetValue($basePrice, $storedGroupPrice, $value) + { + $customerGroupId = 234; + + $this->saleable->expects($this->atLeastOnce()) + ->method('getCustomerGroupId') + ->will($this->returnValue($customerGroupId)); + + $this->saleable->expects($this->once()) + ->method('getData') + ->with('group_price') + ->will($this->returnValue($storedGroupPrice)); + + if (!empty($storedGroupPrice)) { + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $this->priceInfo->expects($this->once()) + ->method('getPrice') + ->with(\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE, null) + ->will($this->returnValue($price)); + $price->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + } + + $this->assertEquals($value, $this->model->getValue()); + } + + /** + * @return array + */ + public function getValueDataProvider() + { + return array( + ['basePrice' => 100, 'storedGroupPrice' => [['cust_group' => 234, 'website_price' => 40]], 'value' => 60], + ['basePrice' => 75, 'storedGroupPrice' => [['cust_group' => 234, 'website_price' => 40]], 'value' => 45], + ['basePrice' => 75, 'storedGroupPrice' => [], 'value' => false], + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/SpecialPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/SpecialPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d5a835892ab3afb06fadbce8c5b4e17cc846742c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/SpecialPriceTest.php @@ -0,0 +1,131 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Bundle + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Price; + +class SpecialPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var SpecialPrice + */ + protected $model; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleable; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \Magento\Stdlib\DateTime\TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $localeDate; + + public function setUp() + { + $this->saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $this->localeDate = $this->getMock('Magento\Stdlib\DateTime\TimezoneInterface'); + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + + $this->saleable->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject('Magento\Bundle\Pricing\Price\SpecialPrice', [ + 'salableItem' => $this->saleable, + 'localeDate' => $this->localeDate + ]); + } + + /** + * @param float $basePrice + * @param float $specialPrice + * @param bool $isScopeDateInInterval + * @param float $value + * @dataProvider getValueDataProvider + */ + public function testGetValue($basePrice, $specialPrice, $isScopeDateInInterval, $value) + { + $specialFromDate = 'some date from'; + $specialToDate = 'som date to'; + + $this->saleable->expects($this->once()) + ->method('getSpecialPrice') + ->will($this->returnValue($specialPrice)); + + $store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + $this->saleable->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($store)); + $this->saleable->expects($this->once()) + ->method('getSpecialFromDate') + ->will($this->returnValue($specialFromDate)); + $this->saleable->expects($this->once()) + ->method('getSpecialToDate') + ->will($this->returnValue($specialToDate)); + + $this->localeDate->expects($this->once()) + ->method('isScopeDateInInterval') + ->with($store, $specialFromDate, $specialToDate) + ->will($this->returnValue($isScopeDateInInterval)); + + if ($isScopeDateInInterval) { + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $this->priceInfo->expects($this->once()) + ->method('getPrice') + ->with(\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE, null) + ->will($this->returnValue($price)); + $price->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + } + + $this->assertEquals($value, $this->model->getValue()); + $this->assertEquals($value, $this->model->getValue()); + } + + /** + * @return array + */ + public function getValueDataProvider() + { + return array( + ['basePrice' => 100, 'specialPrice' => 40, 'isScopeDateInInterval' => true, 'value' => 60], + ['basePrice' => 75, 'specialPrice' => 40, 'isScopeDateInInterval' => true, 'value' => 45], + ['basePrice' => 75, 'specialPrice' => 40, 'isScopeDateInInterval' => false, 'value' => false], + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/TierPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/TierPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..12ba15f38cc453078616e4cffb964ab93d57860b --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/TierPriceTest.php @@ -0,0 +1,172 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Pricing\Price; + +use Magento\Customer\Model\Group; + +class TierPriceTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $product; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $calculator; + + /** + * @var TierPrice + */ + protected $model; + + /** + * Initialize base dependencies + */ + protected function setUp() + { + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + + $this->product = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getPriceInfo', 'hasCustomerGroupId', 'getCustomerGroupId', 'getResource', '__wakeup']) + ->disableOriginalConstructor() + ->getMock(); + + $this->product->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $this->calculator = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject('Magento\Bundle\Pricing\Price\TierPrice', [ + 'salableItem' => $this->product, + 'calculator' => $this->calculator + ]); + } + + /** + * @covers \Magento\Bundle\Pricing\Price\TierPrice::isFirstPriceBetter + * @dataProvider providerForGetterTierPriceList + */ + public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult) + { + $this->product->setData(TierPrice::PRICE_TYPE_TIER, $tierPrices); + + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $price->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + + $this->priceInfo->expects($this->any()) + ->method('getPrice') + ->will($this->returnValue($price)); + + $this->calculator->expects($this->atLeastOnce()) + ->method('getAmount') + ->will($this->returnArgument(0)); + + $this->assertEquals($expectedResult, $this->model->getTierPriceList()); + $this->assertEquals(count($expectedResult), $this->model->getTierPriceCount()); + } + + /** + * @return array + */ + public function providerForGetterTierPriceList() + { + return [ + 'base case' => [ + 'tierPrices' => [ + // will be ignored due to customer group + [ + 'price' => '1.3', + 'website_price' => '1.3', + 'price_qty' => '1.', + 'cust_group' => 999 + ], + [ + 'price' => '50.', + 'website_price' => '50.', + 'price_qty' => '2.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '25.', + 'website_price' => '25.', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '15.', + 'website_price' => '15.', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '30.', + 'website_price' => '30.', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '8.', + 'website_price' => '8.', + 'price_qty' => '11.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + ], + 'basePrice' => 20., + 'expectedResult' => [ + [ + 'price' => '50.', + 'website_price' => '50.', + 'price_qty' => '2.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '30.', + 'website_price' => '30.', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '8.', + 'website_price' => '8.', + 'price_qty' => '11.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + ] + ] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Render/FinalPriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Render/FinalPriceBoxTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e8369e8e3baad59ab570c8c176cf903720c5d39e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Render/FinalPriceBoxTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Bundle + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Bundle\Pricing\Render; + +use Magento\Bundle\Pricing\Price; + +class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var FinalPriceBox + */ + protected $model; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableItem; + + public function setUp() + { + $this->saleableItem = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject('Magento\Bundle\Pricing\Render\FinalPriceBox', [ + 'saleableItem' => $this->saleableItem + ]); + } + + /** + * @dataProvider showRangePriceDataProvider + */ + public function testShowRangePrice($value, $maxValue, $result) + { + $priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + $optionPrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice') + ->disableOriginalConstructor() + ->getMock(); + + $this->saleableItem->expects($this->atLeastOnce()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfo)); + + $priceInfo->expects($this->atLeastOnce()) + ->method('getPrice') + ->with(Price\BundleOptionPriceInterface::PRICE_TYPE_BUNDLE_OPTION) + ->will($this->returnValue($optionPrice)); + + $optionPrice->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($value)); + + $optionPrice->expects($this->once()) + ->method('getMaxValue') + ->will($this->returnValue($maxValue)); + + $this->assertEquals($result, $this->model->showRangePrice()); + } + + + /** + * @return array + */ + public function showRangePriceDataProvider() + { + return [ + ['value' => 40.2, 'maxValue' => 45., 'result' => true], + ['value' => false, 'maxValue' => false, 'result' => false], + ['value' => 45.0, 'maxValue' => 45., 'result' => false], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php index fdf7439b1d8a8d70c6af87b3997e556c587d9395..355b13ca6c5eeccfd979af0e93c0bb570e777aa6 100644 --- a/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php +++ b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.php @@ -26,14 +26,14 @@ return array( 'config' => array( 'name' => 'config', 'translate' => 'label,description', - 'instance' => 'Magento\App\Cache\Type\Config', + 'instance' => 'Magento\Framework\App\Cache\Type\Config', 'label' => 'Configuration', 'description' => 'System(config.xml, local.xml) and modules configuration files(config.xml).' ), 'layout' => array( 'name' => 'layout', 'translate' => 'label,description', - 'instance' => 'Magento\App\Cache\Type\Layout', + 'instance' => 'Magento\Framework\App\Cache\Type\Layout', 'label' => 'Layouts', 'description' => 'Layout building instructions.' ) diff --git a/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml index e1b0d83f255d408c2fd1458e3ae5cef145f17d70..1f767fe1eb36d550124ef0c2e73b7288e0e0c912 100644 --- a/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml +++ b/dev/tests/unit/testsuite/Magento/Cache/Config/_files/cache_config.xml @@ -24,11 +24,11 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/Magento/Cache/etc/cache.xsd"> - <type name="config" translate="label,description" instance="Magento\App\Cache\Type\Config"> + <type name="config" translate="label,description" instance="Magento\Framework\App\Cache\Type\Config"> <label>Configuration</label> <description>System(config.xml, local.xml) and modules configuration files(config.xml).</description> </type> - <type name="layout" translate="label,description" instance="Magento\App\Cache\Type\Layout"> + <type name="layout" translate="label,description" instance="Magento\Framework\App\Cache\Type\Layout"> <label>Layouts</label> <description>Layout building instructions.</description> </type> diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Helper/Adminhtml/DataTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Helper/Adminhtml/DataTest.php index c6ab71c750abe84676efc868d502ab29e83fc466..b3a1c280a800222d2492a2da9f3cb111b00c03cc 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Helper/Adminhtml/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Helper/Adminhtml/DataTest.php @@ -53,16 +53,16 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->returnValue('1') ); - $filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $directoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $filesystemMock->expects($this->any())->method('getDirectoryWrite')->will($this->returnValue($directoryMock)); $directoryMock->expects($this->any())->method('getAbsolutePath')->will($this->returnArgument(0)); $this->_model = new \Magento\Captcha\Helper\Adminhtml\Data( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false), $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false), - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $filesystemMock, $this->getMock('Magento\Captcha\Model\CaptchaFactory', array(), array(), '', false), $backendConfig diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php index d904602f46746890ee3d10377bf6ce02a0fec8d3..86bc1ce2e2e89cbf7ef30c47b764101c96020aa8 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php @@ -35,7 +35,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); } protected function _getHelper($store, $config, $factory) @@ -46,7 +46,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $storeManager->expects($this->any())->method('getWebsite')->will($this->returnValue($this->_getWebsiteStub())); $storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); return new \Magento\Captcha\Helper\Data($context, $storeManager, $config, $this->_filesystem, $factory); } @@ -120,7 +120,7 @@ class DataTest extends \PHPUnit_Framework_TestCase )->method( 'getPath' )->with( - \Magento\App\Filesystem::LIB_DIR + \Magento\Framework\App\Filesystem::LIB_DIR )->will( $this->returnValue(TESTS_TEMP_DIR . '/lib') ); @@ -173,7 +173,7 @@ class DataTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue($dirWriteMock) ); @@ -209,11 +209,11 @@ class DataTest extends \PHPUnit_Framework_TestCase /** * Create Config Stub * - * @return \Magento\App\Config\ScopeConfigInterface + * @return \Magento\Framework\App\Config\ScopeConfigInterface */ protected function _getConfigStub() { - $config = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $config = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); return $config; } diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/CronTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/CronTest.php index ccdcce716772c0dcb7c0a586479ad99ac9cf38cd..513a79ebb165fb8d021f41854f245c146b5b8d71 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Model/CronTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/CronTest.php @@ -76,7 +76,7 @@ class CronTest extends \PHPUnit_Framework_TestCase { $this->_helper = $this->getMock('Magento\Captcha\Helper\Data', array(), array(), '', false); $this->_adminHelper = $this->getMock('Magento\Captcha\Helper\Adminhtml\Data', array(), array(), '', false); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directory = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->_storeManager = $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php index 2de9dca0f49a3d3db390d6bdd0c200228a36ae77..4f85e754e4932f1b5a52969eb0472e7acdd80bc7 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php @@ -122,9 +122,15 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->_customerData = $this->getMock('Magento\Customer\Helper\Data', array(), array(), '', false); $this->_helper = $this->getMock('Magento\Captcha\Helper\Data', array(), array(), '', false); $this->_urlManager = $this->getMock('Magento\Url', array(), array(), '', false); - $this->_actionFlag = $this->getMock('Magento\App\ActionFlag', array(), array(), '', false); + $this->_actionFlag = $this->getMock('Magento\Framework\App\ActionFlag', array(), array(), '', false); $this->_messageManager = $this->getMock('\Magento\Message\ManagerInterface', array(), array(), '', false); - $this->redirect = $this->getMock('\Magento\App\Response\RedirectInterface', array(), array(), '', false); + $this->redirect = $this->getMock( + '\Magento\Framework\App\Response\RedirectInterface', + array(), + array(), + '', + false + ); $this->_observer = $this->_objectManager->getObject( 'Magento\Captcha\Model\Observer', array( @@ -149,8 +155,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $formId = 'contact_us'; $captchaValue = 'some-value'; - $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $controller = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects( $this->any() )->method( @@ -194,8 +200,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $redirectRoutePath = 'contact/index/index'; $redirectUrl = 'http://magento.com/contacts/'; - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $request->expects( $this->any() )->method( @@ -219,7 +225,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->returnValue($redirectUrl) ); - $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $controller = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response)); $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true)); @@ -248,7 +254,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase 'set' )->with( '', - \Magento\App\Action\Action::FLAG_NO_DISPATCH, + \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true ); @@ -280,8 +286,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $redirectRoutePath = '*/*/forgotpassword'; $redirectUrl = 'http://magento.com/customer/account/forgotpassword/'; - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $request->expects( $this->any() )->method( @@ -305,7 +311,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->returnValue($redirectUrl) ); - $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $controller = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response)); $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true)); @@ -334,7 +340,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase 'set' )->with( '', - \Magento\App\Action\Action::FLAG_NO_DISPATCH, + \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true ); @@ -349,7 +355,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $redirectRoutePath = '*/*/create'; $redirectUrl = 'http://magento.com/customer/account/create/'; - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects( $this->at(0) )->method( @@ -361,7 +367,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->returnValue(array($formId => $captchaValue)) ); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $response->expects($this->once())->method('setRedirect')->with($redirectUrl); $this->_urlManager->expects( @@ -385,7 +391,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->returnValue($redirectUrl) ); - $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $controller = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response)); $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true)); @@ -414,7 +420,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase 'set' )->with( '', - \Magento\App\Action\Action::FLAG_NO_DISPATCH, + \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true ); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/GridTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/GridTest.php index 22fa074d8e66c1c8337090157bb05cf17c79140d..084ed65de5538df817a6059c7b9cccae28632233 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/GridTest.php @@ -33,7 +33,7 @@ class GridTest extends \PHPUnit_Framework_TestCase $attribute = $this->getMock('Magento\Catalog\Model\Resource\Eav\Attribute', array(), array(), '', false); $attribute->expects($this->once())->method('getAttributeId')->will($this->returnValue(2)); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $urlBuilder = $this->getMock('Magento\UrlInterface', array(), array(), '', false); $urlBuilder->expects( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php index 3ac4c55d4215c52f210c7d2e1cf15956a3ac8f83..aedd26dce183e5a503ed42c7548050afc1fe17e1 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/AlertsTest.php @@ -38,7 +38,7 @@ class AlertsTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->alerts = $helper->getObject( 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/AbstractProductTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/AbstractProductTest.php new file mode 100644 index 0000000000000000000000000000000000000000..58ea2ffc4d1c4f55b1ed334ff5aaea8e44ab4e91 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/AbstractProductTest.php @@ -0,0 +1,119 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Block\Product; + +/** + * Class for testing methods of AbstractProduct + */ +class AbstractProductTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Block\Product\View\Type\Simple + */ + protected $block; + + /** + * @var \Magento\Catalog\Block\Product\Context + */ + protected $productContextMock; + + /** + * @var \Magento\View\LayoutInterface + */ + protected $layoutMock; + + /** + * Set up mocks and tested class + * Child class is used as the tested class is declared abstract + */ + public function setUp() + { + $this->productContextMock = $this->getMock( + 'Magento\Catalog\Block\Product\Context', + ['getLayout'], + [], + '', + false + ); + $arrayUtilsMock = $this->getMock('Magento\Stdlib\ArrayUtils', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\View\Layout', ['getBlock'], [], '', false); + + $this->productContextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($this->layoutMock)); + + $this->block = new \Magento\Catalog\Block\Product\View\Type\Simple( + $this->productContextMock, + $arrayUtilsMock + ); + } + + /** + * Test for method getProductPrice + * + * @covers \Magento\Catalog\Block\Product\AbstractProduct::getProductPriceHtml + * @covers \Magento\Catalog\Block\Product\AbstractProduct::getProductPrice + */ + public function testGetProductPrice() + { + $expectedPriceHtml = '<html>Expected Price html with price $30</html>'; + $priceRenderBlock = $this->getMock('Magento\Pricing\Render', ['render'], [], '', false); + $product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('product.price.render.default') + ->will($this->returnValue($priceRenderBlock)); + $priceRenderBlock->expects($this->once()) + ->method('render') + ->will($this->returnValue($expectedPriceHtml)); + + $this->assertEquals($expectedPriceHtml, $this->block->getProductPrice($product)); + + } + + /** + * Test testGetProductPriceHtml + */ + public function testGetProductPriceHtml() + { + $expectedPriceHtml = '<html>Expected Price html with price $30</html>'; + $priceRenderBlock = $this->getMock('Magento\Pricing\Render', ['render'], [], '', false); + $product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('product.price.render.default') + ->will($this->returnValue($priceRenderBlock)); + + $priceRenderBlock->expects($this->once()) + ->method('render') + ->will($this->returnValue($expectedPriceHtml)); + + $this->assertEquals($expectedPriceHtml, $this->block->getProductPriceHtml( + $product, 'price_code', 'zone_code' + )); + + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Compare/ListCompareTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Compare/ListCompareTest.php new file mode 100644 index 0000000000000000000000000000000000000000..494f81371bd285815f0190e2876c3c1386e8aa2f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Compare/ListCompareTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Block\Product\Compare; + +/** + * Class ListCompareTest + * @package Magento\Catalog\Block\Product\Compare + */ +class ListCompareTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var ListCompare + */ + protected $block; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + protected function setUp() + { + $this->layout = $this->getMock('Magento\View\Layout', ['getBlock'], [], '', false); + + $context = $this->getMock('Magento\Catalog\Block\Product\Context', ['getLayout'], [], '', false); + $context->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->block = $objectManager->getObject( + 'Magento\Catalog\Block\Product\Compare\ListCompare', + ['context' => $context] + ); + } + + protected function tearDown() + { + $this->block = null; + } + + public function testGetProductPrice() + { + //Data + $expectedResult = 'html'; + $blockName = 'product.price.render.default'; + $productId = 1; + + //Verification + $product = $this->getMock('Magento\Catalog\Model\Product', ['getId', '__wakeup'], [], '', false); + $product->expects($this->once()) + ->method('getId') + ->will($this->returnValue($productId)); + + $blockMock = $this->getMock('Magento\Pricing\Render', ['render'], [], '', false); + $blockMock->expects($this->once()) + ->method('render') + ->with( + 'final_price', + $product, + [ + 'price_id' => 'product-price-' . $productId . '-compare-list-top', + 'display_minimal_price' => true, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_LIST + ] + ) + ->will($this->returnValue($expectedResult)); + + $this->layout->expects($this->once()) + ->method('getBlock') + ->with($blockName) + ->will($this->returnValue($blockMock)); + + $this->assertEquals($expectedResult, $this->block->getProductPrice($product, '-compare-list-top')); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ListProductTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ListProductTest.php index 8c83c7bc77393d28a1e939e12f29e80744507491..ac7225b0013d63ebe80d0bb81402159f3dd88614 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ListProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ListProductTest.php @@ -143,7 +143,7 @@ class ListProductTest extends \PHPUnit_Framework_TestCase $url = 'http://localhost.com/dev/'; $id = 1; $uenc = strtr(base64_encode($url), '+/=', '-_,'); - $data = array('product' => $id, \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $uenc); + $data = array('product' => $id, \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $uenc); $expectedPostData = json_encode( array( 'action' => $url, diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php index 82e3b1e038e19c9441850241db166c36b6ecc4ff..b37463354f246d9d5a9ea20d4164f6768af5f117 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php @@ -47,7 +47,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase protected $helper; /** - * @var \Magento\App\Config\ScopeConfigInterface | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfig; /** @@ -76,7 +76,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase false ); $this->urlBuilder = $this->getMock('Magento\Url', array('getUrl'), array(), '', false); - $this->scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $scopeConfig = array( array(\Magento\Catalog\Model\Config::XML_PATH_LIST_DEFAULT_SORT_BY, null, 'name'), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Widget/NewWidgetTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Widget/NewWidgetTest.php new file mode 100644 index 0000000000000000000000000000000000000000..69b05c89e6b402eff7ce07d6f21660f6a5489942 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/Widget/NewWidgetTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Block\Product\Widget; + +class NewWidgetTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Block\Product\Widget\NewWidget|\PHPUnit_Framework_MockObject_MockObject + */ + protected $block; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $contextMock = $this->getMock('Magento\Catalog\Block\Product\Context', [], [], '', false, false); + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + + $contextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + + $this->block = $objectManager->getObject( + 'Magento\Catalog\Block\Product\Widget\NewWidget', + [ + 'context' => $contextMock + ] + ); + } + + protected function tearDown() + { + $this->block = null; + } + + public function testGetProductPriceHtml() + { + $id = 6; + $expectedHtml = ' + <div class="price-box price-final_price"> + <span class="regular-price" id="product-price-' . $id . '"> + <span class="price">$0.00</span> + </span> + </div>'; + $type = 'widget-new-list'; + $productMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false, false); + $productMock->expects($this->once()) + ->method('getId') + ->will($this->returnValue($id)); + $arguments = [ + 'price_id' => 'old-price-' . $id . '-' . $type, + 'display_minimal_price' => true, + 'include_container' => true, + 'zone' => \Magento\Pricing\Render::ZONE_ITEM_LIST + ]; + + $priceBoxMock = $this->getMock('Magento\Pricing\Render', ['render'], [], '', false, false); + + $this->layout->expects($this->once()) + ->method('getBlock') + ->with($this->equalTo('product.price.render.default')) + ->will($this->returnValue($priceBoxMock)); + + $priceBoxMock->expects($this->once()) + ->method('render') + ->with($this->equalTo('final_price'), $this->equalTo($productMock), $this->equalTo($arguments)) + ->will($this->returnValue($expectedHtml)); + + $result = $this->block->getProductPriceHtml($productMock, $type); + $this->assertEquals($expectedHtml, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php index 31820dfec6048f9dca81aa113234482239e52bbb..42aaa5a35090a9ac2ca7189a250c62735883ebe7 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php @@ -72,7 +72,7 @@ class BuilderTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $methods = array('setStoreId', 'setData', 'load', '__wakeup', 'setAttributeSetId', 'setTypeId'); $this->productMock = $this->getMock('Magento\Catalog\Model\Product', $methods, array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/HelperTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/HelperTest.php index 26d7de33b2423faa3b55d043a11d9e8e44b5e9b3..8a18f4f0bbd6ebd8aef8ca2054bebe01e4a39868 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/HelperTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/HelperTest.php @@ -72,7 +72,7 @@ class HelperTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->jsHelperMock = $this->getMock('Magento\Backend\Helper\Js', array(), array(), '', false); $this->storeMock = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); $this->websiteMock = $this->getMock('Magento\Store\Model\Website', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php index 55c2eee865111cd5142437c06633b5ab3d9397cb..e2e06a71db79e6363eb55e77edafb503ce3516fc 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilterTest.php @@ -42,7 +42,7 @@ class StockDataFilterTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->scopeConfigMock->expects($this->any())->method('getValue')->will($this->returnValue(1)); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index a502a2a0c3fa58eda8a2c27ca48218b874f63b07..3f12ef965d4cfa57f77563e558a573d5066e3872 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -41,7 +41,6 @@ class ProductTest extends \PHPUnit_Framework_TestCase public function setUp() { $productActionMock = $this->getMock('Magento\Catalog\Model\Product\Action', array(), array(), '', false); - $objectManagerMock = $this->getMockForAbstractClass( '\Magento\ObjectManager', array(), @@ -51,9 +50,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase true, array('get') ); - $objectManagerMock->expects($this->any())->method('get')->will($this->returnValue($productActionMock)); - $this->_priceProcessor = $this->getMock( 'Magento\Catalog\Model\Indexer\Product\Price\Processor', array(), @@ -61,19 +58,15 @@ class ProductTest extends \PHPUnit_Framework_TestCase '', false ); - - $requestInterfaceMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); - - $responseInterfaceMock = $this->getMock('Magento\App\ResponseInterface', array('setRedirect', 'sendResponse')); - + $requestInterfaceMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); + $responseInterfaceMock = $this->getMock( + 'Magento\Framework\App\ResponseInterface', + array('setRedirect', 'sendResponse') + ); $managerInterfaceMock = $this->getMock('Magento\Message\ManagerInterface', array(), array(), '', false); - $sessionMock = $this->getMock('Magento\Backend\Model\Session', array(), array(), '', false); - - $actionFlagMock = $this->getMock('Magento\App\ActionFlag', array(), array(), '', false); - + $actionFlagMock = $this->getMock('Magento\Framework\App\ActionFlag', array(), array(), '', false); $helperDataMock = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false); - $contextMock = $this->getMock( 'Magento\Backend\App\Action\Context', array( @@ -89,27 +82,15 @@ class ProductTest extends \PHPUnit_Framework_TestCase '', false ); - $contextMock->expects($this->any())->method('getRequest')->will($this->returnValue($requestInterfaceMock)); - $contextMock->expects($this->any())->method('getResponse')->will($this->returnValue($responseInterfaceMock)); - $contextMock->expects($this->any())->method('getObjectManager')->will($this->returnValue($objectManagerMock)); - - $contextMock->expects( - $this->any() - )->method( - 'getMessageManager' - )->will( - $this->returnValue($managerInterfaceMock) - ); - + $contextMock->expects($this->any()) + ->method('getMessageManager') + ->will($this->returnValue($managerInterfaceMock)); $contextMock->expects($this->any())->method('getSession')->will($this->returnValue($sessionMock)); - $contextMock->expects($this->any())->method('getActionFlag')->will($this->returnValue($actionFlagMock)); - $contextMock->expects($this->any())->method('getHelper')->will($this->returnValue($helperDataMock)); - $this->_controller = new \Magento\Catalog\Controller\Adminhtml\Product( $contextMock, $this->getMock('Magento\Registry', array(), array(), '', false), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/CategoryTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/CategoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5c1bd7e84ccff1a119de697acbee82f038f77da4 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/CategoryTest.php @@ -0,0 +1,189 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Controller; + +use Magento\Framework\App\Action\Action; +use Magento\TestFramework\Helper\ObjectManager; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyFields) + */ +class CategoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $request; + + /** + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $response; + + /** + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $categoryHelper; + + /** + * @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectManager; + + /** + * @var \Magento\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $eventManager; + + /** + * @var \Magento\View\Layout|\PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + /** + * @var \Magento\View\Layout\ProcessorInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $update; + + /** + * @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $view; + + /** + * @var \Magento\Backend\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject + */ + protected $context; + + /** + * @var \Magento\Catalog\Model\Category|\PHPUnit_Framework_MockObject_MockObject + */ + protected $category; + + /** + * @var \Magento\Catalog\Model\CategoryFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $categoryFactory; + + /** + * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject + */ + protected $store; + + /** + * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManager; + + /** + * @var \Magento\Catalog\Model\Design|\PHPUnit_Framework_MockObject_MockObject + */ + protected $catalogDesign; + + /** + * @var \Magento\Theme\Helper\Layout|\PHPUnit_Framework_MockObject_MockObject + */ + protected $layoutHelper; + + /** + * @var \Magento\Catalog\Controller\Category + */ + protected $controller; + + public function setUp() + { + $this->request = $this->getMock('Magento\Framework\App\RequestInterface'); + $this->response = $this->getMock('Magento\Framework\App\ResponseInterface'); + + $this->categoryHelper = $this->getMock('Magento\Catalog\Helper\Category', [], [], '', false); + $this->objectManager = $this->getMock('Magento\ObjectManager', [], [], '', false); + $this->eventManager = $this->getMock('Magento\Event\ManagerInterface'); + + $this->update = $this->getMock('Magento\View\Layout\ProcessorInterface'); + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + $this->layout->expects($this->any())->method('getUpdate')->will($this->returnValue($this->update)); + $this->view = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->view->expects($this->any())->method('getLayout')->will($this->returnValue($this->layout)); + + $this->context = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); + $this->context->expects($this->any())->method('getRequest')->will($this->returnValue($this->request)); + $this->context->expects($this->any())->method('getResponse')->will($this->returnValue($this->response)); + $this->context->expects($this->any())->method('getObjectManager') + ->will($this->returnValue($this->objectManager)); + $this->context->expects($this->any())->method('getEventManager')->will($this->returnValue($this->eventManager)); + $this->context->expects($this->any())->method('getView')->will($this->returnValue($this->view)); + + $this->category = $this->getMock('Magento\Catalog\Model\Category', [], [], '', false); + $this->categoryFactory = $this->getMock('Magento\Catalog\Model\CategoryFactory', ['create'], [], '', false); + + $this->store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); + $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store)); + + $this->catalogDesign = $this->getMock('Magento\Catalog\Model\Design', [], [], '', false); + $this->layoutHelper = $this->getMock('Magento\Theme\Helper\Layout', [], [], '', false); + + $this->controller = (new ObjectManager($this))->getObject('Magento\Catalog\Controller\Category', [ + 'context' => $this->context, + 'categoryFactory' => $this->categoryFactory, + 'storeManager' => $this->storeManager, + 'catalogDesign' => $this->catalogDesign, + ]); + } + + public function testApplyCustomLayoutUpdate() + { + $categoryId = 123; + $pageLayout = 'page_layout'; + + $this->objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ + ['Magento\Catalog\Helper\Category', $this->categoryHelper], + ['Magento\Theme\Helper\Layout', $this->layoutHelper], + ])); + + $this->request->expects($this->any())->method('getParam')->will($this->returnValueMap([ + [Action::PARAM_NAME_URL_ENCODED], + ['id', false, $categoryId], + ])); + + $this->categoryFactory->expects($this->any())->method('create')->will($this->returnValue($this->category)); + $this->category->expects($this->any())->method('setStoreId')->will($this->returnSelf()); + $this->category->expects($this->any())->method('load')->with($categoryId)->will($this->returnSelf()); + + $this->categoryHelper->expects($this->any())->method('canShow')->will($this->returnValue(true)); + + $settings = $this->getMock('Magento\Object', ['getPageLayout'], [], '', false); + $settings->expects($this->atLeastOnce())->method('getPageLayout')->will($this->returnValue($pageLayout)); + + $this->catalogDesign->expects($this->any())->method('getDesignSettings')->will($this->returnValue($settings)); + + $this->layoutHelper->expects($this->once())->method('applyHandle')->with($pageLayout); + + $this->controller->viewAction(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/CompareTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/CompareTest.php index d93331653dca47ebef1bc0192c59a36ee586e406..147ec8509254536e9affba5e5f5d2d5e1c6d18c4 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/CompareTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/CompareTest.php @@ -39,7 +39,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase protected $compareHelper; /** - * @var \Magento\App\Helper\Context | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Helper\Context | \PHPUnit_Framework_MockObject_MockObject */ protected $context; @@ -54,7 +54,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase protected $postDataHelper; /** - * @var \Magento\App\Request\Http | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http | \PHPUnit_Framework_MockObject_MockObject */ protected $request; @@ -63,10 +63,10 @@ class CompareTest extends \PHPUnit_Framework_TestCase $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->urlBuilder = $this->getMock('Magento\Url', array('getUrl'), array(), '', false); - $this->request = $this->getMock('Magento\App\Request\Http', array('getServer'), array(), '', false); - /** @var \Magento\App\Helper\Context $context */ + $this->request = $this->getMock('Magento\Framework\App\Request\Http', array('getServer'), array(), '', false); + /** @var \Magento\Framework\App\Helper\Context $context */ $this->context = $this->getMock( - 'Magento\App\Helper\Context', + 'Magento\Framework\App\Helper\Context', array('getUrlBuilder', 'getRequest'), array(), '', @@ -99,7 +99,8 @@ class CompareTest extends \PHPUnit_Framework_TestCase $removeUrl = 'catalog/product_compare/remove'; $compareListUrl = 'catalog/product_compare'; $postParams = array( - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->compareHelper->urlEncode($compareListUrl), + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->compareHelper + ->urlEncode($compareListUrl), 'product' => $productId ); @@ -146,7 +147,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase $refererUrl = 'home/'; $clearUrl = 'catalog/product_compare/clear'; $postParams = array( - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->compareHelper->urlEncode($refererUrl) + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->compareHelper->urlEncode($refererUrl) ); //Verification diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/Flat/IndexerTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/Flat/IndexerTest.php index e01d0022e5ac3a5a2cee48dc059d59a487fefe7f..3d464d9a736de2ad5e0c6786106a22fb414ead3a 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/Flat/IndexerTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Helper/Product/Flat/IndexerTest.php @@ -41,7 +41,7 @@ class IndexerTest extends \PHPUnit_Framework_TestCase protected $_storeManagerMock; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $_resourceMock; @@ -57,10 +57,10 @@ class IndexerTest extends \PHPUnit_Framework_TestCase public function setUp() { - $contextMock = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $contextMock = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $this->_resourceMock = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/App/Action/ContextPluginTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/App/Action/ContextPluginTest.php index 3b85f33762e53c0da765bdcc8d64739a90b5beb3..08dea438a4af54cab1ec1e423853dd5c3c14534e 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/App/Action/ContextPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/App/Action/ContextPluginTest.php @@ -40,7 +40,7 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase protected $toolbarModelMock; /** - * @var \Magento\App\Http\Context|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Http\Context|\PHPUnit_Framework_MockObject_MockObject */ protected $httpContextMock; @@ -84,9 +84,9 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase $this->closureMock = function () { return 'ExpectedValue'; }; - $this->subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); - $this->httpContextMock = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); + $this->subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); + $this->httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); $this->productListHelperMock = $this->getMock('Magento\Catalog\Helper\Product\ProductList', array(), array(), '', false); $this->plugin = new ContextPlugin( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php index b293e55290f6b5a8193f80fa066ff0081a26a9ff..7b9decb10a25f7abb23c32990459076ce6dfe0ed 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php @@ -40,7 +40,7 @@ class SortbyTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = $this->_objectHelper->getObject( 'Magento\Catalog\Model\Category\Attribute\Backend\Sortby', array('scopeConfig' => $scopeConfig) diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/StateTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/StateTest.php index dc116424472cfccfa0c01e63cb4d5efd3b905f82..85788f0448a0ba9713b7fe68aa4d7dec26e28443 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/StateTest.php @@ -31,7 +31,7 @@ class StateTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfigMock; @@ -42,7 +42,7 @@ class StateTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->scopeConfigMock = $this->getMockForAbstractClass('Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); $this->flatIndexerMock = $this->getMockForAbstractClass( 'Magento\Indexer\Model\IndexerInterface', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/ModeTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/ModeTest.php index 04f21ac5facf62cf9e60ba037a149c91b037e49d..e1e58ca39ef1817cebb8560282edd1bf5e9c6ccc 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/ModeTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Category/Flat/System/Config/ModeTest.php @@ -31,7 +31,7 @@ class ModeTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $configMock; @@ -47,7 +47,7 @@ class ModeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->indexerStateMock = $this->getMock( 'Magento\Indexer\Model\Indexer\State', array('loadByIndexer', 'setStatus', 'save', '__wakeup'), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableDataTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableDataTest.php index 300e84a5f413f27df7695f9ba2eb89aa79518b45..1d3da46059a7cb74d90341b10de3c018139136ba 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows/TableDataTest.php @@ -44,7 +44,7 @@ class TableDataTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $_resourceMock; @@ -52,7 +52,7 @@ class TableDataTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_connectionMock = $this->getMock('Magento\DB\Adapter\AdapterInterface'); - $this->_resourceMock = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resourceMock = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->_productIndexerHelper = $this->getMock( 'Magento\Catalog\Helper\Product\Flat\Indexer', array(), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/StateTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/StateTest.php index ae9bdb329baae010483b70465772241e68dcbbd8..5264a769da94977413ab6c1711921e318155177d 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/StateTest.php @@ -50,7 +50,7 @@ class StateTest extends \PHPUnit_Framework_TestCase '', false ); - $configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = $this->_objectManager->getObject( 'Magento\Catalog\Model\Indexer\Product\Flat\State', array( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/ModeTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/ModeTest.php index 27fc59be7cad2d442d07a6a53278edfc71f506b3..1d9e28d525636fc28cc5809ecb25627445da3753 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/ModeTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/System/Config/ModeTest.php @@ -31,7 +31,7 @@ class ModeTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $configMock; @@ -47,7 +47,7 @@ class ModeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->indexerStateMock = $this->getMock( 'Magento\Indexer\Model\Indexer\State', array('loadByIndexer', 'setStatus', 'save', '__wakeup'), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/TableDataTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/TableDataTest.php index 92417cf9df353df69b9738320686604d9743b7bf..8c29eb278bc472aed16b331f48c2d41f232d1bc0 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/TableDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/TableDataTest.php @@ -39,7 +39,7 @@ class TableDataTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $_resourceMock; @@ -47,7 +47,7 @@ class TableDataTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_connectionMock = $this->getMock('Magento\DB\Adapter\AdapterInterface'); - $this->_resourceMock = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resourceMock = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); } /** diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/ObserverTest.php index 83d77ab58e5a2119a98845f8aa5286875859b562..18354bee60682f8244c049b4f3d77e1cd1b8ea36 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/ObserverTest.php @@ -44,7 +44,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase protected $_storeManagerMock; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $_resourceMock; @@ -79,7 +79,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_resourceMock = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resourceMock = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->_dateTimeMock = $this->getMock('Magento\Stdlib\DateTime', array(), array(), '', false); $this->_localeDateMock = $this->getMock('Magento\Stdlib\DateTime\TimezoneInterface'); $this->_eavConfigMock = $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php index aaf79b27217b61c897f6a6c1618f06cbee72248c..3ed0e730705d5dade85b3a23da7861382989a7ae 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php @@ -59,7 +59,7 @@ class PriceScopeTest extends \PHPUnit_Framework_TestCase $contextMock = $this->getMock('Magento\Model\Context', array(), array(), '', false); $registryMock = $this->getMock('Magento\Registry', array(), array(), '', false); $storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false); - $configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = $this->_objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php index 3a342baa3fb02515098e4d6ebcef1d6cd42a3990..77719c74269f181581b17a3e16398d621206f95d 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php @@ -49,7 +49,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $currencyFactoryMock = $this->getMock('Magento\Directory\Model\CurrencyFactory', array(), array(), '', false); $storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false); $productTypeMock = $this->getMock('Magento\Catalog\Model\Product\Type', array(), array(), '', false); - $configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = $this->getMockForAbstractClass( 'Magento\Catalog\Model\Product\Attribute\Backend\Groupprice\AbstractGroupprice', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php index 67b71e06ce040a29e91e16a29a10696e11083af8..b6e9f848fb504c2ff1f1d0a2f1ba070370d5d505 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php @@ -58,7 +58,9 @@ class MediaTest extends \PHPUnit_Framework_TestCase $directory = $this->getMockBuilder( 'Magento\Filesystem\Directory\Write' )->disableOriginalConstructor()->getMock(); - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $filesystem->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directory)); $this->_model = $this->_objectHelper->getObject( 'Magento\Catalog\Model\Product\Attribute\Backend\Media', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ProductList/ToolbarTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ProductList/ToolbarTest.php index def84244151f3cbf0eabef9c1c370f7c5a90952c..58d8508cf4176c246e1f2684a027006c7beb5d84 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ProductList/ToolbarTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ProductList/ToolbarTest.php @@ -37,7 +37,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase protected $cookie; /** - * @var \Magento\App\Request\Http |\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http |\PHPUnit_Framework_MockObject_MockObject */ protected $request; @@ -47,7 +47,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->cookie = $this->getMock('Magento\Stdlib\Cookie', array('get'), array(), '', false); - $this->request = $this->getMock('Magento\App\Request\Http', array('getParam'), array(), '', false); + $this->request = $this->getMock('Magento\Framework\App\Request\Http', array('getParam'), array(), '', false); $this->toolbarModel = new Toolbar($this->cookie, $this->request); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php index 58cc598ebf21bc94c8b7aeab9b36723ae4ca7802..b7c42aac63e5dea3c9e0bcf984fe2befc3ea4165 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php @@ -39,7 +39,9 @@ class SimpleTest extends \PHPUnit_Framework_TestCase $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $coreDataMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $fileStorageDbMock = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php index ad4a57ce4b463df42704a1a9fe6fd06bb2647219..19b7e6fab12e7cc91ad569b09c37f807426ef5b5 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php @@ -40,7 +40,9 @@ class VirtualTest extends \PHPUnit_Framework_TestCase $coreDataMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $coreRegistryMock = $this->getMock('Magento\Registry', array(), array(), '', false); $fileStorageDbMock = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false); $this->_model = $objectHelper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ValidatorTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ValidatorTest.php index a27d64d2b89b6ffc56bcbd75f054c12f96a98b08..57f802ca10c9df7c8a13b0ec3decea8ebe4afb2b 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/ValidatorTest.php @@ -29,7 +29,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase { $validator = new \Magento\Catalog\Model\Product\Validator(); $productMock = $this->getMock('Magento\Catalog\Model\Product', array(), array(), '', false); - $requestMock = $this->getMock('Magento\App\RequestInterface'); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $responseMock = $this->getMock('Magento\Object'); $productMock->expects($this->once())->method('validate')->will($this->returnValue(true)); $this->assertEquals(true, $validator->validate($productMock, $requestMock, $responseMock)); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/ProductTest.php index 1f126af0f6563ad4f1c7fab92eaff682dc1b5fbb..dd88df3bb3ebb431b9302636aea1d067816c7d1b 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/ProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/ProductTest.php @@ -26,12 +26,17 @@ */ namespace Magento\Catalog\Model; +use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; + class ProductTest extends \PHPUnit_Framework_TestCase { + /** @var ObjectManagerHelper */ + protected $objectManagerHelper; + /** * @var \Magento\Catalog\Model\Product */ - protected $_model; + protected $model; /** * @var \Magento\Indexer\Model\IndexerInterface|\PHPUnit_Framework_MockObject_MockObject @@ -41,17 +46,22 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Catalog\Model\Indexer\Product\Flat\Processor|\PHPUnit_Framework_MockObject_MockObject */ - protected $_productFlatProcessor; + protected $productFlatProcessor; /** * @var \Magento\Catalog\Model\Indexer\Product\Price\Processor|\PHPUnit_Framework_MockObject_MockObject */ - protected $_productPriceProcessor; + protected $productPriceProcessor; /** * @var Product\Type|\PHPUnit_Framework_MockObject_MockObject */ - protected $_productTypeMock; + protected $productTypeMock; + + /** + * @var \Magento\Pricing\PriceInfo\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_priceInfoMock; public function setUp() { @@ -60,21 +70,20 @@ class ProductTest extends \PHPUnit_Framework_TestCase array(), '', false, - false, - true, - array() + false ); - $this->_productFlatProcessor = $this->getMock( + $this->productFlatProcessor = $this->getMock( 'Magento\Catalog\Model\Indexer\Product\Flat\Processor', array(), array(), '', false ); - $this->_productTypeMock = $this->getMock('Magento\Catalog\Model\Product\Type', array(), array(), '', false); - $this->_productPriceProcessor = $this->getMock( + $this->_priceInfoMock = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->productTypeMock = $this->getMock('Magento\Catalog\Model\Product\Type', [], [], '', false); + $this->productPriceProcessor = $this->getMock( 'Magento\Catalog\Model\Indexer\Product\Price\Processor', array(), array(), @@ -82,99 +91,62 @@ class ProductTest extends \PHPUnit_Framework_TestCase false ); - $stateMock = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); - - $stateMock->expects( - $this->any() - )->method( - 'getAreaCode' - )->will( - $this->returnValue(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) - ); + $stateMock = $this->getMock('Magento\FrameworkApp\State', array('getAreaCode'), array(), '', false); + $stateMock->expects($this->any()) + ->method('getAreaCode') + ->will($this->returnValue(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE)); $eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); - - $actionValidatorMock = $this->getMock( - '\Magento\Model\ActionValidator\RemoveAction', array(), array(), '', false - ); + $actionValidatorMock = $this->getMock('\Magento\Model\ActionValidator\RemoveAction', [], [], '', false); $actionValidatorMock->expects($this->any())->method('isAllowed')->will($this->returnValue(true)); - $cacheInterfaceMock = $this->getMock('Magento\App\CacheInterface', array(), array(), '', false); - + $cacheInterfaceMock = $this->getMock('Magento\Framework\App\CacheInterface', array(), array(), '', false); $contextMock = $this->getMock( '\Magento\Model\Context', array('getEventDispatcher', 'getCacheManager', 'getAppState', 'getActionValidator'), array(), '', false ); - $contextMock->expects($this->any())->method('getAppState')->will($this->returnValue($stateMock)); - $contextMock->expects($this->any())->method('getEventDispatcher')->will($this->returnValue($eventManagerMock)); - $contextMock->expects($this->any()) ->method('getCacheManager') ->will($this->returnValue($cacheInterfaceMock)); - $contextMock->expects($this->any()) ->method('getActionValidator') ->will($this->returnValue($actionValidatorMock)); - $this->_model = new \Magento\Catalog\Model\Product( - $contextMock, - $this->getMock('Magento\Registry', array(), array(), '', false), - $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Url', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Link', array(), array(), '', false), - $this->getMock( - 'Magento\Catalog\Model\Product\Configuration\Item\OptionFactory', - array(), - array(), - '', - false - ), - $this->getMock('Magento\CatalogInventory\Model\Stock\ItemFactory', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\CategoryFactory', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Option', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Visibility', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Attribute\Source\Status', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Product\Media\Config', array(), array(), '', false), - $this->getMock('Magento\Index\Model\Indexer', array(), array(), '', false), - $this->_productTypeMock, - $this->getMock('Magento\Catalog\Helper\Image', array(), array(), '', false), - $this->getMock('Magento\Catalog\Helper\Data', array(), array(), '', false), - $this->getMock('Magento\Catalog\Helper\Product', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Resource\Product', array(), array(), '', false), - $this->getMock('Magento\Catalog\Model\Resource\Product\Collection', array(), array(), '', false), - $this->getMock('Magento\Data\CollectionFactory', array(), array(), '', false), - $this->getMock('Magento\App\Filesystem', array(), array(), '', false), - $this->categoryIndexerMock, - $this->_productFlatProcessor, - $this->_productPriceProcessor, - array('id' => 1) + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->model = $this->objectManagerHelper->getObject( + 'Magento\Catalog\Model\Product', + [ + 'context' => $contextMock, + 'catalogProductType' => $this->productTypeMock, + 'categoryIndexer' => $this->categoryIndexerMock, + 'productFlatIndexerProcessor' => $this->productFlatProcessor, + 'productPriceIndexerProcessor' => $this->productPriceProcessor, + 'data' => array('id' => 1) + ] ); } public function testIndexerAfterDeleteCommitProduct() { $this->categoryIndexerMock->expects($this->once())->method('reindexRow'); - $this->_productFlatProcessor->expects($this->once())->method('reindexRow'); - $this->_productPriceProcessor->expects($this->once())->method('reindexRow'); - - $this->_model->delete(); + $this->productFlatProcessor->expects($this->once())->method('reindexRow'); + $this->productPriceProcessor->expects($this->once())->method('reindexRow'); + $this->assertSame($this->model, $this->model->delete()); } public function testReindex() { $this->categoryIndexerMock->expects($this->once())->method('reindexRow'); - $this->_productFlatProcessor->expects($this->once())->method('reindexRow'); - - $this->_model->reindex(); + $this->productFlatProcessor->expects($this->once())->method('reindexRow'); + $this->assertNull($this->model->reindex()); } public function testPriceReindexCallback() { - $this->_productPriceProcessor->expects($this->once())->method('reindexRow'); - - $this->_model->priceReindexCallback(); + $this->productPriceProcessor->expects($this->once())->method('reindexRow'); + $this->assertNull($this->model->priceReindexCallback()); } /** @@ -186,13 +158,13 @@ class ProductTest extends \PHPUnit_Framework_TestCase */ public function testGetIdentities($expected, $origData, $data, $isDeleted = false) { - $this->_model->setIdFieldName('id'); + $this->model->setIdFieldName('id'); $typeMock = $this->getMock('Magento\Catalog\Model\Product\Type\AbstractType', array(), array(), '', false); - $this->_productTypeMock + $this->productTypeMock ->expects($this->once()) ->method('factory') - ->with($this->_model) + ->with($this->model) ->will($this->returnValue($typeMock)); $typeMock->expects($this->once()) @@ -200,12 +172,12 @@ class ProductTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(array('type_1'))); if (is_array($origData)) { foreach ($origData as $key => $value) { - $this->_model->setOrigData($key, $value); + $this->model->setOrigData($key, $value); } } - $this->_model->setData($data); - $this->_model->isDeleted($isDeleted); - $this->assertEquals($expected, $this->_model->getIdentities()); + $this->model->setData($data); + $this->model->isDeleted($isDeleted); + $this->assertEquals($expected, $this->model->getIdentities()); } /** @@ -237,4 +209,42 @@ class ProductTest extends \PHPUnit_Framework_TestCase ), ); } + + /** + * Test retrieving price Info + */ + public function testGetPriceInfo() + { + $this->productTypeMock->expects($this->once()) + ->method('getPriceInfo') + ->with($this->equalTo($this->model)) + ->will($this->returnValue($this->_priceInfoMock)); + $this->assertEquals($this->model->getPriceInfo(), $this->_priceInfoMock); + } + + /** + * Test for set qty + */ + public function testSetQty() + { + $this->productTypeMock->expects($this->once()) + ->method('getPriceInfo') + ->with($this->equalTo($this->model)) + ->will($this->returnValue($this->_priceInfoMock)); + $this->assertEquals($this->model, $this->model->setQty(1)); + $this->assertEquals($this->model->getPriceInfo(), $this->_priceInfoMock); + } + + /** + * Test reload PriceInfo + */ + public function testReloadPriceInfo() + { + $this->productTypeMock->expects($this->exactly(2)) + ->method('getPriceInfo') + ->with($this->equalTo($this->model)) + ->will($this->returnValue($this->_priceInfoMock)); + $this->assertEquals($this->_priceInfoMock, $this->model->getPriceInfo()); + $this->assertEquals($this->_priceInfoMock, $this->model->reloadPriceInfo()); + } } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php index b0f416903a8ce74444e79d92aa6692b359da424e..58cb2e73b448bdec8dfec5d825f09c07e076f9d4 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php @@ -103,7 +103,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase 'Magento\Catalog\Model\Resource\AbstractResource', array('getAttributesByCode'), array( - $this->getMock('Magento\App\Resource', array(), array(), '', false, false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false, false), $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false, false), $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', array(), array(), '', false, false), $this->getMock('Magento\Locale\FormatInterface'), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/TreeTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/TreeTest.php index a2eddcde0760781e0c00d0711d70cb91512b9137..6792ee5d1a5248ddb42cb283718eff602df2f2ac 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/TreeTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/TreeTest.php @@ -52,7 +52,7 @@ class TreeTest extends \PHPUnit_Framework_TestCase $select->expects($this->once())->method('from')->with('catalog_category_entity'); $connection = $this->getMock('Magento\DB\Adapter\AdapterInterface'); $connection->expects($this->once())->method('select')->will($this->returnValue($select)); - $this->_resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->_resource->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Eav/AttributeTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Eav/AttributeTest.php index 373c7264066dc48dab1f4ccfce2432645a1ed79d..93034a5c7a6c60a1f40f9e0648d675783412dfac 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Eav/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Eav/AttributeTest.php @@ -50,7 +50,7 @@ class AttributeTest extends \PHPUnit_Framework_TestCase $eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); - $cacheInterfaceMock = $this->getMock('Magento\App\CacheInterface', array(), array(), '', false); + $cacheInterfaceMock = $this->getMock('Magento\Framework\App\CacheInterface', array(), array(), '', false); $actionValidatorMock = $this->getMock( '\Magento\Model\ActionValidator\RemoveAction', array(), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php index 45c23a4b542c32654bb3a0e4e0a04494ea1b36d7..ba95c1819db80c1fc4b1c18e4523285b16ce1fc6 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php @@ -67,7 +67,7 @@ class FlatTest extends \PHPUnit_Framework_TestCase $this->_model = new \Magento\Catalog\Model\Resource\Product\Flat( - $this->getMock('Magento\App\Resource', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false), $this->_storeManagerInterface, $this->getMock('Magento\Catalog\Model\Config', array(), array(), '', false) ); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/LinkTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/LinkTest.php index 1cbe8d597dba185cadec70361a6a87161178accc..452b4477239d0c4a4639778b95f25ff6a346f028 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/LinkTest.php @@ -53,7 +53,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->readAdapter = $this->getMock('\Magento\DB\Adapter\AdapterInterface', array(), array(), '', false); $this->writeAdapter = $this->getMock('\Magento\DB\Adapter\AdapterInterface', array(), array(), '', false); $this->model = $objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/BasePriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/BasePriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8eda2757898cd25514dccc133c050ce3eda77fcd --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/BasePriceTest.php @@ -0,0 +1,115 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Pricing\Price; + +/** + * Base price test + */ +class BasePriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $basePrice; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator + */ + protected $calculatorMock; + + /** + * @var \Magento\Catalog\Pricing\Price\RegularPrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $regularPriceMock; + + /** + * @var \Magento\Catalog\Pricing\Price\GroupPrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $groupPriceMock; + + /** + * @var \Magento\Catalog\Pricing\Price\SpecialPrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $specialPriceMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject[] + */ + protected $prices; + + /** + * Set up + */ + public function setUp() + { + $qty = 1; + $this->salableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->priceInfoMock = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->regularPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\RegularPrice', [], [], '', false); + $this->groupPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\GroupPrice', [], [], '', false); + $this->specialPriceMock= $this->getMock('Magento\Catalog\Pricing\Price\SpecialPrice', [], [], '', false); + $this->calculatorMock = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + + $this->salableItemMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + $this->prices = [ + 'regular_price' => $this->regularPriceMock, + 'group_price' => $this->groupPriceMock, + 'special_price' => $this->specialPriceMock + ]; + $this->basePrice = new BasePrice($this->salableItemMock, $qty, $this->calculatorMock); + } + + /** + * test method getValue + */ + public function testGetValue() + { + $specialPriceValue = 77; + $this->priceInfoMock->expects($this->once()) + ->method('getPricesIncludedInBase') + ->will($this->returnValue($this->prices)); + $this->regularPriceMock->expects($this->exactly(2)) + ->method('getValue') + ->will($this->returnValue(100)); + $this->groupPriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue(99)); + $this->specialPriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($specialPriceValue)); + $this->assertSame($specialPriceValue, $this->basePrice->getValue()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/FinalPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/FinalPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f66b69602fa3034593215b057b3103922a14976e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/FinalPriceTest.php @@ -0,0 +1,135 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Pricing\Price; + +/** + * Final Price test + */ +class FinalPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Price\FinalPrice + */ + protected $model; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $basePriceMock; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculatorMock; + + /** + * Set up function + */ + public function setUp() + { + $this->saleableMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->priceInfoMock = $this->getMockForAbstractClass('Magento\Pricing\PriceInfoInterface'); + $this->basePriceMock = $this->getMock( + 'Magento\Catalog\Pricing\Price\BasePrice', + [], + [], + '', + false + ); + + $this->saleableMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + $this->priceInfoMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo(\Magento\Catalog\Pricing\Price\BasePrice::PRICE_TYPE_BASE_PRICE)) + ->will($this->returnValue($this->basePriceMock)); + $this->calculatorMock = $this->getMockBuilder('Magento\Pricing\Adjustment\Calculator') + ->disableOriginalConstructor() + ->getMock(); + $this->model = new \Magento\Catalog\Pricing\Price\FinalPrice($this->saleableMock, 1, $this->calculatorMock); + } + + /** + * test for getValue + */ + public function testGetValue() + { + $price = 10; + $this->basePriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($price)); + $result = $this->model->getValue(); + $this->assertEquals($price, $result); + } + + /** + * Test getMinimalPrice() + */ + public function testGetMinimalPrice() + { + $basePrice = 10; + $minimalPrice = 5; + $this->basePriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + $this->calculatorMock->expects($this->once()) + ->method('getAmount') + ->with($this->equalTo($basePrice)) + ->will($this->returnValue($minimalPrice)); + $this->saleableMock->expects($this->once()) + ->method('getMinimalPrice') + ->will($this->returnValue(null)); + $result = $this->model->getMinimalPrice(); + $this->assertEquals($minimalPrice, $result); + } + + /** + * Test getMaximalPrice() + */ + public function testGetMaximalPrice() + { + $basePrice = 10; + $minimalPrice = 5; + $this->basePriceMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + $this->calculatorMock->expects($this->once()) + ->method('getAmount') + ->with($this->equalTo($basePrice)) + ->will($this->returnValue($minimalPrice)); + $result = $this->model->getMaximalPrice(); + $this->assertEquals($minimalPrice, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/GroupPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/GroupPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9759768773fb7e89e0af0f850053c59a81db891a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/GroupPriceTest.php @@ -0,0 +1,237 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Group price test + */ +class GroupPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + /** + * @param array|null $groupPrice + * @param int $customerGroup + * @param float $expected + * + * @dataProvider groupPriceDataProvider + */ + public function testGroupPrice($groupPrice, $customerGroup, $expected) + { + $salableItemMock = $this->prepareSalableItem($groupPrice); + $sessionMock = $this->prepareSession($salableItemMock, $customerGroup); + $groupPriceModel = $this->objectManager->getObject( + 'Magento\Catalog\Pricing\Price\GroupPrice', + [ + 'salableItem' => $salableItemMock, + 'customerSession' => $sessionMock + ] + ); + $this->assertEquals($expected, $groupPriceModel->getValue()); + } + + /** + * @param \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product $salableItemMock + * @param int $customerGroup + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Model\Session + */ + protected function prepareSession($salableItemMock, $customerGroup) + { + $session = $this->getMock('Magento\Customer\Model\Session', ['getCustomerGroupId'], [], '', false); + $session->expects($this->any()) + ->method('getCustomerGroupId') + ->will($this->returnValue($customerGroup)); + + $salableItemMock->expects($this->any()) + ->method('getCustomerGroupId') + ->will($this->returnValue(false)); + + return $session; + } + + /** + * @dataProvider groupPriceNonExistDataProvider + * + * @param array|null $groupPrice + * @param float $expected + */ + public function testGroupPriceNonExist($groupPrice, $expected) + { + $groupPriceModel = $this->objectManager->getObject( + 'Magento\Catalog\Pricing\Price\GroupPrice', + [ + 'salableItem' => $this->prepareSalableItem($groupPrice), + 'customerSession' => $this->getMock('Magento\Customer\Model\Session', [], [], '', false) + ] + ); + + $this->assertEquals($expected, $groupPriceModel->getValue()); + } + + /** + * @param array|null $groupPrice + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function prepareSalableItem($groupPrice) + { + $salableItemMock = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getCustomerGroupId', 'getData', 'getPrice', 'getPriceInfo', 'getResource', '__wakeup'], + [], + '', + false + ); + + $salableItemMock->expects($this->at(1)) + ->method('getData') + ->will($this->returnValue(null)); + + $salableItemMock->expects($this->at(2)) + ->method('getData') + ->will($this->returnValue($groupPrice)); + + $salableItemMock->expects($this->any()) + ->method('getResource') + ->will($this->returnValue($this->prepareSalableItemResource())); + + $priceInfo = $this->getMockBuilder( + 'Magento\Pricing\PriceInfoInterface' + )->disableOriginalConstructor()->getMockForAbstractClass(); + + $priceInfo->expects($this->any()) + ->method('getAdjustments') + ->will($this->returnValue([])); + + $salableItemMock->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfo)); + + return $salableItemMock; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Resource\Product + */ + protected function prepareSalableItemResource() + { + $resourceMock = $this->getMockBuilder( + 'Magento\Catalog\Model\Resource\Product' + )->disableOriginalConstructor()->setMethods(['getAttribute', '__wakeup'])->getMock(); + + $attributeMock = $this->getMock( + 'Magento\Object', + ['getBackend', 'afterLoad'], + [], + '', + false + ); + + $attributeMock->expects($this->any()) + ->method('getBackend') + ->will($this->returnValue($attributeMock)); + + $attributeMock->expects($this->any()) + ->method('afterLoad') + ->will($this->returnValue($attributeMock)); + + $resourceMock->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue($attributeMock)); + + return $resourceMock; + } + + /** + * @return array + */ + public function groupPriceDataProvider() + { + return [ + [ + 'groupPrice' => [ + [ + 'cust_group' => 1, + 'website_price' => 90.9 + ], + [ + 'cust_group' => 2, + 'website_price' => 80.8 + ], + [ + 'cust_group' => 1, + 'website_price' => 70.7 + ] + ], + 'customer_group' => 1, + 'expected' => 90.9 + ], + [ + 'groupPrice' => [ + [ + 'cust_group' => 2, + 'website_price' => 10.1 + ], + [ + 'cust_group' => 1, + 'website_price' => 20.2 + ], + ], + 'customer_group' => 1, + 'expected' => 20.2 + ], + [ + 'groupPrice' => [ + [ + 'cust_group' => 1, + 'website_price' => 90.9 + ], + ], + 'customer_group' => 2, + 'expected' => false + ] + ]; + } + + /** + * @return array + */ + public function groupPriceNonExistDataProvider() + { + return [ + [ + 'groupPrice' => null, + 'expected' => false + ] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/MsrpPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/MsrpPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e4019e857e026a2b3acb9852834edf36150e340f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/MsrpPriceTest.php @@ -0,0 +1,158 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use \Magento\Pricing\PriceInfoInterface; + +/** + * Class MsrpPriceTest + */ +class MsrpPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Price\MsrpPrice + */ + protected $object; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $helper; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableItem; + + /** + * @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $price; + /** + * @var \Magento\Pricing\PriceInfo\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculator; + + protected function setUp() + { + $this->saleableItem = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getPriceInfo', '__wakeup'], + [], + '', + false + ); + + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->price = $this->getMock('Magento\Catalog\Pricing\Price\BasePrice', [], [], '', false); + + $this->priceInfo->expects($this->any()) + ->method('getAdjustments') + ->will($this->returnValue([])); + + $this->saleableItem->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $this->priceInfo->expects($this->any()) + ->method('getPrice') + ->with($this->equalTo('base_price')) + ->will($this->returnValue($this->price)); + + $this->calculator = $this->getMockBuilder('Magento\Pricing\Adjustment\Calculator') + ->disableOriginalConstructor() + ->getMock(); + + $this->helper = $this->getMock( + 'Magento\Catalog\Helper\Data', + ['isShowPriceOnGesture', 'getMsrpPriceMessage', 'isMsrpEnabled', 'canApplyMsrp'], + [], + '', + false + ); + + $this->object = new MsrpPrice( + $this->saleableItem, + PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT, + $this->calculator, + $this->helper + ); + } + + public function testIsShowPriceOnGestureTrue() + { + $this->helper->expects($this->once()) + ->method('isShowPriceOnGesture') + ->with($this->equalTo($this->saleableItem)) + ->will($this->returnValue(true)); + + $this->assertTrue($this->object->isShowPriceOnGesture()); + } + + public function testIsShowPriceOnGestureFalse() + { + $this->helper->expects($this->once()) + ->method('isShowPriceOnGesture') + ->with($this->equalTo($this->saleableItem)) + ->will($this->returnValue(false)); + + $this->assertFalse($this->object->isShowPriceOnGesture()); + } + + public function testGetMsrpPriceMessage() + { + $expectedMessage = 'test'; + $this->helper->expects($this->once()) + ->method('getMsrpPriceMessage') + ->with($this->equalTo($this->saleableItem)) + ->will($this->returnValue($expectedMessage)); + + $this->assertEquals($expectedMessage, $this->object->getMsrpPriceMessage()); + } + + public function testIsMsrpEnabled() + { + $this->helper->expects($this->once()) + ->method('isMsrpEnabled') + ->will($this->returnValue(true)); + + $this->assertTrue($this->object->isMsrpEnabled()); + } + + public function testCanApplyMsrp() + { + $this->helper->expects($this->once()) + ->method('canApplyMsrp') + ->with($this->equalTo($this->saleableItem)) + ->will($this->returnValue(true)); + + $this->assertTrue($this->object->canApplyMsrp($this->saleableItem)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/OptionPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/OptionPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..01bec7999e350e75cfca6d5d3ccaba8f3c97c808 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/OptionPriceTest.php @@ -0,0 +1,219 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Pricing\Price; + +use Magento\Pricing\PriceInfoInterface; + +/** + * Class OptionPriceTest + */ +class OptionPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Price\OptionPrice + */ + protected $object; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $product; + + /** + * @var \Magento\Pricing\PriceInfo\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculator; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amount; + + /** + * SetUp + */ + protected function setUp() + { + $this->product = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getOptionById', '__wakeup', 'getPriceInfo', 'getOptions'], + [], + '', + false + ); + + $this->priceInfo = $this->getMock( + 'Magento\Pricing\PriceInfo\Base', + [], + [], + '', + false + ); + + $this->product->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $this->calculator = $this->getMock( + 'Magento\Pricing\Adjustment\Calculator', + [], + [], + '', + false + ); + + $this->amount = $this->getMock( + 'Magento\Pricing\Amount\Base', + [], + [], + '', + false + ); + + $this->object = new CustomOptionPrice( + $this->product, + PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT, + $this->calculator + ); + } + + /** + * Return value + */ + public function testGetValue() + { + $optionId = 1; + $optionValue = 10; + $optionType = 'select'; + $optionValueMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option\DefaultType') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $optionMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option') + ->disableOriginalConstructor() + ->setMethods(['getId', 'getType', 'groupFactory', '__wakeup']) + ->getMock(); + $groupMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option\Type\Select') + ->disableOriginalConstructor() + ->setMethods(['setOption', 'setConfigurationItemOption', 'getOptionPrice']) + ->getMock(); + + $groupMock->expects($this->once()) + ->method('setOption') + ->with($this->equalTo($optionMock)) + ->will($this->returnSelf()); + $groupMock->expects($this->once()) + ->method('setConfigurationItemOption') + ->with($this->equalTo($optionValueMock)) + ->will($this->returnSelf()); + $groupMock->expects($this->once()) + ->method('getOptionPrice') + ->with($this->equalTo($optionValue), $this->equalTo(0.)) + ->will($this->returnValue($optionValue)); + $optionMock->expects($this->at(0)) + ->method('getId') + ->will($this->returnValue($optionId)); + $optionMock->expects($this->once()) + ->method('getType') + ->will($this->returnValue($optionType)); + $optionMock->expects($this->once()) + ->method('groupFactory') + ->with($this->equalTo($optionType)) + ->will($this->returnValue($groupMock)); + $optionValueMock->expects($this->once()) + ->method('getValue') + ->will($this->returnValue($optionValue)); + $optionIds = new \Magento\Object(['value' => '1']); + + $customOptions = ['option_ids' => $optionIds, 'option_1' => $optionValueMock]; + $this->product->setCustomOptions($customOptions); + $this->product->expects($this->once()) + ->method('getOptionById') + ->with($this->equalTo($optionId)) + ->will($this->returnValue($optionMock)); + $result = $this->object->getValue(); + $this->equalTo($optionValue, $result); + + // Return from cache + $result = $this->object->getValue(); + $this->equalTo($optionValue, $result); + } + + /** + * Test getOptions() + */ + public function testGetOptions() + { + $price = 100; + $displayValue = 120; + $id = 1; + $expected = [$id => [$price => ['base_amount' => $price, 'adjustment' => $displayValue]]]; + + $this->amount->expects($this->once()) + ->method('getValue') + ->will($this->returnValue(120)); + + $this->calculator->expects($this->once()) + ->method('getAmount') + ->will($this->returnValue($this->amount)); + + $optionValueMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option\Value') + ->disableOriginalConstructor() + ->setMethods(['getPriceType', 'getPrice', 'getId', '__wakeup']) + ->getMock(); + $optionValueMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue('percent')); + $optionValueMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo(true)) + ->will($this->returnValue($price)); + $optionValueMock->expects($this->once()) + ->method('getId') + ->will($this->returnValue($id)); + $optionItemMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option') + ->disableOriginalConstructor() + ->setMethods(['getValues', '__wakeup']) + ->getMock(); + $optionItemMock->expects($this->any()) + ->method('getValues') + ->will($this->returnValue(array($optionValueMock))); + $options = [$optionItemMock]; + $this->product->expects($this->once()) + ->method('getOptions') + ->will($this->returnValue($options)); + $result = $this->object->getOptions(); + $this->assertEquals($expected, $result); + $result = $this->object->getOptions(); + $this->assertEquals($expected, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/RegularPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/RegularPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9a9b9988fb5bf5579730c2ed2810635b9aed86c1 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/RegularPriceTest.php @@ -0,0 +1,126 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +/** + * Class RegularPriceTest + */ +class RegularPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Price\RegularPrice + */ + protected $regularPrice; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator + */ + protected $calculatorMock; + + /** + * Test setUp + */ + protected function setUp() + { + $qty = 1; + $this->salableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->priceInfoMock = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->amountMock = $this->getMock('Magento\Pricing\Amount', [], [], '', false); + $this->calculatorMock = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + + $this->salableItemMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + $this->regularPrice = new RegularPrice($this->salableItemMock, $qty, $this->calculatorMock); + } + + /** + * Test method testGetValue + * + * @param float|bool $price + * @dataProvider testGetValueDataProvider + */ + public function testGetValue($price) + { + $this->salableItemMock->expects($this->once()) + ->method('getPrice') + ->will($this->returnValue($price)); + $this->assertEquals($price, $this->regularPrice->getValue()); + } + + /** + * Data provider for testGetValue + * + * @return array + */ + public function testGetValueDataProvider() + { + return [ + 'With price' => [100.00], + 'Without price' => [false] + ]; + } + + /** + * Test method testGetDisplayValue + */ + public function testGetAmount() + { + $priceValue = 77; + $amountValue = 88; + $this->calculatorMock->expects($this->once()) + ->method('getAmount') + ->with($this->equalTo($priceValue)) + ->will($this->returnValue($amountValue)); + $this->salableItemMock->expects($this->once()) + ->method('getPrice') + ->will($this->returnValue($priceValue)); + + $this->assertEquals($amountValue, $this->regularPrice->getAmount()); + } + + /** + * Test method getPriceType + */ + public function testGetPriceType() + { + $this->assertEquals(RegularPrice::PRICE_TYPE_PRICE_DEFAULT, $this->regularPrice->getPriceType()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/SpecialPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/SpecialPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..70bbc4866a23e0bb3d0ccf4d507a8a9a25f97980 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/SpecialPriceTest.php @@ -0,0 +1,132 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +class SpecialPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + /** + * @param bool $isValidInterval + * @param float $specialPrice + * @param float|bool $expected + * + * @dataProvider specialPriceDataProvider + */ + public function testGetValue($isValidInterval, $specialPrice, $expected) + { + $specialPriceModel = $this->objectManager->getObject( + 'Magento\Catalog\Pricing\Price\SpecialPrice', + [ + 'salableItem' => $this->prepareSalebleItem($specialPrice), + 'localeDate' => $this->prepareLocaleDate($isValidInterval) + ] + ); + + $this->assertSame($expected, $specialPriceModel->getValue()); + } + + /** + * @param float $specialPrice + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product + */ + protected function prepareSalebleItem($specialPrice) + { + $salableItemMock = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getSpecialPrice', 'getPriceInfo', 'getStore', '__wakeup'], + [], + '', + false + ); + + $salableItemMock->expects($this->any()) + ->method('getSpecialPrice') + ->will($this->returnValue($specialPrice)); + + $priceInfo = $this->getMockBuilder( + 'Magento\Pricing\PriceInfoInterface' + )->disableOriginalConstructor()->getMockForAbstractClass(); + + $priceInfo->expects($this->any()) + ->method('getAdjustments') + ->will($this->returnValue([])); + + $salableItemMock->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfo)); + + return $salableItemMock; + } + + /** + * @param bool $isValidInterval + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Stdlib\DateTime\TimezoneInterface + */ + protected function prepareLocaleDate($isValidInterval) + { + $localeDate = $this->getMockBuilder( + 'Magento\Stdlib\DateTime\TimezoneInterface' + )->disableOriginalConstructor()->getMockForAbstractClass(); + + $localeDate->expects($this->any()) + ->method('isScopeDateInInterval') + ->will($this->returnValue($isValidInterval)); + + return $localeDate; + } + + /** + * @return array + */ + public function specialPriceDataProvider() + { + return [ + 'validInterval' => [ + 'is_valid_date' => true, + 'special_price' => 50.15, + 'expected' => 50.15, + ], + 'validZeroValue' => [ + 'is_valid_date' => true, + 'special_price' => 0., + 'expected' => 0., + ], + 'invalidInterval' => [ + 'is_valid_date' => false, + 'special_price' => 20., + 'expected' => false, + ] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/TierPriceTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/TierPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d9b45e54f428771509c2d5febd2e6117e3d2868b --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/TierPriceTest.php @@ -0,0 +1,299 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Price; + +use Magento\Customer\Model\Group; + +/** + * Test for \Magento\Catalog\Pricing\Price\TierPrice + */ +class TierPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test customer group + * + * @var int + */ + protected $customerGroup = Group::NOT_LOGGED_IN_ID; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $product; + + /** + * @var float + */ + protected $quantity = 3.; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $calculator; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $session; + + /** + * @var TierPrice + */ + protected $model; + + /** + * Initialize base dependencies + */ + protected function setUp() + { + $this->priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface', [], [], '', false); + + $this->product = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getPriceInfo', 'hasCustomerGroupId', 'getCustomerGroupId', 'getResource', '__wakeup'], + [], + '', + false + ); + $this->product->expects($this->any())->method('getPriceInfo')->will($this->returnValue($this->priceInfo)); + + $this->session = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); + $this->session->expects($this->any())->method('getCustomerGroupId') + ->will($this->returnValue($this->customerGroup)); + + $this->calculator = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + + $this->model = new TierPrice($this->product, $this->quantity, $this->calculator, $this->session); + } + + + /** + * Test base initialization of tier price + * + * @covers \Magento\Catalog\Pricing\Price\TierPrice::__construct + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getValue + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getStoredTierPrices + * @covers \Magento\Catalog\Pricing\Price\TierPrice::canApplyTierPrice + * @dataProvider providerForBaseInitialization + */ + public function testBaseInitialization($tierPrices, $expectedValue) + { + $this->product->setData(TierPrice::PRICE_TYPE_TIER, $tierPrices); + $this->assertEquals($expectedValue, $this->model->getValue()); + } + + /** + * @return array + */ + public function providerForBaseInitialization() + { + return [ + 'case for getValue' => [ + 'tierPrices' => [ + ['website_price' => '20.', 'price_qty' => '1.', 'cust_group' => Group::CUST_GROUP_ALL], + ['website_price' => '10.', 'price_qty' => '1.', 'cust_group' => Group::CUST_GROUP_ALL], + ], + 'expectedValue' => 10. + ], + 'case for canApplyTierPrice' => [ + 'tierPrices' => [ + // tier not for current customer group + ['website_price' => '10.', 'price_qty' => '1.', 'cust_group' => $this->customerGroup + 1], + // tier is higher than product qty + ['website_price' => '10.', 'price_qty' => '10.', 'cust_group' => Group::CUST_GROUP_ALL], + // higher tier qty already found + ['website_price' => '10.', 'price_qty' => '0.5', 'cust_group' => Group::CUST_GROUP_ALL], + // found tier qty is same as current tier qty but current tier group is ALL_GROUPS + ['website_price' => '5.', 'price_qty' => '1.', 'cust_group' => $this->customerGroup], + ['website_price' => '1.', 'price_qty' => '1.', 'cust_group' => Group::CUST_GROUP_ALL], + ], + 'expectedValue' => 5. + ], + ]; + } + + /** + * Test getter stored tier prices from eav model + * + * @covers \Magento\Catalog\Pricing\Price\TierPrice::__construct + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getStoredTierPrices + */ + public function testGetterStoredTierPrices() + { + $this->product->expects($this->once())->method('hasCustomerGroupId') + ->will($this->returnValue(true)); + $this->product->expects($this->once())->method('getCustomerGroupId') + ->will($this->returnValue($this->customerGroup)); + + $backendMock = $this->getMock('Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend', [], [], '', false); + + $attributeMock = $this->getMock('Magento\Eav\Model\Entity\Attribute\AbstractAttribute', [], [], '', false); + $attributeMock->expects($this->once())->method('getBackend')->will($this->returnValue($backendMock)); + + $productResource = $this->getMock('Magento\Catalog\Model\Resource\Product', [], [], '', false); + $productResource->expects($this->once())->method('getAttribute')->with(TierPrice::PRICE_TYPE_TIER) + ->will($this->returnValue($attributeMock)); + + $this->product->expects($this->once())->method('getResource')->will($this->returnValue($productResource)); + + $tierPrice = new TierPrice($this->product, $this->quantity, $this->calculator, $this->session); + $this->assertFalse($tierPrice->getValue()); + } + + /** + * @covers \Magento\Catalog\Pricing\Price\TierPrice::__construct + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getTierPriceList + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getStoredTierPrices + * @covers \Magento\Catalog\Pricing\Price\TierPrice::applyAdjustment + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getTierPriceCount + * @covers \Magento\Catalog\Pricing\Price\TierPrice::filterTierPrices + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getBasePrice + * @dataProvider providerForGetterTierPriceList + */ + public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult) + { + $this->product->setData(TierPrice::PRICE_TYPE_TIER, $tierPrices); + + $price = $this->getMock('Magento\Pricing\Price\PriceInterface', [], [], '', false); + $price->expects($this->any())->method('getValue')->will($this->returnValue($basePrice)); + + $this->priceInfo->expects($this->atLeastOnce())->method('getPrice')->will($this->returnValue($price)); + + $this->calculator->expects($this->atLeastOnce())->method('getAmount') + ->will($this->returnArgument(0)); + + $this->assertEquals($expectedResult, $this->model->getTierPriceList()); + $this->assertEquals(count($expectedResult), $this->model->getTierPriceCount()); + } + + /** + * @return array + */ + public function providerForGetterTierPriceList() + { + return [ + 'base case' => [ + 'tierPrices' => [ + // will be ignored due to customer group + [ + 'price' => '1.3', + 'website_price' => '1.3', + 'price_qty' => '1.3', + 'cust_group' => $this->customerGroup + 1 + ], + // will be ignored due to bigger price + [ + 'price' => '50.3', + 'website_price' => '50.3', + 'price_qty' => '10.3', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '25.4', + 'website_price' => '25.4', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + // cases to calculate save percent + [ + 'price' => '15.1', + 'website_price' => '15.1', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '30.2', + 'website_price' => '30.2', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '8.3', + 'website_price' => '8.3', + 'price_qty' => '2.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + ], + 'basePrice' => 20., + 'expectedResult' => [ + [ + 'price' => '15.1', + 'website_price' => '15.1', + 'price_qty' => '5.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + [ + 'price' => '8.3', + 'website_price' => '8.3', + 'price_qty' => '2.', + 'cust_group' => Group::CUST_GROUP_ALL + ], + ] + ] + ]; + } + + /** + * @covers \Magento\Catalog\Pricing\Price\TierPrice::__construct + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getSavePercent + * @covers \Magento\Catalog\Pricing\Price\TierPrice::getBasePrice + * @dataProvider dataProviderGetSavePercent + */ + public function testGetSavePercent($basePrice, $tierPrice, $savedPercent) + { + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $price->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($basePrice)); + + $this->priceInfo->expects($this->atLeastOnce()) + ->method('getPrice') + ->will($this->returnValue($price)); + + $amount = $this->getMock('Magento\Pricing\Amount\AmountInterface'); + $amount->expects($this->atLeastOnce()) + ->method('getBaseAmount') + ->will($this->returnValue($tierPrice)); + + $this->assertEquals($savedPercent, $this->model->getSavePercent($amount)); + } + + /** + * @return array + */ + public function dataProviderGetSavePercent() + { + return array( + ['basePrice' => '100', 'tierPrice' => '90', 'savedPercent' => '10'], + ['basePrice' => '70', 'tierPrice' => '35', 'savedPercent' => '50'], + ['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30'] + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fa613a71853cd0267033c58c252c352292f44a80 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php @@ -0,0 +1,221 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Render; + +/** + * Class FinalPriceBoxTest + */ +class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Render\FinalPriceBox + */ + protected $object; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceType; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfo; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceBox; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $product; + + /** + * @var \Magento\Logger|\PHPUnit_Framework_MockObject_MockObject + */ + protected $logger; + + /** + * @var \Magento\Pricing\Render\RendererPool|\PHPUnit_Framework_MockObject_MockObject + */ + protected $rendererPool; + + /** + * @var \Magento\Pricing\Price\PriceInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $price; + + protected function setUp() + { + $this->product = $this->getMockForAbstractClass( + 'Magento\Pricing\Object\SaleableInterface', + [], + '', + true, + true, + true, + ['getPriceInfo', '__wakeup'] + ); + + $this->priceType = $this->getMockBuilder('Magento\Catalog\Pricing\Price\MsrpPrice') + ->disableOriginalConstructor() + ->setMethods(['isShowPriceOnGesture', 'getMsrpPriceMessage', 'canApplyMsrp']) + ->getMock(); + + $this->priceInfo = $this->getMockBuilder('Magento\Pricing\PriceInfo') + ->disableOriginalConstructor() + ->setMethods(['getPrice']) + ->getMock(); + + $this->product->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfo)); + + $eventManager = $this->getMock('Magento\Event\ManagerStub', [], [], '', false); + $config = $this->getMock('Magento\Store\Model\Store\Config', [], [], '', false); + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + + $this->priceBox = $this->getMock('Magento\Pricing\Render\PriceBox', [], [], '', false); + $this->logger = $this->getMock('Magento\Logger', [], [], '', false); + + + $this->layout->expects($this->any()) + ->method('getBlock') + ->will($this->returnValue($this->priceBox)); + + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + $context = $this->getMock('Magento\View\Element\Template\Context', [], [], '', false); + $context->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManager)); + $context->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($config)); + $context->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + $context->expects($this->any()) + ->method('getLogger') + ->will($this->returnValue($this->logger)); + $context->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + $this->rendererPool = $this->getMockBuilder('Magento\Pricing\Render\RendererPool') + ->disableOriginalConstructor() + ->getMock(); + + $this->price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + $this->price->expects($this->any()) + ->method('getPriceType') + ->will($this->returnValue(\Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL)); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->object = $objectManager->getObject( + 'Magento\Catalog\Pricing\Render\FinalPriceBox', + array( + 'context' => $context, + 'saleableItem' => $this->product, + 'rendererPool' => $this->rendererPool, + 'price' => $this->price + ) + ); + } + + public function testRenderMsrpDisabled() + { + $this->priceInfo->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo('msrp_price')) + ->will($this->returnValue($this->priceType)); + + $this->priceType->expects($this->any()) + ->method('canApplyMsrp') + ->with($this->equalTo($this->product)) + ->will($this->returnValue(false)); + + $result = $this->object->toHtml(); + + //assert price wrapper + $this->assertStringStartsWith('<div', $result); + //assert css_selector + $this->assertRegExp('/[final_price]/', $result); + } + + public function testRenderMsrpEnabled() + { + $this->priceInfo->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo('msrp_price')) + ->will($this->returnValue($this->priceType)); + + $this->priceType->expects($this->any()) + ->method('canApplyMsrp') + ->with($this->equalTo($this->product)) + ->will($this->returnValue(true)); + + $priceBoxRender = $this->getMockBuilder('Magento\Pricing\Render\PriceBox') + ->disableOriginalConstructor() + ->getMock(); + $priceBoxRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue('test')); + + $this->rendererPool->expects($this->once()) + ->method('createPriceRender') + ->with('msrp_price') + ->will($this->returnValue($priceBoxRender)); + + $result = $this->object->toHtml(); + + //assert price wrapper + $this->assertEquals('<div class="price-box price-final_price">test</div>', $result); + } + + public function testRenderMsrpNotRegisteredException() + { + $this->logger->expects($this->once()) + ->method('logException'); + + $this->priceInfo->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo('msrp_price')) + ->will($this->throwException(new \InvalidArgumentException())); + + $result = $this->object->toHtml(); + + //assert price wrapper + $this->assertStringStartsWith('<div', $result); + //assert css_selector + $this->assertRegExp('/[final_price]/', $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/PriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/PriceBoxTest.php new file mode 100644 index 0000000000000000000000000000000000000000..21662859a91639834b18dffa401ddd256e822708 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/PriceBoxTest.php @@ -0,0 +1,127 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing\Render; + +/** + * Class PriceBoxTest + */ +class PriceBoxTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Render\PriceBox + */ + protected $object; + + /** + * @var \Magento\Core\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $coreHelper; + + /** + * @var \Magento\Math\Random|\PHPUnit_Framework_MockObject_MockObject + */ + protected $mathRandom; + + + protected function setUp() + { + $this->coreHelper = $this->getMock('Magento\Core\Helper\Data', ['jsonEncode'], [], '', false); + $this->mathRandom = $this->getMock('Magento\Math\Random', [], [], '', false); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->object = $objectManager->getObject( + 'Magento\Catalog\Pricing\Render\PriceBox', + [ + 'coreDataHelper' => $this->coreHelper, + 'mathRandom' => $this->mathRandom, + ] + ); + } + + public function testJsonEncode() + { + $expectedValue = 'string'; + + $this->coreHelper->expects($this->once()) + ->method('jsonEncode') + ->with($this->equalTo($expectedValue)) + ->will($this->returnValue($expectedValue)); + + + $result = $this->object->jsonEncode($expectedValue); + + $this->assertEquals($expectedValue, $result); + } + + public function testGetRandomString() + { + $expectedValue = 20; + + $expectedTestValue = 'test_value'; + $this->mathRandom->expects($this->once()) + ->method('getRandomString') + ->with($this->equalTo($expectedValue)) + ->will($this->returnValue('test_value')); + + + $result = $this->object->getRandomString($expectedValue); + + $this->assertEquals($expectedTestValue, $result); + } + + /** + * test for method getCanDisplayQty + * + * @param string $typeCode + * @param bool $expected + * @dataProvider getCanDisplayQtyDataProvider + */ + public function testGetCanDisplayQty($typeCode, $expected) + { + $product = $this->getMockForAbstractClass( + 'Magento\Pricing\Object\SaleableInterface', + [], + '', + true, + true, + true, + ['getTypeId'] + ); + + $product->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($typeCode)); + + $this->assertEquals($expected, $this->object->getCanDisplayQty($product)); + } + + public function getCanDisplayQtyDataProvider() + { + return [ + 'product is not of type grouped' => ['configurable', true], + 'product is of type grouped' => ['grouped', false] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/RenderTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/RenderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c1abccd10c8c1474b27c84ccaf166ea22401657a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/RenderTest.php @@ -0,0 +1,153 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Pricing; + +/** + * Class RenderTest + */ +class RenderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Pricing\Render + */ + protected $object; + + /** + * @var \Magento\Registry|\PHPUnit_Framework_MockObject_MockObject + */ + protected $registry; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $pricingRenderBlock; + + protected function setUp() + { + $this->registry = $this->getMock('Magento\Registry', ['registry'], [], '', false); + + $this->pricingRenderBlock = $this->getMock('Magento\Pricing\Render', [], [], '', false); + + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + + $eventManager = $this->getMock('Magento\Event\ManagerStub', [], [], '', false); + $config = $this->getMock('Magento\Store\Model\Store\Config', [], [], '', false); + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + $context = $this->getMock('Magento\View\Element\Template\Context', [], [], '', false); + $context->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManager)); + $context->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($config)); + $context->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + $context->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->object = $objectManager->getObject( + 'Magento\Catalog\Pricing\Render', + [ + 'context' => $context, + 'registry' => $this->registry, + 'data' => [ + 'price_render' => 'test_price_render', + 'price_type_code' => 'test_price_type_code', + 'module_name' => 'test_module_name' + ] + ] + ); + } + + public function testToHtmlProductFromRegistry() + { + $expectedValue = 'string'; + + $product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + + $this->layout->expects($this->any()) + ->method('getBlock') + ->will($this->returnValue($this->pricingRenderBlock)); + + $this->registry->expects($this->once()) + ->method('registry') + ->with($this->equalTo('product')) + ->will($this->returnValue($product)); + + $this->pricingRenderBlock->expects($this->any()) + ->method('render') + ->with( + $this->equalTo('test_price_type_code'), + $this->equalTo($product), + $this->equalTo($this->object->getData()) + ) + ->will($this->returnValue($expectedValue)); + + $this->assertEquals($expectedValue, $this->object->toHtml()); + } + + public function testToHtmlProductFromParentBlock() + { + $expectedValue = 'string'; + + $product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + + $this->registry->expects($this->never()) + ->method('registry'); + + $block = $this->getMock('Magento\Pricing\Render', ['getProductItem', 'render'], [], '', false); + + $block->expects($this->any()) + ->method('render') + ->with( + $this->equalTo('test_price_type_code'), + $this->equalTo($product), + $this->equalTo($this->object->getData()) + ) + ->will($this->returnValue($expectedValue)); + + $block->expects($this->any()) + ->method('getProductItem') + ->will($this->returnValue($product)); + + $this->layout->expects($this->once()) + ->method('getParentName') + ->will($this->returnValue('parent_name')); + + $this->layout->expects($this->any()) + ->method('getBlock') + ->will($this->returnValue($block)); + + $this->assertEquals($expectedValue, $this->object->toHtml()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Plugin/LayerTest.php b/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Plugin/LayerTest.php index 6482ca2a4a229665f5593fd1bce6319fe222f082..73778835ea4517200ec6e6fd1eec9988c5600fbb 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Plugin/LayerTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Plugin/LayerTest.php @@ -31,7 +31,7 @@ class LayerTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfigMock; @@ -42,7 +42,7 @@ class LayerTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->_scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_stockStatusMock = $this->getMock( '\Magento\CatalogInventory\Model\Stock\Status', array(), diff --git a/dev/tests/unit/testsuite/Magento/CatalogRule/Pricing/Price/CatalogRulePriceTest.php b/dev/tests/unit/testsuite/Magento/CatalogRule/Pricing/Price/CatalogRulePriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c82fe9117269b9b85b4a80fc4a7ff32fd66b1129 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogRule/Pricing/Price/CatalogRulePriceTest.php @@ -0,0 +1,207 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_CatalogRule + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\CatalogRule\Pricing\Price; + +/** + * Class CatalogRulePriceTest + */ +class CatalogRulePriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\CatalogRule\Pricing\Price\CatalogRulePrice + */ + protected $object; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Stdlib\DateTime\TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $dataTimeMock; + + /** + * @var \Magento\Store\Model\StoreManager|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManagerMock; + + /** + * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject + */ + protected $customerSessionMock; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\CatalogRule\Model\Resource\RuleFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $catalogRuleResourceFactoryMock; + + /** + * @var \Magento\CatalogRule\Model\Resource\Rule|\PHPUnit_Framework_MockObject_MockObject + */ + protected $catalogRuleResourceMock; + + /** + * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject + */ + protected $coreWebsiteMock; + + /** + * @var \Magento\Store\Model\Website|\PHPUnit_Framework_MockObject_MockObject + */ + protected $coreStoreMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculator; + + /** + * Set up + */ + public function setUp() + { + $this->salableItemMock = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getId', '__wakeup', 'getPriceInfo'], + [], + '', + false + ); + $this->dataTimeMock = $this->getMockForAbstractClass( + 'Magento\Stdlib\DateTime\TimezoneInterface', + [], + '', + false, + true, + true, + [] + ); + + $this->coreStoreMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($this->coreStoreMock)); + + $this->customerSessionMock = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); + $this->priceInfoMock = $this->getMock('\Magento\Pricing\PriceInfo', ['getAdjustments'], [], '', false); + $this->catalogRuleResourceFactoryMock = $this->getMock( + '\Magento\CatalogRule\Model\Resource\RuleFactory', + ['create'], + [], + '', + false + ); + $this->catalogRuleResourceMock = $this->getMock( + '\Magento\CatalogRule\Model\Resource\Rule', + [], + [], + '', + false + ); + + $this->coreWebsiteMock = $this->getMock('\Magento\Core\Model\Website', [], [], '', false); + + $this->priceInfoMock->expects($this->any()) + ->method('getAdjustments') + ->will($this->returnValue([])); + $this->salableItemMock->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + + $this->catalogRuleResourceFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->catalogRuleResourceMock)); + + $this->calculator = $this->getMockBuilder('Magento\Pricing\Adjustment\Calculator') + ->disableOriginalConstructor() + ->getMock(); + $qty = 1; + $this->object = new CatalogRulePrice( + $this->salableItemMock, + $qty, + $this->calculator, + $this->dataTimeMock, + $this->storeManagerMock, + $this->customerSessionMock, + $this->catalogRuleResourceFactoryMock + ); + } + + /** + * Test get Value + */ + public function testGetValue() + { + $coreStoreId = 1; + $coreWebsiteId = 1; + $productId = 1; + $customerGroupId = 1; + $dateTime = time(); + + $expectedValue = 55.12; + + $this->coreStoreMock->expects($this->once()) + ->method('getId') + ->will($this->returnValue($coreStoreId)); + $this->coreStoreMock->expects($this->once()) + ->method('getWebsiteId') + ->will($this->returnValue($coreWebsiteId)); + $this->dataTimeMock->expects($this->once()) + ->method('scopeTimeStamp') + ->with($this->equalTo($coreStoreId)) + ->will($this->returnValue($dateTime)); + $this->customerSessionMock->expects($this->once()) + ->method('getCustomerGroupId') + ->will($this->returnValue($customerGroupId)); + $this->catalogRuleResourceMock->expects($this->once()) + ->method('getRulePrice') + ->will($this->returnValue($expectedValue)); + $this->salableItemMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue($productId)); + + $this->assertEquals($expectedValue, $this->object->getValue()); + } + + public function testGetAmountNoBaseAmount() + { + $this->catalogRuleResourceMock->expects($this->once()) + ->method('getRulePrice') + ->will($this->returnValue(false)); + + $result = $this->object->getValue(); + $this->assertFalse($result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/PluginTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/PluginTest.php index 9d861a57fe15d44c038f4dc25b0052c87d3100a3..cdb3b036385523296e5e98c5699fb645a49d4b98 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/PluginTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Search/AvailabilityFlag/PluginTest.php @@ -65,7 +65,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase { $this->subjectMock = $this->getMock('Magento\Catalog\Model\Layer\AvailabilityFlagInterface'); $this->layerMock = $this->getMock('\Magento\Catalog\Model\Layer', array(), array(), '', false); - $this->scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->engineMock = $this->getMock('\Magento\CatalogSearch\Model\Resource\EngineInterface'); $this->collectionMock = $this->getMock( '\Magento\Catalog\Model\Resource\Product\Collection', array(), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php index fb6f35964303e8b9a70fc486abfd56f277d194bb..dee39df7ee9429a99015f21fc504a0ece8573e0b 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php @@ -39,7 +39,7 @@ class EngineProviderTest extends \PHPUnit_Framework_TestCase protected $_engineFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfigMock; @@ -52,7 +52,7 @@ class EngineProviderTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\CatalogSearch\Model\Resource\EngineProvider( $this->_engineFactoryMock, diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Controller/CartTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Controller/CartTest.php index bc1a67104c8bd7a0a736b318c0a89f950bec4683..036d0f703ddb03c549668673e7aa40e1a3730896 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Controller/CartTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Controller/CartTest.php @@ -41,10 +41,10 @@ class CartTest extends \PHPUnit_Framework_TestCase $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $responseMock->headersSentThrowsException = false; - $requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $requestMock->expects($this->any())->method('getActionName')->will($this->returnValue('add')); $requestMock->expects( $this->at(0) @@ -56,7 +56,7 @@ class CartTest extends \PHPUnit_Framework_TestCase $this->returnValue('http://malicious.com/') ); $requestMock->expects($this->any())->method('getParam')->will($this->returnValue(null)); - $redirect = $this->getMock('Magento\App\Response\RedirectInterface'); + $redirect = $this->getMock('Magento\Framework\App\Response\RedirectInterface'); $redirect->expects( $this->any() )->method( @@ -93,7 +93,7 @@ class CartTest extends \PHPUnit_Framework_TestCase $storeMock = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); $storeMock->expects($this->any())->method('getBaseUrl')->will($this->returnValue('http://some-url/')); - $configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $configMock->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php index 39357af04e2983e342c6ce8edcfd7d5eb84df9ab..4f61be0d65fb49f8175d9f30d86ab0d1b1bdbb6f 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php @@ -43,9 +43,9 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_translator = $this->getMock('Magento\Translate\Inline\StateInterface', array(), array(), '', false); - $context = $this->getMock('\Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('\Magento\Framework\App\Helper\Context', array(), array(), '', false); - $scopeConfig = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $scopeConfig->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Helper/ExpressRedirectTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Helper/ExpressRedirectTest.php index 276b82ee305e824f604a532705914102f90b1418..6f5ebc69414cdf648b01e7115b06ef8f310d19dc 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Helper/ExpressRedirectTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Helper/ExpressRedirectTest.php @@ -55,7 +55,7 @@ class ExpressRedirectTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_actionFlag = $this->getMockBuilder( - 'Magento\App\ActionFlag' + 'Magento\Framework\App\ActionFlag' )->disableOriginalConstructor()->setMethods( array('set') )->getMock(); @@ -72,7 +72,9 @@ class ExpressRedirectTest extends \PHPUnit_Framework_TestCase array('setBeforeAuthUrl') )->getMock(); - $this->_context = $this->getMockBuilder('Magento\App\Helper\Context')->disableOriginalConstructor()->getMock(); + $this->_context = $this->getMockBuilder('Magento\Framework\App\Helper\Context') + ->disableOriginalConstructor() + ->getMock(); $this->_helper = new \Magento\Checkout\Helper\ExpressRedirect( $this->_actionFlag, @@ -152,7 +154,7 @@ class ExpressRedirectTest extends \PHPUnit_Framework_TestCase ); $responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->setMethods( array('setRedirect') )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Model/Layout/DepersonalizePluginTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Model/Layout/DepersonalizePluginTest.php index ea6af0b662cb742223fd3cf4f063d542f54b6d31..d53c427e018cd6bacab6eeda557d8ccf787390c2 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Model/Layout/DepersonalizePluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Model/Layout/DepersonalizePluginTest.php @@ -47,7 +47,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase protected $checkoutSessionMock; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -80,7 +80,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->moduleManagerMock = $this->getMock('Magento\Module\Manager', array(), array(), '', false); $this->cacheConfigMock = $this->getMock('Magento\PageCache\Model\Config', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Model/SessionTest.php index ba55fcaadb02b83bc9b27318760caee928984da7..87ac519884e798167626b7647c005aa896738c9a 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Model/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Model/SessionTest.php @@ -61,10 +61,10 @@ class SessionTest extends \PHPUnit_Framework_TestCase 'Magento\Sales\Model\QuoteFactory' )->disableOriginalConstructor()->getMock(); - $appState = $this->getMock('\Magento\App\State', array(), array(), '', false); + $appState = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $appState->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); - $request = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects($this->any())->method('getHttpHost')->will($this->returnValue(array())); $constructArguments = $this->_helper->getConstructArguments( diff --git a/dev/tests/unit/testsuite/Magento/Cms/Controller/NorouteTest.php b/dev/tests/unit/testsuite/Magento/Cms/Controller/NorouteTest.php index 3581740316e46e53c13acf0893b949d1fe7d101a..bdf0d5fe9335db355423aa90c55d425f580e979b 100644 --- a/dev/tests/unit/testsuite/Magento/Cms/Controller/NorouteTest.php +++ b/dev/tests/unit/testsuite/Magento/Cms/Controller/NorouteTest.php @@ -44,7 +44,7 @@ class NorouteTest extends \PHPUnit_Framework_TestCase { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $objectManagerMock = $this->getMock('Magento\ObjectManager'); - $responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $responseMock->expects( $this->at(0) )->method( @@ -66,12 +66,12 @@ class NorouteTest extends \PHPUnit_Framework_TestCase $this->returnValue($responseMock) ); - $scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_cmsHelperMock = $this->getMock('Magento\Cms\Helper\Page', array(), array(), '', false); $valueMap = array( array( - 'Magento\App\Config\ScopeConfigInterface', + 'Magento\Framework\App\Config\ScopeConfigInterface', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $scopeConfigMock ), diff --git a/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php index accf4d9860dcf9db6d2156e2524e5ac4913ea2dd..944c6e4c370d6e76b644e6cd06dec293d023457e 100644 --- a/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -116,7 +116,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_driverMock = $this->getMockForAbstractClass( 'Magento\Filesystem\DriverInterface', array(), @@ -144,7 +144,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase ); $this->_filesystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', @@ -155,7 +155,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue($this->_directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Code/GeneratorTest.php b/dev/tests/unit/testsuite/Magento/Code/GeneratorTest.php index 7ac7a51e07839a558749bfb2efad67d2bb1367cf..f872146c5b48b46856a4494983b56ded5103cb40 100644 --- a/dev/tests/unit/testsuite/Magento/Code/GeneratorTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/GeneratorTest.php @@ -62,7 +62,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase protected $_ioObjectMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Filesystem + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Filesystem */ protected $_filesystemMock; diff --git a/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/GenerateTest.php b/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/GenerateTest.php index 9eb75b929e395ef428ba1eb0761cd9bf59414017..9ccbd332cc20fec63db0c54ff5bf55be07e9bbcb 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/GenerateTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/GenerateTest.php @@ -23,7 +23,7 @@ */ namespace Magento\Code\Minifier\Strategy; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\Write; use Magento\Filesystem\Directory\Read; @@ -57,7 +57,7 @@ class GenerateTest extends \PHPUnit_Framework_TestCase $this->rootDirectory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $this->pubViewCacheDir = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', 'getDirectoryRead', '__wakeup'), array(), '', @@ -68,7 +68,7 @@ class GenerateTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($this->rootDirectory) ); @@ -77,7 +77,7 @@ class GenerateTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->will( $this->returnValue($this->pubViewCacheDir) ); diff --git a/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/LiteTest.php b/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/LiteTest.php index a3faee72a37e0f9e31bcae0725056e55cb10ac15..8f17be11d50f42cbc94bef8f259f9b086d6f32b6 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/LiteTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/Minifier/Strategy/LiteTest.php @@ -23,7 +23,7 @@ */ namespace Magento\Code\Minifier\Strategy; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\Read; use Magento\Filesystem\Directory\Write; @@ -57,7 +57,7 @@ class LiteTest extends \PHPUnit_Framework_TestCase $this->rootDirectory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $this->pubViewCacheDir = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', 'getDirectoryRead', '__wakeup'), array(), '', @@ -68,7 +68,7 @@ class LiteTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($this->rootDirectory) ); @@ -77,7 +77,7 @@ class LiteTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->will( $this->returnValue($this->pubViewCacheDir) ); diff --git a/dev/tests/unit/testsuite/Magento/Code/MinifierTest.php b/dev/tests/unit/testsuite/Magento/Code/MinifierTest.php index 9a732d96ba54b63e8cf2dc42cc44e7f5604e0612..af6a0923c4b4e49897e7d84b7971b57dbf4fbdaa 100644 --- a/dev/tests/unit/testsuite/Magento/Code/MinifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/MinifierTest.php @@ -31,7 +31,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase protected $strategy; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; @@ -62,7 +62,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase { $this->strategy = $this->getMockForAbstractClass('Magento\Code\Minifier\StrategyInterface'); $this->filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', @@ -87,7 +87,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($this->rootDirectory) ); @@ -96,7 +96,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->will( $this->returnValue($this->pubViewCacheDir) ); diff --git a/dev/tests/unit/testsuite/Magento/Code/Model/File/Validator/NotProtectedExtensionTest.php b/dev/tests/unit/testsuite/Magento/Code/Model/File/Validator/NotProtectedExtensionTest.php index e64893328e33353c54287adc69d6ddd685c663ca..98c395a4972c08406a6e5000d6cdcbafe7d67a65 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Model/File/Validator/NotProtectedExtensionTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/Model/File/Validator/NotProtectedExtensionTest.php @@ -31,7 +31,7 @@ class NotProtectedExtensionTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfig; @@ -42,7 +42,7 @@ class NotProtectedExtensionTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_scopeConfig = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_scopeConfig->expects( $this->atLeastOnce() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Config/FileIteratorTest.php b/dev/tests/unit/testsuite/Magento/Config/FileIteratorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1e4d9e3ba28e36dbeceeef40fb2bf3fabbfba2d9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Config/FileIteratorTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Config; + +/** + * Class FileIteratorTest + * @package Magento\Config + */ +class FileIteratorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var FileIterator + */ + protected $fileIterator; + + /** + * @var \Magento\Filesystem\Directory\Read | \PHPUnit_Framework_MockObject_MockObject + */ + protected $directoryMock; + + /** + * Array of relative file paths + * + * @var array + */ + protected $filePaths; + + protected function setUp() + { + $this->filePaths = ['/file1', '/file2']; + $this->directoryMock = $this->getMock('Magento\Filesystem\Directory\Read', [], [], '', false); + + $this->fileIterator = new FileIterator( + $this->directoryMock, + $this->filePaths + ); + } + + protected function tearDown() + { + $this->fileIterator = null; + $this->directoryMock = null; + $this->filePaths = null; + } + + public function testIterator() + { + $contents = ['content1', 'content2']; + $index = 0; + foreach ($this->filePaths as $filePath) { + $this->directoryMock->expects($this->at($index)) + ->method('readFile') + ->with($filePath) + ->will($this->returnValue($contents[$index++])); + } + $index = 0; + foreach ($this->fileIterator as $fileContent) { + $this->assertEquals($contents[$index++], $fileContent); + } + } + + public function testToArray() + { + $contents = ['content1', 'content2']; + $expectedArray = []; + $index = 0; + foreach ($this->filePaths as $filePath) { + $expectedArray[$filePath] = $contents[$index]; + $this->directoryMock->expects($this->at($index)) + ->method('readFile') + ->with($filePath) + ->will($this->returnValue($contents[$index++])); + } + $this->assertEquals($expectedArray, $this->fileIterator->toArray()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Config/ScopeTest.php b/dev/tests/unit/testsuite/Magento/Config/ScopeTest.php index 70db7e09076b3e204a92096868f4040f35c35d6e..ef819f0fe5f147c71f95c6d557d9be8d1e22f124 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ScopeTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ScopeTest.php @@ -32,13 +32,13 @@ class ScopeTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\AreaList + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\AreaList */ protected $areaListMock; protected function setUp() { - $this->areaListMock = $this->getMock('Magento\App\AreaList', array('getCodes'), array(), '', false); + $this->areaListMock = $this->getMock('Magento\Framework\App\AreaList', array('getCodes'), array(), '', false); $this->model = new Scope($this->areaListMock); } diff --git a/dev/tests/unit/testsuite/Magento/Config/ValidationStateTest.php b/dev/tests/unit/testsuite/Magento/Config/ValidationStateTest.php index 5cb1b1306eb251cf2188ea38faf3c2f3c3fe5c4d..ec5dd05a2558ede51488a0f777d7dc6f914fb8fa 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ValidationStateTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ValidationStateTest.php @@ -32,7 +32,7 @@ class ValidationStateTest extends \PHPUnit_Framework_TestCase */ public function testIsValidated($appMode, $expectedResult) { - $model = new \Magento\App\Arguments\ValidationState($appMode); + $model = new \Magento\Framework\App\Arguments\ValidationState($appMode); $this->assertEquals($model->isValidated(), $expectedResult); } @@ -42,9 +42,9 @@ class ValidationStateTest extends \PHPUnit_Framework_TestCase public function isValidatedDataProvider() { return array( - array(\Magento\App\State::MODE_DEVELOPER, true), - array(\Magento\App\State::MODE_DEFAULT, false), - array(\Magento\App\State::MODE_PRODUCTION, false) + array(\Magento\Framework\App\State::MODE_DEVELOPER, true), + array(\Magento\Framework\App\State::MODE_DEFAULT, false), + array(\Magento\Framework\App\State::MODE_PRODUCTION, false) ); } } diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php index a449d74f609beda6af77eb2872ffbe05fb9f2ad9..5ad09d91df2215db95d6d01d02d900207f6404c6 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php @@ -40,7 +40,7 @@ class MatrixTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_appConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_appConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $context = $objectHelper->getObject( 'Magento\Backend\Block\Template\Context', diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php index 2ad76bf2b5f264bd9f3d647464de210df494936b..56f5064026467ff29590b7a8928f0071b7b92ec6 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php @@ -34,7 +34,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Catalog\Helper\Image|\PHPUnit_Framework_MockObject_MockObject */ protected $_imageHelper; - /** @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfig; /** @var \PHPUnit_Framework_MockObject_MockObject */ @@ -55,7 +55,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->productConfigMock = $this->getMock( 'Magento\Catalog\Helper\Product\Configuration', array(), diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/SuggestConfigurableAttributesTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/SuggestConfigurableAttributesTest.php index 3a2bbefc900609930734df34894ae1ee9825bbdc..f32303c1d8f11c939bb6cbd26963654b21c48231 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/SuggestConfigurableAttributesTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/SuggestConfigurableAttributesTest.php @@ -53,8 +53,8 @@ class SuggestConfigurableAttributesTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->helperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->attributeListMock = $this->getMock( 'Magento\ConfigurableProduct\Model\SuggestedAttributeList', diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/PluginTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/PluginTest.php index 467125c6c89596821d2032d2737fbcbb0920eaf3..dd126ba9f5b26259f450d4b671e834d2ac18155a 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/PluginTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Builder/PluginTest.php @@ -85,7 +85,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $methods = array('setTypeId', 'getAttributes', 'addData', 'setWebsiteIds', '__wakeup'); $this->productMock = $this->getMock('Magento\Catalog\Model\Product', $methods, array(), '', false); $product = $this->productMock; diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php index 030206c01912bbaa394acb6bbb236911ce478ff5..c748fc5dc26a5cf51286a1e2f024d631a183fe52 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php @@ -59,7 +59,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $methods = array( 'setNewVariationsAttributeSetId', 'setAssociatedProductIds', diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php index 5c35b20cee741d6ca455f00766df9179bbd5b779..a7deb1b8c1f715e4ee9e3554d5f9ea569d099eb8 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php @@ -46,7 +46,9 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $coreDataMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $fileStorageDbMock = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/ConfigurableTest.php index 7c713d40ba92b9f0ea32ba9f4a39e94cb86e1f57..5a75d545c981574612bbc3010b702ac4585e8204 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/ConfigurableTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/TypeTransitionManager/Plugin/ConfigurableTest.php @@ -52,7 +52,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->model = new Configurable($this->requestMock); $this->productMock = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Validator/PluginTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Validator/PluginTest.php index c4da48ebbefcb707165b61ca059d8c42740e9103..ddd3ae77fcc9d2eec746d62681d167434e610701 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Validator/PluginTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Validator/PluginTest.php @@ -93,7 +93,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase $this->coreHelperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->productMock = $this->getMock('Magento\Catalog\Model\Product', array(), array(), '', false); $this->requestMock = $this->getMock( - 'Magento\App\Request\Http', + 'Magento\Framework\App\Request\Http', array('getPost', 'getParam', '__wakeup'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php b/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php index ac21a76508106486ee8c9e6763e4902327c0fabe..ed9b43d4523bfd76c46a8997816330314837eb59 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php @@ -43,7 +43,7 @@ class FormKeyValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_formKeyMock = $this->getMock('\Magento\Data\Form\FormKey', array('getFormKey'), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_model = new \Magento\Core\App\Action\FormKeyValidator($this->_formKeyMock); } diff --git a/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/DesignTest.php b/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/DesignTest.php index b6769aa4b68d22d5f5e58de0aec8836520ab2b1d..da1a875322fb2b952c47ec12266ed74b046b25a4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/DesignTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/DesignTest.php @@ -27,12 +27,12 @@ class DesignTest extends \PHPUnit_Framework_TestCase { public function testAroundDispatch() { - $subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $designLoaderMock = $this->getMock('Magento\View\DesignLoader', array(), array(), '', false); $closureMock = function () { return 'Expected'; }; - $requestMock = $this->getMock('Magento\App\RequestInterface'); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $plugin = new \Magento\Core\App\Action\Plugin\Design($designLoaderMock); $designLoaderMock->expects($this->once())->method('load'); $this->assertEquals('Expected', $plugin->aroundDispatch($subjectMock, $closureMock, $requestMock)); diff --git a/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/LastUrlTest.php b/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/LastUrlTest.php index fa26c4e484be80ac102a7b6750602722dd6260da..8c52c6e8ffa661cf556ebc46511578d01965c720 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/LastUrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/Action/Plugin/LastUrlTest.php @@ -28,11 +28,11 @@ class LastUrlTest extends \PHPUnit_Framework_TestCase public function testAfterDispatch() { $session = $this->getMock('\Magento\Session\Generic', array('setLastUrl'), array(), '', false); - $subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $closureMock = function () { return 'result'; }; - $requestMock = $this->getMock('Magento\App\RequestInterface'); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $url = $this->getMock('\Magento\Url', array(), array(), '', false); $plugin = new \Magento\Core\App\Action\Plugin\LastUrl($session, $url); $session->expects($this->once())->method('setLastUrl')->with('http://example.com'); diff --git a/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/InstallTest.php b/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/InstallTest.php index a35c7d1cd75dc2d0175d9fb3a40669294dce2f29..2b27d06e1d0652067c192b7f404dc121227601c8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/InstallTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/InstallTest.php @@ -62,14 +62,14 @@ class InstallTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_appStateMock = $this->getMock('\Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $this->_cacheMock = $this->getMock('\Magento\Cache\FrontendInterface'); $this->_dbUpdaterMock = $this->getMock('\Magento\Module\UpdaterInterface'); $this->closureMock = function () { return 'Expected'; }; - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); - $this->subjectMock = $this->getMock('Magento\App\FrontController', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); + $this->subjectMock = $this->getMock('Magento\Framework\App\FrontController', array(), array(), '', false); $this->_model = new \Magento\Module\FrontController\Plugin\Install( $this->_appStateMock, $this->_cacheMock, diff --git a/dev/tests/unit/testsuite/Magento/Core/App/MediaTest.php b/dev/tests/unit/testsuite/Magento/Core/App/MediaTest.php index 552c84241bc7170fa6e409afb64eb89159730be8..8c64d3a680d6ff6e54b17267da8363e3708267cb 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/MediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/MediaTest.php @@ -76,7 +76,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase protected $_responseMock; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; @@ -92,18 +92,18 @@ class MediaTest extends \PHPUnit_Framework_TestCase return true; }; $this->_objectManagerMock = $this->getMock('Magento\ObjectManager'); - $this->_appState = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_configMock = $this->getMock('Magento\Core\Model\File\Storage\Config', array(), array(), '', false); $this->_sync = $this->getMock('Magento\Core\Model\File\Storage\Synchronization', array(), array(), '', false); $this->_dirVerificationMock = $this->getMock( - 'Magento\App\Filesystem\DirectoryList\Verification', + 'Magento\Framework\App\Filesystem\DirectoryList\Verification', array(), array(), '', false ); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->directoryReadMock = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $this->filesystemMock->expects( @@ -111,7 +111,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue($this->directoryReadMock) ); @@ -119,8 +119,8 @@ class MediaTest extends \PHPUnit_Framework_TestCase $this->_responseMock = $this->getMock('Magento\Core\Model\File\Storage\Response', array(), array(), '', false); $map = array( - array('Magento\App\Filesystem\DirectoryList\Verification', $this->_dirVerificationMock), - array('Magento\App\State', $this->_appState), + array('Magento\Framework\App\Filesystem\DirectoryList\Verification', $this->_dirVerificationMock), + array('Magento\Framework\App\State', $this->_appState), array('Magento\Core\Model\File\Storage\Request', $this->_requestMock), array('Magento\Core\Model\File\Storage\Synchronization', $this->_sync) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Controller/NorouteTest.php b/dev/tests/unit/testsuite/Magento/Core/Controller/NorouteTest.php index 2804961eee4b0ec13b07fec2f76cea77e85337ab..07e9f73633e36eb17239e78344c6f2ec51dcdc3e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Controller/NorouteTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Controller/NorouteTest.php @@ -48,8 +48,8 @@ class NorouteTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_viewMock = $this->getMock('\Magento\App\ViewInterface'); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_viewMock = $this->getMock('\Magento\Framework\App\ViewInterface'); $this->_statusMock = $this->getMock('Magento\Object', array('getLoaded'), array(), '', false); $this->_controller = $helper->getObject( 'Magento\Core\Controller\Noroute', diff --git a/dev/tests/unit/testsuite/Magento/Core/Controller/Request/HttpTest.php b/dev/tests/unit/testsuite/Magento/Core/Controller/Request/HttpTest.php index b1bd78913061997e8e7916a215a2530b93ccd925..51f691cc3fd039fa134345eabc10fdfb4877c045 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Controller/Request/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Controller/Request/HttpTest.php @@ -25,7 +25,7 @@ namespace Magento\Core\Controller\Request; class HttpTest extends \PHPUnit_Framework_TestCase { - /** @var \Magento\App\RequestInterface */ + /** @var \Magento\Framework\App\RequestInterface */ protected $_model; /** @@ -35,10 +35,10 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_routerListMock = $this->getMock('\Magento\App\Route\ConfigInterface'); - $infoProcessorMock = $this->getMock('Magento\App\Request\PathInfoProcessorInterface'); + $this->_routerListMock = $this->getMock('\Magento\Framework\App\Route\ConfigInterface'); + $infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); - $this->_model = new \Magento\App\Request\Http($this->_routerListMock, $infoProcessorMock); + $this->_model = new \Magento\Framework\App\Request\Http($this->_routerListMock, $infoProcessorMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/Core/Controller/Response/HttpTest.php b/dev/tests/unit/testsuite/Magento/Core/Controller/Response/HttpTest.php index 1c5822f753a73f86f81c4566d1cef135385ad738..5194bcb1e56171ede27f11a00408fa1cbd6fd072 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Controller/Response/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Controller/Response/HttpTest.php @@ -26,7 +26,7 @@ */ /** - * Test class for \Magento\App\ResponseInterface + * Test class for \Magento\Framework\App\ResponseInterface */ namespace Magento\Core\Controller\Response; @@ -36,14 +36,14 @@ class HttpTest extends \PHPUnit_Framework_TestCase * Test for getHeader method * * @dataProvider headersDataProvider - * @covers \Magento\App\Response\Http::getHeader + * @covers \Magento\Framework\App\Response\Http::getHeader * @param string $header */ public function testGetHeaderExists($header) { $cookieMock = $this->getMock('\Magento\Stdlib\Cookie', array(), array(), '', false); - $contextMock = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); - $response = new \Magento\App\Response\Http($cookieMock, $contextMock); + $contextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); + $response = new \Magento\Framework\App\Response\Http($cookieMock, $contextMock); $response->headersSentThrowsException = false; $response->setHeader($header['name'], $header['value'], $header['replace']); $this->assertEquals($header, $response->getHeader($header['name'])); @@ -65,13 +65,13 @@ class HttpTest extends \PHPUnit_Framework_TestCase /** * Test for getHeader method. Validation for attempt to get not existing header * - * @covers \Magento\App\Response\Http::getHeader + * @covers \Magento\Framework\App\Response\Http::getHeader */ public function testGetHeaderNotExists() { $cookieMock = $this->getMock('\Magento\Stdlib\Cookie', array(), array(), '', false); - $contextMock = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); - $response = new \Magento\App\Response\Http($cookieMock, $contextMock); + $contextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); + $response = new \Magento\Framework\App\Response\Http($cookieMock, $contextMock); $response->headersSentThrowsException = false; $response->setHeader('Name', 'value', true); $this->assertFalse($response->getHeader('Wrong name')); diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/DataTest.php new file mode 100644 index 0000000000000000000000000000000000000000..84a8237fed5c5e8caa173969c5ad2a0c45a08e69 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/DataTest.php @@ -0,0 +1,145 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Helper; + +use Magento\Pricing\PriceCurrencyInterface; + +class DataTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Data + */ + protected $model; + + /** + * @var \Magento\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceCurrency; + + public function setUp() + { + $this->priceCurrency = $this->getMock('Magento\Pricing\PriceCurrencyInterface'); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject('Magento\Core\Helper\Data', array( + 'priceCurrency' => $this->priceCurrency + )); + } + + /** + * @param string $amount + * @param bool $format + * @param bool $includeContainer + * @param string $result + * @dataProvider currencyDataProvider + */ + public function testCurrency($amount, $format, $includeContainer, $result) + { + if ($format) { + $this->priceCurrency->expects($this->once()) + ->method('convertAndFormat') + ->with($amount, $includeContainer) + ->will($this->returnValue($result)); + } else { + $this->priceCurrency->expects($this->once()) + ->method('convert') + ->with($amount) + ->will($this->returnValue($result)); + } + $this->assertEquals($result, $this->model->currency($amount, $format, $includeContainer)); + } + + public function currencyDataProvider() + { + return array( + array('amount' => '100', 'format' => true, 'includeContainer' => true, 'result' => '100grn.'), + array('amount' => '115', 'format' => true, 'includeContainer' => false, 'result' => '1150'), + array('amount' => '120', 'format' => false, 'includeContainer' => null, 'result' => '1200'), + ); + } + + /** + * @param string $amount + * @param string $store + * @param bool $format + * @param bool $includeContainer + * @param string $result + * @dataProvider currencyByStoreDataProvider + */ + public function testCurrencyByStore($amount, $store, $format, $includeContainer, $result) + { + if ($format) { + $this->priceCurrency->expects($this->once()) + ->method('convertAndFormat') + ->with($amount, $includeContainer, PriceCurrencyInterface::DEFAULT_PRECISION, $store) + ->will($this->returnValue($result)); + } else { + $this->priceCurrency->expects($this->once()) + ->method('convert') + ->with($amount, $store) + ->will($this->returnValue($result)); + } + $this->assertEquals($result, $this->model->currencyByStore($amount, $store, $format, $includeContainer)); + } + + public function currencyByStoreDataProvider() + { + return array( + array('amount' => '10', 'store' => 1, 'format' => true, 'includeContainer' => true, 'result' => '10grn.'), + array('amount' => '115', 'store' => 4, 'format' => true, 'includeContainer' => false, 'result' => '1150'), + array('amount' => '120', 'store' => 5, 'format' => false, 'includeContainer' => null, 'result' => '1200'), + ); + } + + public function testFormatCurrency() + { + $amount = '120'; + $includeContainer = false; + $result = '10grn.'; + + $this->priceCurrency->expects($this->once()) + ->method('convertAndFormat') + ->with($amount, $includeContainer) + ->will($this->returnValue($result)); + + $this->assertEquals($result, $this->model->formatCurrency($amount, $includeContainer)); + } + + public function testFormatPrice() + { + $amount = '120'; + $includeContainer = false; + $result = '10grn.'; + + $this->priceCurrency->expects($this->once()) + ->method('format') + ->with($amount, $includeContainer) + ->will($this->returnValue($result)); + + $this->assertEquals($result, $this->model->formatPrice($amount, $includeContainer)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/PostDataTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/PostDataTest.php index fc6576514e32370c2930de7aa3f47adafc5b33fd..71ef7cbfe242d774cf60efae51342984dc005bdf 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/PostDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/PostDataTest.php @@ -36,12 +36,18 @@ class PostDataTest extends \PHPUnit_Framework_TestCase 'action' => $url, 'data' => [ 'product' => new \Magento\Object(['id' => 1]), - \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => + \Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED => strtr(base64_encode($url . 'for_uenc'), '+/=', '-_,') ] ]); - $contextMock = $this->getMock('Magento\App\Helper\Context', array('getUrlBuilder'), array(), '', false); + $contextMock = $this->getMock( + 'Magento\Framework\App\Helper\Context', + array('getUrlBuilder'), + array(), + '', + false + ); $urlBuilderMock = $this->getMockForAbstractClass( 'Magento\UrlInterface', array(), diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php index 0696d042a8c9136ea6ac57fb717c2770e890becc..935c83073f7af4f74c7707546eba4fc38d9fae59 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php @@ -86,8 +86,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase $themeCollection = $this->getMock('Magento\Core\Model\Resource\Theme\Collection', array(), array(), '', false); // 6. - /** @var $context \Magento\App\Helper\Context */ - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + /** @var $context \Magento\Framework\App\Helper\Context */ + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); // 7. Get view file system model mock $params = array('area' => $themeArea, 'themeModel' => $theme, 'skipProxy' => true); @@ -465,13 +465,13 @@ class ThemeTest extends \PHPUnit_Framework_TestCase } /** - * @return \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @return \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected function _getFilesystem() { - /** @var $filesystem \Magento\App\Filesystem */ + /** @var $filesystem \Magento\Framework\App\Filesystem */ $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getPath', '__wakeup', 'getDirectoryRead'), array(), '', @@ -484,11 +484,11 @@ class ThemeTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValueMap( array( - array(\Magento\App\Filesystem::ROOT_DIR, self::ROOT_DIR), - array(\Magento\App\Filesystem::APP_DIR, self::APP_DIR), - array(\Magento\App\Filesystem::MODULES_DIR, self::MODULES_DIR), - array(\Magento\App\Filesystem::THEMES_DIR, self::THEMES_DIR), - array(\Magento\App\Filesystem::PUB_LIB_DIR, self::PUB_LIB_DIR) + array(\Magento\Framework\App\Filesystem::ROOT_DIR, self::ROOT_DIR), + array(\Magento\Framework\App\Filesystem::APP_DIR, self::APP_DIR), + array(\Magento\Framework\App\Filesystem::MODULES_DIR, self::MODULES_DIR), + array(\Magento\Framework\App\Filesystem::THEMES_DIR, self::THEMES_DIR), + array(\Magento\Framework\App\Filesystem::PUB_LIB_DIR, self::PUB_LIB_DIR) ) ) ); @@ -554,8 +554,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase false ); - /** @var $context \Magento\App\Helper\Context */ - $context = $this->getMock('Magento\App\Helper\Context', null, array(), '', false); + /** @var $context \Magento\Framework\App\Helper\Context */ + $context = $this->getMock('Magento\Framework\App\Helper\Context', null, array(), '', false); /** @var $fileSystem \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ $fileSystem = $this->getMockBuilder( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/App/Action/ContextPluginTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/App/Action/ContextPluginTest.php index e2dda2bd2ce308fae8c702a3e35638f68e57b40c..2ae2d9cceba520821395991f79717fc018a88c3f 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/App/Action/ContextPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/App/Action/ContextPluginTest.php @@ -43,12 +43,12 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase protected $sessionMock; /** - * @var \Magento\App\Http\Context $httpContext|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Http\Context $httpContext|\PHPUnit_Framework_MockObject_MockObject */ protected $httpContextMock; /** - * @var \Magento\App\Request\Http $httpRequest|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http $httpRequest|\PHPUnit_Framework_MockObject_MockObject */ protected $httpRequestMock; @@ -94,9 +94,9 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase { $this->sessionMock = $this->getMock('Magento\Session\Generic', array('getCurrencyCode'), array(), '', false); - $this->httpContextMock = $this->getMock('Magento\App\Http\Context', + $this->httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); - $this->httpRequestMock = $this->getMock('Magento\App\Request\Http', + $this->httpRequestMock = $this->getMock('Magento\Framework\App\Request\Http', array('getCookie', 'getParam'), array(), '', false); $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', array('getWebsite', '__wakeup'), array(), '', false); @@ -109,8 +109,8 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase $this->closureMock = function () { return 'ExpectedValue'; }; - $this->subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->plugin = new \Magento\Core\Model\App\Action\ContextPlugin( $this->sessionMock, $this->httpContextMock, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/App/Area/CacheIdentifierPluginTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/App/Area/CacheIdentifierPluginTest.php index d8b4ebac1cf790e3e12dab18ffbd8f96c7c1785a..dc3bad17d0782e136594f001e4af78999d9bd747 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/App/Area/CacheIdentifierPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/App/Area/CacheIdentifierPluginTest.php @@ -42,7 +42,7 @@ class CacheIdentifierPluginTest extends \PHPUnit_Framework_TestCase protected $designExceptionsMock; /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $requestMock; @@ -63,7 +63,7 @@ class CacheIdentifierPluginTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', [], [], '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->pageCacheConfigMock = $this->getMock( 'Magento\PageCache\Model\Config', ['getType', 'isEnabled'], @@ -91,7 +91,7 @@ class CacheIdentifierPluginTest extends \PHPUnit_Framework_TestCase */ public function testAfterGetValue($cacheType, $isPageCacheEnabled, $result, $uaException, $expected) { - $identifierMock = $this->getMock('Magento\App\PageCache\Identifier', [], [], '', false); + $identifierMock = $this->getMock('Magento\Framework\App\PageCache\Identifier', [], [], '', false); $this->pageCacheConfigMock->expects($this->once()) ->method('getType') diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/App/StateTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/App/StateTest.php index abaa1acb8f2ca463786590ca4996c770604c38f9..5fc1b18b503e18214cdb01e05bed07a1a4f45dac 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/App/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/App/StateTest.php @@ -29,7 +29,7 @@ namespace Magento\Core\Model\App; class StateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_model; @@ -39,7 +39,7 @@ class StateTest extends \PHPUnit_Framework_TestCase */ public function testConstructor($mode) { - $model = new \Magento\App\State( + $model = new \Magento\Framework\App\State( $this->getMockForAbstractClass('Magento\Config\ScopeInterface', array(), '', false), time(), $mode @@ -53,9 +53,9 @@ class StateTest extends \PHPUnit_Framework_TestCase public static function constructorDataProvider() { return array( - 'default mode' => array(\Magento\App\State::MODE_DEFAULT), - 'production mode' => array(\Magento\App\State::MODE_PRODUCTION), - 'developer mode' => array(\Magento\App\State::MODE_DEVELOPER) + 'default mode' => array(\Magento\Framework\App\State::MODE_DEFAULT), + 'production mode' => array(\Magento\Framework\App\State::MODE_PRODUCTION), + 'developer mode' => array(\Magento\Framework\App\State::MODE_DEVELOPER) ); } @@ -65,7 +65,7 @@ class StateTest extends \PHPUnit_Framework_TestCase */ public function testConstructorException() { - new \Magento\App\State( + new \Magento\Framework\App\State( $this->getMockForAbstractClass('Magento\Config\ScopeInterface', array(), '', false), time(), "unknown mode" diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/DesignLoaderTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/DesignLoaderTest.php index 21ee32859da222081fa4882a9c72980541264a6d..77aefa67fea8a73f94ea3fc1d417ad5b53c70d4c 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/DesignLoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/DesignLoaderTest.php @@ -41,15 +41,15 @@ class DesignLoaderTest extends \PHPUnit_Framework_TestCase protected $_requestMock; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $appState; protected function setUp() { - $this->_areaListMock = $this->getMock('\Magento\App\AreaList', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->appState = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_areaListMock = $this->getMock('\Magento\Framework\App\AreaList', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_model = new \Magento\View\DesignLoader( $this->_requestMock, $this->_areaListMock, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/ConfigTest.php index 0594592a516f0dd7425ff47028c42fbf4049750e..aeaef17c5da280ab558fb749b13ce57dbca1799b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/ConfigTest.php @@ -54,13 +54,19 @@ class ConfigTest extends \PHPUnit_Framework_TestCase ); $directory->expects($this->once())->method('getRelativePath')->will($this->returnArgument(0)); $directory->expects($this->once())->method('openFile')->with('cacheFile')->will($this->returnValue($file)); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $filesystem = $this->getMock( + 'Magento\Framework\App\Filesystem', + array('getDirectoryWrite'), + array(), + '', + false + ); $filesystem->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR )->will( $this->returnValue($directory) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php index c95d1a9cb1af26fb8ba86eda881a7240c20e6a22..cb6e75d0575183827fc526ed7bb5d4390140b350 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php @@ -67,7 +67,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase protected $directoryFactoryMock; /** - * @var \Magento\App\Config\ScopeConfigInterface |\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface |\PHPUnit_Framework_MockObject_MockObject */ protected $configMock; @@ -132,7 +132,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->directoryMock) ); - $this->configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->configMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/RequestTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/RequestTest.php index c134415d777cbe630a64aef7a67a453aaa34af8e..22980491e5f5f31adda0466d89458bc28e2870d8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/RequestTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/RequestTest.php @@ -48,7 +48,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase protected function setUp() { $path = '..PathInfo'; - $this->_requestMock = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_requestMock->expects($this->once())->method('getPathInfo')->will($this->returnValue($path)); $this->_model = new \Magento\Core\Model\File\Storage\Request($this->_workingDir, $this->_requestMock); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php index 04e56449c0dc292dd1078b32b9f5d70720471a71..2c438254094f825233af4c49b1c695c074b3a028 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php @@ -74,13 +74,19 @@ class SynchronizationTest extends \PHPUnit_Framework_TestCase ); $directory->expects($this->once())->method('getRelativePath')->will($this->returnArgument(0)); $directory->expects($this->once())->method('openFile')->with($filePath)->will($this->returnValue($file)); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $filesystem = $this->getMock( + 'Magento\Framework\App\Filesystem', + array('getDirectoryWrite'), + array(), + '', + false + ); $filesystem->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR )->will( $this->returnValue($directory) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/DepersonalizePluginTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/DepersonalizePluginTest.php index fd7cf925841c7478bc7d3748329471cfb3d1ce83..8b4f1bdfe99ba4a1098cf9b5d72a36e5b8acf4e0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/DepersonalizePluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/DepersonalizePluginTest.php @@ -40,7 +40,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase protected $layoutMock; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -70,7 +70,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->layoutMock = $this->getMock('Magento\View\Layout', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->moduleManagerMock = $this->getMock('Magento\Module\Manager', array(), array(), '', false); $this->eventManagerMock = $this->getMock('Magento\Event\Manager', array(), array(), '', false); $this->cacheConfigMock = $this->getMock('Magento\PageCache\Model\Config', array(), array(), '', false); @@ -80,7 +80,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase '', false ); - $this->plugin = new \Magento\Core\Model\Layout\DepersonalizePlugin( + $this->plugin = new DepersonalizePlugin( $this->requestMock, $this->moduleManagerMock, $this->eventManagerMock, diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index 4f15c5ab74ab4e175907ba91fee02e950a760e5c..074d2fabe6875f57a5b94080f0f8b43e47be5fe2 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -88,7 +88,7 @@ class MergeTest extends \PHPUnit_Framework_TestCase $this->_resource = $this->getMock('Magento\Core\Model\Resource\Layout\Update', array(), array(), '', false); - $this->_appState = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_logger = $this->getMock('Magento\Logger', array(), array(), '', false); @@ -109,7 +109,7 @@ class MergeTest extends \PHPUnit_Framework_TestCase $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false, false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false, false); $directory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false, false); $directory->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/NoRouteHandlerListTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/NoRouteHandlerListTest.php index eb91cbeac3cb5b44813ec1df02f8be62efa596f3..f95fe91ec60d34008abb534e261b9fa697764adc 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/NoRouteHandlerListTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/NoRouteHandlerListTest.php @@ -31,7 +31,7 @@ class NoRouteHandlerListTest extends \PHPUnit_Framework_TestCase protected $_objectManagerMock; /** - * @var \Magento\App\Router\NoRouteHandlerList + * @var \Magento\Framework\App\Router\NoRouteHandlerList */ protected $_model; @@ -43,7 +43,7 @@ class NoRouteHandlerListTest extends \PHPUnit_Framework_TestCase 'backend_handler' => array('class' => 'Magento\Backend\App\Router\NoRouteHandler', 'sortOrder' => 10) ); - $this->_model = new \Magento\App\Router\NoRouteHandlerList($this->_objectManagerMock, $handlersList); + $this->_model = new \Magento\Framework\App\Router\NoRouteHandlerList($this->_objectManagerMock, $handlersList); } public function testGetHandlers() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php index eba6fe9e035a2e5fa6afb4cb4d83e4722ee669cf..6f4d4e25c06be13f479e9dc5c7228e9554c822ab 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php @@ -59,7 +59,13 @@ class ObserverTest extends \PHPUnit_Framework_TestCase { $this->_cacheFrontendMock = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface'); - $this->_frontendPoolMock = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); + $this->_frontendPoolMock = $this->getMock( + 'Magento\Framework\App\Cache\Frontend\Pool', + array(), + array(), + '', + false + ); $this->_frontendPoolMock->expects($this->any())->method('valid')->will($this->onConsecutiveCalls(true, false)); $this->_frontendPoolMock->expects( $this->any() @@ -103,7 +109,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase false ); $this->_configMock = $this->getMock( - '\Magento\App\Config\ReinitableConfigInterface', + '\Magento\Framework\App\Config\ReinitableConfigInterface', array(), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php index 0c84a2e127432a804d064e7b6f923adea6ca7bc8..440fa98a1ba1e75927b479299be82cea856a6229 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php @@ -38,13 +38,13 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Resource|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|PHPUnit_Framework_MockObject_MockObject */ protected $_resource; protected function setUp() { - $this->_resource = $this->getMock('Magento\App\Resource', array('getConnection'), array(), '', false, false); + $this->_resource = $this->getMock('Magento\Framework\App\Resource', array('getConnection'), array(), '', false, false); $this->_model = $this->getMock( 'Magento\Model\Resource\Db\AbstractDb', array('_construct', '_getWriteAdapter'), @@ -67,7 +67,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testGetConnectionInMemoryCaching() { - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $string = $this->getMock('Magento\Stdlib\String', array(), array(), '', false); $dateTime = $this->getMock('Magento\Stdlib\DateTime', null, array(), '', true); $connection = new \Magento\DB\Adapter\Pdo\Mysql( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php index 3daa48a51cf258221bc9c814a928e0bd93303872..66423293d83b87cd9047e03f75114e40b78e85b0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php @@ -39,7 +39,7 @@ class FileTest extends \PHPUnit_Framework_TestCase protected $loggerMock; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; @@ -55,7 +55,7 @@ class FileTest extends \PHPUnit_Framework_TestCase { $this->loggerMock = $this->getMock('Magento\Logger', array(), array(), '', false); $this->filesystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', @@ -90,7 +90,7 @@ class FileTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - $this->equalTo(\Magento\App\Filesystem::MEDIA_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::MEDIA_DIR) )->will( $this->returnValue($this->directoryReadMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/SessionTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/SessionTest.php index 542c23f4c4988bdd8bd6a72a7b27bc89ab909053..316dabaa39c0dcf960cf21482f971f4fb9274433 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/SessionTest.php @@ -103,7 +103,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase protected function _prepareResourceMock($connection) { $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Plugin/DebugHintsTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Plugin/DebugHintsTest.php index 588e89f674c965661f5737cb35546a016f317c5f..fd4ffe93afb2f935251838db4f7698be730a39c4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Plugin/DebugHintsTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Plugin/DebugHintsTest.php @@ -53,7 +53,7 @@ class DebugHintsTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectManager = $this->getMock('Magento\ObjectManager'); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->subjectMock = $this->getMock('Magento\View\TemplateEngineFactory', array(), array(), '', false); $this->_model = new DebugHints($this->_objectManager, $this->_scopeConfig, $this->_coreData); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php index e4a6dcededd8c08dd5102b842aa4fe3d0b76f6cb..e3fe5c1b511c5d146864d554a8c1d419c617a84b 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Domain/VirtualTest.php @@ -86,7 +86,7 @@ class VirtualTest extends \PHPUnit_Framework_TestCase false ); $theme->expects($this->once())->method('getStagingVersion')->will($this->returnValue(null)); - $appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array('getAreaCode'), array(), '', false); $appState->expects($this->any())->method('getAreaCode')->will($this->returnValue('fixture_area')); $appStateProperty = new \ReflectionProperty('Magento\Core\Model\Theme', '_appState'); $appStateProperty->setAccessible(true); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php index 047b26b4a1f330474a638581f484ee65a82826a5..b7cca084761922821c1dd8add1d2c45c0ed2d1fb 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/Image/PathTest.php @@ -54,7 +54,7 @@ class PathTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_viewUrlMock = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false); @@ -63,7 +63,7 @@ class PathTest extends \PHPUnit_Framework_TestCase )->method( 'getPath' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue('/media') ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ResolverTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ResolverTest.php index 7eb27a0f5a8d3d4d867467432797f44d73309c96..c2322835bb428f1f596f0bbf40da7b2b1a0600d7 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ResolverTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ResolverTest.php @@ -41,7 +41,7 @@ class ResolverTest extends \PHPUnit_Framework_TestCase protected $themeCollectionFactoryMock; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $appStateMock; @@ -73,7 +73,7 @@ class ResolverTest extends \PHPUnit_Framework_TestCase false ); $this->appStateMock = $this->getMock( - 'Magento\App\State', + 'Magento\Framework\App\State', [], [], '', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php index 8cc7bc1d6c59b6eab9a00d4d609273acba7f95e4..4c658177c081cbbe874c2f9d3eb120f91e7b435a 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php @@ -37,7 +37,7 @@ class SecurityInfoTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\Core\Model\Url\SecurityInfo($this->_scopeConfigMock, array('/account', '/cart')); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php index 681b49d69706739b8853a4d2bf6c8b0b6fe621c0..a73eede046c7f9ed2ceb79ce12a841348f73ffe3 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/View/Url/ConfigTest.php @@ -34,14 +34,14 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; protected function setUp() { $this->_scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->_model = new \Magento\Core\Model\View\Url\Config($this->_scopeConfig); } diff --git a/dev/tests/unit/testsuite/Magento/Cron/App/Cron/Plugin/ApplicationInitializerTest.php b/dev/tests/unit/testsuite/Magento/Cron/App/Cron/Plugin/ApplicationInitializerTest.php index 822a49b39d020625613a7306d4aa2c990ade4436..0f646bea6100df833e5acb970d26d8d126ade435 100644 --- a/dev/tests/unit/testsuite/Magento/Cron/App/Cron/Plugin/ApplicationInitializerTest.php +++ b/dev/tests/unit/testsuite/Magento/Cron/App/Cron/Plugin/ApplicationInitializerTest.php @@ -47,9 +47,9 @@ class ApplicationInitializerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->sidResolverMock = $this->getMock('\Magento\Session\SidResolverInterface', array(), array(), '', false); - $this->subjectMock = $this->getMock('Magento\App\Cron', array(), array(), '', false); + $this->subjectMock = $this->getMock('Magento\Framework\App\Cron', array(), array(), '', false); $this->model = new ApplicationInitializer( $this->appStateMock, $this->sidResolverMock diff --git a/dev/tests/unit/testsuite/Magento/Cron/Model/Config/Reader/XmlTest.php b/dev/tests/unit/testsuite/Magento/Cron/Model/Config/Reader/XmlTest.php index d120cdc2e6fddc85112ef1671c8fc6348e5c8a90..4ddee8afbaeb9149fcbd3750e365be2451423d41 100644 --- a/dev/tests/unit/testsuite/Magento/Cron/Model/Config/Reader/XmlTest.php +++ b/dev/tests/unit/testsuite/Magento/Cron/Model/Config/Reader/XmlTest.php @@ -38,7 +38,7 @@ class XmlTest extends \PHPUnit_Framework_TestCase public function setUp() { $fileResolver = $this->getMockBuilder( - 'Magento\App\Config\FileResolver' + 'Magento\Framework\App\Config\FileResolver' )->disableOriginalConstructor()->getMock(); $converter = $this->getMockBuilder( 'Magento\Cron\Model\Config\Converter\Xml' diff --git a/dev/tests/unit/testsuite/Magento/Cron/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Cron/Model/ObserverTest.php index 02c6155546d9e990c27c543c5ed93e813e114389..f54f63142928c411025749918473a83f1c39f0e4 100644 --- a/dev/tests/unit/testsuite/Magento/Cron/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Cron/Model/ObserverTest.php @@ -37,7 +37,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase protected $_observer; /** - * @var \Magento\App\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ObjectManager|\PHPUnit_Framework_MockObject_MockObject */ protected $_objectManager; @@ -57,12 +57,12 @@ class ObserverTest extends \PHPUnit_Framework_TestCase protected $_scheduleFactory; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfig; /** - * @var \Magento\App\Console\Request|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Console\Request|\PHPUnit_Framework_MockObject_MockObject */ protected $_request; @@ -85,12 +85,12 @@ class ObserverTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_objectManager = $this->getMockBuilder( - 'Magento\App\ObjectManager' + 'Magento\Framework\App\ObjectManager' )->disableOriginalConstructor()->getMock(); - $this->_cache = $this->getMock('Magento\App\CacheInterface'); + $this->_cache = $this->getMock('Magento\Framework\App\CacheInterface'); $this->_config = $this->getMockBuilder('Magento\Cron\Model\Config')->disableOriginalConstructor()->getMock(); $this->_scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->_collection = $this->getMockBuilder( 'Magento\Cron\Model\Resource\Schedule\Collection' @@ -105,7 +105,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase array('create') )->disableOriginalConstructor()->getMock(); $this->_request = $this->getMockBuilder( - 'Magento\App\Console\Request' + 'Magento\Framework\App\Console\Request' )->disableOriginalConstructor()->getMock(); $this->_shell = $this->getMockBuilder( 'Magento\ShellInterface' diff --git a/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/CacheTest.php b/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/CacheTest.php index 3dcf300dabf194b4b934afaec714fb02acfd180f..ed42594ebb34d7472dad6885f21c18aeedd399ae 100644 --- a/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/CacheTest.php @@ -79,7 +79,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase $fileFactory = $this->getMock('Magento\View\Publisher\FileFactory', array(), array(), '', false); $fileFactory->expects($this->any())->method('create')->will($this->returnValue($cssFile)); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($this->rootDirectory)); $this->objectManagerHelper = new ObjectManagerHelper($this); diff --git a/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/Map/StorageTest.php b/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/Map/StorageTest.php index 22c22d99d61be82dcdd04f00e85f536992ab42a2..b602d83bc134a52f750382aa062995e6411931c1 100644 --- a/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/Map/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Css/PreProcessor/Cache/Import/Map/StorageTest.php @@ -33,7 +33,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; /** @var \Magento\Filesystem\Directory\WriteInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -68,13 +68,13 @@ class StorageTest extends \PHPUnit_Framework_TestCase ); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->filesystemMock->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - $this->equalTo(\Magento\App\Filesystem::VAR_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::VAR_DIR) )->will( $this->returnValue($this->mapsDirectoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php index 0d8b29f80f5fe7dd9be9e7c15c772f37fdbe24ee..b729ba7e9335c6031a36f9df2096563b7a1f601a 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php @@ -37,7 +37,7 @@ class AuthorizationLinkTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * \Magento\App\Http\Context + * \Magento\Framework\App\Http\Context */ protected $httpContext; @@ -54,7 +54,7 @@ class AuthorizationLinkTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->httpContext = $this->getMockBuilder('\Magento\App\Http\Context') + $this->httpContext = $this->getMockBuilder('\Magento\Framework\App\Http\Context') ->disableOriginalConstructor() ->setMethods(array('getValue')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php index 63a7c42a76c1e85fffacf05d43d8dcda4aff6bfa..f6a75f1e9ee264b4ffb9590284555e2f56da7116 100755 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php @@ -59,7 +59,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase )->disableOriginalConstructor()->getMock(); $contextMock->expects($this->any())->method('getEscaper')->will($this->returnValue($escaperMock)); - $httpContextMock = $this->getMockBuilder('Magento\App\Http\Context') + $httpContextMock = $this->getMockBuilder('Magento\Framework\App\Http\Context') ->disableOriginalConstructor() ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php index 85e8e839d55979790b5cd759e11d9d229b875f5f..14f034915bb453d11ca17aafcc7f07cce5d6b07b 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php @@ -44,7 +44,7 @@ class RegisterLinkTest extends \PHPUnit_Framework_TestCase public function testToHtml() { $context = $this->_objectManager->getObject('Magento\View\Element\Template\Context'); - $httpContext = $this->getMockBuilder('Magento\App\Http\Context') + $httpContext = $this->getMockBuilder('Magento\Framework\App\Http\Context') ->disableOriginalConstructor() ->setMethods(array('getValue')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Form/RegisterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Form/RegisterTest.php index 2e11b4e52ce691c1b2e599654255586de4057c25..59f83a30a374d086c131d13c1b7c5d9bd1874110 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Form/RegisterTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Form/RegisterTest.php @@ -46,7 +46,7 @@ class RegisterTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Core\Helper\Data */ private $_coreData; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\App\Config\ScopeConfigInterface */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\Config\ScopeConfigInterface */ private $_scopeConfig; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\Session */ @@ -63,7 +63,7 @@ class RegisterTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_moduleManager = $this->getMock('Magento\Module\Manager', array(), array(), '', false); $this->_coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_customerHelper = $this->getMock('Magento\Customer\Helper\Data', array(), array(), '', false); @@ -82,7 +82,7 @@ class RegisterTest extends \PHPUnit_Framework_TestCase $context, $this->_coreData, $this->getMockForAbstractClass('Magento\Json\EncoderInterface', array(), '', false), - $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Cache\Type\Config', array(), array(), '', false), $this->getMock('Magento\Directory\Model\Resource\Region\CollectionFactory', array(), array(), '', false), $this->getMock('Magento\Directory\Model\Resource\Country\CollectionFactory', array(), array(), '', false), $this->_moduleManager, @@ -337,7 +337,7 @@ class RegisterTest extends \PHPUnit_Framework_TestCase $this->returnValue($customerFormData) ); $form = $this->getMock('Magento\Customer\Model\Metadata\Form', array(), array(), '', false); - $request = $this->getMockForAbstractClass('Magento\App\RequestInterface', array(), '', false); + $request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface', array(), '', false); $formData = $this->_block->getFormData(); $form->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php index 6c57091dfcdd42d34ced4740503fec3540448bd0..d6362b395d577ac362f0e6e811dc205ed1af0dd4 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Widget/DobTest.php @@ -71,7 +71,7 @@ class DobTest extends \PHPUnit_Framework_TestCase $frontendCache = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface', array(), '', false); $frontendCache->expects($this->any())->method('getLowLevelFrontend')->will($this->returnValue($zendCacheCore)); - $cache = $this->getMock('Magento\App\CacheInterface'); + $cache = $this->getMock('Magento\Framework\App\CacheInterface'); $cache->expects($this->any())->method('getFrontend')->will($this->returnValue($frontendCache)); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php index 9fba7eba44e1ba9aae83afb0fb5e78272a783ba8..b8cbaaac9f5cdbcb4e9a38de04d5545076c86174 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php @@ -38,12 +38,12 @@ class AccountTest extends \PHPUnit_Framework_TestCase protected $object; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $request; /** - * @var \Magento\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $response; @@ -90,14 +90,14 @@ class AccountTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->request = $this->getMock( - 'Magento\App\RequestInterface', + 'Magento\Framework\App\RequestInterface', array('isPost', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getParam'), array(), '', false ); $this->response = $this->getMock( - 'Magento\App\ResponseInterface', + 'Magento\Framework\App\ResponseInterface', array('setRedirect', 'sendResponse'), array(), '', @@ -166,7 +166,10 @@ class AccountTest extends \PHPUnit_Framework_TestCase $this->returnValueMap( array( array('Magento\Customer\Helper\Data', new \Magento\Object(array('account_url' => 1))), - array('Magento\App\Config\ScopeConfigInterface', new \Magento\Object(array('config_flag' => 1))), + array( + 'Magento\Framework\App\Config\ScopeConfigInterface', + new \Magento\Object(array('config_flag' => 1)) + ), array( 'Magento\Core\Helper\Data', $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false) diff --git a/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index baecc1ffaa1c58eaa13e181d9b0096f22b3183f8..2de86d58b6114374a515b924a8f0a45c257e8d44 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -35,14 +35,14 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** * Request mock instance * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\RequestInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\RequestInterface */ protected $_request; /** * Response mock instance * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\ResponseInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\ResponseInterface */ protected $_response; @@ -56,7 +56,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** * ObjectManager mock instance * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\ObjectManager + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\ObjectManager */ protected $_objectManager; @@ -92,10 +92,12 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->_request = $this->getMockBuilder('Magento\App\Request\Http')->disableOriginalConstructor()->getMock(); + $this->_request = $this->getMockBuilder('Magento\Framework\App\Request\Http') + ->disableOriginalConstructor() + ->getMock(); $this->_response = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->setMethods( array('setRedirect', 'getHeader') )->getMock(); @@ -111,15 +113,17 @@ class IndexTest extends \PHPUnit_Framework_TestCase ); $this->_objectManager = $this->getMockBuilder( - 'Magento\App\ObjectManager' + 'Magento\Framework\App\ObjectManager' )->disableOriginalConstructor()->setMethods( array('get', 'create') )->getMock(); $frontControllerMock = $this->getMockBuilder( - 'Magento\App\FrontController' + 'Magento\Framework\App\FrontController' )->disableOriginalConstructor()->getMock(); - $actionFlagMock = $this->getMockBuilder('Magento\App\ActionFlag')->disableOriginalConstructor()->getMock(); + $actionFlagMock = $this->getMockBuilder('Magento\Framework\App\ActionFlag') + ->disableOriginalConstructor() + ->getMock(); $this->_session = $this->getMockBuilder( 'Magento\Backend\Model\Session' @@ -429,8 +433,8 @@ class IndexTest extends \PHPUnit_Framework_TestCase 'initiatePasswordReset' )->with( $email, - $websiteId, - CustomerAccountServiceInterface::EMAIL_REMINDER + CustomerAccountServiceInterface::EMAIL_REMINDER, + $websiteId ); // verify success message diff --git a/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php b/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php index 7ff98c67f80ef2f8d6284abdd009ab3ba9b5fe4e..8867cc8abc6e650c52505b79d541be027f3cd316 100755 --- a/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Helper/AddressTest.php @@ -28,7 +28,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Helper\Address|\PHPUnit_Framework_MockObject_MockObject */ protected $helper; - /** @var \Magento\App\Helper\Context */ + /** @var \Magento\Framework\App\Helper\Context */ protected $context; /** @var \Magento\View\Element\BlockFactory|\PHPUnit_Framework_MockObject_MockObject */ @@ -37,7 +37,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $storeManager; - /** @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfig; /** @var \Magento\Customer\Service\V1\CustomerMetadataServiceInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -48,7 +48,9 @@ class AddressTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->context = $this->getMockBuilder('Magento\App\Helper\Context')->disableOriginalConstructor()->getMock(); + $this->context = $this->getMockBuilder('Magento\Framework\App\Helper\Context') + ->disableOriginalConstructor() + ->getMock(); $this->blockFactory = $this->getMockBuilder( 'Magento\View\Element\BlockFactory' )->disableOriginalConstructor()->getMock(); @@ -56,7 +58,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase 'Magento\Store\Model\StoreManagerInterface' )->disableOriginalConstructor()->getMock(); $this->scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->customerMetadataService = $this->getMockBuilder( 'Magento\Customer\Service\V1\CustomerMetadataServiceInterface' diff --git a/dev/tests/unit/testsuite/Magento/Customer/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Customer/Helper/DataTest.php index 95a2ef020cf3645420aac065f82bfc871a707b80..742aeea189201ffba56a1779c078ae45a8b7cb5d 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Helper/DataTest.php @@ -41,7 +41,7 @@ class DataTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ protected $_dataHelper; - /** @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_mockRequest; /** @var array */ @@ -59,7 +59,7 @@ class DataTest extends \PHPUnit_Framework_TestCase )->getMock(); $this->_mockRequest = $this->getMock( - 'Magento\App\RequestInterface', + 'Magento\Framework\App\RequestInterface', array('getPost', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getParam'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConfigTest.php index b179725bce4fdf382869d7a817bac454ed103faf..f6fdf8f23e5ab907ceaf6d8a1d2a5aec055486d9 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Address/ConfigTest.php @@ -68,7 +68,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_storeMock = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); - $this->_scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_readerMock = $this->getMock( 'Magento\Customer\Model\Address\Config\Reader', diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/AddressRegistryTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/AddressRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..97751f7db2a392f5b223084a7e225c7a6e78a58a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/AddressRegistryTest.php @@ -0,0 +1,118 @@ +<?php +/** + * Unit test for converter \Magento\Customer\Model\Converter + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Customer\Model; + +class AddressRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Model\AddressRegistry + */ + private $unit; + + /** + * @var \Magento\Customer\Model\AddressFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $addressFactory; + + public function setUp() + { + $this->addressFactory = $this->getMockBuilder('\Magento\Customer\Model\AddressFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->unit = new AddressRegistry($this->addressFactory); + } + + public function testRetrieve() + { + $addressId = 1; + $address = $this->getMockBuilder('\Magento\Customer\Model\Address') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', '__wakeup']) + ->getMock(); + $address->expects($this->once()) + ->method('load') + ->with($addressId) + ->will($this->returnValue($address)); + $address->expects($this->once()) + ->method('getId') + ->will($this->returnValue($addressId)); + $this->addressFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($address)); + $actual = $this->unit->retrieve($addressId); + $this->assertEquals($address, $actual); + $actualCached = $this->unit->retrieve($addressId); + $this->assertEquals($address, $actualCached); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveException() + { + $addressId = 1; + $address = $this->getMockBuilder('\Magento\Customer\Model\Address') + ->setMethods(['load', 'getId', '__wakeup']) + ->disableOriginalConstructor() + ->getMock(); + $address->expects($this->once()) + ->method('load') + ->with($addressId) + ->will($this->returnValue($address)); + $address->expects($this->once()) + ->method('getId') + ->will($this->returnValue(null)); + $this->addressFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($address)); + $this->unit->retrieve($addressId); + } + + public function testRemove() + { + $addressId = 1; + $address = $this->getMockBuilder('\Magento\Customer\Model\Address') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', '__wakeup']) + ->getMock(); + $address->expects($this->exactly(2)) + ->method('load') + ->with($addressId) + ->will($this->returnValue($address)); + $address->expects($this->exactly(2)) + ->method('getId') + ->will($this->returnValue($addressId)); + $this->addressFactory->expects($this->exactly(2)) + ->method('create') + ->will($this->returnValue($address)); + $actual = $this->unit->retrieve($addressId); + $this->assertEquals($address, $actual); + $this->unit->remove($addressId); + $actual = $this->unit->retrieve($addressId); + $this->assertEquals($address, $actual); + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/App/Action/ContextPluginTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/App/Action/ContextPluginTest.php index 48ff9a46fe4fb7188122b7ebab9dbb556e56ce55..f153122dc4c4c0fde4cddfb7f898ced47640a0bc 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/App/Action/ContextPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/App/Action/ContextPluginTest.php @@ -43,7 +43,7 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase protected $customerSessionMock; /** - * @var \Magento\App\Http\Context $httpContext|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Http\Context $httpContext|\PHPUnit_Framework_MockObject_MockObject */ protected $httpContextMock; @@ -69,13 +69,13 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase { $this->customerSessionMock = $this->getMock('Magento\Customer\Model\Session', array(), array(), '', false); - $this->httpContextMock = $this->getMock('Magento\App\Http\Context', + $this->httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); $this->closureMock = function () { return 'ExpectedValue'; }; - $this->subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->plugin = new \Magento\Customer\Model\App\Action\ContextPlugin( $this->customerSessionMock, $this->httpContextMock diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerRegistryTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..af098a7f1913f50e1be773ed1943621e852363a2 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerRegistryTest.php @@ -0,0 +1,222 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Customer\Model; + +/** + * Test for CustomerRegistry + * + * @package Magento\Customer\Model + */ +class CustomerRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Model\CustomerRegistry + */ + private $customerRegistry; + + /** + * @var \Magento\Customer\Model\CustomerFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $customerFactory; + + /** + * @var \Magento\Customer\Model\Customer|\PHPUnit_Framework_MockObject_MockObject + */ + private $customer; + + /**#@+ + * Sample customer data + */ + const CUSTOMER_ID = 1; + const CUSTOMER_EMAIL = 'customer@example.com'; + const WEBSITE_ID = 1; + + public function setUp() + { + $this->customerFactory = $this->getMockBuilder('\Magento\Customer\Model\CustomerFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->customerRegistry = new CustomerRegistry($this->customerFactory); + $this->customer = $this->getMockBuilder('\Magento\Customer\Model\Customer') + ->disableOriginalConstructor() + ->setMethods( + [ + 'load', + 'getId', + 'getEmail', + 'getWebsiteId', + '__wakeup', + 'setEmail', + 'setWebsiteId', + 'loadByEmail' + ] + ) + ->getMock(); + } + + public function testRetrieve() + { + $this->customer->expects($this->once()) + ->method('load') + ->with(self::CUSTOMER_ID) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getId') + ->will($this->returnValue(self::CUSTOMER_ID)); + $this->customerFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->customer)); + $actual = $this->customerRegistry->retrieve(self::CUSTOMER_ID); + $this->assertEquals($this->customer, $actual); + $actualCached = $this->customerRegistry->retrieve(self::CUSTOMER_ID); + $this->assertEquals($this->customer, $actualCached); + } + + public function testRetrieveByEmail() + { + $this->customer->expects($this->once()) + ->method('loadByEmail') + ->with(self::CUSTOMER_EMAIL) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getId') + ->will($this->returnValue(self::CUSTOMER_ID)); + $this->customer->expects($this->any()) + ->method('getEmail') + ->will($this->returnValue(self::CUSTOMER_EMAIL)); + $this->customer->expects($this->any()) + ->method('getWebsiteId') + ->will($this->returnValue(self::WEBSITE_ID)); + $this->customer->expects($this->any()) + ->method('setEmail') + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('setWebsiteId') + ->will($this->returnValue($this->customer)); + $this->customerFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->customer)); + $actual = $this->customerRegistry->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->assertEquals($this->customer, $actual); + $actualCached = $this->customerRegistry->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->assertEquals($this->customer, $actualCached); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveException() + { + $this->customer->expects($this->once()) + ->method('load') + ->with(self::CUSTOMER_ID) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getId') + ->will($this->returnValue(null)); + $this->customerFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->customer)); + $this->customerRegistry->retrieve(self::CUSTOMER_ID); + } + + /** + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveByEmailException() + { + $this->customer->expects($this->once()) + ->method('loadByEmail') + ->with(self::CUSTOMER_EMAIL) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getEmail') + ->will($this->returnValue(null)); + $this->customer->expects($this->any()) + ->method('getWebsiteId') + ->will($this->returnValue(null)); + $this->customer->expects($this->any()) + ->method('setEmail') + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('setWebsiteId') + ->will($this->returnValue($this->customer)); + $this->customerFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($this->customer)); + $this->customerRegistry->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + } + + public function testRemove() + { + $this->customer->expects($this->exactly(2)) + ->method('load') + ->with(self::CUSTOMER_ID) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getId') + ->will($this->returnValue(self::CUSTOMER_ID)); + $this->customerFactory->expects($this->exactly(2)) + ->method('create') + ->will($this->returnValue($this->customer)); + $actual = $this->customerRegistry->retrieve(self::CUSTOMER_ID); + $this->assertEquals($this->customer, $actual); + $this->customerRegistry->remove(self::CUSTOMER_ID); + $actual = $this->customerRegistry->retrieve(self::CUSTOMER_ID); + $this->assertEquals($this->customer, $actual); + } + + public function testRemoveByEmail() + { + $this->customer->expects($this->exactly(2)) + ->method('loadByEmail') + ->with(self::CUSTOMER_EMAIL) + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('getId') + ->will($this->returnValue(self::CUSTOMER_ID)); + $this->customer->expects($this->any()) + ->method('getEmail') + ->will($this->returnValue(self::CUSTOMER_EMAIL)); + $this->customer->expects($this->any()) + ->method('getWebsiteId') + ->will($this->returnValue(self::WEBSITE_ID)); + $this->customer->expects($this->any()) + ->method('setEmail') + ->will($this->returnValue($this->customer)); + $this->customer->expects($this->any()) + ->method('setWebsiteId') + ->will($this->returnValue($this->customer)); + $this->customerFactory->expects($this->exactly(2)) + ->method('create') + ->will($this->returnValue($this->customer)); + $actual = $this->customerRegistry->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->assertEquals($this->customer, $actual); + $this->customerRegistry->removeByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $actual = $this->customerRegistry->retrieveByEmail(self::CUSTOMER_EMAIL, self::WEBSITE_ID); + $this->assertEquals($this->customer, $actual); + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerTest.php index b42fc46e5ef15fcf6d3d336581d067414e646088..3ac0237a569ee3938dded49781c0bfd3511a9166 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/CustomerTest.php @@ -46,7 +46,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Eav\Model\Attribute|\PHPUnit_Framework_MockObject_MockObject */ protected $_attribute; - /** @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfigMock; /** @var \Magento\Mail\Template\TransportBuilder|\PHPUnit_Framework_MockObject_MockObject */ @@ -65,7 +65,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase $this->_attribute = $this->getMock('Magento\Eav\Model\Attribute', array(), array(), '', false); $this->_storeManager = $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false); $this->_storetMock = $this->getMock('\Magento\Store\Model\Store', array(), array(), '', false); - $this->_scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_transportBuilderMock = $this->getMock( '\Magento\Mail\Template\TransportBuilder', array(), diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/GroupRegistryTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/GroupRegistryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..aa5cb81ad543ff1a6950c6303925d42bc4fd0b6a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/GroupRegistryTest.php @@ -0,0 +1,132 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Customer\Model; + +/** + * Unit test for registry \Magento\Customer\Model\GroupRegistry + */ +class GroupRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Customer\Model\GroupRegistry + */ + private $unit; + + /** + * @var \Magento\Customer\Model\CustomerGroupFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $groupFactory; + + public function setUp() + { + $this->groupFactory = $this->getMockBuilder('\Magento\Customer\Model\GroupFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->unit = new GroupRegistry($this->groupFactory); + } + + /** + * Tests that the same instance is returned from multiple retrieve calls with the same parameter. + * + * @return void + */ + public function testRetrieve() + { + $groupId = 1; + $group = $this->getMockBuilder('Magento\Customer\Model\Group') + ->setMethods(['load', 'getId', '__wakeup']) + ->disableOriginalConstructor() + ->getMock(); + $group->expects($this->once()) + ->method('load') + ->with($groupId) + ->will($this->returnValue($group)); + $group->expects($this->once()) + ->method('getId') + ->will($this->returnValue($groupId)); + $this->groupFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($group)); + $actual = $this->unit->retrieve($groupId); + $this->assertEquals($group, $actual); + $actualCached = $this->unit->retrieve($groupId); + $this->assertSame($group, $actualCached); + } + + /** + * Tests that attempting to retrieve a non-existing entity will result in an exception. + * + * @return void + * @expectedException \Magento\Exception\NoSuchEntityException + */ + public function testRetrieveException() + { + $groupId = 1; + $group = $this->getMockBuilder('Magento\Customer\Model\Group') + ->setMethods(['load', 'getId', '__wakeup']) + ->disableOriginalConstructor() + ->getMock(); + $group->expects($this->once()) + ->method('load') + ->with($groupId) + ->will($this->returnValue($group)); + $group->expects($this->once()) + ->method('getId') + ->will($this->returnValue(null)); + $this->groupFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($group)); + $this->unit->retrieve($groupId); + } + + /** + * Tests that an instance removed from the registry will cause the registry to load the model again. + * + * @return void + */ + public function testRemove() + { + $groupId = 1; + $group = $this->getMockBuilder('Magento\Customer\Model\Group') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', '__wakeup']) + ->getMock(); + $group->expects($this->exactly(2)) + ->method('load') + ->with($groupId) + ->will($this->returnValue($group)); + $group->expects($this->exactly(2)) + ->method('getId') + ->will($this->returnValue($groupId)); + $this->groupFactory->expects($this->exactly(2)) + ->method('create') + ->will($this->returnValue($group)); + $actual = $this->unit->retrieve($groupId); + $this->assertSame($group, $actual); + $this->unit->remove($groupId); + $actual = $this->unit->retrieve($groupId); + $this->assertSame($group, $actual); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Layout/DepersonalizePluginTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Layout/DepersonalizePluginTest.php index eecbb584dc2499cb360c6affd7aa205bdfbad001..bac23274926d1fa6836d05cf06325e4bca5be773 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Layout/DepersonalizePluginTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Layout/DepersonalizePluginTest.php @@ -60,7 +60,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase protected $customerFactoryMock; /** - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -110,7 +110,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->customerMock = $this->getMock( 'Magento\Customer\Model\Customer', array('setGroupId', '__wakeup'), diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php index cf8ec428ec2ae8c8112fb8f8a009d06631063da6..28018b3a520f8e135eecbe60f2d17c06c9f69218 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php @@ -302,7 +302,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase } /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $attributeCode * @param bool|string $requestScope * @param bool $requestScopeOnly @@ -326,7 +326,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase public function getRequestValueDataProvider() { $expectedValue = 'EXPECTED_VALUE'; - $requestMockOne = $this->getMockBuilder('\Magento\App\RequestInterface')->getMock(); + $requestMockOne = $this->getMockBuilder('\Magento\Framework\App\RequestInterface')->getMock(); $requestMockOne->expects( $this->any() )->method( @@ -337,7 +337,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase $this->returnValue($expectedValue) ); - $requestMockTwo = $this->getMockBuilder('\Magento\App\RequestInterface')->getMock(); + $requestMockTwo = $this->getMockBuilder('\Magento\Framework\App\RequestInterface')->getMock(); $requestMockTwo->expects( $this->at(0) )->method( @@ -358,7 +358,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase ); $requestMockThree = $this->getMockBuilder( - '\Magento\App\Request\Http' + '\Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->getMock(); $requestMockThree->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/DateTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/DateTest.php index 64e3a174c94b6dff9537225b32bcc9fc46b5b6ad..09cbf32f610e7389c0cf8d668b4deb576e315920 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/DateTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/DateTest.php @@ -66,7 +66,9 @@ class DateTest extends AbstractFormTestCase public function testExtractValue() { - $requestMock = $this->getMockBuilder('Magento\App\RequestInterface')->disableOriginalConstructor()->getMock(); + $requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); $requestMock->expects($this->once())->method('getParam')->will($this->returnValue('1999-1-2')); // yyyy-MM-dd diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/ExtendsAbstractData.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/ExtendsAbstractData.php index 17363b90fdec28d55245dc85db3a8ef1291c78b0..30b35fc18938f9ad4d546d2882418d1cc0bfcefa 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/ExtendsAbstractData.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/ExtendsAbstractData.php @@ -33,7 +33,7 @@ class ExtendsAbstractData extends AbstractData /** * {@inheritdoc} */ - public function extractValue(\Magento\App\RequestInterface $request) + public function extractValue(\Magento\Framework\App\RequestInterface $request) { } @@ -126,10 +126,10 @@ class ExtendsAbstractData extends AbstractData } /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return mixed */ - public function getRequestValue(\Magento\App\RequestInterface $request) + public function getRequestValue(\Magento\Framework\App\RequestInterface $request) { return $this->_getRequestValue($request); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php index 9b84c7a72df392a1254f8e5aae7fb8f067bad8f6..96837c0f3a244cb7b534faa144b66a1e9f80bb91 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php @@ -35,10 +35,10 @@ class FileTest extends AbstractFormTestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Core\Model\File\Validator\NotProtectedExtension */ protected $fileValidatorMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\App\Filesystem */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\Filesystem */ protected $fileSystemMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\App\RequestInterface */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\RequestInterface */ protected $requestMock; protected function setUp() @@ -51,10 +51,10 @@ class FileTest extends AbstractFormTestCase 'Magento\Core\Model\File\Validator\NotProtectedExtension' )->disableOriginalConstructor()->getMock(); $this->fileSystemMock = $this->getMockBuilder( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->disableOriginalConstructor()->getMock(); $this->requestMock = $this->getMockBuilder( - 'Magento\App\RequestInterface' + 'Magento\Framework\App\RequestInterface' )->disableOriginalConstructor()->setMethods( array('getParam', 'getParams', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName') )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/MultiselectTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/MultiselectTest.php index 46cde0f93b7bcc95cbe2ba6c7e37c08d434e8ce9..3eeb87e4086d8f038e4fd8623dbc6b9726294e99 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/MultiselectTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/MultiselectTest.php @@ -68,7 +68,7 @@ class MultiselectTest extends AbstractFormTestCase )->getMock(); $multiselect->expects($this->once())->method('_getRequestValue')->will($this->returnValue($value)); - $request = $this->getMockBuilder('Magento\App\RequestInterface')->getMock(); + $request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')->getMock(); $actual = $multiselect->extractValue($request); $this->assertEquals($expected, $actual); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php index 158a8cd5af3ca6a98c8f0c812bde651b15e9ffb0..73384e91eea00cde87893643c7861b7069827a83 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/Group/Grid/ServiceCollectionTest.php @@ -1,7 +1,5 @@ <?php /** - * Unit test for \Magento\Customer\Model\Resource\Group\Grid\ServiceCollection - * * Magento * * NOTICE OF LICENSE @@ -23,10 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Model\Resource\Group\Grid; -use Magento\Customer\Service\V1\Data\SearchCriteria; +use Magento\Service\V1\Data\SearchCriteria; +/** + * Unit test for \Magento\Customer\Model\Resource\Group\Grid\ServiceCollection + */ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\TestFramework\Helper\ObjectManager */ @@ -35,7 +37,7 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Service\V1\Data\FilterBuilder */ protected $filterBuilder; - /** @var \Magento\Customer\Service\V1\Data\SearchCriteriaBuilder */ + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder */ protected $searchCriteriaBuilder; /** @var \Magento\Customer\Service\V1\Data\SearchResults */ @@ -51,8 +53,13 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase { $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->filterBuilder = new \Magento\Service\V1\Data\FilterBuilder(); - $this->searchCriteriaBuilder = $this->objectManager - ->getObject('\Magento\Customer\Service\V1\Data\SearchCriteriaBuilder'); + $filterGroupBuilder = $this->objectManager + ->getObject('Magento\Service\V1\Data\Search\FilterGroupBuilder'); + /** @var \Magento\Service\V1\Data\SearchCriteriaBuilder $searchBuilder */ + $this->searchCriteriaBuilder = $this->objectManager->getObject( + 'Magento\Service\V1\Data\SearchCriteriaBuilder', + ['filterGroupBuilder' => $filterGroupBuilder] + ); $this->groupServiceMock = $this->getMockBuilder('\Magento\Customer\Service\V1\CustomerGroupServiceInterface') ->getMock(); $this->searchResults = (new \Magento\Customer\Service\V1\Data\SearchResultsBuilder())->create(); @@ -75,7 +82,8 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase ->setCurrentPage(1) ->setPageSize(0) ->addSortOrder('name', SearchCriteria::SORT_ASC) - ->addFilter($this->filterBuilder->setField('name')->setConditionType('eq')->setValue('Magento')->create()) + ->addFilter([$this->filterBuilder->setField('name')->setConditionType('eq') + ->setValue('Magento')->create()]) ->create(); // Verifies that the search criteria Data Object created by the serviceCollection matches expected @@ -97,13 +105,12 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase $value = '35'; /** @var SearchCriteria $expectedSearchCriteria */ + $filter = $this->filterBuilder->setField($field)->setConditionType($conditionType)->setValue($value)->create(); $expectedSearchCriteria = $this->searchCriteriaBuilder ->setCurrentPage(1) ->setPageSize(0) ->addSortOrder('name', SearchCriteria::SORT_ASC) - ->addFilter( - $this->filterBuilder->setField($field)->setConditionType($conditionType)->setValue($value)->create() - ) + ->addFilter([$filter]) ->create(); // Verifies that the search criteria Data Object created by the serviceCollection matches expected @@ -130,7 +137,7 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase ->setCurrentPage(1) ->setPageSize(0) ->addSortOrder('name', SearchCriteria::SORT_ASC) - ->addOrGroup( + ->addFilter( [ $this->filterBuilder->setField($fieldA)->setConditionType('eq')->setValue($value)->create(), $this->filterBuilder->setField($fieldB)->setConditionType('eq')->setValue($value)->create(), @@ -162,8 +169,10 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase ->setCurrentPage(1) ->setPageSize(0) ->addSortOrder('name', SearchCriteria::SORT_ASC) - ->addFilter($this->filterBuilder->setField($fieldA)->setConditionType('gt')->setValue($value)->create()) - ->addFilter($this->filterBuilder->setField($fieldB)->setConditionType('gt')->setValue($value)->create()) + ->addFilter([$this->filterBuilder->setField($fieldA)->setConditionType('gt') + ->setValue($value)->create()]) + ->addFilter([$this->filterBuilder->setField($fieldB)->setConditionType('gt') + ->setValue($value)->create()]) ->create(); // Verifies that the search criteria Data Object created by the serviceCollection matches expected diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php index d5f4db38212ab19671dc462f0837dd8be1273634..f92d429fd3527673678bec53461f6ff3f37f7e3a 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/SessionTest.php @@ -57,7 +57,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase $this->_converterMock = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); $this->_storageMock = $this->getMock('Magento\Customer\Model\Session\Storage', [], [], '', false); $this->_eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', [], [], '', false); - $this->_httpContextMock = $this->getMock('Magento\App\Http\Context', [], [], '', false); + $this->_httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', [], [], '', false); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_model = $helper->getObject('Magento\Customer\Model\Session', [ diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php index d345c5037bbbcd51f02e40f1fe7119caf78025b1..e703f9d932d2dc5bd14920bea4938a78baab9b20 100755 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAccountServiceTest.php @@ -21,10 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Customer\Service\V1; use Magento\Customer\Model\Converter; -use Magento\Customer\Service\V1\Data\Search\AndGroupBuilder; +use Magento\Customer\Model\CustomerRegistry; +use Magento\Service\V1\Data\SearchCriteriaBuilder; use Magento\Exception\InputException; use Magento\Exception\NoSuchEntityException; use Magento\Customer\Service\V1\Data\CustomerBuilder; @@ -32,7 +34,7 @@ use Magento\Service\V1\Data\FilterBuilder; use Magento\Mail\Exception as MailException; /** - * \Magento\Customer\Service\V1\CustomerAccountService + * Test for \Magento\Customer\Service\V1\CustomerAccountService * * @SuppressWarnings(PHPMD.TooManyMethods) * @SuppressWarnings(PHPMD.ExcessivePublicCount) @@ -72,11 +74,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ private $_storeManagerMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Math\Random - */ - private $_mathRandomMock; - /** * @var Converter */ @@ -88,14 +85,13 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase private $_storeMock; /** - * @var \Magento\Customer\Model\Metadata\Validator + * @var \Magento\Customer\Service\V1\Data\CustomerBuilder */ - private $_validator; - - /** @var \Magento\Customer\Service\V1\Data\CustomerBuilder */ private $_customerBuilder; - /** @var \Magento\Customer\Service\V1\Data\CustomerDetailsBuilder */ + /** + * @var \Magento\Customer\Service\V1\Data\CustomerDetailsBuilder + */ private $_customerDetailsBuilder; /** @@ -109,9 +105,9 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase private $_customerMetadataService; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\UrlInterface + * @var \PHPUnit_Framework_MockObject_MockObject | CustomerRegistry */ - private $_urlMock; + private $_customerRegistry; /** * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Logger @@ -123,8 +119,10 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ private $_customerHelperMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\ObjectManager */ - protected $_objectManagerMock; + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $_objectManager; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\Config\Share */ private $_configShareMock; @@ -132,8 +130,23 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Encryption\EncryptorInterface */ private $_encryptorMock; + /** + * @var SearchCriteriaBuilder + */ + protected $_searchBuilder; + public function setUp() { + $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $filterGroupBuilder = $this->_objectManager + ->getObject('Magento\Service\V1\Data\Search\FilterGroupBuilder'); + /** @var SearchCriteriaBuilder $searchBuilder */ + $this->_searchBuilder = $this->_objectManager->getObject( + 'Magento\Service\V1\Data\SearchCriteriaBuilder', + ['filterGroupBuilder' => $filterGroupBuilder] + ); + $this->_customerFactoryMock = $this->getMockBuilder( 'Magento\Customer\Model\CustomerFactory' )->disableOriginalConstructor()->setMethods( @@ -196,7 +209,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_eventManagerMock = $this->getMockBuilder( '\Magento\Event\ManagerInterface' )->disableOriginalConstructor()->getMock(); - $this->_customerModelMock->expects($this->any())->method('validate')->will($this->returnValue(true)); $this->_setupStoreMock(); @@ -211,7 +223,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_customerMetadataService = $this->getMockForAbstractClass( 'Magento\Customer\Service\V1\CustomerMetadataServiceInterface', - array(), + [], '', false ); @@ -233,37 +245,40 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_converter = new Converter($customerBuilder, $this->_customerFactoryMock); - $this->_customerAddressServiceMock = $this->getMockBuilder( - '\Magento\Customer\Service\V1\CustomerAddressService' - )->disableOriginalConstructor()->getMock(); - - $this->_customerHelperMock = $this->getMockBuilder( - 'Magento\Customer\Helper\Data' - )->disableOriginalConstructor()->setMethods( - array('isCustomerInStore') - )->getMock(); - $this->_customerHelperMock->expects( - $this->any() - )->method( - 'isCustomerInStore' - )->will( - $this->returnValue(false) - ); - - $this->_objectManagerMock = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->_objectManagerMock->expects( - $this->any() - )->method( - 'create' - )->with( - 'Magento\Customer\Helper\Data' - )->will( - $this->returnValue($this->_customerHelperMock) - ); + $this->_customerRegistry = $this->getMockBuilder('\Magento\Customer\Model\CustomerRegistry') + ->setMethods(['retrieve', 'retrieveByEmail']) + ->disableOriginalConstructor() + ->getMock(); - $this->_urlMock = $this->getMockBuilder('\Magento\UrlInterface')->disableOriginalConstructor()->getMock(); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieve') + ->will($this->returnValue($this->_customerModelMock)); + + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieveByEmail') + ->will($this->returnValue($this->_customerModelMock)); + + $this->_customerAddressServiceMock = + $this->getMockBuilder('Magento\Customer\Service\V1\CustomerAddressService') + ->disableOriginalConstructor() + ->getMock(); + + $this->_customerHelperMock = + $this->getMockBuilder('Magento\Customer\Helper\Data') + ->disableOriginalConstructor() + ->setMethods(['isCustomerInStore']) + ->getMock(); + $this->_customerHelperMock->expects($this->any()) + ->method('isCustomerInStore') + ->will($this->returnValue(false)); + + $this->_urlMock = $this->getMockBuilder('Magento\UrlInterface') + ->disableOriginalConstructor() + ->getMock(); - $this->_loggerMock = $this->getMockBuilder('\Magento\Logger') + $this->_loggerMock = $this->getMockBuilder('Magento\Logger') ->disableOriginalConstructor() ->getMock(); @@ -336,17 +351,10 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testActivateAccountDoesntExist() { - $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); - - $this->_mockReturnValue($this->_customerModelMock, array('getId' => 0)); - - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieve') + ->will($this->throwException(new NoSuchEntityException('customerId', 1))); // Assertions $this->_customerModelMock->expects($this->never())->method('save'); @@ -357,9 +365,14 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase try { $customerService->activateCustomer(self::ID, self::EMAIL_CONFIRMATION_KEY); $this->fail('Expected exception not thrown.'); - } catch (\Magento\Exception\NoSuchEntityException $nsee) { - $this->assertSame($nsee->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); - $this->assertSame($nsee->getParams(), array('customerId' => self::ID)); + } catch (\Magento\Exception\NoSuchEntityException $e) { + $this->assertSame($e->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); + $this->assertSame( + $e->getParams(), + [ + 'customerId' => self::ID, + ] + ); } } @@ -579,31 +592,24 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase { $resetToken = 'lsdj579slkj5987slkj595lkj'; - $this->_mockReturnValue( - $this->_customerModelMock, - array( - 'getId' => 0, - 'load' => $this->_customerModelMock, - 'getRpToken' => $resetToken, - 'isResetPasswordLinkTokenExpired' => false - ) - ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieve') + ->will($this->throwException(new NoSuchEntityException('customerId', 1))); $customerService = $this->_createService(); try { $customerService->validateResetPasswordLinkToken(1, $resetToken); $this->fail("Expected NoSuchEntityException not caught"); - } catch (\Magento\Exception\NoSuchEntityException $nsee) { - $this->assertSame($nsee->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); - $this->assertSame($nsee->getParams(), array('customerId' => self::ID)); + } catch (\Magento\Exception\NoSuchEntityException $e) { + $this->assertSame($e->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); + $this->assertSame( + $e->getParams(), + [ + 'customerId' => self::ID, + ] + ); } } @@ -648,21 +654,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testSendPasswordResetLink() { $email = 'foo@example.com'; - $this->_mockReturnValue( - $this->_customerModelMock, - array( - 'getId' => self::ID, - 'setWebsiteId' => $this->_customerModelMock, - 'loadByEmail' => $this->_customerModelMock - ) - ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); $this->_customerModelMock->expects($this->once())->method('sendPasswordResetConfirmationEmail'); @@ -670,40 +661,36 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $customerService->initiatePasswordReset( $email, - self::WEBSITE_ID, - CustomerAccountServiceInterface::EMAIL_RESET + CustomerAccountServiceInterface::EMAIL_RESET, + self::WEBSITE_ID ); } public function testSendPasswordResetLinkBadEmailOrWebsite() { $email = 'foo@example.com'; - $this->_mockReturnValue( - $this->_customerModelMock, - array( - 'getId' => 0, - 'setWebsiteId' => $this->_customerModelMock, - 'loadByEmail' => $this->_customerModelMock - ) - ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieveByEmail') + ->will($this->throwException((new NoSuchEntityException('email', $email))->addField('websiteId', 0))); $this->_customerModelMock->expects($this->never())->method('sendPasswordResetConfirmationEmail'); $customerService = $this->_createService(); try { - $customerService->initiatePasswordReset($email, 0, CustomerAccountServiceInterface::EMAIL_RESET); + $customerService->initiatePasswordReset($email, CustomerAccountServiceInterface::EMAIL_RESET, 0); $this->fail("Expected NoSuchEntityException not caught"); - } catch (\Magento\Exception\NoSuchEntityException $nsee) { - $this->assertSame($nsee->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); - $this->assertSame($nsee->getParams(), array('email' => $email, 'websiteId' => 0)); + } catch (\Magento\Exception\NoSuchEntityException $e) { + $this->assertSame($e->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); + $this->assertSame( + $e->getParams(), + [ + 'email' => $email, + 'websiteId' => 0 + ] + ); } } @@ -722,28 +709,20 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase 'loadByEmail' => $this->_customerModelMock ) ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_customerModelMock)); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'sendPasswordResetConfirmationEmail' - )->will( - $this->throwException(new \Magento\Model\Exception(__('Invalid transactional email code: %1', 0))) - ); + $this->_customerModelMock->expects($this->once()) + ->method('sendPasswordResetConfirmationEmail') + ->will($this->throwException(new \Magento\Model\Exception(__('Invalid transactional email code: %1', 0)))); $customerService = $this->_createService(); $customerService->initiatePasswordReset( $email, - self::WEBSITE_ID, - CustomerAccountServiceInterface::EMAIL_RESET + CustomerAccountServiceInterface::EMAIL_RESET, + self::WEBSITE_ID ); } @@ -753,38 +732,28 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->_mockReturnValue( $this->_customerModelMock, array( - 'getId' => self::ID, + 'getId' => self::ID, 'setWebsiteId' => $this->_customerModelMock, - 'loadByEmail' => $this->_customerModelMock + 'loadByEmail' => $this->_customerModelMock, ) ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_customerModelMock)); $exception = new MailException(__('The mail server is down')); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'sendPasswordResetConfirmationEmail' - )->will( - $this->throwException($exception) - ); + $this->_customerModelMock->expects($this->once()) + ->method('sendPasswordResetConfirmationEmail') + ->will($this->throwException($exception)); - $this->_loggerMock->expects($this->once())->method('logException')->with($exception); + $this->_loggerMock->expects($this->once()) + ->method('logException') + ->with($exception); $customerService = $this->_createService(); - $customerService->initiatePasswordReset( - $email, - self::WEBSITE_ID, - CustomerAccountServiceInterface::EMAIL_RESET - ); + $customerService->initiatePasswordReset($email, CustomerAccountServiceInterface::EMAIL_RESET, self::WEBSITE_ID); } public function testResetPassword() @@ -952,23 +921,12 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase { $resetToken = 'lsdj579slkj5987slkj595lkj'; $password = 'password_secret'; + $invalidCustomerId = 4200; - $this->_mockReturnValue( - $this->_customerModelMock, - array( - 'getId' => 0, - 'load' => $this->_customerModelMock, - 'getRpToken' => $resetToken, - 'isResetPasswordLinkTokenExpired' => false - ) - ); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieve') + ->will($this->throwException(new NoSuchEntityException('customerId', $invalidCustomerId))); $this->_customerModelMock->expects($this->never())->method('setRpToken'); $this->_customerModelMock->expects($this->never())->method('setRpTokenCreatedAt'); @@ -977,11 +935,16 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $customerService = $this->_createService(); try { - $customerService->resetPassword(4200, $resetToken, $password); + $customerService->resetPassword($invalidCustomerId, $resetToken, $password); $this->fail("Expected NoSuchEntityException not caught"); - } catch (\Magento\Exception\NoSuchEntityException $nsee) { - $this->assertSame($nsee->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); - $this->assertSame($nsee->getParams(), array('customerId' => 4200)); + } catch (\Magento\Exception\NoSuchEntityException $e) { + $this->assertSame($e->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); + $this->assertSame( + $e->getParams(), + [ + 'customerId' => $invalidCustomerId, + ] + ); } } @@ -1026,15 +989,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testResendConfirmation() { - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(55)); - $this->_customerModelMock->expects($this->once())->method('setWebsiteId')->will($this->returnSelf()); $this->_customerModelMock->expects( $this->any() )->method( @@ -1056,23 +1010,25 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testResendConfirmationNoEmail() { - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $this->_customerModelMock->expects($this->once())->method('getId')->will($this->returnValue(0)); - $this->_customerModelMock->expects($this->once())->method('setWebsiteId')->will($this->returnSelf()); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieveByEmail') + ->will( + $this->throwException( + (new NoSuchEntityException('email', self::EMAIL))->addField('websiteId', self::WEBSITE_ID) + ) + ); $customerService = $this->_createService(); try { $customerService->resendConfirmation('email@no.customer', 1); $this->fail("Expected NoSuchEntityException not caught"); - } catch (NoSuchEntityException $nsee) { - $expectedParams = array('email' => 'email@no.customer', 'websiteId' => 1); - $this->assertEquals($expectedParams, $nsee->getParams()); + } catch (NoSuchEntityException $e) { + $expectedParams = [ + 'email' => self::EMAIL, + 'websiteId' => self::WEBSITE_ID + ]; + $this->assertEquals($expectedParams, $e->getParams()); } } @@ -1082,60 +1038,33 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ public function testResendConfirmationNotNeeded() { - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $this->_customerModelMock->expects($this->once())->method('getId')->will($this->returnValue(55)); - $this->_customerModelMock->expects($this->once())->method('setWebsiteId')->with(2)->will($this->returnSelf()); - $customerService = $this->_createService(); $customerService->resendConfirmation('email@test.com', 2); } public function testResendConfirmationWithMailException() { - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(55)); - $this->_customerModelMock->expects($this->once())->method('setWebsiteId')->will($this->returnSelf()); - $this->_customerModelMock->expects( - $this->any() - )->method( - 'isConfirmationRequired' - )->will( - $this->returnValue(true) - ); - $this->_customerModelMock->expects( - $this->any() - )->method( - 'getConfirmation' - )->will( - $this->returnValue('123abc') - ); + $this->_customerModelMock->expects($this->any()) + ->method('isConfirmationRequired') + ->will($this->returnValue(true)); + $this->_customerModelMock->expects($this->any()) + ->method('getConfirmation') + ->will($this->returnValue('123abc')); $exception = new MailException(__('The mail server is down')); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'sendNewAccountEmail' - )->withAnyParameters()->will( - $this->throwException($exception) - ); + $this->_customerModelMock->expects($this->once()) + ->method('sendNewAccountEmail') + ->withAnyParameters() + ->will($this->throwException($exception)); - $this->_loggerMock->expects($this->once())->method('logException')->with($exception); + $this->_loggerMock->expects($this->once()) + ->method('logException') + ->with($exception); $customerService = $this->_createService(); $customerService->resendConfirmation('email', 1); + // If we call sendNewAccountEmail and no exception is returned, the test succeeds } /** @@ -1145,23 +1074,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testGetConfirmationStatus($expected) { $customerId = 1234; - $this->_customerFactoryMock->expects( - $this->once() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'load' - )->with( - $customerId - )->will( - $this->returnSelf() - ); - $this->_customerModelMock->expects($this->once())->method('getId')->will($this->returnValue($customerId)); if (CustomerAccountServiceInterface::ACCOUNT_CONFIRMED == $expected) { $this->_customerModelMock->expects( $this->once() @@ -1217,19 +1129,8 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ public function testCanModify($isBoolean) { - $this->_mockReturnValue($this->_customerModelMock, array('getId' => self::ID)); - - $this->_customerModelMock->expects($this->once())->method('load')->with(self::ID)->will($this->returnSelf()); $this->_customerModelMock->expects($this->once())->method('isReadonly')->will($this->returnValue($isBoolean)); - $this->_customerFactoryMock->expects( - $this->once() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $customerService = $this->_createService(); $this->assertEquals(!$isBoolean, $customerService->canModify(self::ID)); } @@ -1243,7 +1144,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase { $this->_mockReturnValue($this->_customerModelMock, array('getId' => self::ID)); - $this->_customerModelMock->expects($this->once())->method('load')->with(self::ID)->will($this->returnSelf()); $this->_customerModelMock->expects( $this->once() )->method( @@ -1252,14 +1152,6 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->returnValue($isBoolean) ); - $this->_customerFactoryMock->expects( - $this->once() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - $customerService = $this->_createService(); $this->assertEquals($isBoolean, $customerService->canDelete(self::ID)); } @@ -1274,7 +1166,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase return array('true' => array(true), 'false' => array(false)); } - public function testSaveCustomer() + public function testCreateCustomer() { $customerData = array( 'customer_id' => self::ID, @@ -1286,6 +1178,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); $this->_customerFactoryMock->expects( $this->any() @@ -1295,6 +1188,16 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->_customerModelMock) ); + $this->_converter = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); + $this->_converter + ->expects($this->once()) + ->method('createCustomerFromModel') + ->will($this->returnValue($customerEntity)); + $this->_converter + ->expects($this->any()) + ->method('getCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); + $this->_mockReturnValue( $this->_customerModelMock, array( @@ -1318,64 +1221,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); // verify - $this->_customerModelMock->expects($this->atLeastOnce())->method('setData'); - - $customerService = $this->_createService(); - - $this->assertEquals(self::ID, $customerService->saveCustomer($customerEntity)); - } - - public function testSaveNonexistingCustomer() - { - $customerData = array( - 'customer_id' => self::ID, - 'email' => self::EMAIL, - 'firstname' => self::FIRSTNAME, - 'lastname' => self::LASTNAME, - 'create_in' => 'Admin', - 'password' => 'password' - ); - $this->_customerBuilder->populateWithArray($customerData); - $customerEntity = $this->_customerBuilder->create(); - - $this->_customerFactoryMock->expects( - $this->atLeastOnce() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - - $this->_mockReturnValue( - $this->_customerModelMock, - array( - 'getId' => '2', - 'getEmail' => self::EMAIL, - 'getFirstname' => self::FIRSTNAME, - 'getLastname' => self::LASTNAME - ) - ); - - $mockAttribute = $this->getMockBuilder( - 'Magento\Customer\Service\V1\Data\Eav\AttributeMetadata' - )->disableOriginalConstructor()->getMock(); - $this->_customerMetadataService->expects( - $this->any() - )->method( - 'getCustomerAttributeMetadata' - )->will( - $this->returnValue($mockAttribute) - ); - - // verify - $this->_customerModelMock->expects($this->atLeastOnce())->method('setData'); + $this->_converter + ->expects($this->once()) + ->method('createCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); $customerService = $this->_createService(); - $this->assertEquals(2, $customerService->saveCustomer($customerEntity)); + $this->assertSame($customerEntity, $customerService->createCustomer($customerDetails)); } - public function testSaveNewCustomer() + public function testCreateNewCustomer() { $customerData = array( 'email' => self::EMAIL, @@ -1386,6 +1242,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); + + $this->_converter = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); + $this->_converter + ->expects($this->once()) + ->method('createCustomerFromModel') + ->will($this->returnValue($customerEntity)); + $this->_converter + ->expects($this->any()) + ->method('getCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); $this->_customerFactoryMock->expects( $this->any() @@ -1417,18 +1284,21 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); // verify - $this->_customerModelMock->expects($this->atLeastOnce())->method('setData'); + $this->_converter + ->expects($this->once()) + ->method('createCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); $customerService = $this->_createService(); - $this->assertEquals(self::ID, $customerService->saveCustomer($customerEntity)); + $this->assertSame($customerEntity, $customerService->createCustomer($customerDetails)); } /** * @expectedException \Exception * @expectedExceptionMessage exception message */ - public function testSaveCustomerWithException() + public function testCreateCustomerWithException() { $customerData = array( 'email' => self::EMAIL, @@ -1439,6 +1309,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); + + $this->_converter = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); + $this->_converter + ->expects($this->once()) + ->method('createCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); + $this->_converter + ->expects($this->any()) + ->method('getCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); $this->_customerFactoryMock->expects( $this->any() @@ -1469,21 +1350,16 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $this->returnValue($mockAttribute) ); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'save' - )->will( - $this->throwException(new \Exception('exception message')) - ); + $this->_converter + ->expects($this->once()) + ->method('createCustomerFromModel') + ->will($this->throwException(new \Exception('exception message'))); - // verify $customerService = $this->_createService(); - - $customerService->saveCustomer($customerEntity); + $customerService->createCustomer($customerDetails); } - public function testSaveCustomerWithInputException() + public function testCreateCustomerWithInputException() { $customerData = array( 'email' => self::EMAIL, @@ -1494,6 +1370,13 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerBuilder->populateWithArray($customerData); $customerEntity = $this->_customerBuilder->create(); + $customerDetails = $this->_customerDetailsBuilder->setCustomer($customerEntity)->create(); + + $this->_converter = $this->getMock('Magento\Customer\Model\Converter', [], [], '', false); + $this->_converter + ->expects($this->once()) + ->method('createCustomerModel') + ->will($this->returnValue($this->_customerModelMock)); $this->_customerFactoryMock->expects( $this->any() @@ -1521,7 +1404,7 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase $customerService = $this->_createService(); try { - $customerService->saveCustomer($customerEntity); + $customerService->createCustomer($customerDetails); } catch (InputException $inputException) { $this->assertContains( array('fieldName' => 'firstname', 'code' => InputException::REQUIRED_FIELD, 'value' => null), @@ -1657,12 +1540,11 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $customerService = $this->_createService(); - $searchBuilder = new Data\SearchCriteriaBuilder(new AndGroupBuilder(new FilterBuilder())); $filterBuilder = new FilterBuilder(); $filter = $filterBuilder->setField('email')->setValue('customer@search.example.com')->create(); - $searchBuilder->addFilter($filter); + $this->_searchBuilder->addFilter([$filter]); - $searchResults = $customerService->searchCustomers($searchBuilder->create()); + $searchResults = $customerService->searchCustomers($this->_searchBuilder->create()); $this->assertEquals(0, $searchResults->getTotalCount()); } @@ -1728,35 +1610,27 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase ); $customerService = $this->_createService(); - $searchBuilder = new Data\SearchCriteriaBuilder(new AndGroupBuilder(new FilterBuilder())); $filterBuilder = new FilterBuilder(); $filter = $filterBuilder->setField('email')->setValue(self::EMAIL)->create(); - $searchBuilder->addFilter($filter); + $this->_searchBuilder->addFilter([$filter]); - $searchResults = $customerService->searchCustomers($searchBuilder->create()); + $searchResults = $customerService->searchCustomers($this->_searchBuilder->create()); $this->assertEquals(1, $searchResults->getTotalCount()); $this->assertEquals(self::EMAIL, $searchResults->getItems()[0]->getCustomer()->getEmail()); } public function testGetCustomerDetails() { - $customerMock = $this->getMockBuilder( - '\Magento\Customer\Service\V1\Data\Customer' - )->disableOriginalConstructor()->getMock(); - $addressMock = $this->getMockBuilder( - '\Magento\Customer\Service\V1\Data\Address' - )->disableOriginalConstructor()->getMock(); - $this->_converter = $this->getMockBuilder( - '\Magento\Customer\Model\Converter' - )->disableOriginalConstructor()->getMock(); + $customerMock = $this->getMockBuilder('\Magento\Customer\Service\V1\Data\Customer') + ->disableOriginalConstructor() + ->getMock(); + $addressMock = $this->getMockBuilder('\Magento\Customer\Service\V1\Data\Address') + ->disableOriginalConstructor() + ->getMock(); + $this->_converter = $this->getMockBuilder('\Magento\Customer\Model\Converter') + ->disableOriginalConstructor() + ->getMock(); $service = $this->_createService(); - $this->_converter->expects( - $this->once() - )->method( - 'getCustomerModel' - )->will( - $this->returnValue($this->_customerModelMock) - ); $this->_converter->expects( $this->once() )->method( @@ -1781,23 +1655,20 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ public function testGetCustomerDetailsWithException() { - $customerMock = $this->getMockBuilder( - '\Magento\Customer\Service\V1\Data\Customer' - )->disableOriginalConstructor()->getMock(); - $addressMock = $this->getMockBuilder( - '\Magento\Customer\Service\V1\Data\Address' - )->disableOriginalConstructor()->getMock(); - $this->_converter = $this->getMockBuilder( - '\Magento\Customer\Model\Converter' - )->disableOriginalConstructor()->getMock(); + $customerMock = $this->getMockBuilder('\Magento\Customer\Service\V1\Data\Customer') + ->disableOriginalConstructor() + ->getMock(); + $addressMock = $this->getMockBuilder('\Magento\Customer\Service\V1\Data\Address') + ->disableOriginalConstructor() + ->getMock(); + $this->_converter = $this->getMockBuilder('\Magento\Customer\Model\Converter') + ->disableOriginalConstructor() + ->getMock(); $service = $this->_createService(); - $this->_converter->expects( - $this->once() - )->method( - 'getCustomerModel' - )->will( - $this->throwException(new \Magento\Exception\NoSuchEntityException('testField', 'value')) - ); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieve') + ->will($this->throwException(new NoSuchEntityException('customerId', 1))); $this->_converter->expects( $this->any() )->method( @@ -1817,21 +1688,25 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase public function testIsEmailAvailable() { - $this->_converter = $this->getMockBuilder( - '\Magento\Customer\Model\Converter' - )->disableOriginalConstructor()->getMock(); $service = $this->_createService(); - $this->_converter->expects( - $this->once() - )->method( - 'getCustomerModelByEmail' - )->will( - $this->throwException(new \Magento\Exception\NoSuchEntityException('testField', 'value')) - ); - $this->assertTrue($service->isEmailAvailable('email', 1)); + $this->_customerRegistry + ->expects($this->any()) + ->method('retrieveByEmail') + ->will( + $this->throwException( + (new NoSuchEntityException('email', self::EMAIL))->addField('websiteId', self::WEBSITE_ID) + ) + ); + $this->assertTrue($service->isEmailAvailable(self::EMAIL, self::WEBSITE_ID)); } public function testIsEmailAvailableNegative() + { + $service = $this->_createService(); + $this->assertFalse($service->isEmailAvailable('email', 1)); + } + + public function testIsEmailAvailableDefaultWebsite() { $customerMock = $this->getMockBuilder( '\Magento\Customer\Service\V1\Data\Customer' @@ -1840,69 +1715,61 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase '\Magento\Customer\Model\Converter' )->disableOriginalConstructor()->getMock(); $service = $this->_createService(); - $this->_converter->expects( + + $defaultWebsiteId = 7; + $this->_storeMock->expects($this->once())->method('getWebSiteId')->will($this->returnValue($defaultWebsiteId)); + $this->_customerRegistry->expects( $this->once() - )->method( - 'getCustomerModelByEmail' - )->will( - $this->returnValue($customerMock) - ); - $this->assertFalse($service->isEmailAvailable('email', 1)); + )->method('retrieveByEmail')->with('email', $defaultWebsiteId)->will($this->returnValue($customerMock)); + $this->assertFalse($service->isEmailAvailable('email')); } public function testCreateAccountMailException() { - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->_customerModelMock)); // This is to get the customer model through validation - $this->_customerModelMock->expects($this->any())->method('getFirstname')->will($this->returnValue('John')); + $this->_customerModelMock->expects($this->any()) + ->method('getFirstname') + ->will($this->returnValue('John')); - $this->_customerModelMock->expects($this->any())->method('getLastname')->will($this->returnValue('Doe')); + $this->_customerModelMock->expects($this->any()) + ->method('getLastname') + ->will($this->returnValue('Doe')); - $this->_customerModelMock->expects( - $this->any() - )->method( - 'getEmail' - )->will( - $this->returnValue('somebody@example.com') - ); + $this->_customerModelMock->expects($this->any()) + ->method('getEmail') + ->will($this->returnValue('somebody@example.com')); - // This is to get the customer model through Converter::getCustomerModel - $this->_customerModelMock->expects($this->once())->method('load')->will($this->returnSelf()); + - $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(true)); + $this->_customerModelMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue(true)); $exception = new MailException(__('The mail server is down')); - $this->_customerModelMock->expects( - $this->once() - )->method( - 'sendNewAccountEmail' - )->will( - $this->throwException($exception) - ); + $this->_customerModelMock->expects($this->once()) + ->method('sendNewAccountEmail') + ->will($this->throwException($exception)); - $this->_loggerMock->expects($this->once())->method('logException')->with($exception); + $this->_loggerMock->expects($this->once()) + ->method('logException') + ->with($exception); $mockCustomer = $this->getMockBuilder('Magento\Customer\Service\V1\Data\Customer') ->disableOriginalConstructor() ->getMock(); - $mockCustomer->expects($this->any())->method('getStoreId')->will($this->returnValue(true)); + $mockCustomer->expects($this->any()) + ->method('getStoreId') + ->will($this->returnValue(true)); - $mockCustomer->expects( - $this->once() - )->method( - '__toArray' - )->will( - $this->returnValue(array('attributeSetId' => true)) - ); + $mockCustomer->expects($this->once()) + ->method('__toArray') + ->will($this->returnValue(['attributeSetId' => true])); $this->_customerModelMock->expects($this->once()) ->method('getAttributes') @@ -1911,14 +1778,17 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase /** * @var Data\CustomerDetails | \PHPUnit_Framework_MockObject_MockObject */ - $mockCustomerDetail = $this->getMockBuilder( - 'Magento\Customer\Service\V1\Data\CustomerDetails' - )->disableOriginalConstructor()->getMock(); + $mockCustomerDetail = $this->getMockBuilder('Magento\Customer\Service\V1\Data\CustomerDetails') + ->disableOriginalConstructor() + ->getMock(); - $mockCustomerDetail->expects($this->once())->method('getCustomer')->will($this->returnValue($mockCustomer)); + $mockCustomerDetail->expects($this->once()) + ->method('getCustomer') + ->will($this->returnValue($mockCustomer)); $service = $this->_createService(); - $service->createAccount($mockCustomerDetail, 'abc123'); + $service->createCustomer($mockCustomerDetail, 'abc123'); + // If we get no mail exception, the test in considered a success } private function _setupStoreMock() @@ -1956,24 +1826,20 @@ class CustomerAccountServiceTest extends \PHPUnit_Framework_TestCase */ private function _createService() { - $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $customerService = new CustomerAccountService( - $this->_customerFactoryMock, - $this->_eventManagerMock, - $this->_storeManagerMock, - $this->_mathRandomMock, - $this->_converter, - $this->_validator, - $objectManager->getObject('\Magento\Customer\Service\V1\Data\CustomerBuilder'), - $this->_customerDetailsBuilder, - new Data\SearchResultsBuilder, - new Data\CustomerValidationResultsBuilder(), - $this->_customerAddressServiceMock, - $this->_customerMetadataService, - $this->_urlMock, - $this->_loggerMock, - $this->_encryptorMock, - $this->_configShareMock + $customerService = $this->_objectManager->getObject('Magento\Customer\Service\V1\CustomerAccountService', + [ + 'customerFactory' => $this->_customerFactoryMock, + 'storeManager' => $this->_storeManagerMock, + 'converter' => $this->_converter, + 'searchResultsBuilder' => new Data\SearchResultsBuilder, + 'customerBuilder' => $this->_customerBuilder, + 'customerDetailsBuilder' => $this->_customerDetailsBuilder, + 'customerAddressService' => $this->_customerAddressServiceMock, + 'customerMetadataService' => $this->_customerMetadataService, + 'customerRegistry' => $this->_customerRegistry, + 'encryptor' => $this->_encryptorMock, + 'logger' => $this->_loggerMock + ] ); return $customerService; } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php index 10096a75c5e36139e419d9bb7e4824b6625b0060..3d429f4c9a3bdecbf67f7cbe5eed7dc1ff27e3ef 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerAddressServiceTest.php @@ -79,9 +79,14 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase private $_customerFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\AddressFactory + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\AddressRegistry */ - private $_addressFactoryMock; + private $_addressRegistryMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\CustomerRegistry + */ + private $_customerRegistryMock; /** * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\Customer @@ -179,11 +184,15 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase ) )->getMock(); - $this->_addressFactoryMock = $this->getMockBuilder( - 'Magento\Customer\Model\AddressFactory' - )->disableOriginalConstructor()->setMethods( - array('create') - )->getMock(); + $this->_addressRegistryMock = $this->getMockBuilder('Magento\Customer\Model\AddressRegistry') + ->disableOriginalConstructor() + ->setMethods(array('retrieve', 'remove')) + ->getMock(); + + $this->_customerRegistryMock = $this->getMockBuilder('Magento\Customer\Model\CustomerRegistry') + ->disableOriginalConstructor() + ->setMethods(array('retrieve', 'remove')) + ->getMock(); $this->_directoryData = $this->getMockBuilder( '\Magento\Directory\Helper\Data' @@ -262,6 +271,8 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testGetAddressesDefaultBilling() { + $customerId = 1; + $addressMock = $this->_createAddress(1, 'John'); $this->_customerModelMock->expects( $this->any() @@ -280,13 +291,11 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerModelMock->expects($this->any())->method('getDefaultBilling')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getDefaultShipping')->will($this->returnValue(0)); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with($customerId) + ->will($this->returnValue($this->_customerModelMock)); + $this->_addressConverterMock->expects( $this->once() )->method( @@ -301,7 +310,6 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $customerService = $this->_createService(); - $customerId = 1; $address = $customerService->getDefaultBillingAddress($customerId); $this->assertEquals('address', $address); @@ -309,6 +317,8 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testGetAddressesDefaultShipping() { + $customerId = 1; + $addressMock = $this->_createAddress(1, 'John'); $this->_customerModelMock->expects( $this->any() @@ -327,25 +337,14 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerModelMock->expects($this->any())->method('getDefaultShipping')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getDefaultBilling')->will($this->returnValue(0)); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); - - $this->_addressConverterMock->expects( - $this->once() - )->method( - 'createAddressFromModel' - )->with( - $addressMock, - 0, - 1 - )->will( - $this->returnValue('address') - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with($customerId) + ->will($this->returnValue($this->_customerModelMock)); + $this->_addressConverterMock->expects($this->once()) + ->method('createAddressFromModel') + ->with($addressMock, 0, 1) + ->will($this->returnValue('address')); $customerService = $this->_createService(); @@ -359,7 +358,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase { $addressMock = $this->_createAddress(1, 'John'); $addressMock->expects($this->any())->method('getCustomerId')->will($this->returnValue(self::ID)); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($addressMock)); + $this->_addressRegistryMock->expects($this->once()) + ->method('retrieve') + ->will($this->returnValue($addressMock)); $this->_customerModelMock->expects( $this->any() )->method( @@ -370,13 +371,10 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getDefaultShipping')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getDefaultBilling')->will($this->returnValue(0)); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(self::ID) + ->will($this->returnValue($this->_customerModelMock)); $this->_addressConverterMock->expects( $this->once() )->method( @@ -398,6 +396,8 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testGetAddresses() { + $customerId = 1; + $addressMock = $this->_createAddress(1, 'John'); $addressMock2 = $this->_createAddress(2, 'Genry'); $this->_customerModelMock->expects( @@ -407,7 +407,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_customerModelMock) ); - $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); + $this->_customerModelMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue($customerId)); $this->_customerModelMock->expects( $this->any() )->method( @@ -417,13 +419,10 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase ); $this->_customerModelMock->expects($this->any())->method('getDefaultShipping')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getDefaultBilling')->will($this->returnValue(2)); - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with($customerId) + ->will($this->returnValue($this->_customerModelMock)); $this->_addressConverterMock->expects( $this->at(0) @@ -458,22 +457,26 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testSaveAddresses() { // Setup Customer mock - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(1) + ->will($this->returnValue($this->_customerModelMock)); $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getAddresses')->will($this->returnValue(array())); // Setup address mock $mockAddress = $this->_createAddress(1, 'John'); - $mockAddress->expects($this->once())->method('save'); - $mockAddress->expects($this->any())->method('setData'); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($mockAddress)); + $mockAddress->expects($this->once()) + ->method('save'); + $mockAddress->expects($this->any()) + ->method('setData'); + $mockAddress->expects($this->any()) + ->method('setCustomer'); + $this->_addressConverterMock->expects($this->once()) + ->method('createAddressModel') + ->will($this->returnValue($mockAddress)); + $customerService = $this->_createService(); $this->_addressBuilder->setFirstname( @@ -503,13 +506,10 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $mockAddress = $this->_createAddress(1, 'John'); // Setup Customer mock - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(1) + ->will($this->returnValue($this->_customerModelMock)); $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); $this->_customerModelMock->expects( @@ -571,13 +571,10 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testSaveAddressesIdSetButNotAlreadyExisting() { // Setup Customer mock - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(1) + ->will($this->returnValue($this->_customerModelMock)); $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getAddresses')->will($this->returnValue(array())); @@ -595,7 +592,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase $mockAddress = $this->_createAddress(1, 'John'); $mockAddress->expects($this->once())->method('save'); $mockAddress->expects($this->any())->method('setData'); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($mockAddress)); + $this->_addressConverterMock->expects($this->once()) + ->method('createAddressModel') + ->will($this->returnValue($mockAddress)); $customerService = $this->_createService(); $this->_addressBuilder->setId( @@ -623,14 +622,13 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testSaveAddressesCustomerIdNotExist() { + $expectedException = new \Magento\Exception\NoSuchEntityException('customerId', 4200); + // Setup Customer mock - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(4200) + ->will($this->throwException($expectedException)); $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(0)); $this->_customerModelMock->expects($this->any())->method('getAddresses')->will($this->returnValue(array())); @@ -665,11 +663,8 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase try { $customerService->saveAddresses(4200, array($this->_addressBuilder->create())); $this->fail("Expected NoSuchEntityException not caught"); - } catch (\Magento\Exception\NoSuchEntityException $nsee) { - $this->assertSame($nsee->getCode(), \Magento\Exception\NoSuchEntityException::NO_SUCH_ENTITY); - $this->assertSame($nsee->getParams(), array('customerId' => 4200)); - } catch (\Exception $unexpected) { - $this->fail('Unexpected exception type thrown. ' . $unexpected->getMessage()); + } catch (\Magento\Exception\NoSuchEntityException $e) { + $this->assertSame($e, $expectedException); } } @@ -678,7 +673,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase // Setup address mock $mockAddress = $this->_createAddress(1, 'John'); $mockAddress->expects($this->any())->method('getCustomerId')->will($this->returnValue(self::ID)); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($mockAddress)); + $this->_addressRegistryMock->expects($this->once()) + ->method('retrieve') + ->will($this->returnValue($mockAddress)); // verify delete is called on the mock address model $mockAddress->expects($this->once())->method('delete'); @@ -692,7 +689,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase // Setup address mock $mockAddress = $this->_createAddress(0, ''); $mockAddress->expects($this->any())->method('getCustomerId')->will($this->returnValue(self::ID)); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($mockAddress)); + $this->_addressRegistryMock->expects($this->once()) + ->method('retrieve') + ->will($this->throwException(new \Magento\Exception\NoSuchEntityException('addressId', 2))); // verify delete is called on the mock address model $mockAddress->expects($this->never())->method('delete'); @@ -710,20 +709,19 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase public function testSaveAddressesWithValidatorException() { // Setup Customer mock - $this->_customerFactoryMock->expects( - $this->any() - )->method( - 'create' - )->will( - $this->returnValue($this->_customerModelMock) - ); + $this->_customerRegistryMock->expects($this->once()) + ->method('retrieve') + ->with(1) + ->will($this->returnValue($this->_customerModelMock)); $this->_customerModelMock->expects($this->any())->method('load')->will($this->returnSelf()); $this->_customerModelMock->expects($this->any())->method('getId')->will($this->returnValue(1)); $this->_customerModelMock->expects($this->any())->method('getAddresses')->will($this->returnValue(array())); // Setup address mock, no first name $mockAddress = $this->_createAddress(1, ''); - $this->_addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($mockAddress)); + $this->_addressConverterMock->expects($this->once()) + ->method('createAddressModel') + ->will($this->returnValue($mockAddress)); $customerService = $this->_createService(); $this->_addressBuilder->setFirstname( @@ -861,9 +859,9 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase private function _createService() { $customerService = new CustomerAddressService( - $this->_addressFactoryMock, - $this->_customerConverter, + $this->_addressRegistryMock, $this->_addressConverterMock, + $this->_customerRegistryMock, $this->_directoryData ); return $customerService; @@ -917,7 +915,8 @@ class CustomerAddressServiceTest extends \PHPUnit_Framework_TestCase 'validate', 'getCountryModel', 'getRegionCollection', - 'getSize' + 'getSize', + 'setCustomer' ) )->getMock(); $addressMock->expects($this->any())->method('getId')->will($this->returnValue($addrId)); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerCurrentServiceTest.php b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerCurrentServiceTest.php index 8aa63b0280cf1c71c8c840994997393dcfba85c3..0b546fed3da0743f698e65ad06bea811795cb87f 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerCurrentServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Service/V1/CustomerCurrentServiceTest.php @@ -56,7 +56,7 @@ class CustomerCurrentServiceTest extends \PHPUnit_Framework_TestCase protected $customerServiceMock; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -66,7 +66,7 @@ class CustomerCurrentServiceTest extends \PHPUnit_Framework_TestCase protected $moduleManagerMock; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $viewMock; @@ -108,9 +108,9 @@ class CustomerCurrentServiceTest extends \PHPUnit_Framework_TestCase '', false ); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->moduleManagerMock = $this->getMock('Magento\Module\Manager', array(), array(), '', false); - $this->viewMock = $this->getMock('Magento\App\View', array(), array(), '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\View', array(), array(), '', false); $this->customerCurrentService = new \Magento\Customer\Service\V1\CustomerCurrentService( $this->customerSessionMock, diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php index 8150cbcfffcf2e7352cfe7f1ffa57ca753c088a8..5ce16a43c5c9f37ea41bfd68b1a7d0287560425a 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php @@ -84,7 +84,7 @@ class CustomTest extends \PHPUnit_Framework_TestCase $this->_model = $objectManagerHelper->getObject( 'Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Code\Custom', array( - 'config' => $this->getMock('Magento\App\Config\ScopeConfigInterface'), + 'config' => $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), 'formFactory' => $this->getMock('Magento\Data\FormFactory', array(), array(), '', false), 'urlBuilder' => $this->_urlBuilder, 'themeContext' => $this->_themeContext diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Files/ContentTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Files/ContentTest.php index f8e2b6202cce95604ccdcca72da050a045488dc7..1959420063e597e7827697424728f819c7150d69 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Files/ContentTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Files/ContentTest.php @@ -44,7 +44,7 @@ class ContentTest extends \PHPUnit_Framework_TestCase protected $_filesContent; /** - * @var \Magento\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject */ protected $_request; @@ -52,7 +52,7 @@ class ContentTest extends \PHPUnit_Framework_TestCase { $this->_helperStorage = $this->getMock('Magento\Theme\Helper\Storage', array(), array(), '', false); $this->_urlBuilder = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false); - $this->_request = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $constructArguments = $objectManagerHelper->getConstructArguments( diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php index 272cce9c8d75505d35c932b646d9f1febf0809a3..6fb805543cc3cb93d01718cb983d6fab61a0a494 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php @@ -46,7 +46,7 @@ class EditorTest extends \PHPUnit_Framework_TestCase { $this->_objectManagerMock = $this->getMock('Magento\ObjectManager'); - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects($this->any())->method('setActionName')->will($this->returnSelf()); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -224,7 +224,7 @@ class EditorTest extends \PHPUnit_Framework_TestCase $storeManager->expects($this->any())->method('getStore')->will($this->returnSelf()); $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); - $configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $authMock = $this->getMock('Magento\AuthorizationInterface'); $authMock->expects($this->any())->method('filterAclNodes')->will($this->returnSelf()); $backendSession = $this->getMock( @@ -251,7 +251,7 @@ class EditorTest extends \PHPUnit_Framework_TestCase $this->_getThemeCollectionFactory($countCustomization) ), array('Magento\TranslateInterface', $translate), - array('Magento\App\Config\ScopeConfigInterface', $configMock), + array('Magento\Framework\App\Config\ScopeConfigInterface', $configMock), array('Magento\Event\ManagerInterface', $eventManager), array('Magento\Store\Model\StoreManager', $storeManager), array('Magento\AuthorizationInterface', $authMock), diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php index b0629957cd45c86d1478056164b7092184ed0d24..3bac07ec31d26361ea46b6dd05fb5680a4f7ba73 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php @@ -56,7 +56,7 @@ class StandardTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param bool $isVde * @param bool $isLoggedIn * @param array $routers @@ -65,7 +65,7 @@ class StandardTest extends \PHPUnit_Framework_TestCase * @dataProvider matchDataProvider */ public function testMatch( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, $isVde, $isLoggedIn, array $routers = array(), @@ -91,19 +91,24 @@ class StandardTest extends \PHPUnit_Framework_TestCase $excludedRouters = array('admin' => 'admin router', 'vde' => 'vde router'); - $routerListMock = $this->getMock('\Magento\App\Route\ConfigInterface'); + $routerListMock = $this->getMock('\Magento\Framework\App\Route\ConfigInterface'); - $infoProcessorMock = $this->getMock('Magento\App\Request\PathInfoProcessorInterface'); + $infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); // test data to verify routers match logic $matchedRequest = $this->getMock( - 'Magento\App\Request\Http', + 'Magento\Framework\App\Request\Http', array('_isFrontArea'), array($routerListMock, $infoProcessorMock, $uri) ); - $matchedController = $this->getMockForAbstractClass('Magento\App\Action\AbstractAction', array(), '', false); + $matchedController = $this->getMockForAbstractClass( + 'Magento\Framework\App\Action\AbstractAction', + array(), + '', + false + ); // method "match" will be invoked for this router because it's first in the list $matchedRouter = $this->getMock('Magento\Core\App\Router\Base', array(), array(), '', false); @@ -130,13 +135,13 @@ class StandardTest extends \PHPUnit_Framework_TestCase array('matched' => $matchedRouter, 'not_matched' => $notMatchedRouter) ); - $infoProcessorMock = $this->getMock('Magento\App\Request\PathInfoProcessorInterface'); + $infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); $routers = array( 'not vde request' => array( '$request' => $this->getMock( - 'Magento\App\Request\Http', array('_isFrontArea'), array( + 'Magento\Framework\App\Request\Http', array('_isFrontArea'), array( $routerListMock, $infoProcessorMock, $notVdeUrl ) ), @@ -145,7 +150,7 @@ class StandardTest extends \PHPUnit_Framework_TestCase ), 'not logged as admin' => array( '$request' => $this->getMock( - 'Magento\App\Request\Http', + 'Magento\Framework\App\Request\Http', array('_isFrontArea'), array($routerListMock, $infoProcessorMock, $uri) ), @@ -154,7 +159,7 @@ class StandardTest extends \PHPUnit_Framework_TestCase ), 'no matched routers' => array( '$request' => $this->getMock( - 'Magento\App\Request\Http', + 'Magento\Framework\App\Request\Http', array('_isFrontArea'), array($routerListMock, $infoProcessorMock, $uri) ), @@ -174,14 +179,14 @@ class StandardTest extends \PHPUnit_Framework_TestCase } /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param bool $isVde * @param bool $isLoggedIn * @param array $routers * @return \Magento\DesignEditor\Controller\Varien\Router\Standard */ protected function _prepareMocksForTestMatch( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, $isVde, $isLoggedIn, array $routers @@ -193,7 +198,7 @@ class StandardTest extends \PHPUnit_Framework_TestCase $rewriteServiceMock = $this->getMock( 'Magento\UrlRewrite\App\Request\RewriteService', array(), array(), '', false ); - $routerListMock = $this->getMock('Magento\App\RouterList', + $routerListMock = $this->getMock('Magento\Framework\App\RouterList', array( 'current', 'next', diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Helper/DataTest.php index 8cb2d01af1ecd1969468f610864db7ba185408ce..6bb9cb7918a477ca6eb929ca643931bbbeb678aa 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Helper/DataTest.php @@ -50,7 +50,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $this->_context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); } protected function tearDown() @@ -73,7 +73,7 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testIsVdeRequest($path, $expected) { $this->_model = new \Magento\DesignEditor\Helper\Data($this->_context, self::TEST_FRONT_NAME); - $requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $requestMock->expects($this->once())->method('getOriginalPathInfo')->will($this->returnValue($path)); $this->assertEquals($expected, $this->_model->isVdeRequest($requestMock)); } diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php index 167efaa791faf9bfabe41745323973ac615d15ad..1ab2b7329e4314c0643bb9d2c5f13f37a6837e1c 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php @@ -102,7 +102,7 @@ class StateTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_configMock; @@ -149,7 +149,7 @@ class StateTest extends \PHPUnit_Framework_TestCase false ); $this->_cacheStateMock = $this->getMockBuilder( - 'Magento\App\Cache\StateInterface' + 'Magento\Framework\App\Cache\StateInterface' )->disableOriginalConstructor()->getMock(); $this->_dataHelper = $this->getMock( @@ -162,7 +162,7 @@ class StateTest extends \PHPUnit_Framework_TestCase $this->_objectManager = $this->getMock('Magento\ObjectManager'); - $mutableConfig = $this->getMockForAbstractClass('\Magento\App\Config\MutableScopeConfigInterface'); + $mutableConfig = $this->getMockForAbstractClass('\Magento\Framework\App\Config\MutableScopeConfigInterface'); $mutableConfig->expects( $this->any() )->method( @@ -175,7 +175,7 @@ class StateTest extends \PHPUnit_Framework_TestCase $this->returnSelf() ); - $this->_configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_configMock->expects( $this->any() )->method( @@ -299,7 +299,7 @@ class StateTest extends \PHPUnit_Framework_TestCase public function testUpdateNavigationMode() { $this->_setAdditionalExpectations(); - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects($this->once())->method('getPathInfo')->will($this->returnValue('/')); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Translate/Inline/ProviderTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Translate/Inline/ProviderTest.php index 99ba875304bb1993aba28f13ff02b016bf73276d..9941a5c826ffe9de7bf0b17833d7eaef35915d89 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Translate/Inline/ProviderTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Translate/Inline/ProviderTest.php @@ -37,7 +37,7 @@ class ProviderTest extends \PHPUnit_Framework_TestCase protected $translateInline; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -45,7 +45,7 @@ class ProviderTest extends \PHPUnit_Framework_TestCase { $this->translateVde = $this->getMock('Magento\DesignEditor\Model\Translate\Inline', [], [], '', false); $this->translateInline = $this->getMock('Magento\Translate\Inline', [], [], '', false); - $this->request = $this->getMock('Magento\App\RequestInterface', [], [], '', false); + $this->request = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); } /** diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php index b35875f98a8ec329e6f99793345f9797055bc21c..667b931e95d0e5ae6ddb96a6c559ad61a791f663 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php @@ -67,7 +67,7 @@ class NavigationModeTest extends \PHPUnit_Framework_TestCase $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_designHelperMock = $this->getMock('Magento\DesignEditor\Helper\Data', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_requestMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Dhl/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Dhl/Model/CarrierTest.php index 6609d010795f4e626317131d098e508705dbdd48..91793ff1e6253c83520e8dd30a1f7a66d90c2955 100644 --- a/dev/tests/unit/testsuite/Magento/Dhl/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Dhl/Model/CarrierTest.php @@ -50,7 +50,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase { $this->_helper = new \Magento\TestFramework\Helper\ObjectManager($this); $scopeConfig = $this->getMockBuilder( - '\Magento\App\Config\ScopeConfigInterface' + '\Magento\Framework\App\Config\ScopeConfigInterface' )->setMethods( array('isSetFlag', 'getValue') )->disableOriginalConstructor()->getMock(); @@ -143,7 +143,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase $this->returnValue(file_get_contents(__DIR__ . '/_files/countries.xml')) ); $filesystem = $this->getMockBuilder( - '\Magento\App\Filesystem' + '\Magento\Framework\App\Filesystem' )->disableOriginalConstructor()->setMethods( array('getDirectoryRead') )->getMock(); @@ -200,7 +200,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase public function testPrepareShippingLabelContent() { $xml = simplexml_load_file( - __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'response_shipping_label.xml' + __DIR__ . '/_files/response_shipping_label.xml' ); $result = $this->_invokePrepareShippingLabelContent($xml); $this->assertEquals(1111, $result->getTrackingNumber()); diff --git a/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php index 24b310b2d90ff920085a8e1bf38a51e51b250095..e6c74098be22245b7417e3a4960ac43a34d3be38 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Helper/DataTest.php @@ -46,7 +46,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected $_store; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_config; @@ -58,9 +58,9 @@ class DataTest extends \PHPUnit_Framework_TestCase public function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); - $configCacheType = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); + $configCacheType = $this->getMock('Magento\Framework\App\Cache\Type\Config', array(), array(), '', false); $this->_countryCollection = $this->getMock( 'Magento\Directory\Model\Resource\Country\Collection', @@ -100,7 +100,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $currencyFactory = $this->getMock('Magento\Directory\Model\CurrencyFactory', array(), array(), '', false); - $this->_config = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_config = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $arguments = array( 'context' => $context, diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/Currency/DefaultLocatorTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/Currency/DefaultLocatorTest.php index 4a046f93ffd94550550e6feac31d9e74148978d7..63baedcebc1bc69bfa4b76a3f1c796cc84b12a38 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Model/Currency/DefaultLocatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/Currency/DefaultLocatorTest.php @@ -52,7 +52,7 @@ class DefaultLocatorTest extends \PHPUnit_Framework_TestCase { $backendData = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false); $this->_requestMock = $this->getMockForAbstractClass( - 'Magento\App\RequestInterface', + 'Magento\Framework\App\RequestInterface', array($backendData), '', false, @@ -60,7 +60,7 @@ class DefaultLocatorTest extends \PHPUnit_Framework_TestCase true, array('getParam') ); - $this->_configMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false); $this->_model = new \Magento\Directory\Model\Currency\DefaultLocator( $this->_configMock, diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php new file mode 100644 index 0000000000000000000000000000000000000000..80c37d742bb4d648fdcb1e29c3037aa2cbbae9b9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php @@ -0,0 +1,226 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Directory + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Directory\Model; + +class PriceCurrencyTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var PriceCurrency + */ + protected $priceCurrency; + + /** + * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeManager; + + /** + * @var \Magento\Directory\Model\CurrencyFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $currencyFactory; + + public function setUp() + { + $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManager') + ->disableOriginalConstructor() + ->getMock(); + + $this->currencyFactory = $this->getMockBuilder('Magento\Directory\Model\CurrencyFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->logger = $this->getMockBuilder('Magento\Logger') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->priceCurrency = $objectManager->getObject('Magento\Directory\Model\PriceCurrency', array( + 'storeManager' => $this->storeManager, + 'currencyFactory' => $this->currencyFactory + )); + } + + public function testConvert() + { + $amount = 5.6; + $convertedAmount = 9.3; + + $currency = $this->getCurrentCurrencyMock(); + $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currency); + $store = $this->getStoreMock($baseCurrency); + + $this->assertEquals($convertedAmount, $this->priceCurrency->convert($amount, $store, $currency)); + } + + public function testConvertWithStoreCode() + { + $amount = 5.6; + $storeCode = 2; + $convertedAmount = 9.3; + + $currency = $this->getCurrentCurrencyMock(); + $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currency); + $store = $this->getStoreMock($baseCurrency); + + $this->storeManager->expects($this->once()) + ->method('getStore') + ->with($storeCode) + ->will($this->returnValue($store)); + + $this->assertEquals($convertedAmount, $this->priceCurrency->convert($amount, $storeCode, $currency)); + } + + public function testConvertWithCurrencyString() + { + $amount = 5.6; + $currency = 'ru'; + $convertedAmount = 9.3; + + $currentCurrency = $this->getCurrentCurrencyMock(); + $currentCurrency->expects($this->once()) + ->method('load') + ->with($currency) + ->will($this->returnSelf()); + + $this->currencyFactory->expects($this->once()) + ->method('create') + ->will($this->returnValue($currentCurrency)); + + $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currentCurrency); + $baseCurrency->expects($this->once()) + ->method('getRate') + ->with($currentCurrency) + ->will($this->returnValue(1.2)); + $store = $this->getStoreMock($baseCurrency); + + $this->assertEquals($convertedAmount, $this->priceCurrency->convert($amount, $store, $currency)); + } + + public function testConvertWithStoreCurrency() + { + $amount = 5.6; + $currency = null; + $convertedAmount = 9.3; + + $currentCurrency = $this->getCurrentCurrencyMock(); + $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currentCurrency); + $store = $this->getStoreMock($baseCurrency); + $store->expects($this->atLeastOnce()) + ->method('getCurrentCurrency') + ->will($this->returnValue($currentCurrency)); + + $this->assertEquals($convertedAmount, $this->priceCurrency->convert($amount, $store, $currency)); + } + + public function testFormat() + { + $amount = 5.6; + $precision = \Magento\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION; + $includeContainer = false; + $store = null; + $formattedAmount = '5.6 grn'; + + $currency = $this->getCurrentCurrencyMock(); + $currency->expects($this->once()) + ->method('formatPrecision') + ->with($amount, $precision, [], $includeContainer) + ->will($this->returnValue($formattedAmount)); + + $this->assertEquals($formattedAmount, $this->priceCurrency->format( + $amount, + $includeContainer, + $precision, + $store, + $currency + )); + } + + public function testConvertAndFormat() + { + $amount = 5.6; + $precision = \Magento\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION; + $includeContainer = false; + $store = null; + $convertedAmount = 9.3; + $formattedAmount = '9.3 grn'; + + $currency = $this->getCurrentCurrencyMock(); + $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currency); + $store = $this->getStoreMock($baseCurrency); + + $currency->expects($this->once()) + ->method('formatPrecision') + ->with($convertedAmount, $precision, [], $includeContainer) + ->will($this->returnValue($formattedAmount)); + + $this->assertEquals($formattedAmount, $this->priceCurrency->convertAndFormat( + $amount, + $includeContainer, + $precision, + $store, + $currency + )); + } + + protected function getCurrentCurrencyMock() + { + $currency = $this->getMockBuilder('Magento\Directory\Model\Currency') + ->disableOriginalConstructor() + ->getMock(); + + return $currency; + } + + protected function getStoreMock($baseCurrency) + { + $store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + + $store->expects($this->atLeastOnce()) + ->method('getBaseCurrency') + ->will($this->returnValue($baseCurrency)); + + return $store; + } + + protected function getBaseCurrencyMock($amount, $convertedAmount, $currency) + { + $baseCurrency = $this->getMockBuilder('Magento\Directory\Model\Currency') + ->disableOriginalConstructor() + ->getMock(); + + $baseCurrency->expects($this->once()) + ->method('convert') + ->with($amount, $currency) + ->will($this->returnValue($convertedAmount)); + + return $baseCurrency; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php index 0ed9b7c3ed297c54461e6647cae0e193897d3685..9355bc62298d081b584758ff1120eb3062b19f7e 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php @@ -56,7 +56,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $fetchStrategy = $this->getMockForAbstractClass('Magento\Data\Collection\Db\FetchStrategyInterface'); $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false); - $scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $countryFactory = $this->getMock( 'Magento\Directory\Model\Resource\CountryFactory', diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fbfabf1d167fb9dbee3aea0f9aeded3560b1471d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php @@ -0,0 +1,125 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Downloadable\Block\Catalog\Product; + +/** + * Tests Magento\Downloadable\Block\Catalog\Product\Links + */ +class LinksTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Downloadable\Block\Catalog\Product\Links */ + protected $linksBlock; + + /** + * @var \Magento\Downloadable\Model\Link|\PHPUnit_Framework_MockObject_MockObject + */ + protected $linkMock; + + /** + * @var \Magento\Downloadable\Pricing\Price\LinkPrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $linkPriceMock; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + public function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $contextMock = $this->getMock('Magento\Catalog\Block\Product\Context', [], [], '', false, false); + + $this->priceInfoMock = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->linkPriceMock = $this->getMock('Magento\Downloadable\Pricing\Price\LinkPrice', [], [], '', false); + $this->salableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->amountMock = $this->getMock('Magento\Pricing\Amount\Base', [], [], '', false); + $this->linkMock = $this->getMock('Magento\Downloadable\Model\Link', [], [], '', false); + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + $contextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + $data = [ + 'product' => $this->salableItemMock + ]; + + $this->linksBlock = $objectManager->getObject( + 'Magento\Downloadable\Block\Catalog\Product\Links', + [ + 'context' => $contextMock, + 'data' => $data + ] + ); + } + + public function testGetLinkPrice() + { + $priceCode = 'link_price'; + $arguments = []; + $expectedHtml = 'some html'; + $this->salableItemMock->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + $this->priceInfoMock->expects($this->any()) + ->method('getPrice') + ->with($this->equalTo($priceCode)) + ->will($this->returnValue($this->linkPriceMock)); + $this->linkPriceMock->expects($this->any()) + ->method('getLinkAmount') + ->with($this->linkMock) + ->will($this->returnValue($this->amountMock)); + + $priceBoxMock = $this->getMock('Magento\Pricing\Render', ['renderAmount'], [], '', false, false); + + $this->layout->expects($this->once()) + ->method('getBlock') + ->with($this->equalTo('product.price.render.default')) + ->will($this->returnValue($priceBoxMock)); + + $priceBoxMock->expects($this->once()) + ->method('renderAmount') + ->with($this->amountMock, $this->linkPriceMock, $this->salableItemMock, $arguments) + ->will($this->returnValue($expectedHtml)); + + $result = $this->linksBlock->getLinkPrice($this->linkMock); + $this->assertEquals($expectedHtml, $result); + } +} + \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php index 28497eeb986d01ebc3c6c69d103cd3c4b326c0e4..cff3ebbddd8c783a9935b46275c2fc72cb0395dd 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/DownloadableTest.php @@ -47,7 +47,7 @@ class DownloadableTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->productMock = $this->getMock( 'Magento\Catalog\Model\Product', array('setDownloadableData', '__wakeup'), diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Helper/DownloadTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Helper/DownloadTest.php index 1ef8ec76065097e5d32ac42e227a3c5bc42fc157..85a1e3235ce8bab2b7b070cb38e7918b879fbaae 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Helper/DownloadTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Helper/DownloadTest.php @@ -24,7 +24,7 @@ namespace Magento\Downloadable\Helper; use Magento\Downloadable\Helper\Download as DownloadHelper; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\File\ReadInterface as FileReadInterface; use Magento\Filesystem\Directory\ReadInterface as DirReadInterface; use Magento\Downloadable\Helper\File as DownloadableFile; @@ -70,7 +70,7 @@ class DownloadTest extends \PHPUnit_Framework_TestCase self::$functionExists = true; self::$mimeContentType = self::MIME_TYPE; - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_handleMock = $this->getMock('Magento\Filesystem\File\ReadInterface', array(), array(), '', false); $this->_workingDirectoryMock = $this->getMock( 'Magento\Filesystem\Directory\ReadInterface', @@ -82,11 +82,11 @@ class DownloadTest extends \PHPUnit_Framework_TestCase $this->_downloadableFileMock = $this->getMock('Magento\Downloadable\Helper\File', array(), array(), '', false); $this->_helper = new DownloadHelper( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false), $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), $this->_downloadableFileMock, $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false), - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $this->_filesystemMock ); } diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php index aa48f224a3ad4bc5da468268e7e7428a525e5282..0133702a510d7155f0f93f088c4da5bccdd3fe06 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php @@ -44,7 +44,9 @@ class TypeTest extends \PHPUnit_Framework_TestCase $fileStorageDb = $this->getMockBuilder( 'Magento\Core\Helper\File\Storage\Database' )->disableOriginalConstructor()->getMock(); - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/DownloadableTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/DownloadableTest.php index da55f92914551da567d891019ffcf3d3e738079c..a93c0a47219f25471ef7d2621881db1a4d7b5dd1 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/DownloadableTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTransitionManager/Plugin/DownloadableTest.php @@ -52,7 +52,7 @@ class DownloadableTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->model = new Downloadable($this->requestMock); $this->productMock = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Pricing/Price/LinkPriceTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Pricing/Price/LinkPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ad1e8723d0e5c72e0b4e299d104eed5ae3e512ef --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Pricing/Price/LinkPriceTest.php @@ -0,0 +1,96 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Downloadable\Pricing\Price; + +/** + * Class LinkPriceTest + * @package Magento\Downloadable\Pricing\Price + */ +class LinkPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Downloadable\Pricing\Price\LinkPrice + */ + protected $linkPrice; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculatorMock; + + /** + * @var \Magento\Downloadable\Model\Resource\Link|\PHPUnit_Framework_MockObject_MockObject + */ + protected $linkMock; + + /** + * Test setUp + */ + protected function setUp() + { + $this->salableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->amountMock = $this->getMock('Magento\Pricing\Amount\Base', [], [], '', false); + $this->calculatorMock = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + $this->linkMock = $this->getMock( + 'Magento\Downloadable\Model\Link', + ['getPrice', 'getProduct', '__wakeup'], + [], + '', + false + ); + + $this->linkPrice = new LinkPrice($this->salableItemMock, 1, $this->calculatorMock); + } + + public function testGetLinkAmount() + { + $amount = 100; + + $this->linkMock->expects($this->once()) + ->method('getPrice') + ->will($this->returnValue($amount)); + $this->linkMock->expects($this->once()) + ->method('getProduct') + ->will($this->returnValue($this->salableItemMock)); + $this->calculatorMock->expects($this->once()) + ->method('getAmount') + ->with($amount, $this->equalTo($this->salableItemMock)) + ->will($this->returnValue($amount)); + + $result = $this->linkPrice->getLinkAmount($this->linkMock); + $this->assertEquals($amount, $result); + } + +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Eav/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Eav/Helper/DataTest.php index 59421a4aaf6792df5e3a621b3496b9de0340c750..98207a4d09ce4eb67397ca37a105bbf79b7e0261 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Helper/DataTest.php @@ -41,9 +41,9 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $context = $this->getMock('\Magento\App\Helper\Context', [], [], '', false); + $context = $this->getMock('\Magento\Framework\App\Helper\Context', [], [], '', false); $attributeConfig = $this->getMock('\Magento\Eav\Model\Entity\Attribute\Config', [], [], '', false); - $scopeConfig = $this->getMock('\Magento\App\Config\ScopeConfigInterface', [], [], '', false); + $scopeConfig = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); $eavConfig = $this->getMock('\Magento\Eav\Model\Config', [], [], '', false); $this->_helper = new Data($context, $attributeConfig, $scopeConfig, $eavConfig); $this->_eavConfig = $eavConfig; diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php index 4d30e36a3298053f07860a9a2b284c5f116371fd..8836152147531c17f1209753dd98d564c5d335dd 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php @@ -39,7 +39,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $this->_model = $this->getMockForAbstractClass( 'Magento\Eav\Model\Entity\AbstractEntity', array( - $this->getMock('Magento\App\Resource', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false), $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false), $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', array(), array(), '', false), $this->getMock('\Magento\Locale\FormatInterface'), @@ -289,7 +289,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $attributes[$attributeCode] = $attribute; $data = array( - $this->getMock('Magento\App\Resource', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false), $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false), $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', array(), array(), '', false), $this->getMock('Magento\Locale\FormatInterface'), diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php index 8a8df1a9f341a1ff93604b8c168b3143247d6d7d..567645d1e4347c130bf83259c51be89a7f4624fe 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/ConfigTest.php @@ -73,7 +73,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); + $this->_cacheMock = $this->getMock('Magento\Framework\App\Cache\Type\Config', array(), array(), '', false); $this->_cacheId = 'eav_attributes'; $this->_cacheMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php index 5da51f14cec46920b609014a7502976b83dee527..e6e835f9b3d979b4eb3aff4def7c7d1e185ecb35 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php @@ -56,7 +56,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected $configMock; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $coreResourceMock; @@ -88,7 +88,13 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase ); $this->eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $this->configMock = $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false); - $this->coreResourceMock = $this->getMock('Magento\App\Resource', array('getConnection'), array(), '', false); + $this->coreResourceMock = $this->getMock( + 'Magento\Framework\App\Resource', + array('getConnection'), + array(), + '', + false + ); $this->resourceHelperMock = $this->getMock('Magento\Eav\Model\Resource\Helper', array(), array(), '', false); $this->validatorFactoryMock = $this->getMock( 'Magento\Validator\UniversalFactory', diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php index 1679301a3f7a24308f33c092f653d3a9abe8fd22..61637e983d949ea78de8f444185aae22d02b4e92 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php @@ -51,7 +51,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $eventManagerMock; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $coreResourceMock; @@ -88,7 +88,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ); $this->eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $this->coreResourceMock = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getConnection', 'getTableName'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php index 47d4bd915a7a5e51043200a820b79a7b0784b2cc..be370c7283f9708582d7205e9b7bf864a2905b30 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php @@ -263,9 +263,9 @@ class AttributeTest extends \PHPUnit_Framework_TestCase $this->returnValue(array(new \Magento\Object(array('id' => 0)), new \Magento\Object(array('id' => 1)))) ); - /** @var $resource \Magento\App\Resource */ + /** @var $resource \Magento\Framework\App\Resource */ $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php index d2e3564f8e14cf7f8a5ca666fb6836da8747788c..eda5a1e9c7b8647d011f412cd38d43151890ee9b 100644 --- a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php @@ -88,7 +88,7 @@ class EditTest extends \PHPUnit_Framework_TestCase $this->_emailConfigMock = $this->getMock('Magento\Email\Model\Template\Config', array(), array(), '', false); $this->filesystemMock = $this->getMock( - '\Magento\App\Filesystem', + '\Magento\Framework\App\Filesystem', array('getFilesystem', '__wakeup', 'getPath', 'getDirectoryRead'), array(), '', @@ -256,9 +256,9 @@ class EditTest extends \PHPUnit_Framework_TestCase public function testGetDefaultTemplatesAsOptionsArray() { $dirValueMap = array( - array(\Magento\App\Filesystem::ROOT_DIR, 'var/www/magento\rootdir/'), - array(\Magento\App\Filesystem::APP_DIR, 'var/www/magento\rootdir\app/'), - array(\Magento\App\Filesystem::THEMES_DIR, 'var\www/magento\rootdir\app/themes/') + array(\Magento\Framework\App\Filesystem::ROOT_DIR, 'var/www/magento\rootdir/'), + array(\Magento\Framework\App\Filesystem::APP_DIR, 'var/www/magento\rootdir\app/'), + array(\Magento\Framework\App\Filesystem::THEMES_DIR, 'var\www/magento\rootdir\app/themes/') ); $this->directoryMock = $this->getMock('\Magento\Filesystem\Directory\Read', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/FileIteratorTest.php b/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/FileIteratorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3c43453b312d3524d151443840c056bd09fa50dc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/FileIteratorTest.php @@ -0,0 +1,126 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Email\Model\Template\Config; + +/** + * Class FileIteratorTest + * @package Magento\Config + */ +class FileIteratorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var FileIterator + */ + protected $fileIterator; + + /** + * @var \Magento\Filesystem\Directory\Read | \PHPUnit_Framework_MockObject_MockObject + */ + protected $directoryMock; + + /** + * @var \Magento\Module\Dir\ReverseResolver | \PHPUnit_Framework_MockObject_MockObject + */ + protected $moduleDirResolverMock; + + /** + * Array of relative file paths + * + * @var array + */ + protected $filePaths; + + protected function setUp() + { + $this->filePaths = ['/file1', '/file2']; + $this->directoryMock = $this->getMock('Magento\Filesystem\Directory\Read', [], [], '', false); + $this->moduleDirResolverMock = $this->getMock('Magento\Module\Dir\ReverseResolver', [], [], '', false); + + $this->fileIterator = new FileIterator( + $this->directoryMock, + $this->filePaths, + $this->moduleDirResolverMock + ); + } + + protected function tearDown() + { + $this->fileIterator = null; + $this->directoryMock = null; + $this->filePaths = null; + $this->moduleDirResolverMock = null; + } + + public function testIterator() + { + $moduleName = 'Filesystem'; + $contents = ['<template 123>', '<template 321>']; + $expectedResult = ['<template module="'. $moduleName .'" 123>', '<template module="'. $moduleName .'" 321>']; + $directoryPath = 'directory/path'; + $index = 0; + $dirIndex = 0; + foreach ($this->filePaths as $filePath) { + $this->directoryMock->expects($this->at($dirIndex++)) + ->method('getAbsolutePath') + ->with($filePath) + ->will($this->returnValue($directoryPath . $filePath)); + $this->moduleDirResolverMock->expects($this->at($index)) + ->method('getModuleName') + ->with($directoryPath . $filePath) + ->will($this->returnValue($moduleName)); + $this->directoryMock->expects($this->at($dirIndex++)) + ->method('readFile') + ->with($filePath) + ->will($this->returnValue($contents[$index++])); + } + $index = 0; + foreach ($this->fileIterator as $fileContent) { + $this->assertEquals($expectedResult[$index++], $fileContent); + } + } + + public function testIteratorNegative() + { + $directoryPath = 'directory/path'; + $filePath = $this->filePaths[0]; + + $this->setExpectedException( + 'UnexpectedValueException', + sprintf("Unable to determine a module, file '%s' belongs to.", $filePath) + ); + + $this->directoryMock->expects($this->at(0)) + ->method('getAbsolutePath') + ->with($filePath) + ->will($this->returnValue($directoryPath . $filePath)); + $this->moduleDirResolverMock->expects($this->at(0)) + ->method('getModuleName') + ->with($directoryPath . $filePath) + ->will($this->returnValue(false)); + $this->directoryMock->expects($this->never()) + ->method('readFile'); + + $this->fileIterator->current(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/ReaderTest.php index 34eea9a466c1b3ff7925a9bb84bdfa3f085d8c31..3208480f2fcb6761dd9a0a62324ffe2cb4858320 100644 --- a/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Email/Model/Template/Config/ReaderTest.php @@ -128,16 +128,15 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function testRead() { - $this->_filesystemDirectoryMock->expects( - $this->at(0) + $this->at(1) )->method( 'readFile' )->will( $this->returnValue(file_get_contents($this->_paths[0])) ); $this->_filesystemDirectoryMock->expects( - $this->at(2) + $this->at(3) )->method( 'readFile' )->will( diff --git a/dev/tests/unit/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/unit/testsuite/Magento/Email/Model/TemplateTest.php index ad9b8a61cd9371d80006b830533f796764fc3a77..13cea82a3dbe167ff2333c0e39dd4b747dc288f0 100644 --- a/dev/tests/unit/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/Email/Model/TemplateTest.php @@ -50,10 +50,10 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->getMock('Magento\Registry', array(), array(), '', false), $this->getMock('Magento\Core\Model\App\Emulation', array(), array(), '', false), $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false), - $this->getMock('Magento\App\Filesystem', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false), $this->getMock('Magento\View\Url', array(), array(), '', false), $this->getMock('Magento\View\FileSystem', array(), array(), '', false), - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $this->getMock('Magento\Email\Model\Template\FilterFactory', array(), array(), '', false), $emailConfig, array('template_id' => 10) diff --git a/dev/tests/unit/testsuite/Magento/Event/Config/DataTest.php b/dev/tests/unit/testsuite/Magento/Event/Config/DataTest.php index a2f3cbd22e29caf96c673dcc681eabcea10f9c52..9ffbd48f40e7ceba933105b3f6445ac79fee5078 100644 --- a/dev/tests/unit/testsuite/Magento/Event/Config/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Event/Config/DataTest.php @@ -55,7 +55,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->_readerMock = $this->getMock('Magento\Event\Config\Reader', array(), array(), '', false); $this->_configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $this->_cacheMock = $this->getMock('Magento\Config\CacheInterface'); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_model = new \Magento\Event\Config\Data( $this->_readerMock, $this->_configScopeMock, diff --git a/dev/tests/unit/testsuite/Magento/Event/Invoker/InvokerDefaultTest.php b/dev/tests/unit/testsuite/Magento/Event/Invoker/InvokerDefaultTest.php index 3e0fa0eb004dc6d597b8b1ab1160f2cde8835cca..811b5b3aa89afaf9276930f3a41140cb063514c0 100644 --- a/dev/tests/unit/testsuite/Magento/Event/Invoker/InvokerDefaultTest.php +++ b/dev/tests/unit/testsuite/Magento/Event/Invoker/InvokerDefaultTest.php @@ -61,7 +61,7 @@ class InvokerDefaultTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_invokerDefault = new \Magento\Event\Invoker\InvokerDefault( $this->_observerFactoryMock, @@ -147,7 +147,7 @@ class InvokerDefaultTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEVELOPER) + $this->returnValue(\Magento\Framework\App\State::MODE_DEVELOPER) ); $this->_invokerDefault->dispatch( @@ -190,7 +190,7 @@ class InvokerDefaultTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_PRODUCTION) + $this->returnValue(\Magento\Framework\App\State::MODE_PRODUCTION) ); $this->_invokerDefault->dispatch( diff --git a/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php b/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php index 273b0814383b8dc8a314926f67def36d3b809d21..589505ca01e44d5254a16ef1534ccdc8c56c016c 100644 --- a/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php +++ b/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php @@ -46,6 +46,13 @@ class ReadTest extends \PHPUnit_Framework_TestCase */ protected $fileFactory; + /** + * Directory path + * + * @var string + */ + protected $path; + /** * Set up */ @@ -53,7 +60,11 @@ class ReadTest extends \PHPUnit_Framework_TestCase { $this->driver = $this->getMock('Magento\Filesystem\Driver\File', array(), array(), '', false); $this->fileFactory = $this->getMock('Magento\Filesystem\File\ReadFactory', array(), array(), '', false); - $this->read = new \Magento\Filesystem\Directory\Read(array(), $this->fileFactory, $this->driver); + $this->read = new \Magento\Filesystem\Directory\Read( + array('path' => $this->path), + $this->fileFactory, + $this->driver + ); } /** @@ -77,4 +88,51 @@ class ReadTest extends \PHPUnit_Framework_TestCase $this->driver->expects($this->once())->method('stat')->will($this->returnValue(array('some-stat-data'))); $this->assertEquals(array('some-stat-data'), $this->read->stat('correct-path')); } + + public function testReadFileNoProtocol() + { + $path = 'filepath'; + $flag = 'flag'; + $context = 'context'; + $contents = 'contents'; + + $this->driver->expects($this->once()) + ->method('getAbsolutePath') + ->with($this->path, $path) + ->will($this->returnValue($path)); + $this->driver->expects($this->once()) + ->method('fileGetContents') + ->with($path, $flag, $context) + ->will($this->returnValue($contents)); + + $this->assertEquals($contents, $this->read->readFile($path, $flag, $context)); + } + + public function testReadFileCustomProtocol() + { + $path = 'filepath'; + $flag = 'flag'; + $context = 'context'; + $protocol = 'ftp'; + $contents = 'contents'; + + $fileMock = $this->getMock('Magento\Filesystem\File\Read', [], [], '', false); + $fileMock->expects($this->once()) + ->method('readAll') + ->with($flag, $context) + ->will($this->returnValue($contents)); + + $this->driver->expects($this->once()) + ->method('getAbsolutePath') + ->with($this->path, $path, $protocol) + ->will($this->returnValue($path)); + $this->driver->expects($this->never()) + ->method('fileGetContents'); + $this->fileFactory->expects($this->once()) + ->method('create') + ->with($path, $protocol, $this->driver) + ->will($this->returnValue($fileMock)); + + $this->assertEquals($contents, $this->read->readFile($path, $flag, $context, $protocol)); + } } diff --git a/dev/tests/unit/testsuite/Magento/Filesystem/DirectoryListTest.php b/dev/tests/unit/testsuite/Magento/Filesystem/DirectoryListTest.php index 9685c58d41cf5333608e0c90109613a42970188f..45ec6bb9a9fe2b818332adf1b8912bddefd61948 100644 --- a/dev/tests/unit/testsuite/Magento/Filesystem/DirectoryListTest.php +++ b/dev/tests/unit/testsuite/Magento/Filesystem/DirectoryListTest.php @@ -24,7 +24,7 @@ namespace Magento\Filesystem; use Magento\Filesystem; -use Magento\App\Filesystem as AppFilesystem; +use Magento\Framework\App\Filesystem as AppFilesystem; class DirectoryListTest extends \PHPUnit_Framework_TestCase { diff --git a/dev/tests/unit/testsuite/Magento/FilesystemTest.php b/dev/tests/unit/testsuite/Magento/FilesystemTest.php index 931fb592858018873a045a1ec39a14ff38a37611..67f2162fbf7fce9e976add00e7fe81425ccd6b94 100644 --- a/dev/tests/unit/testsuite/Magento/FilesystemTest.php +++ b/dev/tests/unit/testsuite/Magento/FilesystemTest.php @@ -23,7 +23,7 @@ */ namespace Magento; -use Magento\App\Filesystem as AppFilesystem; +use Magento\Framework\App\Filesystem as AppFilesystem; class FilesystemTest extends \PHPUnit_Framework_TestCase { @@ -36,7 +36,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $_dirWriteFactoryMock; - /** @var \Magento\App\Filesystem\DirectoryList|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem\DirectoryList|\PHPUnit_Framework_MockObject_MockObject */ protected $_directoryListMock; /** @var \Magento\Filesystem\File\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ @@ -52,7 +52,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase false ); $this->_directoryListMock = $this->getMock( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array(), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Filter/TranslitTest.php b/dev/tests/unit/testsuite/Magento/Filter/TranslitTest.php index 06989dbcfc46a467a750380d9e384bfb67d874ff..8bc8289b3cb073eee186d3899ceeb32a0cdd14bc 100644 --- a/dev/tests/unit/testsuite/Magento/Filter/TranslitTest.php +++ b/dev/tests/unit/testsuite/Magento/Filter/TranslitTest.php @@ -80,7 +80,7 @@ class TranslitTest extends \PHPUnit_Framework_TestCase public function testFilterConfigured() { $config = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->setMethods( array('getValue', 'setValue', 'isSetFlag') )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/App/AbstractShellTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/AbstractShellTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/AbstractShellTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/AbstractShellTest.php index 2d4343b512e8d77fd15e2b0259538bb5f0db3f8d..8f3c14a2aa05f017504e296140607c8fac8fe7cb 100644 --- a/dev/tests/unit/testsuite/Magento/App/AbstractShellTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/AbstractShellTest.php @@ -21,19 +21,19 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class AbstractShellTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\AbstractShell | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\AbstractShell | \PHPUnit_Framework_MockObject_MockObject */ protected $_model; protected function setUp() { $this->_model = $this->getMockBuilder( - '\Magento\App\AbstractShell' + '\Magento\Framework\App\AbstractShell' )->disableOriginalConstructor()->setMethods( array('_applyPhpVariables') )->getMockForAbstractClass(); diff --git a/dev/tests/unit/testsuite/Magento/App/Action/ForwardTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Action/ForwardTest.php similarity index 62% rename from dev/tests/unit/testsuite/Magento/App/Action/ForwardTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Action/ForwardTest.php index 9ad6e8098a4e233b1a88d86111b913b1733106e9..18f3a36cad4c36a0e6242b21da9d8e989832c8e3 100644 --- a/dev/tests/unit/testsuite/Magento/App/Action/ForwardTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Action/ForwardTest.php @@ -21,31 +21,31 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class ForwardTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Action\Forward + * @var \Magento\Framework\App\Action\Forward */ protected $_actionAbstract; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; protected function setUp() { - $this->_request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_response = $this->getMock('\Magento\App\Response\Http', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_response = $this->getMock('\Magento\Framework\App\Response\Http', array(), array(), '', false); - $this->_actionAbstract = new \Magento\App\Action\Forward($this->_request, $this->_response); + $this->_actionAbstract = new \Magento\Framework\App\Action\Forward($this->_request, $this->_response); } public function testDispatch() @@ -58,7 +58,7 @@ class ForwardTest extends \PHPUnit_Framework_TestCase * Test for getRequest method * * @test - * @covers \Magento\App\Action\AbstractAction::getRequest + * @covers \Magento\Framework\App\Action\AbstractAction::getRequest */ public function testGetRequest() { @@ -69,7 +69,7 @@ class ForwardTest extends \PHPUnit_Framework_TestCase * Test for getResponse method * * @test - * @covers \Magento\App\Action\AbstractAction::getResponse + * @covers \Magento\Framework\App\Action\AbstractAction::getResponse */ public function testGetResponse() { @@ -80,18 +80,18 @@ class ForwardTest extends \PHPUnit_Framework_TestCase * Test for getResponse med. Checks that response headers are set correctly * * @test - * @covers \Magento\App\Action\AbstractAction::getResponse + * @covers \Magento\Framework\App\Action\AbstractAction::getResponse */ public function testResponseHeaders() { - $infoProcessorMock = $this->getMock('Magento\App\Request\PathInfoProcessorInterface'); - $routerListMock = $this->getMock('Magento\App\Route\ConfigInterface'); + $infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); + $routerListMock = $this->getMock('Magento\Framework\App\Route\ConfigInterface'); $cookieMock = $this->getMock('Magento\Stdlib\Cookie', array(), array(), '', false); - $contextMock = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); - $request = new \Magento\App\Request\Http($routerListMock, $infoProcessorMock); - $response = new \Magento\App\Response\Http($cookieMock, $contextMock); + $contextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); + $request = new \Magento\Framework\App\Request\Http($routerListMock, $infoProcessorMock); + $response = new \Magento\Framework\App\Response\Http($cookieMock, $contextMock); $response->headersSentThrowsException = false; - $action = new \Magento\App\Action\Forward($request, $response); + $action = new \Magento\Framework\App\Action\Forward($request, $response); $this->assertEquals(array(), $action->getResponse()->getHeaders()); } diff --git a/dev/tests/unit/testsuite/Magento/App/Action/TitleTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Action/TitleTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/Action/TitleTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Action/TitleTest.php index ede510e7b3bbf7dcf75e55e4ea3f801539e3373d..979e798d7f83bd63a2558fbeb0b91b29049df023 100644 --- a/dev/tests/unit/testsuite/Magento/App/Action/TitleTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Action/TitleTest.php @@ -22,18 +22,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class TitleTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ protected $_model; protected function setUp() { - $this->_model = new \Magento\App\Action\Title(); + $this->_model = new \Magento\Framework\App\Action\Title(); } public function testAddPrependFalse() diff --git a/dev/tests/unit/testsuite/Magento/App/ActionFlagTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ActionFlagTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/App/ActionFlagTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ActionFlagTest.php index e619fc1a920f4311e0cadf5d92af07ebac6c9f41..b0e131b851a34fc682353db52cc13ab3bf24bc9a 100644 --- a/dev/tests/unit/testsuite/Magento/App/ActionFlagTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ActionFlagTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ActionFlagTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; @@ -38,8 +38,8 @@ class ActionFlagTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_actionFlag = new \Magento\App\ActionFlag($this->_requestMock); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_actionFlag = new \Magento\Framework\App\ActionFlag($this->_requestMock); } public function testSetIfActionNotExist() diff --git a/dev/tests/unit/testsuite/Magento/App/AreaListTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/AreaListTest.php similarity index 81% rename from dev/tests/unit/testsuite/Magento/App/AreaListTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/AreaListTest.php index 1955c8bf559289054a94e897754a8ab11c8c7131..82b6a185402a6bf0ae76158f096ec7f2775c1af4 100644 --- a/dev/tests/unit/testsuite/Magento/App/AreaListTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/AreaListTest.php @@ -21,17 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class AreaListTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_model; /** - * @var \Magento\App\Area\FrontNameResolverFactory + * @var \Magento\Framework\App\Area\FrontNameResolverFactory */ protected $_resolverFactory; @@ -44,20 +44,20 @@ class AreaListTest extends \PHPUnit_Framework_TestCase { $this->objectManagerMock = $this->getMock('Magento\ObjectManager'); $this->_resolverFactory = $this - ->getMock('\Magento\App\Area\FrontNameResolverFactory', array(), array(), '', false); + ->getMock('\Magento\Framework\App\Area\FrontNameResolverFactory', array(), array(), '', false); } public function testGetCodeByFrontNameWhenAreaDoesNotContainFrontName() { $expected = 'expectedFrontName'; - $this->_model = new \Magento\App\AreaList( + $this->_model = new \Magento\Framework\App\AreaList( $this->objectManagerMock, $this->_resolverFactory, array('testArea' => array('frontNameResolver' => 'testValue')), $expected ); - $resolverMock = $this->getMock('\Magento\App\Area\FrontNameResolverInterface'); + $resolverMock = $this->getMock('\Magento\Framework\App\Area\FrontNameResolverInterface'); $this->_resolverFactory->expects( $this->any() )->method( @@ -75,7 +75,7 @@ class AreaListTest extends \PHPUnit_Framework_TestCase public function testGetCodeByFrontNameReturnsAreaCode() { $expected = 'testArea'; - $this->_model = new \Magento\App\AreaList( + $this->_model = new \Magento\Framework\App\AreaList( $this->objectManagerMock, $this->_resolverFactory, array('testArea'=>array('frontName' => 'testFrontName')), @@ -89,7 +89,7 @@ class AreaListTest extends \PHPUnit_Framework_TestCase public function testGetFrontNameWhenAreaCodeAndFrontNameAreSet() { $expected = 'testFrontName'; - $this->_model = new \Magento\App\AreaList( + $this->_model = new \Magento\Framework\App\AreaList( $this->objectManagerMock, $this->_resolverFactory, array('testAreaCode' => array('frontName' => 'testFrontName')), @@ -102,7 +102,12 @@ class AreaListTest extends \PHPUnit_Framework_TestCase public function testGetFrontNameWhenAreaCodeAndFrontNameArentSet() { - $this->_model = new \Magento\App\AreaList($this->objectManagerMock, $this->_resolverFactory, array(), ''); + $this->_model = new \Magento\Framework\App\AreaList( + $this->objectManagerMock, + $this->_resolverFactory, + array(), + '' + ); $actual = $this->_model->getFrontName('testAreaCode'); $this->assertNull($actual); @@ -110,7 +115,7 @@ class AreaListTest extends \PHPUnit_Framework_TestCase public function testGetCodes() { - $this->_model = new \Magento\App\AreaList( + $this->_model = new \Magento\Framework\App\AreaList( $this->objectManagerMock, $this->_resolverFactory, array('area1' => 'value1', 'area2' => 'value2'), '' ); diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/ArgumentInterpreterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/ArgumentInterpreterTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/Arguments/ArgumentInterpreterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/ArgumentInterpreterTest.php index 4e3d4e619b125d0373fcf2d33a74ab08d565c575..880e8890651784e8eb1052f1c61bcd9a6d96d6f7 100644 --- a/dev/tests/unit/testsuite/Magento/App/Arguments/ArgumentInterpreterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/ArgumentInterpreterTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments; +namespace Magento\Framework\App\Arguments; class ArgumentInterpreterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Arguments\ArgumentInterpreter + * @var \Magento\Framework\App\Arguments\ArgumentInterpreter */ private $object; diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/PrimaryTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/PrimaryTest.php similarity index 85% rename from dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/PrimaryTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/PrimaryTest.php index a289fa86f8da10d0e565dbef0a54b7ca21235926..4cad0e16bba4b5356c21d56515bd4766c0c5d428 100644 --- a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/PrimaryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/PrimaryTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments\FileResolver; +namespace Magento\Framework\App\Arguments\FileResolver; class PrimaryTest extends \PHPUnit_Framework_TestCase { @@ -34,7 +34,7 @@ class PrimaryTest extends \PHPUnit_Framework_TestCase public function testGet(array $fileList, $scope, $filename) { $directory = $this->getMock('Magento\Filesystem\Directory\Read', array('search'), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', false); $iteratorFactory = $this->getMock('Magento\Config\FileIteratorFactory', array('create'), array(), '', false); $filesystem->expects( @@ -42,7 +42,7 @@ class PrimaryTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::CONFIG_DIR + \Magento\Framework\App\Filesystem::CONFIG_DIR )->will( $this->returnValue($directory) ); @@ -51,7 +51,7 @@ class PrimaryTest extends \PHPUnit_Framework_TestCase $iteratorFactory->expects($this->once())->method('create')->will($this->returnValue(true)); - $model = new \Magento\App\Arguments\FileResolver\Primary($filesystem, $iteratorFactory); + $model = new \Magento\Framework\App\Arguments\FileResolver\Primary($filesystem, $iteratorFactory); $this->assertTrue($model->get($filename, $scope)); } diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/app/etc/config.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/app/etc/config.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/app/etc/config.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/app/etc/config.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/app/etc/custom/config.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/app/etc/custom/config.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/app/etc/custom/config.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/app/etc/custom/config.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/primary/app/etc/di.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/primary/app/etc/di.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/primary/app/etc/di.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/primary/app/etc/di.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/primary/app/etc/some_config/di.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/primary/app/etc/some_config/di.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/FileResolver/_files/primary/app/etc/some_config/di.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/FileResolver/_files/primary/app/etc/some_config/di.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/LoaderTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/LoaderTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/App/Arguments/LoaderTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/LoaderTest.php index ee5db631d2d141f18a26ec86fb026369ba2c76fb..20b3192aa1f1414720f82bf1173595f01c0e3f77 100644 --- a/dev/tests/unit/testsuite/Magento/App/Arguments/LoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/LoaderTest.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments; +namespace Magento\Framework\App\Arguments; class LoaderTest extends \PHPUnit_Framework_TestCase { @@ -32,13 +32,19 @@ class LoaderTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject */ protected $_dirs; public function setUp() { - $this->_dirs = $this->getMock('\Magento\App\Filesystem\DirectoryList', array('getDir'), array(), '', false); + $this->_dirs = $this->getMock( + '\Magento\Framework\App\Filesystem\DirectoryList', + array('getDir'), + array(), + '', + false + ); } public function testWithOneXmlFile() diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/_files/local.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/local.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/_files/local.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/local.php diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/_files/local.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/local.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/_files/local.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/local.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer.php diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer_merged.php b/dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer_merged.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Arguments/_files/other/local_developer_merged.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Arguments/_files/other/local_developer_merged.php diff --git a/dev/tests/unit/testsuite/Magento/App/ArgumentsTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ArgumentsTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/App/ArgumentsTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ArgumentsTest.php index 9d083bec6feb9b2d17dea26e3bb350801cf75b3d..685cc0afcd938e6a8a98fa1fe5ebe8299d6656af 100644 --- a/dev/tests/unit/testsuite/Magento/App/ArgumentsTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ArgumentsTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ArgumentsTest extends \PHPUnit_Framework_TestCase { @@ -36,12 +36,12 @@ class ArgumentsTest extends \PHPUnit_Framework_TestCase protected static $fixtureConfigMerged; /** - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $_arguments; /** - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $_argumentsMerged; @@ -53,11 +53,11 @@ class ArgumentsTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $loader = $this->getMock('Magento\App\Arguments\Loader', array(), array(), '', false); + $loader = $this->getMock('Magento\Framework\App\Arguments\Loader', array(), array(), '', false); $loader->expects($this->atLeastOnce())->method('load')->will($this->returnValue(self::$fixtureConfig)); - $this->_arguments = new \Magento\App\Arguments(array(), $loader); - $this->_argumentsMerged = new \Magento\App\Arguments( + $this->_arguments = new \Magento\Framework\App\Arguments(array(), $loader); + $this->_argumentsMerged = new \Magento\Framework\App\Arguments( require __DIR__ . '/Arguments/_files/other/local_developer.php', $loader ); diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php similarity index 87% rename from dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php index 085f401a5b10fd0de30a5ec41dbf22acba9d1cd8..b38ca0a4da9a4344d32b53e32c069b449922a795 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Frontend; +namespace Magento\Framework\App\Cache\Frontend; class FactoryTest extends \PHPUnit_Framework_TestCase { @@ -117,14 +117,14 @@ class FactoryTest extends \PHPUnit_Framework_TestCase array(), array( array( - 'class' => 'Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', + 'class' => 'Magento\Framework\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', 'parameters' => array('param' => 'value') ) ) ); $result = $model->create(array('backend' => 'Zend_Cache_Backend_BlackHole')); - $this->assertInstanceOf('Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', $result); + $this->assertInstanceOf('Magento\Framework\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy', $result); $params = $result->getParams(); $this->assertArrayHasKey('param', $params); @@ -136,7 +136,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase * * @param array $enforcedOptions * @param array $decorators - * @return \Magento\App\Cache\Frontend\Factory + * @return \Magento\Framework\App\Cache\Frontend\Factory */ protected function _buildModelForCreate($enforcedOptions = array(), $decorators = array()) { @@ -144,7 +144,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase switch ($class) { case 'Magento\Cache\Frontend\Adapter\Zend': return new $class($params['frontend']); - case 'Magento\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy': + case 'Magento\Framework\App\Cache\Frontend\FactoryTest\CacheDecoratorDummy': $frontend = $params['frontend']; unset($params['frontend']); return new $class($frontend, $params); @@ -158,17 +158,17 @@ class FactoryTest extends \PHPUnit_Framework_TestCase $objectManager->expects($this->any())->method('create')->will($this->returnCallback($processFrontendFunc)); $map = array( - array(\Magento\App\Filesystem::CACHE_DIR, 'CACHE_DIR'), - array(\Magento\App\Filesystem::CONFIG_DIR, 'CONFIG_DIR') + array(\Magento\Framework\App\Filesystem::CACHE_DIR, 'CACHE_DIR'), + array(\Magento\Framework\App\Filesystem::CONFIG_DIR, 'CONFIG_DIR') ); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getPath'), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getPath'), array(), '', false); $filesystem->expects($this->any())->method('getPath')->will($this->returnValueMap($map)); - $resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); - $model = new \Magento\App\Cache\Frontend\Factory( + $model = new \Magento\Framework\App\Cache\Frontend\Factory( $objectManager, $filesystem, $resource, diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php index 3b316b59f44719e9eea163e9c3ec3d086d16e379..35e925cc207858ff850237bf8a3e79595b050d7d 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest/CacheDecoratorDummy.php @@ -25,7 +25,7 @@ /** * Dummy object to test creation of decorators for cache frontend */ -namespace Magento\App\Cache\Frontend\FactoryTest; +namespace Magento\Framework\App\Cache\Frontend\FactoryTest; class CacheDecoratorDummy extends \Magento\Cache\Frontend\Decorator\Bare { diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/PoolTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/PoolTest.php index 1381889ac004faa3863ba78f1c92067259a86a2d..f4eb4a18bedeb30f554de1db360633d1d0cac341 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Frontend/PoolTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Frontend/PoolTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Frontend; +namespace Magento\Framework\App\Cache\Frontend; class PoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cache\Frontend\Pool + * @var \Magento\Framework\App\Cache\Frontend\Pool */ protected $_model; @@ -53,10 +53,10 @@ class PoolTest extends \PHPUnit_Framework_TestCase array(array('r1d1' => 'value1', 'r1d2' => 'value2'), $this->_frontendInstances['resource1']), array(array('r2d1' => 'value1', 'r2d2' => 'value2'), $this->_frontendInstances['resource2']) ); - $frontendFactory = $this->getMock('Magento\App\Cache\Frontend\Factory', array(), array(), '', false); + $frontendFactory = $this->getMock('Magento\Framework\App\Cache\Frontend\Factory', array(), array(), '', false); $frontendFactory->expects($this->any())->method('create')->will($this->returnValueMap($frontendFactoryMap)); - $arguments = $this->getMock('Magento\App\Arguments', array(), array(), '', false); + $arguments = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); $arguments->expects( $this->any() )->method( @@ -70,7 +70,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase 'resource1' => array('r1d1' => 'value1', 'r1d2' => 'value2') ); - $this->_model = new \Magento\App\Cache\Frontend\Pool($arguments, $frontendFactory, $frontendSettings); + $this->_model = new \Magento\Framework\App\Cache\Frontend\Pool($arguments, $frontendFactory, $frontendSettings); } /** @@ -78,10 +78,10 @@ class PoolTest extends \PHPUnit_Framework_TestCase */ public function testConstructorNoInitialization() { - $arguments = $this->getMock('Magento\App\Arguments', array(), array(), '', false); - $frontendFactory = $this->getMock('Magento\App\Cache\Frontend\Factory', array(), array(), '', false); + $arguments = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); + $frontendFactory = $this->getMock('Magento\Framework\App\Cache\Frontend\Factory', array(), array(), '', false); $frontendFactory->expects($this->never())->method('create'); - new \Magento\App\Cache\Frontend\Pool($arguments, $frontendFactory); + new \Magento\Framework\App\Cache\Frontend\Pool($arguments, $frontendFactory); } /** @@ -96,7 +96,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase array $frontendSettings, array $expectedFactoryArg ) { - $arguments = $this->getMock('Magento\App\Arguments', array(), array(), '', false); + $arguments = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); $arguments->expects( $this->once() )->method( @@ -105,10 +105,10 @@ class PoolTest extends \PHPUnit_Framework_TestCase $this->returnValue($fixtureCacheConfig) ); - $frontendFactory = $this->getMock('Magento\App\Cache\Frontend\Factory', array(), array(), '', false); + $frontendFactory = $this->getMock('Magento\Framework\App\Cache\Frontend\Factory', array(), array(), '', false); $frontendFactory->expects($this->at(0))->method('create')->with($expectedFactoryArg); - $model = new \Magento\App\Cache\Frontend\Pool($arguments, $frontendFactory, $frontendSettings); + $model = new \Magento\Framework\App\Cache\Frontend\Pool($arguments, $frontendFactory, $frontendSettings); $model->current(); } diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php index a66b477d244e18ed795cda602dcc520305aa0c00..afe38919d5521435ded488d06e5f54ec8c177a24 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php @@ -21,17 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; class StateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_model; /** - * @var \Magento\App\Cache\State\Options|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Cache\State\Options|\PHPUnit_Framework_MockObject_MockObject */ protected $_resource; @@ -106,7 +106,7 @@ class StateTest extends \PHPUnit_Framework_TestCase * @param array|false $resourceTypeOptions * @param bool $appInstalled * @param bool $banAll - * @return \Magento\App\Cache\StateInterface + * @return \Magento\Framework\App\Cache\StateInterface */ protected function _buildModel( $cacheTypeOptions, @@ -120,22 +120,22 @@ class StateTest extends \PHPUnit_Framework_TestCase )->method( 'load' )->with( - \Magento\App\Cache\State::CACHE_ID + \Magento\Framework\App\Cache\State::CACHE_ID )->will( $this->returnValue($cacheTypeOptions === false ? false : serialize($cacheTypeOptions)) ); - $cacheFrontendPool = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); + $cacheFrontendPool = $this->getMock('Magento\Framework\App\Cache\Frontend\Pool', array(), array(), '', false); $cacheFrontendPool->expects( $this->any() )->method( 'get' )->with( - \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID + \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID )->will( $this->returnValue($this->_cacheFrontend) ); - $this->_resource = $this->getMock('Magento\App\Cache\State\Options', array(), array(), '', false); + $this->_resource = $this->getMock('Magento\Framework\App\Cache\State\Options', array(), array(), '', false); $this->_resource->expects( $this->any() )->method( @@ -144,10 +144,15 @@ class StateTest extends \PHPUnit_Framework_TestCase $this->returnValue($resourceTypeOptions) ); - $appState = $this->getMock('Magento\App\State', array(), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $appState->expects($this->any())->method('isInstalled')->will($this->returnValue($appInstalled)); - $this->_model = new \Magento\App\Cache\State($this->_resource, $cacheFrontendPool, $appState, $banAll); + $this->_model = new \Magento\Framework\App\Cache\State( + $this->_resource, + $cacheFrontendPool, + $appState, + $banAll + ); return $this->_model; } @@ -181,7 +186,9 @@ class StateTest extends \PHPUnit_Framework_TestCase $model = $this->_buildModel($cacheTypes); $this->_resource->expects($this->once())->method('saveAllOptions')->with($cacheTypes); - $this->_cacheFrontend->expects($this->once())->method('remove')->with(\Magento\App\Cache\State::CACHE_ID); + $this->_cacheFrontend->expects($this->once()) + ->method('remove') + ->with(\Magento\Framework\App\Cache\State::CACHE_ID); $model->persist(); } diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/AccessProxyTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/AccessProxyTest.php index c2e5b5a2ab0c46f6712de423eca987e6df93b0aa..e54660f0808855ac800125b8c865250ed521c710 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Type/AccessProxyTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/AccessProxyTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class AccessProxyTest extends \PHPUnit_Framework_TestCase { @@ -38,11 +38,11 @@ class AccessProxyTest extends \PHPUnit_Framework_TestCase $frontendMock = $this->getMock('Magento\Cache\FrontendInterface'); - $cacheEnabler = $this->getMock('Magento\App\Cache\StateInterface'); + $cacheEnabler = $this->getMock('Magento\Framework\App\Cache\StateInterface'); $cacheEnabler->expects($this->at(0))->method('isEnabled')->with($identifier)->will($this->returnValue(false)); $cacheEnabler->expects($this->at(1))->method('isEnabled')->with($identifier)->will($this->returnValue(true)); - $object = new \Magento\App\Cache\Type\AccessProxy($frontendMock, $cacheEnabler, $identifier); + $object = new \Magento\Framework\App\Cache\Type\AccessProxy($frontendMock, $cacheEnabler, $identifier); $helper = new \Magento\TestFramework\Helper\ProxyTesting(); // For the first call the cache is disabled - so fake default result is returned diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/FrontendPoolTest.php similarity index 81% rename from dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/FrontendPoolTest.php index ea29850c9b7323ef0b31fb79678727e8e02bca7d..a7285115f73db8140f29439439cf1b155c056d91 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Type/FrontendPoolTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/FrontendPoolTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class FrontendPoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cache\Type\FrontendPool + * @var \Magento\Framework\App\Cache\Type\FrontendPool */ protected $_model; @@ -36,20 +36,20 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Arguments|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Arguments|\PHPUnit_Framework_MockObject_MockObject */ protected $_arguments; /** - * @var \Magento\App\Cache\Frontend\Pool|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Cache\Frontend\Pool|\PHPUnit_Framework_MockObject_MockObject */ protected $_cachePool; protected function setUp() { $this->_objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->_arguments = $this->getMock('Magento\App\Arguments', array(), array(), '', false); - $this->_cachePool = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); + $this->_arguments = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); + $this->_cachePool = $this->getMock('Magento\Framework\App\Cache\Frontend\Pool', array(), array(), '', false); $this->_model = new FrontendPool( $this->_objectManager, $this->_arguments, @@ -88,13 +88,13 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase $this->returnValue($cacheFrontend) ); - $accessProxy = $this->getMock('Magento\App\Cache\Type\AccessProxy', array(), array(), '', false); + $accessProxy = $this->getMock('Magento\Framework\App\Cache\Type\AccessProxy', array(), array(), '', false); $this->_objectManager->expects( $this->once() )->method( 'create' )->with( - 'Magento\App\Cache\Type\AccessProxy', + 'Magento\Framework\App\Cache\Type\AccessProxy', $this->identicalTo(array('frontend' => $cacheFrontend, 'identifier' => $inputCacheType)) )->will( $this->returnValue($accessProxy) @@ -113,7 +113,7 @@ class FrontendPoolTest extends \PHPUnit_Framework_TestCase 'fallback to default id' => array( null, 'unknown_cache_type', - \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID + \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID ) ); } diff --git a/dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/GenericTest.php similarity index 75% rename from dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/GenericTest.php index 89682a353e20977f7e64abd8bccfaf3bf5a73596..9c5753b2e1937479e7ef8e7cb8444aaff69b3532 100644 --- a/dev/tests/unit/testsuite/Magento/App/Cache/Type/GenericTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/GenericTest.php @@ -23,9 +23,9 @@ */ /** - * The test covers \Magento\App\Cache_Type_* classes all at once, as all of them are similar + * The test covers \Magento\Framework\App\Cache_Type_* classes all at once, as all of them are similar */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class GenericTest extends \PHPUnit_Framework_TestCase { @@ -37,7 +37,7 @@ class GenericTest extends \PHPUnit_Framework_TestCase { $frontendMock = $this->getMock('Magento\Cache\FrontendInterface'); - $poolMock = $this->getMock('Magento\App\Cache\Type\FrontendPool', array(), array(), '', false); + $poolMock = $this->getMock('Magento\Framework\App\Cache\Type\FrontendPool', array(), array(), '', false); $poolMock->expects( $this->atLeastOnce() )->method( @@ -64,12 +64,12 @@ class GenericTest extends \PHPUnit_Framework_TestCase public static function constructorDataProvider() { return array( - array('Magento\App\Cache\Type\Block'), - array('Magento\App\Cache\Type\Collection'), - array('Magento\App\Cache\Type\Config'), - array('Magento\App\Cache\Type\Layout'), - array('Magento\App\Cache\Type\Translate'), - array('Magento\App\Cache\Type\Block') + array('Magento\Framework\App\Cache\Type\Block'), + array('Magento\Framework\App\Cache\Type\Collection'), + array('Magento\Framework\App\Cache\Type\Config'), + array('Magento\Framework\App\Cache\Type\Layout'), + array('Magento\Framework\App\Cache\Type\Translate'), + array('Magento\Framework\App\Cache\Type\Block') ); } } diff --git a/dev/tests/unit/testsuite/Magento/App/CacheTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/CacheTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/CacheTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/CacheTest.php index ac93fe8131409a506f983ee6d7a8381c6160474a..0ac0711ed3822e0da46ab9620150232add7ac111 100644 --- a/dev/tests/unit/testsuite/Magento/App/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/CacheTest.php @@ -24,12 +24,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class CacheTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cache + * @var \Magento\Framework\App\Cache */ protected $_model; @@ -57,7 +57,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase array('clean') ); - $frontendPoolMock = $this->getMock('Magento\App\Cache\Frontend\Pool', array(), array(), '', false); + $frontendPoolMock = $this->getMock('Magento\Framework\App\Cache\Frontend\Pool', array(), array(), '', false); $frontendPoolMock->expects($this->any())->method('valid')->will($this->onConsecutiveCalls(true, false)); $frontendPoolMock->expects( @@ -72,12 +72,12 @@ class CacheTest extends \PHPUnit_Framework_TestCase )->method( 'get' )->with( - \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID + \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID )->will( $this->returnValue($this->_cacheFrontendMock) ); - $this->_model = new \Magento\App\Cache($frontendPoolMock); + $this->_model = new \Magento\Framework\App\Cache($frontendPoolMock); } /** @@ -163,7 +163,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase public function saveDataProvider() { - $configTag = \Magento\App\Config::CACHE_TAG; + $configTag = \Magento\Framework\App\Config::CACHE_TAG; return array( 'default tags' => array('test_data', 'test_id', array(), 'test_data', 'test_id', array()), 'config tags' => array( diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Data/BackendModelPoolTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Data/BackendModelPoolTest.php similarity index 65% rename from dev/tests/unit/testsuite/Magento/App/Config/Data/BackendModelPoolTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Data/BackendModelPoolTest.php index 9d842a54cc11a7af5fae1e4dabfbf657273b036d..9ecd31ded51b742079f9db2918660c5779b89e0f 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/Data/BackendModelPoolTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Data/BackendModelPoolTest.php @@ -21,17 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Data; +namespace Magento\Framework\App\Config\Data; class BackendModelPoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Data\ProcessorFactory + * @var \Magento\Framework\App\Config\Data\ProcessorFactory */ protected $_model; /** - * @var \Magento\App\Config\Data\ProcessorInterface + * @var \Magento\Framework\App\Config\Data\ProcessorInterface */ protected $_processorMock; @@ -43,13 +43,13 @@ class BackendModelPoolTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectManager = $this->getMock('Magento\ObjectManager'); - $this->_model = new \Magento\App\Config\Data\ProcessorFactory($this->_objectManager); - $this->_processorMock = $this->getMockForAbstractClass('Magento\App\Config\Data\ProcessorInterface'); + $this->_model = new \Magento\Framework\App\Config\Data\ProcessorFactory($this->_objectManager); + $this->_processorMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\Data\ProcessorInterface'); $this->_processorMock->expects($this->any())->method('processValue')->will($this->returnArgument(0)); } /** - * @covers \Magento\App\Config\Data\ProcessorFactory::get + * @covers \Magento\Framework\App\Config\Data\ProcessorFactory::get */ public function testGetModelWithCorrectInterface() { @@ -58,19 +58,19 @@ class BackendModelPoolTest extends \PHPUnit_Framework_TestCase )->method( 'create' )->with( - 'Magento\App\Config\Data\TestBackendModel' + 'Magento\Framework\App\Config\Data\TestBackendModel' )->will( $this->returnValue($this->_processorMock) ); $this->assertInstanceOf( - 'Magento\App\Config\Data\ProcessorInterface', - $this->_model->get('Magento\App\Config\Data\TestBackendModel') + 'Magento\Framework\App\Config\Data\ProcessorInterface', + $this->_model->get('Magento\Framework\App\Config\Data\TestBackendModel') ); } /** - * @covers \Magento\App\Config\Data\ProcessorFactory::get + * @covers \Magento\Framework\App\Config\Data\ProcessorFactory::get * @expectedException \InvalidArgumentException */ public function testGetModelWithWrongInterface() @@ -80,18 +80,18 @@ class BackendModelPoolTest extends \PHPUnit_Framework_TestCase )->method( 'create' )->with( - 'Magento\App\Config\Data\WrongBackendModel' + 'Magento\Framework\App\Config\Data\WrongBackendModel' )->will( $this->returnValue( - $this->getMock('Magento\App\Config\Data\WrongBackendModel', array(), array(), '', false) + $this->getMock('Magento\Framework\App\Config\Data\WrongBackendModel', array(), array(), '', false) ) ); - $this->_model->get('Magento\App\Config\Data\WrongBackendModel'); + $this->_model->get('Magento\Framework\App\Config\Data\WrongBackendModel'); } /** - * @covers \Magento\App\Config\Data\ProcessorFactory::get + * @covers \Magento\Framework\App\Config\Data\ProcessorFactory::get */ public function testGetMemoryCache() { @@ -100,12 +100,12 @@ class BackendModelPoolTest extends \PHPUnit_Framework_TestCase )->method( 'create' )->with( - 'Magento\App\Config\Data\TestBackendModel' + 'Magento\Framework\App\Config\Data\TestBackendModel' )->will( $this->returnValue($this->_processorMock) ); - $this->_model->get('Magento\App\Config\Data\TestBackendModel'); - $this->_model->get('Magento\App\Config\Data\TestBackendModel'); + $this->_model->get('Magento\Framework\App\Config\Data\TestBackendModel'); + $this->_model->get('Magento\Framework\App\Config\Data\TestBackendModel'); } } diff --git a/dev/tests/unit/testsuite/Magento/App/Config/DataTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/DataTest.php similarity index 79% rename from dev/tests/unit/testsuite/Magento/App/Config/DataTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/DataTest.php index cf891bf639b186caaafc147f8c79d45164ed9415..9f88c914110453b9f2a66ad1daf50b8c2d73ae01 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/DataTest.php @@ -21,31 +21,31 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class DataTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Data + * @var \Magento\Framework\App\Config\Data */ protected $_model; /** - * @var \Magento\App\Config\MetadataProcessor|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\MetadataProcessor|\PHPUnit_Framework_MockObject_MockObject */ protected $_metaDataProcessor; protected function setUp() { $this->_metaDataProcessor = $this->getMock( - 'Magento\App\Config\MetadataProcessor', + 'Magento\Framework\App\Config\MetadataProcessor', array(), array(), '', false ); $this->_metaDataProcessor->expects($this->any())->method('process')->will($this->returnArgument(0)); - $this->_model = new \Magento\App\Config\Data($this->_metaDataProcessor, array()); + $this->_model = new \Magento\Framework\App\Config\Data($this->_metaDataProcessor, array()); } /** @@ -69,7 +69,10 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testGetData() { - $model = new \Magento\App\Config\Data($this->_metaDataProcessor, array('test' => array('path' => 'value'))); + $model = new \Magento\Framework\App\Config\Data( + $this->_metaDataProcessor, + array('test' => array('path' => 'value')) + ); $this->assertEquals('value', $model->getValue('test/path')); } } diff --git a/dev/tests/unit/testsuite/Magento/App/Config/FileResolverTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/FileResolverTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/App/Config/FileResolverTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/FileResolverTest.php index d55a87abf8c669f75e4c8bc7ad131084d365dd9c..ba8470d7ba0240c0cfe9fc162ca34b7ec137ff9e 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/FileResolverTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/FileResolverTest.php @@ -21,21 +21,21 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class FileResolverTest extends \PHPUnit_Framework_TestCase { /** * Files resolver * - * @var \Magento\App\Config\FileResolver + * @var \Magento\Framework\App\Config\FileResolver */ protected $model; /** * Filesystem * - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; @@ -60,7 +60,13 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase '', false ); - $this->filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $this->filesystem = $this->getMock( + 'Magento\Framework\App\Filesystem', + array('getDirectoryRead'), + array(), + '', + false + ); $this->moduleReader = $this->getMock( 'Magento\Module\Dir\Reader', array(), @@ -68,7 +74,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase '', false ); - $this->model = new \Magento\App\Config\FileResolver( + $this->model = new \Magento\Framework\App\Config\FileResolver( $this->moduleReader, $this->filesystem, $this->iteratorFactory @@ -107,7 +113,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::CONFIG_DIR + \Magento\Framework\App\Filesystem::CONFIG_DIR )->will( $this->returnValue($directory) ); diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ConverterTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ConverterTest.php index ff20d55a86f71e6bf515f80ca760bd3150cca0f8..037950ef58bb0d75074fc32ce841c2ce48b0b296 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/Initial/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ConverterTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Initial\Converter + * @var \Magento\Framework\App\Config\Initial\Converter */ protected $_model; @@ -37,7 +37,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase 'stores' => '/config/stores', 'websites' => '/config/websites' ); - $this->_model = new \Magento\App\Config\Initial\Converter($nodeMap); + $this->_model = new \Magento\Framework\App\Config\Initial\Converter($nodeMap); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ReaderTest.php similarity index 85% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/ReaderTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ReaderTest.php index 2cd20e4f56a6ad7067dd7156d93d21eef641dfb3..bb2ec6d91aa11cb89910b0286572af06e0f5e349 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/Initial/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/ReaderTest.php @@ -21,14 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; class ReaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Initial\Reader + * @var \Magento\Framework\App\Config\Initial\Reader */ protected $_model; @@ -38,7 +38,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected $_fileResolverMock; /** - * @var \Magento\App\Config\Initial\Converter|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\Initial\Converter|\PHPUnit_Framework_MockObject_MockObject */ protected $_converterMock; @@ -56,8 +56,14 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $this->_filePath = __DIR__ . '/_files/'; $this->_fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface'); - $this->_converterMock = $this->getMock('Magento\App\Config\Initial\Converter'); - $schemaLocatorMock = $this->getMock('Magento\App\Config\Initial\SchemaLocator', array(), array(), '', false); + $this->_converterMock = $this->getMock('Magento\Framework\App\Config\Initial\Converter'); + $schemaLocatorMock = $this->getMock( + 'Magento\Framework\App\Config\Initial\SchemaLocator', + array(), + array(), + '', + false + ); $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface'); $validationStateMock->expects($this->once())->method('isValidated')->will($this->returnValue(true)); $schemaFile = $this->_filePath . 'config.xsd'; @@ -69,7 +75,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_model = new \Magento\App\Config\Initial\Reader( + $this->_model = new \Magento\Framework\App\Config\Initial\Reader( $this->_fileResolverMock, $this->_converterMock, $schemaLocatorMock, @@ -78,7 +84,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\App\Config\Initial\Reader::read + * @covers \Magento\Framework\App\Config\Initial\Reader::read */ public function testReadNoFiles() { @@ -108,7 +114,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\App\Config\Initial\Reader::read + * @covers \Magento\Framework\App\Config\Initial\Reader::read */ public function testReadValidConfig() { diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/XsdTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/XsdTest.php similarity index 97% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/XsdTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/XsdTest.php index 92a1a3c60126b710f586b393057e79171274e920..a5631d7516f05a9c2490fb154d73667345fc82a0 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/Initial/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/XsdTest.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; class XsdTest extends \PHPUnit_Framework_TestCase { diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/config.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/config.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/config.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/config.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/config.xsd b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/config.xsd similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/config.xsd rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/config.xsd diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/converted_config.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/converted_config.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/converted_config.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/converted_config.php diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config1.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config1.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config1.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config1.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config2.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config2.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config2.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config2.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config_merged.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config_merged.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/initial_config_merged.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/initial_config_merged.php diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/invalidConfigXmlArray.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/invalidConfigXmlArray.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/invalidConfigXmlArray.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/invalidConfigXmlArray.php diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/valid_config.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/valid_config.xml similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/Initial/_files/valid_config.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Initial/_files/valid_config.xml diff --git a/dev/tests/unit/testsuite/Magento/App/Config/InitialTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/InitialTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/Config/InitialTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/InitialTest.php index 56af83b4fd0f69cb7ba399bcd8d7be5d74ad5ba3..4ad69618670cc982df6f55aa227f9d66fec99632 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/InitialTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/InitialTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class InitialTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Initial + * @var \Magento\Framework\App\Config\Initial */ protected $_model; @@ -42,8 +42,10 @@ class InitialTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_initialReaderMock = $this->getMock('Magento\App\Config\Initial\Reader', array(), array(), '', false); - $this->_configCacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); + $this->_initialReaderMock = + $this->getMock('Magento\Framework\App\Config\Initial\Reader', array(), array(), '', false); + $this->_configCacheMock = + $this->getMock('Magento\Framework\App\Cache\Type\Config', array(), array(), '', false); $serializedData = serialize( array( 'data' => array( @@ -64,7 +66,7 @@ class InitialTest extends \PHPUnit_Framework_TestCase $this->returnValue($serializedData) ); - $this->_model = new \Magento\App\Config\Initial($this->_initialReaderMock, $this->_configCacheMock); + $this->_model = new \Magento\Framework\App\Config\Initial($this->_initialReaderMock, $this->_configCacheMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/App/Config/MetadataProcessorTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/MetadataProcessorTest.php similarity index 82% rename from dev/tests/unit/testsuite/Magento/App/Config/MetadataProcessorTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/MetadataProcessorTest.php index f3a356ced6ccbc650d55644639bd82bb6810b28f..a250ddef913e8f70d2352a2fd9d36cf48c3800e4 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/MetadataProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/MetadataProcessorTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class MetadataProcessorTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\MetadataProcessor + * @var \Magento\Framework\App\Config\MetadataProcessor */ protected $_model; @@ -48,14 +48,14 @@ class MetadataProcessorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_modelPoolMock = $this->getMock( - 'Magento\App\Config\Data\ProcessorFactory', + 'Magento\Framework\App\Config\Data\ProcessorFactory', array(), array(), '', false ); - $this->_initialConfigMock = $this->getMock('Magento\App\Config\Initial', array(), array(), '', false); - $this->_backendModelMock = $this->getMock('Magento\App\Config\Data\ProcessorInterface'); + $this->_initialConfigMock = $this->getMock('Magento\Framework\App\Config\Initial', array(), array(), '', false); + $this->_backendModelMock = $this->getMock('Magento\Framework\App\Config\Data\ProcessorInterface'); $this->_initialConfigMock->expects( $this->any() )->method( @@ -63,7 +63,10 @@ class MetadataProcessorTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue(array('some/config/path' => array('backendModel' => 'Custom_Backend_Model'))) ); - $this->_model = new \Magento\App\Config\MetadataProcessor($this->_modelPoolMock, $this->_initialConfigMock); + $this->_model = new \Magento\Framework\App\Config\MetadataProcessor( + $this->_modelPoolMock, + $this->_initialConfigMock + ); } public function testProcess() diff --git a/dev/tests/unit/testsuite/Magento/App/Config/Scope/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Scope/ConverterTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/Config/Scope/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/Scope/ConverterTest.php index 3fbbd70f321f9e06a95afe6dfcf4132a5612e10b..72320ae0298f2f604d780f9fa2d05fb983df4bb4 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/Scope/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/Scope/ConverterTest.php @@ -21,18 +21,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Scope; +namespace Magento\Framework\App\Config\Scope; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Scope\Converter + * @var \Magento\Framework\App\Config\Scope\Converter */ protected $_model; protected function setUp() { - $this->_model = new \Magento\App\Config\Scope\Converter(); + $this->_model = new \Magento\Framework\App\Config\Scope\Converter(); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/App/Config/ScopePoolTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/ScopePoolTest.php similarity index 73% rename from dev/tests/unit/testsuite/Magento/App/Config/ScopePoolTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/ScopePoolTest.php index 8413ca113314ed52dbecb6b85e615f2c409ab606..f565addfa4f8e6c97df6af453d0adec5e661ebb2 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/ScopePoolTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/ScopePoolTest.php @@ -21,22 +21,22 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class ScopePoolTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Config\Scope\Reader|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\Scope\Reader|PHPUnit_Framework_MockObject_MockObject */ protected $_reader; /** - * @var \Magento\App\Config\Scope\ReaderPoolInterface|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\Scope\ReaderPoolInterface|PHPUnit_Framework_MockObject_MockObject */ protected $_readerPool; /** - * @var \Magento\App\Config\DataFactory|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\DataFactory|PHPUnit_Framework_MockObject_MockObject */ protected $_dataFactory; @@ -46,21 +46,21 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase protected $_cache; /** - * @var \Magento\App\Config\ScopePool + * @var \Magento\Framework\App\Config\ScopePool */ protected $_object; public function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_readerPool = $this->getMockForAbstractClass('\Magento\App\Config\Scope\ReaderPoolInterface'); - $this->_reader = $this->getMockForAbstractClass('\Magento\App\Config\Scope\ReaderInterface'); + $this->_readerPool = $this->getMockForAbstractClass('\Magento\Framework\App\Config\Scope\ReaderPoolInterface'); + $this->_reader = $this->getMockForAbstractClass('\Magento\Framework\App\Config\Scope\ReaderInterface'); $this->_dataFactory = $this->getMockBuilder( - '\Magento\App\Config\DataFactory' + '\Magento\Framework\App\Config\DataFactory' )->disableOriginalConstructor()->getMock(); $this->_cache = $this->getMock('\Magento\Cache\FrontendInterface'); $this->_object = $helper->getObject( - '\Magento\App\Config\ScopePool', + '\Magento\Framework\App\Config\ScopePool', array( 'readerPool' => $this->_readerPool, 'dataFactory' => $this->_dataFactory, @@ -80,7 +80,7 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase */ public function testGetScope($scopeType, $scope, array $data, $cachedData) { - $scopeCode = $scope instanceof \Magento\App\ScopeInterface ? $scope->getCode() : $scope; + $scopeCode = $scope instanceof \Magento\Framework\App\ScopeInterface ? $scope->getCode() : $scope; $cacheKey = "test_cache_id|{$scopeType}|{$scopeCode}"; $this->_readerPool->expects( @@ -103,11 +103,13 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase )->with( serialize($data), $cacheKey, - array(\Magento\App\Config\ScopePool::CACHE_TAG) + array(\Magento\Framework\App\Config\ScopePool::CACHE_TAG) ); } - $configData = $this->getMockBuilder('\Magento\App\Config\Data')->disableOriginalConstructor()->getMock(); + $configData = $this->getMockBuilder('\Magento\Framework\App\Config\Data') + ->disableOriginalConstructor() + ->getMock(); $this->_dataFactory->expects( $this->once() )->method( @@ -117,15 +119,21 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($configData) ); - $this->assertInstanceOf('\Magento\App\Config\DataInterface', $this->_object->getScope($scopeType, $scope)); + $this->assertInstanceOf( + '\Magento\Framework\App\Config\DataInterface', + $this->_object->getScope($scopeType, $scope) + ); // second call to check caching - $this->assertInstanceOf('\Magento\App\Config\DataInterface', $this->_object->getScope($scopeType, $scope)); + $this->assertInstanceOf( + '\Magento\Framework\App\Config\DataInterface', + $this->_object->getScope($scopeType, $scope) + ); } public function getScopeDataProvider() { - $baseScope = $this->getMockForAbstractClass('Magento\App\ScopeInterface'); + $baseScope = $this->getMockForAbstractClass('Magento\Framework\App\ScopeInterface'); $baseScope->expects($this->any())->method('getCode')->will($this->returnValue('testScope')); return array( array('scopeType1', 'testScope', array('key' => 'value'), null), @@ -142,7 +150,7 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase 'clean' )->with( \Zend_Cache::CLEANING_MODE_MATCHING_TAG, - array(\Magento\App\Config\ScopePool::CACHE_TAG) + array(\Magento\Framework\App\Config\ScopePool::CACHE_TAG) ); $this->_object->clean('testScope'); } diff --git a/dev/tests/unit/testsuite/Magento/App/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/XsdTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/Config/XsdTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/XsdTest.php index a633880a8b8a0e0e44806d7b030375b78f373cdb..3d6fb29b3b8fa0fcd45a720adf5ea98dc5dfc849 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/XsdTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class XsdTest extends \PHPUnit_Framework_TestCase { @@ -38,7 +38,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_xsdSchema = BP . '/lib/Magento/App/etc/routes.xsd'; + $this->_xsdSchema = BP . '/lib/Magento/Framework/App/etc/routes.xsd'; $this->_xsdValidator = new \Magento\TestFramework\Utility\XsdValidator(); } diff --git a/dev/tests/unit/testsuite/Magento/App/Config/_files/invalidRoutesXmlArray.php b/dev/tests/unit/testsuite/Magento/Framework/App/Config/_files/invalidRoutesXmlArray.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Config/_files/invalidRoutesXmlArray.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/_files/invalidRoutesXmlArray.php diff --git a/dev/tests/unit/testsuite/Magento/App/Config/_files/valid_routes.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Config/_files/valid_routes.xml similarity index 98% rename from dev/tests/unit/testsuite/Magento/App/Config/_files/valid_routes.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Config/_files/valid_routes.xml index 4cc0d8e1d02e16f20d98ead2ed3999ab4b171dbf..c3b4bcf7c345d78e5d403724273063b60e5dbf6c 100644 --- a/dev/tests/unit/testsuite/Magento/App/Config/_files/valid_routes.xml +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Config/_files/valid_routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="first"> <route id="test"> <module name="Some_ModuleName" before="Some_BeforeModuleName" /> diff --git a/dev/tests/unit/testsuite/Magento/App/Console/ResponseTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/Console/ResponseTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php index f824fdb10a21307651ee57b7aea3ecd8780cb19d..b3bf510f8de690a661a667dc72fb36280461ad4f 100644 --- a/dev/tests/unit/testsuite/Magento/App/Console/ResponseTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php @@ -22,18 +22,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Console; +namespace Magento\Framework\App\Console; class ResponseTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Console\Response + * @var \Magento\Framework\App\Console\Response */ protected $model; public function setUp() { - $this->model = new \Magento\App\Console\Response(); + $this->model = new \Magento\Framework\App\Console\Response(); } public function testSendResponseDefaultBehaviour() diff --git a/dev/tests/unit/testsuite/Magento/App/CronTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/CronTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/CronTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/CronTest.php index 2568293b4d8b8573270521a499d6fddbb96e342e..d4e6600743ec38c198223cd2e967596f126231c2 100644 --- a/dev/tests/unit/testsuite/Magento/App/CronTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/CronTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class CronTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Cron + * @var \Magento\Framework\App\Cron */ protected $_model; @@ -58,9 +58,9 @@ class CronTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_eventManagerMock = $this->getMock('Magento\Event\ManagerInterface'); - $this->_stateMock = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->_request = $this->getMock('Magento\App\Console\Request', array(), array(), '', false); - $this->_responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->_stateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\Console\Request', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); $this->_model = new Cron($this->_eventManagerMock, $this->_stateMock, $this->_request, $this->_responseMock); } diff --git a/dev/tests/unit/testsuite/Magento/App/EntryPoint/EntryPointTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/EntryPoint/EntryPointTest.php similarity index 83% rename from dev/tests/unit/testsuite/Magento/App/EntryPoint/EntryPointTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/EntryPoint/EntryPointTest.php index cf17a2030a14d0e2308234c0b0dcb86f82fda0cd..971b4ba1bf3ce1d31ce83f70f68e690b2226a455 100644 --- a/dev/tests/unit/testsuite/Magento/App/EntryPoint/EntryPointTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/EntryPoint/EntryPointTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\EntryPoint; +namespace Magento\Framework\App\EntryPoint; class EntryPointTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\EntryPoint\EntryPoint + * @var \Magento\Framework\App\EntryPoint\EntryPoint */ protected $_model; @@ -54,9 +54,9 @@ class EntryPointTest extends \PHPUnit_Framework_TestCase { $this->_parameters = array('MAGE_MODE' => 'developer'); $this->_objectManagerMock = $this->getMock('Magento\ObjectManager'); - $this->_responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $this->_rootDir = realpath(__DIR__ . '/../../../../../../../'); - $this->_model = new \Magento\App\EntryPoint\EntryPoint( + $this->_model = new \Magento\Framework\App\EntryPoint\EntryPoint( $this->_rootDir, $this->_parameters, $this->_objectManagerMock @@ -65,8 +65,8 @@ class EntryPointTest extends \PHPUnit_Framework_TestCase public function testRunExecutesApplication() { - $applicationName = '\Magento\App\TestApplication'; - $applicationMock = $this->getMock('\Magento\AppInterface'); + $applicationName = '\Magento\Framework\App\TestApplication'; + $applicationMock = $this->getMock('\Magento\Framework\AppInterface'); $applicationMock->expects($this->once())->method('launch')->will($this->returnValue($this->_responseMock)); $this->_objectManagerMock->expects( $this->once() @@ -83,8 +83,8 @@ class EntryPointTest extends \PHPUnit_Framework_TestCase public function testRunCatchesExceptionThrownByApplication() { - $applicationName = '\Magento\App\TestApplication'; - $applicationMock = $this->getMock('\Magento\AppInterface'); + $applicationName = '\Magento\Framework\App\TestApplication'; + $applicationMock = $this->getMock('\Magento\Framework\AppInterface'); $applicationMock->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/App/Error/HandlerTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Error/HandlerTest.php similarity index 79% rename from dev/tests/unit/testsuite/Magento/App/Error/HandlerTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Error/HandlerTest.php index ad1dd01a8d0134e7022ebf2d19a384039e9e7086..e1a5d67fc967ad3684b3a2ea6e608ed837fc6384 100644 --- a/dev/tests/unit/testsuite/Magento/App/Error/HandlerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Error/HandlerTest.php @@ -1,6 +1,6 @@ <?php /** - * Unit Test for \Magento\App\Error\Handler + * Unit Test for \Magento\Framework\App\Error\Handler * * Magento * @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Error; +namespace Magento\Framework\App\Error; class HandlerTest extends \PHPUnit_Framework_TestCase { @@ -37,30 +37,30 @@ class HandlerTest extends \PHPUnit_Framework_TestCase /** * Filesystem mock * - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; /** * App state mock * - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $appState; /** * Handler instance * - * @var \Magento\App\Error\Handler + * @var \Magento\Framework\App\Error\Handler */ protected $handler; protected function setUp() { $this->logger = $this->getMock('Magento\Logger', array(), array(), '', false); - $this->filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); - $this->appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->handler = new \Magento\App\Error\Handler($this->logger, $this->filesystem, $this->appState); + $this->filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); + $this->appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $this->handler = new \Magento\Framework\App\Error\Handler($this->logger, $this->filesystem, $this->appState); } /** @@ -75,7 +75,7 @@ class HandlerTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEVELOPER) + $this->returnValue(\Magento\Framework\App\State::MODE_DEVELOPER) ); $exception = new \Exception('TestMessage'); @@ -99,16 +99,16 @@ class HandlerTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEFAULT) + $this->returnValue(\Magento\Framework\App\State::MODE_DEFAULT) ); $this->filesystem->expects( $this->atLeastOnce() )->method( 'getPath' )->with( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR )->will( - $this->returnValue(dirname(__DIR__) . '/../_files') + $this->returnValue(dirname(__DIR__) . '/../../_files') ); $exception = new \Exception('TestMessage'); @@ -128,7 +128,7 @@ class HandlerTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEFAULT) + $this->returnValue(\Magento\Framework\App\State::MODE_DEFAULT) ); $this->logger->expects( $this->once() @@ -162,7 +162,7 @@ class HandlerTest extends \PHPUnit_Framework_TestCase )->method( 'getMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEVELOPER) + $this->returnValue(\Magento\Framework\App\State::MODE_DEVELOPER) ); set_error_handler(array($this->handler, 'handler')); try { diff --git a/dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/ConfigurationTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/ConfigurationTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/ConfigurationTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/ConfigurationTest.php index ae2b49ae450063713c96c68e2fa14963559dd16a..6a1285844460931156af3ca23fb92a23b52d4ad3 100644 --- a/dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/ConfigurationTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/ConfigurationTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Filesystem\DirectoryList; +namespace Magento\Framework\App\Filesystem\DirectoryList; class ConfigurationTest extends \PHPUnit_Framework_TestCase { @@ -39,7 +39,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase /* Mock Config model */ $config = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->setMethods( array('getValue', 'setValue', 'isSetFlag') )->getMock(); @@ -51,7 +51,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase )->with( Configuration::XML_FILESYSTEM_DIRECTORY_PATH )->will( - $this->returnValue(array(\Magento\App\Filesystem::PUB_DIR => array('uri' => ''))) + $this->returnValue(array(\Magento\Framework\App\Filesystem::PUB_DIR => array('uri' => ''))) ); $config->expects( @@ -85,7 +85,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase )->method( 'isConfigured' )->with( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR )->will( $this->returnValue($pubDirIsConfigured) ); @@ -98,13 +98,13 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase )->method( 'addDirectory' )->with( - \Magento\App\Filesystem::PUB_DIR, + \Magento\Framework\App\Filesystem::PUB_DIR, array('uri' => '') ); } $this->dirListConfiguration = $objectManager->getObject( - 'Magento\App\Filesystem\DirectoryList\Configuration', + 'Magento\Framework\App\Filesystem\DirectoryList\Configuration', array('config' => $config) ); $this->assertNull($this->dirListConfiguration->configure($directoryList)); diff --git a/dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/VerificationTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/VerificationTest.php similarity index 77% rename from dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/VerificationTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/VerificationTest.php index 4dda3016a739ccb79be4d821e3fb636d47fced53..cc5c823f19cb4e887e527e48cd83fc6457c50eaa 100644 --- a/dev/tests/unit/testsuite/Magento/App/Filesystem/DirectoryList/VerificationTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Filesystem/DirectoryList/VerificationTest.php @@ -21,9 +21,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Filesystem\DirectoryList; +namespace Magento\Framework\App\Filesystem\DirectoryList; -use Magento\App\State; +use Magento\Framework\App\State; class VerificationTest extends \PHPUnit_Framework_TestCase { @@ -51,25 +51,25 @@ class VerificationTest extends \PHPUnit_Framework_TestCase 'developer mode' => array( State::MODE_DEVELOPER, array( - \Magento\App\Filesystem::CACHE_DIR => array(true, true, 'base_dir/var/cache'), - \Magento\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), - \Magento\App\Filesystem::SESSION_DIR => array(true, true, 'base_dir/var/session') + \Magento\Framework\App\Filesystem::CACHE_DIR => array(true, true, 'base_dir/var/cache'), + \Magento\Framework\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), + \Magento\Framework\App\Filesystem::SESSION_DIR => array(true, true, 'base_dir/var/session') ) ), 'with_not_existing_dirs' => array( State::MODE_DEFAULT, array( - \Magento\App\Filesystem::CACHE_DIR => array(false, true, 'base_dir/var/cache'), - \Magento\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), - \Magento\App\Filesystem::SESSION_DIR => array(false, true, 'base_dir/var/session') + \Magento\Framework\App\Filesystem::CACHE_DIR => array(false, true, 'base_dir/var/cache'), + \Magento\Framework\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), + \Magento\Framework\App\Filesystem::SESSION_DIR => array(false, true, 'base_dir/var/session') ) ), 'production mode' => array( State::MODE_PRODUCTION, array( - \Magento\App\Filesystem::CACHE_DIR => array(true, true, 'base_dir/var/cache'), - \Magento\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), - \Magento\App\Filesystem::SESSION_DIR => array(true, true, 'base_dir/var/session') + \Magento\Framework\App\Filesystem::CACHE_DIR => array(true, true, 'base_dir/var/cache'), + \Magento\Framework\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), + \Magento\Framework\App\Filesystem::SESSION_DIR => array(true, true, 'base_dir/var/session') ) ) ); @@ -100,9 +100,9 @@ class VerificationTest extends \PHPUnit_Framework_TestCase 'developer mode' => array( State::MODE_DEVELOPER, array( - \Magento\App\Filesystem::CACHE_DIR => array(true, false, 'base_dir/var/cache'), - \Magento\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), - \Magento\App\Filesystem::SESSION_DIR => array(true, false, 'base_dir/var/session') + \Magento\Framework\App\Filesystem::CACHE_DIR => array(true, false, 'base_dir/var/cache'), + \Magento\Framework\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), + \Magento\Framework\App\Filesystem::SESSION_DIR => array(true, false, 'base_dir/var/session') ) ) ); @@ -133,9 +133,9 @@ class VerificationTest extends \PHPUnit_Framework_TestCase 'developer mode' => array( State::MODE_DEVELOPER, array( - \Magento\App\Filesystem::CACHE_DIR => array(true, false, 'base_dir/var/cache'), - \Magento\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), - \Magento\App\Filesystem::SESSION_DIR => array(true, false, 'base_dir/var/session', true) + \Magento\Framework\App\Filesystem::CACHE_DIR => array(true, false, 'base_dir/var/cache'), + \Magento\Framework\App\Filesystem::LOG_DIR => array(true, true, 'base_dir/var/log'), + \Magento\Framework\App\Filesystem::SESSION_DIR => array(true, false, 'base_dir/var/session', true) ) ) ); @@ -151,7 +151,7 @@ class VerificationTest extends \PHPUnit_Framework_TestCase protected function getVerificationInstance(array $expectedDirs, $mode) { $filesystem = $this->getFilesystemMock($expectedDirs); - $appState = $this->getMock('Magento\App\State', array('getMode'), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array('getMode'), array(), '', false); $appState->expects($this->once())->method('getMode')->will($this->returnValue($mode)); return new Verification($filesystem, $appState); } @@ -165,7 +165,7 @@ class VerificationTest extends \PHPUnit_Framework_TestCase protected function getFilesystemMock(array $dirsToVerify) { $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', '__wakeup'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/App/FilesystemTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/FilesystemTest.php similarity index 93% rename from dev/tests/unit/testsuite/Magento/App/FilesystemTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/FilesystemTest.php index 16ad3d80476f97cafcae0f1702391daad7288c8e..001600a4de0ddcb2c3ef35fce952e672f2cdc4e8 100644 --- a/dev/tests/unit/testsuite/Magento/App/FilesystemTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/FilesystemTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class FilesystemTest extends \PHPUnit_Framework_TestCase { @@ -34,7 +34,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Filesystem\Directory\WriteFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $_dirWriteFactoryMock; - /** @var \Magento\App\Filesystem\DirectoryList|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem\DirectoryList|\PHPUnit_Framework_MockObject_MockObject */ protected $_directoryListMock; /** @var \Magento\Filesystem\File\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ @@ -50,7 +50,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase false ); $this->_directoryListMock = $this->getMock( - 'Magento\App\Filesystem\DirectoryList', + 'Magento\Framework\App\Filesystem\DirectoryList', array(), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/App/FrontClass.php b/dev/tests/unit/testsuite/Magento/Framework/App/FrontClass.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/App/FrontClass.php rename to dev/tests/unit/testsuite/Magento/Framework/App/FrontClass.php index 09edb91a1caf18dd17434a10eddfe00d25883dba..48c7b54daadb9b22b277372087ce0315f60abb6a 100644 --- a/dev/tests/unit/testsuite/Magento/App/FrontClass.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/FrontClass.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class FrontClass { diff --git a/dev/tests/unit/testsuite/Magento/App/FrontControllerTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/FrontControllerTest.php similarity index 79% rename from dev/tests/unit/testsuite/Magento/App/FrontControllerTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/FrontControllerTest.php index e8c82293b788bba37cce49c85ff7210f10699cf9..496818b6bf1f0a378e304ff4eba26da9747f8880 100644 --- a/dev/tests/unit/testsuite/Magento/App/FrontControllerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/FrontControllerTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class FrontControllerTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\FrontController + * @var \Magento\Framework\App\FrontController */ protected $_model; @@ -47,11 +47,12 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_router = $this->getMock('Magento\App\Router\AbstractRouter', array('match'), array(), '', false); - $this->_routerList = $this->getMock('Magento\App\RouterList', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_router = + $this->getMock('Magento\Framework\App\Router\AbstractRouter', array('match'), array(), '', false); + $this->_routerList = $this->getMock('Magento\Framework\App\RouterList', array(), array(), '', false); $this->_routerList->expects($this->any())->method('getIterator')->will($this->returnValue($this->_routerList)); - $this->_model = new \Magento\App\FrontController($this->_routerList); + $this->_model = new \Magento\Framework\App\FrontController($this->_routerList); } /** @@ -73,8 +74,8 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase $this->_request->expects($this->any())->method('isDispatched')->will($this->returnValue(false)); $this->_routerList->expects($this->atLeastOnce())->method('valid')->will($this->returnValue(true)); $this->_routerList->expects($this->atLeastOnce())->method('current')->will($this->returnValue($this->_router)); - $controllerInstance = $this->getMock('Magento\App\ActionInterface'); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $controllerInstance = $this->getMock('Magento\Framework\App\ActionInterface'); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $controllerInstance->expects($this->any())->method('getResponse')->will($this->returnValue($response)); $this->_router->expects($this->atLeastOnce())->method('match')->will($this->returnValue($controllerInstance)); $controllerInstance->expects($this->any())->method('dispatch')->with($this->_request); diff --git a/dev/tests/unit/testsuite/Magento/App/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/HttpTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php index 202c953260ae3336e5c3de5bdae61115be98c540..d5a7e60264b201a7782bc7d9b40ecbecb5c7a2e8 100644 --- a/dev/tests/unit/testsuite/Magento/App/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class HttpTest extends \PHPUnit_Framework_TestCase { @@ -47,7 +47,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected $_filesystemMock; /** - * @var \Magento\App\Http + * @var \Magento\Framework\App\Http */ protected $_http; @@ -70,24 +70,26 @@ class HttpTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_requestMock = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->setMethods(['getFrontName'])->getMock(); $frontName = 'frontName'; $this->_requestMock->expects($this->once())->method('getFrontName')->will($this->returnValue($frontName)); $areaCode = 'areaCode'; - $areaListMock = $this->getMockBuilder('Magento\App\AreaList')->disableOriginalConstructor()->setMethods( - ['getCodeByFrontName'] - )->getMock(); + $areaListMock = $this->getMockBuilder('Magento\Framework\App\AreaList') + ->disableOriginalConstructor() + ->setMethods(['getCodeByFrontName']) + ->getMock(); $areaListMock->expects($this->once())->method('getCodeByFrontName')->with($frontName)->will( $this->returnValue($areaCode) ); - $this->_stateMock = $this->getMockBuilder('Magento\App\State')->disableOriginalConstructor()->setMethods( - ['setAreaCode', 'getMode'] - )->getMock(); + $this->_stateMock = $this->getMockBuilder('Magento\Framework\App\State') + ->disableOriginalConstructor() + ->setMethods(['setAreaCode', 'getMode']) + ->getMock(); $this->_stateMock->expects($this->once())->method('setAreaCode')->with($areaCode); $areaConfig = []; $configLoaderMock = $this->getMockBuilder( - 'Magento\App\ObjectManager\ConfigLoader' + 'Magento\Framework\App\ObjectManager\ConfigLoader' )->disableOriginalConstructor()->setMethods(['load'])->getMock(); $configLoaderMock->expects($this->once())->method('load')->with($areaCode)->will( $this->returnValue($areaConfig) @@ -97,16 +99,17 @@ class HttpTest extends \PHPUnit_Framework_TestCase )->getMock(); $objectManagerMock->expects($this->once())->method('configure')->with($areaConfig); $this->_responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->setMethods( ['setHttpResponseCode', 'setBody'] )->getMock(); $this->_frontControllerMock = $this->getMockBuilder( - 'Magento\App\FrontControllerInterface' + 'Magento\Framework\App\FrontControllerInterface' )->disableOriginalConstructor()->setMethods(['dispatch'])->getMock(); - $objectManagerMock->expects($this->once())->method('get')->with('Magento\App\FrontControllerInterface')->will( - $this->returnValue($this->_frontControllerMock) - ); + $objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Framework\App\FrontControllerInterface') + ->will($this->returnValue($this->_frontControllerMock)); $this->_frontControllerMock->expects($this->once())->method('dispatch')->with($this->_requestMock)->will( $this->returnValue($this->_responseMock) ); @@ -116,13 +119,13 @@ class HttpTest extends \PHPUnit_Framework_TestCase ['dispatch'] )->getMock(); $this->_filesystemMock = $this->getMockBuilder( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->disableOriginalConstructor()->setMethods( ['getPath'] )->getMock(); $this->_http = $this->_objectManager->getObject( - 'Magento\App\Http', + 'Magento\Framework\App\Http', [ 'objectManager' => $objectManagerMock, 'eventManager' => $this->_eventManagerMock, @@ -155,7 +158,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase ) ); $this->_stateMock->expects($this->once())->method('getMode')->will( - $this->returnValue(\Magento\App\State::MODE_DEVELOPER) + $this->returnValue(\Magento\Framework\App\State::MODE_DEVELOPER) ); $this->_responseMock->expects($this->once())->method('setHttpResponseCode')->with(500); diff --git a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigCacheTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigCacheTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigCacheTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigCacheTest.php index 2512f61bf6f0dab46e34c1072280cad4d56d76b8..58e950ec59af6883d121ca9bfe8a6f833f4788fc 100644 --- a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigCacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigCacheTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\ObjectManager; +namespace Magento\Framework\App\ObjectManager; class ConfigCacheTest extends \PHPUnit_Framework_TestCase { /** - * @var Magento\App\ObjectManager\ConfigCache + * @var Magento\Framework\App\ObjectManager\ConfigCache */ protected $_configCache; @@ -38,7 +38,7 @@ class ConfigCacheTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_cacheFrontendMock = $this->getMock('\Magento\Cache\FrontendInterface'); - $this->_configCache = new \Magento\App\ObjectManager\ConfigCache($this->_cacheFrontendMock); + $this->_configCache = new \Magento\Framework\App\ObjectManager\ConfigCache($this->_cacheFrontendMock); } protected function tearDown() diff --git a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php index 657aec888ff8adba123de08b54305d609ca55c4b..6f7146d16f66d06f7856c5e7f28f085b4decf324 100644 --- a/dev/tests/unit/testsuite/Magento/App/ObjectManager/ConfigLoaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\ObjectManager; +namespace Magento\Framework\App\ObjectManager; class ConfigLoaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\ObjectManager\ConfigLoader + * @var \Magento\Framework\App\ObjectManager\ConfigLoader */ protected $_model; @@ -36,7 +36,7 @@ class ConfigLoaderTest extends \PHPUnit_Framework_TestCase protected $_readerMock; /** - * @var \Magento\App\Cache\Type\Config + * @var \Magento\Framework\App\Cache\Type\Config */ protected $_cacheMock; @@ -44,8 +44,8 @@ class ConfigLoaderTest extends \PHPUnit_Framework_TestCase { $this->_readerMock = $this->getMock('Magento\ObjectManager\Config\Reader\Dom', array(), array(), '', false); - $this->_cacheMock = $this->getMock('Magento\App\Cache\Type\Config', array(), array(), '', false); - $this->_model = new \Magento\App\ObjectManager\ConfigLoader($this->_cacheMock, $this->_readerMock); + $this->_cacheMock = $this->getMock('Magento\Framework\App\Cache\Type\Config', array(), array(), '', false); + $this->_model = new \Magento\Framework\App\ObjectManager\ConfigLoader($this->_cacheMock, $this->_readerMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/App/PageCache/FormKeyTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/FormKeyTest.php similarity index 87% rename from dev/tests/unit/testsuite/Magento/App/PageCache/FormKeyTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/PageCache/FormKeyTest.php index 57cdb4bafaf128e9ebcc9d0a2dcd0f6844f9f79a..49f4e8aafc9634688ba2b0b6d42ccd6427c7993b 100644 --- a/dev/tests/unit/testsuite/Magento/App/PageCache/FormKeyTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/FormKeyTest.php @@ -22,11 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Class FormKeyTest - * @package Magento\App\PageCache + * @package Magento\Framework\App\PageCache */ class FormKeyTest extends \PHPUnit_Framework_TestCase { @@ -50,7 +50,7 @@ class FormKeyTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->cookieMock = $this->getMock('Magento\Stdlib\Cookie', array('get'), array(), '', false); - $this->formKey = new \Magento\App\PageCache\FormKey($this->cookieMock); + $this->formKey = new \Magento\Framework\App\PageCache\FormKey($this->cookieMock); } public function testGet() @@ -61,7 +61,7 @@ class FormKeyTest extends \PHPUnit_Framework_TestCase //Verification $this->cookieMock->expects($this->once()) ->method('get') - ->with(\Magento\App\PageCache\FormKey::COOKIE_NAME) + ->with(\Magento\Framework\App\PageCache\FormKey::COOKIE_NAME) ->will($this->returnValue($formKey)); $this->assertEquals($formKey, $this->formKey->get()); diff --git a/dev/tests/unit/testsuite/Magento/App/PageCache/IdentifierTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/IdentifierTest.php similarity index 80% rename from dev/tests/unit/testsuite/Magento/App/PageCache/IdentifierTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/PageCache/IdentifierTest.php index 8221a507215d3e6a37681939b37aabc12d201b5d..5c5ce8cda52f11ac3bcb076cf4e8721e21aa4396 100644 --- a/dev/tests/unit/testsuite/Magento/App/PageCache/IdentifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/IdentifierTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; class IdentifierTest extends \PHPUnit_Framework_TestCase { @@ -31,18 +31,20 @@ class IdentifierTest extends \PHPUnit_Framework_TestCase $vary = 1; $expected = md5(serialize(array($uri, $vary))); - $requestMock = $this->getMockBuilder('\Magento\App\Request\Http')->disableOriginalConstructor()->getMock(); + $requestMock = $this->getMockBuilder('\Magento\Framework\App\Request\Http') + ->disableOriginalConstructor() + ->getMock(); $requestMock->expects($this->once())->method('getRequestUri')->will($this->returnValue($uri)); $requestMock->expects( $this->once() )->method( 'get' )->with( - $this->equalTo(\Magento\App\Response\Http::COOKIE_VARY_STRING) + $this->equalTo(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING) )->will( $this->returnValue($vary) ); - $model = new \Magento\App\PageCache\Identifier($requestMock); + $model = new \Magento\Framework\App\PageCache\Identifier($requestMock); $result = $model->getValue(); $this->assertEquals($expected, $result); } diff --git a/dev/tests/unit/testsuite/Magento/App/PageCache/KernelTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/KernelTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/PageCache/KernelTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/PageCache/KernelTest.php index 01a781e38a2ff840be4d3288e3db16cdbb2ecedc..70d811202d8120b23b7e953dba77b8b31c80a091 100644 --- a/dev/tests/unit/testsuite/Magento/App/PageCache/KernelTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/KernelTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; class KernelTest extends \PHPUnit_Framework_TestCase { @@ -31,22 +31,22 @@ class KernelTest extends \PHPUnit_Framework_TestCase protected $kernel; /** - * @var \Magento\App\PageCache\Cache|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\PageCache\Cache|\PHPUnit_Framework_MockObject_MockObject */ protected $cacheMock; /** - * @var \Magento\App\PageCache\Identifier|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\PageCache\Identifier|\PHPUnit_Framework_MockObject_MockObject */ protected $identifierMock; /** - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; /** - * @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; @@ -55,12 +55,13 @@ class KernelTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->cacheMock = $this->getMock('Magento\App\PageCache\Cache', array(), array(), '', false); - $this->identifierMock = $this->getMock('Magento\App\PageCache\Identifier', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->cacheMock = $this->getMock('Magento\Framework\App\PageCache\Cache', array(), array(), '', false); + $this->identifierMock = + $this->getMock('Magento\Framework\App\PageCache\Identifier', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->kernel = new Kernel($this->cacheMock, $this->identifierMock, $this->requestMock); $this->responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->setMethods( array('getHeader', 'getHttpResponseCode', 'setNoCacheHeaders', 'clearHeader') )->disableOriginalConstructor()->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/App/PageCache/PageCacheTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/PageCacheTest.php similarity index 78% rename from dev/tests/unit/testsuite/Magento/App/PageCache/PageCacheTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/PageCache/PageCacheTest.php index b6ffa5bbd999beeabe3e8a16866467154a0c9114..6b38a4492cbd1d711f89ead48b129f122613c1dd 100644 --- a/dev/tests/unit/testsuite/Magento/App/PageCache/PageCacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/PageCacheTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; class PageCacheTest extends \PHPUnit_Framework_TestCase { @@ -29,7 +29,9 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase { $identifier = 'page_cache'; - $poolMock = $this->getMockBuilder('\Magento\App\Cache\Frontend\Pool')->disableOriginalConstructor()->getMock(); + $poolMock = $this->getMockBuilder('\Magento\Framework\App\Cache\Frontend\Pool') + ->disableOriginalConstructor() + ->getMock(); $poolMock->expects( $this->once() )->method( @@ -39,7 +41,7 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase )->will( $this->returnArgument(0) ); - $model = new \Magento\App\PageCache\Cache($poolMock); - $this->assertInstanceOf('Magento\App\PageCache\Cache', $model); + $model = new \Magento\Framework\App\PageCache\Cache($poolMock); + $this->assertInstanceOf('Magento\Framework\App\PageCache\Cache', $model); } } diff --git a/dev/tests/unit/testsuite/Magento/App/PageCache/VersionTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/VersionTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/App/PageCache/VersionTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/PageCache/VersionTest.php index 280bd84ac2cb65bd0ecb359c57d1cf2311e2de26..766583908e1e76ce44f8e08f504be96f3d4f64c6 100644 --- a/dev/tests/unit/testsuite/Magento/App/PageCache/VersionTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/PageCache/VersionTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; class VersionTest extends \PHPUnit_Framework_TestCase { @@ -42,7 +42,7 @@ class VersionTest extends \PHPUnit_Framework_TestCase /** * Request mock * - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -52,7 +52,7 @@ class VersionTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->cookieMock = $this->getMock('Magento\Stdlib\Cookie', array('set'), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array('isPost'), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array('isPost'), array(), '', false); $this->version = new Version($this->cookieMock, $this->requestMock); } diff --git a/dev/tests/unit/testsuite/Magento/App/ReinitableConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ReinitableConfigTest.php similarity index 77% rename from dev/tests/unit/testsuite/Magento/App/ReinitableConfigTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ReinitableConfigTest.php index f7532d498944eed02e3fc4c21223c15f39ca3b16..ac03d39822a94a10f51fc7ac5fad13c5b677cc73 100644 --- a/dev/tests/unit/testsuite/Magento/App/ReinitableConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ReinitableConfigTest.php @@ -24,17 +24,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ReinitableConfigTest extends \PHPUnit_Framework_TestCase { public function testReinit() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $scopePool = $this->getMock('\Magento\App\Config\ScopePool', array('clean'), array(), '', false); + $scopePool = $this->getMock('\Magento\Framework\App\Config\ScopePool', array('clean'), array(), '', false); $scopePool->expects($this->once())->method('clean'); /** @var \Magento\Core\Model\ReinitableConfig $config */ - $config = $helper->getObject('Magento\App\ReinitableConfig', array('scopePool' => $scopePool)); - $this->assertInstanceOf('\Magento\App\Config\ReinitableConfigInterface', $config->reinit()); + $config = $helper->getObject('Magento\Framework\App\ReinitableConfig', array('scopePool' => $scopePool)); + $this->assertInstanceOf('\Magento\Framework\App\Config\ReinitableConfigInterface', $config->reinit()); } } diff --git a/dev/tests/unit/testsuite/Magento/App/Request/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/App/Request/HttpTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php index db755d4881e974f851286a244d490bec9b9df0d4..a449742e8b38133222053ff7956df22f12d182c7 100644 --- a/dev/tests/unit/testsuite/Magento/App/Request/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php @@ -22,14 +22,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Request; +namespace Magento\Framework\App\Request; -use Magento\App\Request\Http as Request; +use Magento\Framework\App\Request\Http as Request; class HttpTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $_model; @@ -45,8 +45,8 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_routerListMock = $this->getMock('Magento\App\Route\ConfigInterface'); - $this->_infoProcessorMock = $this->getMock('Magento\App\Request\PathInfoProcessorInterface'); + $this->_routerListMock = $this->getMock('Magento\Framework\App\Route\ConfigInterface'); + $this->_infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $this->_infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); } @@ -136,7 +136,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase public function testSetRouteNameWithRouter() { - $router = $this->getMock('\Magento\App\Router\AbstractRouter', array(), array(), '', false); + $router = $this->getMock('\Magento\Framework\App\Router\AbstractRouter', array(), array(), '', false); $this->_routerListMock->expects($this->any())->method('getRouteFrontName')->will($this->returnValue($router)); $this->_model = new Request($this->_routerListMock, $this->_infoProcessorMock); $this->_model->setRouteName('RouterName'); diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ConverterTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ConverterTest.php index 3ec1ac362908b79e4e9569511a3ca95ae2cb547e..327d543acc29e617c176b900c4d2208a526a7860 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ConverterTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource\Config\Converter + * @var \Magento\Framework\App\Resource\Config\Converter */ protected $_model; @@ -44,7 +44,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase { $this->_filePath = __DIR__ . '/_files/'; $this->_source = new \DOMDocument(); - $this->_model = new \Magento\App\Resource\Config\Converter(); + $this->_model = new \Magento\Framework\App\Resource\Config\Converter(); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ReaderTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/ReaderTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ReaderTest.php index 3b5f215733891dde63a9c449bc3f4e7c900eebbf..22e6c181d6f3b6c7bd6a608c109e1f5ecadf24cf 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/ReaderTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class ReaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource\Config\Reader + * @var \Magento\Framework\App\Resource\Config\Reader */ protected $_model; @@ -67,18 +67,19 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface'); $this->_validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface'); $this->_schemaLocatorMock = $this->getMock( - 'Magento\App\Resource\Config\SchemaLocator', + 'Magento\Framework\App\Resource\Config\SchemaLocator', array(), array(), '', false ); - $this->_converterMock = $this->getMock('Magento\App\Resource\Config\Converter', array(), array(), '', false); + $this->_converterMock = + $this->getMock('Magento\Framework\App\Resource\Config\Converter', array(), array(), '', false); - $this->_configLocalMock = $this->getMock('Magento\App\Arguments', array(), array(), '', false); + $this->_configLocalMock = $this->getMock('Magento\Framework\App\Arguments', array(), array(), '', false); - $this->_model = new \Magento\App\Resource\Config\Reader( + $this->_model = new \Magento\Framework\App\Resource\Config\Reader( $this->_fileResolverMock, $this->_converterMock, $this->_schemaLocatorMock, diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/SchemaLocatorTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/SchemaLocatorTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/SchemaLocatorTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/SchemaLocatorTest.php index 0a1483b417fe829eb7a92e61d5d0b44b32f9524a..77cd4ffbd106202d760ee07a3204b4f43db5562a 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/SchemaLocatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/SchemaLocatorTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { @@ -31,14 +31,14 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase protected $_expected; /** - * @var \Magento\App\Resource\Config\SchemaLocator + * @var \Magento\Framework\App\Resource\Config\SchemaLocator */ protected $_model; protected function setUp() { - $this->_expected = str_replace('\\', '/', BP) . '/lib/Magento/App/etc/resources.xsd'; - $this->_model = new \Magento\App\Resource\Config\SchemaLocator(); + $this->_expected = str_replace('\\', '/', BP) . '/lib/Magento/Framework/App/etc/resources.xsd'; + $this->_model = new \Magento\Framework\App\Resource\Config\SchemaLocator(); } public function testGetSchema() diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/XsdTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/XsdTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/XsdTest.php index b722857b6046bf1f6d5f5527c2db19cf4d818d93..7bb9aa3dcc31b22ce36f10b381eee3e08547c919 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/XsdTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class XsdTest extends \PHPUnit_Framework_TestCase { @@ -38,7 +38,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_xsdSchema = BP . '/lib/Magento/App/etc/resources.xsd'; + $this->_xsdSchema = BP . '/lib/Magento/Framework/App/etc/resources.xsd'; $this->_xsdValidator = new \Magento\TestFramework\Utility\XsdValidator(); } diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/invalidResourcesXmlArray.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/invalidResourcesXmlArray.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/invalidResourcesXmlArray.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/invalidResourcesXmlArray.php diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/resources.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/resources.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/resources.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/resources.php diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/resources.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/resources.xml similarity index 97% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/resources.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/resources.xml index 83d0c6b9670a8478bbce3817a6a851a551dfe02e..8ad07dd490af26adec4cd917c0a9b9a8c48978dd 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/resources.xml +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/resources.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Framework/App/etc/resources.xsd"> <resource name="resourceName" extends="anotherResourceName" /> <resource name="otherResourceName" connection="connectionName" /> <resource name="defaultSetup" connection="customConnection" /> diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/valid_resources.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/valid_resources.xml similarity index 96% rename from dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/valid_resources.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/valid_resources.xml index 3f77a9df5a02ad57b01b4497e93c89fc2e0a1405..db51b6d8b3a251a1c09f51fc4f85fa3a1e153216 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/Config/_files/valid_resources.xml +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/Config/_files/valid_resources.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/App/etc/resources.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Framework/App/etc/resources.xsd"> <resource name="test_name" extends="test_extends" connection="test_connection" /> <resource name="test_name_two" /> </config> diff --git a/dev/tests/unit/testsuite/Magento/App/Resource/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/App/Resource/ConfigTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php index 259634f21e17ffb90d253991665cec84ff045a04..10f11e0373081df9167b2aed4822597f37cb27d5 100644 --- a/dev/tests/unit/testsuite/Magento/App/Resource/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource; +namespace Magento\Framework\App\Resource; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Resource\Config + * @var \Magento\Framework\App\Resource\Config */ protected $_model; @@ -60,7 +60,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_scopeMock = $this->getMock('Magento\Config\ScopeInterface'); $this->_cacheMock = $this->getMock('Magento\Config\CacheInterface'); - $this->_readerMock = $this->getMock('Magento\App\Resource\Config\Reader', array(), array(), '', false); + $this->_readerMock = + $this->getMock('Magento\Framework\App\Resource\Config\Reader', array(), array(), '', false); $this->_resourcesConfig = array( 'mainResourceName' => array('name' => 'mainResourceName', 'extends' => 'anotherResourceName'), @@ -82,7 +83,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->returnValue(serialize($this->_resourcesConfig)) ); - $this->_model = new \Magento\App\Resource\Config( + $this->_model = new \Magento\Framework\App\Resource\Config( $this->_readerMock, $this->_scopeMock, $this->_cacheMock, @@ -106,7 +107,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ public function testExceptionConstructor() { - new \Magento\App\Resource\Config( + new \Magento\Framework\App\Resource\Config( $this->_readerMock, $this->_scopeMock, $this->_cacheMock, @@ -125,7 +126,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase array('resourceName' => 'mainResourceName', 'connectionName' => 'anotherConnection'), array( 'resourceName' => 'brokenResourceName', - 'connectionName' => \Magento\App\Resource\Config::DEFAULT_SETUP_CONNECTION + 'connectionName' => \Magento\Framework\App\Resource\Config::DEFAULT_SETUP_CONNECTION ), array('resourceName' => 'extendedResourceName', 'connectionName' => 'default'), array('resourceName' => 'validResource', 'connectionName' => 'validConnectionName') diff --git a/dev/tests/unit/testsuite/Magento/App/ResourceTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ResourceTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/ResourceTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ResourceTest.php index 58d303beeb95f559604b9889374066f4263f022d..fb846711d935db3e3eb10b6c976fbb31609eea90 100644 --- a/dev/tests/unit/testsuite/Magento/App/ResourceTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ResourceTest.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ResourceTest extends \PHPUnit_Framework_TestCase { @@ -47,21 +47,22 @@ class ResourceTest extends \PHPUnit_Framework_TestCase protected $_connection; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resorce; - const RESOURCE_NAME = \Magento\App\Resource::DEFAULT_READ_RESOURCE; + const RESOURCE_NAME = \Magento\Framework\App\Resource::DEFAULT_READ_RESOURCE; const CONNECTION_NAME = 'Connection Name'; public function setUp() { - $this->_cache = $this->getMockBuilder('Magento\App\CacheInterface')->disableOriginalConstructor()->setMethods( - [] - )->getMock(); + $this->_cache = $this->getMockBuilder('Magento\Framework\App\CacheInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); $this->_connectionFactory = $this->getMockBuilder( - 'Magento\App\Resource\ConnectionFactory' + 'Magento\Framework\App\Resource\ConnectionFactory' )->disableOriginalConstructor()->setMethods(['create'])->getMock(); $this->_connection = $this->getMockBuilder( 'Magento\DB\Adapter\AdapterInterface' @@ -69,11 +70,11 @@ class ResourceTest extends \PHPUnit_Framework_TestCase [] )->getMock(); $this->_config = $this->getMockBuilder( - 'Magento\App\Resource\ConfigInterface' + 'Magento\Framework\App\Resource\ConfigInterface' )->disableOriginalConstructor()->setMethods(['getConnectionName'])->getMock(); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_resorce = $objectManager->getObject( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', [ 'cache' => $this->_cache, 'resourceConfig' => $this->_config, @@ -192,9 +193,9 @@ class ResourceTest extends \PHPUnit_Framework_TestCase private function setConnection() { $connectionSetter = \Closure::bind( - function (\Magento\App\Resource $resource, $connection, $connectionName) { + function (\Magento\Framework\App\Resource $resource, $connection, $connectionName) { $resource->_connections[$connectionName] = $connection; - }, null, 'Magento\App\Resource' + }, null, 'Magento\Framework\App\Resource' ); $connectionSetter($this->_resorce, $this->_connection, self::CONNECTION_NAME); diff --git a/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Response/Http/FileFactoryTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Response/Http/FileFactoryTest.php index 8b2d61eb250a2d0e3c1bd7a0d23f1376b4b3c9d4..1d64fb51043403332bbc7dba03ff1d9d66d79687 100644 --- a/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Response/Http/FileFactoryTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Response\Http; +namespace Magento\Framework\App\Response\Http; class FileFactoryTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Response\Http\FileFactory + * @var \Magento\Framework\App\Response\Http\FileFactory */ protected $_model; @@ -48,7 +48,7 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_fileSystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', @@ -75,7 +75,7 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase $this->returnValue(0) ); $this->_responseMock = $this->getMock( - 'Magento\App\Response\Http', + 'Magento\Framework\App\Response\Http', array('setHeader', 'sendHeaders'), array(), '', @@ -88,7 +88,10 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_responseMock) ); - $this->_model = new \Magento\App\Response\Http\FileFactory($this->_responseMock, $this->_fileSystemMock); + $this->_model = new \Magento\Framework\App\Response\Http\FileFactory( + $this->_responseMock, + $this->_fileSystemMock + ); } /** diff --git a/dev/tests/unit/testsuite/Magento/App/Response/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Response/HttpTest.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/App/Response/HttpTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Response/HttpTest.php index 4dcf6a2be937e15982bb107be55a9198c119d48b..dfa2efc55b01dfee0a9c58ac1e2fff8ebe45c2fa 100644 --- a/dev/tests/unit/testsuite/Magento/App/Response/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Response/HttpTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Response; +namespace Magento\Framework\App\Response; class HttpTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Response\Http + * @var \Magento\Framework\App\Response\Http */ protected $_model; @@ -36,14 +36,14 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected $_cookieMock; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_context; protected function setUp() { $this->_cookieMock = $this->getMock('Magento\Stdlib\Cookie', array(), array(), '', false); - $this->_context = new \Magento\App\Http\Context(); + $this->_context = new \Magento\Framework\App\Http\Context(); $this->_model = new Http($this->_cookieMock, $this->_context); $this->_model->headersSentThrowsException = false; $this->_model->setHeader('name', 'value'); diff --git a/dev/tests/unit/testsuite/Magento/App/ResponseFactoryTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ResponseFactoryTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/ResponseFactoryTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ResponseFactoryTest.php index 9df56af05a7f918187c0bd08260df3be4022771c..b8d38c9584b6953a9d5d6a57095a802c1cccb041 100644 --- a/dev/tests/unit/testsuite/Magento/App/ResponseFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ResponseFactoryTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ResponseFactoryTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\ResponseFactory + * @var \Magento\Framework\App\ResponseFactory */ protected $_model; @@ -36,26 +36,26 @@ class ResponseFactoryTest extends \PHPUnit_Framework_TestCase protected $_objectManagerMock; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_expectedObject; protected function setUp() { $this->_objectManagerMock = $this->getMock('Magento\ObjectManager'); - $this->_model = new \Magento\App\ResponseFactory($this->_objectManagerMock); + $this->_model = new \Magento\Framework\App\ResponseFactory($this->_objectManagerMock); } public function testCreate() { - $this->_expectedObject = $this->getMockBuilder('\Magento\App\ResponseInterface')->getMock(); + $this->_expectedObject = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface')->getMock(); $arguments = array(array('property' => 'value')); $this->_objectManagerMock->expects( $this->once() )->method( 'create' )->with( - 'Magento\App\ResponseInterface', + 'Magento\Framework\App\ResponseInterface', $arguments )->will( $this->returnValue($this->_expectedObject) diff --git a/dev/tests/unit/testsuite/Magento/App/Route/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/ConverterTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/App/Route/Config/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/ConverterTest.php index abd5094bc48b9baa63c78a55e4ca572c56c6585d..31f431f604ea3ed2b3071b2a5b35659528be40ae 100644 --- a/dev/tests/unit/testsuite/Magento/App/Route/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/ConverterTest.php @@ -21,18 +21,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route\Config; +namespace Magento\Framework\App\Route\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Route\Config\Converter + * @var \Magento\Framework\App\Route\Config\Converter */ protected $_model; protected function setUp() { - $this->_model = new \Magento\App\Route\Config\Converter(); + $this->_model = new \Magento\Framework\App\Route\Config\Converter(); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/App/Route/Config/SchemaLocatorTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/SchemaLocatorTest.php similarity index 87% rename from dev/tests/unit/testsuite/Magento/App/Route/Config/SchemaLocatorTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/SchemaLocatorTest.php index 8fe0af7719e5f033e6e67de0cc1b9ddc12f7ed56..3a161b595726a7216aad7a9ad1a0bb90012f500b 100644 --- a/dev/tests/unit/testsuite/Magento/App/Route/Config/SchemaLocatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/SchemaLocatorTest.php @@ -21,18 +21,18 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route\Config; +namespace Magento\Framework\App\Route\Config; class SchemaLocatorTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Route\Config\SchemaLocator + * @var \Magento\Framework\App\Route\Config\SchemaLocator */ protected $_config; protected function setUp() { - $this->_config = new \Magento\App\Route\Config\SchemaLocator(); + $this->_config = new \Magento\Framework\App\Route\Config\SchemaLocator(); } public function testGetSchema() diff --git a/dev/tests/unit/testsuite/Magento/App/Route/Config/_files/routes.php b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/_files/routes.php similarity index 100% rename from dev/tests/unit/testsuite/Magento/App/Route/Config/_files/routes.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/_files/routes.php diff --git a/dev/tests/unit/testsuite/Magento/App/Route/Config/_files/routes.xml b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/_files/routes.xml similarity index 98% rename from dev/tests/unit/testsuite/Magento/App/Route/Config/_files/routes.xml rename to dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/_files/routes.xml index cd2f780782ff436eef54069dcf6866d97c7317f4..471c1de450b2152edec9e61cd2a3828b7e38f24d 100644 --- a/dev/tests/unit/testsuite/Magento/App/Route/Config/_files/routes.xml +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Route/Config/_files/routes.xml @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/App/etc/routes.xsd"> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/Framework/App/etc/routes.xsd"> <router id="backend"> <route id="adminhtml" frontName="admin"> <module name="Magento_ModuleD" /> diff --git a/dev/tests/unit/testsuite/Magento/App/Route/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Route/ConfigTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/App/Route/ConfigTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Route/ConfigTest.php index 3496fd63359701c772dcd9d45ab775d583607656..7c3b934943a0afc1d606902d0a55aa1fff6987b6 100644 --- a/dev/tests/unit/testsuite/Magento/App/Route/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Route/ConfigTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route; +namespace Magento\Framework\App\Route; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Route\Config + * @var \Magento\Framework\App\Route\Config */ protected $_config; @@ -52,10 +52,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_readerMock = $this->getMock('Magento\App\Route\Config\Reader', array(), array(), '', false); + $this->_readerMock = $this->getMock('Magento\Framework\App\Route\Config\Reader', array(), array(), '', false); $this->_cacheMock = $this->getMock('Magento\Config\CacheInterface'); $this->_configScopeMock = $this->getMock('\Magento\Config\ScopeInterface'); - $this->_areaList = $this->getMock('\Magento\App\AreaList', array(), array(), '', false); + $this->_areaList = $this->getMock('\Magento\Framework\App\AreaList', array(), array(), '', false); $this->_configScopeMock->expects( $this->any() )->method( @@ -63,7 +63,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue('areaCode') ); - $this->_config = new \Magento\App\Route\Config( + $this->_config = new \Magento\Framework\App\Route\Config( $this->_readerMock, $this->_cacheMock, $this->_configScopeMock, diff --git a/dev/tests/unit/testsuite/Magento/App/Router/DefaultRouterTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Router/DefaultRouterTest.php similarity index 70% rename from dev/tests/unit/testsuite/Magento/App/Router/DefaultRouterTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/Router/DefaultRouterTest.php index a8d8f69c887deebe842dc9f36c9ee43ac4b68a06..b0c02c2ebc82b917e5e1ca44924b1e4732f96b3e 100644 --- a/dev/tests/unit/testsuite/Magento/App/Router/DefaultRouterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Router/DefaultRouterTest.php @@ -23,37 +23,39 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Router; +namespace Magento\Framework\App\Router; class DefaultRouterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Router\DefaultRouter + * @var \Magento\Framework\App\Router\DefaultRouter */ protected $_model; public function testMatch() { - $request = $this->getMock('Magento\App\RequestInterface', [], [], '', false); + $request = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $actionFactory = $this->getMock('Magento\App\ActionFactory', [], [], '', false); + $actionFactory = $this->getMock('Magento\Framework\App\ActionFactory', [], [], '', false); $actionFactory->expects($this->once())->method('createController')->with( - 'Magento\App\Action\Forward', + 'Magento\Framework\App\Action\Forward', array('request' => $request) )->will( - $this->returnValue($this->getMockForAbstractClass('Magento\App\Action\AbstractAction', [], '', false)) + $this->returnValue( + $this->getMockForAbstractClass('Magento\Framework\App\Action\AbstractAction', [], '', false) + ) ); $noRouteHandler = $this->getMock('Magento\Core\App\Router\NoRouteHandler', [], [], '', false); $noRouteHandler->expects($this->any())->method('process')->will($this->returnValue(true)); - $noRouteHandlerList = $this->getMock('Magento\App\Router\NoRouteHandlerList', [], [], '', false); + $noRouteHandlerList = $this->getMock('Magento\Framework\App\Router\NoRouteHandlerList', [], [], '', false); $noRouteHandlerList->expects($this->any())->method('getHandlers')->will($this->returnValue([$noRouteHandler])); $this->_model = $helper->getObject( - 'Magento\App\Router\DefaultRouter', + 'Magento\Framework\App\Router\DefaultRouter', array( 'actionFactory' => $actionFactory, 'noRouteHandlerList' => $noRouteHandlerList ) ); - $this->assertInstanceOf('Magento\App\Action\AbstractAction', $this->_model->match($request)); + $this->assertInstanceOf('Magento\Framework\App\Action\AbstractAction', $this->_model->match($request)); } } diff --git a/dev/tests/unit/testsuite/Magento/App/RouterListTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/RouterListTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/RouterListTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/RouterListTest.php index 0906f2c4c8e2d0050cc47538a2864469615f9fd2..480f9ee4e3f3267d676d7cab936fa652ac7b3304 100644 --- a/dev/tests/unit/testsuite/Magento/App/RouterListTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/RouterListTest.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class RouterListTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\RouterList + * @var \Magento\Framework\App\RouterList */ protected $_model; @@ -51,7 +51,7 @@ class RouterListTest extends \PHPUnit_Framework_TestCase ); $this->_objectManagerMock = $this->getMock('Magento\ObjectManager'); - $this->_model = new \Magento\App\RouterList($this->_objectManagerMock, $this->_routerList); + $this->_model = new \Magento\Framework\App\RouterList($this->_objectManagerMock, $this->_routerList); } public function testGetRoutes() diff --git a/dev/tests/unit/testsuite/Magento/App/ScopeResolverPoolTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ScopeResolverPoolTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/App/ScopeResolverPoolTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ScopeResolverPoolTest.php index 388f92c4664a6e877c52f8e1a862abf5fa22be50..4f389d0e640f525c80343f1b1d7f228cc00795a7 100644 --- a/dev/tests/unit/testsuite/Magento/App/ScopeResolverPoolTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ScopeResolverPoolTest.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ScopeResolverPoolTest extends \PHPUnit_Framework_TestCase { @@ -38,8 +38,8 @@ class ScopeResolverPoolTest extends \PHPUnit_Framework_TestCase public function testGet() { - $scope = $this->getMock('\Magento\App\ScopeResolverInterface'); - $scopeResolver = $this->_helper->getObject('Magento\App\ScopeResolverPool', [ + $scope = $this->getMock('\Magento\Framework\App\ScopeResolverInterface'); + $scopeResolver = $this->_helper->getObject('Magento\Framework\App\ScopeResolverPool', [ 'scopeResolvers' => [ 'test' => $scope ] @@ -50,14 +50,14 @@ class ScopeResolverPoolTest extends \PHPUnit_Framework_TestCase /** * @param string $scope * - * @covers \Magento\App\ScopeResolverPool::get() + * @covers \Magento\Framework\App\ScopeResolverPool::get() * @expectedException \InvalidArgumentException * @expectedExceptionMessage Invalid scope type * @dataProvider testGetExceptionDataProvider */ public function testGetException($scope) { - $scopeResolver = $this->_helper->getObject('Magento\App\ScopeResolverPool', [ + $scopeResolver = $this->_helper->getObject('Magento\Framework\App\ScopeResolverPool', [ 'scopeResolvers' => [ 'test' => new \Magento\Object() ] diff --git a/dev/tests/unit/testsuite/Magento/App/StateTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/StateTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/App/StateTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/StateTest.php index 2f9a238b6c7bad32b268dfd924ca77b48ceaa42e..89a2c95839fcc588b17c926793365799be74513e 100644 --- a/dev/tests/unit/testsuite/Magento/App/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/StateTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class StateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_model; @@ -43,7 +43,7 @@ class StateTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_model = new \Magento\App\State($this->_scopeMock, time()); + $this->_model = new \Magento\Framework\App\State($this->_scopeMock, time()); } public function testSetAreaCode() diff --git a/dev/tests/unit/testsuite/Magento/App/ViewTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php similarity index 91% rename from dev/tests/unit/testsuite/Magento/App/ViewTest.php rename to dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php index ed3a480c18a5cd6f6aebb8f7541eb82274530852..d4db19c775949320add1c2d09b625ba389da0990 100644 --- a/dev/tests/unit/testsuite/Magento/App/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/ViewTest.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ViewTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\View + * @var \Magento\Framework\App\View */ protected $_view; @@ -64,7 +64,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_layoutMock = $this->getMock('Magento\View\Layout', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $this->_layoutProcessor = $this->getMock('Magento\View\Layout\ProcessorInterface'); $this->_layoutMock->expects( @@ -74,14 +74,14 @@ class ViewTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_layoutProcessor) ); - $this->_actionFlagMock = $this->getMock('Magento\App\ActionFlag', array(), array(), '', false); + $this->_actionFlagMock = $this->getMock('Magento\Framework\App\ActionFlag', array(), array(), '', false); $this->_eventManagerMock = $this->getMock('Magento\Event\ManagerInterface'); $this->_view = $helper->getObject( - 'Magento\App\View', + 'Magento\Framework\App\View', array( 'layout' => $this->_layoutMock, 'request' => $this->_requestMock, - 'response' => $this->getMock('Magento\App\Response\Http', array(), array(), '', false), + 'response' => $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false), 'configScope' => $this->_configScopeMock, 'eventManager' => $this->_eventManagerMock, 'actionFlag' => $this->_actionFlagMock @@ -221,8 +221,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase { $valueMap = array( - array('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, false), - array('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, false) + array('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, false), + array('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, false) ); $this->_actionFlagMock->expects($this->any())->method('get')->will($this->returnValueMap($valueMap)); @@ -257,8 +257,8 @@ class ViewTest extends \PHPUnit_Framework_TestCase { $valueMap = array( - array('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, true), - array('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, true) + array('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, true), + array('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT, true) ); $this->_actionFlagMock->expects($this->any())->method('get')->will($this->returnValueMap($valueMap)); diff --git a/dev/tests/unit/testsuite/Magento/GiftMessage/Helper/MessageTest.php b/dev/tests/unit/testsuite/Magento/GiftMessage/Helper/MessageTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b418f9ec2d81ed90350bb62472da1e3504e689cc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/GiftMessage/Helper/MessageTest.php @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\GiftMessage\Helper; + +class MessageTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $layoutFactoryMock; + + /** + * @var \Magento\GiftMessage\Helper\Message + */ + protected $helper; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->layoutFactoryMock = $this->getMock('\Magento\View\LayoutFactory', array(), array(), '', false); + + $this->helper = $objectManager->getObject('\Magento\GiftMessage\Helper\Message', array( + 'layoutFactory' => $this->layoutFactoryMock, + 'skipMessageCheck' => array('onepage_checkout'), + )); + } + + /** + * Make sure that isMessagesAvailable is not called + */ + public function testGetInlineForCheckout() + { + $expectedHtml = '<a href="here">here</a>'; + $layoutMock = $this->getMock('\Magento\View\Layout', array(), array(), '', false); + $entityMock = $this->getMock('\Magento\Object', array(), array(), '', false); + $inlineMock = $this->getMock( + 'Magento\GiftMessage\Block\Message\Inline', + array('setId', 'setDontDisplayContainer', 'setEntity', 'setType', 'toHtml'), + array(), + '', + false + ); + + $this->layoutFactoryMock->expects($this->once())->method('create')->will($this->returnValue($layoutMock)); + $layoutMock->expects($this->once())->method('createBlock')->will($this->returnValue($inlineMock)); + + $inlineMock->expects($this->once())->method('setId')->will($this->returnSelf()); + $inlineMock->expects($this->once())->method('setDontDisplayContainer')->will($this->returnSelf()); + $inlineMock->expects($this->once())->method('setEntity')->with($entityMock)->will($this->returnSelf()); + $inlineMock->expects($this->once())->method('setType')->will($this->returnSelf()); + $inlineMock->expects($this->once())->method('toHtml')->will($this->returnValue($expectedHtml)); + + $this->assertEquals($expectedHtml, $this->helper->getInline('onepage_checkout', $entityMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/GoogleAdwords/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/GoogleAdwords/Helper/DataTest.php index 21e1ad634c42f16224f9ea1bb915f02b85174b2f..9ecdda480d185a5d126af19bfa80e5e18697ba39 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleAdwords/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleAdwords/Helper/DataTest.php @@ -52,12 +52,12 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_registryMock = $this->getMock('Magento\Registry', array(), array(), '', false); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $this->_helper = $objectManager->getObject( 'Magento\GoogleAdwords\Helper\Data', array( diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/DataTest.php index 2e4de489ef360128ffd9fb62b319e0e28ad9f9e7..61b32f993dec70dce4acc04f539c534614430f0a 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/DataTest.php @@ -48,7 +48,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_googleAnalyticsHelperMock = $this->getMock( 'Magento\GoogleAnalytics\Helper\Data', array(), @@ -58,7 +58,7 @@ class DataTest extends \PHPUnit_Framework_TestCase ); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $this->_helper = $objectManagerHelper->getObject( 'Magento\GoogleOptimizer\Helper\Data', array( diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php index 3d50e0c21dd3624d7d2dd63387c81df370f5d517..7964be0d3867eac1fb95cf1805d3d1dfe9c461fc 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php @@ -62,7 +62,7 @@ class FormTest extends \PHPUnit_Framework_TestCase '', false ); - $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $data = array('context' => $context); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_helper = $objectManagerHelper->getObject('Magento\GoogleOptimizer\Helper\Form', $data); diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Category/SaveTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Category/SaveTest.php index ebf2b31c58795d3c74462830ccdd2977add626e6..fe69f31143533ce1d45b5d76a29cd0c2aa077df3 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Category/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Category/SaveTest.php @@ -77,7 +77,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase $this->_eventObserverMock = $this->getMock('Magento\Event\Observer', array(), array(), '', false); $this->_eventObserverMock->expects($this->once())->method('getEvent')->will($this->returnValue($event)); $this->_codeMock = $this->getMock('Magento\GoogleOptimizer\Model\Code', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_modelObserver = $objectManagerHelper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/DeleteTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/DeleteTest.php index cf758ed452ab71cd1b86b9fe4112580ea9b23298..a5f281f28bc4287963c6745c2c72c092acc37ebc 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/DeleteTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/DeleteTest.php @@ -43,7 +43,7 @@ class DeleteTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_codeMock = $this->getMock('Magento\GoogleOptimizer\Model\Code', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $page = $this->getMock('Magento\Cms\Model\Page', array(), array(), '', false); $page->expects($this->once())->method('getId')->will($this->returnValue(3)); diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/SaveTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/SaveTest.php index a6700fa18fdf1816cfdc6e9666a90a4674534a07..13c8e0e24cbee352b7ae7c0fa72632d048adee99 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/CmsPage/SaveTest.php @@ -64,7 +64,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase { $this->_helperMock = $this->getMock('Magento\GoogleOptimizer\Helper\Data', array(), array(), '', false); $this->_codeMock = $this->getMock('Magento\GoogleOptimizer\Model\Code', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->_pageMock = $this->getMock('Magento\Cms\Model\Page', array(), array(), '', false); $event = $this->getMock('Magento\Event', array('getObject'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/SaveTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/SaveTest.php index 646696dc22eab830338311c18074435f7040c01a..d5d2f3eedf3fb1e53e16785c3832d299fb434eb2 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/SaveTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/SaveTest.php @@ -77,7 +77,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase $this->_eventObserverMock = $this->getMock('Magento\Event\Observer', array(), array(), '', false); $this->_eventObserverMock->expects($this->once())->method('getEvent')->will($this->returnValue($event)); $this->_codeMock = $this->getMock('Magento\GoogleOptimizer\Model\Code', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_modelObserver = $objectManagerHelper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Block/Cart/Item/Renderer/GroupedTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Block/Cart/Item/Renderer/GroupedTest.php index 8faa6df1aa0b4b200e789605979fdb892cff9344..2bc29c7e58d7d7b7a178eaaf58755173495db18a 100644 --- a/dev/tests/unit/testsuite/Magento/GroupedProduct/Block/Cart/Item/Renderer/GroupedTest.php +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Block/Cart/Item/Renderer/GroupedTest.php @@ -31,7 +31,7 @@ use Magento\Catalog\Model\Config\Source\Product\Thumbnail as ThumbnailSource; class GroupedTest extends \PHPUnit_Framework_TestCase { - /** @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopeConfig; /** @var Renderer */ @@ -41,7 +41,7 @@ class GroupedTest extends \PHPUnit_Framework_TestCase { parent::setUp(); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_renderer = $objectManagerHelper->getObject( 'Magento\GroupedProduct\Block\Cart\Item\Renderer\Grouped', array('scopeConfig' => $this->_scopeConfig) diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/EditTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/EditTest.php index 8893ec398b2016e1f01453d747573fd6e15651ff..4d59c6588fc5e73712485561e1683b9981eb27e2 100644 --- a/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/EditTest.php @@ -57,10 +57,10 @@ class EditTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->request = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->request = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->factory = $this->getMock('Magento\Catalog\Model\ProductFactory', array('create'), array(), '', false); $this->registry = $this->getMock('Magento\Registry', array(), array(), '', false); - $this->view = $this->getMock('Magento\App\ViewInterface', array(), array(), '', false); + $this->view = $this->getMock('Magento\Framework\App\ViewInterface', array(), array(), '', false); $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->controller = $this->objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php index ea1981ccd18b02ede3910915d3f47848c265915f..22cdac721d7786777ee52875e7fe86d26bc88e9d 100644 --- a/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Controller/Adminhtml/Product/Initialization/Helper/ProductLinks/Plugin/GroupedTest.php @@ -48,7 +48,7 @@ class GroupedTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->productMock = $this->getMock( 'Magento\Catalog\Model\Product', array('getGroupedReadonly', 'setGroupedLinkData', '__wakeup'), diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php index 5021af43f4512eb105c2dc1b0a5bfc70fa0521d2..f7127c1d44b8056eacbfd7c184dd89d79c04b2b0 100644 --- a/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php @@ -59,7 +59,7 @@ class GroupedTest extends \PHPUnit_Framework_TestCase $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $coreDataMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $fileStorageDbMock = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $coreRegistry = $this->getMock('Magento\Registry', array(), array(), '', false); $this->product = $this->getMock('Magento\Catalog\Model\Product', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..55ef402c0e0d27e32020d8fa1b13fa2c477dc86f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php @@ -0,0 +1,126 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\GroupedProduct\Pricing\Price; + +/** + * Class FinalPriceTest + */ +class FinalPriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\GroupedProduct\Pricing\Price\FinalPrice + */ + protected $finalPrice; + + /** + * @var \Magento\GroupedProduct\Model\Product\Type\Grouped|\PHPUnit_Framework_MockObject_MockObject + */ + protected $typeInstanceMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $salableItemMock; + + /** + * @var \Magento\Pricing\Adjustment\Calculator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $calculatorMock; + + /** + * @var \Magento\Pricing\PriceInfo\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceInfoMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $productMock; + + /** + * @var \Magento\Pricing\Amount\AmountInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountMock; + + /** + * @var \Magento\Catalog\Pricing\Price\FinalPrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceTypeMock; + + /** + * Setup + */ + public function setUp() + { + $this->salableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->productMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $this->amountMock = $this->getMock('Magento\Pricing\Amount\Base', [], [], '', false); + $this->calculatorMock = $this->getMock('Magento\Pricing\Adjustment\Calculator', [], [], '', false); + $this->priceInfoMock = $this->getMock('Magento\Pricing\PriceInfo\Base', [], [], '', false); + $this->typeInstanceMock = $this->getMock('Magento\GroupedProduct\Model\Product\Type\Grouped', + [], [], '', false); + $this->priceTypeMock = $this->getMock('Magento\Catalog\Pricing\Price\FinalPrice', [], [], '', false); + + $this->finalPrice = new \Magento\GroupedProduct\Pricing\Price\FinalPrice + ( + $this->salableItemMock, + $this->calculatorMock + ); + } + + public function testGetMinProduct() + { + $valueMap = [ + [90], + [70] + ]; + $this->salableItemMock->expects($this->once()) + ->method('getTypeInstance') + ->will($this->returnValue($this->typeInstanceMock)); + + $this->typeInstanceMock->expects($this->once()) + ->method('getAssociatedProducts') + ->with($this->equalTo($this->salableItemMock)) + ->will($this->returnValue([$this->productMock, $this->productMock])); + + $this->productMock->expects($this->exactly(2)) + ->method('setQty') + ->with($this->equalTo(\Magento\Pricing\PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT)); + + $this->productMock->expects($this->exactly(2)) + ->method('getPriceInfo') + ->will($this->returnValue($this->priceInfoMock)); + + $this->priceInfoMock->expects($this->exactly(2)) + ->method('getPrice') + ->with($this->equalTo(\Magento\Catalog\Pricing\Price\FinalPriceInterface::PRICE_TYPE_FINAL)) + ->will($this->returnValue($this->priceTypeMock)); + + $this->priceTypeMock->expects($this->exactly(2)) + ->method('getValue') + ->will($this->returnValueMap($valueMap)); + $this->assertEquals($this->finalPrice->getMinProduct(), $this->productMock); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Http/AuthenticationTest.php b/dev/tests/unit/testsuite/Magento/Http/AuthenticationTest.php index e0c0f399c680b3802a3c6df6097356358061d364..04622022954b134ecf0d247c8232ad23254654b5 100644 --- a/dev/tests/unit/testsuite/Magento/Http/AuthenticationTest.php +++ b/dev/tests/unit/testsuite/Magento/Http/AuthenticationTest.php @@ -36,9 +36,9 @@ class AuthenticationTest extends \PHPUnit_Framework_TestCase */ public function testGetCredentials($server, $expectedLogin, $expectedPass) { - $request = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $request->expects($this->once())->method('getServer')->will($this->returnValue($server)); - $response = $this->getMock('\Magento\App\Response\Http', array(), array(), '', false); + $response = $this->getMock('\Magento\Framework\App\Response\Http', array(), array(), '', false); $authentication = new \Magento\HTTP\Authentication($request, $response); $this->assertSame(array($expectedLogin, $expectedPass), $authentication->getCredentials()); } @@ -89,10 +89,10 @@ class AuthenticationTest extends \PHPUnit_Framework_TestCase public function testSetAuthenticationFailed() { - $request = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $request = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $cookieMock = $this->getMock('Magento\Stdlib\Cookie', array(), array(), '', false); - $contextMock = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); - $response = new \Magento\App\Response\Http($cookieMock, $contextMock); + $contextMock = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); + $response = new \Magento\Framework\App\Response\Http($cookieMock, $contextMock); $authentication = new \Magento\HTTP\Authentication($request, $response); $realm = uniqid(); $response->headersSentThrowsException = false; diff --git a/dev/tests/unit/testsuite/Magento/Http/HeaderTest.php b/dev/tests/unit/testsuite/Magento/Http/HeaderTest.php index d2bf3d512b3e6a21efbabe4117ee52ab55791fdb..7733164aa5ec33681b51039092f65c9bab8e5729 100644 --- a/dev/tests/unit/testsuite/Magento/Http/HeaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Http/HeaderTest.php @@ -34,7 +34,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $_request; @@ -48,7 +48,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_request = $this->getMock( - 'Magento\App\Request\Http', + 'Magento\Framework\App\Request\Http', array('getServer', 'getRequestUri'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/RemoteAddressTest.php b/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/RemoteAddressTest.php index 93be70075c6cc7ea17b312514a07f13e61c162cc..aa6857c8e5a4224ac96004d657e4362cf13d3343 100644 --- a/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/RemoteAddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/RemoteAddressTest.php @@ -29,7 +29,7 @@ namespace Magento\Http\PhpEnvironment; class RemoteAddressTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Request\Http + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Request\Http */ protected $_request; @@ -41,7 +41,7 @@ class RemoteAddressTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_request = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->setMethods( array('getServer') )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/ServerAddressTest.php b/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/ServerAddressTest.php index 9dc42646bcade6aaf4703d8b0d29957e05363a4d..91eb51427b8cb5ead862c8e33b028e2394bb86ef 100644 --- a/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/ServerAddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Http/PhpEnvironment/ServerAddressTest.php @@ -34,14 +34,14 @@ class ServerAddressTest extends \PHPUnit_Framework_TestCase protected $_serverAddress; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Request\Http + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Request\Http */ protected $_request; protected function setUp() { $this->_request = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->setMethods( array('getServer') )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Image/Adapter/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Image/Adapter/AbstractTest.php index 0fb022c30d1fa4ef73cde295459baf802984e846..0601b2bef51bf4bec947987480f7d1e1efe3a59f 100644 --- a/dev/tests/unit/testsuite/Magento/Image/Adapter/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Image/Adapter/AbstractTest.php @@ -51,7 +51,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase { $this->directoryWriteMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->filesystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', 'createDirectory'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Image/Adapter/Gd2Test.php b/dev/tests/unit/testsuite/Magento/Image/Adapter/Gd2Test.php index e1cab85d93280e595ab5ff11bf8811832fb90351..5754c4ec79c561c398ece2ebc405f245b94a0177 100644 --- a/dev/tests/unit/testsuite/Magento/Image/Adapter/Gd2Test.php +++ b/dev/tests/unit/testsuite/Magento/Image/Adapter/Gd2Test.php @@ -26,7 +26,7 @@ namespace Magento\Image\Adapter; use Magento\TestFramework\Helper\ObjectManager; /** - * Mocking crucial for this adapter global functions + * Mocking global functions crucial for this adapter */ /** @@ -89,7 +89,7 @@ class Gd2Test extends \PHPUnit_Framework_TestCase /** * @var array simulation of getimagesize() */ - public static $imageData = array(); + public static $imageData = []; /** * Adapter for testing @@ -122,9 +122,9 @@ class Gd2Test extends \PHPUnit_Framework_TestCase /** * Test open() method * - * @param $fileData array - * @param $exception string|bool|null - * @param $limit string + * @param array $fileData + * @param string|bool|null $exception + * @param string $limit * @dataProvider filesProvider */ public function testOpen($fileData, $exception, $limit) @@ -141,7 +141,7 @@ class Gd2Test extends \PHPUnit_Framework_TestCase public function filesProvider() { - $smallFile = array( + $smallFile = [ 0 => 480, 1 => 320, 2 => 2, @@ -149,9 +149,9 @@ class Gd2Test extends \PHPUnit_Framework_TestCase 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg' - ); + ]; - $bigFile = array( + $bigFile = [ 0 => 3579, 1 => 2398, 2 => 2, @@ -159,14 +159,14 @@ class Gd2Test extends \PHPUnit_Framework_TestCase 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg' - ); - - return array( - 'positive_M' => array($smallFile, false, '2M'), - 'positive_KB' => array($smallFile, false, '2048K'), - 'negative_KB' => array($bigFile, 'OverflowException', '2048K'), - 'negative_bytes' => array($bigFile, 'OverflowException', '2048000'), - 'positive_no_limit' => array($smallFile, false, -1), - ); + ]; + + return [ + 'positive_M' => [$smallFile, false, '2M'], + 'positive_KB' => [$smallFile, false, '2048K'], + 'negative_KB' => [$bigFile, 'OverflowException', '2048K'], + 'negative_bytes' => [$bigFile, 'OverflowException', '2048000'], + 'no_limit' => [$bigFile, false, '-1'], + ]; } } diff --git a/dev/tests/unit/testsuite/Magento/Image/Adapter/ImageMagickTest.php b/dev/tests/unit/testsuite/Magento/Image/Adapter/ImageMagickTest.php index 4788a8fcd9ee1a37a1be1106b6befb80c75883a0..daca67874f241fc89e492a21541345aa262ad832 100644 --- a/dev/tests/unit/testsuite/Magento/Image/Adapter/ImageMagickTest.php +++ b/dev/tests/unit/testsuite/Magento/Image/Adapter/ImageMagickTest.php @@ -33,7 +33,8 @@ class ImageMagickTest extends \PHPUnit_Framework_TestCase */ public function testWatermark($imagePath, $expectedMessage) { - $filesystem = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystem = + $this->getMockBuilder('Magento\Framework\App\Filesystem')->disableOriginalConstructor()->getMock(); $this->setExpectedException('LogicException', $expectedMessage); $object = new \Magento\Image\Adapter\ImageMagick($filesystem); $object->watermark($imagePath); diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/Customer/AddressTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/Customer/AddressTest.php index e471a9621fa92220ba40ed6ce73047071cd57d40..3040d0e6c40473f6699d58d1e819b99a24adaaf8 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/Customer/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/Customer/AddressTest.php @@ -97,7 +97,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_model = new \Magento\ImportExport\Model\Export\Entity\Eav\Customer\Address( - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $storeManager, $this->getMock('Magento\ImportExport\Model\Export\Factory', array(), array(), '', false), $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/CustomerTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/CustomerTest.php index dff8d86167c7b0f5cd1069a3e2e8b0efd1ee9ba6..01bd833dfa3c51e38fd6729a3492d98459b58ff1 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/Eav/CustomerTest.php @@ -91,7 +91,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase ); $this->_model = new \Magento\ImportExport\Model\Export\Entity\Eav\Customer( - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $storeManager, $this->getMock('Magento\ImportExport\Model\Export\Factory', array(), array(), '', false), $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php index 5b57e146ef37e038118c7fbe9ff749cbea105a6c..ec7302dcd6a4cb4d5d4ad26b8b088be674512fff 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php @@ -80,7 +80,7 @@ class ExportTest extends \PHPUnit_Framework_TestCase ); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $adapterFactory = $this->getMock('Magento\Logger\AdapterFactory', array(), array(), '', false); $entityFactory = $this->getMock( 'Magento\ImportExport\Model\Export\Entity\Factory', diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php index 418174f7e5a00ecedcb3e9acfc8e4bbf44f39e87..9c1e948a3b95ec5302c64889940d29bf94db3d3d 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/CustomerCompositeTest.php @@ -64,7 +64,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase protected $_importFactory; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -112,7 +112,8 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $translateInline = $this->getMock('\Magento\Translate\InlineInterface', array(), array(), '', false); $translateInline->expects($this->any())->method('isAllowed')->will($this->returnValue(false)); - $context = $this->getMock('Magento\App\Helper\Context', array('getTranslateInline'), array(), '', false); + $context = + $this->getMock('Magento\Framework\App\Helper\Context', array('getTranslateInline'), array(), '', false); $context->expects($this->any())->method('getTranslateInline')->will($this->returnValue($translateInline)); $data = array( @@ -130,7 +131,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->_resourceHelper = $this->getMock( 'Magento\ImportExport\Model\Resource\Helper', array(), @@ -170,7 +171,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $this->_getCustomerEntityMock(); $data['address_entity'] = $this->_getAddressEntityMock(); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -225,7 +226,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['address_entity'] = $addressEntity; $data['data_source_model'] = $dataSourceMock; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -280,7 +281,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -469,7 +470,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -526,7 +527,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -687,7 +688,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -729,7 +730,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -774,7 +775,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, @@ -974,7 +975,7 @@ class CustomerCompositeTest extends \PHPUnit_Framework_TestCase $data = $this->_getModelDependencies(); $data['customer_entity'] = $customerEntity; $data['address_entity'] = $addressEntity; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\CustomerComposite( $this->_coreHelper, $this->_string, diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php index 8877190b89edf914b12b1b1f9847a9430af95fcc..76db40939878452eb6025855a0c4d0ce7b2607c5 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/Customer/AddressTest.php @@ -456,7 +456,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase */ protected function _getModelMock() { - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $storeManager = $this->getMock('\Magento\Store\Model\StoreManager', array('getWebsites'), array(), '', false); $storeManager->expects( $this->once() @@ -472,7 +472,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase $scopeConfig, $this->getMock('Magento\ImportExport\Model\ImportFactory', array(), array(), '', false), $this->getMock('Magento\ImportExport\Model\Resource\Helper', array(), array(), '', false), - $this->getMock('Magento\App\Resource', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false), $storeManager, $this->getMock('Magento\ImportExport\Model\Export\Factory', array(), array(), '', false), $this->getMock('Magento\Eav\Model\Config', array(), array(), '', false), diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/EavAbstractTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/EavAbstractTest.php index 46185c25d8fd44c25b4670d54090da785fef7032..b74e69b3d30d75c095bb534d1149ccf6474a7436 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/EavAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/EavAbstractTest.php @@ -60,7 +60,7 @@ class EavAbstractTest extends \PHPUnit_Framework_TestCase protected $_importFactory; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; @@ -88,7 +88,7 @@ class EavAbstractTest extends \PHPUnit_Framework_TestCase { $this->_coreDataMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_string = new \Magento\Stdlib\String(); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_importFactory = $this->getMock( 'Magento\ImportExport\Model\ImportFactory', @@ -97,7 +97,7 @@ class EavAbstractTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $this->_resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $this->_resourceHelper = $this->getMock( 'Magento\ImportExport\Model\Resource\Helper', array(), diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php index 1dca5e4a20204f3eeaa339eb4953464da42e3f29..81eac2ae1ef3d3260e1574fb833c2766143d029c 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php @@ -240,11 +240,11 @@ class OptionTest extends \PHPUnit_Framework_TestCase $catalogDataMock = $this->getMock('Magento\Catalog\Helper\Data', array('__construct'), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\ImportExport\Model\Import\Entity\Product\Option( $this->getMock('Magento\ImportExport\Model\Resource\Import\Data', array(), array(), '', false), - $this->getMock('Magento\App\Resource', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false), $this->getMock('Magento\ImportExport\Model\Resource\Helper', array(), array(), '', false), $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false), $this->getMock('Magento\Catalog\Model\ProductFactory', array(), array(), '', false), diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php index 9113535726487e63049769204211b2aca2ccddc4..3553a391a8a0fc8bbbbec47d0fe9a89dafee3c06 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/EntityAbstractTest.php @@ -31,7 +31,8 @@ * @todo Fix tests in the scope of https://wiki.magento.com/display/MAGE2/Technical+Debt+%28Team-Donetsk-B%29 */ namespace Magento\ImportExport\Model\Import; -use \Magento\ImportExport\Model\Import\AbstractEntity; + +use Magento\ImportExport\Model\Import\AbstractEntity; class EntityAbstractTest extends \PHPUnit_Framework_TestCase { @@ -75,10 +76,10 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase { $coreHelper = $this->getMock('Magento\Core\Helper\Data', array('__construct'), array(), '', false); $string = new \Magento\Stdlib\String(); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $importFactory = $this->getMock('Magento\ImportExport\Model\ImportFactory', array(), array(), '', false); $resourceHelper = $this->getMock('Magento\ImportExport\Model\Resource\Helper', array(), array(), '', false); - $resource = $this->getMock('Magento\App\Resource', array(), array(), '', false); + $resource = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false); $data = array( 'coreData' => $coreHelper, @@ -104,7 +105,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method _prepareRowForDb() * - * @covers AbstractEntity::_prepareRowForDb + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::_prepareRowForDb */ public function testPrepareRowForDb() { @@ -233,7 +234,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method getBehavior() with $rowData argument = null * - * @covers AbstractEntity::getBehavior + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::getBehavior */ public function testGetBehaviorWithoutRowData() { @@ -397,7 +398,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method getBehavior() with $rowData argument = null * - * @covers AbstractEntity::getBehavior + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::getBehavior * * @dataProvider dataProviderForTestGetBehaviorWithRowData * @param $inputBehavior @@ -546,7 +547,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method validateData() * - * @covers AbstractEntity::validateData + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::validateData * @expectedException \Magento\Model\Exception */ public function testValidateDataPermanentAttributes() @@ -565,7 +566,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method validateData() * - * @covers AbstractEntity::validateData + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::validateData * @expectedException \Magento\Model\Exception */ public function testValidateDataEmptyColumnName() @@ -577,7 +578,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method validateData() * - * @covers AbstractEntity::validateData + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::validateData * @expectedException \Magento\Model\Exception */ public function testValidateDataColumnNameWithWhitespaces() @@ -589,7 +590,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase /** * Test for method validateData() * - * @covers AbstractEntity::validateData + * @covers \Magento\ImportExport\Model\Import\AbstractEntity::validateData * @expectedException \Magento\Model\Exception */ public function testValidateDataAttributeNames() diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Source/CsvTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Source/CsvTest.php index 505048d004bc25ca79e6a61aef81b7f804745647..8b67c91cc3a981121b247fe381f6e09062e69aa7 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Source/CsvTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Source/CsvTest.php @@ -26,7 +26,7 @@ namespace Magento\ImportExport\Model\Import\Source; class CsvTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystem; @@ -40,7 +40,7 @@ class CsvTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); } diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/Import/CustomerComposite/DataTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/Import/CustomerComposite/DataTest.php index 17e966187f8183a088e064f69a24e4458b113622..6ae34bab52571b9816c94a35944cd84db622a776 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/Import/CustomerComposite/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/Import/CustomerComposite/DataTest.php @@ -80,9 +80,9 @@ class DataTest extends \PHPUnit_Framework_TestCase $adapterMock->expects($this->any())->method('select')->will($this->returnValue($selectMock)); $adapterMock->expects($this->any())->method('query')->will($this->returnValue($statementMock)); - /** @var $resourceModelMock \Magento\App\Resource */ + /** @var $resourceModelMock \Magento\Framework\App\Resource */ $resourceModelMock = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getConnection', '_newConnection', 'getTableName'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php b/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php index 39d357e47ea750c15e30e89ae6b8741894598bae..e75675161da0d77385a6894283ef1ad306e4a726 100644 --- a/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php +++ b/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php @@ -50,7 +50,8 @@ class IndexerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $this->_filesystem = + $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', false); $directoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $directoryMock->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); $this->_filesystem->expects( @@ -67,7 +68,7 @@ class IndexerTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); $this->_entryPoint = new \Magento\Index\App\Indexer( 'reportDir', $this->_filesystem, diff --git a/dev/tests/unit/testsuite/Magento/Index/App/ShellTest.php b/dev/tests/unit/testsuite/Magento/Index/App/ShellTest.php index 66cdf85830c07a6f42beedd92c8ff785b5d26464..242634733dd5009df74be0c96691efe02097553a 100644 --- a/dev/tests/unit/testsuite/Magento/Index/App/ShellTest.php +++ b/dev/tests/unit/testsuite/Magento/Index/App/ShellTest.php @@ -46,7 +46,7 @@ class ShellTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_shellFactory = $this->getMock('Magento\Index\Model\ShellFactory', array('create'), array(), '', false); - $this->_responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); $this->_entryPoint = new \Magento\Index\App\Shell('indexer.php', $this->_shellFactory, $this->_responseMock); } diff --git a/dev/tests/unit/testsuite/Magento/Index/Model/Lock/StorageTest.php b/dev/tests/unit/testsuite/Magento/Index/Model/Lock/StorageTest.php index ffe711e15e1c158eb892e7155ba739be58951ea7..898d35fed3ea682ab0aff36e3a9a570272a381a0 100644 --- a/dev/tests/unit/testsuite/Magento/Index/Model/Lock/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Index/Model/Lock/StorageTest.php @@ -51,13 +51,14 @@ class StorageTest extends \PHPUnit_Framework_TestCase $directoryMock->expects($this->any())->method('openFile')->will($this->returnValue($streamMock)); - $filesystemMock = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystemMock = + $this->getMockBuilder('Magento\Framework\App\Filesystem')->disableOriginalConstructor()->getMock(); $filesystemMock->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR )->will( $this->returnValue($directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Indexer/App/ShellTest.php b/dev/tests/unit/testsuite/Magento/Indexer/App/ShellTest.php index da1e331d1932b1cc6cb9993038d84814a426fd2b..f0fb2505ed590628d108a2a1c527bcaad01befb5 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/App/ShellTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/App/ShellTest.php @@ -49,7 +49,7 @@ class ShellTest extends \PHPUnit_Framework_TestCase '', false ); - $this->responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); $this->entryPoint = new \Magento\Indexer\App\Shell( 'indexer.php', $this->shellFactoryMock, diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Config/ReaderTest.php index b0b0427363b24ccb23469aea65df3eb89d235854..109fdb4cf6fa4451f35116e7a98fe4e4361dfc51 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Config/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Config/ReaderTest.php @@ -36,14 +36,14 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected $_converter; /** - * @var \Magento\App\Config\FileResolver|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\FileResolver|\PHPUnit_Framework_MockObject_MockObject */ protected $_fileResolverMock; protected function setUp() { $this->_fileResolverMock = $this->getMock( - 'Magento\App\Config\FileResolver', + 'Magento\Framework\App\Config\FileResolver', array('get'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/DirTest.php b/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/DirTest.php index a97636cb143eef90bf3e6f3206515e3ebd89d6e1..efe05111a9775cad101c10215b86a9a45690ed49 100644 --- a/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/DirTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/DirTest.php @@ -35,7 +35,7 @@ class DirTest extends \PHPUnit_Framework_TestCase /** * App state mock * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\State + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\State */ protected $appStateMock; @@ -58,8 +58,9 @@ class DirTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $this->appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $filesystem = + $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', false); $this->varDirectory = $this->getMock( 'Magento\Filesystem\Directory\Write', array('read', 'isDirectory', 'delete'), @@ -72,13 +73,13 @@ class DirTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR )->will( $this->returnValue($this->varDirectory) ); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $this->subjectMock = $this->getMock('Magento\Install\Controller\Index', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->plugin = new \Magento\Install\App\Action\Plugin\Dir($this->appStateMock, $filesystem, $logger); } diff --git a/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/InstallTest.php b/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/InstallTest.php index 715444df815f7bf55d1952c750f90ad54ac71b43..9fd92977e60c58d895eea56af24820486d983049 100644 --- a/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/InstallTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/App/Action/Plugin/InstallTest.php @@ -62,19 +62,20 @@ class InstallTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->_response = $this->getMock('Magento\App\ResponseInterface', array('setRedirect', 'sendResponse')); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $this->_response = + $this->getMock('Magento\Framework\App\ResponseInterface', array('setRedirect', 'sendResponse')); $this->_urlMock = $this->getMock('Magento\Url', array(), array(), '', false); $this->closureMock = function () { return 'ExpectedValue'; }; - $this->subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->_plugin = new \Magento\Install\App\Action\Plugin\Install( $this->_appStateMock, $this->_response, $this->_urlMock, - $this->getMock('Magento\App\ActionFlag', array(), array(), '', false) + $this->getMock('Magento\Framework\App\ActionFlag', array(), array(), '', false) ); } diff --git a/dev/tests/unit/testsuite/Magento/Install/App/ConsoleTest.php b/dev/tests/unit/testsuite/Magento/Install/App/ConsoleTest.php index 0acb02f63fc362176593b159dff9e31edab77e62..79c6924b53d0675d6152827b69a9c7f618e27b66 100644 --- a/dev/tests/unit/testsuite/Magento/Install/App/ConsoleTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/App/ConsoleTest.php @@ -36,7 +36,7 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase protected $_installerMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Filesystem\DirectoryList\Verification + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Filesystem\DirectoryList\Verification */ protected $_dirVerifierMock; @@ -79,16 +79,16 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase ); $this->_installerMock = $this->getMock('Magento\Install\Model\Installer\Console', array(), array(), '', false); $this->_dirVerifierMock = $this->getMock( - 'Magento\App\Filesystem\DirectoryList\Verification', + 'Magento\Framework\App\Filesystem\DirectoryList\Verification', array(), array(), '', false ); $this->_outputMock = $this->getMock('Magento\Install\App\Output', array(), array(), '', false); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_configLoaderMock = $this->getMockBuilder( - 'Magento\App\ObjectManager\ConfigLoader' + 'Magento\Framework\App\ObjectManager\ConfigLoader' )->disableOriginalConstructor()->getMock(); $this->_instFactoryMock->expects( $this->any() @@ -122,7 +122,7 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase false ); $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', @@ -133,7 +133,7 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($directory) ); @@ -157,7 +157,7 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase $this->returnValue(true) ); } - $this->_responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); return new \Magento\Install\App\Console( $this->_instFactoryMock, $this->_outputMock, diff --git a/dev/tests/unit/testsuite/Magento/Install/Block/BeginTest.php b/dev/tests/unit/testsuite/Magento/Install/Block/BeginTest.php index 6bac4f14a631871dbd7c1afe86f6420707be3b13..8c25d4519409c9780a49751a0d53beae6e212b1a 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Block/BeginTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/Block/BeginTest.php @@ -61,7 +61,7 @@ class BeginTest extends \PHPUnit_Framework_TestCase $this->returnValue($expectedTxt) ); - $fileSystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $fileSystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $fileSystem->expects($this->once())->method('getDirectoryRead')->will($this->returnValue($directoryMock)); $block = $this->_objectManager->getObject( @@ -81,7 +81,7 @@ class BeginTest extends \PHPUnit_Framework_TestCase */ public function testGetLicenseHtmlWhenFileIsEmpty($fileName) { - $fileSystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $fileSystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $fileSystem->expects($this->never())->method('read'); $block = $this->_objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Install/Controller/WizardTest.php b/dev/tests/unit/testsuite/Magento/Install/Controller/WizardTest.php index e599cb3efd72a2da58538c0dca2069023ba8cbde..1fd7891023b5594ac53d679060d910f8092e767f 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Controller/WizardTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/Controller/WizardTest.php @@ -54,7 +54,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase protected $_block; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_viewMock; @@ -74,7 +74,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase protected $_controller; /** - * @var \Magento\App\Action\Context + * @var \Magento\Framework\App\Action\Context */ protected $_contextMock; @@ -89,17 +89,17 @@ class WizardTest extends \PHPUnit_Framework_TestCase protected $_sessionMock; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_requestMock; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_responseMock; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlagMock; @@ -157,7 +157,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase $this->_viewMock = $this->getMockForAbstractClass( - '\Magento\App\ViewInterface', + '\Magento\Framework\App\ViewInterface', array(), '', false, @@ -173,12 +173,12 @@ class WizardTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->_layoutMock) ); - $this->_requestMock = $this->_getClearMock('\Magento\App\RequestInterface'); - $this->_responseMock = $this->_getClearMock('\Magento\App\ResponseInterface'); - $this->_actionFlagMock = $this->_getClearMock('\Magento\App\ActionFlag'); + $this->_requestMock = $this->_getClearMock('\Magento\Framework\App\RequestInterface'); + $this->_responseMock = $this->_getClearMock('\Magento\Framework\App\ResponseInterface'); + $this->_actionFlagMock = $this->_getClearMock('\Magento\Framework\App\ActionFlag'); $this->_contextMock = $this->getMock( - '\Magento\App\Action\Context', + '\Magento\Framework\App\Action\Context', array('getView', 'getRequest', 'getResponse', 'getActionFlag'), array(), '', @@ -267,7 +267,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase 'session' => $this->_sessionMock, 'dbUpdater' => $this->_getClearMock('Magento\Module\UpdaterInterface'), 'storeManager' => $this->_getClearMock('Magento\Store\Model\StoreManagerInterface'), - 'appState' => $this->_getClearMock('Magento\App\State') + 'appState' => $this->_getClearMock('Magento\Framework\App\State') ) ); } diff --git a/dev/tests/unit/testsuite/Magento/Install/Model/Installer/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Install/Model/Installer/ConfigTest.php index 77d2a8257a967d8616b4bdbdae16bdd6686e5540..16431bf3024ff80be9018bad667690714e0eb65e 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Model/Installer/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/Model/Installer/ConfigTest.php @@ -39,7 +39,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystemMock; @@ -57,13 +57,13 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { $this->_directoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_filesystemMock->expects( $this->any() )->method( 'getPath' )->with( - \Magento\App\Filesystem::CONFIG_DIR + \Magento\Framework\App\Filesystem::CONFIG_DIR )->will( $this->returnValue(TESTS_TEMP_DIR) ); @@ -78,7 +78,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_messageManager = $this->getMock('\Magento\Message\ManagerInterface', array(), array(), '', false); $this->_model = new \Magento\Install\Model\Installer\Config( $this->getMock('Magento\Install\Model\Installer', array(), array(), '', false), - $this->getMock('Magento\App\RequestInterface', array(), array(), '', false), + $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false), $this->_filesystemMock, $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false), $this->_messageManager diff --git a/dev/tests/unit/testsuite/Magento/Install/Model/Installer/Db/Mysql4Test.php b/dev/tests/unit/testsuite/Magento/Install/Model/Installer/Db/Mysql4Test.php index e6332dab15fc585d73e21335665163661a3a2d7a..9afc08de54db4c6c6d29bed03d00bdc3e77dcd1e 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Model/Installer/Db/Mysql4Test.php +++ b/dev/tests/unit/testsuite/Magento/Install/Model/Installer/Db/Mysql4Test.php @@ -58,7 +58,8 @@ class Mysql4Test extends \PHPUnit_Framework_TestCase $adapterMock->expects($this->once())->method('getConnection')->will($this->returnValue($connectionMock)); $adapterFactory->expects($this->once())->method('create')->will($this->returnValue($adapterMock)); - $localConfig = $this->getMockBuilder('\Magento\App\Arguments')->disableOriginalConstructor()->getMock(); + $localConfig = + $this->getMockBuilder('\Magento\Framework\App\Arguments')->disableOriginalConstructor()->getMock(); $installer = new \Magento\Install\Model\Installer\Db\Mysql4($adapterFactory, $localConfig); $this->assertEquals($expectedResult, $installer->supportEngine()); @@ -93,7 +94,8 @@ class Mysql4Test extends \PHPUnit_Framework_TestCase '', false ); - $localConfig = $this->getMockBuilder('\Magento\App\Arguments')->disableOriginalConstructor()->getMock(); + $localConfig = + $this->getMockBuilder('\Magento\Framework\App\Arguments')->disableOriginalConstructor()->getMock(); $installer = new \Magento\Install\Model\Installer\Db\Mysql4($adapterFactory, $localConfig, $dbExtensions); $installer->setConfig($config); $this->assertEquals($expectedResult, $installer->getRequiredExtensions()); diff --git a/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php b/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php index 51c5b3533b9c5581af56afc7b901e7fb0142a2a9..d198583f8b17660147ae0c96dfeb035901d8144f 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php @@ -38,29 +38,29 @@ class InstallerTest extends \PHPUnit_Framework_TestCase /** * Application chache model * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; /** * Application config model * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\Cache\TypeListInterface + * @var \Magento\Framework\App\Cache\TypeListInterface */ protected $_cacheTypeList; @@ -75,11 +75,13 @@ class InstallerTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_cache = $this->getMock('\Magento\App\CacheInterface', array(), array(), '', false); - $this->_config = $this->getMock('\Magento\App\Config\ReinitableConfigInterface', array(), array(), '', false); - $this->_cacheState = $this->getMock('\Magento\App\Cache\StateInterface', array(), array(), '', false); - $this->_cacheTypeList = $this->getMock('\Magento\App\Cache\TypeListInterface', array(), array(), '', false); - $this->_appState = $this->getMock('\Magento\App\State', array(), array(), '', false); + $this->_cache = $this->getMock('\Magento\Framework\App\CacheInterface', array(), array(), '', false); + $this->_config = + $this->getMock('\Magento\Framework\App\Config\ReinitableConfigInterface', array(), array(), '', false); + $this->_cacheState = $this->getMock('\Magento\Framework\App\Cache\StateInterface', array(), array(), '', false); + $this->_cacheTypeList = + $this->getMock('\Magento\Framework\App\Cache\TypeListInterface', array(), array(), '', false); + $this->_appState = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $this->_installerConfig = $this->getMock( '\Magento\Install\Model\Installer\Config', array(), diff --git a/dev/tests/unit/testsuite/Magento/Install/Model/WizardTest.php b/dev/tests/unit/testsuite/Magento/Install/Model/WizardTest.php index df3a7aa36cbd19d2c0a2109aaae1be24a9c1c93e..70b69ad1f5e26ca6f5f713798494d9aaf28643b9 100644 --- a/dev/tests/unit/testsuite/Magento/Install/Model/WizardTest.php +++ b/dev/tests/unit/testsuite/Magento/Install/Model/WizardTest.php @@ -58,7 +58,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_requestMock; @@ -71,7 +71,7 @@ class WizardTest extends \PHPUnit_Framework_TestCase $this->_configMock = $this->getMock('\Magento\Install\Model\Config', array(), array(), '', false); $this->_configMock->expects($this->any())->method('getWizardSteps')->will($this->returnValue(array())); $this->_urlBuilderMock = $this->getMock('\Magento\UrlInterface', array(), array(), '', false); - $this->_requestMock = $this->getMock('\Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('\Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->_model = $this->_objectManager->getObject( 'Magento\Install\Model\Wizard', array('urlBuilder' => $this->_urlBuilderMock, 'installConfig' => $this->_configMock) diff --git a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index 72e7823ec25933e952799acd617c18510a9ab2cc..abf5f7fc9a2ea3a630ad054f926264d1334cbef6 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -47,7 +47,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Backend\Model\Layout\Filter\Acl|\PHPUnit_Framework_MockObject_MockObject */ protected $_layoutFilterMock; - /** @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_configMock; /** @var \Magento\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -71,10 +71,10 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Registry|\PHPUnit_Framework_MockObject_MockObject */ protected $_registryMock; - /** @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $_requestMock; - /** @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $_responseMock; /** @var \PHPUnit_Framework_MockObject_MockObject */ @@ -86,7 +86,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Integration\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ protected $_integrationHelperMock; - /** @var \Magento\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_viewMock; /** @var \Magento\Core\Model\Layout\Merge|\PHPUnit_Framework_MockObject_MockObject */ @@ -115,7 +115,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase )->disableOriginalConstructor()->getMock(); // Initialize mocks which are used in several test cases $this->_configMock = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->_eventManagerMock = $this->getMockBuilder( 'Magento\Event\ManagerInterface' @@ -136,10 +136,10 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase 'Magento\Integration\Service\OauthV1' )->disableOriginalConstructor()->getMock(); $this->_requestMock = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->getMock(); $this->_responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->getMock(); $this->_registryMock = $this->getMockBuilder('Magento\Registry')->disableOriginalConstructor()->getMock(); $this->_configScopeMock = $this->getMockBuilder( @@ -819,7 +819,7 @@ HANDLE; protected function _createIntegrationController() { // Mock Layout passed into constructor - $this->_viewMock = $this->getMock('Magento\App\ViewInterface'); + $this->_viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); $this->_layoutMock = $this->getMock('Magento\View\LayoutInterface'); $this->_layoutMergeMock = $this->getMockBuilder( 'Magento\Core\Model\Layout\Merge' @@ -883,7 +883,7 @@ HANDLE; protected function _verifyLoadAndRenderLayout() { $map = array( - array('Magento\App\Config\ScopeConfigInterface', $this->_configMock), + array('Magento\Framework\App\Config\ScopeConfigInterface', $this->_configMock), array('Magento\Core\Model\Layout\Filter\Acl', $this->_layoutFilterMock), array('Magento\Backend\Model\Session', $this->_backendSessionMock), array('Magento\TranslateInterface', $this->_translateModelMock), diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php index e56a65279b36b0ee5fce0e35be22dee9cd32aaf9..51062a8fbf2c95b37b04c6ad093107df8c45f5c4 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/DataTest.php @@ -25,7 +25,7 @@ namespace Magento\Integration\Helper\Oauth; class DataTest extends \PHPUnit_Framework_TestCase { - /** @var \Magento\App\Config\ScopeConfigInterface */ + /** @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfigMock; /** @var \Magento\Integration\Helper\Oauth\Data */ @@ -34,7 +34,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_scopeConfigMock = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->getMock(); $this->_dataHelper = new \Magento\Integration\Helper\Oauth\Data($this->_scopeConfigMock); diff --git a/dev/tests/unit/testsuite/Magento/Locale/Hierarchy/Config/FileResolverTest.php b/dev/tests/unit/testsuite/Magento/Locale/Hierarchy/Config/FileResolverTest.php index a277e04fdfb923c6198c1ddbcd6ed2fe1b950962..c2f7e537f52e236550500648cf6e7eacf956a14d 100644 --- a/dev/tests/unit/testsuite/Magento/Locale/Hierarchy/Config/FileResolverTest.php +++ b/dev/tests/unit/testsuite/Magento/Locale/Hierarchy/Config/FileResolverTest.php @@ -42,7 +42,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', false); $this->_directoryMock = $this->getMock( '\Magento\Filesystem\Directory\Read', array('isExist', 'search'), @@ -55,7 +55,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::APP_DIR + \Magento\Framework\App\Filesystem::APP_DIR )->will( $this->returnValue($this->_directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Log/App/ShellTest.php b/dev/tests/unit/testsuite/Magento/Log/App/ShellTest.php index 575331999c36ee986c11025c9d87fe558ae9abd1..da687ffb30d52bf7c451455601feb4e80c20e7a2 100644 --- a/dev/tests/unit/testsuite/Magento/Log/App/ShellTest.php +++ b/dev/tests/unit/testsuite/Magento/Log/App/ShellTest.php @@ -49,7 +49,7 @@ class ShellTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_responseMock = $this->getMock('Magento\App\Console\Response', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Console\Response', array(), array(), '', false); $this->_model = new \Magento\Log\App\Shell('shell.php', $this->_shellFactoryMock, $this->_responseMock); } diff --git a/dev/tests/unit/testsuite/Magento/Log/LoggerTest.php b/dev/tests/unit/testsuite/Magento/Log/LoggerTest.php index 0fe654fee9d900c90e99d0db7132e384777d3859..a99fc800ecc1cc071e2503b2ad2e0f712af56447 100644 --- a/dev/tests/unit/testsuite/Magento/Log/LoggerTest.php +++ b/dev/tests/unit/testsuite/Magento/Log/LoggerTest.php @@ -50,14 +50,14 @@ class LoggerTest extends \PHPUnit_Framework_TestCase protected function setUp() { $logDir = TESTS_TEMP_DIR . '/var/log'; - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directory = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->_filesystemMock->expects( $this->any() )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::LOG_DIR + \Magento\Framework\App\Filesystem::LOG_DIR )->will( $this->returnValue($this->_directory) ); diff --git a/dev/tests/unit/testsuite/Magento/Log/Model/Shell/Command/CleanTest.php b/dev/tests/unit/testsuite/Magento/Log/Model/Shell/Command/CleanTest.php index ac1f6c42a85723af199114a8fc538a4704569301..6016809846c2bd0cc8375c3e5c4a3bf7f7a39f17 100644 --- a/dev/tests/unit/testsuite/Magento/Log/Model/Shell/Command/CleanTest.php +++ b/dev/tests/unit/testsuite/Magento/Log/Model/Shell/Command/CleanTest.php @@ -42,7 +42,7 @@ class CleanTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_mutableConfigMock = $this->getMock('Magento\App\Config\MutableScopeConfigInterface'); + $this->_mutableConfigMock = $this->getMock('Magento\Framework\App\Config\MutableScopeConfigInterface'); $this->_logFactoryMock = $this->getMock('Magento\Log\Model\LogFactory', array('create'), array(), '', false); $this->_logMock = $this->getMock('Magento\Log\Model\Log', array(), array(), '', false); $this->_logFactoryMock->expects($this->once())->method('create')->will($this->returnValue($this->_logMock)); diff --git a/dev/tests/unit/testsuite/Magento/Log/Model/ShellTest.php b/dev/tests/unit/testsuite/Magento/Log/Model/ShellTest.php index b5db2768ac80b3edb2b9ea225611dea3ebbea345..f30086880340e3e84af9ffa23772470e2a42e7d8 100644 --- a/dev/tests/unit/testsuite/Magento/Log/Model/ShellTest.php +++ b/dev/tests/unit/testsuite/Magento/Log/Model/ShellTest.php @@ -43,7 +43,7 @@ class ShellTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_factoryMock = $this->getMock('Magento\Log\Model\Shell\Command\Factory', array(), array(), '', false); - $filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_model = $this->getMock( 'Magento\Log\Model\Shell', array('_applyPhpVariables'), diff --git a/dev/tests/unit/testsuite/Magento/Mail/Template/TransportBuilderTest.php b/dev/tests/unit/testsuite/Magento/Mail/Template/TransportBuilderTest.php index 90188a6168ad207db7bdba680efbac37f3b3cb84..43fbd72c74ad75dd4213d897c531faa4e24c8a88 100644 --- a/dev/tests/unit/testsuite/Magento/Mail/Template/TransportBuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Mail/Template/TransportBuilderTest.php @@ -177,9 +177,13 @@ class TransportBuilderTest extends \PHPUnit_Framework_TestCase public function getTransportDataProvider() { return array( - array(\Magento\App\TemplateTypesInterface::TYPE_TEXT, \Magento\Mail\Message::TYPE_TEXT, 'Plain text'), array( - \Magento\App\TemplateTypesInterface::TYPE_HTML, + \Magento\Framework\App\TemplateTypesInterface::TYPE_TEXT, + \Magento\Mail\Message::TYPE_TEXT, + 'Plain text' + ), + array( + \Magento\Framework\App\TemplateTypesInterface::TYPE_HTML, \Magento\Mail\Message::TYPE_HTML, '<h1>Html message</h1>' ) diff --git a/dev/tests/unit/testsuite/Magento/Model/AbstractModelTest.php b/dev/tests/unit/testsuite/Magento/Model/AbstractModelTest.php index 509508ae03b862a5a58adcc460318df43e85a467..c6d8a527a298fad80b5cb8a0c189447a5ae00722 100644 --- a/dev/tests/unit/testsuite/Magento/Model/AbstractModelTest.php +++ b/dev/tests/unit/testsuite/Magento/Model/AbstractModelTest.php @@ -69,8 +69,8 @@ class AbstractModelTest extends \PHPUnit_Framework_TestCase $this->contextMock = new \Magento\Model\Context( $this->getMock('Magento\Logger', array(), array(), '', false), $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false), - $this->getMock('Magento\App\CacheInterface', array(), array(), '', false), - $this->getMock('Magento\App\State', array(), array(), '', false), + $this->getMock('Magento\Framework\App\CacheInterface', array(), array(), '', false), + $this->getMock('Magento\Framework\App\State', array(), array(), '', false), $this->actionValidatorMock ); $this->registryMock = $this->getMock('Magento\Registry', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Module/Declaration/FileResolverTest.php b/dev/tests/unit/testsuite/Magento/Module/Declaration/FileResolverTest.php index 555c5be63b02e1a62cf00261d193e814dc9b33eb..2e8438041c75f704bcec78338d730f47b6362197 100644 --- a/dev/tests/unit/testsuite/Magento/Module/Declaration/FileResolverTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/Declaration/FileResolverTest.php @@ -77,8 +77,8 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase */ protected function getFileResolver($baseDir) { - $filesystem = new \Magento\App\Filesystem( - new \Magento\App\Filesystem\DirectoryList($baseDir), + $filesystem = new \Magento\Framework\App\Filesystem( + new \Magento\Framework\App\Filesystem\DirectoryList($baseDir), new \Magento\Filesystem\Directory\ReadFactory(), new \Magento\Filesystem\Directory\WriteFactory() ); diff --git a/dev/tests/unit/testsuite/Magento/Module/Declaration/Reader/FilesystemTest.php b/dev/tests/unit/testsuite/Magento/Module/Declaration/Reader/FilesystemTest.php index 48de7938707df9fb908dfbff9326f300c0149d8c..4837c1badb79481ee899f542155b0b86460a88cd 100644 --- a/dev/tests/unit/testsuite/Magento/Module/Declaration/Reader/FilesystemTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/Declaration/Reader/FilesystemTest.php @@ -37,7 +37,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase $schemaLocatorMock = $this->getMock('Magento\Module\Declaration\SchemaLocator', array(), array(), '', false); $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface'); - $appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); $dependencyManager = $this->getMock('Magento\Module\DependencyManagerInterface'); @@ -106,8 +106,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase */ protected function getFileResolver($baseDir) { - $filesystem = new \Magento\App\Filesystem( - new \Magento\App\Filesystem\DirectoryList($baseDir), + $filesystem = new \Magento\Framework\App\Filesystem( + new \Magento\Framework\App\Filesystem\DirectoryList($baseDir), new \Magento\Filesystem\Directory\ReadFactory(), new \Magento\Filesystem\Directory\WriteFactory() ); diff --git a/dev/tests/unit/testsuite/Magento/Module/Dir/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Module/Dir/ReaderTest.php index 707debc7427dba6e4018f21ca4e8c1758e3247cd..81b2352482dab8ea55e16aad6ad5b2a3309ed5a0 100644 --- a/dev/tests/unit/testsuite/Magento/Module/Dir/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/Dir/ReaderTest.php @@ -28,7 +28,7 @@ */ namespace Magento\Module\Dir; -use \Magento\App\Filesystem, +use \Magento\Framework\App\Filesystem, \Magento\Config\FileIteratorFactory; class ReaderTest extends \PHPUnit_Framework_TestCase @@ -71,7 +71,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_protFactoryMock = $this->getMock( - 'Magento\App\Config\BaseFactory', + 'Magento\Framework\App\Config\BaseFactory', array(), array(), '', @@ -79,11 +79,13 @@ class ReaderTest extends \PHPUnit_Framework_TestCase false ); $this->_dirsMock = $this->getMock('Magento\Module\Dir', array(), array(), '', false, false); - $this->_baseConfigMock = $this->getMock('Magento\App\Config\Base', array(), array(), '', false, false); + $this->_baseConfigMock = + $this->getMock('Magento\Framework\App\Config\Base', array(), array(), '', false, false); $this->_moduleListMock = $this->getMock('Magento\Module\ModuleListInterface'); - $this->_filesystemMock = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false, false); - $this->_fileIteratorFactory = $this->getMock('\Magento\Config\FileIteratorFactory', array(), array(), - '', false, false); + $this->_filesystemMock = + $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false, false); + $this->_fileIteratorFactory = + $this->getMock('\Magento\Config\FileIteratorFactory', array(), array(), '', false, false); $this->_model = new \Magento\Module\Dir\Reader( $this->_dirsMock, diff --git a/dev/tests/unit/testsuite/Magento/Module/DirTest.php b/dev/tests/unit/testsuite/Magento/Module/DirTest.php index 53052924fcad765d6981c0fedd081cedac4f82b5..30cfa8ea07aef86f234c116400b5367a60ef91fa 100644 --- a/dev/tests/unit/testsuite/Magento/Module/DirTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/DirTest.php @@ -31,7 +31,7 @@ class DirTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; @@ -47,7 +47,7 @@ class DirTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false, false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false, false); $this->directoryMock = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false, false); $this->_stringMock = $this->getMock('Magento\Stdlib\String', array(), array(), '', false, false); diff --git a/dev/tests/unit/testsuite/Magento/Module/Setup/MigrationTest.php b/dev/tests/unit/testsuite/Magento/Module/Setup/MigrationTest.php index d926677c5f424dc897f2bfd5ee60e2d0e2d5b30c..509b3976ff9c52b38f901db6905287ec39af3a74 100644 --- a/dev/tests/unit/testsuite/Magento/Module/Setup/MigrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/Setup/MigrationTest.php @@ -163,7 +163,7 @@ class MigrationTest extends \PHPUnit_Framework_TestCase $moduleListMock = $this->getMock('Magento\Module\ModuleListInterface'); $moduleListMock->expects($this->once())->method('getModule')->will($this->returnValue(array())); - $filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $modulesDirMock = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $filesystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($modulesDirMock)); @@ -174,7 +174,7 @@ class MigrationTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false))); $contextMock->expects($this->once()) ->method('getResourceModel') - ->will($this->returnValue($this->getMock('Magento\App\Resource', array(), array(), '', false))); + ->will($this->returnValue($this->getMock('Magento\Framework\App\Resource', array(), array(), '', false))); $contextMock->expects($this->once()) ->method('getLogger') ->will($this->returnValue($this->getMock('Magento\Logger', array(), array(), '', false))); @@ -246,12 +246,12 @@ class MigrationTest extends \PHPUnit_Framework_TestCase $tableRowsCount = count($tableData); $setupModel = new \Magento\Module\Setup\Migration( - $this->getMock('Magento\App\Resource', array(), array(), '', false, false), - $this->getMock('Magento\App\Filesystem', array(), array(), '', false), + $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false, false), + $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false), $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), $this->getMock('Magento\Logger', array(), array(), '', false), $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false), - $this->getMock('Magento\App\Config\ScopeConfigInterface'), + $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $this->getMock('Magento\Module\ModuleListInterface'), $this->getMock('Magento\Module\Dir\Reader', array(), array(), '', false, false), $this->getMock('Magento\Install\Model\Resource\Resource', array(), array(), '', false), @@ -300,11 +300,11 @@ class MigrationTest extends \PHPUnit_Framework_TestCase } /** - * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Filesystem + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Filesystem */ protected function _getFilesystemMock() { - $mock = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $mock = $this->getMockBuilder('Magento\Framework\App\Filesystem')->disableOriginalConstructor()->getMock(); return $mock; } } diff --git a/dev/tests/unit/testsuite/Magento/Module/UpdaterTest.php b/dev/tests/unit/testsuite/Magento/Module/UpdaterTest.php index 497fc63e6593d3799f29d7feab15db2d35e9f503..7fd163a4461befc26eff865007729fbf098ce01e 100644 --- a/dev/tests/unit/testsuite/Magento/Module/UpdaterTest.php +++ b/dev/tests/unit/testsuite/Magento/Module/UpdaterTest.php @@ -58,7 +58,7 @@ class UpdaterTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_factoryMock = $this->getMock('Magento\Module\Updater\SetupFactory', array(), array(), '', false); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_moduleListMock = $this->getMock('Magento\Module\ModuleListInterface'); $this->_resourceResolver = $this->getMock('Magento\Module\ResourceResolverInterface'); $this->_resourceSetupMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Helper/DataTest.php index 63f04b4554313d9b749805de8ada5e76c5e0b1a7..9369660645123f37a597bd3685b1db7c787af3bd 100644 --- a/dev/tests/unit/testsuite/Magento/Multishipping/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Helper/DataTest.php @@ -38,14 +38,14 @@ class DataTest extends \PHPUnit_Framework_TestCase /** * Core store config mock * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfigMock; /** * Context mock * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Helper\Context + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Helper\Context */ protected $contextMock; @@ -65,8 +65,8 @@ class DataTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->contextMock = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); - $this->scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->contextMock = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); + $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->checkoutSessionMock = $this->getMock('\Magento\Checkout\Model\Session', array(), array(), '', false); $this->quoteMock = $this->getMock('\Magento\Sales\Model\Quote', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecureTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecureTest.php index 21a7741f3b9251d357d770fc2a6c133184e0d4d8..365b920da78b2ae818f944a160dc5c086c8c54a7 100644 --- a/dev/tests/unit/testsuite/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecureTest.php +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecureTest.php @@ -45,14 +45,14 @@ class Is3DSecureTest extends \PHPUnit_Framework_TestCase /** * Store config mock * - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfigMock; public function setUp() { $this->paymentConfigMock = $this->getMock('\Magento\Payment\Model\Config', array(), array(), '', false); - $this->scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); } diff --git a/dev/tests/unit/testsuite/Magento/Mview/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Mview/Config/ReaderTest.php index 7ec6ec7bb7b5f02c2c9c9abfb96f7e7fabce9d9b..4bca0c294f0545dc621367cbfc0d8e0989d9af9a 100644 --- a/dev/tests/unit/testsuite/Magento/Mview/Config/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Mview/Config/ReaderTest.php @@ -36,14 +36,14 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected $_converter; /** - * @var \Magento\App\Config\FileResolver|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\FileResolver|\PHPUnit_Framework_MockObject_MockObject */ protected $_fileResolverMock; protected function setUp() { $this->_fileResolverMock = $this->getMock( - 'Magento\App\Config\FileResolver', + 'Magento\Framework\App\Config\FileResolver', array('get'), array(), '', @@ -58,7 +58,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase )->method( 'getDir' )->with( - \Magento\App\Filesystem::LIB_DIR + \Magento\Framework\App\Filesystem::LIB_DIR )->will( $this->returnValue('stub') ); diff --git a/dev/tests/unit/testsuite/Magento/Mview/View/ChangelogTest.php b/dev/tests/unit/testsuite/Magento/Mview/View/ChangelogTest.php index 15142e5ffb80f8444b211e4ccc514b2a92faf7c8..023561e07497df353c6510a5a087234a7c34b355 100644 --- a/dev/tests/unit/testsuite/Magento/Mview/View/ChangelogTest.php +++ b/dev/tests/unit/testsuite/Magento/Mview/View/ChangelogTest.php @@ -38,7 +38,7 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase protected $connectionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Resource + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Resource */ protected $resourceMock; @@ -47,7 +47,7 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase $this->connectionMock = $this->getMock('Magento\DB\Adapter\Pdo\Mysql', array(), array(), '', false); $this->resourceMock = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getConnection', 'getTableName'), array(), '', @@ -61,7 +61,8 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase public function testInstanceOf() { - $resourceMock = $this->getMock('Magento\App\Resource', array('getConnection'), array(), '', false, false); + $resourceMock = + $this->getMock('Magento\Framework\App\Resource', array('getConnection'), array(), '', false, false); $resourceMock->expects($this->once())->method('getConnection')->will($this->returnValue(true)); $model = new \Magento\Mview\View\Changelog($resourceMock); $this->assertInstanceOf('\Magento\Mview\View\ChangelogInterface', $model); @@ -73,7 +74,8 @@ class ChangelogTest extends \PHPUnit_Framework_TestCase */ public function testCheckConnectionException() { - $resourceMock = $this->getMock('Magento\App\Resource', array('getConnection'), array(), '', false, false); + $resourceMock = + $this->getMock('Magento\Framework\App\Resource', array('getConnection'), array(), '', false, false); $resourceMock->expects($this->once())->method('getConnection')->will($this->returnValue(null)); $model = new \Magento\Mview\View\Changelog($resourceMock); $model->setViewId('ViewIdTest'); diff --git a/dev/tests/unit/testsuite/Magento/Mview/View/SubscriptionTest.php b/dev/tests/unit/testsuite/Magento/Mview/View/SubscriptionTest.php index 3c394e5c777121790483fc98a2027738cb7ee8d3..23939165ae40a4aaba72dbe95467785ce591d302 100644 --- a/dev/tests/unit/testsuite/Magento/Mview/View/SubscriptionTest.php +++ b/dev/tests/unit/testsuite/Magento/Mview/View/SubscriptionTest.php @@ -38,7 +38,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase protected $connectionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Resource + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Resource */ protected $resourceMock; @@ -62,7 +62,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->connectionMock = $this->getMock('Magento\DB\Adapter\Pdo\Mysql', [], [], '', false); $this->resourceMock = $this->getMock( - 'Magento\App\Resource', array('getConnection', 'getTableName'), [], '', false, false + 'Magento\Framework\App\Resource', array('getConnection', 'getTableName'), [], '', false, false ); $this->mockGetConnection($this->connectionMock); $this->triggerFactoryMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Newsletter/Controller/ManageTest.php b/dev/tests/unit/testsuite/Magento/Newsletter/Controller/ManageTest.php index 217eecc6fd161c8b229895b6eadf5960269a8039..10198f45c6e110498e23acf7867f70a2b7206c62 100644 --- a/dev/tests/unit/testsuite/Magento/Newsletter/Controller/ManageTest.php +++ b/dev/tests/unit/testsuite/Magento/Newsletter/Controller/ManageTest.php @@ -34,12 +34,12 @@ class ManageTest extends \PHPUnit_Framework_TestCase private $controller; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ private $requestMock; /** - * @var \Magento\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ private $responseMock; @@ -49,7 +49,7 @@ class ManageTest extends \PHPUnit_Framework_TestCase private $messageManagerMock; /** - * @var \Magento\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject */ private $redirectMock; @@ -70,16 +70,16 @@ class ManageTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->requestMock = $this->getMockBuilder('Magento\App\RequestInterface') + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') ->disableOriginalConstructor() ->getMock(); - $this->responseMock = $this->getMockBuilder('Magento\App\ResponseInterface') + $this->responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface') ->disableOriginalConstructor() ->getMock(); $this->messageManagerMock = $this->getMockBuilder('Magento\Message\ManagerInterface') ->disableOriginalConstructor() ->getMock(); - $this->redirectMock = $this->getMockBuilder('Magento\App\Response\RedirectInterface') + $this->redirectMock = $this->getMockBuilder('Magento\Framework\App\Response\RedirectInterface') ->disableOriginalConstructor() ->getMock(); $this->customerSessionMock = $this->getMockBuilder('Magento\Customer\Model\Session') diff --git a/dev/tests/unit/testsuite/Magento/Newsletter/Model/Queue/TransportBuilderTest.php b/dev/tests/unit/testsuite/Magento/Newsletter/Model/Queue/TransportBuilderTest.php index 074ab9a5f5884e383e3c4d2969c8201ed71fe6b8..65e9fdcc1e058cb79e01642fac6af49974391b4f 100644 --- a/dev/tests/unit/testsuite/Magento/Newsletter/Model/Queue/TransportBuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Newsletter/Model/Queue/TransportBuilderTest.php @@ -43,7 +43,7 @@ class TransportBuilderTest extends \Magento\Mail\Template\TransportBuilderTest * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function testGetTransport( - $templateType = \Magento\App\TemplateTypesInterface::TYPE_HTML, + $templateType = \Magento\Framework\App\TemplateTypesInterface::TYPE_HTML, $messageType = \Magento\Mail\Message::TYPE_HTML, $bodyText = '<h1>Html message</h1>' ) { diff --git a/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php b/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php index cc0b7cecb321839886e262abc7e35926e1a9d475..6b029e69d9cb550726b1f276aa3139587c617c89 100644 --- a/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php @@ -38,7 +38,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $storeManager = $this->getMock('Magento\Store\Model\StoreManager', array(), array(), '', false); $storeManager->expects($this->once())->method('hasSingleStore')->will($this->returnValue($isSingleStore)); - $request = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); if ($isSingleStore) { $store = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); @@ -71,7 +71,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->returnValue('processed text') ); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $templateFactory = $this->getMock('Magento\Newsletter\Model\TemplateFactory'); $data = array('template_text' => 'template text'); diff --git a/dev/tests/unit/testsuite/Magento/Object/Copy/Config/SchemaLocatorTest.php b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/SchemaLocatorTest.php index 9ffdb2a0053706f7baa4d07cb3ba431c1c049f2d..c24b9357b783c3ee5a64f2fe524c2dd19ec45bb9 100644 --- a/dev/tests/unit/testsuite/Magento/Object/Copy/Config/SchemaLocatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Object/Copy/Config/SchemaLocatorTest.php @@ -40,11 +40,13 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->fileSystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array(), array(), '', false ); $this->fileSystemMock->expects($this->any()) - ->method('getPath')->with(\Magento\App\Filesystem::ROOT_DIR)->will($this->returnValue('schema_dir')); + ->method('getPath') + ->with(\Magento\Framework\App\Filesystem::ROOT_DIR) + ->will($this->returnValue('schema_dir')); $this->model = new \Magento\Object\Copy\Config\SchemaLocator($this->fileSystemMock, 'schema.xsd', 'perFileSchema.xsd'); diff --git a/dev/tests/unit/testsuite/Magento/ObjectManager/Code/Generator/_files/SampleProxy.txt b/dev/tests/unit/testsuite/Magento/ObjectManager/Code/Generator/_files/SampleProxy.txt index 00d3f98f0ef14625d5dfe950df213c7fe4d92d7f..ca8a668ba7f8225dfa5bbc946ef97a6fd417d68f 100644 --- a/dev/tests/unit/testsuite/Magento/ObjectManager/Code/Generator/_files/SampleProxy.txt +++ b/dev/tests/unit/testsuite/Magento/ObjectManager/Code/Generator/_files/SampleProxy.txt @@ -60,7 +60,7 @@ class Sample_Proxy extends \Magento\ObjectManager\Code\Generator\Sample */ public function __wakeup() { - $this->_objectManager = \Magento\App\ObjectManager::getInstance(); + $this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** diff --git a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php index 20cb631c8148dd171dd828c01499dffc40e51aac..f80559d773d65e49bbac2ce111bc082f014e99ca 100644 --- a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php +++ b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/mapped_simple_di_config.php @@ -24,9 +24,9 @@ return array( 'preferences' => array( 'Magento\Module\UpdaterInterface' => 'Magento\Module\Updaterter', - 'Magento\App\RequestInterface' => 'Magento\App\Request\Http\Proxy', + 'Magento\Framework\App\RequestInterface' => 'Magento\Framework\App\Request\Http\Proxy', ), - 'Magento\App\State' => array('arguments' => array('test name' => 'test value')), + 'Magento\Framework\App\State' => array('arguments' => array('test name' => 'test value')), 'Magento\Core\Model\Config\Modules' => array( 'arguments' => array('test name' => 'test value'), 'plugins' => array( @@ -43,6 +43,6 @@ return array( ) ), 'Magento\Http\Handler\Composite' => array('shared' => false, 'arguments' => array('test name' => 'test value')), - 'customCacheInstance' => array('shared' => true, 'type' => 'Magento\App\Cache', 'arguments' => array()), + 'customCacheInstance' => array('shared' => true, 'type' => 'Magento\Framework\App\Cache', 'arguments' => array()), 'customOverriddenInstance' => array('shared' => false, 'arguments' => array()) ); diff --git a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml index 6e89639248b37195fba0945880bb33f7c2c87eac..60149f2b989e82694673c73c312e7cf601532444 100644 --- a/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml +++ b/dev/tests/unit/testsuite/Magento/ObjectManager/Config/Mapper/_files/simple_di_config.xml @@ -26,9 +26,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> <!-- Comment within root node --> <preference for="Magento\Module\UpdaterInterface" type="Magento\Module\Updaterter" /> - <preference for="Magento\App\RequestInterface" type="Magento\App\Request\Http\Proxy" /> + <preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http\Proxy" /> <!--Arguments only--> - <type name="Magento\App\State"> + <type name="Magento\Framework\App\State"> <arguments> <argument name="test name" xsi:type="string">test value</argument> </arguments> @@ -48,6 +48,6 @@ <argument name="test name" xsi:type="string">test value</argument> </arguments> </type> - <virtualType name="customCacheInstance" type="Magento\App\Cache" shared="true" /> + <virtualType name="customCacheInstance" type="Magento\Framework\App\Cache" shared="true" /> <virtualType name="customOverriddenInstance" shared="false" /> </config> diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php index 7ff9f1a1a486aabb0eebb90ab66c6b72ff0487dc..ac4e6b428c3674957b408d5c7f2358055869f0ce 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php @@ -38,7 +38,7 @@ class BanktransferTest extends \PHPUnit_Framework_TestCase $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $adapterFactoryMock = $this->getMock('Magento\Logger\AdapterFactory', array('create'), array(), '', false); $this->_object = $objectManagerHelper->getObject( 'Magento\OfflinePayments\Model\Banktransfer', diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php index 7b7b10f210a441ba39375315d3ca6f71fd786f28..44866f6e982bff36eb32626fce9ba5603af28ed8 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php @@ -41,7 +41,7 @@ class CashondeliveryTest extends \PHPUnit_Framework_TestCase $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); $adapterFactoryMock = $this->getMock('Magento\Logger\AdapterFactory', array('create'), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_object = $helper->getObject( 'Magento\OfflinePayments\Model\Cashondelivery', array( diff --git a/dev/tests/unit/testsuite/Magento/OfflineShipping/Block/Adminhtml/Form/Field/ExportTest.php b/dev/tests/unit/testsuite/Magento/OfflineShipping/Block/Adminhtml/Form/Field/ExportTest.php index 86e695328a2d3a04ca2ac46c603892b7b48c52d7..a597397412889fa3f4e7f753c814490ca27d0836 100644 --- a/dev/tests/unit/testsuite/Magento/OfflineShipping/Block/Adminhtml/Form/Field/ExportTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflineShipping/Block/Adminhtml/Form/Field/ExportTest.php @@ -60,7 +60,7 @@ class ExportTest extends \PHPUnit_Framework_TestCase $blockMock = $this->getMock('Magento\Backend\Block\Widget\Button', array(), array(), '', false, false); - $requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false, false); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false, false); $requestMock->expects($this->once())->method('getParam')->with('website')->will($this->returnValue(1)); $mockData = $this->getMock('StdClass', array('toHtml')); diff --git a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php index 69c7e0d47d039f8b54f3205cacc5a64ffa125591..d6f6ddd719b4c60749a25956344ea8762b5784f8 100644 --- a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php +++ b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php @@ -48,7 +48,7 @@ class ApiTest extends \PHPUnit_Framework_TestCase $string = $this->getMock('\Magento\Stdlib\String', array(), array(), '', false); $config = $this->getMock('Magento\Ogone\Model\Config', array(), array(), '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $loggerFactory = $this->getMock('\Magento\Logger\AdapterFactory', array(), array(), '', false); $object = new \Magento\Ogone\Model\Api( $eventManager, diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Block/System/Config/Form/Field/ExportTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Block/System/Config/Form/Field/ExportTest.php index 1a2d50db334c5a49ed3a29d14265f076ec1400e3..54863fbe60607cbbbd58446188738cf28b076cdc 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Block/System/Config/Form/Field/ExportTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Block/System/Config/Form/Field/ExportTest.php @@ -72,7 +72,7 @@ class ExportTest extends \PHPUnit_Framework_TestCase ); $this->_model->setUrlBuilder($urlBuilderMock); - $requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false, false); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false, false); $requestMock->expects($this->once())->method('getParam')->with('website')->will($this->returnValue(1)); $mockData = $this->getMock('Magento\Object', array('toHtml')); diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Controller/Adminhtml/PageCacheTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Controller/Adminhtml/PageCacheTest.php index a852f44120a56b04f63ad0754016bf9736e4adf8..1bcef2cf135ec5f364c12489ffa839bdcb5708c5 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Controller/Adminhtml/PageCacheTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Controller/Adminhtml/PageCacheTest.php @@ -38,17 +38,17 @@ namespace Magento\PageCache\Controller\Adminhtml; class PageCacheTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; /** - * @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; /** - * @var \Magento\App\View|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\View|\PHPUnit_Framework_MockObject_MockObject */ protected $viewMock; @@ -58,7 +58,7 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase protected $controller; /** - * @var \Magento\App\Response\Http\FileFactory|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http\FileFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $fileFactoryMock; @@ -73,7 +73,7 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->fileFactoryMock = $this->getMockBuilder( - 'Magento\App\Response\Http\FileFactory' + 'Magento\Framework\App\Response\Http\FileFactory' )->disableOriginalConstructor()->getMock(); $this->configMock = $this->getMockBuilder( 'Magento\PageCache\Model\Config' @@ -83,12 +83,12 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase )->disableOriginalConstructor()->getMock(); $this->requestMock = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->getMock(); $this->responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->getMock(); - $this->viewMock = $this->getMockBuilder('Magento\App\View')->disableOriginalConstructor()->getMock(); + $this->viewMock = $this->getMockBuilder('Magento\Framework\App\View')->disableOriginalConstructor()->getMock(); $contextMock->expects($this->any())->method('getRequest')->will($this->returnValue($this->requestMock)); $contextMock->expects($this->any())->method('getResponse')->will($this->returnValue($this->responseMock)); @@ -106,7 +106,7 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase $fileContent = 'some conetnt'; $filename = 'varnish.vcl'; $responseMock = $this->getMockBuilder( - 'Magento\App\ResponseInterface' + 'Magento\Framework\App\ResponseInterface' )->disableOriginalConstructor()->getMock(); $this->configMock->expects($this->once())->method('getVclFile')->will($this->returnValue($fileContent)); @@ -117,12 +117,12 @@ class PageCacheTest extends \PHPUnit_Framework_TestCase )->with( $this->equalTo($filename), $this->equalTo($fileContent), - $this->equalTo(\Magento\App\Filesystem::VAR_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::VAR_DIR) )->will( $this->returnValue($responseMock) ); $result = $this->controller->exportVarnishConfigAction(); - $this->assertInstanceOf('Magento\App\ResponseInterface', $result); + $this->assertInstanceOf('Magento\Framework\App\ResponseInterface', $result); } } diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Controller/BlockTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Controller/BlockTest.php index fdeab24b2530e704a10836605c3b9b2999d218a5..ae7a0f397c1b590674541396d33a8b2c909b8e08 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Controller/BlockTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Controller/BlockTest.php @@ -38,17 +38,17 @@ namespace Magento\PageCache\Controller; class BlockTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; /** - * @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; /** - * @var \Magento\App\View|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\View|\PHPUnit_Framework_MockObject_MockObject */ protected $viewMock; @@ -71,15 +71,16 @@ class BlockTest extends \PHPUnit_Framework_TestCase 'Magento\View\Layout' )->disableOriginalConstructor()->getMock(); - $contextMock = $this->getMockBuilder('Magento\App\Action\Context')->disableOriginalConstructor()->getMock(); + $contextMock = + $this->getMockBuilder('Magento\Framework\App\Action\Context')->disableOriginalConstructor()->getMock(); $this->requestMock = $this->getMockBuilder( - 'Magento\App\Request\Http' + 'Magento\Framework\App\Request\Http' )->disableOriginalConstructor()->getMock(); $this->responseMock = $this->getMockBuilder( - 'Magento\App\Response\Http' + 'Magento\Framework\App\Response\Http' )->disableOriginalConstructor()->getMock(); - $this->viewMock = $this->getMockBuilder('Magento\App\View')->disableOriginalConstructor()->getMock(); + $this->viewMock = $this->getMockBuilder('Magento\Framework\App\View')->disableOriginalConstructor()->getMock(); $contextMock->expects($this->any())->method('getRequest')->will($this->returnValue($this->requestMock)); $contextMock->expects($this->any())->method('getResponse')->will($this->returnValue($this->responseMock)); diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Helper/DataTest.php index ce7f8feabe8fe36a9ed898dbc4c8d3e80bda2ded..cf60f1e270ba94a80831b400905baf4f6e446ad7 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Helper/DataTest.php @@ -48,12 +48,12 @@ class DataTest extends \PHPUnit_Framework_TestCase protected $updateLayoutMock; /** - * @var \Magento\App\Helper\Context|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Helper\Context|\PHPUnit_Framework_MockObject_MockObject */ protected $contextMock; /** - * @var \Magento\App\View|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\View|\PHPUnit_Framework_MockObject_MockObject */ protected $viewMock; @@ -85,8 +85,9 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function prepareMocks() { - $this->contextMock = $this->getMock('Magento\App\Helper\Context', [], [], '', false); - $this->viewMock = $this->getMock('Magento\App\View', ['getLayout'], ['getPageLayoutHandles'], '', false); + $this->contextMock = $this->getMock('Magento\Framework\App\Helper\Context', [], [], '', false); + $this->viewMock = + $this->getMock('Magento\Framework\App\View', ['getLayout'], ['getPageLayoutHandles'], '', false); $layoutMock = $this->getMockForAbstractClass( 'Magento\View\LayoutInterface', array(), diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/BuiltinPluginTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/BuiltinPluginTest.php index bc360b6da8eb43ab33156b0a9ecc93a2898c5b06..e20b132ca9cf8b74c8966521490022c618de9157 100755 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/BuiltinPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/BuiltinPluginTest.php @@ -37,27 +37,27 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase protected $configMock; /** - * @var \Magento\App\PageCache\Version|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\PageCache\Version|\PHPUnit_Framework_MockObject_MockObject */ protected $versionMock; /** - * @var \Magento\App\PageCache\Kernel|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\PageCache\Kernel|\PHPUnit_Framework_MockObject_MockObject */ protected $kernelMock; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $stateMock; /** - * @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; /** - * @var \Magento\App\FrontControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\FrontControllerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $frontControllerMock; @@ -67,7 +67,7 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase protected $closure; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -77,18 +77,18 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->configMock = $this->getMock('Magento\PageCache\Model\Config', array(), array(), '', false); - $this->versionMock = $this->getMock('Magento\App\PageCache\Version', array(), array(), '', false); - $this->kernelMock = $this->getMock('Magento\App\PageCache\Kernel', array(), array(), '', false); - $this->stateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->versionMock = $this->getMock('Magento\Framework\App\PageCache\Version', array(), array(), '', false); + $this->kernelMock = $this->getMock('Magento\Framework\App\PageCache\Kernel', array(), array(), '', false); + $this->stateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->frontControllerMock = $this->getMock( - 'Magento\App\FrontControllerInterface', + 'Magento\Framework\App\FrontControllerInterface', array(), array(), '', false ); - $this->requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); - $this->responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); + $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $response = $this->responseMock; $this->closure = function () use ($response) { return $response; @@ -123,7 +123,7 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase $this->stateMock->expects($this->any()) ->method('getMode') ->will($this->returnValue($state)); - if ($state == \Magento\App\State::MODE_DEVELOPER) { + if ($state == \Magento\Framework\App\State::MODE_DEVELOPER) { $this->responseMock->expects($this->at(1)) ->method('setHeader') ->with('X-Magento-Cache-Control'); @@ -164,7 +164,7 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase $this->stateMock->expects($this->any()) ->method('getMode') ->will($this->returnValue($state)); - if ($state == \Magento\App\State::MODE_DEVELOPER) { + if ($state == \Magento\Framework\App\State::MODE_DEVELOPER) { $this->responseMock->expects($this->once()) ->method('setHeader') ->with('X-Magento-Cache-Debug'); @@ -201,8 +201,8 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase public function dataProvider() { return array( - 'developer_mode' => array(\Magento\App\State::MODE_DEVELOPER), - 'production' => array(\Magento\App\State::MODE_PRODUCTION), + 'developer_mode' => array(\Magento\Framework\App\State::MODE_DEVELOPER), + 'production' => array(\Magento\Framework\App\State::MODE_PRODUCTION), ); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/MessageBoxTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/MessageBoxTest.php similarity index 78% rename from dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/MessageBoxTest.php rename to dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/MessageBoxTest.php index fd07ae05e1337b7d86e0f40d3b5ccde37cabe440..ee29de0fa39504fb3a31b56864ff2a458f2b28b2 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/FrontController/Plugin/MessageBoxTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/MessageBoxTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\App\FrontController\Plugin; +namespace Magento\PageCache\Model\App\FrontController; /** * Class MessageBoxTest @@ -50,7 +50,7 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase /** * Request mock * - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -60,12 +60,12 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase protected $messageManagerMock; /** - * @var \Magento\App\FrontController + * @var \Magento\Framework\App\FrontController */ protected $objectMock; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $responseMock; @@ -75,7 +75,7 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->cookieMock = $this->getMock('Magento\Stdlib\Cookie', array(), array(), '', false); - $this->requestMock = $this->getMock('Magento\App\Request\Http', array('isPost'), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', array('isPost'), array(), '', false); $this->configMock = $this->getMock('Magento\PageCache\Model\Config', array('isEnabled'), array(), '', false); $this->messageManagerMock = $this->getMockBuilder('Magento\Message\Manager') ->disableOriginalConstructor() @@ -88,8 +88,8 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase $this->messageManagerMock ); - $this->objectMock = $this->getMock('Magento\App\FrontController', array(), array(), '', false); - $this->responseMock = $this->getMock('Magento\App\ResponseInterface', array(), array(), '', false); + $this->objectMock = $this->getMock('Magento\Framework\App\FrontController', array(), array(), '', false); + $this->responseMock = $this->getMock('Magento\Framework\App\ResponseInterface', array(), array(), '', false); } /** @@ -106,19 +106,16 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase $this->requestMock->expects($this->once()) ->method('isPost') ->will($this->returnValue(true)); - $this->configMock->expects($this->once()) - ->method('isEnabled') - ->will($this->returnValue(true)); $this->cookieMock->expects($this->once()) ->method('set') ->with( - $this->equalTo(\Magento\Core\App\FrontController\Plugin\MessageBox::COOKIE_NAME), + $this->equalTo(MessageBox::COOKIE_NAME), 1, - $this->equalTo(\Magento\Core\App\FrontController\Plugin\MessageBox::COOKIE_PERIOD), + $this->equalTo(MessageBox::COOKIE_PERIOD), '/' ); $this->assertInstanceOf( - '\Magento\App\ResponseInterface', + '\Magento\Framework\App\ResponseInterface', $this->msgBox->afterDispatch($this->objectMock, $this->responseMock) ); } @@ -134,7 +131,7 @@ class MessageBoxTest extends \PHPUnit_Framework_TestCase $this->messageManagerMock->expects($this->never()) ->method('getMessages'); $this->assertInstanceOf( - '\Magento\App\ResponseInterface', + '\Magento\Framework\App\ResponseInterface', $this->msgBox->afterDispatch($this->objectMock, $this->responseMock) ); } diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/VarnishPluginTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/VarnishPluginTest.php index def15e6000ec4eb165bd37975eecbe4abe7dcac1..82e4555f127c77311bf0e2cf7477879742e4dad2 100755 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/VarnishPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/App/FrontController/VarnishPluginTest.php @@ -37,22 +37,22 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase protected $configMock; /** - * @var \Magento\App\PageCache\Version|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\PageCache\Version|\PHPUnit_Framework_MockObject_MockObject */ protected $versionMock; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $stateMock; /** - * @var \Magento\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; /** - * @var \Magento\App\FrontControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\FrontControllerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $frontControllerMock; @@ -62,7 +62,7 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase protected $closure; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; @@ -72,17 +72,17 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->configMock = $this->getMock('Magento\PageCache\Model\Config', array(), array(), '', false); - $this->versionMock = $this->getMock('Magento\App\PageCache\Version', array(), array(), '', false); - $this->stateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->versionMock = $this->getMock('Magento\Framework\App\PageCache\Version', array(), array(), '', false); + $this->stateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->frontControllerMock = $this->getMock( - 'Magento\App\FrontControllerInterface', + 'Magento\Framework\App\FrontControllerInterface', array(), array(), '', false ); - $this->requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); - $this->responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); + $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $response = $this->responseMock; $this->closure = function () use ($response) { return $response; @@ -113,7 +113,7 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase $this->stateMock->expects($this->any()) ->method('getMode') ->will($this->returnValue($state)); - if ($state == \Magento\App\State::MODE_DEVELOPER) { + if ($state == \Magento\Framework\App\State::MODE_DEVELOPER) { $this->responseMock->expects($this->once()) ->method('setHeader') ->with('X-Magento-Debug'); @@ -147,8 +147,8 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase public function dataProvider() { return array( - 'developer_mode' => array(\Magento\App\State::MODE_DEVELOPER), - 'production' => array(\Magento\App\State::MODE_PRODUCTION), + 'developer_mode' => array(\Magento\Framework\App\State::MODE_DEVELOPER), + 'production' => array(\Magento\Framework\App\State::MODE_PRODUCTION), ); } } diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php index e5679feee8722fdc815e47e05bc947ab9aaf891b..25e4a9bb67ca64f0c733bab0293d2442acb0d327 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php @@ -33,12 +33,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Config\ScopeConfigInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Config\ScopeConfigInterface */ protected $_coreConfigMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Cache\StateInterface + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; @@ -47,9 +47,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $filesystemMock = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); - $this->_coreConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); - $this->_cacheState = $this->getMock('\Magento\App\Cache\State', array('isEnabled'), array(), '', false); + $filesystemMock = + $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $this->_coreConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); + $this->_cacheState = + $this->getMock('\Magento\Framework\App\Cache\State', array('isEnabled'), array(), '', false); $modulesDirectoryMock = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $filesystemMock->expects( @@ -57,7 +59,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::MODULES_DIR + \Magento\Framework\App\Filesystem::MODULES_DIR )->will( $this->returnValue($modulesDirectoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/Layout/LayoutPluginTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/Layout/LayoutPluginTest.php index c21243d88396c622ec548068f4315d7bcd8a0593..c416b0e1792af8f0412a0ec1519ec9cb6be90b36 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/Layout/LayoutPluginTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/Layout/LayoutPluginTest.php @@ -31,7 +31,7 @@ class LayoutPluginTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; @@ -41,7 +41,7 @@ class LayoutPluginTest extends \PHPUnit_Framework_TestCase protected $layoutMock; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $configMock; @@ -56,7 +56,7 @@ class LayoutPluginTest extends \PHPUnit_Framework_TestCase true, array('isCacheable', 'getAllBlocks') ); - $this->responseMock = $this->getMock('\Magento\App\Response\Http', array(), array(), '', false); + $this->responseMock = $this->getMock('\Magento\Framework\App\Response\Http', array(), array(), '', false); $this->configMock = $this->getMock('Magento\PageCache\Model\Config', array(), array(), '', false); $this->model = new \Magento\PageCache\Model\Layout\LayoutPlugin( diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/ObserverTest.php index a1c96c021b03dbb7001049ce1b59c8965ffed9c3..db21e2c6d521d5eda183b0e3d669022ee47ec68d 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/ObserverTest.php @@ -33,7 +33,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\PageCache\Model\Config */ protected $_configMock; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\PageCache\Cache */ + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\PageCache\Cache */ protected $_cacheMock; /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\View\Element\AbstractBlock */ @@ -48,7 +48,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\PageCache\Helper\Data */ protected $_helperMock; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Cache\TypeListInterface */ + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Cache\TypeListInterface */ protected $_typeListMock; /** @var \Magento\Object */ @@ -57,7 +57,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\PageCache\Model\Observer */ protected $_observerObject; - /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\PageCache\FormKey */ + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\PageCache\FormKey */ protected $_formKey; /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Session\Generic */ @@ -75,10 +75,10 @@ class ObserverTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_cacheMock = $this->getMock('Magento\App\PageCache\Cache', array('clean'), array(), '', false); + $this->_cacheMock = $this->getMock('Magento\Framework\App\PageCache\Cache', array('clean'), array(), '', false); $this->_helperMock = $this->getMock('Magento\PageCache\Helper\Data', array(), array(), '', false); - $this->_typeListMock = $this->getMock('Magento\App\Cache\TypeList', array(), array(), '', false); - $this->_formKey = $this->getMock('Magento\App\PageCache\FormKey', array(), array(), '', false); + $this->_typeListMock = $this->getMock('Magento\Framework\App\Cache\TypeList', array(), array(), '', false); + $this->_formKey = $this->getMock('Magento\Framework\App\PageCache\FormKey', array(), array(), '', false); $this->_session = $this->getMock('Magento\Session\Generic', array('setData'), array(), '', false); $this->_model = new \Magento\PageCache\Model\Observer( @@ -313,7 +313,6 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $formKey = 'asdfaswqrwqe12'; //Verification - $this->_configMock->expects($this->once())->method('isEnabled')->will($this->returnValue(true)); $this->_formKey->expects($this->once())->method('get')->will($this->returnValue($formKey)); $this->_session->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/SubstitutionTest.php b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/SubstitutionTest.php index f15fee76c4207c65bd113b3ba7eb44d0f91c4fac..3813239805ff851d19c1ab1f2e996323af2fee4e 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/SubstitutionTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/SubstitutionTest.php @@ -58,7 +58,7 @@ class SubstitutionTest extends \PHPUnit_Framework_TestCase )->getMock(); $scopeConfig = $this->getMockBuilder( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->disableOriginalConstructor()->setMethods( [] )->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Payment/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Payment/Helper/DataTest.php index bbf4b7191c3dec2afab9bc53c7d9d902daa26a5c..2f6222db97efe5305ad698e96ac4ba6718c11083 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Helper/DataTest.php @@ -37,13 +37,13 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $context = $this->getMock('Magento\App\Helper\Context', [], [], '', false); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface', [], [], '', false); - $layout = $this->getMock('Magento\View\LayoutInterface', [], [], '', false); - $this->_methodFactory = $this->getMock('Magento\Payment\Model\Method\Factory', [], [], '', false); - $appEmulation = $this->getMock('Magento\Core\Model\App\Emulation', [], [], '', false); - $paymentConfig = $this->getMock('Magento\Payment\Model\Config', [], [], '', false); - $initialConfig = $this->getMock('Magento\App\Config\Initial', [], [], '', false); + $context = $this->getMock('Magento\Framework\App\Helper\Context', [], [], '', false); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); + $layout = $this->getMock('Magento\View\LayoutInterface', [], [], '', false); + $this->_methodFactory = $this->getMock('Magento\Payment\Model\Method\Factory', [], [], '', false); + $appEmulation = $this->getMock('Magento\Core\Model\App\Emulation', [], [], '', false); + $paymentConfig = $this->getMock('Magento\Payment\Model\Config', [], [], '', false); + $initialConfig = $this->getMock('Magento\Framework\App\Config\Initial', [], [], '', false); $this->_helper = new \Magento\Payment\Helper\Data( $context, diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/GroupListTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/GroupListTest.php new file mode 100644 index 0000000000000000000000000000000000000000..69777c8b41ad3d88c29882f3d2feb7ddd88d2797 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/GroupListTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Payment\Model\Resource\Grid; + +class GroupListTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Payment\Model\Resource\Grid\GroupsList + */ + protected $groupArrayModel; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $helperMock; + + protected function setUp() + { + $this->helperMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); + $this->groupArrayModel = new \Magento\Payment\Model\Resource\Grid\GroupList($this->helperMock); + } + + public function testToOptionArray() + { + $this->helperMock + ->expects($this->once()) + ->method('getPaymentMethodList') + ->with(true, true, true) + ->will($this->returnValue(array('group data'))); + $this->assertEquals(array('group data'), $this->groupArrayModel->toOptionArray()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/TypeListTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/TypeListTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1285c2e732c3116f87af83dd7364511eefc3f696 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/Resource/Grid/TypeListTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Payment\Model\Resource\Grid; + +class TypeListTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Payment\Model\Resource\Grid\TypeList + */ + protected $typesArrayModel; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $helperMock; + + protected function setUp() + { + $this->helperMock = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); + $this->typesArrayModel = new \Magento\Payment\Model\Resource\Grid\TypeList($this->helperMock); + } + + public function testToOptionArray() + { + $this->helperMock + ->expects($this->once()) + ->method('getPaymentMethodList') + ->with(true) + ->will($this->returnValue(array('group data'))); + $this->assertEquals(array('group data'), $this->typesArrayModel->toOptionArray()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php index 8297f11cba7c4d89de2470fdbaf41cc269ea53ae..a5773dcba7ee8ab92855f6c816135bf9b9c6c78b 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Block/Express/ReviewTest.php @@ -27,7 +27,7 @@ namespace Magento\Paypal\Block\Express; class ReviewTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $request; @@ -44,7 +44,7 @@ class ReviewTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->request = $this->getMock('Magento\App\Request\Http', [], [], '', false); + $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->viewUrl = $this->getMock('Magento\View\Url', [], [], '', false); $this->model = $helper->getObject( 'Magento\Paypal\Block\Express\Review', diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php index ff9a9797d1c2979fac9134f8fc425e00826affac..8be69262d3e6cb7dbd8b7fa99888a5b8a0773604 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Billing/AgreementTest.php @@ -36,7 +36,7 @@ class AgreementTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_request; @@ -93,16 +93,16 @@ class AgreementTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->_agreement) ); - $this->_request = $this->getMock('Magento\App\RequestInterface'); + $this->_request = $this->getMock('Magento\Framework\App\RequestInterface'); $this->_request->expects($this->once())->method('getParam')->with('agreement')->will($this->returnValue(15)); - $response = $this->getMock('Magento\App\ResponseInterface'); + $response = $this->getMock('Magento\Framework\App\ResponseInterface'); - $redirect = $this->getMock('Magento\App\Response\RedirectInterface'); + $redirect = $this->getMock('Magento\Framework\App\Response\RedirectInterface'); $this->_messageManager = $this->getMock('Magento\Message\ManagerInterface'); - $context = $this->getMock('Magento\App\Action\Context', array(), array(), '', false); + $context = $this->getMock('Magento\Framework\App\Action\Context', array(), array(), '', false); $context->expects($this->any())->method('getObjectManager')->will($this->returnValue($this->_objectManager)); $context->expects($this->any())->method('getRequest')->will($this->returnValue($this->_request)); $context->expects($this->any())->method('getResponse')->will($this->returnValue($response)); @@ -111,7 +111,7 @@ class AgreementTest extends \PHPUnit_Framework_TestCase $this->_registry = $this->getMock('Magento\Registry', array(), array(), '', false); - $title = $this->getMock('Magento\App\Action\Title', array(), array(), '', false); + $title = $this->getMock('Magento\Framework\App\Action\Title', array(), array(), '', false); $this->_controller = new Agreement($context, $this->_registry, $title); } diff --git a/dev/tests/unit/testsuite/Magento/Persistent/Model/SessionTest.php b/dev/tests/unit/testsuite/Magento/Persistent/Model/SessionTest.php index bdf98a26f3010ab105c0d0e375cc48babe23e411..fcd69d2bf89030da3b33175744957305e4277cf2 100644 --- a/dev/tests/unit/testsuite/Magento/Persistent/Model/SessionTest.php +++ b/dev/tests/unit/testsuite/Magento/Persistent/Model/SessionTest.php @@ -49,9 +49,9 @@ class SessionTest extends \PHPUnit_Framework_TestCase array(), '', false, false, true, array('__wakeup', 'getIdFieldName', 'getConnection', 'beginTransaction', 'delete', 'commit', 'rollBack')); - $appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $eventDispatcherMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false, false); - $cacheManagerMock = $this->getMock('Magento\App\CacheInterface', array(), array(), '', false, false); + $cacheManagerMock = $this->getMock('Magento\Framework\App\CacheInterface', array(), array(), '', false, false); $loggerMock = $this->getMock('Magento\Logger', array(), array(), '', false); $actionValidatorMock = $this->getMock( '\Magento\Model\ActionValidator\RemoveAction', array(), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/PhraseTest.php b/dev/tests/unit/testsuite/Magento/PhraseTest.php index 4eacdbc290a70f01521376a5ef3f2a33bda8018b..c5fa7379dfa91370207c52f33436b423e85ac390 100644 --- a/dev/tests/unit/testsuite/Magento/PhraseTest.php +++ b/dev/tests/unit/testsuite/Magento/PhraseTest.php @@ -25,20 +25,25 @@ namespace Magento; class PhraseTest extends \PHPUnit_Framework_TestCase { + /** + * @var \Magento\Phrase + */ + protected $phrase; + /** * @var \Magento\Phrase\RendererInterface|PHPUnit_Framework_MockObject_MockObject */ - protected $_renderer; + protected $renderer; protected function setUp() { - $this->_renderer = $this->getMock('Magento\Phrase\RendererInterface'); - \Magento\Phrase::setRenderer($this->_renderer); + $this->renderer = $this->getMock('Magento\Phrase\RendererInterface'); + \Magento\Phrase::setRenderer($this->renderer); } protected function tearDown() { - $this->_removeRendererFromPhrase(); + $this->removeRendererFromPhrase(); \Magento\Phrase::setRenderer(new \Magento\Phrase\Renderer\Placeholder()); } @@ -47,8 +52,9 @@ class PhraseTest extends \PHPUnit_Framework_TestCase $text = 'some text'; $arguments = ['arg1', 'arg2']; $result = 'rendered text'; + $this->phrase = new \Magento\Phrase($text, $arguments); - $this->_renderer->expects( + $this->renderer->expects( $this->once() )->method( 'render' @@ -59,25 +65,22 @@ class PhraseTest extends \PHPUnit_Framework_TestCase $this->returnValue($result) ); - $phrase = new \Magento\Phrase($text, $arguments); - $this->assertEquals($result, $phrase->render()); + $this->assertEquals($result, $this->phrase->render()); } public function testRenderingWithoutRenderer() { - $this->_removeRendererFromPhrase(); - + $this->removeRendererFromPhrase(); $result = 'some text'; + $this->phrase = new \Magento\Phrase($result); - $phrase = new \Magento\Phrase($result); - $this->assertEquals($result, $phrase->render()); + $this->assertEquals($result, $this->phrase->render()); } public function testDefersRendering() { - $this->_renderer->expects($this->never())->method('render'); - - new \Magento\Phrase('some text'); + $this->renderer->expects($this->never())->method('render'); + $this->phrase = new \Magento\Phrase('some text'); } public function testThatToStringIsAliasToRender() @@ -85,8 +88,9 @@ class PhraseTest extends \PHPUnit_Framework_TestCase $text = 'some text'; $arguments = ['arg1', 'arg2']; $result = 'rendered text'; + $this->phrase = new \Magento\Phrase($text, $arguments); - $this->_renderer->expects( + $this->renderer->expects( $this->once() )->method( 'render' @@ -97,14 +101,13 @@ class PhraseTest extends \PHPUnit_Framework_TestCase $this->returnValue($result) ); - $phrase = new \Magento\Phrase($text, $arguments); - $this->assertEquals($result, (string)$phrase); + $this->assertEquals($result, (string) $this->phrase); } - protected function _removeRendererFromPhrase() + protected function removeRendererFromPhrase() { $property = new \ReflectionProperty('Magento\Phrase', '_renderer'); $property->setAccessible(true); - $property->setValue(null); + $property->setValue($this->phrase, null); } } diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CalculatorTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CalculatorTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6be42a00035b6c17283803605f87ac10590b0451 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CalculatorTest.php @@ -0,0 +1,132 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Adjustment; + +/** + * Class CalculatorTest + * + * @package Magento\Pricing\Adjustment + */ +class CalculatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Adjustment\Calculator + */ + protected $model; + + /** + * @var \Magento\Pricing\Amount\AmountFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountFactoryMock; + + public function setUp() + { + $this->amountFactoryMock = $this->getMockBuilder('Magento\Pricing\Amount\AmountFactory') + ->disableOriginalConstructor() + ->getMock(); + $this->model = new \Magento\Pricing\Adjustment\Calculator($this->amountFactoryMock); + } + + /** + * Test getAmount() + */ + public function testGetAmount() + { + $amount = 10; + $fullAmount = $amount; + $newAmount = 15; + $taxAdjustmentCode = 'tax'; + $weeeAdjustmentCode = 'weee'; + $adjust = 5; + $expectedAdjustments = [ + $taxAdjustmentCode => $adjust, + $weeeAdjustmentCode => $adjust + ]; + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['getPriceInfo', '__wakeup']) + ->getMock(); + + $taxAdjustmentMock = $this->getMockBuilder('Magento\Tax\Pricing\Adjustment') + ->disableOriginalConstructor() + ->getMock(); + $taxAdjustmentMock->expects($this->once()) + ->method('getAdjustmentCode') + ->will($this->returnValue($taxAdjustmentCode)); + $taxAdjustmentMock->expects($this->once()) + ->method('isIncludedInBasePrice') + ->will($this->returnValue(true)); + $taxAdjustmentMock->expects($this->once()) + ->method('extractAdjustment') + ->with($this->equalTo($amount), $this->equalTo($productMock)) + ->will($this->returnValue($adjust)); + + $weeeAdjustmentMock = $this->getMockBuilder('Magento\Weee\Pricing\Adjustment') + ->disableOriginalConstructor() + ->getMock(); + $weeeAdjustmentMock->expects($this->once()) + ->method('getAdjustmentCode') + ->will($this->returnValue($weeeAdjustmentCode)); + $weeeAdjustmentMock->expects($this->once()) + ->method('isIncludedInBasePrice') + ->will($this->returnValue(false)); + $weeeAdjustmentMock->expects($this->once()) + ->method('isIncludedInDisplayPrice') + ->with($this->equalTo($productMock)) + ->will($this->returnValue(true)); + $weeeAdjustmentMock->expects($this->once()) + ->method('applyAdjustment') + ->with($this->equalTo($fullAmount), $this->equalTo($productMock)) + ->will($this->returnValue($newAmount)); + + $adjustments = [$taxAdjustmentMock, $weeeAdjustmentMock]; + + $priceInfoMock = $this->getMockBuilder('\Magento\Pricing\PriceInfoInterface') + ->disableOriginalConstructor() + //->setMethods(['getPriceInfo']) + ->getMock(); + $priceInfoMock->expects($this->any()) + ->method('getAdjustments') + ->will($this->returnValue($adjustments)); + + $productMock->expects($this->any()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfoMock)); + + $amountBaseMock = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + + $this->amountFactoryMock->expects($this->once()) + ->method('create') + ->with($this->equalTo($newAmount), $this->equalTo($expectedAdjustments)) + ->will($this->returnValue($amountBaseMock)); + $result = $this->model->getAmount($amount, $productMock); + $this->assertInstanceOf('Magento\Pricing\Amount\AmountInterface', $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CollectionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..30817dc398a259cf53b6e03dbffd0a9da7914dc6 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/CollectionTest.php @@ -0,0 +1,147 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Adjustment; + +class CollectionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Adjustment\Pool + */ + protected $adjustmentPool; + + /** + * @var [][] + */ + protected $adjustmentsData; + + public function setUp() + { + $adj1 = $this->getMock('Magento\Pricing\Adjustment\AdjustmentInterface'); + $adj1->expects($this->any()) + ->method('getSortOrder') + ->will($this->returnValue(10)); + $adj2 = $this->getMock('Magento\Pricing\Adjustment\AdjustmentInterface'); + $adj2->expects($this->any()) + ->method('getSortOrder') + ->will($this->returnValue(20)); + $adj3 = $this->getMock('Magento\Pricing\Adjustment\AdjustmentInterface'); + $adj3->expects($this->any()) + ->method('getSortOrder') + ->will($this->returnValue(5)); + $adj4 = $this->getMock('Magento\Pricing\Adjustment\AdjustmentInterface'); + $adj4->expects($this->any()) + ->method('getSortOrder') + ->will($this->returnValue(\Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER)); + + $adjustmentsData = [ + 'adj1' => $adj1, + 'adj2' => $adj2, + 'adj3' => $adj3, + 'adj4' => $adj4, + ]; + + /** @var \Magento\Pricing\Adjustment\Pool|\PHPUnit_Framework_MockObject_MockObject $adjustmentPool */ + $adjustmentPool = $this->getMockBuilder('Magento\Pricing\Adjustment\Pool') + ->disableOriginalConstructor() + ->setMethods(['getAdjustmentByCode']) + ->getMock(); + $adjustmentPool->expects($this->any())->method('getAdjustmentByCode')->will( + $this->returnCallback( + function ($code) use ($adjustmentsData) { + if (!isset($adjustmentsData[$code])) { + $this->fail(sprintf('Adjustment "%s" not found', $code)); + } + return $adjustmentsData[$code]; + } + ) + ); + + $this->adjustmentPool = $adjustmentPool; + $this->adjustmentsData = $adjustmentsData; + } + + /** + * @param string[] $adjustments + * @param string[] $expectedResult + * @dataProvider getItemsDataProvider + */ + public function testGetItems($adjustments, $expectedResult) + { + $collection = new Collection($this->adjustmentPool, $adjustments); + + $result = $collection->getItems(); + + $this->assertEquals($expectedResult, array_keys($result)); + } + + public function getItemsDataProvider() + { + return [ + [['adj1'], ['adj1']], + [['adj4'], ['adj4']], + [['adj1', 'adj4'], ['adj1', 'adj4']], + [['adj1', 'adj2', 'adj3', 'adj4'], ['adj3', 'adj1', 'adj2', 'adj4']] + ]; + } + + + /** + * @param string[] $adjustments + * @param string $code + * @param $expectedResult + * @dataProvider getItemByCodeDataProvider + */ + public function testGetItemByCode($adjustments, $code, $expectedResult) + { + $collection = new Collection($this->adjustmentPool, $adjustments); + + $item = $collection->getItemByCode($code); + + $this->assertEquals($expectedResult, $item->getAdjustmentCode()); + } + + public function getItemByCodeDataProvider() + { + return [ + [['adj1'], 'adj1', $this->adjustmentsData['adj1']], + [['adj1', 'adj2', 'adj3', 'adj4'], 'adj1', $this->adjustmentsData['adj1']], + [['adj1', 'adj2', 'adj3', 'adj4'], 'adj2', $this->adjustmentsData['adj2']], + [['adj1', 'adj2', 'adj3', 'adj4'], 'adj3', $this->adjustmentsData['adj3']], + [['adj1', 'adj2', 'adj3', 'adj4'], 'adj4', $this->adjustmentsData['adj4']], + ]; + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testGetItemByNotExistingCode() + { + $adjustments = ['adj1']; + $collection = new Collection($this->adjustmentPool, $adjustments); + $collection->getItemByCode('not_existing_code'); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/FactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c1f18de96600cc28b7aa111017997d9503db2def --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/FactoryTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Adjustment; + +/** + * Test class for \Magento\Pricing\Adjustment\Factory + */ +class FactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + public function testCreate() + { + $adjustmentInterface = 'Magento\Pricing\Adjustment\AdjustmentInterface'; + $adjustmentFactory = $this->prepareAdjustmentFactory($adjustmentInterface); + + $this->assertInstanceOf( + $adjustmentInterface, + $adjustmentFactory->create($adjustmentInterface) + ); + } + + /** + * @param string $adjustmentInterface + * @return object + */ + protected function prepareAdjustmentFactory($adjustmentInterface) + { + return $this->objectManager->getObject( + 'Magento\Pricing\Adjustment\Factory', + ['objectManager' => $this->prepareObjectManager($adjustmentInterface)] + ); + } + + /** + * @param string $adjustmentInterface + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\ObjectManager\ObjectManager + */ + protected function prepareObjectManager($adjustmentInterface) + { + $objectManager = $this->getMock('Magento\ObjectManager\ObjectManager', array('create'), array(), '', false); + $objectManager->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->getMockForAbstractClass($adjustmentInterface))); + return $objectManager; + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testCreateWithException() + { + $invalidAdjustmentInterface = 'Magento\Object'; + $adjustmentFactory = $this->prepareAdjustmentFactory($invalidAdjustmentInterface); + $adjustmentFactory->create($invalidAdjustmentInterface); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/PoolTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/PoolTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4b3ecda4896c1b935562e61d6a1ce78b8a9aa5ac --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Adjustment/PoolTest.php @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Adjustment; + +class PoolTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Adjustment\Pool + */ + public $model; + + public function setUp() + { + $adjustmentsData = [ + 'adj1' => ['className' => 'adj1_class', 'sortOrder' => 10], + 'adj2' => ['className' => 'adj2_class', 'sortOrder' => 20], + 'adj3' => ['className' => 'adj3_class', 'sortOrder' => 5], + 'adj4' => ['className' => 'adj4_class', 'sortOrder' => null], + 'adj5' => ['className' => 'adj5_class'], + ]; + + /** @var \Magento\Pricing\Adjustment\Factory|\PHPUnit_Framework_MockObject_MockObject $adjustmentFactory */ + $adjustmentFactory = $this->getMockBuilder('Magento\Pricing\Adjustment\Factory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $adjustmentFactory->expects($this->any())->method('create')->will( + $this->returnCallback( + function ($className, $data) { + return $className . '|' . $data['sortOrder']; + } + ) + ); + + $this->model = new Pool($adjustmentFactory, $adjustmentsData); + } + + public function testGetAdjustments() + { + $expectedResult = [ + 'adj1' => 'adj1_class|10', + 'adj2' => 'adj2_class|20', + 'adj3' => 'adj3_class|5', + 'adj4' => 'adj4_class|' . \Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER, + 'adj5' => 'adj5_class|' . \Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER, + ]; + + $result = $this->model->getAdjustments(); + + $this->assertEquals($expectedResult, $result); + } + + /** + * @dataProvider getAdjustmentByCodeDataProvider + */ + public function testGetAdjustmentByCode($code, $expectedResult) + { + $result = $this->model->getAdjustmentByCode($code); + + $this->assertEquals($expectedResult, $result); + } + + public function getAdjustmentByCodeDataProvider() + { + return [ + ['adj1', 'adj1_class|10'], + ['adj2', 'adj2_class|20'], + ['adj3', 'adj3_class|5'], + ['adj4', 'adj4_class|' . \Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER], + ['adj5', 'adj5_class|' . \Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER], + ]; + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testGetAdjustmentByNotExistingCode() + { + $this->model->getAdjustmentByCode('not_existing_code'); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Amount/AmountFactoryTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Amount/AmountFactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ab5357a6e0887ecc899232a15061d7b4b7178f1f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Amount/AmountFactoryTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Amount; + +/** + * Class AmountFactoryTest + */ +class AmountFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Amount\AmountFactory + */ + protected $factory; + + /** + * @var \Magento\Framework\App\ObjectManager |\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectManagerMock; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amountMock; + + /** + * Test setUp + */ + public function setUp() + { + $this->objectManagerMock = $this->getMock('Magento\Framework\App\ObjectManager', [], [], '', false); + $this->amountMock = $this->getMock('Magento\Pricing\Amount\Base', [], [], '', false); + $this->factory = new \Magento\Pricing\Amount\AmountFactory($this->objectManagerMock); + } + + /** + * Test method create + */ + public function testCreate() + { + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with( + $this->equalTo('Magento\Pricing\Amount\AmountInterface'), + $this->equalTo( + [ + 'amount' => 'this-is-float-amount', + 'adjustmentAmounts' => ['this-is-array-of-adjustments'] + ] + ) + ) + ->will($this->returnValue($this->amountMock)); + $this->assertEquals( + $this->amountMock, + $this->factory->create('this-is-float-amount', ['this-is-array-of-adjustments']) + ); + } + + /** + * Test method create + * + * @expectedException \InvalidArgumentException + */ + public function testCreateException() + { + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with( + $this->equalTo('Magento\Pricing\Amount\AmountInterface'), + $this->equalTo( + [ + 'amount' => 'this-is-float-amount', + 'adjustmentAmounts' => ['this-is-array-of-adjustments'] + ] + ) + ) + ->will($this->returnValue(new \stdClass)); + $this->assertEquals( + $this->amountMock, + $this->factory->create('this-is-float-amount', ['this-is-array-of-adjustments']) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Amount/BaseTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Amount/BaseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..769b3c2e0c3e466b21dc70ee156e6d2bc0bd46fa --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Amount/BaseTest.php @@ -0,0 +1,183 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Amount; + +/** + * Class BaseTest + * + * @package Magento\Pricing\Amount + */ +class BaseTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test getValue() without exclude argument + */ + public function testGetValueWithoutExclude() + { + $amount = 1; + $adjustments = []; + $exclude = null; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getValue($exclude); + $this->assertEquals($amount, $result); + } + + /** + * Test getValue() with exclude argument + */ + public function testGetValueWithExclude() + { + $amount = 1; + $code = 'test_adjustment'; + $adjust = 5; + $adjustments = [$code => $adjust]; + $expected = $amount - $adjust; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getValue($code); + $this->assertEquals($expected, $result); + } + + /** + * Test __toString() + */ + public function testToString() + { + $amount = 1; + $adjustments = []; + + $model = $this->createEntity($amount, $adjustments); + $result = (string)$model; + $this->assertEquals($amount, $result); + } + + /** + * Test getBaseAmount() + */ + public function testGetBaseAmount() + { + $amount = 1; + $adjustments = []; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getBaseAmount(); + $this->assertEquals($amount, $result); + } + + /** + * Test getAdjustmentAmount() if no adjustment amounts + */ + public function testGetAdjustmentAmountNoAdjustments() + { + $amount = 1; + $adjustments = []; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getAdjustmentAmount('some_code'); + $this->assertFalse($result); + } + + /** + * Test getAdjustmentAmount() if adjustment amount exists + */ + public function testGetAdjustmentAmountWithAdjustments() + { + $amount = 1; + $code = 'test_code'; + $adjust = 10; + $adjustments = [$code => $adjust]; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getAdjustmentAmount($code); + $this->assertEquals($adjust, $result); + } + + /** + * Test getTotalAdjustmentAmount() + */ + public function testGetTotalAdjustmentAmount() + { + $amount = 1; + $adjust1 = 10; + $adjust2 = 5; + $expected = $adjust1 + $adjust2; + $adjustments = [ + 'test_code1' => $adjust1, + 'test_code2' => $adjust2 + ]; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getTotalAdjustmentAmount(); + $this->assertEquals($expected, $result); + } + + /** + * Test getAdjustmentAmounts() + */ + public function testGetAdjustmentAmounts() + { + $amount = 1; + $adjust = 5; + $adjustments = [ + 'test_code1' => $adjust, + ]; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->getAdjustmentAmounts(); + $this->assertEquals($adjustments, $result); + } + + /** + * Test getAdjustmentAmounts() + */ + public function testHasAdjustment() + { + $amount = 1; + $adjust = 5; + $code = 'test_code1'; + $adjustments = [ + $code => $adjust, + ]; + + $model = $this->createEntity($amount, $adjustments); + $result = $model->hasAdjustment($code); + $this->assertTrue($result); + } + + /** + * Return instance of tested model + * + * @param string $amount + * @param array $adjustmentAmounts + * @return Base + */ + protected function createEntity($amount, array $adjustmentAmounts = []) + { + return new \Magento\Pricing\Amount\Base($amount, $adjustmentAmounts); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Price/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Price/FactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..40eb7dcd2671ee8f3245bf7979953ffa1ce22150 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Price/FactoryTest.php @@ -0,0 +1,96 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Price; + +/** + * Test class for \Magento\Pricing\Factory + */ +class FactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Factory + */ + protected $model; + + /** + * @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + */ + protected $objectManagerMock; + + public function setUp() + { + $this->objectManagerMock = $this->getMockBuilder('Magento\ObjectManager') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject('Magento\Pricing\Price\Factory', array( + 'objectManager' => $this->objectManagerMock + )); + } + + public function testCreate() + { + $quantity = 2.2; + $className = 'Magento\Pricing\Price\PriceInterface'; + $priceMock = $this->getMock($className); + $salableItem = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $arguments = []; + + $argumentsResult = array_merge($arguments, ['salableItem' => $salableItem, 'quantity' => $quantity]); + + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with($className, $argumentsResult) + ->will($this->returnValue($priceMock)); + + $this->assertEquals($priceMock, $this->model->create($salableItem, $className, $quantity, $arguments)); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Magento\Pricing\PriceInfo\Base doesn't implement \Magento\Pricing\Price\PriceInterface + */ + public function testCreateWithException() + { + $quantity = 2.2; + $className = 'Magento\Pricing\PriceInfo\Base'; + $priceMock = $this->getMockBuilder($className)->disableOriginalConstructor()->getMock(); + $salableItem = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $arguments = []; + + $argumentsResult = array_merge($arguments, ['salableItem' => $salableItem, 'quantity' => $quantity]); + + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with($className, $argumentsResult) + ->will($this->returnValue($priceMock)); + + $this->model->create($salableItem, $className, $quantity, $arguments); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/PriceCompositeTest.php b/dev/tests/unit/testsuite/Magento/Pricing/PriceCompositeTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c6bffccc3c5b65902b3568d5108b26f7f5796f24 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/PriceCompositeTest.php @@ -0,0 +1,116 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing; + +use Magento\Pricing\Price\Factory as PriceFactory; +use Magento\Catalog\Pricing\Price\FinalPriceInterface; +use Magento\Catalog\Pricing\Price\GroupPriceInterface; +use Magento\Catalog\Pricing\Price\SpecialPriceInterface; + +/** + * Test class for \Magento\Pricing\PriceComposite + */ +class PriceCompositeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var PriceComposite + */ + protected $model; + + /** + * @var PriceFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceFactory; + + /** + * @var array + */ + protected $metadata; + + public function setUp() + { + $this->priceFactory = $this->getMockBuilder('Magento\Pricing\Price\Factory') + ->disableOriginalConstructor() + ->getMock(); + + $this->metadata = array( + FinalPriceInterface::PRICE_TYPE_FINAL => ['class' => 'Class\For\FinalPrice'], + GroupPriceInterface::PRICE_TYPE_GROUP => ['class' => 'Class\For\GroupPrice'], + SpecialPriceInterface::PRICE_TYPE_SPECIAL => ['class' => 'Class\For\SpecialPrice'] + ); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject('Magento\Pricing\PriceComposite', array( + 'priceFactory' => $this->priceFactory, + 'metadata' => $this->metadata + )); + } + + public function testGetPriceCodes() + { + $expectedCodes = [ + FinalPriceInterface::PRICE_TYPE_FINAL, + GroupPriceInterface::PRICE_TYPE_GROUP, + SpecialPriceInterface::PRICE_TYPE_SPECIAL + ]; + $this->assertEquals($expectedCodes, $this->model->getPriceCodes()); + } + + public function testGetMetadata() + { + $this->assertEquals($this->metadata, $this->model->getMetadata()); + } + + public function testCreatePriceObject() + { + $saleable = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $priceCode = FinalPriceInterface::PRICE_TYPE_FINAL; + $quantity = 2.4; + + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + + $this->priceFactory->expects($this->once()) + ->method('create') + ->with($saleable, $this->metadata[$priceCode]['class'], $quantity) + ->will($this->returnValue($price)); + + $this->assertEquals($price, $this->model->createPriceObject($saleable, $priceCode, $quantity)); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage wrong_price is not registered in prices list + */ + public function testCreatePriceObjectWithException() + { + $saleable = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + $priceCode = 'wrong_price'; + $quantity = 2.4; + + $this->model->createPriceObject($saleable, $priceCode, $quantity); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/BaseTest.php b/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/BaseTest.php new file mode 100644 index 0000000000000000000000000000000000000000..494904df12d60058df1a498c503ed0bf9fe1809e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/BaseTest.php @@ -0,0 +1,190 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\PriceInfo; + +/** + * Test class for \Magento\Pricing\PriceInfo\Base + */ +class BaseTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Pricing\Object\SaleableInterface + */ + protected $saleableItem; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Pricing\PriceComposite + */ + protected $prices; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Pricing\Adjustment\Collection + */ + protected $adjustmentCollection; + + /** + * @var float + */ + protected $quantity; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Pricing\Amount\AmountFactory + */ + protected $amountFactory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|Base + */ + protected $model; + + public function setUp() + { + $this->saleableItem = $this->getMock('Magento\Pricing\Object\SaleableInterface', [], [], '', false); + $this->prices = $this->getMock('Magento\Pricing\PriceComposite', [], [], '', false); + $this->adjustmentCollection = $this->getMock('Magento\Pricing\Adjustment\Collection', [], [], '', false); + $this->amountFactory = $this->getMock('Magento\Pricing\Amount\AmountFactory', [], [], '', false); + $this->quantity = 3.; + $this->model = new Base( + $this->saleableItem, + $this->prices, + $this->adjustmentCollection, + $this->amountFactory, + $this->quantity + ); + } + + /** + * @covers \Magento\Pricing\PriceInfo\Base::__construct + * @covers \Magento\Pricing\PriceInfo\Base::initPrices + * @covers \Magento\Pricing\PriceInfo\Base::getPrices + */ + public function testGetPrices() + { + $this->prices->expects($this->once()) + ->method('getPriceCodes') + ->will($this->returnValue(['test1', 'test2'])); + $this->prices->expects($this->at(1))->method('createPriceObject') + ->with($this->saleableItem, 'test1', $this->quantity)->will($this->returnValue('1')); + $this->prices->expects($this->at(2))->method('createPriceObject') + ->with($this->saleableItem, 'test2', $this->quantity)->will($this->returnValue('2')); + $this->assertEquals(['test1' => '1', 'test2' => '2'], $this->model->getPrices()); + } + + /** + * @covers \Magento\Pricing\PriceInfo\Base::__construct + * @covers \Magento\Pricing\PriceInfo\Base::getPrice + * @dataProvider providerGetPrice + */ + public function testGetPrice($entryParams, $createCount) + { + list($priceCode, $quantity) = array_values(reset($entryParams)); + $this->prices->expects($this->exactly($createCount))->method('createPriceObject') + ->with($this->saleableItem, $priceCode, $quantity ? : $this->quantity)->will( + $this->returnValue('basePrice') + ); + + foreach ($entryParams as $params) { + list($priceCode, $quantity) = array_values($params); + $this->assertEquals('basePrice', $this->model->getPrice($priceCode, $quantity)); + } + } + + /** + * Data provider for testGetPrice + * + * @return array + */ + public function providerGetPrice() + { + return [ + 'case with empty quantity' => [ + 'entryParams' => [ + ['priceCode' => 'testCode', 'quantity' => null] + ], + 'createCount' => 1 + ], + 'case with existing price' => [ + 'entryParams' => [ + ['priceCode' => 'testCode', 'quantity' => null], + ['priceCode' => 'testCode', 'quantity' => null] + ], + 'createCount' => 1 + ], + 'case with quantity' => [ + 'entryParams' => [ + ['priceCode' => 'testCode', 'quantity' => 2.] + ], + 'createCount' => 1 + ], + ]; + } + + /** + * @covers \Magento\Pricing\PriceInfo\Base::getAdjustments + */ + public function testGetAdjustments() + { + $this->adjustmentCollection->expects($this->once())->method('getItems')->will($this->returnValue('result')); + $this->assertEquals('result', $this->model->getAdjustments()); + } + + /** + * @covers \Magento\Pricing\PriceInfo\Base::getAdjustment + */ + public function testGetAdjustment() + { + $this->adjustmentCollection->expects($this->any())->method('getItemByCode') + ->with('test1') + ->will($this->returnValue('adjustment')); + $this->assertEquals('adjustment', $this->model->getAdjustment('test1')); + } + + /** + * @covers \Magento\Pricing\PriceInfo\Base::getPricesIncludedInBase + */ + public function testGetPricesIncludedInBase() + { + $this->prices->expects($this->once()) + ->method('getMetadata') + ->will( + $this->returnValue( + [ + 'test1' => ['class' => 'class1', 'include_in_base_price' => false], + 'test2' => ['class' => 'class2', 'include_in_base_price' => true] + ] + ) + ); + + $priceModelMock = $this->getMock('Magento\Catalog\Pricing\Price\SpecialPrice', [], [], '', false); + $priceModelMock->expects($this->once())->method('getValue')->will($this->returnValue(2.5)); + $this->prices->expects($this->at(1))->method('createPriceObject') + ->with($this->saleableItem, 'test2', $this->quantity)->will($this->returnValue($priceModelMock)); + + $this->assertSame([$priceModelMock], $this->model->getPricesIncludedInBase()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/FactoryTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e3b271dc4585b2851bf0282ec1a727174bfd6328 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/PriceInfo/FactoryTest.php @@ -0,0 +1,135 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\PriceInfo; + +/** + * Test class for \Magento\Pricing\PriceInfo\Factory + */ +class FactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + /** + * @dataProvider priceInfoClassesProvider + */ + public function testCreate($types, $type, $expected) + { + $priceInfoFactory = $this->preparePriceInfoFactory( + $expected, + $types + ); + + $productMock = $this->getMock( + 'Magento\Catalog\Model\Product', + ['getTypeId', 'getQty', '__wakeup'], + [], + '', + false + ); + + $productMock->expects($this->any()) + ->method('getTypeId') + ->will($this->returnValue($type)); + + $productMock->expects($this->any()) + ->method('getQty') + ->will($this->returnValue(1)); + + $this->assertInstanceOf( + $expected, + $priceInfoFactory->create($productMock) + ); + } + + /** + * @param string $priceInfoInterface + * @param array $types + * @return object + */ + protected function preparePriceInfoFactory($priceInfoInterface, $types = []) + { + return $this->objectManager->getObject( + 'Magento\Pricing\PriceInfo\Factory', + [ + 'types' => $types, + 'objectManager' => $this->prepareObjectManager($priceInfoInterface) + ] + ); + } + + /** + * @param string $priceInfoInterface + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\ObjectManager\ObjectManager + */ + protected function prepareObjectManager($priceInfoInterface) + { + $objectManager = $this->getMock('Magento\ObjectManager\ObjectManager', ['create'], [], '', false); + $objectManager->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->getMockForAbstractClass($priceInfoInterface))); + return $objectManager; + } + + /** + * @return array + */ + public function priceInfoClassesProvider() + { + return [ + [ + ['new_type' => 'Magento\Pricing\PriceInfo\Base'], + 'new_type', + 'Magento\Pricing\PriceInfoInterface' + ], + [ + [], + 'unknown', + 'Magento\Pricing\PriceInfoInterface' + ] + ]; + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testCreateWithException() + { + $invalidPriceInfoInterface = 'Magento\Object'; + $priceInfoFactory = $this->preparePriceInfoFactory($invalidPriceInfoInterface); + $priceInfoFactory->create( + $this->getMock('Magento\Catalog\Model\Product', ['__wakeup'], [], '', false) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Render/AbstractAdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Render/AbstractAdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ce65486e039ccd92834b23303aea9b274463c2b2 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Render/AbstractAdjustmentTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +/** + * Test class for \Magento\Pricing\Render\AbstractAdjustment + */ +class AbstractAdjustmentTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Amount + */ + protected $model; + + /** + * @var \Magento\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceCurrency; + + public function setUp() + { + $this->priceCurrency = $this->getMock('Magento\Pricing\PriceCurrencyInterface'); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $constructorArgs = $objectManager->getConstructArguments('Magento\Pricing\Render\AbstractAdjustment', array( + 'priceCurrency' => $this->priceCurrency + )); + $this->model = $this->getMockBuilder('Magento\Pricing\Render\AbstractAdjustment') + ->setConstructorArgs($constructorArgs) + ->getMockForAbstractClass(); + } + + public function testConvertAndFormatCurrency() + { + $amount = '100'; + $includeContainer = true; + $precision = \Magento\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION; + + $result = '100.0 grn'; + + $this->priceCurrency->expects($this->once()) + ->method('convertAndFormat') + ->with($amount, $includeContainer, $precision) + ->will($this->returnValue($result)); + + $this->assertEquals($result, $this->model->convertAndFormatCurrency($amount, $includeContainer, $precision)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Render/AmountTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Render/AmountTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5187c10968690de8d042547af669f6299a40e0fb --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Render/AmountTest.php @@ -0,0 +1,151 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; + +/** + * Test class for \Magento\Pricing\Render\Amount + */ +class AmountTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Amount + */ + protected $model; + + /** + * @var \Magento\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceCurrency; + + /** + * @var RendererPool|\PHPUnit_Framework_MockObject_MockObject + */ + protected $rendererPool; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + /** + * @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableItemMock; + + /** + * @var PriceInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceMock; + + public function setUp() + { + $this->priceCurrency = $this->getMock('Magento\Pricing\PriceCurrencyInterface'); + $data = [ + 'default' => [ + 'adjustments' => [ + 'base_price_test' => [ + 'tax' => [ + 'adjustment_render_class' => 'Magento\View\Element\Template', + 'adjustment_render_template' => 'template.phtml' + ] + ] + ] + ] + ]; + + $this->rendererPool = $this->getMock( + 'Magento\Pricing\Render\RendererPool', + [], + ['data' => $data], + '', + false, + false + ); + + $this->layout = $this->getMock('Magento\View\Layout', [], [], '', false); + + $eventManager = $this->getMock('Magento\Event\ManagerStub', [], [], '', false); + $config = $this->getMock('Magento\Store\Model\Store\Config', [], [], '', false); + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + $context = $this->getMock('Magento\View\Element\Template\Context', [], [], '', false); + $context->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManager)); + $context->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($config)); + $context->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->layout)); + $context->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Pricing\Render\Amount', + [ + 'context' => $context, + 'priceCurrency' => $this->priceCurrency, + 'rendererPool' => $this->rendererPool + ] + ); + } + + public function testConvertAndFormatCurrency() + { + $amount = '100'; + $includeContainer = true; + $precision = \Magento\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION; + + $result = '100.0 grn'; + + $this->priceCurrency->expects($this->once()) + ->method('convertAndFormat') + ->with($amount, $includeContainer, $precision) + ->will($this->returnValue($result)); + + $this->assertEquals($result, $this->model->convertAndFormatCurrency($amount, $includeContainer, $precision)); + } + + /** + * Test case for getAdjustmentRenders method through toHtml() + */ + public function testToHtmlGetAdjustmentRenders() + { + $adjustmentRender = []; + $this->rendererPool->expects($this->once()) + ->method('getAdjustmentRenders') + ->will($this->returnValue($adjustmentRender)); + + $this->model->toHtml(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Render/LayoutTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Render/LayoutTest.php new file mode 100644 index 0000000000000000000000000000000000000000..16037f666555cdb2fe07a864e0315b86e84781f8 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Render/LayoutTest.php @@ -0,0 +1,128 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +/** + * Test class for \Magento\Pricing\Render\Layout + */ +class LayoutTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Layout + */ + protected $model; + + /** + * @var \Magento\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $layout; + + /** + * @var \Magento\View\LayoutFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $layoutFactory; + + /** + * @var \Magento\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $generalLayout; + + public function setUp() + { + $this->layout = $this->getMock('Magento\View\LayoutInterface'); + $this->generalLayout = $this->getMock('Magento\View\LayoutInterface'); + + $isCacheable = false; + $this->generalLayout->expects($this->once()) + ->method('isCacheable') + ->will($this->returnValue(false)); + $layoutFactory = $this->getMockBuilder('Magento\View\LayoutFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $layoutFactory->expects($this->once()) + ->method('create') + ->with($this->equalTo(['cacheable' => $isCacheable])) + ->will($this->returnValue($this->layout)); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Pricing\Render\Layout', + [ + 'layoutFactory' => $layoutFactory, + 'generalLayout' => $this->generalLayout + ] + ); + } + + public function testAddHandle() + { + $handle = 'test_handle'; + + $layoutProcessor = $this->getMock('Magento\View\Layout\ProcessorInterface'); + $layoutProcessor->expects($this->once()) + ->method('addHandle') + ->with($handle); + $this->layout->expects($this->once()) + ->method('getUpdate') + ->will($this->returnValue($layoutProcessor)); + + $this->model->addHandle($handle); + } + + public function testLoadLayout() + { + $layoutProcessor = $this->getMock('Magento\View\Layout\ProcessorInterface'); + $layoutProcessor->expects($this->once()) + ->method('load'); + $this->layout->expects($this->once()) + ->method('getUpdate') + ->will($this->returnValue($layoutProcessor)); + + $this->layout->expects($this->once()) + ->method('generateXml'); + + $this->layout->expects($this->once()) + ->method('generateElements'); + + $this->model->loadLayout(); + } + + public function testGetBlock() + { + $blockName = 'block.name'; + + $block = $this->getMock('Magento\View\Element\BlockInterface'); + + $this->layout->expects($this->once()) + ->method('getBlock') + ->with($blockName) + ->will($this->returnValue($block)); + + $this->assertEquals($block, $this->model->getBlock($blockName)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Render/PriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Render/PriceBoxTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4e63bf27c32355512b10f1430547a7e72f493652 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Render/PriceBoxTest.php @@ -0,0 +1,196 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +/** + * Test class for \Magento\Pricing\Render\PriceBox + */ +class PriceBoxTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + + /** + * @var PriceBox + */ + protected $model; + + /** + * @var \Magento\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject + */ + protected $context; + + /** + * @var \Magento\Pricing\Render\RendererPool|\PHPUnit_Framework_MockObject_MockObject + */ + protected $rendererPool; + + /** + * @var \Magento\Pricing\Object\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleable; + + /** + * @var \Magento\Pricing\Price\PriceInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $price; + + public function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->rendererPool = $this->getMockBuilder('Magento\Pricing\Render\RendererPool') + ->disableOriginalConstructor() + ->setMethods(['createAmountRender']) + ->getMock(); + + $layout = $this->getMock('Magento\View\LayoutInterface'); + $eventManager = $this->getMock('Magento\Event\ManagerInterface'); + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + $storeConfig = $this->getMockBuilder('Magento\Store\Model\Store\Config') + ->disableOriginalConstructor() + ->getMock(); + $this->context = $this->getMockBuilder('Magento\View\Element\Template\Context') + ->disableOriginalConstructor() + ->getMock(); + $this->context->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($layout)); + $this->context->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManager)); + $this->context->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($storeConfig)); + $this->context->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + $this->saleable = $this->getMock('Magento\Pricing\Object\SaleableInterface'); + + $this->price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + + $this->model = $this->objectManager->getObject('Magento\Pricing\Render\PriceBox', array( + 'context' => $this->context, + 'saleableItem' => $this->saleable, + 'price' => $this->price, + 'rendererPool' => $this->rendererPool + )); + } + + /** + * @param array $data + * @param string $priceType + * @param array $cssClasses + * @dataProvider toHtmlDataProvider + */ + public function testToHtml($data, $priceType, $cssClasses) + { + $this->price->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceType)); + + $priceBox = $this->objectManager->getObject('Magento\Pricing\Render\PriceBox', array( + 'context' => $this->context, + 'saleableItem' => $this->saleable, + 'price' => $this->price, + 'rendererPool' => $this->rendererPool, + 'data' => $data + )); + $priceBox->toHtml(); + $this->assertEquals($cssClasses, $priceBox->getData('css_classes')); + } + + public function toHtmlDataProvider() + { + return array( + array( + 'data' => [], + 'price_type' => 'test_price', + 'css_classes' => 'price-test_price' + ), + array( + 'data' => ['css_classes' => 'some_css_class'], + 'price_type' => 'test_price', + 'css_classes' => 'some_css_class price-test_price' + )); + } + + public function testGetSaleableItem() + { + $this->assertEquals($this->saleable, $this->model->getSaleableItem()); + } + + public function testGetPrice() + { + $this->assertEquals($this->price, $this->model->getPrice()); + } + + public function testGetPriceType() + { + $priceCode = 'test_price'; + $quantity = 1.; + + $price = $this->getMock('Magento\Pricing\Price\PriceInterface'); + + $priceInfo = $this->getMock('Magento\Pricing\PriceInfoInterface'); + $priceInfo->expects($this->once()) + ->method('getPrice') + ->with($priceCode, $quantity) + ->will($this->returnValue($price)); + + $this->saleable->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfo)); + + $this->assertEquals($price, $this->model->getPriceType($priceCode, $quantity)); + } + + public function testRenderAmount() + { + $amount = $this->getMock('Magento\Pricing\Amount\AmountInterface'); + $arguments = []; + $resultHtml = 'result_html'; + + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['toHtml']) + ->getMock(); + $amountRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue($resultHtml)); + + $this->rendererPool->expects($this->once()) + ->method('createAmountRender') + ->with($amount, $this->saleable, $this->price, $arguments) + ->will($this->returnValue($amountRender)); + + $this->assertEquals($resultHtml, $this->model->renderAmount($amount, $arguments)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/Render/RendererPoolTest.php b/dev/tests/unit/testsuite/Magento/Pricing/Render/RendererPoolTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b3f268ef1bdb4dc61339e4f3b15f4b2e7f058c28 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/Render/RendererPoolTest.php @@ -0,0 +1,636 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +/** + * Test class for \Magento\Pricing\Render\RendererPool + */ +class RendererPoolTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Pricing\Render\RendererPool | \PHPUnit_Framework_MockObject_MockObject + */ + protected $object; + + /** + * @var \Magento\Core\Model\Layout | \PHPUnit_Framework_MockObject_MockObject + */ + protected $layoutMock; + + /** + * @var \Magento\Catalog\Model\Product | \PHPUnit_Framework_MockObject_MockObject + */ + protected $productMock; + + /** + * @var \Magento\Catalog\Pricing\Price\BasePrice | \PHPUnit_Framework_MockObject_MockObject + */ + protected $priceMock; + + /** + * @var \Magento\View\LayoutInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $contextMock; + + public function setUp() + { + $this->layoutMock = $this->getMockBuilder('Magento\View\Layout') + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock = $this->getMockBuilder('\Magento\View\Element\Context') + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects($this->any()) + ->method('getLayout') + ->will($this->returnValue($this->layoutMock)); + $this->productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + $this->priceMock = $this->getMockBuilder('Magento\Catalog\Pricing\Price\BasePrice') + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Test createPriceRender() if not found render class name + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Class name for price code "price_test" not registered + */ + public function testCreatePriceRenderNoClassName() + { + $methodData = []; + $priceCode = 'price_test'; + $data = []; + $type = 'simple'; + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->createPriceRender($priceCode, $this->productMock, $methodData); + $this->assertNull($result); + } + + /** + * Test createPriceRender() if not found price model + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Price model for price code "price_test" not registered + */ + public function testCreatePriceRenderNoPriceModel() + { + $methodData = []; + $priceCode = 'price_test'; + $type = 'simple'; + $className = 'Test'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'render_class' => $className + ] + ] + ] + ]; + $priceModel = null; + + $priceInfoMock = $this->getMockBuilder('Magento\Pricing\PriceInfo\Base') + ->disableOriginalConstructor() + ->getMock(); + $priceInfoMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo($priceCode)) + ->will($this->returnValue($priceModel)); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->productMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfoMock)); + + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->createPriceRender($priceCode, $this->productMock, $methodData); + $this->assertNull($result); + } + + /** + * Test createPriceRender() if not found price model + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Block "Magento\View\Element\Template\Context" must implement + * \Magento\Pricing\Render\PriceBoxRenderInterface + */ + public function testCreatePriceRenderBlockNotPriceBox() + { + $methodData = []; + $priceCode = 'price_test'; + $type = 'simple'; + $className = 'Magento\View\Element\Template\Context'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'render_class' => $className + ] + ] + ] + ]; + + $priceInfoMock = $this->getMockBuilder('Magento\Pricing\PriceInfo\Base') + ->disableOriginalConstructor() + ->getMock(); + $priceInfoMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo($priceCode)) + ->will($this->returnValue($this->priceMock)); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->productMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfoMock)); + + $contextMock = $this->getMockBuilder('Magento\View\Element\Template\Context') + ->disableOriginalConstructor() + ->getMock(); + $block = new \Magento\View\Element\Template($contextMock); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'price' => $this->priceMock, + 'saleableItem' => $this->productMock + ]; + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($className), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($block)); + + $result = $testedClass->createPriceRender($priceCode, $this->productMock, $methodData); + $this->assertNull($result); + } + + /** + * Test createPriceRender() + */ + public function testCreatePriceRender() + { + $methodData = []; + $priceCode = 'price_test'; + $type = 'simple'; + $className = 'Magento\View\Element\Template\Context'; + $template = 'template.phtml'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'render_class' => $className, + 'render_template' => $template + ] + ] + ] + ]; + + $priceInfoMock = $this->getMockBuilder('Magento\Pricing\PriceInfo\Base') + ->disableOriginalConstructor() + ->getMock(); + $priceInfoMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo($priceCode)) + ->will($this->returnValue($this->priceMock)); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->productMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfoMock)); + + $renderBlock = $this->getMockBuilder('Magento\Pricing\Render\PriceBox') + ->disableOriginalConstructor() + ->getMock(); + $renderBlock->expects($this->once()) + ->method('setTemplate') + ->with($this->equalTo($template)); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'price' => $this->priceMock, + 'saleableItem' => $this->productMock + ]; + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($className), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($renderBlock)); + + $result = $testedClass->createPriceRender($priceCode, $this->productMock, $methodData); + $this->assertInstanceOf('Magento\Pricing\Render\PriceBoxRenderInterface', $result); + } + + /** + * Test createAmountRender() if amount render class not found + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage There is no amount render class for price code "base_price_test" + */ + public function testCreateAmountRenderNoAmountClass() + { + $data = []; + $type = 'simple'; + $methodData = []; + $priceCode = 'base_price_test'; + + $amountMock = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->createAmountRender($amountMock, $this->productMock, $this->priceMock, $methodData); + $this->assertNull($result); + } + + /** + * Test createAmountRender() if amount render block not implement Amount interface + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Block "Magento\View\Element\Template\Context" + * must implement \Magento\Pricing\Render\AmountRenderInterface + */ + public function testCreateAmountRenderNotAmountInterface() + { + $type = 'simple'; + $methodData = []; + $priceCode = 'base_price_test'; + $amountRenderClass = 'Magento\View\Element\Template\Context'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'amount_render_class' => $amountRenderClass + ] + ] + ] + ]; + + $amountMock = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $contextMock = $this->getMockBuilder('Magento\View\Element\Template\Context') + ->disableOriginalConstructor() + ->getMock(); + $block = new \Magento\View\Element\Template($contextMock); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'amount' => $amountMock, + 'saleableItem' => $this->productMock, + 'price' => $this->priceMock + ]; + + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($amountRenderClass), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($block)); + + $result = $testedClass->createAmountRender($amountMock, $this->productMock, $this->priceMock, $methodData); + $this->assertNull($result); + } + + /** + * Test createAmountRender() + */ + public function testCreateAmountRender() + { + $type = 'simple'; + $methodData = []; + $priceCode = 'base_price_test'; + $template = 'template.phtml'; + $amountRenderClass = 'Magento\Pricing\Render\Amount'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'amount_render_class' => $amountRenderClass, + 'amount_render_template' => $template + ] + ] + ] + ]; + + $amountMock = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $blockMock = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->getMock(); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'amount' => $amountMock, + 'saleableItem' => $this->productMock, + 'price' => $this->priceMock + ]; + + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($amountRenderClass), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($blockMock)); + + $blockMock->expects($this->once()) + ->method('setTemplate') + ->with($this->equalTo($template)); + + $result = $testedClass->createAmountRender($amountMock, $this->productMock, $this->priceMock, $methodData); + $this->assertInstanceOf('Magento\Pricing\Render\AmountRenderInterface', $result); + } + + /** + * Test getAdjustmentRenders() with not existed adjustment render class + */ + public function testGetAdjustmentRendersNoRenderClass() + { + $typeId = 'simple'; + $priceCode = 'base_price_test'; + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($typeId)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $code = 'test_code'; + $adjustments = [$code => 'some data']; + $data = [ + 'default' => [ + 'adjustments' => $adjustments + ] + ]; + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->getAdjustmentRenders($this->productMock, $this->priceMock); + $this->assertNull($result); + } + + /** + * Test getAdjustmentRenders() with not existed adjustment render template + */ + public function testGetAdjustmentRendersNoRenderTemplate() + { + $typeId = 'simple'; + $priceCode = 'base_price_test'; + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($typeId)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $code = 'test_code'; + $adjustments = [ + $code => [ + 'adjustment_render_class' => 'Test' + ] + ]; + $data = [ + 'default' => [ + 'adjustments' => $adjustments + ] + ]; + + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->getAdjustmentRenders($this->productMock, $this->priceMock); + $this->assertNull($result); + } + + /** + * Test getAdjustmentRenders() + */ + public function testGetAdjustmentRenders() + { + $typeId = 'simple'; + $priceCode = 'base_price_test'; + $class = 'Magento\View\Element\Template'; + $template = 'template.phtml'; + + $code = 'tax'; + $adjustments = [ + $priceCode => [ + $code => [ + 'adjustment_render_class' => $class, + 'adjustment_render_template' => $template + ] + ] + ]; + $data = [ + 'default' => [ + 'adjustments' => $adjustments + ] + ]; + + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($typeId)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $blockMock = $this->getMockBuilder('Magento\View\Element\Template') + ->disableOriginalConstructor() + ->getMock(); + $blockMock->expects($this->once()) + ->method('setTemplate') + ->with($this->equalTo($template)); + + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($class)) + ->will($this->returnValue($blockMock)); + + $testedClass = $this->createTestedEntity($data); + $result = $testedClass->getAdjustmentRenders($this->productMock, $this->priceMock); + $this->assertArrayHasKey($code, $result); + $this->assertInstanceOf('Magento\View\Element\Template', $result[$code]); + } + + /** + * Test getAmountRenderBlockTemplate() through createAmountRender() in case when template not exists + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage For type "simple" amount render block not configured + */ + public function testGetAmountRenderBlockTemplateNoTemplate() + { + $type = 'simple'; + $methodData = []; + $priceCode = 'base_price_test'; + $template = false; + $amountRenderClass = 'Magento\Pricing\Render\Amount'; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'amount_render_class' => $amountRenderClass, + 'amount_render_template' => $template + ] + ] + ] + ]; + + $amountMock = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->priceMock->expects($this->once()) + ->method('getPriceType') + ->will($this->returnValue($priceCode)); + + $blockMock = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->getMock(); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'amount' => $amountMock, + 'saleableItem' => $this->productMock, + 'price' => $this->priceMock + ]; + + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($amountRenderClass), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($blockMock)); + + $result = $testedClass->createAmountRender($amountMock, $this->productMock, $this->priceMock, $methodData); + $this->assertNull($result); + } + + /** + * Test getRenderBlockTemplate() through createPriceRender() in case when template not exists + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Price code "price_test" render block not configured + */ + public function testGetRenderBlockTemplate() + { + $methodData = []; + $priceCode = 'price_test'; + $type = 'simple'; + $className = 'Magento\View\Element\Template\Context'; + $template = false; + $data = [ + $type => [ + 'prices' => [ + $priceCode => [ + 'render_class' => $className, + 'render_template' => $template + ] + ] + ] + ]; + + $priceInfoMock = $this->getMockBuilder('Magento\Pricing\PriceInfo\Base') + ->disableOriginalConstructor() + ->getMock(); + $priceInfoMock->expects($this->once()) + ->method('getPrice') + ->with($this->equalTo($priceCode)) + ->will($this->returnValue($this->priceMock)); + $this->productMock->expects($this->once()) + ->method('getTypeId') + ->will($this->returnValue($type)); + $this->productMock->expects($this->once()) + ->method('getPriceInfo') + ->will($this->returnValue($priceInfoMock)); + + $renderBlock = $this->getMockBuilder('Magento\Pricing\Render\PriceBox') + ->disableOriginalConstructor() + ->getMock(); + + $testedClass = $this->createTestedEntity($data); + + $arguments = [ + 'data' => $methodData, + 'rendererPool' => $testedClass, + 'price' => $this->priceMock, + 'saleableItem' => $this->productMock + ]; + $this->layoutMock->expects($this->once()) + ->method('createBlock') + ->with($this->equalTo($className), $this->equalTo(''), $this->equalTo($arguments)) + ->will($this->returnValue($renderBlock)); + + $result = $testedClass->createPriceRender($priceCode, $this->productMock, $methodData); + $this->assertInstanceOf('Magento\Pricing\Render\PriceBoxRenderInterface', $result); + } + + /** + * Create tested object with specified parameters + * + * @param array $data + * @return RendererPool + */ + protected function createTestedEntity(array $data = []) + { + return $this->object = new \Magento\Pricing\Render\RendererPool($this->contextMock, $data); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Pricing/RenderTest.php b/dev/tests/unit/testsuite/Magento/Pricing/RenderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..eefba963c5e778c0a6f00e2df09bc5dd3af8a340 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Pricing/RenderTest.php @@ -0,0 +1,215 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @subpackage unit_tests + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing; + +/** + * Test class for \Magento\Pricing\Render + */ +class RenderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Render + */ + protected $model; + + /** + * @var Render\Layout|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceLayout; + + /** + * @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject + */ + protected $price; + + /** + * @var \Magento\Pricing\Amount\Base|\PHPUnit_Framework_MockObject_MockObject + */ + protected $amount; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $saleableItem; + + /** + * @var \Magento\Pricing\Render\RendererPool|\PHPUnit_Framework_MockObject_MockObject + */ + protected $renderPool; + + public function setUp() + { + $this->priceLayout = $this->getMockBuilder('Magento\Pricing\Render\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $this->price = $this->getMockBuilder('\Magento\Catalog\Pricing\Price\BasePrice') + ->disableOriginalConstructor() + ->getMock(); + + $this->amount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->getMock(); + + $this->saleableItem = $this->getMockBuilder('\Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $this->renderPool = $this->getMockBuilder('Magento\Pricing\Render\RendererPool') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Pricing\Render', + [ + 'priceLayout' => $this->priceLayout + ] + ); + } + + public function testSetLayout() + { + $priceRenderHandle = 'price_render_handle'; + + $this->priceLayout->expects($this->once()) + ->method('addHandle') + ->with($priceRenderHandle); + + $this->priceLayout->expects($this->once()) + ->method('loadLayout'); + + $layout = $this->getMock('Magento\View\LayoutInterface'); + $this->model->setPriceRenderHandle($priceRenderHandle); + $this->model->setLayout($layout); + } + + /** + * @expectedException \RuntimeException + */ + public function testRenderWithoutRenderList() + { + $priceType = 'final'; + $arguments = ['param' => 1]; + $result = ''; + + $this->priceLayout->expects($this->once()) + ->method('getBlock') + ->with('render.product.prices') + ->will($this->returnValue(false)); + + $this->assertEquals($result, $this->model->render($priceType, $this->saleableItem, $arguments)); + } + + public function testRender() + { + $priceType = 'final'; + $arguments = ['param' => 1]; + $result = 'simple.final'; + + $pricingRender = $this->getMock('Magento\Pricing\Render', [], [], '', false, true, true, false); + $this->renderPool->expects($this->once()) + ->method('createPriceRender') + ->will($this->returnValue($pricingRender)); + $pricingRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue('simple.final')); + $this->priceLayout->expects($this->once()) + ->method('getBlock') + ->with('render.product.prices') + ->will($this->returnValue($this->renderPool)); + $this->assertEquals($result, $this->model->render($priceType, $this->saleableItem, $arguments)); + } + + public function testRenderDefault() + { + $priceType = 'special'; + $arguments = ['param' => 15]; + $result = 'default.special'; + $pricingRender = $this->getMock('Magento\Pricing\Render', [], [], '', false, true, true, false); + $this->renderPool->expects($this->once()) + ->method('createPriceRender') + ->will($this->returnValue($pricingRender)); + $pricingRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue('default.special')); + $this->priceLayout->expects($this->once()) + ->method('getBlock') + ->with('render.product.prices') + ->will($this->returnValue($this->renderPool)); + + $this->assertEquals($result, $this->model->render($priceType, $this->saleableItem, $arguments)); + } + + public function testRenderDefaultDefault() + { + $priceType = 'final'; + $arguments = ['param' => 15]; + $result = 'default.default'; + + $pricingRender = $this->getMock('Magento\Pricing\Render', [], [], '', false, true, true, false); + $this->renderPool->expects($this->once()) + ->method('createPriceRender') + ->will($this->returnValue($pricingRender)); + $pricingRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue('default.default')); + $this->priceLayout->expects($this->once()) + ->method('getBlock') + ->with('render.product.prices') + ->will($this->returnValue($this->renderPool)); + + $this->assertEquals($result, $this->model->render($priceType, $this->saleableItem, $arguments)); + } + + public function testAmountRender() + { + $arguments = ['param' => 15]; + $expectedResult = 'default.default'; + + $pricingRender = $this->getMock('Magento\Pricing\Render\Amount', [], [], '', false, true, true, false); + $this->renderPool->expects($this->once()) + ->method('createAmountRender') + ->with( + $this->equalTo($this->amount), + $this->equalTo($this->saleableItem), + $this->equalTo($this->price), + $this->equalTo($arguments) + ) + ->will($this->returnValue($pricingRender)); + $pricingRender->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue('default.default')); + $this->priceLayout->expects($this->once()) + ->method('getBlock') + ->with('render.product.prices') + ->will($this->returnValue($this->renderPool)); + + $result = $this->model->renderAmount($this->amount, $this->price, $this->saleableItem, $arguments); + $this->assertEquals($expectedResult, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Adminhtml/Product/Edit/Tab/Price/RecurringTest.php b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Adminhtml/Product/Edit/Tab/Price/RecurringTest.php index ee0a88ab8693fb33f7c7508088cb4b1b8bc9ddba..4ee644818770a6a622bf9c55171e1352f3744eeb 100644 --- a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Adminhtml/Product/Edit/Tab/Price/RecurringTest.php +++ b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Adminhtml/Product/Edit/Tab/Price/RecurringTest.php @@ -51,7 +51,7 @@ class RecurringTest extends \PHPUnit_Framework_TestCase protected $_eventManager; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -70,7 +70,7 @@ class RecurringTest extends \PHPUnit_Framework_TestCase $this->_registry = $this->getMock('Magento\Registry', array(), array(), '', false); $this->_eventManager = $this->getMock('Magento\Event\Manager', array(), array(), '', false); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_context = $helper->getObject( 'Magento\Backend\Block\Template\Context', array('eventManager' => $this->_eventManager, 'scopeConfig' => $this->_scopeConfig) diff --git a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/GridTest.php b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/GridTest.php index fc4c66cbb711b1688a6f992063fe454eddacc9fd..1b453affb981b4a00e88a62d9bf9d6940734434d 100644 --- a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/GridTest.php @@ -44,12 +44,7 @@ class GridTest extends \PHPUnit_Framework_TestCase */ public function testPrepareLayout() { - $customer = $this->getMockBuilder( - 'Magento\Customer\Model\Customer' - )->disableOriginalConstructor()->setMethods( - array('getId', '__wakeup') - )->getMock(); - $customer->expects($this->once())->method('getId')->will($this->returnValue(1)); + $customerId = 1; $registry = $this->getMockBuilder( 'Magento\Registry' )->disableOriginalConstructor()->setMethods( @@ -60,9 +55,9 @@ class GridTest extends \PHPUnit_Framework_TestCase )->method( 'registry' )->with( - 'current_customer' + 'current_customer_id' )->will( - $this->returnValue($customer) + $this->returnValue($customerId) ); $store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); $collectionElement = $this->getMockBuilder( diff --git a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/Related/Orders/GridTest.php b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/Related/Orders/GridTest.php index 462d615bec361b14f74fe6044c6d90f0bfe22b00..f8592922375c35d35aad759451f2d1aa3c33bf6b 100644 --- a/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/Related/Orders/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/RecurringPayment/Block/Payment/Related/Orders/GridTest.php @@ -44,8 +44,7 @@ class GridTest extends \PHPUnit_Framework_TestCase */ public function testPrepareLayout() { - $customer = $this->getMock('Magento\Customer\Model\Customer', array(), array(), '', false); - $customer->expects($this->once())->method('getId')->will($this->returnValue(1)); + $customerId = 1; $store = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); $args = array( 'getIncrementId', @@ -85,9 +84,9 @@ class GridTest extends \PHPUnit_Framework_TestCase )->method( 'registry' )->with( - 'current_customer' + 'current_customer_id' )->will( - $this->returnValue($customer) + $this->returnValue($customerId) ); $payment->expects($this->once())->method('setStore')->with($store)->will($this->returnValue($payment)); $storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Review/Block/Adminhtml/MainTest.php b/dev/tests/unit/testsuite/Magento/Review/Block/Adminhtml/MainTest.php index 5e8660335d175f3840523af306baec833c249f0b..168e39dfba4669527460d0013003fa5a44f9403f 100644 --- a/dev/tests/unit/testsuite/Magento/Review/Block/Adminhtml/MainTest.php +++ b/dev/tests/unit/testsuite/Magento/Review/Block/Adminhtml/MainTest.php @@ -34,7 +34,7 @@ class MainTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $request; @@ -51,7 +51,7 @@ class MainTest extends \PHPUnit_Framework_TestCase ->method('getCustomer') ->with('customer id') ->will($this->returnValue(new \Magento\Object())); - $this->request = $this->getMockForAbstractClass('Magento\App\RequestInterface'); + $this->request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); $this->request->expects($this->at(0)) ->method('getParam') ->with('customerId', false) diff --git a/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php b/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php index 50dc3677dc476b2ec64fb640836bcac56356d294..fad3f2f621df31ef0339095901e122394533012d 100644 --- a/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php @@ -60,7 +60,7 @@ class PagerTest extends \PHPUnit_Framework_TestCase ); $contextMock = $this->getMock( - 'Magento\App\Helper\Context', + 'Magento\Framework\App\Helper\Context', array('getModuleManager', 'getRequest'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php index cfd7e6a9abcbfcb22274d24012b5e1f0a7420261..80d85710e37317912948ced64fa4b1c5727f5955 100644 --- a/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php @@ -47,7 +47,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $loggerMock; /** - * @var \Magento\App\Resource|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Resource|\PHPUnit_Framework_MockObject_MockObject */ protected $resourceMock; @@ -71,7 +71,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ); $this->loggerMock = $this->getMock('Magento\Logger', array('log'), array(), '', false); $this->resourceMock = $this->getMock( - 'Magento\App\Resource', array('getConnection', 'getTableName'), array(), '', false + 'Magento\Framework\App\Resource', array('getConnection', 'getTableName'), array(), '', false ); $this->adapterMock = $this->getMock( 'Zend_Db_Adapter_Pdo_Mysql', array('select', 'query'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Rss/Block/Catalog/AbstractCatalogTest.php b/dev/tests/unit/testsuite/Magento/Rss/Block/Catalog/AbstractCatalogTest.php new file mode 100644 index 0000000000000000000000000000000000000000..dac4ddb56a956cdddf2792f3149806ebc28238e9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rss/Block/Catalog/AbstractCatalogTest.php @@ -0,0 +1,73 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Rss\Block\Catalog; + +/** + * Test for rendering price html in rss templates + * + * @package Magento\Rss\Block\Catalog + */ +class AbstractCatalogTest extends \PHPUnit_Framework_TestCase +{ + /** + * test renderPriceHtml function + */ + public function testRenderPriceHtml() + { + $priceHtmlForTest = '<html>Price is 10 for example</html>'; + $templateContextMock = $this->getMock('Magento\View\Element\Template\Context', [], [], '', false); + $httpContextMock = $this->getMock('Magento\Framework\App\Http\Context', [], [], '', false); + $helperMock = $this->getMock('Magento\Catalog\Helper\Data', [], [], '', false); + $productMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); + $layoutMock = $this->getMockForAbstractClass( + 'Magento\View\LayoutInterface', + [], + '', + true, + true, + true, + ['getBlock'] + ); + $priceRendererMock = $this->getMock('Magento\Pricing\Render', ['render'], [], '', false); + + $layoutMock->expects($this->once()) + ->method('getBlock') + ->will($this->returnValue($priceRendererMock)); + $priceRendererMock->expects($this->once()) + ->method('render') + ->will($this->returnValue($priceHtmlForTest)); + + $block = new \Magento\Rss\Block\Catalog\AbstractCatalog( + $templateContextMock, + $httpContextMock, + $helperMock + ); + $block->setLayout($layoutMock); + + $this->assertEquals($priceHtmlForTest, $block->renderPriceHtml($productMock, true)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php index 9b6113da06a74825cd977da94f8bd35dabd05951..4df212e8863ef3389380894974369db3031aec0a 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php @@ -36,7 +36,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $context = $objectManagerHelper->getObject('Magento\View\Element\Template\Context'); - $httpContext = $this->getMockBuilder('\Magento\App\Http\Context') + $httpContext = $this->getMockBuilder('\Magento\Framework\App\Http\Context') ->disableOriginalConstructor() ->setMethods(array('getValue')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php index ef51a31fa2659318ceae6d47dcd167ca4e1ffcbe..b3074f3995a0ef1bd424f2383336304862b86f0f 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php @@ -31,12 +31,12 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase protected $_controller; /** - * @var \Magento\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_responseMock; /** - * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_requestMock; @@ -61,9 +61,9 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase protected function setUp() { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_responseMock = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $this->_responseMock = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $this->_responseMock->headersSentThrowsException = false; - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $constructArguments = $objectManager->getConstructArguments( 'Magento\Backend\Model\Session', diff --git a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/OrderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/OrderTest.php index e5a2767829f8a5d0c6eeb1cb4f21969113ff1b3f..84e46f2701f7db412d4420e5ad5803e9434666fd 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/OrderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/OrderTest.php @@ -75,8 +75,9 @@ class OrderTest extends \PHPUnit_Framework_TestCase array('addError') )->getMock(); - $titleMock = $this->getMock('\Magento\App\Action\Title', array('__wakeup', 'add'), array(), '', false); - $viewMock = $this->getMockForAbstractClass('\Magento\App\ViewInterface'); + $titleMock = + $this->getMock('\Magento\Framework\App\Action\Title', array('__wakeup', 'add'), array(), '', false); + $viewMock = $this->getMockForAbstractClass('\Magento\Framework\App\ViewInterface'); $this->_controllerMock = $this->getMockBuilder( '\Magento\Sales\Controller\Adminhtml\Stub\Order' @@ -110,7 +111,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase )->method( '_initAction' )->will( - $this->throwException(new \Magento\App\Action\Exception($msg)) + $this->throwException(new \Magento\Framework\App\Action\Exception($msg)) ); $this->_orderMock->expects($this->never())->method('getRealOrderId'); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Stub/Order.php b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Stub/Order.php index 20fc6cf501d9f8fae7cd1896373e12bf9d5295df..83b2e08585fab3fa5f3bbe4abb06cabe6fc90a9c 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Stub/Order.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Stub/Order.php @@ -32,12 +32,12 @@ use Magento\Sales\Controller\Adminhtml\Order as OrderController; class Order extends OrderController { /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ public $_title; /** - * @var \Magento\App\Action\Title + * @var \Magento\Framework\App\Action\Title */ public $_view; diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php index 7e0683a308622002c0fbe33a5ebe803bebeb4475..a744eda9518d4d529ae69410d9d3c26f32ef8c52 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php @@ -144,7 +144,7 @@ class CreateTest extends \PHPUnit_Framework_TestCase )->method( 'prepareRequest' )->will( - $this->returnValue($this->getMock('Magento\App\RequestInterface')) + $this->returnValue($this->getMock('Magento\Framework\App\RequestInterface')) ); $customerMock = $this->getMock('Magento\Customer\Service\V1\Data\Customer', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php index 281af4f7ec2d577692292ae4441b334f856668ba..d111a3f8897c5dbf1361e1148de0bc3bc4766834 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/DataTest.php @@ -44,7 +44,7 @@ class DataTest extends \PHPUnit_Framework_TestCase 'Magento\Sales\Model\Config\Reader' )->disableOriginalConstructor()->getMock(); $this->_cacheMock = $this->getMockBuilder( - 'Magento\App\Cache\Type\Config' + 'Magento\Framework\App\Cache\Type\Config' )->disableOriginalConstructor()->getMock(); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/ReaderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/ReaderTest.php index 9dc22a5adbc5ef98d84d0333cb9fe775ff541f7c..f90a84796af1a1001956b5031826fd1702daed8a 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Config/ReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Config/ReaderTest.php @@ -39,7 +39,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $fileResolver = $this->getMockBuilder( - 'Magento\App\Config\FileResolver' + 'Magento\Framework\App\Config\FileResolver' )->disableOriginalConstructor()->getMock(); $converter = $this->getMockBuilder( 'Magento\Sales\Model\Config\Converter' diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/Child/CollectionUpdaterTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/Child/CollectionUpdaterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..be8f99d3b5d6ec8b156163f78f4d039475a44fcc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/Child/CollectionUpdaterTest.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Grid\Child; + +class CollectionUpdaterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Model\Grid\Child\CollectionUpdater + */ + protected $collectionUpdater; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $registryMock; + + + protected function setUp() + { + $this->registryMock = $this->getMock('Magento\Registry', array(), array(), '', false); + + $this->collectionUpdater = new \Magento\Sales\Model\Grid\Child\CollectionUpdater( + $this->registryMock + ); + } + + public function testUpdateIfOrderExists() + { + $collectionMock = $this->getMock( + 'Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection', array(), array(), '', false + ); + $transactionMock = $this->getMock('Magento\Sales\Model\Order\Payment\Transaction', array(), array(), '', false); + $this->registryMock + ->expects($this->once()) + ->method('registry') + ->with('current_transaction') + ->will($this->returnValue($transactionMock)); + $transactionMock->expects($this->once())->method('getId')->will($this->returnValue('transactionId')); + $collectionMock->expects($this->once())->method('addParentIdFilter')->will($this->returnSelf()); + $this->assertEquals($collectionMock, $this->collectionUpdater->update($collectionMock)); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/CollectionUpdaterTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/CollectionUpdaterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7ecdf668c1158791cba837af8d8f6cd63df055b9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Grid/CollectionUpdaterTest.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Grid; + +class CollectionUpdaterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Model\Grid\CollectionUpdater + */ + protected $collectionUpdater; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $registryMock; + + + protected function setUp() + { + $this->registryMock = $this->getMock('Magento\Registry', array(), array(), '', false); + + $this->collectionUpdater = new \Magento\Sales\Model\Grid\CollectionUpdater( + $this->registryMock + ); + } + + public function testUpdateIfOrderNotExists() + { + $collectionMock = $this->getMock( + 'Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection', array(), array(), '', false + ); + $this->registryMock + ->expects($this->once()) + ->method('registry') + ->with('current_order') + ->will($this->returnValue(false)); + $collectionMock->expects($this->never())->method('setOrderFilter'); + $collectionMock + ->expects($this->once()) + ->method('addOrderInformation') + ->with(array('increment_id')) + ->will($this->returnSelf()); + $this->assertEquals($collectionMock, $this->collectionUpdater->update($collectionMock)); + } + + public function testUpdateIfOrderExists() + { + $collectionMock = $this->getMock( + 'Magento\Sales\Model\Resource\Order\Payment\Transaction\Collection', array(), array(), '', false + ); + $orderMock = $this->getMock('Magento\Sales\Model\Order', array(), array(), '', false); + $this->registryMock + ->expects($this->once()) + ->method('registry') + ->with('current_order') + ->will($this->returnValue($orderMock)); + $orderMock->expects($this->once())->method('getId')->will($this->returnValue('orderId')); + $collectionMock->expects($this->once())->method('setOrderFilter')->with('orderId')->will($this->returnSelf()); + $collectionMock + ->expects($this->once()) + ->method('addOrderInformation') + ->with(array('increment_id')) + ->will($this->returnSelf()); + $this->assertEquals($collectionMock, $this->collectionUpdater->update($collectionMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php index 6151193f94906d98c123d49c3eb2e5a2028e1064..391e81a14c9c4b4aad95eac777048abad8c308f6 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/AbstractTest.php @@ -41,9 +41,9 @@ class AbstractTest extends \PHPUnit_Framework_TestCase // Setup most constructor dependencies $paymentData = $this->getMock('Magento\Payment\Helper\Data', array(), array(), '', false); $string = $this->getMock('Magento\Stdlib\String', array(), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $translate = $this->getMock('Magento\Translate\Inline\StateInterface', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $pdfItemsFactory = $this->getMock('Magento\Sales\Model\Order\Pdf\ItemsFactory', array(), array(), '', false); $localeMock = $this->getMock('Magento\Stdlib\DateTime\TimezoneInterface', array(), array(), '', false, false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php index 9b5b11a757c335c0e4fcdcd13c6adddc49d04e2a..8315aaf4200d9ef8e2f53233cea1511321c88ee2 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Pdf/InvoiceTest.php @@ -48,7 +48,7 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase } ) ); - $filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false, false); + $filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false, false); $filesystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($directoryMock)); $filesystemMock->expects($this->any())->method('getDirectoryWrite')->will($this->returnValue($directoryMock)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php index 52e5dc3b1d80aea9e8c18920fc46d80d8bbc08b6..85b97e17805d8dfd72bac59f969709e64c10da0f 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php @@ -30,7 +30,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Sales\Model\Order\Total\Config\Base */ protected $object; - /** @var \Magento\App\Cache\Type\Config|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Cache\Type\Config|\PHPUnit_Framework_MockObject_MockObject */ protected $configCacheType; /** @var \Magento\Logger|\PHPUnit_Framework_MockObject_MockObject */ @@ -44,7 +44,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->configCacheType = $this->getMock('Magento\App\Cache\Type\Config', [], [], '', false); + $this->configCacheType = $this->getMock('Magento\Framework\App\Cache\Type\Config', [], [], '', false); $this->logger = $this->getMock('Magento\Logger', [], [], '', false); $this->salesConfig = $this->getMock('Magento\Sales\Model\Config', [], [], '', false); $this->orderTotalFactory = $this->getMock('Magento\Sales\Model\Order\TotalFactory', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/QuoteTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/QuoteTest.php index 9aee67b676a9a2eec28709b229874ac87c046117..ad72435f678054ae16cd65487d94374c67eb6b2d 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/QuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/QuoteTest.php @@ -34,7 +34,7 @@ class QuoteTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resourceMock; @@ -62,7 +62,7 @@ class QuoteTest extends \PHPUnit_Framework_TestCase $this->_adapterMock = $this->getMock('\Magento\DB\Adapter\Pdo\Mysql', array(), array(), '', false); $this->_adapterMock->expects($this->any())->method('select')->will($this->returnValue($this->_selectMock)); - $this->_resourceMock = $this->getMock('\Magento\App\Resource', array(), array(), '', false); + $this->_resourceMock = $this->getMock('\Magento\Framework\App\Resource', array(), array(), '', false); $this->_resourceMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/RuleTest.php b/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/RuleTest.php index 24e8e733814d053f99eac10fe5c424bdbe4fc425..32851c42784c0200ee9f511c7a4f4cc451624c50 100644 --- a/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/RuleTest.php +++ b/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/RuleTest.php @@ -72,7 +72,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase ); $resourceMock = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getConnection', 'getTableName'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Session/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Session/ConfigTest.php index 9e07ba529dbbbb6574690bbadc2eb1e7da2d119a..6730747bf8d386111f12a8f64c51a8d3b60333c8 100644 --- a/dev/tests/unit/testsuite/Magento/Session/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Session/ConfigTest.php @@ -35,7 +35,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $config; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_configMock; @@ -45,27 +45,27 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_stringHelperMock; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_requestMock; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; protected function setUp() { - $this->_configMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_stringHelperMock = $this->getMock('\Magento\Stdlib\String', array(), array(), '', false, false); $this->_requestMock = $this->getMock( - '\Magento\App\Request\Http', + '\Magento\Framework\App\Request\Http', array('getBasePath', 'isSecure', 'getHttpHost'), array(), '', @@ -80,9 +80,9 @@ class ConfigTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue('init.host') ); - $this->_appState = $this->getMock('\Magento\App\State', array('isInstalled'), array(), '', false, false); + $this->_appState = $this->getMock('\Magento\Framework\App\State', array('isInstalled'), array(), '', false, false); $this->_appState->expects($this->atLeastOnce())->method('isInstalled')->will($this->returnValue(true)); - $this->_filesystem = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false, false); + $this->_filesystem = $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false, false); $this->config = new \Magento\Session\Config( $this->_configMock, diff --git a/dev/tests/unit/testsuite/Magento/Session/SaveHandler/DbTableTest.php b/dev/tests/unit/testsuite/Magento/Session/SaveHandler/DbTableTest.php index e6504acfbca0efd45052c143a8c4c465b7906866..22818823ccf6d6d34ff177770ca1d8f362daec8e 100644 --- a/dev/tests/unit/testsuite/Magento/Session/SaveHandler/DbTableTest.php +++ b/dev/tests/unit/testsuite/Magento/Session/SaveHandler/DbTableTest.php @@ -97,7 +97,7 @@ class DbTableTest extends \PHPUnit_Framework_TestCase ); $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', @@ -121,7 +121,7 @@ class DbTableTest extends \PHPUnit_Framework_TestCase public function testCheckConnectionNoConnection() { $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', @@ -156,7 +156,7 @@ class DbTableTest extends \PHPUnit_Framework_TestCase ); $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', @@ -193,7 +193,7 @@ class DbTableTest extends \PHPUnit_Framework_TestCase protected function _prepareResourceMock($connection) { $resource = $this->getMock( - 'Magento\App\Resource', + 'Magento\Framework\App\Resource', array('getTableName', 'getConnection'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Helper/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Helper/CarrierTest.php index 85dee75b273fba8a3f055535b2380d7b7cb171ee..cbc7c19c378bad1aba49603245500db0775022ee 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Helper/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Helper/CarrierTest.php @@ -42,12 +42,12 @@ class CarrierTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->helper = $objectManagerHelper->getObject( 'Magento\Shipping\Helper\Carrier', array( - 'context' => $this->getMock('Magento\App\Helper\Context', array(), array(), '', false), + 'context' => $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false), 'locale' => $this->getMock('Magento\LocaleInterface'), 'scopeConfig' => $this->scopeConfig ) diff --git a/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php b/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php index 615893e4b314d5374a59df4acb3fab7abda2ac7d..8eea8b3522f7629262882a6926d2f62531d6328a 100644 --- a/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php +++ b/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php @@ -62,7 +62,7 @@ class SitemapTest extends \PHPUnit_Framework_TestCase protected $_sitemapCmsPageMock; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystemMock; @@ -157,7 +157,7 @@ class SitemapTest extends \PHPUnit_Framework_TestCase $this->_directoryMock->expects($this->any())->method('openFile')->will($this->returnValue($this->_fileMock)); $this->_filesystemMock = $this->getMockBuilder( - 'Magento\App\Filesystem' + 'Magento\Framework\App\Filesystem' )->setMethods( array('getDirectoryWrite') )->disableOriginalConstructor()->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/StoreCheckTest.php b/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/StoreCheckTest.php index 3443b34f0dbd793382662857682ff9b5742d822d..0d0615ad846d298c98249562d9b43540ea539915 100644 --- a/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/StoreCheckTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/StoreCheckTest.php @@ -66,11 +66,11 @@ class StoreCheckTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_storeMock) ); - $this->subjectMock = $this->getMock('Magento\App\Action\Action', array(), array(), '', false); + $this->subjectMock = $this->getMock('Magento\Framework\App\Action\Action', array(), array(), '', false); $this->closureMock = function () { return 'Expected'; }; - $this->requestMock = $this->getMock('Magento\App\RequestInterface'); + $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->_plugin = new \Magento\Store\App\Action\Plugin\StoreCheck($this->_storeManagerMock); } diff --git a/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandlerTest.php b/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandlerTest.php index 81faddb08796efd6e6078dba8baa4d626c985a1d..6a742aa424136983b7f785f16892796d90456a37 100644 --- a/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandlerTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/DispatchExceptionHandlerTest.php @@ -53,17 +53,17 @@ class DispatchExceptionHandlerTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManager', array(), array(), '', false); - $this->_filesystemMock = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false); $this->closureMock = function () { return 'Expected'; }; - $this->subjectMock = $this->getMock('Magento\App\FrontController', array(), array(), '', false); + $this->subjectMock = $this->getMock('Magento\Framework\App\FrontController', array(), array(), '', false); $this->_model = new DispatchExceptionHandler($this->_storeManagerMock, $this->_filesystemMock); } public function testAroundDispatch() { - $requestMock = $this->getMock('Magento\App\RequestInterface'); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); $this->assertEquals( 'Expected', $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $requestMock) diff --git a/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/RequestPreprocessorTest.php b/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/RequestPreprocessorTest.php index 56ebeac3538c9c40fd6f5bd817757342afaf53bd..2b1c2933a76a89d0088015c4aedd22fcb17f90a4 100644 --- a/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/RequestPreprocessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/App/FrontController/Plugin/RequestPreprocessorTest.php @@ -73,21 +73,21 @@ class RequestPreprocessorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_storeMock = $this->getMock('\Magento\Store\Model\Store', array(), array(), '', false); - $this->_requestMock = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $this->closureMock = function () { return 'Expected'; }; $this->_storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManager', array(), array(), '', false); - $this->_appStateMock = $this->getMock('\Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $this->_urlMock = $this->getMock('\Magento\Url', array(), array(), '', false); - $this->_scopeConfigMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); - $this->subjectMock = $this->getMock('Magento\App\FrontController', array(), array(), '', false); + $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); + $this->subjectMock = $this->getMock('Magento\Framework\App\FrontController', array(), array(), '', false); $this->_model = new \Magento\Store\App\FrontController\Plugin\RequestPreprocessor( $this->_storeManagerMock, $this->_appStateMock, $this->_urlMock, $this->_scopeConfigMock, - $this->getMock('\Magento\App\ResponseFactory', array(), array(), '', false) + $this->getMock('\Magento\Framework\App\ResponseFactory', array(), array(), '', false) ); } diff --git a/dev/tests/unit/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php b/dev/tests/unit/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php index 76cfde72c29f78d0149fae2794a0a125aa369bb8..a1319beb297842a5ed0852278d14bce7b22f239d 100644 --- a/dev/tests/unit/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php @@ -48,7 +48,7 @@ class PathInfoProcessorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_requestMock = $this->getMock( - '\Magento\App\RequestInterface', + '\Magento\Framework\App\RequestInterface', array( 'isDirectAccessFrontendName', 'getModuleName', diff --git a/dev/tests/unit/testsuite/Magento/Store/Helper/CookieTest.php b/dev/tests/unit/testsuite/Magento/Store/Helper/CookieTest.php index 70404025e3a94d0cf1fd45745be2c5f752bdd0f9..e36b7727c89f0bcda8b291b147e556fd5625ae5e 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Helper/CookieTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Helper/CookieTest.php @@ -31,7 +31,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase protected $_object; /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $_request; @@ -44,9 +44,10 @@ class CookieTest extends \PHPUnit_Framework_TestCase { $this->_initMock()->_getCookieStub(array(1 => 1)); $this->assertFalse($this->_object->isUserNotAllowSaveCookie()); - $request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), array(), '', false, false); + $request = $this->getMock('\Magento\Framework\App\Request\Http', array('getCookie'), array(), '', false, false); $request->expects($this->any())->method('getCookie')->will($this->returnValue(json_encode(array()))); - $context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $context = + $this->getMock('Magento\Framework\App\Helper\Context', array('getRequest'), array(), '', false, false); $context->expects($this->once())->method('getRequest')->will($this->returnValue($request)); $this->_object = new \Magento\Store\Helper\Cookie( $context, @@ -65,10 +66,12 @@ class CookieTest extends \PHPUnit_Framework_TestCase public function testGetCookieRestrictionLifetime() { - $this->_request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), array(), '', false, false); - $this->_context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $this->_request = + $this->getMock('\Magento\Framework\App\Request\Http', array('getCookie'), array(), '', false, false); + $this->_context = + $this->getMock('Magento\Framework\App\Helper\Context', array('getRequest'), array(), '', false, false); $this->_context->expects($this->once())->method('getRequest')->will($this->returnValue($this->_request)); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $storeStub = $this->_getStoreStub(); $scopeConfig->expects( $this->once() @@ -90,8 +93,10 @@ class CookieTest extends \PHPUnit_Framework_TestCase protected function _initMock() { - $this->_request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), array(), '', false, false); - $this->_context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $this->_request = + $this->getMock('\Magento\Framework\App\Request\Http', array('getCookie'), array(), '', false, false); + $this->_context = + $this->getMock('Magento\Framework\App\Helper\Context', array('getRequest'), array(), '', false, false); $this->_context->expects($this->once())->method('getRequest')->will($this->returnValue($this->_request)); $this->_object = new \Magento\Store\Helper\Cookie( $this->_context, @@ -119,7 +124,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase */ protected function _getConfigStub() { - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $scopeConfig->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Processor/PlaceholderTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Processor/PlaceholderTest.php index b8e46bd7140ff66b2013be6063d3cf8d866a2623..e33cacb0f093413428e7f6322f856e1203f91637 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Processor/PlaceholderTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Processor/PlaceholderTest.php @@ -37,7 +37,7 @@ class PlaceholderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_requestMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/DefaultReaderTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/DefaultReaderTest.php index 0a78e51cbe0f01b0e4dd5e1192bd398ea4ce7c74..5007242be824504fa8d1f796bd9831dd7138f8a4 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/DefaultReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/DefaultReaderTest.php @@ -47,7 +47,7 @@ class DefaultReaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_initialConfigMock = $this->getMock('Magento\App\Config\Initial', array(), array(), '', false); + $this->_initialConfigMock = $this->getMock('Magento\Framework\App\Config\Initial', array(), array(), '', false); $this->_collectionFactory = $this->getMock( 'Magento\Store\Model\Resource\Config\Collection\ScopedFactory', array('create'), @@ -55,11 +55,11 @@ class DefaultReaderTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); $this->_model = new \Magento\Store\Model\Config\Reader\DefaultReader( $this->_initialConfigMock, - new \Magento\App\Config\Scope\Converter(), + new \Magento\Framework\App\Config\Scope\Converter(), $this->_collectionFactory, $this->_appStateMock ); @@ -72,7 +72,7 @@ class DefaultReaderTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - \Magento\App\ScopeInterface::SCOPE_DEFAULT + \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT )->will( $this->returnValue(array('config' => array('key1' => 'default_value1', 'key2' => 'default_value2'))) ); diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/StoreTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/StoreTest.php index 0eebe76f63c7167739d91f3a3fb1aa7536eecb56..125c077178861d3e702fbec5ad5ba4d37e688a1f 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/StoreTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/StoreTest.php @@ -31,7 +31,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopePullMock; @@ -57,27 +57,27 @@ class StoreTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_scopePullMock = $this->getMock('Magento\App\Config\ScopePool', array(), array(), '', false); + $this->_scopePullMock = $this->getMock('Magento\Framework\App\Config\ScopePool', [], [], '', false); $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $this->_initialConfigMock = $this->getMock('Magento\App\Config\Initial', array(), array(), '', false); + $this->_initialConfigMock = $this->getMock('Magento\Framework\App\Config\Initial', [], [], '', false); $this->_collectionFactory = $this->getMock( 'Magento\Store\Model\Resource\Config\Collection\ScopedFactory', - array('create'), - array(), + ['create'], + [], '', false ); - $storeFactoryMock = $this->getMock('Magento\Store\Model\StoreFactory', array('create'), array(), '', false); - $this->_storeMock = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); + $storeFactoryMock = $this->getMock('Magento\Store\Model\StoreFactory', ['create'], [], '', false); + $this->_storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $storeFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->_storeMock)); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', [], [], '', false); $this->_appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); $placeholderProcessor = $this->getMock( 'Magento\Store\Model\Config\Processor\Placeholder', - array(), - array(), + [], + [], '', false ); @@ -102,19 +102,20 @@ class StoreTest extends \PHPUnit_Framework_TestCase { $websiteCode = 'default'; $storeId = 1; - $websiteMock = $this->getMock('Magento\Store\Model\Website', array(), array(), '', false); + $websiteMock = $this->getMock('Magento\Store\Model\Website', [], [], '', false); $websiteMock->expects($this->any())->method('getCode')->will($this->returnValue($websiteCode)); $this->_storeMock->expects($this->any())->method('getWebsite')->will($this->returnValue($websiteMock)); $this->_storeMock->expects($this->any())->method('load')->with($storeCode); $this->_storeMock->expects($this->any())->method('getId')->will($this->returnValue($storeId)); + $this->_storeMock->expects($this->any())->method('getCode')->will($this->returnValue($websiteCode)); - $dataMock = $this->getMock('Magento\App\Config\Data', array(), array(), '', false); + $dataMock = $this->getMock('Magento\Framework\App\Config\Data', [], [], '', false); $dataMock->expects( $this->any() )->method( 'getValue' )->will( - $this->returnValue(array('config' => array('key0' => 'website_value0', 'key1' => 'website_value1'))) + $this->returnValue(['config' => ['key0' => 'website_value0', 'key1' => 'website_value1']]) ); $dataMock->expects( @@ -122,7 +123,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase )->method( 'getSource' )->will( - $this->returnValue(array('config' => array('key0' => 'website_value0', 'key1' => 'website_value1'))) + $this->returnValue(['config' => ['key0' => 'website_value0', 'key1' => 'website_value1']]) ); $this->_scopePullMock->expects( $this->once() @@ -142,20 +143,20 @@ class StoreTest extends \PHPUnit_Framework_TestCase )->with( "stores|{$storeCode}" )->will( - $this->returnValue(array('config' => array('key1' => 'store_value1', 'key2' => 'store_value2'))) + $this->returnValue(['config' => ['key1' => 'store_value1', 'key2' => 'store_value2']]) ); $this->_collectionFactory->expects( $this->once() )->method( 'create' )->with( - array('scope' => 'stores', 'scopeId' => $storeId) + ['scope' => 'stores', 'scopeId' => $storeId] )->will( $this->returnValue( - array( - new \Magento\Object(array('path' => 'config/key1', 'value' => 'store_db_value1')), - new \Magento\Object(array('path' => 'config/key3', 'value' => 'store_db_value3')) - ) + [ + new \Magento\Object(['path' => 'config/key1', 'value' => 'store_db_value1']), + new \Magento\Object(['path' => 'config/key3', 'value' => 'store_db_value3']) + ] ) ); $this->_storeManagerMock->expects( @@ -165,19 +166,19 @@ class StoreTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue($this->_storeMock) ); - $expectedData = array( - 'config' => array( + $expectedData = [ + 'config' => [ 'key0' => 'website_value0', 'key1' => 'store_db_value1', 'key2' => 'store_value2', 'key3' => 'store_db_value3' - ) - ); + ] + ]; $this->assertEquals($expectedData, $this->_model->read($storeCode)); } public function readDataProvider() { - return array(array('default', $this->never()), array(null, $this->once())); + return [['default', $this->never()], [null, $this->once()]]; } } diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/WebsiteTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/WebsiteTest.php index 65663a36c08aabe5f9da4b49fca214c6855bb479..1fd70e61438cf55594cd7eaf8bc58e4ffde7e53e 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/WebsiteTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/Config/Reader/WebsiteTest.php @@ -36,7 +36,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase protected $_initialConfigMock; /** - * @var \Magento\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopePool|\PHPUnit_Framework_MockObject_MockObject */ protected $_scopePullMock; @@ -57,8 +57,8 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_initialConfigMock = $this->getMock('Magento\App\Config\Initial', array(), array(), '', false); - $this->_scopePullMock = $this->getMock('Magento\App\Config\ScopePool', array(), array(), '', false); + $this->_initialConfigMock = $this->getMock('Magento\Framework\App\Config\Initial', array(), array(), '', false); + $this->_scopePullMock = $this->getMock('Magento\Framework\App\Config\ScopePool', array(), array(), '', false); $this->_collectionFactory = $this->getMock( 'Magento\Store\Model\Resource\Config\Collection\ScopedFactory', array('create'), @@ -76,13 +76,13 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase $this->_websiteMock = $this->getMock('Magento\Store\Model\Website', array(), array(), '', false); $websiteFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->_websiteMock)); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); $this->_model = new \Magento\Store\Model\Config\Reader\Website( $this->_initialConfigMock, $this->_scopePullMock, - new \Magento\App\Config\Scope\Converter(), + new \Magento\Framework\App\Config\Scope\Converter(), $this->_collectionFactory, $websiteFactoryMock, $this->_appStateMock @@ -94,7 +94,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase $websiteCode = 'default'; $websiteId = 1; - $dataMock = $this->getMock('Magento\App\Config\Data', array(), array(), '', false); + $dataMock = $this->getMock('Magento\Framework\App\Config\Data', array(), array(), '', false); $dataMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php index dbf53b651f32d7139a0367af4128c7ab32d9c318..f8388fe4a9186b87553e0f955db47c482c518a79 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php @@ -63,7 +63,7 @@ class StorageFactoryTest extends \PHPUnit_Framework_TestCase protected $_cookie; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $_httpContext; @@ -99,11 +99,11 @@ class StorageFactoryTest extends \PHPUnit_Framework_TestCase $this->_eventManagerMock = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $this->_logMock = $this->getMock('Magento\Logger', array(), array(), '', false); $this->_sidResolverMock = $this->getMock('\Magento\Session\SidResolverInterface', array(), array(), '', false); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_storage = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->_cookie = $this->getMock('Magento\Stdlib\Cookie', array(), array(), '', false); - $this->_httpContext = $this->getMock('Magento\App\Http\Context', array(), array(), '', false); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_httpContext = $this->getMock('Magento\Framework\App\Http\Context', array(), array(), '', false); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\Store\Model\StorageFactory( $this->_objectManagerMock, diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StoreManagerTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StoreManagerTest.php index 6a64d1047a23e15338851c55cdcd648fcad0d986..50d16b5baae291b37a629e1497cc54c989cd4ac9 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StoreManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StoreManagerTest.php @@ -55,7 +55,7 @@ class StoreManagerTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_factoryMock = $this->getMock('Magento\Store\Model\StorageFactory', array(), array(), '', false); - $this->_requestMock = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_requestMock = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $this->_helperMock = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_storage = $this->getMock('Magento\Store\Model\StoreManagerInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StoresConfigTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StoresConfigTest.php index dfbb7b0f3450a96a9c86cfbebba9e2c7b4ff98c5..4dd12f82ca32baa3d9fb03d947c744394c27b7a0 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StoresConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StoresConfigTest.php @@ -59,7 +59,7 @@ class StoresConfigTest extends \PHPUnit_Framework_TestCase $this->_storeOne = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); $this->_storeTwo = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); $this->_storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $this->_config = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_config = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_model = new \Magento\Store\Model\StoresConfig( $this->_storeManager, diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php index b2d4be0733b5a458bff11123fa3a8784a84985d7..8a41d396ec247057b42096d5a9b8f737d50e04af 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php @@ -28,37 +28,52 @@ namespace Magento\Tax\Model\TaxClass\Type; class CustomerTest extends \PHPUnit_Framework_TestCase { - public function testGetAssignedObjects() + public function testIsAssignedToObjects() { - $collectionMock = $this->getMockBuilder( - 'Magento\Model\Resource\Db\Collection\AbstractCollection' - )->setMethods( - array('addFieldToFilter') - )->disableOriginalConstructor()->getMock(); - $collectionMock->expects( - $this->once() - )->method( - 'addFieldToFilter' - )->with( - $this->equalTo('tax_class_id'), - $this->equalTo(5) - )->will( - $this->returnSelf() + $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + + $searchResultsMock = $this->getMockBuilder('Magento\Service\V1\Data\SearchResults') + ->setMethods(['getItems']) + ->disableOriginalConstructor() + ->getMock(); + $searchResultsMock->expects($this->once()) + ->method('getItems') + ->will($this->returnValue(['randomValue'])); + + $filterBuilder = $objectManagerHelper + ->getObject('\Magento\Service\V1\Data\FilterBuilder'); + $filterGroupBuilder = $objectManagerHelper + ->getObject('\Magento\Service\V1\Data\Search\FilterGroupBuilder'); + $searchCriteriaBuilder = $objectManagerHelper->getObject( + 'Magento\Service\V1\Data\SearchCriteriaBuilder', + [ + 'filterGroupBuilder' => $filterGroupBuilder + ] ); + $expectedSearchCriteria = $searchCriteriaBuilder + ->addFilter([$filterBuilder->setField('tax_class_id')->setValue(5)->create()]) + ->create(); - $customerGroupMock = $this->getMockBuilder( - 'Magento\Customer\Model\Group' - )->setMethods( - array('getCollection', '__wakeup') - )->disableOriginalConstructor()->getMock(); - $customerGroupMock->expects($this->once())->method('getCollection')->will($this->returnValue($collectionMock)); + $customerGroupServiceMock = $this->getMockBuilder('Magento\Customer\Service\V1\CustomerGroupService') + ->setMethods(['searchGroups']) + ->disableOriginalConstructor() + ->getMock(); + $customerGroupServiceMock->expects($this->once()) + ->method('searchGroups') + ->with($this->equalTo($expectedSearchCriteria)) + ->will($this->returnValue($searchResultsMock)); - $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); /** @var $model \Magento\Tax\Model\TaxClass\Type\Customer */ $model = $objectManagerHelper->getObject( 'Magento\Tax\Model\TaxClass\Type\Customer', - array('modelCustomerGroup' => $customerGroupMock, 'data' => array('id' => 5)) + [ + 'groupService' => $customerGroupServiceMock, + 'filterBuilder' => $filterBuilder, + 'searchCriteriaBuilder' => $searchCriteriaBuilder, + 'data' => ['id' => 5] + ] ); - $this->assertEquals($collectionMock, $model->getAssignedToObjects()); + + $this->assertTrue($model->isAssignedToObjects()); } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php index b6a2f3ac5b6fe191297671fa7dd53abc2b2c28d8..d8d16cb0e2130a7ee0cc6e988517799f310adbbd 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php @@ -28,29 +28,18 @@ namespace Magento\Tax\Model\TaxClass\Type; class ProductTest extends \PHPUnit_Framework_TestCase { - public function testGetAssignedObjects() + public function testIsAssignedToObjects() { - $collectionMock = $this->getMockBuilder( - 'Magento\Model\Resource\Db\Collection\AbstractCollection' - )->setMethods( - array('addAttributeToFilter') - )->disableOriginalConstructor()->getMock(); - $collectionMock->expects( - $this->once() - )->method( - 'addAttributeToFilter' - )->with( - $this->equalTo('tax_class_id'), - $this->equalTo(1) - )->will( - $this->returnSelf() - ); + $collectionMock = $this->getMockBuilder('Magento\Model\Resource\Db\Collection\AbstractCollection') + ->setMethods(['addAttributeToFilter', 'getSize'])->disableOriginalConstructor()->getMock(); + $collectionMock->expects($this->once())->method('addAttributeToFilter') + ->with($this->equalTo('tax_class_id'), $this->equalTo(1))->will($this->returnSelf()); + $collectionMock->expects($this->once())->method('getSize') + ->will($this->returnValue(1)); - $productMock = $this->getMockBuilder( - 'Magento\Catalog\Model\Product' - )->setMethods( - array('getCollection', '__wakeup') - )->disableOriginalConstructor()->getMock(); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getCollection', '__wakeup', 'getEntityId']) + ->disableOriginalConstructor()->getMock(); $productMock->expects($this->once())->method('getCollection')->will($this->returnValue($collectionMock)); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -59,6 +48,6 @@ class ProductTest extends \PHPUnit_Framework_TestCase 'Magento\Tax\Model\TaxClass\Type\Product', array('modelProduct' => $productMock, 'data' => array('id' => 1)) ); - $this->assertEquals($collectionMock, $model->getAssignedToObjects()); + $this->assertTrue($model->isAssignedToObjects()); } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..08e96ad785be61db3a2f3552552f05686f8db314 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php @@ -0,0 +1,226 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Tax\Pricing; + +use Magento\Tax\Helper\Data as TaxHelper; +use Magento\Pricing\Object\SaleableInterface; + +class AdjustmentTest extends \PHPUnit_Framework_TestCase +{ + public function testGetAdjustmentCode() + { + // Instantiate/mock objects + /** @var TaxHelper $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor() + ->setMethods(array()) + ->getMock(); + $model = new Adjustment($taxHelper); + + // Run tested method + $code = $model->getAdjustmentCode(); + + // Check expectations + $this->assertNotEmpty($code); + } + + /** + * @param bool $isPriceIncludesTax + * @dataProvider isIncludedInBasePriceDataProvider + */ + public function testIsIncludedInBasePrice($isPriceIncludesTax) + { + // Instantiate/mock objects + /** @var TaxHelper|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('priceIncludesTax')) + ->getMock(); + $model = new Adjustment($taxHelper); + + // Avoid execution of irrelevant functionality + $taxHelper->expects($this->any())->method('priceIncludesTax')->will($this->returnValue($isPriceIncludesTax)); + + // Run tested method + $result = $model->isIncludedInBasePrice(); + + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertEquals($isPriceIncludesTax, $result); + } + + public function isIncludedInBasePriceDataProvider() + { + return [[true], [false]]; + } + + /** + * @dataProvider isIncludedInDisplayPriceDataProvider + */ + public function testIsIncludedInDisplayPrice($displayPriceIncludingTax, $displayBothPrices, $expectedResult) + { + // Instantiate/mock objects + /** @var TaxHelper|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('displayPriceIncludingTax', 'displayBothPrices')) + ->getMock(); + + // Avoid execution of irrelevant functionality + $taxHelper->expects($this->any()) + ->method('displayPriceIncludingTax') + ->will($this->returnValue($displayPriceIncludingTax)); + $taxHelper->expects($this->any()) + ->method('displayBothPrices') + ->will($this->returnValue($displayBothPrices)); + + $model = new Adjustment($taxHelper); + // Run tested method + $result = $model->isIncludedInDisplayPrice(); + + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function isIncludedInDisplayPriceDataProvider() + { + return [ + [false, false, false], + [false, true, true], + [true, false, true], + [true, true, true], + ]; + } + + /** + * @param float $amount + * @param bool $isPriceIncludesTax + * @param float $price + * @param float $expectedResult + * @dataProvider extractAdjustmentDataProvider + */ + public function testExtractAdjustment($isPriceIncludesTax, $amount, $price, $expectedResult) + { + // Instantiate/mock objects + /** @var TaxHelper|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('priceIncludesTax', 'getPrice')) + ->getMock(); + /** @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $object = $this->getMockBuilder('Magento\Pricing\Object\SaleableInterface')->getMock(); + $model = new Adjustment($taxHelper); + + // Avoid execution of irrelevant functionality + $taxHelper->expects($this->any()) + ->method('priceIncludesTax') + ->will($this->returnValue($isPriceIncludesTax)); + $taxHelper->expects($this->any()) + ->method('getPrice') + ->with($object, $amount) + ->will($this->returnValue($price)); + + // Run tested method + $result = $model->extractAdjustment($amount, $object); + + // Check expectations + $this->assertInternalType('float', $result); + $this->assertEquals($expectedResult, $result); + } + + public function extractAdjustmentDataProvider() + { + return [ + [false, 'not_important', 'not_important', 0.00], + [true, 10.1, 0.2, 9.9], + [true, 10.1, 20.3, -10.2], + [true, 0.0, 0.0, 0], + ]; + } + + /** + * @param bool $isPriceIncludesTax + * @param float $amount + * @param float $price + * @param $expectedResult + * @dataProvider applyAdjustmentDataProvider + */ + public function testApplyAdjustment($isPriceIncludesTax, $amount, $price, $expectedResult) + { + // Instantiate/mock objects + /** @var TaxHelper|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('priceIncludesTax', 'getPrice')) + ->getMock(); + /** @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $object = $this->getMockBuilder('Magento\Pricing\Object\SaleableInterface')->getMock(); + $model = new Adjustment($taxHelper); + + // Avoid execution of irrelevant functionality + $taxHelper->expects($this->any()) + ->method('priceIncludesTax') + ->will($this->returnValue($isPriceIncludesTax)); + $taxHelper->expects($this->any()) + ->method('getPrice') + ->with($object, $amount, !$isPriceIncludesTax) + ->will($this->returnValue($price)); + + // Run tested method + $result = $model->applyAdjustment($amount, $object); + + // Check expectations + $this->assertInternalType('float', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function applyAdjustmentDataProvider() + { + return [ + [true, 1.1, 2.2, 2.2], + [true, 0.0, 2.2, 2.2], + [true, 1.1, 0.0, 0.0], + ]; + } + + public function testIsExcludedWith() + { + $adjustmentCode = 'some_random_adjustment_code123'; + + // Instantiate/mock objects + /** @var TaxHelper|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $taxHelper = $this->getMockBuilder('Magento\Tax\Helper\Data')->disableOriginalConstructor()->getMock(); + $model = new Adjustment($taxHelper); + + // Run tested method + $result = $model->isExcludedWith($adjustmentCode); + + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertFalse($result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Pricing/Render/AdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Tax/Pricing/Render/AdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a8826a297700c76045cffbd5d33f4571d0d927f3 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Pricing/Render/AdjustmentTest.php @@ -0,0 +1,295 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Tax\Pricing\Render; + +class AdjustmentTest extends \PHPUnit_Framework_TestCase +{ + /** + * Context mock + * + * @var \Magento\View\Element\Template\Context + */ + protected $contextMock; + + /** + * Price currency model mock + * + * @var \Magento\Directory\Model\PriceCurrency + */ + protected $priceCurrencyMock; + + /** + * Price helper mock + * + * @var \Magento\Tax\Helper\Data + */ + protected $taxHelperMock; + + /** + * @var \Magento\Tax\Pricing\Render\Adjustment + */ + protected $model; + + /** + * Init mocks and model + */ + public function setUp() + { + $this->contextMock = $this->getMock( + 'Magento\View\Element\Template\Context', + ['getEventManager', 'getStoreConfig', 'getScopeConfig'], + [], + '', + false + ); + $this->priceCurrencyMock = $this->getMock('Magento\Directory\Model\PriceCurrency', [], [], '', false); + $this->taxHelperMock = $this->getMock( + 'Magento\Tax\Helper\Data', + [], + [], + '', + false + ); + + $eventManagerMock = $this->getMockBuilder('Magento\Event\ManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $storeConfigMock = $this->getMockBuilder('Magento\Store\Model\Store\Config') + ->disableOriginalConstructor() + ->getMock(); + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + + $this->contextMock->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManagerMock)); + $this->contextMock->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($storeConfigMock)); + $this->contextMock->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + $this->model = new Adjustment( + $this->contextMock, + $this->priceCurrencyMock, + $this->taxHelperMock + ); + } + + /** + * Test for method getAdjustmentCode + */ + public function testGetAdjustmentCode() + { + $this->assertEquals(\Magento\Tax\Pricing\Adjustment::CODE, $this->model->getAdjustmentCode()); + } + + /** + * Test for method displayBothPrices + */ + public function testDisplayBothPrices() + { + $shouldDisplayBothPrices = true; + $this->taxHelperMock->expects($this->once()) + ->method('displayBothPrices') + ->will($this->returnValue($shouldDisplayBothPrices)); + $this->assertEquals($shouldDisplayBothPrices, $this->model->displayBothPrices()); + } + + /** + * Test for method getDisplayAmountExclTax + */ + public function testGetDisplayAmountExclTax() + { + $expectedPriceValue = 1.23; + $expectedPrice = '$4.56'; + + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getAmount']) + ->getMock(); + + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + + $baseAmount->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($expectedPriceValue)); + + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + + $this->priceCurrencyMock->expects($this->any()) + ->method('convertAndFormat') + ->will($this->returnValue($expectedPrice)); + + $this->model->render($amountRender); + $result = $this->model->getDisplayAmountExclTax(); + + $this->assertEquals($expectedPrice, $result); + } + + /** + * Test for method getDisplayAmount + * + * @param bool $includeContainer + * @dataProvider getDisplayAmountDataProvider + */ + public function testGetDisplayAmount($includeContainer) + { + $expectedPriceValue = 1.23; + $expectedPrice = '$4.56'; + + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getAmount']) + ->getMock(); + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + + $baseAmount->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($expectedPriceValue)); + + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + + $this->priceCurrencyMock->expects($this->any()) + ->method('convertAndFormat') + ->with($this->anything(), $this->equalTo($includeContainer)) + ->will($this->returnValue($expectedPrice)); + + $this->model->render($amountRender); + $result = $this->model->getDisplayAmount($includeContainer); + + $this->assertEquals($expectedPrice, $result); + } + + /** + * Data provider for testGetDisplayAmount + * + * @return array + */ + public function getDisplayAmountDataProvider() + { + return [[true], [false]]; + } + + /** + * Test for method buildIdWithPrefix + * + * @param string $prefix + * @param null|false|int $saleableId + * @param null|false|string $suffix + * @param string $expectedResult + * @dataProvider buildIdWithPrefixDataProvider + */ + public function testBuildIdWithPrefix($prefix, $saleableId, $suffix, $expectedResult) + { + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getSaleableItem']) + ->getMock(); + + /** @var \Magento\Catalog\Model\Product $saleable */ + $saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['getId', '__wakeup']) + ->getMock(); + + $amountRender->expects($this->any()) + ->method('getSaleableItem') + ->will($this->returnValue($saleable)); + $saleable->expects($this->any()) + ->method('getId') + ->will($this->returnValue($saleableId)); + + $this->model->setIdSuffix($suffix); + $this->model->render($amountRender); + $result = $this->model->buildIdWithPrefix($prefix); + + $this->assertEquals($expectedResult, $result); + } + + /** + * data provider for testBuildIdWithPrefix + * + * @return array + */ + public function buildIdWithPrefixDataProvider() + { + return [ + ['some_prefix_', null, '_suffix', 'some_prefix__suffix'], + ['some_prefix_', false, '_suffix', 'some_prefix__suffix'], + ['some_prefix_', 123, '_suffix', 'some_prefix_123_suffix'], + ['some_prefix_', 123, null, 'some_prefix_123'], + ['some_prefix_', 123, false, 'some_prefix_123'], + ]; + } + + /** + * test for method displayPriceIncludingTax + */ + public function testDisplayPriceIncludingTax() + { + $expectedResult = true; + + $this->taxHelperMock->expects($this->once()) + ->method('displayPriceIncludingTax') + ->will($this->returnValue($expectedResult)); + + $result = $this->model->displayPriceIncludingTax(); + + $this->assertEquals($expectedResult, $result); + } + + /** + * test for method displayPriceExcludingTax + */ + public function testDisplayPriceExcludingTax() + { + $expectedResult = true; + + $this->taxHelperMock->expects($this->once()) + ->method('displayPriceExcludingTax') + ->will($this->returnValue($expectedResult)); + + $result = $this->model->displayPriceExcludingTax(); + + $this->assertEquals($expectedResult, $result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php index 95648fb685b455838a03e638ee409a15e0680bf1..7387990567ae29ef6eccca55ae8b9c1fbd12bcd3 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/PluginScannerTest.php @@ -43,7 +43,7 @@ class PluginScannerTest extends \PHPUnit_Framework_TestCase public function testCollectEntities() { $actual = $this->_model->collectEntities($this->_testFiles); - $expected = array('Magento\App\Cache\TagPlugin', 'Magento\Core\Model\Action\Plugin'); + $expected = array('Magento\Framework\App\Cache\TagPlugin', 'Magento\Core\Model\Action\Plugin'); $this->assertEquals($expected, $actual); } } diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php index f70951bb117c5a9bac97125c691122e82996daf2..24316dc7055d9c3b765a89e2cdc8c4db3b001748 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlInterceptorScannerTest.php @@ -53,7 +53,10 @@ class XmlInterceptorScannerTest extends \PHPUnit_Framework_TestCase public function testCollectEntities() { $actual = $this->_model->collectEntities($this->_testFiles); - $expected = array('Magento\App\Cache\Interceptor', 'Magento\App\Action\Context\Interceptor'); + $expected = array( + 'Magento\Framework\App\Cache\Interceptor', + 'Magento\Framework\App\Action\Context\Interceptor' + ); $this->assertEquals($expected, $actual); } } diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlScannerTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlScannerTest.php index bfff47d2609d036f7985b0debe568cc8ed58df12..e7d6ce6b0a4d243e779a2b0871c2279cbcf247c6 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlScannerTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/Code/Scanner/XmlScannerTest.php @@ -89,7 +89,7 @@ class XmlScannerTest extends \PHPUnit_Framework_TestCase 'Invalid proxy class for ' . substr('\Magento\SomeModule\Model\Nested\Element\Proxy', 0, -5) ); $actual = $this->_model->collectEntities($this->_testFiles); - $expected = array('Magento\App\Request\Http\Proxy'); + $expected = array('Magento\Framework\App\Request\Http\Proxy'); $this->assertEquals($expected, $actual); } } diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml index a2992be949198ba1d3d48be3f5fc5d00d0a1e018..6687c88c566d7b86a4730c9631df83d2c23529c5 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/code/Magento/SomeModule/etc/di.xml @@ -24,11 +24,11 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <preference for="Magento\App\RequestInterface" type="Magento\App\Request\Http\Proxy" /> + <preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http\Proxy" /> <preference for="Magento\Core\Model\Config\InvalidatorInterface" type="Magento\Core\Model\Config\Invalidator\Proxy" /> - <preference for="Magento\App\CacheInterface" type="Magento\App\Cache\Proxy" /> - <virtualType name="custom_cache_instance" type="Magento\App\Cache"> - <plugin name="tag" type="Magento\App\Cache\TagPlugin" /> + <preference for="Magento\Framework\App\CacheInterface" type="Magento\Framework\App\Cache\Proxy" /> + <virtualType name="custom_cache_instance" type="Magento\Framework\App\Cache"> + <plugin name="tag" type="Magento\Framework\App\Cache\TagPlugin" /> </virtualType> <type name="Magento\SomeModule\Model\Test"> <arguments> diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml index 2073ec34b1889104ae7af80f1ea005365a562d82..5febaba151b6ab262f599dbfd5fe448d8c35f6c7 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/Di/_files/app/etc/di/config.xml @@ -24,12 +24,12 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../../lib/Magento/ObjectManager/etc/config.xsd"> - <type name="Magento\App\Cache"> + <type name="Magento\Framework\App\Cache"> <arguments> <argument name="storeManager" xsi:type="object">customStoreManagerProxy</argument> </arguments> </type> - <type name="Magento\App\Action\Context"> + <type name="Magento\Framework\App\Action\Context"> <arguments> <argument name="layoutFactory" xsi:type="object">customLayoutFactory</argument> </arguments> diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ConfigTest.php index b75c7d3e5892aa1ebf95137a4f4dd698a96be0ea..0957067b3cf7a3640f1a24ee56cdd60ccd5ff408 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ConfigTest.php @@ -33,7 +33,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_rootDirectory; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystem; @@ -41,7 +41,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { $this->_rootDirectory = $this->getMockForAbstractClass('Magento\Filesystem\Directory\WriteInterface'); $this->_rootDirectory->expects($this->never())->method('getAbsolutePath'); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_filesystem->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php index ce605760fa25daf318452aee84bb31d00996f82f..b62125887b8ff42e9b13543dc17ac94a8e77d952 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php @@ -52,7 +52,7 @@ class CopyRuleTest extends \PHPUnit_Framework_TestCase protected function setUp() { $filesystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php index 454a091f22ef99b6ea2c2972a52ee93ce0d5a6ec..94010dc383d93cf7e7da9747c67ee3bab39da3ea 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php @@ -42,7 +42,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase protected $_tmpDir; /** - * @var \Magento\App\Filesystem | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem | \PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; @@ -54,13 +54,13 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase protected function setUp() { $methods = array('getDirectoryWrite', 'getPath', '__wakeup'); - $this->filesystem = $this->getMock('Magento\App\Filesystem', $methods, array(), '', false); + $this->filesystem = $this->getMock('Magento\Framework\App\Filesystem', $methods, array(), '', false); $this->filesystem->expects( $this->any() )->method( 'getPath' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue(str_replace('\\', '/', BP)) ); @@ -229,7 +229,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase */ protected function _createThemeDeployment($permitted, $forbidden = null, $isDryRun = false) { - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $preProcessor = $this->getMock( 'Magento\View\Asset\PreProcessor\PreProcessorInterface', array(), @@ -238,7 +238,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase false ); $fileFactory = $this->getMock('Magento\View\Publisher\FileFactory', array(), array(), '', false); - $appState = $this->getMock('Magento\App\State', array(), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $themeFactory = $this->getMock('Magento\Core\Model\Theme\DataFactory', array('create'), array(), '', false); $object = new \Magento\Tools\View\Generator\ThemeDeployment( diff --git a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/CssTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/CssTest.php index 8410a115e6eb6e71184b0aadcde3d287247851a1..5c04c23615cbe129fc0324ff3cb4bfd45976f369 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/CssTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/CssTest.php @@ -107,15 +107,15 @@ class CssTest extends \PHPUnit_Framework_TestCase { $method = self::getMethod('_getAdditionalElementTypes'); - /** @var $configModel \Magento\App\Config\ScopeConfigInterface */ - $configModel = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + /** @var $configModel \Magento\Framework\App\Config\ScopeConfigInterface */ + $configModel = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_objectManager->expects( $this->any() )->method( 'get' )->with( - 'Magento\App\Config\ScopeConfigInterface' + 'Magento\Framework\App\Config\ScopeConfigInterface' )->will( $this->returnValue($configModel) ); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/ContentTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/ContentTest.php index f0061d79faf3dc45bbb6fdea0b4f20e1b9b597de..0e97952a57db4c9f2163bdee89e1cf5e0feb74a8 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/ContentTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/Wysiwyg/Files/ContentTest.php @@ -44,7 +44,7 @@ class ContentTest extends \PHPUnit_Framework_TestCase protected $_filesContent; /** - * @var \Magento\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\RequestInterface|PHPUnit_Framework_MockObject_MockObject */ protected $_request; @@ -52,7 +52,7 @@ class ContentTest extends \PHPUnit_Framework_TestCase { $this->_helperStorage = $this->getMock('Magento\Theme\Helper\Storage', array(), array(), '', false); $this->_urlBuilder = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false); - $this->_request = $this->getMock('Magento\App\RequestInterface', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\RequestInterface', array(), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $constructArguments = $objectManagerHelper->getConstructArguments( diff --git a/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php index a7e2a1c1db43ccd99f3bae3caf22a546a907e828..8a70eaf63af0c3365c90b440254a7fb00b42d914 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php @@ -33,9 +33,9 @@ class HeaderTest extends \PHPUnit_Framework_TestCase */ public function testGetLogoSrc() { - $filesystem = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false); $mediaDirectory = $this->getMock('\Magento\Filesystem\Directory\Read', array(), array(), '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $urlBuilder = $this->getMock('Magento\UrlInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php index d8d36e878a3693948cd79e6aec33d491f6e7aa2a..55458130f7d276e47d0a0a9425453754e40959c8 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php @@ -53,7 +53,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase protected $eventManager; /** - * @var \Magento\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $view; @@ -61,9 +61,9 @@ class ThemeTest extends \PHPUnit_Framework_TestCase { $this->_objectManagerMock = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->_request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); + $this->_request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); $this->eventManager = $this->getMock('\Magento\Event\ManagerInterface', array(), array(), '', false); - $this->view = $this->getMock('\Magento\App\ViewInterface', array(), array(), '', false); + $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', array(), array(), '', false); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_model = $helper->getObject( @@ -71,7 +71,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase array( 'request' => $this->_request, 'objectManager' => $this->_objectManagerMock, - 'response' => $this->getMock('Magento\App\Response\Http', array(), array(), '', false), + 'response' => $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false), 'eventManager' => $this->eventManager, 'view' => $this->view, ) diff --git a/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php b/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php index 487ffa2871e6a9a01fe0b2dd7c0c2a9126b4e33c..d4646153d501978e112d95647880d40b422c8740 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Helper/StorageTest.php @@ -32,7 +32,7 @@ namespace Magento\Theme\Helper; class StorageTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; @@ -67,7 +67,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected $directoryWrite; /** - * @var \Magento\App\Helper\Context|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Helper\Context|\PHPUnit_Framework_MockObject_MockObject */ protected $contextHelper; @@ -87,10 +87,10 @@ class StorageTest extends \PHPUnit_Framework_TestCase { $this->customizationPath = '/' . implode('/', array('var', 'theme')); - $this->request = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); - $this->filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->request = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->session = $this->getMock('Magento\Backend\Model\Session', array(), array(), '', false); - $this->contextHelper = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); + $this->contextHelper = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); $this->directoryWrite = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->themeFactory = $this->getMock( 'Magento\View\Design\Theme\FlyweightFactory', diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php index 1dcf9115c7faa63425f87d026e96c72882f5c235..8ee869b233b56b2ea13a79cb8c3177de3dea880b 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/ConfigTest.php @@ -58,7 +58,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $_layoutCacheMock; /** - * @var \Magento\App\Config\Storage\WriterInterface + * @var \Magento\Framework\App\Config\Storage\WriterInterface */ protected $_scopeConfigWriter; @@ -81,7 +81,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase array('getStores', 'isSingleStoreMode') ); $this->_configData = $this->getMock( - 'Magento\App\Config\Value', + 'Magento\Framework\App\Config\Value', array('getCollection', 'addFieldToFilter', '__wakeup'), array(), '', @@ -91,7 +91,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $this->_layoutCacheMock = $this->getMockForAbstractClass('Magento\Cache\FrontendInterface'); $this->_scopeConfigWriter = $this->getMock( - 'Magento\App\Config\Storage\WriterInterface', + 'Magento\Framework\App\Config\Storage\WriterInterface', array('save', 'delete') ); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/CopyServiceTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/CopyServiceTest.php index 6de7fcd8444f8413f202313e537a4d0f7d34914a..0a14b81fe7d4f84c9f5a79a244b1cdb6a7111624 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/CopyServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/CopyServiceTest.php @@ -168,7 +168,8 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $this->_filesystem = + $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', false); $this->_dirWriteMock = $this->getMock( 'Magento\Filesystem\Directory\Write', array('isDirectory', 'search', 'copy', 'delete', 'read', 'copyFile', 'isExist'), @@ -181,7 +182,7 @@ class CopyServiceTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue($this->_dirWriteMock) ); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Uploader/ServiceTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Uploader/ServiceTest.php index 8188053767bbfadee2348b7bf04b70921e7f75a4..9ceb190a5ab052cbf47a8f4ac9be7bf237b85e32 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Uploader/ServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Uploader/ServiceTest.php @@ -52,7 +52,7 @@ class ServiceTest extends \PHPUnit_Framework_TestCase protected $_fileSizeMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\App\Filesystem + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Filesystem */ protected $_filesystemMock; @@ -78,7 +78,7 @@ class ServiceTest extends \PHPUnit_Framework_TestCase ); $this->_uploaderFactory->expects($this->any())->method('create')->will($this->returnValue($this->_uploader)); $this->_directoryMock = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_filesystemMock->expects( $this->any() )->method( diff --git a/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php index 76f3ac2176cfe5c5923635154de1d8484f23b4dd..b3f8b2d362cd10aa50c26a0abc4d5fb7b50b6457 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Wysiwyg/StorageTest.php @@ -37,7 +37,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected $_storageRoot; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystem; @@ -68,7 +68,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_helperStorage = $this->getMock('Magento\Theme\Helper\Storage', array(), array(), '', false); $this->_objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); $this->_imageFactory = $this->getMock('Magento\Image\AdapterFactory', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Translate/InlineTest.php b/dev/tests/unit/testsuite/Magento/Translate/InlineTest.php index 292d18fecfd71671f79ac5db53e4fd9f5dc3f974..12c54e9d56b3e406c0ef9f50889239150096e5fe 100644 --- a/dev/tests/unit/testsuite/Magento/Translate/InlineTest.php +++ b/dev/tests/unit/testsuite/Magento/Translate/InlineTest.php @@ -26,7 +26,7 @@ namespace Magento\Translate; class InlineTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\App\ScopeResolverInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\ScopeResolverInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $scopeResolverMock; @@ -57,7 +57,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->scopeResolverMock = $this->getMock('Magento\App\ScopeResolverInterface', array(), array(), '', false); + $this->scopeResolverMock = + $this->getMock('Magento\Framework\App\ScopeResolverInterface', array(), array(), '', false); $this->urlMock = $this->getMock('Magento\UrlInterface', array(), array(), '', false); $this->layoutMock = $this->getMock('Magento\View\LayoutInterface', array(), array(), '', false); $this->configMock = $this->getMock('Magento\Translate\Inline\ConfigInterface', array(), array(), '', false); @@ -287,7 +288,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase */ protected function prepareIsAllowed($isEnabled, $isActive, $isDevAllowed, $scope = null) { - $scopeMock = $this->getMock('Magento\App\Config\ScopeConfigInterface', array(), array(), '', false); + $scopeMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', array(), array(), '', false); $this->stateMock->expects($this->any())->method('isEnabled')->will($this->returnValue($isEnabled)); $this->scopeResolverMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/TranslateTest.php b/dev/tests/unit/testsuite/Magento/TranslateTest.php index c902e2afa1f7375017e09e4af3da49e02aeb4316..ed17fc9ff4f20cdcda8819ba5c28ced3c03c1d61 100644 --- a/dev/tests/unit/testsuite/Magento/TranslateTest.php +++ b/dev/tests/unit/testsuite/Magento/TranslateTest.php @@ -52,7 +52,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Module\Dir\Reader */ protected $_modulesReader; - /** @var \Magento\App\ScopeResolverInterface */ + /** @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; /** @var \Magento\Translate\ResourceInterface */ @@ -61,13 +61,13 @@ class TranslateTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Locale\ResolverInterface */ protected $_locale; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appState; - /** @var \Magento\App\Filesystem */ + /** @var \Magento\Framework\App\Filesystem */ protected $_filesystem; - /** @var \Magento\App\RequestInterface */ + /** @var \Magento\Framework\App\RequestInterface */ protected $_request; /** @var \Magento\File\Csv */ @@ -84,15 +84,15 @@ class TranslateTest extends \PHPUnit_Framework_TestCase $this->_viewFileSystem = $this->getMock('\Magento\View\FileSystem', [], [], '', false); $this->_moduleList = $this->getMock('\Magento\Module\ModuleList', [], [], '', false); $this->_modulesReader = $this->getMock('\Magento\Module\Dir\Reader', [], [], '', false); - $this->_scopeResolver = $this->getMock('\Magento\App\ScopeResolverInterface', [], [], '', false); + $this->_scopeResolver = $this->getMock('\Magento\Framework\App\ScopeResolverInterface', [], [], '', false); $this->_resource = $this->getMock('\Magento\Translate\ResourceInterface', [], [], '', false); $this->_locale = $this->getMock('\Magento\Locale\ResolverInterface', [], [], '', false); - $this->_appState = $this->getMock('\Magento\App\State', [], [], '', false); - $this->_request = $this->getMock('\Magento\App\RequestInterface', [], [], '', false); + $this->_appState = $this->getMock('\Magento\Framework\App\State', [], [], '', false); + $this->_request = $this->getMock('\Magento\Framework\App\RequestInterface', [], [], '', false); $this->_csvParser = $this->getMock('\Magento\File\Csv', [], [], '', false); $this->_directory = $this->getMock('\Magento\Filesystem\Directory\ReadInterface', [], [], '', false); - $filesystem = $this->getMock('\Magento\App\Filesystem', [], [], '', false); + $filesystem = $this->getMock('\Magento\Framework\App\Filesystem', [], [], '', false); $filesystem->expects($this->once())->method('getDirectoryRead')->will($this->returnValue($this->_directory)); $this->_translate = new Translate( diff --git a/dev/tests/unit/testsuite/Magento/Translation/Model/Inline/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Translation/Model/Inline/ConfigTest.php index 51d136d193d68eb17a97b746b235e1424c829828..a5cfa0adefde9f2bd74176cca02b001e9c0db611 100644 --- a/dev/tests/unit/testsuite/Magento/Translation/Model/Inline/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Translation/Model/Inline/ConfigTest.php @@ -31,7 +31,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected $model; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfigMock; @@ -42,7 +42,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->scopeConfigMock = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->helperMock = $this->getMock('Magento\Core\Helper\Data', array('isDevAllowed'), array(), '', false); $this->model = new Config( $this->scopeConfigMock, @@ -54,7 +54,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { $store = 'some store'; $result = 'result'; - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $scopeConfig->expects( $this->once() )->method( diff --git a/dev/tests/unit/testsuite/Magento/UrlRewrite/App/Request/RewriteServiceTest.php b/dev/tests/unit/testsuite/Magento/UrlRewrite/App/Request/RewriteServiceTest.php index 5a344773d1375636d52f2f4db9694c107be0abae..f512ee70e8a551c49cff5f7d21dfec5a4940b552 100644 --- a/dev/tests/unit/testsuite/Magento/UrlRewrite/App/Request/RewriteServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/UrlRewrite/App/Request/RewriteServiceTest.php @@ -52,9 +52,9 @@ class RewriteServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_routerListMock = $this->getMock('\Magento\App\RouterList', array(), array(), '', false); - $this->_configMock = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); - $this->_requestMock = $this->getMock('\Magento\App\Request\Http', array(), array(), '', false); + $this->_routerListMock = $this->getMock('\Magento\Framework\App\RouterList', array(), array(), '', false); + $this->_configMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); + $this->_requestMock = $this->getMock('\Magento\Framework\App\Request\Http', array(), array(), '', false); $this->_rewriteFactoryMock = $this->getMock( '\Magento\UrlRewrite\Model\UrlRewriteFactory', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/UrlRewrite/Helper/UrlRewriteTest.php b/dev/tests/unit/testsuite/Magento/UrlRewrite/Helper/UrlRewriteTest.php index b2b3d52a98d9ba7fb9cd5132eb972def0d8995b1..0d9ffd0becda752e7d1b289a8d2d47a1c0725ca3 100644 --- a/dev/tests/unit/testsuite/Magento/UrlRewrite/Helper/UrlRewriteTest.php +++ b/dev/tests/unit/testsuite/Magento/UrlRewrite/Helper/UrlRewriteTest.php @@ -43,7 +43,7 @@ class UrlRewriteTest extends \PHPUnit_Framework_TestCase ); $optionsMock->expects($this->any())->method('getRedirectOptions')->will($this->returnValue(array('R', 'RP'))); $helper = new \Magento\UrlRewrite\Helper\UrlRewrite( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false, false), + $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false, false), $optionsMock ); $mockObject = new \Magento\Object(); diff --git a/dev/tests/unit/testsuite/Magento/UrlTest.php b/dev/tests/unit/testsuite/Magento/UrlTest.php index 22d768817fb76f30bd51237295ae1b644f5f83bc..e37ff72c771bebc1c797c43d3f45fca361a19bc0 100644 --- a/dev/tests/unit/testsuite/Magento/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/UrlTest.php @@ -61,7 +61,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase protected $sessionMock; /** - * @var \Magento\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $scopeConfig; @@ -74,7 +74,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase $this->queryParamsResolverMock = $this->getMock('Magento\Url\QueryParamsResolverInterface', [], [], '', false); $this->sidResolverMock = $this->getMock('Magento\Session\SidResolverInterface'); $this->sessionMock = $this->getMock('Magento\Session\Generic', [], [], '', false); - $this->scopeConfig = $this->getMock('\Magento\App\Config\ScopeConfigInterface'); + $this->scopeConfig = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); } /** @@ -90,12 +90,12 @@ class UrlTest extends \PHPUnit_Framework_TestCase /** * @param array $mockMethods - * @return \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @return \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected function getRequestMock($mockMethods = []) { $interfaceMethods = array('getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getParam'); - return $this->getMock('Magento\App\RequestInterface', array_merge($interfaceMethods, $mockMethods)); + return $this->getMock('Magento\Framework\App\RequestInterface', array_merge($interfaceMethods, $mockMethods)); } /** @@ -179,7 +179,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase public function testGetUrl($query, $queryResult, $returnUri) { $requestMock = $this->getRequestMock(['isDirectAccessFrontendName', 'getAlias']); - $routeConfigMock = $this->getMock('Magento\App\Route\ConfigInterface'); + $routeConfigMock = $this->getMock('Magento\Framework\App\Route\ConfigInterface'); $model = $this->getUrlModel( ['scopeResolver' => $this->scopeResolverMock, 'routeParamsResolver' => $this->getRouteParamsResolver(), 'queryParamsResolver' => $this->queryParamsResolverMock, @@ -290,7 +290,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase 'getRequestedControllerName', 'getRequestedActionName', ]); - $routeConfigMock = $this->getMock('Magento\App\Route\ConfigInterface'); + $routeConfigMock = $this->getMock('Magento\Framework\App\Route\ConfigInterface'); $model = $this->getUrlModel( ['scopeResolver' => $this->scopeResolverMock, 'routeParamsResolver' => $this->getRouteParamsResolver(), 'queryParamsResolver' => $this->queryParamsResolverMock, @@ -319,7 +319,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase public function testGetDirectUrl() { $requestMock = $this->getRequestMock(['isDirectAccessFrontendName', 'getAlias']); - $routeConfigMock = $this->getMock('Magento\App\Route\ConfigInterface'); + $routeConfigMock = $this->getMock('Magento\Framework\App\Route\ConfigInterface'); $model = $this->getUrlModel( ['scopeResolver' => $this->scopeResolverMock, 'routeParamsResolver' => $this->getRouteParamsResolver(), 'queryParamsResolver' => $this->queryParamsResolverMock, diff --git a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php index a49e64af083cea4bb9a82a3775b525e318b0634d..ddfa6ce56343ecf35c8b27aaed4d1f4d38cd7b2a 100644 --- a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php +++ b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php @@ -55,7 +55,7 @@ class RoleTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_resourceMock = $this->getMock('Magento\App\Resource', array(), array(), '', false, false); + $this->_resourceMock = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false, false); $this->_groupFactoryMock = $this->getMock( 'Magento\User\Model\Acl\Role\GroupFactory', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php index 10c402b7f8df3ec1c4efb7907208016c5fd3412c..7f65c67967b3ee1171ae72a11119616ccc6aeb21 100644 --- a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php +++ b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php @@ -45,7 +45,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_resourceMock = $this->getMock('Magento\App\Resource', array(), array(), '', false, false); + $this->_resourceMock = $this->getMock('Magento\Framework\App\Resource', array(), array(), '', false, false); $this->_rootResourceMock = new \Magento\Acl\RootResource('Magento_Adminhtml::all'); $this->_model = new \Magento\User\Model\Acl\Loader\Rule($this->_rootResourceMock, $this->_resourceMock); } diff --git a/dev/tests/unit/testsuite/Magento/Usps/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Usps/Helper/DataTest.php index 6bca4e6faf163c6153172aedbed33af7eb0d977a..4c38a5fd874f4da252326b8f6242d5081b805e7d 100644 --- a/dev/tests/unit/testsuite/Magento/Usps/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Usps/Helper/DataTest.php @@ -34,7 +34,7 @@ class DataTest extends \PHPUnit_Framework_TestCase { $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $arguments = array( - 'context' => $this->getMock('Magento\App\Helper\Context', array(), array(), '', false), + 'context' => $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false), 'locale' => $this->getMock('Magento\Locale', array(), array(), '', false) ); diff --git a/dev/tests/unit/testsuite/Magento/Usps/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Usps/Model/CarrierTest.php index 80251399ad75c3e8046095dd1c49a6fc86bb68f0..f5dc883c98285ef75c1ed6ffdcec0a410cfd6dc4 100644 --- a/dev/tests/unit/testsuite/Magento/Usps/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Usps/Model/CarrierTest.php @@ -48,7 +48,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase $this->_helper = new \Magento\TestFramework\Helper\ObjectManager($this); $scopeConfig = $this->getMockBuilder( - '\Magento\App\Config\ScopeConfigInterface' + '\Magento\Framework\App\Config\ScopeConfigInterface' )->setMethods( array('isSetFlag', 'getValue') )->disableOriginalConstructor()->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php index 5d19550da277c3029df984683a0302940028f2ba..cea83f65bd74fe8db232bf7f98c027705fdc7242 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php @@ -59,9 +59,9 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = $this->getMockForAbstractClass('Magento\ObjectManager', array('create')); $this->_config = $this->getMock('Magento\View\Asset\ConfigInterface', array(), array(), '', false); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directory = $this->getMock('\Magento\Filesystem\Directory\Write', array(), array(), '', false); - $this->_state = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_state = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); $this->_filesystem->expects( $this->any() )->method( @@ -140,37 +140,37 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase 'js production mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\App\State::MODE_PRODUCTION, + \Magento\Framework\App\State::MODE_PRODUCTION, 'Magento\View\Asset\MergeStrategy\FileExists' ), 'css production mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\App\State::MODE_PRODUCTION, + \Magento\Framework\App\State::MODE_PRODUCTION, 'Magento\View\Asset\MergeStrategy\FileExists' ), 'js default mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'Magento\View\Asset\MergeStrategy\Checksum' ), 'css default mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\App\State::MODE_DEFAULT, + \Magento\Framework\App\State::MODE_DEFAULT, 'Magento\View\Asset\MergeStrategy\Checksum' ), 'js developer mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\App\State::MODE_DEVELOPER, + \Magento\Framework\App\State::MODE_DEVELOPER, 'Magento\View\Asset\MergeStrategy\Checksum' ), 'css developer mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\App\State::MODE_DEVELOPER, + \Magento\Framework\App\State::MODE_DEVELOPER, 'Magento\View\Asset\MergeStrategy\Checksum' ) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php index 535c6f2a7f9f107e6e8f254673024fe9c7c6c07f..09b5e5914ba8aebb0e37251d47ff375c9aad356d 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php @@ -72,7 +72,8 @@ class ChecksumTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryWrite'), array(), '', false); + $this->_filesystem = + $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryWrite'), array(), '', false); $this->_directory = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->_filesystem->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php index 308c2b43a84e8a91e350d8329a62397e8699ae70..f1d39c29f49b3604e1b0da9dab0f397b3d67d985 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php @@ -50,14 +50,14 @@ class DirectTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_cssUrlResolver = $this->getMock('Magento\View\Url\CssResolver', array(), array(), '', false); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directory = $this->getMock('Magento\Filesystem\Directory\Write', array(), array(), '', false); $this->_filesystem->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::PUB_DIR + \Magento\Framework\App\Filesystem::PUB_DIR )->will( $this->returnValue($this->_directory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php index 950cff1d001ae5fcd2bddee85b279368f47a8938..f9770257228c2a3fce7f76e11b2cef65c3f2eac8 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php @@ -63,7 +63,7 @@ class FileExistsTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', 'getDirectoryRead'), array(), '', diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php index 9fd7d5a6fa1fb640b991f0ba8ba2727a4bc8c34e..5f2ea4c4c5b4c2dfefc2fb1501cc9cb68f5140c6 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php @@ -96,7 +96,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase array('create', 'get') ); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_objectManager->expects($this->any())->method('get')->will($this->returnValue($this->_filesystem)); $this->_object = new \Magento\View\Asset\Merged( @@ -171,7 +171,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase )->method( 'getPath' )->with( - $this->equalTo(\Magento\App\Filesystem::PUB_LIB_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::PUB_LIB_DIR) )->will( $this->returnValue('pub/lib') ); @@ -180,7 +180,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase )->method( 'getPath' )->with( - $this->equalTo(\Magento\App\Filesystem::STATIC_VIEW_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR) )->will( $this->returnValue('pub/static') ); @@ -203,7 +203,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - $this->equalTo(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR) )->will( $this->returnValue($readDirectoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php index a5ec5e5b3b7fde74cda50122c18d77621955d8f9..83a6755821f92cf76edbcc69b3bcaccef7d41535 100644 --- a/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php @@ -41,7 +41,7 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $_appState; @@ -49,8 +49,8 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase { $this->_config = $this->getMock('Magento\View\Asset\ConfigInterface', array(), array(), '', false); $this->_objectManager = $this->getMock('Magento\ObjectManager'); - $this->_appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $directory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($directory)); $directory->expects($this->any())->method('getAbsolutePath')->will($this->returnArgument(0)); @@ -190,9 +190,12 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase public function getAssetsAppModesDataProvider() { return array( - 'production' => array(\Magento\App\State::MODE_PRODUCTION, 'Magento\Code\Minifier\Strategy\Lite'), - 'default' => array(\Magento\App\State::MODE_DEFAULT, 'Magento\Code\Minifier\Strategy\Generate'), - 'developer' => array(\Magento\App\State::MODE_DEVELOPER, 'Magento\Code\Minifier\Strategy\Generate') + 'production' => array(\Magento\Framework\App\State::MODE_PRODUCTION, 'Magento\Code\Minifier\Strategy\Lite'), + 'default' => array(\Magento\Framework\App\State::MODE_DEFAULT, 'Magento\Code\Minifier\Strategy\Generate'), + 'developer' => array( + \Magento\Framework\App\State::MODE_DEVELOPER, + 'Magento\Code\Minifier\Strategy\Generate' + ) ); } } diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Fallback/FactoryTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Fallback/FactoryTest.php index 57a472388f273332d98f131892fd2b87eac584cc..8e741814bfb96e0a336c0bc32c73c3e108f8ad12 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/Fallback/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Fallback/FactoryTest.php @@ -43,13 +43,13 @@ class FactoryTest extends \PHPUnit_Framework_TestCase protected function setUp() { $filesystemMock = $this->getMock( - '\Magento\App\Filesystem', + '\Magento\Framework\App\Filesystem', array('getPath', 'getDirectoryRead', '__wakeup'), array( 'dir' => array( - \Magento\App\Filesystem::THEMES_DIR => 'themes', - \Magento\App\Filesystem::MODULES_DIR => 'modules', - \Magento\App\Filesystem::PUB_LIB_DIR => 'pub_lib' + \Magento\Framework\App\Filesystem::THEMES_DIR => 'themes', + \Magento\Framework\App\Filesystem::MODULES_DIR => 'modules', + \Magento\Framework\App\Filesystem::PUB_LIB_DIR => 'pub_lib' ) ), '', @@ -62,9 +62,9 @@ class FactoryTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValueMap( array( - \Magento\App\Filesystem::THEMES_DIR => 'themes', - \Magento\App\Filesystem::MODULES_DIR => 'modules', - \Magento\App\Filesystem::PUB_LIB_DIR => 'pub_lib' + \Magento\Framework\App\Filesystem::THEMES_DIR => 'themes', + \Magento\Framework\App\Filesystem::MODULES_DIR => 'modules', + \Magento\Framework\App\Filesystem::PUB_LIB_DIR => 'pub_lib' ) ) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxyTest.php b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxyTest.php index 7a67ca2854c05e7007e88d2aa92498b3592be573..e1d57f37f130ce0afb6aaf845f3cfcabd8a22f4e 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxyTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxyTest.php @@ -26,7 +26,7 @@ */ namespace Magento\View\Design\FileResolution\Strategy\Fallback; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\TestFramework\Helper\ProxyTesting; /** @@ -284,13 +284,13 @@ class CachingProxyTest extends \PHPUnit_Framework_TestCase ); $this->directoryWrite->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); $methods = array('getDirectoryRead', 'getDirectoryWrite', '__wakeup'); - $filesystem = $this->getMock('Magento\App\Filesystem', $methods, array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', $methods, array(), '', false); $filesystem->expects( $this->once() )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($directoryRead) ); @@ -299,7 +299,7 @@ class CachingProxyTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::VAR_DIR + \Magento\Framework\App\Filesystem::VAR_DIR )->will( $this->returnValue($this->directoryWrite) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php index 8ac5e5499de90fcb623a1c70e14e6bcf455b7cea..8598f8fe7c0c4b28d4163b7a0b53c4d0ad4013d7 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/Strategy/FallbackTest.php @@ -71,7 +71,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase $this->fallbackFactory = $this->getMock( 'Magento\View\Design\Fallback\Factory', array('createLocaleFileRule', 'createFileRule', 'createViewFileRule'), - array($this->getMock('Magento\App\Filesystem', array(), array(), '', false)) + array($this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false)) ); $this->fallbackFactory->expects( $this->any() @@ -229,7 +229,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase /** * @param string $targetFile - * @return \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @return \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected function getFileSystemMock($targetFile) { @@ -249,7 +249,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase ) ); $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', @@ -260,7 +260,7 @@ class FallbackTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/StrategyPoolTest.php b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/StrategyPoolTest.php index 43af7acf0740c3e2f8a2480eed2c3b63810c6194..c4155103fc9175792681778cbf39cb8dbf4d15d9 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/StrategyPoolTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/FileResolution/StrategyPoolTest.php @@ -26,7 +26,7 @@ */ namespace Magento\View\Design\FileResolution; -use Magento\App\State; +use Magento\Framework\App\State; /** * StrategyPool Test @@ -46,7 +46,7 @@ class StrategyPoolTest extends \PHPUnit_Framework_TestCase protected $appState; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystem; @@ -58,11 +58,11 @@ class StrategyPoolTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); - $this->appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->filesystem = $this->getMock('Magento\App\Filesystem', array('getPath'), array(), '', false); + $this->appState = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); + $this->filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getPath'), array(), '', false); $pathMap = array( - array(\Magento\App\Filesystem::VAR_DIR, 'base_dir/var'), - array(\Magento\App\Filesystem::ROOT_DIR, 'base_dir') + array(\Magento\Framework\App\Filesystem::VAR_DIR, 'base_dir/var'), + array(\Magento\Framework\App\Filesystem::ROOT_DIR, 'base_dir') ); $this->filesystem->expects($this->any())->method('getPath')->will($this->returnValueMap($pathMap)); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php index 00f74dd0c083714af1064750f8a7499368c54fc9..d7b46d0d262456d094419bc1540468e56db24fac 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/AbstractFileTest.php @@ -68,7 +68,7 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase '', false ); - $this->_filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_modelBuilder = $this->getMockBuilder( 'Magento\View\Design\Theme\Customization\AbstractFile' @@ -251,7 +251,7 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($directoryMock) ); @@ -292,7 +292,7 @@ class AbstractFileTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue($directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php index ed6c69427bab802712008ae9ce9ea214024957fd..622c7b02a92176b1601f8139e6a8ad8bddc1e2f4 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Customization/PathTest.php @@ -60,11 +60,11 @@ class PathTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false); - $this->_appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); + $this->_appState = $this->getMock('Magento\Framework\App\State', array('getAreaCode'), array(), '', false); $appStateProperty = new \ReflectionProperty('\Magento\Core\Model\Theme', '_appState'); $appStateProperty->setAccessible(true); $appStateProperty->setValue($this->_theme, $this->_appState); - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directory = $this->getMock('\Magento\Filesystem\Directory\Read', array(), array(), '', false); $filesystem->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($this->_directory)); $this->_directory->expects($this->once())->method('getAbsolutePath')->will($this->returnArgument(0)); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Image/UploaderTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Image/UploaderTest.php index 58288566f55895acbf0a727829bd628d0e05dc2f..29aa7573bf63a1beefe9a5addaace65a9824b141 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/Theme/Image/UploaderTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/Image/UploaderTest.php @@ -59,7 +59,7 @@ class UploaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_transferAdapterMock = $this->getMock('Zend_File_Transfer_Adapter_Http', array(), array(), '', false); $this->_fileUploader = $this->getMock('Magento\File\Uploader', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php b/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php index fd0c70d87e4c84d08aab27f3ed8d1b07508af4b5..22b8a31165a16ae278219bfe61601669d0b4c30d 100644 --- a/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Design/Theme/ImageTest.php @@ -38,7 +38,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystemMock; @@ -73,7 +73,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase false ); $this->_filesystemMock = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryWrite', '__wakeup'), array(), '', @@ -85,7 +85,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryWrite' )->with( - \Magento\App\Filesystem::MEDIA_DIR + \Magento\Framework\App\Filesystem::MEDIA_DIR )->will( $this->returnValue($this->_directoryMock) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php b/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php index 3167426a358be6478e3064529574f3c84c70b2b8..928861f9091cb46787c9cc6bc09a717daf815379 100644 --- a/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php @@ -36,7 +36,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase */ public function testGetUiId($expectedResult, $nameInLayout, $methodArguments) { - /** @var $block \Magento\View\Element\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ + /** @var $block \Magento\View\Element\AbstractBlock|\PHPUnit_Framework_MockObject_MockObject */ $block = $this->getMockForAbstractClass('Magento\View\Element\AbstractBlock', array(), '', false); $block->setNameInLayout($nameInLayout); @@ -90,7 +90,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $configManager = $this->getMock('Magento\View\ConfigInterface', array(), array(), '', false); $configManager->expects($this->exactly(2))->method('getViewConfig')->will($this->returnValue($config)); - /** @var $block \Magento\View\Element\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ + /** @var $block \Magento\View\Element\AbstractBlock|\PHPUnit_Framework_MockObject_MockObject */ $params = array('viewConfig' => $configManager); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $block = $this->getMockForAbstractClass( diff --git a/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php b/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php index 822e4c4194534538accfdff3dccee71a3643e206..c4528009be9c676b48743473d467005a86e83509 100644 --- a/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php @@ -49,8 +49,8 @@ class CurrentTest extends \PHPUnit_Framework_TestCase { $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_urlBuilderMock = $this->getMock('\Magento\UrlInterface'); - $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_defaultPathMock = $this->getMock('\Magento\App\DefaultPathInterface'); + $this->_requestMock = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $this->_defaultPathMock = $this->getMock('\Magento\Framework\App\DefaultPathInterface'); } public function testGetUrl() diff --git a/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php b/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php index bf1629bc1a7d418c9070cfc80901791d0b6511e3..dcc4bb043d6da09e9f24755bdb6cedc8fe134b87 100644 --- a/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php @@ -34,7 +34,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase protected $_block; /** - * @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $_filesystem; @@ -52,7 +52,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase { $this->_viewFileSystem = $this->getMock('\Magento\View\FileSystem', array(), array(), '', false); - $this->_filesystem = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false); + $this->_filesystem = $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_templateEngine = $this->getMock( 'Magento\View\TemplateEnginePool', @@ -64,7 +64,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $this->_templateEngine->expects($this->any())->method('get')->will($this->returnValue($this->_templateEngine)); - $appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); + $appState = $this->getMock('Magento\Framework\App\State', array('getAreaCode'), array(), '', false); $appState->expects($this->any())->method('getAreaCode')->will($this->returnValue('frontend')); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_block = $helper->getObject( diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php index 7bdf03a7d8fc97f3c840f81fd7079944d3fcb905..96131a58eee6b5c5023fa5a7b6394b0891c42a69 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php @@ -47,7 +47,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase { $this->directory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', @@ -58,7 +58,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::MODULES_DIR + \Magento\Framework\App\Filesystem::MODULES_DIR )->will( $this->returnValue($this->directory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/BaseTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/BaseTest.php index ead6369682908e1aba0163edef20624b7b840587..954687aef2acbe994c5376110207552ac016f1b9 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/BaseTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/BaseTest.php @@ -52,13 +52,13 @@ class BaseTest extends \PHPUnit_Framework_TestCase '', false ); - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', false); $filesystem->expects( $this->once() )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::THEMES_DIR + \Magento\Framework\App\Filesystem::THEMES_DIR )->will( $this->returnValue($this->directory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php index ccda0392ff99d7490b41bb3e58b5e05559d09e2e..9add3f150a70e624d2d22782416f7034bb2ff040 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php @@ -42,7 +42,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $filesystem = $this->getMock('Magento\App\Filesystem', array('getDirectoryRead'), array(), '', false); + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array('getDirectoryRead'), array(), '', false); $this->_directory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false); $this->_directory->expects($this->any())->method('getAbsolutePath')->will($this->returnArgument(0)); @@ -51,7 +51,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - $this->equalTo(\Magento\App\Filesystem::THEMES_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::THEMES_DIR) )->will( $this->returnValue($this->_directory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/ThemeTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/ThemeTest.php index 9dee48d4d3bd4e0f97489a791bf1701d8ac75fec..63f5eb3f8d05ca5da25367563feb195fb784f2eb 100644 --- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/ThemeTest.php @@ -53,7 +53,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase false ); $filesystem = $this->getMock( - 'Magento\App\Filesystem', + 'Magento\Framework\App\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', @@ -64,7 +64,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase )->method( 'getDirectoryRead' )->with( - \Magento\App\Filesystem::THEMES_DIR + \Magento\Framework\App\Filesystem::THEMES_DIR )->will( $this->returnValue($this->directory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/LayoutTest.php b/dev/tests/unit/testsuite/Magento/View/LayoutTest.php index d70dfda352a6a014bfb0b1c95d1930af2f00913b..06244e7560d0c717ed25002ba7cbe04dd4e04eb1 100644 --- a/dev/tests/unit/testsuite/Magento/View/LayoutTest.php +++ b/dev/tests/unit/testsuite/Magento/View/LayoutTest.php @@ -46,7 +46,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase protected $processorFactoryMock; /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ protected $appStateMock; @@ -80,7 +80,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase false ); $this->appStateMock = $this->getMock( - 'Magento\App\State', + 'Magento\Framework\App\State', [], [], '', diff --git a/dev/tests/unit/testsuite/Magento/View/Publisher/CssFileTest.php b/dev/tests/unit/testsuite/Magento/View/Publisher/CssFileTest.php index 875ad075623b556b17513e2540c4a1aa88c42ae5..fb9812390e1765799e6a7911e13626b90fb95aa4 100644 --- a/dev/tests/unit/testsuite/Magento/View/Publisher/CssFileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Publisher/CssFileTest.php @@ -33,7 +33,7 @@ class CssFileTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; /** @var \Magento\View\Service|\PHPUnit_Framework_MockObject_MockObject */ @@ -81,13 +81,13 @@ class CssFileTest extends \PHPUnit_Framework_TestCase ) { $this->rootDirectory = $this->getMock('Magento\Filesystem\Directory\WriteInterface'); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->filesystemMock->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - $this->equalTo(\Magento\App\Filesystem::ROOT_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::ROOT_DIR) )->will( $this->returnValue($this->rootDirectory) ); @@ -112,7 +112,7 @@ class CssFileTest extends \PHPUnit_Framework_TestCase )->method( 'getAppMode' )->will( - $this->returnValue(\Magento\App\State::MODE_DEVELOPER) + $this->returnValue(\Magento\Framework\App\State::MODE_DEVELOPER) ); if ($sourcePath) { @@ -160,11 +160,11 @@ class CssFileTest extends \PHPUnit_Framework_TestCase public function getPathCallback($param) { switch ($param) { - case \Magento\App\Filesystem::PUB_LIB_DIR: + case \Magento\Framework\App\Filesystem::PUB_LIB_DIR: return $this->libDir; - case \Magento\App\Filesystem::STATIC_VIEW_DIR: + case \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR: return $this->viewStaticDir; - case \Magento\App\Filesystem::THEMES_DIR: + case \Magento\Framework\App\Filesystem::THEMES_DIR: return $this->themeDir; default: throw new \UnexpectedValueException('Path callback received wrong value: ' . $param); diff --git a/dev/tests/unit/testsuite/Magento/View/Publisher/FileAbstractTest.php b/dev/tests/unit/testsuite/Magento/View/Publisher/FileAbstractTest.php index 80909208f5c029b156e055f5daedaa8deaae6acb..50c167ceab5f3390960fcbae2523d9390b0840b6 100644 --- a/dev/tests/unit/testsuite/Magento/View/Publisher/FileAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Publisher/FileAbstractTest.php @@ -28,7 +28,7 @@ class FileAbstractTest extends \PHPUnit_Framework_TestCase /** @var \Magento\View\Publisher\FileAbstract|\PHPUnit_Framework_MockObject_MockObject */ protected $fileAbstract; - /** @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; /** @var \Magento\View\Service|\PHPUnit_Framework_MockObject_MockObject */ @@ -55,13 +55,13 @@ class FileAbstractTest extends \PHPUnit_Framework_TestCase { $this->rootDirectory = $this->getMock('Magento\Filesystem\Directory\WriteInterface'); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->filesystemMock->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - $this->equalTo(\Magento\App\Filesystem::ROOT_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::ROOT_DIR) )->will( $this->returnValue($this->rootDirectory) ); diff --git a/dev/tests/unit/testsuite/Magento/View/Publisher/FileTest.php b/dev/tests/unit/testsuite/Magento/View/Publisher/FileTest.php index 677303da54b7dbc22270eec9e314613f1a2692cf..485e80f27ab21519c854492323ff86a653d4304a 100644 --- a/dev/tests/unit/testsuite/Magento/View/Publisher/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Publisher/FileTest.php @@ -33,7 +33,7 @@ class FileTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; /** @var \Magento\View\Service|\PHPUnit_Framework_MockObject_MockObject */ @@ -75,13 +75,13 @@ class FileTest extends \PHPUnit_Framework_TestCase { $this->rootDirectory = $this->getMock('Magento\Filesystem\Directory\WriteInterface'); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->filesystemMock->expects( $this->once() )->method( 'getDirectoryWrite' )->with( - $this->equalTo(\Magento\App\Filesystem::ROOT_DIR) + $this->equalTo(\Magento\Framework\App\Filesystem::ROOT_DIR) )->will( $this->returnValue($this->rootDirectory) ); @@ -143,11 +143,11 @@ class FileTest extends \PHPUnit_Framework_TestCase public function getPathCallback($param) { switch ($param) { - case \Magento\App\Filesystem::PUB_LIB_DIR: + case \Magento\Framework\App\Filesystem::PUB_LIB_DIR: return $this->libDir; - case \Magento\App\Filesystem::STATIC_VIEW_DIR: + case \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR: return $this->viewStaticDir; - case \Magento\App\Filesystem::THEMES_DIR: + case \Magento\Framework\App\Filesystem::THEMES_DIR: return $this->themeDir; default: throw new \UnexpectedValueException('Path callback received wrong value: ' . $param); diff --git a/dev/tests/unit/testsuite/Magento/View/PublisherTest.php b/dev/tests/unit/testsuite/Magento/View/PublisherTest.php index f58dda77859c7e9efbe8608b8466e8349c96d52d..f27b87615f42a75a48bf5c5b341451334bc4aa6c 100644 --- a/dev/tests/unit/testsuite/Magento/View/PublisherTest.php +++ b/dev/tests/unit/testsuite/Magento/View/PublisherTest.php @@ -33,7 +33,7 @@ class PublisherTest extends \PHPUnit_Framework_TestCase /** @var ObjectManagerHelper */ protected $objectManagerHelper; - /** @var \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; /** @var \Magento\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject */ @@ -81,7 +81,7 @@ class PublisherTest extends \PHPUnit_Framework_TestCase false ); - $this->filesystemMock = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + $this->filesystemMock = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $this->filesystemMock->expects( $this->any() )->method( @@ -114,11 +114,11 @@ class PublisherTest extends \PHPUnit_Framework_TestCase public function getDirectoryWriteCallback($param) { switch ($param) { - case \Magento\App\Filesystem::ROOT_DIR: + case \Magento\Framework\App\Filesystem::ROOT_DIR: return $this->rootDirectory; - case \Magento\App\Filesystem::VAR_DIR: + case \Magento\Framework\App\Filesystem::VAR_DIR: return $this->tmpDirectory; - case \Magento\App\Filesystem::STATIC_VIEW_DIR: + case \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR: return $this->pubDirectory; default: throw new \UnexpectedValueException('Directory write callback received wrong value: ' . $param); diff --git a/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php b/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php index acef5646dfe2ef4f0d464c19c95275c175e4ed7a..f93ab86164bf1cd8f531fd67be16cbf4bd740bc9 100644 --- a/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php +++ b/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php @@ -113,7 +113,7 @@ class PhpTest extends \PHPUnit_Framework_TestCase public function testHelperWithValidClass() { - $class = 'Magento\App\Helper\AbstractHelper'; + $class = 'Magento\Framework\App\Helper\AbstractHelper'; $object = $this->getMockForAbstractClass($class, array(), '', false); $this->_helperFactoryMock->expects( $this->once() diff --git a/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php index a0dd3cdde2cda5751ed8cc9a9576db9a4b80949f..532b64121c42e0d6fc47122b85654f9d04c71bee 100644 --- a/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php @@ -32,13 +32,14 @@ class CssResolverTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $filesystem = $this->getMock('Magento\App\Filesystem', array('getPath', '__wakeup'), array(), '', false); + $filesystem = + $this->getMock('Magento\Framework\App\Filesystem', array('getPath', '__wakeup'), array(), '', false); $filesystem->expects( $this->any() )->method( 'getPath' )->with( - \Magento\App\Filesystem::ROOT_DIR + \Magento\Framework\App\Filesystem::ROOT_DIR )->will( $this->returnValue('/base_dir/') ); diff --git a/dev/tests/unit/testsuite/Magento/View/UrlTest.php b/dev/tests/unit/testsuite/Magento/View/UrlTest.php index 7d43d1bbfc78d373246c832e60e4cd78d63b6221..b7b973a49dc441e5b56c5e88e93849ec5884109e 100644 --- a/dev/tests/unit/testsuite/Magento/View/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/View/UrlTest.php @@ -38,8 +38,8 @@ class UrlTest extends \PHPUnit_Framework_TestCase $expected = 'http://example.com/public_dir/a/t/m/file.js'; // 1. Get fileSystem model - /** @var $filesystem \Magento\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ - $filesystem = $this->getMock('Magento\App\Filesystem', array(), array(), '', false); + /** @var $filesystem \Magento\Framework\App\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ + $filesystem = $this->getMock('Magento\Framework\App\Filesystem', array(), array(), '', false); $filesystem->expects($this->never())->method('isFile'); $filesystem->expects($this->never())->method('isDirectory'); $filesystem->expects($this->never())->method('read'); diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php index 32d3c82baf10ea6533b1cd17c1f9c13f09d38f57..2b3d01ee3e403dfa0cb1fd08188c51c324e93e51 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php @@ -51,13 +51,15 @@ class ErrorProcessorTest extends \PHPUnit_Framework_TestCase 'Magento\Core\Helper\Data' )->disableOriginalConstructor()->getMock(); - $this->_appStateMock = $this->getMockBuilder('Magento\App\State') + $this->_appStateMock = $this->getMockBuilder('Magento\Framework\App\State') ->disableOriginalConstructor() ->getMock(); $this->_loggerMock = $this->getMockBuilder('Magento\Logger')->disableOriginalConstructor()->getMock(); - $filesystemMock = $this->getMockBuilder('\Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $filesystemMock = $this->getMockBuilder('\Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); /** Initialize SUT. */ $this->_errorProcessor = new ErrorProcessor( diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php index 66a5c02f57c06ad676818743d8a2597a7febf8b1..1c75c6157a22904bb6ea87037c7e42736fa24e0f 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/JsonTest.php @@ -43,7 +43,7 @@ class JsonTest extends \PHPUnit_Framework_TestCase { /** Prepare mocks for SUT constructor. */ $this->_helperMock = $this->getMockBuilder('Magento\Core\Helper\Data')->disableOriginalConstructor()->getMock(); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); /** Initialize SUT. */ $this->_jsonDeserializer = new \Magento\Webapi\Controller\Rest\Request\Deserializer\Json( $this->_helperMock, diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php index 27303edf1a7b1171804c828c9d366500e484b724..0c2554336e7cb95f0026f4465ae1625094333337 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/Request/Deserializer/XmlTest.php @@ -38,7 +38,7 @@ class XmlTest extends \PHPUnit_Framework_TestCase { /** Prepare mocks for SUT constructor. */ $this->_xmlParserMock = $this->getMock('Magento\Xml\Parser', array('xmlToArray', 'loadXML')); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); /** Initialize SUT. */ $this->_xmlDeserializer = new \Magento\Webapi\Controller\Rest\Request\Deserializer\Xml( $this->_xmlParserMock, diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RequestTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RequestTest.php index f352c0b30fe1141ce8f89b52e859d8cf32e32280..1913f09e584cb6804589fd76097700143ff31824 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RequestTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RequestTest.php @@ -45,7 +45,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase )->setMethods( array('deserialize', 'get') )->disableOriginalConstructor()->getMock(); - $areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $areaListMock->expects($this->once())->method('getFrontName')->will($this->returnValue('rest')); /** Instantiate request. */ diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/ResponseTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/ResponseTest.php index 9794ae8436dc67fc5568ad57b52f044a9ead282e..15835d3082de895e990254406cf739b2b3fc8379 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/ResponseTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/ResponseTest.php @@ -30,7 +30,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Webapi\Controller\Rest\Response */ protected $_responseRest; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appStateMock; /** @var \Magento\Webapi\Controller\Rest\Response\Renderer\Xml */ @@ -51,7 +51,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase $rendererFactoryMock->expects($this->any())->method('get')->will($this->returnValue($this->_rendererMock)); $this->_errorProcessorMock = $this->getMockBuilder('Magento\Webapi\Controller\ErrorProcessor') ->disableOriginalConstructor()->getMock(); - $this->_appStateMock = $this->getMock('Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('Magento\Framework\App\State', array(), array(), '', false); /** Init SUP. */ $this->_responseRest = new \Magento\Webapi\Controller\Rest\Response( diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RouterTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RouterTest.php index b8dc0b4880efe2239160c6363a216e5572a40cbc..28a6f9b44394efc9c86a16ac51ae6e086906dc43 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RouterTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Rest/RouterTest.php @@ -54,7 +54,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase )->disableOriginalConstructor()->setMethods( array('match') )->getMock(); - $areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $areaListMock->expects($this->once())->method('getFrontName')->will($this->returnValue('rest')); $this->_request = new \Magento\Webapi\Controller\Rest\Request( diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php index 041cf7add6b5e3077b60bcb78d0c09c2464a26e5..0ccd7cecf59c9f52938852750aa6063a1a2657ef 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/RestTest.php @@ -48,7 +48,7 @@ class RestTest extends \PHPUnit_Framework_TestCase /** @var \stdClass */ protected $_serviceMock; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appStateMock; /** @var \Magento\Authz\Service\AuthorizationV1Interface */ @@ -59,6 +59,11 @@ class RestTest extends \PHPUnit_Framework_TestCase */ protected $areaListMock; + /** + * @var \Magento\Webapi\Controller\ServiceArgsSerializer|\PHPUnit_Framework_MockObject_MockObject + */ + protected $serializerMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject */ @@ -91,7 +96,7 @@ class RestTest extends \PHPUnit_Framework_TestCase $this->_routeMock = $this->getMockBuilder( 'Magento\Webapi\Controller\Rest\Router\Route' )->setMethods( - array('isSecure', 'getServiceMethod', 'getServiceClass') + array('isSecure', 'getServiceMethod', 'getServiceClass', 'getParameters') )->disableOriginalConstructor()->getMock(); $this->_objectManagerMock = $this->getMockBuilder( @@ -104,7 +109,9 @@ class RestTest extends \PHPUnit_Framework_TestCase array(self::SERVICE_METHOD) )->disableOriginalConstructor()->getMock(); - $this->_appStateMock = $this->getMockBuilder('Magento\App\State')->disableOriginalConstructor()->getMock(); + $this->_appStateMock = $this->getMockBuilder('Magento\Framework\App\State') + ->disableOriginalConstructor() + ->getMock(); $this->_authzServiceMock = $this->getMockBuilder( 'Magento\Authz\Service\AuthorizationV1Interface' @@ -116,9 +123,11 @@ class RestTest extends \PHPUnit_Framework_TestCase $errorProcessorMock->expects($this->any())->method('maskException')->will($this->returnArgument(0)); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $serializer = $objectManager->getObject('Magento\Webapi\Controller\ServiceArgsSerializer'); - $this->areaListMock = $this->getMock('\Magento\App\AreaList', array(), array(), '', false); - $this->areaMock = $this->getMock('Magento\App\AreaInterface'); + $this->serializerMock = $this->getMockBuilder('\Magento\Webapi\Controller\ServiceArgsSerializer') + ->disableOriginalConstructor() + ->setMethods(['getInputData'])->getMock(); + $this->areaListMock = $this->getMock('\Magento\Framework\App\AreaList', array(), array(), '', false); + $this->areaMock = $this->getMock('Magento\Framework\App\AreaInterface'); $this->areaListMock->expects($this->any())->method('getArea')->will($this->returnValue($this->areaMock)); /** Init SUT. */ @@ -132,7 +141,7 @@ class RestTest extends \PHPUnit_Framework_TestCase 'appState' => $this->_appStateMock, 'layout' => $layoutMock, 'authorizationService' => $this->_authzServiceMock, - 'serializer' => $serializer, + 'serializer' => $this->serializerMock, 'errorProcessor' => $errorProcessorMock, 'areaList' => $this->areaListMock ) @@ -158,7 +167,6 @@ class RestTest extends \PHPUnit_Framework_TestCase $this->_objectManagerMock->expects($this->any())->method('get')->will($this->returnValue($this->_serviceMock)); $this->_responseMock->expects($this->any())->method('prepareResponse')->will($this->returnValue(array())); - $this->_requestMock->expects($this->any())->method('getRequestData')->will($this->returnValue(array())); $this->_serviceMock->expects($this->any())->method(self::SERVICE_METHOD)->will($this->returnValue(null)); parent::setUp(); @@ -188,8 +196,11 @@ class RestTest extends \PHPUnit_Framework_TestCase $this->_appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); $this->_serviceMock->expects($this->any())->method(self::SERVICE_METHOD)->will($this->returnValue(array())); $this->_routeMock->expects($this->any())->method('isSecure')->will($this->returnValue($isSecureRoute)); + $this->_routeMock->expects($this->once())->method('getParameters')->will($this->returnValue(array())); + $this->_requestMock->expects($this->any())->method('getRequestData')->will($this->returnValue(array())); $this->_requestMock->expects($this->any())->method('isSecure')->will($this->returnValue($isSecureRequest)); $this->_authzServiceMock->expects($this->once())->method('isAllowed')->will($this->returnValue(true)); + $this->serializerMock->expects($this->any())->method('getInputData')->will($this->returnValue([])); $this->_restController->dispatch($this->_requestMock); $this->assertFalse($this->_responseMock->isException()); } @@ -238,7 +249,62 @@ class RestTest extends \PHPUnit_Framework_TestCase $exceptionArray = $this->_responseMock->getException(); $this->assertEquals($expectedMsg, $exceptionArray[0]->getMessage()); } + + /** + * @param array $requestData Data from the request + * @param array $parameters Data from config about which parameters to override + * @param array $expectedOverriddenParams Result of overriding $requestData when applying rules from $parameters + * + * @dataProvider overrideParmasDataProvider + */ + public function testOverrideParams($requestData, $parameters, $expectedOverriddenParams) + { + $this->_routeMock->expects($this->once())->method('getParameters')->will($this->returnValue($parameters)); + $this->_appStateMock->expects($this->any())->method('isInstalled')->will($this->returnValue(true)); + $this->_authzServiceMock->expects($this->once())->method('isAllowed')->will($this->returnValue(true)); + $this->_requestMock->expects($this->any())->method('getRequestData')->will($this->returnValue($requestData)); + + // serializer should expect overridden params + $this->serializerMock->expects($this->once())->method('getInputData') + ->with( + $this->equalTo('Magento\Webapi\Controller\TestService'), + $this->equalTo('testMethod'), + $this->equalTo($expectedOverriddenParams) + ); + + $this->_restController->dispatch($this->_requestMock); + } + + /** + * @return array + */ + public function overrideParmasDataProvider() + { + return [ + 'force false, value present' => [ + ['Name1' => 'valueIn'], + ['Name1' => ['force' => false, 'value' => 'valueOverride']], + ['Name1' => 'valueIn'], + ], + 'force true, value present' => [ + ['Name1' => 'valueIn'], + ['Name1' => ['force' => true, 'value' => 'valueOverride']], + ['Name1' => 'valueOverride'] + ], + 'force true, value not present' => [ + ['Name1' => 'valueIn'], + ['Name2' => ['force' => true, 'value' => 'valueOverride']], + ['Name1' => 'valueIn', 'Name2' => 'valueOverride'] + ], + 'force false, value not present' => [ + ['Name1' => 'valueIn'], + ['Name2' => ['force' => false, 'value' => 'valueOverride']], + ['Name1' => 'valueIn', 'Name2' => 'valueOverride'], + ], + ]; + } } + class TestService { public function testMethod() diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Soap/RequestTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Soap/RequestTest.php index 77a82a7cdb7fcf297963f0632d880ee8b0ba8d61..9a555725d19c17745e250f3b21363bacbf07fad1 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/Soap/RequestTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/Soap/RequestTest.php @@ -33,7 +33,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase protected function setUp() { /** Prepare mocks for SUT constructor. */ - $areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $areaListMock->expects($this->once())->method('getFrontName')->will($this->returnValue('soap')); diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php index ee910bac71aa923e9f9369816ca306a8750086bf..b59f1d505b255a3f7a0e9a4f0acb2f3ab92316ab 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/SoapTest.php @@ -45,7 +45,7 @@ class SoapTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Webapi\Controller\ErrorProcessor */ protected $_errorProcessorMock; - /** @var \Magento\App\State */ + /** @var \Magento\Framework\App\State */ protected $_appStateMock; /** @var \Magento\Oauth\Oauth */ @@ -83,7 +83,7 @@ class SoapTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->setMethods(array('maskException')) ->getMock(); - $this->_appStateMock = $this->getMock('\Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $localeMock = $this->getMockBuilder('Magento\Locale') ->disableOriginalConstructor() ->setMethods(array('getLanguage')) @@ -107,8 +107,9 @@ class SoapTest extends \PHPUnit_Framework_TestCase $this->_soapServerMock->expects($this->any())->method('setWSDL')->will($this->returnSelf()); $this->_soapServerMock->expects($this->any())->method('setEncoding')->will($this->returnSelf()); $this->_soapServerMock->expects($this->any())->method('setReturnResponse')->will($this->returnSelf()); - $areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); - $areaMock = $this->getMock('Magento\App\AreaInterface'); + $pathProcessorMock = $this->getMock('Magento\Webapi\Model\PathProcessor', [], [], '', false); + $areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); + $areaMock = $this->getMock('Magento\Framework\App\AreaInterface'); $areaListMock->expects($this->any())->method('getArea')->will($this->returnValue($areaMock)); $this->_soapController = new \Magento\Webapi\Controller\Soap( $this->_requestMock, @@ -120,6 +121,7 @@ class SoapTest extends \PHPUnit_Framework_TestCase $layoutMock, $this->_oauthServiceMock, $localeResolverMock, + $pathProcessorMock, $areaListMock ); } diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/XsdTest.php deleted file mode 100644 index 966a2ab15978278e0aa133d58abff47c0311c39c..0000000000000000000000000000000000000000 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/XsdTest.php +++ /dev/null @@ -1,250 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Webapi\Model\Config; - -/** - * Test for validation rules implemented by XSD schema for API integration configuration. - */ -class XsdTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - protected $_schemaFile; - - protected function setUp() - { - $this->_schemaFile = BP . '/app/code/Magento/Webapi/etc/webapi.xsd'; - } - - /** - * @param string $fixtureXml - * @param array $expectedErrors - * @dataProvider exemplarXmlDataProvider - */ - public function testExemplarXml($fixtureXml, array $expectedErrors) - { - $messageFormat = '%message%'; - $dom = new \Magento\Config\Dom($fixtureXml, array(), null, null, $messageFormat); - $actualResult = $dom->validate($this->_schemaFile, $actualErrors); - $this->assertEquals(empty($expectedErrors), $actualResult, "Validation result is invalid."); - $this->assertEquals($expectedErrors, $actualErrors, "Validation errors does not match."); - } - - /** - * @return array - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function exemplarXmlDataProvider() - { - return array( - /** Valid configurations */ - 'valid' => array( - // @codingStandardsIgnoreStart - '<config> - <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id'. - '</rest-route> - <rest-route httpMethod="POST" method="create" isSecure="1" '. - 'resources="Magento_TestModule1::resource1,Magento_TestModule1::resource2"></rest-route> - </service> - </config>', - array() - ), - 'valid with several entities' => array( - '<config> - <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id'. - '</rest-route> - <rest-route httpMethod="GET" method="items" resources="Magento_TestModule1::resource2">'. - '</rest-route> - <rest-route httpMethod="POST" method="create" resources="Magento_TestModule1::resource3">'. - '</rest-route> - <rest-route httpMethod="PUT" method="update" '. - 'resources="Magento_TestModule1::resource1,Magento_TestModule1::resource2">/:id</rest-route> - </service> - - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id'. - '</rest-route> - <rest-route httpMethod="GET" method="items" resources="Magento_TestModule1::resource2">'. - '</rest-route> - <rest-route httpMethod="POST" method="create" resources="Magento_TestModule1::resource3">'. - '</rest-route> - <rest-route httpMethod="PUT" method="update" '. - 'resources="Magento_TestModule1::resource1,Magento_TestModule1::resource2">/:id</rest-route> - <rest-route httpMethod="DELETE" method="delete" '. - 'resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id'. - '</rest-route> - <rest-route httpMethod="GET" method="items" resources="Magento_TestModule1::resource2">'. - '</rest-route> - <rest-route httpMethod="POST" method="create" resources="Magento_TestModule1::resource3">'. - '</rest-route> - <rest-route httpMethod="PUT" method="update" '. - 'resources="Magento_TestModule1::resource1,Magento_TestModule1::resource2">/:id</rest-route> - <rest-route httpMethod="DELETE" method="delete" '. - 'resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - </config>', - array() - ), - /** Missing required nodes */ - 'empty root node' => array( - '<config/>', - array("Element 'config': Missing child element(s). Expected is ( service ).") - ), - 'empty rest-route' => array( - '<config> - <service/> - </config>', - array("Element 'service': Missing child element(s). Expected is ( rest-route ).") - ), - 'invalid rest-routes' => array( - '<config> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface"> - <rest-route> - <invalid></invalid> - </rest-route> - </service> - </config>', - array( - "Element 'rest-route': ". - "Element content is not allowed, because the content type is a simple type definition." - ) - ), - 'irrelevant root node' => array( - '<invalid/>', - array("Element 'invalid': No matching global declaration available for the validation root.") - ), - /** Excessive nodes */ - 'irrelevant node in root' => array( - '<config> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface"> - <rest-route> - </rest-route> - </service> - <invalid/> - </config>', - array("Element 'invalid': This element is not expected. Expected is ( service ).") - ), - 'irrelevant node in service' => array( - '<config> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface"> - <rest-route> - </rest-route> - <invalid/> - </service> - </config>', - array("Element 'invalid': This element is not expected. Expected is ( rest-route ).") - ), - 'irrelevant node in rest-routes' => array( - '<config> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface"> - <rest-route> - <invalid/> - </rest-route> - </service> - </config>', - array( - "Element 'rest-route': Element content is not allowed, ". - "because the content type is a simple type definition." - ) - ), - /** Excessive attributes */ - 'invalid attribute in root' => array( - '<config invalid="invalid"> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_TestModule1::resource1">/:id'. - '</rest-route> - </service> - </config>', - array("Element 'config', attribute 'invalid': The attribute 'invalid' is not allowed.") - ), - 'invalid attribute in service' => array( - '<config> - <service invalid="invalid" class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" '. - 'baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" '. - 'resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - </config>', - array("Element 'service', attribute 'invalid': The attribute 'invalid' is not allowed.") - ), - 'invalid attribute in rest-routes' => array( - '<config> - <service class="Magento\TestModule1\Service\V2\AllSoapAndRestInterface" '. - 'baseUrl="/V2/testmodule1"> - <rest-route invalid="invalid" httpMethod="GET" method="item" '. - 'resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - </config>', - array("Element 'rest-route', attribute 'invalid': The attribute 'invalid' is not allowed.") - ), - /** Invalid values */ - 'rest-route with invalid httpMethod' => array( - '<config> - <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route httpMethod="INVALID" method="item" '. - 'resources="Magento_TestModule1::resource1">/:id</rest-route> - </service> - </config>', - array( - "Element 'rest-route', attribute 'httpMethod': [facet 'enumeration'] " . - "The value 'INVALID' is not an element of the set {'GET', 'PUT', 'POST', 'DELETE'}.", - "Element 'rest-route', attribute 'httpMethod': 'INVALID' ". - "is not a valid value of the local atomic type." - ) - ), - 'rest-route with invalid isSecure key type' => array( - '<config> - <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route isSecure="Invalid"></rest-route> - </service> - </config>', - array( - "Element 'rest-route', attribute 'isSecure': " . - "'Invalid' is not a valid value of the atomic type 'xs:boolean'." - ) - ), - 'rest-route with invalid resources type' => array( - '<config> - <service class="Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route resources="Invalid"></rest-route> - </service> - </config>', - array( - "Element 'rest-route', attribute 'resources': [facet 'pattern'] " . - "The value 'Invalid' is not accepted by the pattern '.+::.+(, ?.+::.+)*'.", - "Element 'rest-route', attribute 'resources': 'Invalid' ". - "is not a valid value of the atomic type 'resourcesType'." - ) - ) - ); - // @codingStandardsIgnoreEnd - } -} diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.php index b63573c25b8ade550419f03254c737fd6263c9b4..505a19c7d9ef5f71fe3f69e36f0b5246a25decf3 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.php @@ -21,49 +21,112 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -return array( - '\Magento\TestModule1\Service\V1\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule1\Service\V1\AllSoapAndRestInterface', - 'baseUrl' => '/V1/testmodule1', - 'methods' => array( - 'item' => array( - 'httpMethod' => 'GET', - 'method' => 'item', - 'route' => '/:id', - 'isSecure' => false, - 'resources' => array('Magento_Test1::resource1') - ) - ) - ), - '\Magento\TestModule1\Service\V2\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule1\Service\V2\AllSoapAndRestInterface', - 'baseUrl' => '/V2/testmodule1', - 'methods' => array( - 'item' => array( - 'httpMethod' => 'GET', - 'method' => 'item', - 'route' => '/:id', - 'isSecure' => false, - 'resources' => array('Magento_Test1::resource1', 'Magento_Test1::resource2') - ), - 'create' => array( - 'httpMethod' => 'POST', - 'method' => 'create', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_Test1::resource1', 'Magento_Test1::resource2') - ), - 'delete' => array( - 'httpMethod' => 'DELETE', - 'method' => 'delete', - 'route' => '/:id', - 'isSecure' => true, - 'resources' => array('Magento_Test1::resource2') - ) - ) - ), - '\Magento\TestModule1\Service\V3\AllSoapAndRestInterface' => array( - 'class' => '\Magento\TestModule1\Service\V3\AllSoapAndRestInterface', - 'methods' => array() - ) -); +return [ + 'services' => [ + 'Magento\Customer\Service\V1\CustomerServiceInterface' => [ + 'getCustomer' => [ + 'resources' => [ + 'Magento_Customer::customer_self' => true, + 'Magento_Customer::read' => true, + ], + 'secure' => false, + ], + 'updateCustomer' => [ + 'resources' => [ + 'Magento_Customer::customer_self' => true, + ], + 'secure' => true, + ], + 'createCustomer' => [ + 'resources' => [ + 'Magento_Customer::manage' => true, + ], + 'secure' => false, + ], + 'deleteCustomer' => [ + 'resources' => [ + 'Magento_Customer::manage' => true, + 'Magento_Customer::delete' => true, + ], + 'secure' => false, + ], + ], + ], + 'routes' => [ + '/V1/customers/me' => [ + 'GET' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\Customer\Service\V1\CustomerServiceInterface', + 'method' => 'getCustomer', + ], + 'resources' => [ + 'Magento_Customer::customer_self' => true, + ], + 'parameters' => [ + 'id' => [ + 'force' => true, + 'value' => null, + ], + ], + ], + 'PUT' => [ + 'secure' => true, + 'service' => [ + 'class' => 'Magento\Customer\Service\V1\CustomerServiceInterface', + 'method' => 'updateCustomer', + ], + 'resources' => [ + 'Magento_Customer::customer_self' => true, + ], + 'parameters' => [ + 'id' => [ + 'force' => false, + 'value' => null, + ], + ], + ] + ], + '/V1/customers' => [ + 'POST' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\Customer\Service\V1\CustomerServiceInterface', + 'method' => 'createCustomer', + ], + 'resources' => [ + 'Magento_Customer::manage' => true, + ], + 'parameters' => [ + ], + ], + ], + '/V1/customers/:id' => [ + 'GET' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\Customer\Service\V1\CustomerServiceInterface', + 'method' => 'getCustomer', + ], + 'resources' => [ + 'Magento_Customer::read' => true, + ], + 'parameters' => [ + ], + ], + 'DELETE' => [ + 'secure' => false, + 'service' => [ + 'class' => 'Magento\Customer\Service\V1\CustomerServiceInterface', + 'method' => 'deleteCustomer', + ], + 'resources' => [ + 'Magento_Customer::manage' => true, + 'Magento_Customer::delete' => true, + ], + 'parameters' => [ + ], + ], + ], + ], +]; diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.xml b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.xml index d5a15cb9a5f6725339b67b2890927087900ac54c..d596a3c78d0c7f07b404a0320c794f873851aa05 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.xml +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/_files/webapi.xml @@ -23,17 +23,43 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> - <service class="\Magento\TestModule1\Service\V1\AllSoapAndRestInterface" baseUrl="/V1/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_Test1::resource1">/:id</rest-route> - </service> - - <service class="\Magento\TestModule1\Service\V2\AllSoapAndRestInterface" baseUrl="/V2/testmodule1"> - <rest-route httpMethod="GET" method="item" resources="Magento_Test1::resource1, Magento_Test1::resource2">/:id</rest-route> - <rest-route httpMethod="POST" method="create" resources="Magento_Test1::resource1,Magento_Test1::resource2"></rest-route> - <rest-route httpMethod="DELETE" method="delete" isSecure="true" resources="Magento_Test1::resource2">/:id</rest-route> - </service> - - <!--TODO: All service methods must have resources that's why all of them must be declared explicitly--> - <service class="\Magento\TestModule1\Service\V3\AllSoapAndRestInterface"/> -</config> +<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Webapi/etc/webapi.xsd"> + <route url="/V1/customers/me" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="getCustomer" /> + <resources> + <resource ref="Magento_Customer::customer_self" /> + </resources> + <data> + <parameter name="id" force="true">null</parameter> + </data> + </route> + <route url="/V1/customers/me" method="PUT" secure="true"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="updateCustomer" /> + <resources> + <resource ref="Magento_Customer::customer_self" /> + </resources> + <data> + <parameter name="id">null</parameter> + </data> + </route> + <route url="/V1/customers" method="POST"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="createCustomer" /> + <resources> + <resource ref="Magento_Customer::manage" /> + </resources> + </route> + <route url="/V1/customers/:id" method="GET"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="getCustomer" /> + <resources> + <resource ref="Magento_Customer::read" /> + </resources> + </route> + <route url="/V1/customers/:id" method="DELETE"> + <service class="Magento\Customer\Service\V1\CustomerServiceInterface" method="deleteCustomer" /> + <resources> + <resource ref="Magento_Customer::manage" /> + <resource ref="Magento_Customer::delete" /> + </resources> + </route> +</routes> diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php index 39eca5a8644734ed96a565531b285482af6a1aef..afe9c2fc2c68c7b2ede3240326695419feeb14ac 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ConfigTest.php @@ -47,9 +47,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $objectManagerMock = $this->getMockBuilder( - 'Magento\App\ObjectManager' + 'Magento\Framework\App\ObjectManager' )->disableOriginalConstructor()->getMock(); - $fileSystemMock = $this->getMockBuilder('Magento\App\Filesystem')->disableOriginalConstructor()->getMock(); + $fileSystemMock = $this->getMockBuilder('Magento\Framework\App\Filesystem') + ->disableOriginalConstructor() + ->getMock(); $classReflection = $this->getMock( 'Magento\Webapi\Model\Config\ClassReflector', array('reflectClassMethods'), @@ -60,34 +62,27 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $classReflection->expects($this->any())->method('reflectClassMethods')->will($this->returnValue(array())); $this->_helperMock = $this->getMock('Magento\Webapi\Helper\Data', array(), array(), '', false); $this->_configMock = $this->getMock('Magento\Webapi\Model\Config', array(), array(), '', false); - $servicesConfig = array( - 'ModuleFooV1' => array( - 'class' => 'Magento\Module\Service\FooV1Interface', - 'baseUrl' => '/V1/foo', - 'methods' => array( - 'someMethod' => array( - 'httpMethod' => 'GET', - 'method' => 'someMethod', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource1') - ) - ) - ), - 'ModuleBarV1' => array( - 'class' => 'Magento\Module\Service\BarV1Interface', - 'baseUrl' => '/V1/bar', - 'methods' => array( - 'someMethod' => array( - 'httpMethod' => 'GET', - 'method' => 'someMethod', - 'route' => '', - 'isSecure' => false, - 'resources' => array('Magento_TestModule1::resource2') - ) - ) - ) - ); + $servicesConfig = [ + 'services' => [ + 'Magento\Module\Service\FooV1Interface' => [ + 'someMethod' => [ + 'resources' => [ + 'Magento_TestModule1::resource1' => true, + ], + 'secure' => false, + ], + ], + 'Magento\Module\Service\BarV1Interface' => [ + 'someMethod' => [ + 'resources' => [ + 'Magento_TestModule1::resource2' => true, + ], + 'secure' => false, + ], + ], + ], + ]; + $this->_configMock->expects($this->once())->method('getServices')->will($this->returnValue($servicesConfig)); $this->_helperMock->expects( $this->any() diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/FaultTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/FaultTest.php index f544fbddb637c56f958e68bb581b72491ca47867..cfd8d7a5b27cce20ed4115a9553aa122a09d382f 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/FaultTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/FaultTest.php @@ -51,7 +51,7 @@ class FaultTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_requestMock = $this->getMock('\Magento\App\RequestInterface'); + $this->_requestMock = $this->getMock('\Magento\Framework\App\RequestInterface'); /** Initialize SUT. */ $message = "Soap fault reason."; $details = array('param1' => 'value1', 'param2' => 2); @@ -78,7 +78,7 @@ class FaultTest extends \PHPUnit_Framework_TestCase $this->returnValue(new \Zend_Locale('en_US')) ); - $this->_appStateMock = $this->getMock('\Magento\App\State', array(), array(), '', false); + $this->_appStateMock = $this->getMock('\Magento\Framework\App\State', array(), array(), '', false); $this->_soapFault = new \Magento\Webapi\Model\Soap\Fault( $this->_requestMock, diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ServerTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ServerTest.php index e04ddf7aadb7aed49cffd943b9a953fa3431e6cf..9909e2abd43271c327561e42eb5cb7fc4d4df5fe 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ServerTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Soap/ServerTest.php @@ -67,6 +67,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase )->will( $this->returnValue('http://magento.com/') ); + $this->_storeMock->expects($this->any())->method('getCode')->will($this->returnValue('storeCode')); $this->_storeManagerMock->expects( $this->any() @@ -76,7 +77,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase $this->returnValue($this->_storeMock) ); - $areaListMock = $this->getMock('Magento\App\AreaList', array(), array(), '', false); + $areaListMock = $this->getMock('Magento\Framework\App\AreaList', array(), array(), '', false); $configScopeMock = $this->getMock('Magento\Config\ScopeInterface'); $areaListMock->expects($this->any())->method('getFrontName')->will($this->returnValue('soap')); @@ -100,7 +101,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase false ); - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); /** Init SUT. */ $this->_soapServer = new \Magento\Webapi\Model\Soap\Server( @@ -159,7 +160,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase */ public function testGetEndpointUri() { - $expectedResult = 'http://magento.com/soap'; + $expectedResult = 'http://magento.com/soap/storeCode'; $actualResult = $this->_soapServer->getEndpointUri(); $this->assertEquals($expectedResult, $actualResult, 'Endpoint URI building is invalid.'); } @@ -172,7 +173,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase $param = "testModule1AllSoapAndRest:V1,testModule2AllSoapNoRest:V1"; $serviceKey = \Magento\Webapi\Model\Soap\Server::REQUEST_PARAM_SERVICES; $this->_requestMock->expects($this->any())->method('getParam')->will($this->returnValue($param)); - $expectedResult = "http://magento.com/soap?{$serviceKey}={$param}&wsdl=1"; + $expectedResult = "http://magento.com/soap/storeCode?{$serviceKey}={$param}&wsdl=1"; $actualResult = $this->_soapServer->generateUri(true); $this->assertEquals($expectedResult, urldecode($actualResult), 'URI (with WSDL param) generated is invalid.'); } @@ -185,7 +186,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase $param = "testModule1AllSoapAndRest:V1,testModule2AllSoapNoRest:V1"; $serviceKey = \Magento\Webapi\Model\Soap\Server::REQUEST_PARAM_SERVICES; $this->_requestMock->expects($this->any())->method('getParam')->will($this->returnValue($param)); - $expectedResult = "http://magento.com/soap?{$serviceKey}={$param}"; + $expectedResult = "http://magento.com/soap/storeCode?{$serviceKey}={$param}"; $actualResult = $this->_soapServer->generateUri(false); $this->assertEquals( $expectedResult, diff --git a/dev/tests/unit/testsuite/Magento/Weee/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Weee/Helper/DataTest.php index 371faa7f250e2482c2a9ea8bbb47bbb3b14c228d..ef372460155b4e6aa47aba858d6b4171facfe4cf 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Helper/DataTest.php @@ -38,7 +38,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); - $scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface', [], [], '', false); + $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); $scopeConfig->expects($this->any())->method('getValue')->will($this->returnValue(true)); $weeeTax = $this->getMock('Magento\Weee\Model\Tax', [], [], '', false); $weeeTax->expects($this->any())->method('getWeeeAmount')->will($this->returnValue('11.26')); diff --git a/dev/tests/unit/testsuite/Magento/Weee/Pricing/AdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Weee/Pricing/AdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..95570a35a65d75737c44f77b8bd03d73c36c1826 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Weee/Pricing/AdjustmentTest.php @@ -0,0 +1,203 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Weee\Pricing; + +use Magento\Weee\Helper\Data as WeeeHelper; +use Magento\Pricing\Object\SaleableInterface; + +class AdjustmentTest extends \PHPUnit_Framework_TestCase +{ + public function testGetAdjustmentCode() + { + // Instantiate/mock objects + /** @var WeeeHelper $weeHelper */ + $weeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor() + ->setMethods(array()) + ->getMock(); + $model = new Adjustment($weeHelper); + + // Run tested method + $code = $model->getAdjustmentCode(); + + // Check expectations + $this->assertNotEmpty($code); + } + + public function testIsIncludedInBasePrice() + { + // Instantiate/mock objects + /** @var WeeeHelper|\PHPUnit_Framework_MockObject_MockObject $weeeHelper */ + $weeeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor()->getMock(); + $model = new Adjustment($weeeHelper); + + // Run tested method + $result = $model->isIncludedInBasePrice(); + + // Check expectations + $this->assertInternalType('bool', $result); + } + + /** + * @dataProvider isIncludedInDisplayPriceDataProvider + */ + public function testIsIncludedInDisplayPrice($expectedResult) + { + // Instantiate/mock objects + /** @var WeeeHelper|\PHPUnit_Framework_MockObject_MockObject $weeeHelper */ + $weeeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('typeOfDisplay')) + ->getMock(); + $model = new Adjustment($weeeHelper); + + // Avoid execution of irrelevant functionality + $weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with( + $this->equalTo( + [ + \Magento\Weee\Model\Tax::DISPLAY_INCL, + \Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, + \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, + 4 + ] + ) + ) + ->will($this->returnValue($expectedResult)); + + // Run tested method + $result = $model->isIncludedInDisplayPrice(); + + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function isIncludedInDisplayPriceDataProvider() + { + return [[false], [true]]; + } + + /** + * @param float $amount + * @param float $expectedResult + * @dataProvider extractAdjustmentDataProvider + */ + public function testExtractAdjustment($amount, $expectedResult) + { + // Instantiate/mock objects + /** @var WeeeHelper|\PHPUnit_Framework_MockObject_MockObject $weeeHelper */ + $weeeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('getAmount')) + ->getMock(); + /** @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject $saleableItem */ + $saleableItem = $this->getMockBuilder('Magento\Pricing\Object\SaleableInterface')->getMock(); + $model = new Adjustment($weeeHelper); + + // Avoid execution of irrelevant functionality + $weeeHelper->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($amount)); + + // Run tested method + $result = $model->extractAdjustment('anything_here', $saleableItem); + + // Check expectations + $this->assertInternalType('float', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function extractAdjustmentDataProvider() + { + return [ + [1.1, 1.1], + [0.0, 0.0], + ]; + } + + /** + * @param float $amount + * @param float $amountOld + * @param float $expectedResult + * @dataProvider applyAdjustmentDataProvider + */ + public function testApplyAdjustment($amount, $amountOld, $expectedResult) + { + // Instantiate/mock objects + /** @var WeeeHelper|\PHPUnit_Framework_MockObject_MockObject $weeeHelper */ + $weeeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor() + ->setMethods(array('getAmount')) + ->getMock(); + /** @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject $taxHelper */ + $object = $this->getMockBuilder('Magento\Pricing\Object\SaleableInterface')->getMock(); + $model = new Adjustment($weeeHelper); + + // Avoid execution of irrelevant functionality + $weeeHelper->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($amountOld)); + + // Run tested method + $result = $model->applyAdjustment($amount, $object); + + // Check expectations + $this->assertInternalType('float', $result); + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function applyAdjustmentDataProvider() + { + return [ + [1.1, 2.2, 3.3], + [0.0, 2.2, 2.2], + [1.1, 0.0, 1.1], + ]; + } + + public function testIsExcludedWith() + { + $adjustmentCode = 'some_random_adjustment_code123'; + + // Instantiate/mock objects + /** @var WeeeHelper|\PHPUnit_Framework_MockObject_MockObject $weeeHelper */ + $weeeHelper = $this->getMockBuilder('Magento\Weee\Helper\Data')->disableOriginalConstructor()->getMock(); + $model = new Adjustment($weeeHelper); + + // Run tested method + $result = $model->isExcludedWith($adjustmentCode); + + // Check expectations + $this->assertInternalType('bool', $result); + $this->assertFalse($result); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Weee/Pricing/Render/AdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Weee/Pricing/Render/AdjustmentTest.php new file mode 100644 index 0000000000000000000000000000000000000000..02d74f1da549ccabf24eb1ef829594f0239e14c3 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Weee/Pricing/Render/AdjustmentTest.php @@ -0,0 +1,373 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Weee\Pricing\Render; + +/** + * Class AdjustmentTest for testing Adjustment class + * + * @package Magento\Weee\Pricing\Render + */ +class AdjustmentTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Weee\Pricing\Render\Adjustment + */ + protected $model; + + /** + * @var \Magento\Weee\Helper\Data + */ + protected $weeeHelperMock; + + /** + * Context mock + * + * @var \Magento\View\Element\Template\Context + */ + protected $contextMock; + + /** + * Price currency model mock + * + * @var \Magento\Directory\Model\PriceCurrency + */ + protected $priceCurrencyMock; + + /** + * Set up mocks for tested class + */ + public function setUp() + { + $this->contextMock = $this->getMock('Magento\View\Element\Template\Context', [], [], '', false); + $this->priceCurrencyMock = $this->getMockForAbstractClass( + 'Magento\Pricing\PriceCurrencyInterface', + [], + '', + true, + true, + true, + [] + ); + $this->weeeHelperMock = $this->getMock('\Magento\Weee\Helper\Data', [], [], '', false); + $eventManagerMock = $this->getMockBuilder('Magento\Event\ManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $storeConfigMock = $this->getMockBuilder('Magento\Store\Model\Store\Config') + ->disableOriginalConstructor() + ->getMock(); + + $scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface'); + + $this->contextMock->expects($this->any()) + ->method('getEventManager') + ->will($this->returnValue($eventManagerMock)); + $this->contextMock->expects($this->any()) + ->method('getStoreConfig') + ->will($this->returnValue($storeConfigMock)); + $this->contextMock->expects($this->any()) + ->method('getScopeConfig') + ->will($this->returnValue($scopeConfigMock)); + + $this->model = new Adjustment( + $this->contextMock, + $this->priceCurrencyMock, + $this->weeeHelperMock + ); + } + + /** + * Test for method getAdjustmentCode + */ + public function testGetAdjustmentCode() + { + $this->assertEquals(\Magento\Weee\Pricing\Adjustment::CODE, $this->model->getAdjustmentCode()); + } + + /** + * Test for method getFinalAmount + */ + public function testGetFinalAmount() + { + $expectedValue = 10; + $typeOfDisplay = 1; //Just to set it to not false + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getSaleableItem', 'getDisplayValue', 'getAmount']) + ->getMock(); + $amountRender->expects($this->any()) + ->method('getDisplayValue') + ->will($this->returnValue($expectedValue)); + $this->weeeHelperMock->expects($this->any())->method('typeOfDisplay')->will($this->returnValue($typeOfDisplay)); + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + + $this->model->render($amountRender); + $result = $this->model->getFinalAmount(); + + $this->assertEquals($expectedValue, $result); + } + + /** + * Test for method showInclDescr + * + * @dataProvider showInclDescrDataProvider + */ + public function testShowInclDescr($typeOfDisplay, $amount, $expectedResult) + { + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getSaleableItem', 'getDisplayValue', 'getAmount']) + ->getMock(); + /** @var \Magento\Catalog\Model\Product $saleable */ + $saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['__wakeup']) + ->getMock(); + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + + $baseAmount->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($amount)); + + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + + $callback = function ($argument) use ($typeOfDisplay) { + if (is_array($argument)) { + return in_array($typeOfDisplay, $argument); + } else { + return $argument == $typeOfDisplay; + } + }; + + $this->weeeHelperMock->expects($this->any())->method('typeOfDisplay')->will($this->returnCallback($callback)); + $this->weeeHelperMock->expects($this->any())->method('getAmount')->will($this->returnValue($amount)); + $amountRender->expects($this->any())->method('getSaleableItem')->will($this->returnValue($saleable)); + + $this->model->render($amountRender); + $result = $this->model->showInclDescr(); + + $this->assertEquals($expectedResult, $result); + } + + /** + * Data provider for testShowInclDescr + * + * @return array + */ + public function showInclDescrDataProvider() + { + return [ + [\Magento\Weee\Model\Tax::DISPLAY_INCL, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, 1.23, true], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL, 1.23, false], + [4, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL, 0, false], + [4, 0, false], + ]; + } + + /** + * Test method for showExclDescrIncl + * + * @param int $typeOfDisplay + * @param float $amount + * @param bool $expectedResult + * @dataProvider showExclDescrInclDataProvider + */ + public function testShowExclDescrIncl($typeOfDisplay, $amount, $expectedResult) + { + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getSaleableItem', 'getDisplayValue', 'getAmount']) + ->getMock(); + /** @var \Magento\Catalog\Model\Product $saleable */ + $saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['__wakeup']) + ->getMock(); + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $baseAmount->expects($this->any()) + ->method('getValue') + ->will($this->returnValue($amount)); + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + + $callback = function ($argument) use ($typeOfDisplay) { + if (is_array($argument)) { + return in_array($typeOfDisplay, $argument); + } else { + return $argument == $typeOfDisplay; + } + }; + + $this->weeeHelperMock->expects($this->any())->method('typeOfDisplay')->will($this->returnCallback($callback)); + $this->weeeHelperMock->expects($this->any())->method('getAmount')->will($this->returnValue($amount)); + $amountRender->expects($this->any())->method('getSaleableItem')->will($this->returnValue($saleable)); + + $this->model->render($amountRender); + $result = $this->model->showExclDescrIncl(); + + $this->assertEquals($expectedResult, $result); + } + + /** + * Data provider for testShowExclDescrIncl + * + * @return array + */ + public function showExclDescrInclDataProvider() + { + return [ + [\Magento\Weee\Model\Tax::DISPLAY_INCL, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 1.23, true], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL, 1.23, false], + [4, 1.23, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, 0, false], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL, 0, false], + [4, 0, false], + ]; + } + + /** + * Test for method getWeeeTaxAttributes + * + * @param int $typeOfDisplay + * @param array $attributes + * @param array $expectedResult + * @dataProvider getWeeeTaxAttributesDataProvider + */ + public function testGetWeeeTaxAttributes($typeOfDisplay, $attributes, $expectedResult) + { + /** @var \Magento\Pricing\Render\Amount $amountRender */ + $amountRender = $this->getMockBuilder('Magento\Pricing\Render\Amount') + ->disableOriginalConstructor() + ->setMethods(['getSaleableItem', 'getDisplayValue', 'getAmount']) + ->getMock(); + /** @var \Magento\Catalog\Model\Product $saleable */ + $saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['__wakeup']) + ->getMock(); + /** @var \Magento\Pricing\Amount\Base $baseAmount */ + $baseAmount = $this->getMockBuilder('Magento\Pricing\Amount\Base') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $amountRender->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($baseAmount)); + $callback = function ($argument) use ($typeOfDisplay) { + if (is_array($argument)) { + return in_array($typeOfDisplay, $argument); + } else { + return $argument == $typeOfDisplay; + } + }; + $this->weeeHelperMock->expects($this->any())->method('typeOfDisplay')->will($this->returnCallback($callback)); + $this->weeeHelperMock->expects($this->any()) + ->method('getProductWeeeAttributesForDisplay') + ->will($this->returnValue($attributes)); + $amountRender->expects($this->any())->method('getSaleableItem')->will($this->returnValue($saleable)); + + $this->model->render($amountRender); + $result = $this->model->getWeeeTaxAttributes(); + + $this->assertEquals($expectedResult, $result); + } + + /** + * Data provider for testGetWeeeTaxAttributes + * + * @return array + */ + public function getWeeeTaxAttributesDataProvider() + { + return [ + [\Magento\Weee\Model\Tax::DISPLAY_INCL, [1,2,3], []], + [\Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, [1,2,3], [1,2,3]], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, [1,2,3], [1,2,3]], + [\Magento\Weee\Model\Tax::DISPLAY_EXCL, [1,2,3], []], + [4, [1,2,3], []], + ]; + } + + /** + * Test for method renderWeeeTaxAttribute + * + * @param \Magento\Object $attribute + * @param string $expectedResult + * @dataProvider renderWeeeTaxAttributeDataProvider + */ + public function testRenderWeeeTaxAttribute($attribute, $expectedResult) + { + $this->priceCurrencyMock->expects($this->any())->method('convertAndFormat')->will($this->returnArgument(0)); + + $result = $this->model->renderWeeeTaxAttribute($attribute); + $this->assertEquals($expectedResult, $result); + } + + /** + * Data provider for testRenderWeeeTaxAttribute + * + * @return array + */ + public function renderWeeeTaxAttributeDataProvider() + { + return [ + [new \Magento\Object(['name' => 'name1', 'amount' => 51]), 'name1: 51'], + [new \Magento\Object(['name' => 'name1', 'amount' => false]), 'name1: '], + [new \Magento\Object(['name' => false, 'amount' => 51]), ': 51'], + [new \Magento\Object(['name' => false, 'amount' => false]), ': '], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php b/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php index a9e4d29a74ba6bf04098a6e0830b875f97f88f85..6cc097075e5eec8dd13abb2f07b23d24307e975f 100644 --- a/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php +++ b/dev/tests/unit/testsuite/Magento/Widget/Model/Widget/InstanceTest.php @@ -69,12 +69,12 @@ class InstanceTest extends \PHPUnit_Framework_TestCase $this->_namespaceResolver = $this->getMockBuilder( '\Magento\Widget\Model\NamespaceResolver' )->disableOriginalConstructor()->getMock(); - $this->_cacheTypesListMock = $this->getMock('Magento\App\Cache\TypeListInterface'); + $this->_cacheTypesListMock = $this->getMock('Magento\Framework\App\Cache\TypeListInterface'); $this->_readerMock = $this->getMockBuilder( 'Magento\Widget\Model\Config\Reader' )->disableOriginalConstructor()->getMock(); - $filesystemMock = $this->getMock('\Magento\App\Filesystem', array(), array(), '', false); + $filesystemMock = $this->getMock('\Magento\Framework\App\Filesystem', array(), array(), '', false); $this->_directoryMock = $this->getMock('\Magento\Filesystem\Directory\Read', array(), array(), '', false); $filesystemMock->expects( $this->any() diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Controller/IndexTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Controller/IndexTest.php index afec8bf396abd5fa8255d434e2041947b06fc6b7..5d650a98ca56f3896045df945c0ab81ec107d33f 100644 --- a/dev/tests/unit/testsuite/Magento/Wishlist/Controller/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Controller/IndexTest.php @@ -38,8 +38,8 @@ class IndexTest extends \PHPUnit_Framework_TestCase public function testCartAction() { - $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + $request = $this->getMock('Magento\Framework\App\Request\Http', array(), array(), '', false); + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $wishlistItem = $this->getMock( 'Magento\Object', @@ -121,16 +121,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** * Create the tested object * - * @param \Magento\App\Request\Http $request - * @param \Magento\App\Response\Http|null $response + * @param \Magento\Framework\App\Request\Http $request + * @param \Magento\Framework\App\Response\Http|null $response * @param \Magento\ObjectManager|null $objectManager * @return \Magento\Wishlist\Controller\Index */ protected function _factory($request, $response = null, $objectManager = null) { if (!$response) { - /** @var $response \Magento\App\ResponseInterface */ - $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false); + /** @var $response \Magento\Framework\App\ResponseInterface */ + $response = $this->getMock('Magento\Framework\App\Response\Http', array(), array(), '', false); $response->headersSentThrowsException = false; } if (!$objectManager) { @@ -140,7 +140,10 @@ class IndexTest extends \PHPUnit_Framework_TestCase 'Magento\UrlRewrite\Model\UrlRewriteFactory', array('create'), array(), '', false ); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $varienFront = $helper->getObject('Magento\App\FrontController', array('rewriteFactory' => $rewriteFactory)); + $varienFront = $helper->getObject( + 'Magento\Framework\App\FrontController', + array('rewriteFactory' => $rewriteFactory) + ); $arguments = array( 'request' => $request, diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Helper/DataTest.php new file mode 100644 index 0000000000000000000000000000000000000000..31f6e96acc766439383b13907cbaf5866bd4b754 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Helper/DataTest.php @@ -0,0 +1,71 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Wishlist\Helper; + +class DataTest extends \PHPUnit_Framework_TestCase +{ + public function testGetAddToCartUrl() + { + $url = 'http://magento.com/wishlist/index/index/wishlist_id/1/?___store=default'; + $encoded = 'encodedUrl'; + + $coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); + $coreData->expects($this->any()) + ->method('urlEncode') + ->with($url) + ->will($this->returnValue($encoded)); + + $store = $this->getMock('Magento\Store\Model\Store', array(), array(), '', false); + $store->expects($this->any()) + ->method('getUrl') + ->with('wishlist/index/cart', array('item' => '%item%', 'uenc' => $encoded)) + ->will($this->returnValue($url)); + + $storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface', array(), array(), '', false); + $storeManager->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($store)); + + $urlBuilder = $this->getMock('Magento\UrlInterface\Proxy', array('getUrl'), array(), '', false); + $urlBuilder->expects($this->any()) + ->method('getUrl') + ->with('*/*/*', array('_current' => true, '_use_rewrite' => true, '_scope_to_url' => true)) + ->will($this->returnValue($url)); + + $context = $this->getMock('Magento\Framework\App\Helper\Context', array(), array(), '', false); + $context->expects($this->once()) + ->method('getUrlBuilder') + ->will($this->returnValue($urlBuilder)); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + /** @var \Magento\Wishlist\Helper\Data $wishlistHelper */ + $wishlistHelper = $objectManager->getObject( + 'Magento\Wishlist\Helper\Data', + array('context' => $context, 'storeManager' => $storeManager, 'coreData' => $coreData) + ); + + $this->assertEquals($url, $wishlistHelper->getAddToCartUrl('%item%')); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Model/ConfigTest.php index 0f00661058842be248e796e1408313b0783f09de..b2bcb25f5980423cad9339bcbefd703ad3ca27ae 100644 --- a/dev/tests/unit/testsuite/Magento/Wishlist/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Model/ConfigTest.php @@ -47,7 +47,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_scopeConfig = $this->getMock('Magento\App\Config\ScopeConfigInterface'); + $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_catalogConfig = $this->getMock('Magento\Catalog\Model\Config', array(), array(), '', false); $this->_attributeConfig = $this->getMock( 'Magento\Catalog\Model\Attribute\Config', diff --git a/dev/tests/unit/testsuite/Magento/_files/errors/report.php b/dev/tests/unit/testsuite/Magento/_files/errors/report.php index 923daab8a233c982782070858d5f4d9995d02140..2c5136b1fbc938b0985ad1fd1936ee25563c9686 100644 --- a/dev/tests/unit/testsuite/Magento/_files/errors/report.php +++ b/dev/tests/unit/testsuite/Magento/_files/errors/report.php @@ -23,4 +23,4 @@ */ /** @var $reportData array */ -\Magento\App\Error\HandlerTest::assertNotEmpty($reportData); +\Magento\Framework\App\Error\HandlerTest::assertNotEmpty($reportData); diff --git a/dev/tools/Magento/Tools/Migration/aliases_map/composite_modules_ce.php b/dev/tools/Magento/Tools/Migration/aliases_map/composite_modules_ce.php index 63ff29f38e12bff76d3c2f74ac32f4cb6303e2e2..602104a37f2152bad55df81771980336e42e4ef5 100644 --- a/dev/tools/Magento/Tools/Migration/aliases_map/composite_modules_ce.php +++ b/dev/tools/Magento/Tools/Migration/aliases_map/composite_modules_ce.php @@ -38,5 +38,5 @@ require_once realpath( dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) ) . '/app/code/Magento/Core/Model/Resource/Setup/Migration.php'; -$objectManager = new \Magento\App\ObjectManager(); +$objectManager = new \Magento\Framework\App\ObjectManager(); return $objectManager->create('\Magento\Module\Setup\Migration')->getCompositeModules(); diff --git a/dev/tools/Magento/Tools/Migration/themes_view.php b/dev/tools/Magento/Tools/Migration/themes_view.php index d12aeda9985f31444511b61c811f1fb2e2aa0af7..13366c0d2239406801b5156186bc7adde2e0d255 100644 --- a/dev/tools/Magento/Tools/Migration/themes_view.php +++ b/dev/tools/Magento/Tools/Migration/themes_view.php @@ -26,11 +26,11 @@ require_once __DIR__ . '/../../../../../app/bootstrap.php'; $rootDir = realpath(__DIR__ . '/../../../../..'); try { - $entryPoint = new \Magento\App\EntryPoint\EntryPoint($rootDir, array()); + $entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint($rootDir, array()); - $objectManager = new \Magento\App\ObjectManager(); - /** @var $configModel \Magento\App\Config\ReinitableConfigInterface */ - $configModel = $objectManager->get('Magento\App\Config\ReinitableConfigInterface'); + $objectManager = new \Magento\Framework\App\ObjectManager(); + /** @var $configModel \Magento\Framework\App\Config\ReinitableConfigInterface */ + $configModel = $objectManager->get('Magento\Framework\App\Config\ReinitableConfigInterface'); $configModel->reinit(); $config = array(); diff --git a/dev/tools/Magento/Tools/View/Generator/Config.php b/dev/tools/Magento/Tools/View/Generator/Config.php index fd651c6be6e82bf1682d58d7688b09447700d091..fec67a30a5c3d3c0452dcab247eb360357c1143f 100644 --- a/dev/tools/Magento/Tools/View/Generator/Config.php +++ b/dev/tools/Magento/Tools/View/Generator/Config.php @@ -47,15 +47,18 @@ class Config private $_isDryRun; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $cmdOptions * @param array $allowedFiles Non-generated files delivered with the application, * so allowed to be present in the publication directory * @throws \Magento\Exception */ - public function __construct(\Magento\App\Filesystem $filesystem, array $cmdOptions, $allowedFiles = array()) - { - $rootDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + public function __construct( + \Magento\Framework\App\Filesystem $filesystem, + array $cmdOptions, + $allowedFiles = array() + ) { + $rootDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $sourceDir = isset($cmdOptions['source']) ? $cmdOptions['source'] : $rootDirectory->getAbsolutePath(); if (!$rootDirectory->isDirectory($rootDirectory->getRelativePath($sourceDir))) { throw new \Magento\Exception('Source directory does not exist: ' . $sourceDir); @@ -64,7 +67,7 @@ class Config if (isset($cmdOptions['destination'])) { $destinationDir = $cmdOptions['destination']; } else { - $destinationDir = $filesystem->getPath(\Magento\App\Filesystem::STATIC_VIEW_DIR); + $destinationDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); } $destinationDirRelative = $rootDirectory->getRelativePath($destinationDir); if (!$rootDirectory->isDirectory($destinationDirRelative)) { diff --git a/dev/tools/Magento/Tools/View/Generator/CopyRule.php b/dev/tools/Magento/Tools/View/Generator/CopyRule.php index 095ffa7df6e312a665deab336864d282990f8c9b..f8d2b2ef01cd6c54bd34511a5485167ee2ff5075 100644 --- a/dev/tools/Magento/Tools/View/Generator/CopyRule.php +++ b/dev/tools/Magento/Tools/View/Generator/CopyRule.php @@ -32,7 +32,7 @@ namespace Magento\Tools\View\Generator; class CopyRule { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ private $_filesystem; @@ -56,12 +56,12 @@ class CopyRule /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Core\Model\Theme\Collection $themes * @param \Magento\View\Design\Fallback\Rule\RuleInterface $fallbackRule */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Core\Model\Theme\Collection $themes, \Magento\View\Design\Fallback\Rule\RuleInterface $fallbackRule ) { @@ -138,7 +138,7 @@ class CopyRule private function _getMatchingDirs($dirPattern) { $dirPattern = preg_replace($this->_placeholderPcre, '*', $dirPattern, -1, $placeholderCount); - $directoryHandler = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directoryHandler = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); if ($placeholderCount) { // autodetect pattern base directory because the filesystem interface requires it $firstPlaceholderPos = strpos($dirPattern, '*'); diff --git a/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php b/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php index 732728881e505f576d9daeffa5d366db6ea455a3..6514711c25ca2353de496d011ddce70c044723b4 100644 --- a/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php +++ b/dev/tools/Magento/Tools/View/Generator/ThemeDeployment.php @@ -68,7 +68,7 @@ class ThemeDeployment private $_isDryRun; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ private $appState; @@ -91,10 +91,10 @@ class ThemeDeployment * Constructor * * @param \Magento\View\Url\CssResolver $cssUrlResolver - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Asset\PreProcessor\PreProcessorInterface $preProcessor * @param \Magento\View\Publisher\FileFactory $fileFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Core\Model\Theme\DataFactory $themeFactory * @param string $destinationHomeDir * @param string $configPermitted @@ -105,10 +105,10 @@ class ThemeDeployment */ public function __construct( \Magento\View\Url\CssResolver $cssUrlResolver, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Asset\PreProcessor\PreProcessorInterface $preProcessor, \Magento\View\Publisher\FileFactory $fileFactory, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Core\Model\Theme\DataFactory $themeFactory, $destinationHomeDir, $configPermitted, @@ -118,7 +118,7 @@ class ThemeDeployment $this->themeFactory = $themeFactory; $this->appState = $appState; $this->preProcessor = $preProcessor; - $this->tmpDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $this->tmpDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $this->fileFactory = $fileFactory; $this->_cssUrlResolver = $cssUrlResolver; $this->_destinationHomeDir = $destinationHomeDir; diff --git a/dev/tools/Magento/Tools/View/generator.php b/dev/tools/Magento/Tools/View/generator.php index 5cae797cad74fb5dfe26301bfdc39b75a12cee9e..eea822aa3b20b16424d1958a0a5285e2f007b787 100644 --- a/dev/tools/Magento/Tools/View/generator.php +++ b/dev/tools/Magento/Tools/View/generator.php @@ -65,7 +65,7 @@ if (isset($options['help'])) { $logger->log('Deploying...', \Zend_Log::INFO); try { - $objectManagerFactory = new \Magento\App\ObjectManagerFactory(); + $objectManagerFactory = new \Magento\Framework\App\ObjectManagerFactory(); $objectManager = $objectManagerFactory->create(BP, $_SERVER); $config = $objectManager->create( diff --git a/downloader/app/Magento/Downloader/Connect.php b/downloader/app/Magento/Downloader/Connect.php index 2f5f648f334a4615a532c109f7b2a373f0c36275..d02a0a0b99b278676a6072aa7c8e104492033073 100644 --- a/downloader/app/Magento/Downloader/Connect.php +++ b/downloader/app/Magento/Downloader/Connect.php @@ -244,7 +244,7 @@ class Connect public function run($command, $options = array(), $params = array()) { @set_time_limit(0); - @ini_set('memory_limit', '2048M'); + @ini_set('memory_limit', '256M'); if (empty($this->_cmdCache[$command])) { \Magento\Connect\Command::getCommands(); diff --git a/downloader/app/Magento/Downloader/Controller.php b/downloader/app/Magento/Downloader/Controller.php index 915385ad150e4fd03d318357e88c1916878ba280..21ed5b4cbe3fb0ea519cc0b97ecee661cca77c4c 100644 --- a/downloader/app/Magento/Downloader/Controller.php +++ b/downloader/app/Magento/Downloader/Controller.php @@ -534,7 +534,7 @@ final class Controller } include_once self::$_instance->getBootstrapPath(); - \Magento\App\ObjectManager::getInstance()->get('Magento\App\State')->setIsDownloader(); + \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\App\State')->setIsDownloader(); } if (self::isInstalled()) { \Mage::getSingleton('Magento\Backend\Model\UrlInterface')->turnOffSecretKey(); @@ -977,7 +977,7 @@ final class Controller \Mage::app()->getConfig()->reinit(); /** @var $updater \Magento\Module\UpdaterInterface*/ - $updater = \Magento\App\ObjectManager::getInstance()->get('Magento\Module\UpdaterInterface'); + $updater = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Module\UpdaterInterface'); $updater->updateScheme(); $updater->updateData(); $message .= 'Cache cleaned successfully'; @@ -1071,7 +1071,7 @@ final class Controller \Mage::getBaseDir('var') . '/backups' ); - \Magento\App\ObjectManager::getInstance()->get( + \Magento\Framework\App\ObjectManager::getInstance()->get( 'Magento\Registry' )->register( 'backup_manager', diff --git a/downloader/lib/Magento/Backup/Snapshot.php b/downloader/lib/Magento/Backup/Snapshot.php index 5ab469120e6f5bb6c6e0fab88efe793595afa5f1..89ee8897f334049838096fda19b31a35083ff907 100644 --- a/downloader/lib/Magento/Backup/Snapshot.php +++ b/downloader/lib/Magento/Backup/Snapshot.php @@ -45,7 +45,7 @@ class Snapshot extends \Magento\Backup\Filesystem /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -55,10 +55,10 @@ class Snapshot extends \Magento\Backup\Filesystem protected $_backupFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param Factory $backupFactory */ - public function __construct(\Magento\App\Filesystem $filesystem, \Magento\Backup\Factory $backupFactory) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, \Magento\Backup\Factory $backupFactory) { $this->_filesystem = $filesystem; $this->_backupFactory = $backupFactory; @@ -138,7 +138,7 @@ class Snapshot extends \Magento\Backup\Filesystem )->setTime( $this->getTime() )->setBackupsDir( - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) )->setResourceModel( $this->getResourceModel() ); diff --git a/index.php b/index.php index 48d1224c2d63313e207bb4f1dabeac1e5b646af2..6eada12c9022ab6619d48ec0b7142819f3c1f365 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ * $params['MAGE_RUN_CODE'] = 'website2'; * $params['MAGE_RUN_TYPE'] = 'website'; * ... - * $entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); + * $entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); * -------------------------------------------- * * Magento @@ -33,5 +33,5 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ require __DIR__ . '/app/bootstrap.php'; -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $_SERVER); -$entryPoint->run('Magento\App\Http'); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $_SERVER); +$entryPoint->run('Magento\Framework\App\Http'); diff --git a/lib/CardinalCommerce/CentinelErrors.php b/lib/CardinalCommerce/CentinelErrors.php index 4892429e33d5304f6a139990e8bcd15e7de9338f..2ac2eb1996262b706116844a7e4256a4b087b4ba 100644 --- a/lib/CardinalCommerce/CentinelErrors.php +++ b/lib/CardinalCommerce/CentinelErrors.php @@ -10,11 +10,15 @@ // ///////////////////////////////////////////////////////////////////////////////////////////// - define("CENTINEL_ERROR_CODE_8000", "8000"); - define("CENTINEL_ERROR_CODE_8000_DESC", "Protocol Not Recogonized, must be http:// or https://"); - define("CENTINEL_ERROR_CODE_8010", "8010"); - define("CENTINEL_ERROR_CODE_8010_DESC", "Unable to Communicate with MAPS Server"); - define("CENTINEL_ERROR_CODE_8020", "8020"); - define("CENTINEL_ERROR_CODE_8020_DESC", "Error Parsing XML Response"); - define("CENTINEL_ERROR_CODE_8030", "8030"); - define("CENTINEL_ERROR_CODE_8030_DESC", "Communication Timeout Encountered"); +defined('CENTINEL_ERROR_CODE_8000') ? : define("CENTINEL_ERROR_CODE_8000", "8000"); +defined('CENTINEL_ERROR_CODE_8000_DESC') ? + : define('CENTINEL_ERROR_CODE_8000_DESC', 'Protocol Not Recogonized, must be http:// or https://'); +defined('CENTINEL_ERROR_CODE_8010') ? : define('CENTINEL_ERROR_CODE_8010', "8010"); +defined('CENTINEL_ERROR_CODE_8010_DESC') ? + : define('CENTINEL_ERROR_CODE_8010_DESC', 'Unable to Communicate with MAPS Server'); +defined('CENTINEL_ERROR_CODE_8020') ? : define('CENTINEL_ERROR_CODE_8020', "8020"); +defined('CENTINEL_ERROR_CODE_8020_DESC') ? + : define('CENTINEL_ERROR_CODE_8020_DESC', 'Error Parsing XML Response'); +defined('CENTINEL_ERROR_CODE_8030') ? : define('CENTINEL_ERROR_CODE_8030', "8030"); +defined('CENTINEL_ERROR_CODE_8030_DESC') ? + : define('CENTINEL_ERROR_CODE_8030_DESC', 'Communication Timeout Encountered'); diff --git a/lib/Magento/App/FrontController/Plugin/Clickjacking.php b/lib/Magento/App/FrontController/Plugin/Clickjacking.php deleted file mode 100644 index b02a6d9e8017a7d49560c68273f1905ff6a80cc4..0000000000000000000000000000000000000000 --- a/lib/Magento/App/FrontController/Plugin/Clickjacking.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Clickjacking protection plugin - * - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\App\FrontController\Plugin; - -class Clickjacking -{ - /** - * Process response - * - * @param \Magento\App\FrontController $subject - * @param \Magento\App\ResponseInterface $response - * - * @return \Magento\App\ResponseInterface - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterDispatch(\Magento\App\FrontController $subject, \Magento\App\ResponseInterface $response) - { - if (!$response->getHeader('X-Frame-Options')) { - $response->setHeader('X-Frame-Options', 'SAMEORIGIN'); - } - return $response; - } -} diff --git a/lib/Magento/Backup/Snapshot.php b/lib/Magento/Backup/Snapshot.php index eb807dcf8720d2ba6819ae2116e7bf4586452990..59cbd2c86b17ffa8f4f61f7397279c0eab3ec923 100644 --- a/lib/Magento/Backup/Snapshot.php +++ b/lib/Magento/Backup/Snapshot.php @@ -45,7 +45,7 @@ class Snapshot extends Filesystem /** * Filesystem facade * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -55,10 +55,10 @@ class Snapshot extends Filesystem protected $_backupFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param Factory $backupFactory */ - public function __construct(\Magento\App\Filesystem $filesystem, Factory $backupFactory) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, Factory $backupFactory) { $this->_filesystem = $filesystem; $this->_backupFactory = $backupFactory; @@ -138,7 +138,7 @@ class Snapshot extends Filesystem )->setTime( $this->getTime() )->setBackupsDir( - $this->_filesystem->getPath(\Magento\App\Filesystem::VAR_DIR) + $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::VAR_DIR) )->setResourceModel( $this->getResourceModel() ); diff --git a/lib/Magento/Code/Minifier.php b/lib/Magento/Code/Minifier.php index 745f6435379ef73b998fb4a40d9b146aeb902055..dbd6bb775a6d0cfb9a2ac6e837a659ca1f454169 100644 --- a/lib/Magento/Code/Minifier.php +++ b/lib/Magento/Code/Minifier.php @@ -49,17 +49,17 @@ class Minifier /** * @param \Magento\Code\Minifier\StrategyInterface $strategy - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $directoryName */ public function __construct( \Magento\Code\Minifier\StrategyInterface $strategy, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $directoryName ) { $this->_strategy = $strategy; - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); - $this->pubViewCacheDir = $filesystem->getDirectoryRead(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); + $this->pubViewCacheDir = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR); $this->directoryName = $directoryName; } diff --git a/lib/Magento/Code/Minifier/Strategy/Generate.php b/lib/Magento/Code/Minifier/Strategy/Generate.php index 4167da0d298c6bdf6109609322c497f0f2d47af3..a581b03814e25370e2fdeeaf6a1ed34940004d74 100644 --- a/lib/Magento/Code/Minifier/Strategy/Generate.php +++ b/lib/Magento/Code/Minifier/Strategy/Generate.php @@ -49,13 +49,13 @@ class Generate implements \Magento\Code\Minifier\StrategyInterface /** * @param \Magento\Code\Minifier\AdapterInterface $adapter - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\Code\Minifier\AdapterInterface $adapter, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Code\Minifier\AdapterInterface $adapter, \Magento\Framework\App\Filesystem $filesystem) { $this->adapter = $adapter; - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); - $this->pubViewCacheDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); + $this->pubViewCacheDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR); } /** diff --git a/lib/Magento/Code/Minifier/Strategy/Lite.php b/lib/Magento/Code/Minifier/Strategy/Lite.php index dfc432c05a5fb5b8cdaf7ed623e6e886a26c11ac..de0c1fbc84e864a773f3a9155ba30dc35518b86a 100644 --- a/lib/Magento/Code/Minifier/Strategy/Lite.php +++ b/lib/Magento/Code/Minifier/Strategy/Lite.php @@ -52,13 +52,13 @@ class Lite implements \Magento\Code\Minifier\StrategyInterface /** * @param \Magento\Code\Minifier\AdapterInterface $adapter - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\Code\Minifier\AdapterInterface $adapter, \Magento\App\Filesystem $filesystem) + public function __construct(\Magento\Code\Minifier\AdapterInterface $adapter, \Magento\Framework\App\Filesystem $filesystem) { $this->adapter = $adapter; - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); - $this->pubViewCacheDir = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_VIEW_CACHE_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); + $this->pubViewCacheDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR); } /** diff --git a/lib/Magento/Config/Dom.php b/lib/Magento/Config/Dom.php index f2335cc06a6a93394b587efa7521fe814ffdf062..c43613e5874aee7dddfe59e98251e5956ba79b54 100644 --- a/lib/Magento/Config/Dom.php +++ b/lib/Magento/Config/Dom.php @@ -222,7 +222,14 @@ class Dom $prefix = is_null($this->_rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; $path = $parentPath . '/' . $prefix . $node->tagName; $idAttribute = $this->_nodeMergingConfig->getIdAttribute($path); - if ($idAttribute && ($value = $node->getAttribute($idAttribute))) { + if (is_array($idAttribute)) { + $constraints = []; + foreach ($idAttribute as $attribute) { + $value = $node->getAttribute($attribute); + $constraints[] = "@{$attribute}='{$value}'"; + } + $path .= '[' . join(' and ', $constraints) . ']'; + } elseif ($idAttribute && ($value = $node->getAttribute($idAttribute))) { $path .= "[@{$idAttribute}='{$value}']"; } return $path; diff --git a/lib/Magento/Config/FileIterator.php b/lib/Magento/Config/FileIterator.php index b83eb2f36c4ae1f86c93c36830670fefff92d320..1996162524332b9aacb09fd44a712811ba659622 100644 --- a/lib/Magento/Config/FileIterator.php +++ b/lib/Magento/Config/FileIterator.php @@ -29,13 +29,6 @@ namespace Magento\Config; */ class FileIterator implements \Iterator, \Countable { - /** - * Cache - * - * @var array - */ - protected $cached = array(); - /** * Paths * @@ -87,10 +80,7 @@ class FileIterator implements \Iterator, \Countable */ public function current() { - if (!isset($this->cached[$this->key()])) { - $this->cached[$this->key()] = $this->directoryRead->readFile($this->key()); - } - return $this->cached[$this->key()]; + return $this->directoryRead->readFile($this->key()); } /** @@ -120,7 +110,7 @@ class FileIterator implements \Iterator, \Countable */ public function valid() { - return (bool)$this->key(); + return (bool) $this->key(); } /** diff --git a/lib/Magento/Config/Reader/Filesystem.php b/lib/Magento/Config/Reader/Filesystem.php index cd14a5eda9f07fdb855c77d8bcdabf8a30e8d2c8..af6af7ba78559f6f34f02a36aeee2827485e9bdd 100644 --- a/lib/Magento/Config/Reader/Filesystem.php +++ b/lib/Magento/Config/Reader/Filesystem.php @@ -126,9 +126,6 @@ class Filesystem implements \Magento\Config\ReaderInterface * * @param string|null $scope * @return array - * @throws \Magento\Exception - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function read($scope = null) { diff --git a/lib/Magento/Config/Scope.php b/lib/Magento/Config/Scope.php index 1c5610f3f68e3e4726077dca7ad0069dbe5744fe..150f641483242e8174a6749a2e6316cb3f90be1c 100644 --- a/lib/Magento/Config/Scope.php +++ b/lib/Magento/Config/Scope.php @@ -42,17 +42,17 @@ class Scope implements \Magento\Config\ScopeInterface, \Magento\Config\ScopeList /** * List of all available areas * - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_areaList; /** * Constructor * - * @param \Magento\App\AreaList $areaList + * @param \Magento\Framework\App\AreaList $areaList * @param string $defaultScope */ - public function __construct(\Magento\App\AreaList $areaList, $defaultScope = 'primary') + public function __construct(\Magento\Framework\App\AreaList $areaList, $defaultScope = 'primary') { $this->_defaultScope = $this->_currentScope = $defaultScope; $this->_areaList = $areaList; diff --git a/lib/Magento/Css/PreProcessor/Cache/Import/Cache.php b/lib/Magento/Css/PreProcessor/Cache/Import/Cache.php index 6a951ecf8f79e59b92169e58bd09fc2c04f10524..dfaa640ed2d395ce04466fb4c510391d0103a85f 100644 --- a/lib/Magento/Css/PreProcessor/Cache/Import/Cache.php +++ b/lib/Magento/Css/PreProcessor/Cache/Import/Cache.php @@ -24,7 +24,7 @@ namespace Magento\Css\PreProcessor\Cache\Import; use Magento\Exception; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; /** * File cache entity for entry file diff --git a/lib/Magento/Css/PreProcessor/Cache/Import/Map/Storage.php b/lib/Magento/Css/PreProcessor/Cache/Import/Map/Storage.php index 9f933b4fbc13c00c6f5f06d23c6f9aaed07c02a0..0ced2f62c3923c165b8f6d66170e3c0811e3546f 100644 --- a/lib/Magento/Css/PreProcessor/Cache/Import/Map/Storage.php +++ b/lib/Magento/Css/PreProcessor/Cache/Import/Map/Storage.php @@ -23,7 +23,7 @@ */ namespace Magento\Css\PreProcessor\Cache\Import\Map; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; /** * Storage for import cache diff --git a/lib/Magento/Css/PreProcessor/Cache/Plugin/ImportCleaner.php b/lib/Magento/Css/PreProcessor/Cache/Plugin/ImportCleaner.php index 9544ff79a02be0f5f2644e848fea4fab9bd0d749..a494ea4c06d36c506739eba4f410e385c80f3ada 100644 --- a/lib/Magento/Css/PreProcessor/Cache/Plugin/ImportCleaner.php +++ b/lib/Magento/Css/PreProcessor/Cache/Plugin/ImportCleaner.php @@ -23,7 +23,7 @@ */ namespace Magento\Css\PreProcessor\Cache\Plugin; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Css\PreProcessor\Cache\Import\Map\Storage; /** diff --git a/lib/Magento/Css/PreProcessor/UrlResolver.php b/lib/Magento/Css/PreProcessor/UrlResolver.php index b3abf5e31ee6fe13fe95efedfde380814154e388..7e56ff501d3d6f8ed577a4dcc0eff8171c14b841 100644 --- a/lib/Magento/Css/PreProcessor/UrlResolver.php +++ b/lib/Magento/Css/PreProcessor/UrlResolver.php @@ -79,7 +79,7 @@ class UrlResolver implements PreProcessorInterface protected $fileFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\RelatedFile $relatedFile * @param \Magento\View\Url\CssResolver $cssUrlResolver * @param \Magento\View\Publisher $publisher @@ -87,14 +87,14 @@ class UrlResolver implements PreProcessorInterface * @param \Magento\View\Publisher\FileFactory $fileFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\RelatedFile $relatedFile, \Magento\View\Url\CssResolver $cssUrlResolver, \Magento\View\Publisher $publisher, \Magento\Logger $logger, \Magento\View\Publisher\FileFactory $fileFactory ) { - $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->relatedFile = $relatedFile; $this->cssUrlResolver = $cssUrlResolver; $this->publisher = $publisher; diff --git a/lib/Magento/DB/Adapter/Pdo/Mysql.php b/lib/Magento/DB/Adapter/Pdo/Mysql.php index 198f00ec0d9dbabfac00e35746b59bb68e1dd478..e5b9a096a76fc5b28ea95876ff325945843aed26 100644 --- a/lib/Magento/DB/Adapter/Pdo/Mysql.php +++ b/lib/Magento/DB/Adapter/Pdo/Mysql.php @@ -25,7 +25,7 @@ */ namespace Magento\DB\Adapter\Pdo; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Cache\FrontendInterface; use Magento\DB\Adapter\AdapterInterface; use Magento\DB\Ddl\Table; diff --git a/lib/Magento/DB/Helper/AbstractHelper.php b/lib/Magento/DB/Helper/AbstractHelper.php index 5c1da9937fcbc1982cbdb77469e993fc2bb6b81f..c6147bcf9cafa7df4bf66d6582357ded09d31e85 100644 --- a/lib/Magento/DB/Helper/AbstractHelper.php +++ b/lib/Magento/DB/Helper/AbstractHelper.php @@ -49,17 +49,17 @@ abstract class AbstractHelper protected $_modulePrefix; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** * Initialize resource helper instance * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param string $modulePrefix */ - public function __construct(\Magento\App\Resource $resource, $modulePrefix) + public function __construct(\Magento\Framework\App\Resource $resource, $modulePrefix) { $this->_resource = $resource; $this->_modulePrefix = (string)$modulePrefix; diff --git a/lib/Magento/Event/Config/Data.php b/lib/Magento/Event/Config/Data.php index 654279e9c50b8d8dcc215efd83ca2215f0f19e63..f9092d146171e0ee7c810649b0dddda1cc286201 100644 --- a/lib/Magento/Event/Config/Data.php +++ b/lib/Magento/Event/Config/Data.php @@ -35,7 +35,7 @@ class Data extends \Magento\Config\Data\Scoped protected $_scopePriorityScheme = array('global'); /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -43,14 +43,14 @@ class Data extends \Magento\Config\Data\Scoped * @param \Magento\Event\Config\Reader $reader * @param \Magento\Config\ScopeInterface $configScope * @param \Magento\Config\CacheInterface $cache - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param string $cacheId */ public function __construct( \Magento\Event\Config\Reader $reader, \Magento\Config\ScopeInterface $configScope, \Magento\Config\CacheInterface $cache, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, $cacheId = 'event_config_cache' ) { $this->_appState = $appState; diff --git a/lib/Magento/Event/Invoker/InvokerDefault.php b/lib/Magento/Event/Invoker/InvokerDefault.php index 26b08d5edee11662be2f806af84870621430ee7c..a43c46d537cf249a38a319b0b97fd6594a6bb836 100644 --- a/lib/Magento/Event/Invoker/InvokerDefault.php +++ b/lib/Magento/Event/Invoker/InvokerDefault.php @@ -40,15 +40,15 @@ class InvokerDefault implements \Magento\Event\InvokerInterface /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** * @param \Magento\Event\ObserverFactory $observerFactory - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState */ - public function __construct(\Magento\Event\ObserverFactory $observerFactory, \Magento\App\State $appState) + public function __construct(\Magento\Event\ObserverFactory $observerFactory, \Magento\Framework\App\State $appState) { $this->_observerFactory = $observerFactory; $this->_appState = $appState; @@ -89,7 +89,7 @@ class InvokerDefault implements \Magento\Event\InvokerInterface { if (method_exists($object, $method)) { $object->{$method}($observer); - } elseif ($this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER) { + } elseif ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { throw new \LogicException('Method "' . $method . '" is not defined in "' . get_class($object) . '"'); } return $this; diff --git a/lib/Magento/Filesystem/Directory/Read.php b/lib/Magento/Filesystem/Directory/Read.php index b30719374f14c7653e64c683a1c2ad2b2d6b6dd2..72cac07567dc8b2ed23063946d16a79d7204a7b5 100644 --- a/lib/Magento/Filesystem/Directory/Read.php +++ b/lib/Magento/Filesystem/Directory/Read.php @@ -238,6 +238,10 @@ class Read implements ReadInterface { $absolutePath = $this->driver->getAbsolutePath($this->path, $path, $protocol); + if (is_null($protocol)) { + return $this->driver->fileGetContents($absolutePath, $flag, $context); + } + /** @var \Magento\Filesystem\File\Read $fileReader */ $fileReader = $this->fileFactory->create($absolutePath, $protocol, $this->driver); return $fileReader->readAll($flag, $context); diff --git a/lib/Magento/Filesystem/Driver/Http.php b/lib/Magento/Filesystem/Driver/Http.php index 1e58a58f171f5655392bcd84ab0aeed0802a62fc..3d5da71ae62b390602258cca8b76afc1ad08e5bc 100644 --- a/lib/Magento/Filesystem/Driver/Http.php +++ b/lib/Magento/Filesystem/Driver/Http.php @@ -180,7 +180,7 @@ class Http extends File $hostname . "\r\n" . 'User-Agent: Magento ver/' . - \Magento\AppInterface::VERSION . + \Magento\Framework\AppInterface::VERSION . "\r\n" . 'Connection: close' . "\r\n" . diff --git a/lib/Magento/Filter/Input.php b/lib/Magento/Filter/Input.php index 09a2f92090f09e741dada0e29eb5035bbb1aba2d..903f65c5a41e2da53c7d1eede4dd4d64aee26326 100644 --- a/lib/Magento/Filter/Input.php +++ b/lib/Magento/Filter/Input.php @@ -260,14 +260,14 @@ class Input implements \Zend_Filter_Interface * Call specified helper method for $value filtration * * @param mixed $value - * @param \Magento\App\Helper\AbstractHelper $helper + * @param \Magento\Framework\App\Helper\AbstractHelper $helper * @param array $filterData * @return mixed * @throws \Exception */ protected function _applyFiltrationWithHelper( $value, - \Magento\App\Helper\AbstractHelper $helper, + \Magento\Framework\App\Helper\AbstractHelper $helper, array $filterData ) { if (!isset($filterData['method']) || empty($filterData['method'])) { @@ -286,7 +286,7 @@ class Input implements \Zend_Filter_Interface * Try to create Magento helper for filtration based on $filterData. Return false on failure * * @param \Zend_Filter_Interface|array $filterData - * @return false|\Magento\App\Helper\AbstractHelper + * @return false|\Magento\Framework\App\Helper\AbstractHelper * @throws \Exception */ protected function _getFiltrationHelper($filterData) @@ -296,7 +296,7 @@ class Input implements \Zend_Filter_Interface $helper = $filterData['helper']; if (is_string($helper)) { $helper = $this->_objectManager->get($helper); - } elseif (!$helper instanceof \Magento\App\Helper\AbstractHelper) { + } elseif (!$helper instanceof \Magento\Framework\App\Helper\AbstractHelper) { throw new \Exception("Filter '{$helper}' not found"); } } diff --git a/lib/Magento/Filter/Translit.php b/lib/Magento/Filter/Translit.php index 27184e85fb560b5d0c863db880be5bf1116df550..5ac18575e7e1fcd5ab9c0a90dbdb4991dd2df0a1 100644 --- a/lib/Magento/Filter/Translit.php +++ b/lib/Magento/Filter/Translit.php @@ -356,9 +356,9 @@ class Translit implements \Zend_Filter_Interface ); /** - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $config) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config) { $convertConfig = $config->getValue('url/convert', 'default'); if ($convertConfig) { diff --git a/lib/Magento/App/AbstractShell.php b/lib/Magento/Framework/App/AbstractShell.php similarity index 95% rename from lib/Magento/App/AbstractShell.php rename to lib/Magento/Framework/App/AbstractShell.php index 88370a943b09fdd745a88d58633e254a8b5e2cd2..17b3b70aff6733d7c5f4d71bb0f7392e2a3e16b9 100644 --- a/lib/Magento/App/AbstractShell.php +++ b/lib/Magento/Framework/App/AbstractShell.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; /** * Shell scripts abstract class @@ -57,17 +57,17 @@ abstract class AbstractShell /** * Initializes application and parses input parameters * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $entryPoint * @throws \Exception */ - public function __construct(\Magento\App\Filesystem $filesystem, $entryPoint) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, $entryPoint) { if (isset($_SERVER['REQUEST_METHOD'])) { throw new \Exception('This script cannot be run from Browser. This is the shell script.'); } - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_entryPoint = $entryPoint; $this->_rawArgs = $_SERVER['argv']; $this->_applyPhpVariables(); diff --git a/lib/Magento/App/Action/AbstractAction.php b/lib/Magento/Framework/App/Action/AbstractAction.php similarity index 69% rename from lib/Magento/App/Action/AbstractAction.php rename to lib/Magento/Framework/App/Action/AbstractAction.php index 781188370af28d550be6bf8d3d59a7b893693271..3ede52a0d93d7594bca8f31b787779e379b91219 100644 --- a/lib/Magento/App/Action/AbstractAction.php +++ b/lib/Magento/Framework/App/Action/AbstractAction.php @@ -23,26 +23,28 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; -abstract class AbstractAction implements \Magento\App\ActionInterface +abstract class AbstractAction implements \Magento\Framework\App\ActionInterface { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ResponseInterface $response */ - public function __construct(\Magento\App\RequestInterface $request, \Magento\App\ResponseInterface $response) - { + public function __construct( + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\ResponseInterface $response + ) { $this->_request = $request; $this->_response = $response; } @@ -50,7 +52,7 @@ abstract class AbstractAction implements \Magento\App\ActionInterface /** * Retrieve request object * - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function getRequest() { @@ -60,7 +62,7 @@ abstract class AbstractAction implements \Magento\App\ActionInterface /** * Retrieve response object * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function getResponse() { diff --git a/lib/Magento/App/Action/Action.php b/lib/Magento/Framework/App/Action/Action.php similarity index 95% rename from lib/Magento/App/Action/Action.php rename to lib/Magento/Framework/App/Action/Action.php index d160d21f86fa34ad788171ad0eedad84b499be3a..4b1090ed4e8579f2500afd68a6316ec0c47e4ad6 100644 --- a/lib/Magento/App/Action/Action.php +++ b/lib/Magento/Framework/App/Action/Action.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; class Action extends AbstractAction { @@ -59,17 +59,17 @@ class Action extends AbstractAction protected $_eventManager; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; /** - * @var \Magento\App\Response\RedirectInterface + * @var \Magento\Framework\App\Response\RedirectInterface */ protected $_redirect; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_view; diff --git a/lib/Magento/App/Action/Context.php b/lib/Magento/Framework/App/Action/Context.php similarity index 74% rename from lib/Magento/App/Action/Context.php rename to lib/Magento/Framework/App/Action/Context.php index 93f24dbaaaef022b987b79a5a896dd3f4f6dafcc..8e8da425519a563c4ec9b78ceb6f056c60df7504 100644 --- a/lib/Magento/App/Action/Context.php +++ b/lib/Magento/Framework/App/Action/Context.php @@ -21,17 +21,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class Context implements \Magento\ObjectManager\ContextInterface { /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; @@ -51,17 +51,17 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_url; /** - * @var \Magento\App\Response\RedirectInterface + * @var \Magento\Framework\App\Response\RedirectInterface */ protected $_redirect; /** - * @var \Magento\App\ActionFlag + * @var \Magento\Framework\App\ActionFlag */ protected $_actionFlag; /** - * @var \Magento\App\ViewInterface + * @var \Magento\Framework\App\ViewInterface */ protected $_view; @@ -71,25 +71,25 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $messageManager; /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\ResponseInterface $response * @param \Magento\ObjectManager $objectManager * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $url - * @param \Magento\App\Response\RedirectInterface $redirect - * @param \Magento\App\ActionFlag $actionFlag - * @param \Magento\App\ViewInterface $view + * @param \Magento\Framework\App\Response\RedirectInterface $redirect + * @param \Magento\Framework\App\ActionFlag $actionFlag + * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\Message\ManagerInterface $messageManager */ public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\ResponseInterface $response, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\ResponseInterface $response, \Magento\ObjectManager $objectManager, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $url, - \Magento\App\Response\RedirectInterface $redirect, - \Magento\App\ActionFlag $actionFlag, - \Magento\App\ViewInterface $view, + \Magento\Framework\App\Response\RedirectInterface $redirect, + \Magento\Framework\App\ActionFlag $actionFlag, + \Magento\Framework\App\ViewInterface $view, \Magento\Message\ManagerInterface $messageManager ) { $this->_request = $request; @@ -104,7 +104,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\ActionFlag + * @return \Magento\Framework\App\ActionFlag */ public function getActionFlag() { @@ -120,7 +120,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\ViewInterface + * @return \Magento\Framework\App\ViewInterface */ public function getView() { @@ -136,7 +136,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\Response\RedirectInterface + * @return \Magento\Framework\App\Response\RedirectInterface */ public function getRedirect() { @@ -144,7 +144,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function getRequest() { @@ -152,7 +152,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function getResponse() { diff --git a/lib/Magento/App/Action/Exception.php b/lib/Magento/Framework/App/Action/Exception.php similarity index 96% rename from lib/Magento/App/Action/Exception.php rename to lib/Magento/Framework/App/Action/Exception.php index 5f610de9dc65559a844e562be3ac5647d8610994..20f29691e4e265cabefc55d8fe663bac91187957 100644 --- a/lib/Magento/App/Action/Exception.php +++ b/lib/Magento/Framework/App/Action/Exception.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class Exception extends \Exception { diff --git a/lib/Magento/App/Action/Forward.php b/lib/Magento/Framework/App/Action/Forward.php similarity index 90% rename from lib/Magento/App/Action/Forward.php rename to lib/Magento/Framework/App/Action/Forward.php index fd268983b9cb4c9fcd805bd5fbb330c767c262ba..82250b2802e778da7a7cfe23da5093d36dea57ff 100644 --- a/lib/Magento/App/Action/Forward.php +++ b/lib/Magento/Framework/App/Action/Forward.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; class Forward extends AbstractAction { diff --git a/lib/Magento/App/Action/NotFoundException.php b/lib/Magento/Framework/App/Action/NotFoundException.php similarity index 96% rename from lib/Magento/App/Action/NotFoundException.php rename to lib/Magento/Framework/App/Action/NotFoundException.php index 4bf49fcf00fd616ef7ea1accb80886423ddf586b..bdf288b374fdf5bba65ad2b376be2660b85b3122 100644 --- a/lib/Magento/App/Action/NotFoundException.php +++ b/lib/Magento/Framework/App/Action/NotFoundException.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class NotFoundException extends \Exception { diff --git a/lib/Magento/App/Action/Redirect.php b/lib/Magento/Framework/App/Action/Redirect.php similarity index 90% rename from lib/Magento/App/Action/Redirect.php rename to lib/Magento/Framework/App/Action/Redirect.php index f35d1eba5d15ac4ce896c1035a7fd1f37807494f..e54b5f9b390e2099d5256afa0c893d29ec8830e3 100644 --- a/lib/Magento/App/Action/Redirect.php +++ b/lib/Magento/Framework/App/Action/Redirect.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; -use Magento\App\RequestInterface; -use Magento\App\ResponseInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\ResponseInterface; class Redirect extends AbstractAction { diff --git a/lib/Magento/App/Action/Title.php b/lib/Magento/Framework/App/Action/Title.php similarity index 97% rename from lib/Magento/App/Action/Title.php rename to lib/Magento/Framework/App/Action/Title.php index 1fdde88b9c39f84a3e63ca5198cdeb3753b3cde8..bca693c948f0dbc8756f0ea54364fd6b8511832d 100644 --- a/lib/Magento/App/Action/Title.php +++ b/lib/Magento/Framework/App/Action/Title.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Action; +namespace Magento\Framework\App\Action; class Title { diff --git a/lib/Magento/App/ActionFactory.php b/lib/Magento/Framework/App/ActionFactory.php similarity index 89% rename from lib/Magento/App/ActionFactory.php rename to lib/Magento/Framework/App/ActionFactory.php index bf223a9c248c9a7bdd3d5543d3ede1c60450301b..25bae123939bd385eceda7f1d9397ac5de98c08b 100644 --- a/lib/Magento/App/ActionFactory.php +++ b/lib/Magento/Framework/App/ActionFactory.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -use Magento\App\Action\AbstractAction; +use Magento\Framework\App\Action\AbstractAction; class ActionFactory { @@ -49,7 +49,7 @@ class ActionFactory */ public function createController($controllerName, array $arguments = array()) { - $context = $this->_objectManager->create('Magento\App\Action\Context', $arguments); + $context = $this->_objectManager->create('Magento\Framework\App\Action\Context', $arguments); $arguments['context'] = $context; return $this->_objectManager->create($controllerName, $arguments); } diff --git a/lib/Magento/App/ActionFlag.php b/lib/Magento/Framework/App/ActionFlag.php similarity index 95% rename from lib/Magento/App/ActionFlag.php rename to lib/Magento/Framework/App/ActionFlag.php index 2b884b2d742913afe6da196da93e97863e52e399..1c0e6c9753aa69e24036792d03f56f28548a9800 100644 --- a/lib/Magento/App/ActionFlag.php +++ b/lib/Magento/Framework/App/ActionFlag.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ActionFlag { @@ -38,7 +38,7 @@ class ActionFlag /** * @param RequestInterface $request */ - public function __construct(\Magento\App\RequestInterface $request) + public function __construct(\Magento\Framework\App\RequestInterface $request) { $this->_request = $request; } diff --git a/lib/Magento/App/ActionInterface.php b/lib/Magento/Framework/App/ActionInterface.php similarity index 97% rename from lib/Magento/App/ActionInterface.php rename to lib/Magento/Framework/App/ActionInterface.php index a02490427f294c4ff81c87e73296059240e2b91d..fe65dfac869645316ce0131716c6500fbc3c2999 100644 --- a/lib/Magento/App/ActionInterface.php +++ b/lib/Magento/Framework/App/ActionInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface ActionInterface { diff --git a/lib/Magento/App/Area/FrontNameResolverFactory.php b/lib/Magento/Framework/App/Area/FrontNameResolverFactory.php similarity index 97% rename from lib/Magento/App/Area/FrontNameResolverFactory.php rename to lib/Magento/Framework/App/Area/FrontNameResolverFactory.php index d0b73aeb33ebcfaba31d3fb8f1a920f2e913ccc0..890d971342ae0624bd9409f34d686133dd8946f8 100644 --- a/lib/Magento/App/Area/FrontNameResolverFactory.php +++ b/lib/Magento/Framework/App/Area/FrontNameResolverFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Area; +namespace Magento\Framework\App\Area; class FrontNameResolverFactory { diff --git a/lib/Magento/App/Area/FrontNameResolverInterface.php b/lib/Magento/Framework/App/Area/FrontNameResolverInterface.php similarity index 96% rename from lib/Magento/App/Area/FrontNameResolverInterface.php rename to lib/Magento/Framework/App/Area/FrontNameResolverInterface.php index 6e713192726dafdedc5835b476d07d0eb681e179..0ef7837ea4e368504298a02d024954267682aeb4 100644 --- a/lib/Magento/App/Area/FrontNameResolverInterface.php +++ b/lib/Magento/Framework/App/Area/FrontNameResolverInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Area; +namespace Magento\Framework\App\Area; interface FrontNameResolverInterface { diff --git a/lib/Magento/App/AreaInterface.php b/lib/Magento/Framework/App/AreaInterface.php similarity index 97% rename from lib/Magento/App/AreaInterface.php rename to lib/Magento/Framework/App/AreaInterface.php index c766ec39fc7db060e83ab919f360b661181f6ea7..32aef99d4535981c0a288ffddf0b0a9f32ae69ef 100644 --- a/lib/Magento/App/AreaInterface.php +++ b/lib/Magento/Framework/App/AreaInterface.php @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface AreaInterface { diff --git a/lib/Magento/App/AreaList.php b/lib/Magento/Framework/App/AreaList.php similarity index 96% rename from lib/Magento/App/AreaList.php rename to lib/Magento/Framework/App/AreaList.php index 26a63f3b69c379e9d96795549d39d31d890d8879..00dbd1c07bff5eca90d5e3207145ca6fb5c51d47 100644 --- a/lib/Magento/App/AreaList.php +++ b/lib/Magento/Framework/App/AreaList.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class AreaList { @@ -35,7 +35,7 @@ class AreaList protected $_areas; /** - * @var \Magento\App\AreaInterface[] + * @var \Magento\Framework\App\AreaInterface[] */ protected $_areaInstances = array(); @@ -135,7 +135,7 @@ class AreaList { if (!isset($this->_areaInstances[$code])) { $this->_areaInstances[$code] = $this->objectManager->create( - 'Magento\App\AreaInterface', + 'Magento\Framework\App\AreaInterface', array('areaCode' => $code) ); } diff --git a/lib/Magento/App/AreaList/Proxy.php b/lib/Magento/Framework/App/AreaList/Proxy.php similarity index 94% rename from lib/Magento/App/AreaList/Proxy.php rename to lib/Magento/Framework/App/AreaList/Proxy.php index 38442be3a7804f5b94545b1b52ad142b2a3a96ef..9433fdf1412cc4932c1a8cc5a7e902e8b49f2d8f 100644 --- a/lib/Magento/App/AreaList/Proxy.php +++ b/lib/Magento/Framework/App/AreaList/Proxy.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\AreaList; +namespace Magento\Framework\App\AreaList; -class Proxy extends \Magento\App\AreaList +class Proxy extends \Magento\Framework\App\AreaList { /** * Object Manager instance @@ -64,7 +64,7 @@ class Proxy extends \Magento\App\AreaList */ public function __construct( \Magento\ObjectManager $objectManager, - $instanceName = 'Magento\App\AreaList', + $instanceName = 'Magento\Framework\App\AreaList', $shared = true ) { $this->_objectManager = $objectManager; @@ -87,7 +87,7 @@ class Proxy extends \Magento\App\AreaList */ public function __wakeup() { - $this->_objectManager = \Magento\App\ObjectManager::getInstance(); + $this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** diff --git a/lib/Magento/App/Arguments.php b/lib/Magento/Framework/App/Arguments.php similarity index 95% rename from lib/Magento/App/Arguments.php rename to lib/Magento/Framework/App/Arguments.php index 5cc263f4b174fa64bafdadf91e61085885c7657e..81aeac7d6483121685b6e93fd6408e7873ef2fc9 100644 --- a/lib/Magento/App/Arguments.php +++ b/lib/Magento/Framework/App/Arguments.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class Arguments { @@ -37,7 +37,7 @@ class Arguments /** * Configuration loader * - * @var \Magento\App\Arguments\Loader + * @var \Magento\Framework\App\Arguments\Loader */ protected $_loader; @@ -50,9 +50,9 @@ class Arguments /** * @param array $parameters - * @param \Magento\App\Arguments\Loader $loader + * @param \Magento\Framework\App\Arguments\Loader $loader */ - public function __construct(array $parameters, \Magento\App\Arguments\Loader $loader) + public function __construct(array $parameters, \Magento\Framework\App\Arguments\Loader $loader) { $this->_loader = $loader; $this->_parameters = $parameters; diff --git a/lib/Magento/App/Arguments/ArgumentInterpreter.php b/lib/Magento/Framework/App/Arguments/ArgumentInterpreter.php similarity index 95% rename from lib/Magento/App/Arguments/ArgumentInterpreter.php rename to lib/Magento/Framework/App/Arguments/ArgumentInterpreter.php index 5dce1cf0ad63db62dbe8dea4cb590987df4ba1ca..76325e5269ac2c06bddc90116f23beed46e08ab3 100644 --- a/lib/Magento/App/Arguments/ArgumentInterpreter.php +++ b/lib/Magento/Framework/App/Arguments/ArgumentInterpreter.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments; +namespace Magento\Framework\App\Arguments; use Magento\Data\Argument\InterpreterInterface; use Magento\Data\Argument\Interpreter\Constant; use Magento\Data\Argument\MissingOptionalValueException; -use Magento\App\Arguments; +use Magento\Framework\App\Arguments; /** * Interpreter that returns value of an application argument, retrieving its name from a constant diff --git a/lib/Magento/App/Arguments/FileResolver/Primary.php b/lib/Magento/Framework/App/Arguments/FileResolver/Primary.php similarity index 90% rename from lib/Magento/App/Arguments/FileResolver/Primary.php rename to lib/Magento/Framework/App/Arguments/FileResolver/Primary.php index bc7a782e44be7c939c71a3ad90017097e1a777bf..5115486f516ffcded3f57cbaab1ed7b91a0e7b11 100644 --- a/lib/Magento/App/Arguments/FileResolver/Primary.php +++ b/lib/Magento/Framework/App/Arguments/FileResolver/Primary.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments\FileResolver; +namespace Magento\Framework\App\Arguments\FileResolver; class Primary implements \Magento\Config\FileResolverInterface { @@ -45,14 +45,14 @@ class Primary implements \Magento\Config\FileResolverInterface protected $iteratorFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Config\FileIteratorFactory $iteratorFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Config\FileIteratorFactory $iteratorFactory ) { - $this->configDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::CONFIG_DIR); + $this->configDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::CONFIG_DIR); $this->iteratorFactory = $iteratorFactory; } diff --git a/lib/Magento/App/Arguments/Loader.php b/lib/Magento/Framework/App/Arguments/Loader.php similarity index 90% rename from lib/Magento/App/Arguments/Loader.php rename to lib/Magento/Framework/App/Arguments/Loader.php index 8e411649bbcc1691534548d81b1d63144833e7e7..56738a9fa1195bd4a6a76f163108afbe2b3d78e1 100644 --- a/lib/Magento/App/Arguments/Loader.php +++ b/lib/Magento/Framework/App/Arguments/Loader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments; +namespace Magento\Framework\App\Arguments; class Loader { @@ -64,12 +64,12 @@ class Loader ); /** - * @param \Magento\App\Filesystem\DirectoryList $dirList + * @param \Magento\Framework\App\Filesystem\DirectoryList $dirList * @param string $customFile */ - public function __construct(\Magento\App\Filesystem\DirectoryList $dirList, $customFile = null) + public function __construct(\Magento\Framework\App\Filesystem\DirectoryList $dirList, $customFile = null) { - $this->_dir = $dirList->getDir(\Magento\App\Filesystem::CONFIG_DIR); + $this->_dir = $dirList->getDir(\Magento\Framework\App\Filesystem::CONFIG_DIR); $this->_customFile = $customFile; } diff --git a/lib/Magento/App/Arguments/ValidationState.php b/lib/Magento/Framework/App/Arguments/ValidationState.php similarity index 91% rename from lib/Magento/App/Arguments/ValidationState.php rename to lib/Magento/Framework/App/Arguments/ValidationState.php index 380cd51b03e07b95f9d01821b45c884877047ad3..8d28e1f60b1e83d4376118b49c155188c4a6c6cd 100644 --- a/lib/Magento/App/Arguments/ValidationState.php +++ b/lib/Magento/Framework/App/Arguments/ValidationState.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Arguments; +namespace Magento\Framework\App\Arguments; class ValidationState implements \Magento\Config\ValidationStateInterface { @@ -47,6 +47,6 @@ class ValidationState implements \Magento\Config\ValidationStateInterface */ public function isValidated() { - return $this->_appMode == \Magento\App\State::MODE_DEVELOPER; + return $this->_appMode == \Magento\Framework\App\State::MODE_DEVELOPER; } } diff --git a/lib/Magento/App/Cache.php b/lib/Magento/Framework/App/Cache.php similarity index 89% rename from lib/Magento/App/Cache.php rename to lib/Magento/Framework/App/Cache.php index b204c3b831c47909049b336001918a9303f183fd..8f1876499df13d2264c372387269476c25d0868b 100644 --- a/lib/Magento/App/Cache.php +++ b/lib/Magento/Framework/App/Cache.php @@ -28,17 +28,17 @@ * System cache model * support id and tags prefix support, */ -namespace Magento\App; +namespace Magento\Framework\App; class Cache implements CacheInterface { /** * @var string */ - protected $_frontendIdentifier = \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; + protected $_frontendIdentifier = \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; /** - * @var \Magento\App\Cache\Frontend\Pool + * @var \Magento\Framework\App\Cache\Frontend\Pool */ protected $_frontendPool; @@ -50,9 +50,9 @@ class Cache implements CacheInterface protected $_frontend; /** - * @param \Magento\App\Cache\Frontend\Pool $frontendPool + * @param \Magento\Framework\App\Cache\Frontend\Pool $frontendPool */ - public function __construct(\Magento\App\Cache\Frontend\Pool $frontendPool) + public function __construct(\Magento\Framework\App\Cache\Frontend\Pool $frontendPool) { $this->_frontendPool = $frontendPool; $this->_frontend = $frontendPool->get($this->_frontendIdentifier); diff --git a/lib/Magento/App/Cache/Frontend/Factory.php b/lib/Magento/Framework/App/Cache/Frontend/Factory.php similarity index 95% rename from lib/Magento/App/Cache/Frontend/Factory.php rename to lib/Magento/Framework/App/Cache/Frontend/Factory.php index 5b8e138fa9ffa3619b6e96035a51a13d3e636151..f3c2808edfdec5ca66362670493a7855f926fe03 100644 --- a/lib/Magento/App/Cache/Frontend/Factory.php +++ b/lib/Magento/Framework/App/Cache/Frontend/Factory.php @@ -25,7 +25,7 @@ /** * Factory that creates cache frontend instances based on options */ -namespace Magento\App\Cache\Frontend; +namespace Magento\Framework\App\Cache\Frontend; class Factory { @@ -44,7 +44,7 @@ class Factory private $_objectManager; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ private $_filesystem; @@ -87,21 +87,21 @@ class Factory /** * Resource * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resource; /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Filesystem $filesystem - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Filesystem $filesystem + * @param \Magento\Framework\App\Resource $resource * @param array $enforcedOptions * @param array $decorators */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\App\Filesystem $filesystem, - \Magento\App\Resource $resource, + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\Resource $resource, array $enforcedOptions = array(), array $decorators = array() ) { @@ -124,20 +124,21 @@ class Factory foreach (array('backend_options', 'slow_backend_options') as $section) { if (!empty($options[$section]['cache_dir'])) { - $directory = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); + $directory = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); $directory->create($options[$section]['cache_dir']); $options[$section]['cache_dir'] = $directory->getAbsolutePath($options[$section]['cache_dir']); } } - $this->_backendOptions['cache_dir'] = $this->_filesystem->getPath(\Magento\App\Filesystem::CACHE_DIR); + $this->_backendOptions['cache_dir'] = $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::CACHE_DIR); $idPrefix = isset($options['id_prefix']) ? $options['id_prefix'] : ''; if (!$idPrefix && isset($options['prefix'])) { $idPrefix = $options['prefix']; } if (empty($idPrefix)) { - $idPrefix = substr(md5($this->_filesystem->getPath(\Magento\App\Filesystem::CONFIG_DIR)), 0, 3) . '_'; + $idPrefix = + substr(md5($this->_filesystem->getPath(\Magento\Framework\App\Filesystem::CONFIG_DIR)), 0, 3) . '_'; } $options['frontend_options']['cache_id_prefix'] = $idPrefix; diff --git a/lib/Magento/App/Cache/Frontend/Pool.php b/lib/Magento/Framework/App/Cache/Frontend/Pool.php similarity index 95% rename from lib/Magento/App/Cache/Frontend/Pool.php rename to lib/Magento/Framework/App/Cache/Frontend/Pool.php index 9008a64b3bfbf7978d9fc0a4acadc495c08b32f8..391571dcfca21837fcd7861e43c91059d6a705d4 100644 --- a/lib/Magento/App/Cache/Frontend/Pool.php +++ b/lib/Magento/Framework/App/Cache/Frontend/Pool.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Frontend; +namespace Magento\Framework\App\Cache\Frontend; /** * In-memory readonly pool of all cache front-end instances known to the system @@ -34,7 +34,7 @@ class Pool implements \Iterator const DEFAULT_FRONTEND_ID = 'default'; /** - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ private $_arguments; @@ -54,12 +54,12 @@ class Pool implements \Iterator private $_frontendSettings; /** - * @param \Magento\App\Arguments $arguments + * @param \Magento\Framework\App\Arguments $arguments * @param Factory $frontendFactory * @param array $frontendSettings Format: array('<frontend_id>' => array(<cache_settings>), ...) */ public function __construct( - \Magento\App\Arguments $arguments, + \Magento\Framework\App\Arguments $arguments, Factory $frontendFactory, array $frontendSettings = array() ) { diff --git a/lib/Magento/App/Cache/InstanceFactory.php b/lib/Magento/Framework/App/Cache/InstanceFactory.php similarity index 97% rename from lib/Magento/App/Cache/InstanceFactory.php rename to lib/Magento/Framework/App/Cache/InstanceFactory.php index 1d25d0b1030c2a9b152b472b97f2f9a13fb6c55a..8a99bfe710bd954f3ca169e7c166ae556c769475 100644 --- a/lib/Magento/App/Cache/InstanceFactory.php +++ b/lib/Magento/Framework/App/Cache/InstanceFactory.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; class InstanceFactory { diff --git a/lib/Magento/App/Cache/Proxy.php b/lib/Magento/Framework/App/Cache/Proxy.php similarity index 96% rename from lib/Magento/App/Cache/Proxy.php rename to lib/Magento/Framework/App/Cache/Proxy.php index 17e16cb91c02beb055396a6160712d93973cb82b..17af4ba1283809b8c1e7d3c721a658ef872da325 100644 --- a/lib/Magento/App/Cache/Proxy.php +++ b/lib/Magento/Framework/App/Cache/Proxy.php @@ -25,9 +25,9 @@ /** * System cache proxy model */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; -use Magento\App\CacheInterface; +use Magento\Framework\App\CacheInterface; class Proxy implements CacheInterface { @@ -57,7 +57,7 @@ class Proxy implements CacheInterface protected function _getCache() { if (null == $this->_cache) { - $this->_cache = $this->_objectManager->get('Magento\App\Cache'); + $this->_cache = $this->_objectManager->get('Magento\Framework\App\Cache'); } return $this->_cache; } diff --git a/lib/Magento/App/Cache/State.php b/lib/Magento/Framework/App/Cache/State.php similarity index 89% rename from lib/Magento/App/Cache/State.php rename to lib/Magento/Framework/App/Cache/State.php index 795a53c001eaa11e412e327530bb2c211f94f151..c6678b8b8d3b57e04eb96251b7e0e3f4cb7bd866 100644 --- a/lib/Magento/App/Cache/State.php +++ b/lib/Magento/Framework/App/Cache/State.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; class State implements StateInterface { @@ -60,18 +60,19 @@ class State implements StateInterface /** * @param State\OptionsInterface $options - * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool + * @param \Magento\Framework\App\State $appState * @param bool $banAll Whether all cache types are forced to be disabled */ public function __construct( State\OptionsInterface $options, - \Magento\App\Cache\Frontend\Pool $cacheFrontendPool, - \Magento\App\State $appState, + \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool, + \Magento\Framework\App\State $appState, $banAll = false ) { $this->_options = $options; - $this->_cacheFrontend = $cacheFrontendPool->get(\Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); + $this->_cacheFrontend = + $cacheFrontendPool->get(\Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); if ($appState->isInstalled()) { $this->_loadTypeStatuses($banAll); } diff --git a/lib/Magento/App/Cache/State/Options.php b/lib/Magento/Framework/App/Cache/State/Options.php similarity index 94% rename from lib/Magento/App/Cache/State/Options.php rename to lib/Magento/Framework/App/Cache/State/Options.php index 26392552d347b894b7ea360c448544be7688852d..e55c2dfe6bd7fe31640ca561893d9a34f1f856f1 100644 --- a/lib/Magento/App/Cache/State/Options.php +++ b/lib/Magento/Framework/App/Cache/State/Options.php @@ -23,9 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\State; +namespace Magento\Framework\App\Cache\State; -class Options extends \Magento\Model\Resource\Db\AbstractDb implements \Magento\App\Cache\State\OptionsInterface +use Magento\Model\Resource\Db\AbstractDb; + +class Options extends AbstractDb implements OptionsInterface { /** * Define main table diff --git a/lib/Magento/App/Cache/State/OptionsInterface.php b/lib/Magento/Framework/App/Cache/State/OptionsInterface.php similarity index 96% rename from lib/Magento/App/Cache/State/OptionsInterface.php rename to lib/Magento/Framework/App/Cache/State/OptionsInterface.php index 9f54f99d8d418ee7778ce82aa939347c14bf13b7..e248b9e7fadb95bf6b9fee01c8a6868d710a88ae 100644 --- a/lib/Magento/App/Cache/State/OptionsInterface.php +++ b/lib/Magento/Framework/App/Cache/State/OptionsInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\State; +namespace Magento\Framework\App\Cache\State; interface OptionsInterface { diff --git a/lib/Magento/App/Cache/StateInterface.php b/lib/Magento/Framework/App/Cache/StateInterface.php similarity index 97% rename from lib/Magento/App/Cache/StateInterface.php rename to lib/Magento/Framework/App/Cache/StateInterface.php index 127c406fcc36d945bc70697ade3fe854b03b3286..9cd1e0b9912bd1274c42591606ce76ebac247e1f 100644 --- a/lib/Magento/App/Cache/StateInterface.php +++ b/lib/Magento/Framework/App/Cache/StateInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; interface StateInterface { diff --git a/lib/Magento/App/Cache/Type/AccessProxy.php b/lib/Magento/Framework/App/Cache/Type/AccessProxy.php similarity index 93% rename from lib/Magento/App/Cache/Type/AccessProxy.php rename to lib/Magento/Framework/App/Cache/Type/AccessProxy.php index a2fb394f995be68a6765fac9d22afac1913b55fe..60b57fce1d3d0f832ba16bfa58cd7b186cc62c9f 100644 --- a/lib/Magento/App/Cache/Type/AccessProxy.php +++ b/lib/Magento/Framework/App/Cache/Type/AccessProxy.php @@ -27,14 +27,14 @@ * It's typical for "access proxies" to have a decorator-like implementation, the difference is logical - * controlling access rather than attaching additional responsibility to a subject. */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class AccessProxy extends \Magento\Cache\Frontend\Decorator\Bare { /** * Cache types manager * - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ private $_cacheState; @@ -47,12 +47,12 @@ class AccessProxy extends \Magento\Cache\Frontend\Decorator\Bare /** * @param \Magento\Cache\FrontendInterface $frontend - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param string $identifier Cache type identifier */ public function __construct( \Magento\Cache\FrontendInterface $frontend, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, $identifier ) { parent::__construct($frontend); diff --git a/lib/Magento/App/Cache/Type/Block.php b/lib/Magento/Framework/App/Cache/Type/Block.php similarity index 86% rename from lib/Magento/App/Cache/Type/Block.php rename to lib/Magento/Framework/App/Cache/Type/Block.php index 4604ae540d6c07327d0f09df3ba55d0cb88b5e96..f0eed1e4a94ad82096e71eec0e4790d65b12c166 100644 --- a/lib/Magento/App/Cache/Type/Block.php +++ b/lib/Magento/Framework/App/Cache/Type/Block.php @@ -27,7 +27,7 @@ * * @todo utilize the class for all manipulations with the cache type */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class Block extends \Magento\Cache\Frontend\Decorator\TagScope { @@ -42,9 +42,9 @@ class Block extends \Magento\Cache\Frontend\Decorator\TagScope const CACHE_TAG = 'BLOCK_HTML'; /** - * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool */ - public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool) { parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } diff --git a/lib/Magento/App/Cache/Type/Collection.php b/lib/Magento/Framework/App/Cache/Type/Collection.php similarity index 97% rename from lib/Magento/App/Cache/Type/Collection.php rename to lib/Magento/Framework/App/Cache/Type/Collection.php index 59f15c4de79cb65c6a9f10e643b19b2957c572d6..776da96858b33d1298b1a1418e90247e9c41a23c 100644 --- a/lib/Magento/App/Cache/Type/Collection.php +++ b/lib/Magento/Framework/App/Cache/Type/Collection.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; /** * System / Cache Management / Cache type "Collections Data" diff --git a/lib/Magento/App/Cache/Type/Config.php b/lib/Magento/Framework/App/Cache/Type/Config.php similarity index 97% rename from lib/Magento/App/Cache/Type/Config.php rename to lib/Magento/Framework/App/Cache/Type/Config.php index da309b744e40563b2c277a987a94d66dfce1d924..193796bf0be33aac2707298ad2e1a7e46ea2df78 100644 --- a/lib/Magento/App/Cache/Type/Config.php +++ b/lib/Magento/Framework/App/Cache/Type/Config.php @@ -25,7 +25,7 @@ /** * System / Cache Management / Cache type "Configuration" */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; class Config extends \Magento\Cache\Frontend\Decorator\TagScope implements \Magento\Config\CacheInterface { diff --git a/lib/Magento/App/Cache/Type/FrontendPool.php b/lib/Magento/Framework/App/Cache/Type/FrontendPool.php similarity index 85% rename from lib/Magento/App/Cache/Type/FrontendPool.php rename to lib/Magento/Framework/App/Cache/Type/FrontendPool.php index 47fb50960ae5cd1ac9683a41c275373c563a78a4..58d12891ae45a140d3ed7f32160bc869018d8982 100644 --- a/lib/Magento/App/Cache/Type/FrontendPool.php +++ b/lib/Magento/Framework/App/Cache/Type/FrontendPool.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; /** * In-memory readonly pool of cache front-ends with enforced access control, specific to cache types @@ -34,12 +34,12 @@ class FrontendPool private $_objectManager; /** - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ private $_arguments; /** - * @var \Magento\App\Cache\Frontend\Pool + * @var \Magento\Framework\App\Cache\Frontend\Pool */ private $_frontendPool; @@ -55,14 +55,14 @@ class FrontendPool /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Arguments $arguments - * @param \Magento\App\Cache\Frontend\Pool $frontendPool + * @param \Magento\Framework\App\Arguments $arguments + * @param \Magento\Framework\App\Cache\Frontend\Pool $frontendPool * @param array $typeFrontendMap Format: array('<cache_type_id>' => '<cache_frontend_id>', ...) */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\App\Arguments $arguments, - \Magento\App\Cache\Frontend\Pool $frontendPool, + \Magento\Framework\App\Arguments $arguments, + \Magento\Framework\App\Cache\Frontend\Pool $frontendPool, array $typeFrontendMap = array() ) { $this->_objectManager = $objectManager; @@ -84,7 +84,7 @@ class FrontendPool $frontendInstance = $this->_frontendPool->get($frontendId); /** @var $frontendInstance AccessProxy */ $frontendInstance = $this->_objectManager->create( - 'Magento\App\Cache\Type\AccessProxy', + 'Magento\Framework\App\Cache\Type\AccessProxy', array('frontend' => $frontendInstance, 'identifier' => $cacheType) ); $this->_instances[$cacheType] = $frontendInstance; @@ -105,7 +105,7 @@ class FrontendPool if (isset($this->_typeFrontendMap[$cacheType])) { $result = $this->_typeFrontendMap[$cacheType]; } else { - $result = \Magento\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; + $result = \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID; } } return $result; diff --git a/lib/Magento/App/Cache/Type/Layout.php b/lib/Magento/Framework/App/Cache/Type/Layout.php similarity index 97% rename from lib/Magento/App/Cache/Type/Layout.php rename to lib/Magento/Framework/App/Cache/Type/Layout.php index 6a04a8ac5ed6ad5f04a1166007050a32f7a33260..b396f657620e9cf2fbb13c36b1c997f5e99ebd95 100644 --- a/lib/Magento/App/Cache/Type/Layout.php +++ b/lib/Magento/Framework/App/Cache/Type/Layout.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; /** * System / Cache Management / Cache type "Layouts" diff --git a/lib/Magento/App/Cache/Type/Translate.php b/lib/Magento/Framework/App/Cache/Type/Translate.php similarity index 97% rename from lib/Magento/App/Cache/Type/Translate.php rename to lib/Magento/Framework/App/Cache/Type/Translate.php index ba02f25a37448500759ae5d6a7dc9afb186c4630..4b127a5c96dc7a2381c34e8ea2312704a11c2a91 100644 --- a/lib/Magento/App/Cache/Type/Translate.php +++ b/lib/Magento/Framework/App/Cache/Type/Translate.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache\Type; +namespace Magento\Framework\App\Cache\Type; /** * System / Cache Management / Cache type "Translations" diff --git a/lib/Magento/App/Cache/TypeList.php b/lib/Magento/Framework/App/Cache/TypeList.php similarity index 96% rename from lib/Magento/App/Cache/TypeList.php rename to lib/Magento/Framework/App/Cache/TypeList.php index e0db2d1962b60a1ac2f8fb41522749788475891d..b0107b92ac7cb0e4561d826c78e671a44d4c56f3 100644 --- a/lib/Magento/App/Cache/TypeList.php +++ b/lib/Magento/Framework/App/Cache/TypeList.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; class TypeList implements TypeListInterface { @@ -43,7 +43,7 @@ class TypeList implements TypeListInterface protected $_cacheState; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -51,13 +51,13 @@ class TypeList implements TypeListInterface * @param \Magento\Cache\ConfigInterface $config * @param StateInterface $cacheState * @param InstanceFactory $factory - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache */ public function __construct( \Magento\Cache\ConfigInterface $config, StateInterface $cacheState, InstanceFactory $factory, - \Magento\App\CacheInterface $cache + \Magento\Framework\App\CacheInterface $cache ) { $this->_config = $config; $this->_factory = $factory; diff --git a/lib/Magento/App/Cache/TypeListInterface.php b/lib/Magento/Framework/App/Cache/TypeListInterface.php similarity index 97% rename from lib/Magento/App/Cache/TypeListInterface.php rename to lib/Magento/Framework/App/Cache/TypeListInterface.php index 867afd11b3376a8275a5723637d448554f381ae3..8759bc2cef5ba30b927fefbd99484c676b82f41e 100644 --- a/lib/Magento/App/Cache/TypeListInterface.php +++ b/lib/Magento/Framework/App/Cache/TypeListInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Cache; +namespace Magento\Framework\App\Cache; interface TypeListInterface { diff --git a/lib/Magento/App/CacheInterface.php b/lib/Magento/Framework/App/CacheInterface.php similarity index 98% rename from lib/Magento/App/CacheInterface.php rename to lib/Magento/Framework/App/CacheInterface.php index 08debde7f8b75ec0b395d6850fffd560ac131790..c37bba032134d16c0e889ef08b3748e0d24450b9 100644 --- a/lib/Magento/App/CacheInterface.php +++ b/lib/Magento/Framework/App/CacheInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface CacheInterface { diff --git a/lib/Magento/App/Config.php b/lib/Magento/Framework/App/Config.php similarity index 74% rename from lib/Magento/App/Config.php rename to lib/Magento/Framework/App/Config.php index 09251e374377b6a6e340e80278ba779ec5ef893e..7b5a6f166fae4b5d0e177315a4e3f8f0841125c8 100644 --- a/lib/Magento/App/Config.php +++ b/lib/Magento/Framework/App/Config.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -class Config implements \Magento\App\Config\ScopeConfigInterface +class Config implements \Magento\Framework\App\Config\ScopeConfigInterface { /** * Config cache tag @@ -33,14 +33,14 @@ class Config implements \Magento\App\Config\ScopeConfigInterface const CACHE_TAG = 'CONFIG'; /** - * @var \Magento\App\Config\ScopePool + * @var \Magento\Framework\App\Config\ScopePool */ protected $_scopePool; /** - * @param \Magento\App\Config\ScopePool $scopePool + * @param \Magento\Framework\App\Config\ScopePool $scopePool */ - public function __construct(\Magento\App\Config\ScopePool $scopePool) + public function __construct(\Magento\Framework\App\Config\ScopePool $scopePool) { $this->_scopePool = $scopePool; } @@ -53,8 +53,11 @@ class Config implements \Magento\App\Config\ScopeConfigInterface * @param null|string $scopeCode * @return mixed */ - public function getValue($path = null, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null) - { + public function getValue( + $path = null, + $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scopeCode = null + ) { return $this->_scopePool->getScope($scope, $scopeCode)->getValue($path); } @@ -66,7 +69,7 @@ class Config implements \Magento\App\Config\ScopeConfigInterface * @param null|string $scopeCode * @return bool */ - public function isSetFlag($path, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null) + public function isSetFlag($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null) { return (bool)$this->getValue($path, $scope, $scopeCode); } diff --git a/lib/Magento/App/Config/Base.php b/lib/Magento/Framework/App/Config/Base.php similarity index 93% rename from lib/Magento/App/Config/Base.php rename to lib/Magento/Framework/App/Config/Base.php index bf7eb2a8c3320549932657f0fa51267ff61b9bf5..b4839e5be7b21d8850c793f5b01bc08838ec0789 100644 --- a/lib/Magento/App/Config/Base.php +++ b/lib/Magento/Framework/App/Config/Base.php @@ -24,7 +24,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class Base extends \Magento\Simplexml\Config { @@ -40,7 +40,7 @@ class Base extends \Magento\Simplexml\Config */ public function __construct($sourceData = null) { - $this->_elementClass = 'Magento\App\Config\Element'; + $this->_elementClass = 'Magento\Framework\App\Config\Element'; parent::__construct($sourceData); self::$instances[] = $this; } diff --git a/lib/Magento/App/Config/BaseFactory.php b/lib/Magento/Framework/App/Config/BaseFactory.php similarity index 87% rename from lib/Magento/App/Config/BaseFactory.php rename to lib/Magento/Framework/App/Config/BaseFactory.php index cdae17950c29bab1e325e0f2e009487f998bc76b..5ec982421a07aecd1d2b0462110865427d3a469a 100644 --- a/lib/Magento/App/Config/BaseFactory.php +++ b/lib/Magento/Framework/App/Config/BaseFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class BaseFactory { @@ -44,10 +44,10 @@ class BaseFactory * Create config model * * @param string|\Magento\Simplexml\Element $sourceData - * @return \Magento\App\Config\Base + * @return \Magento\Framework\App\Config\Base */ public function create($sourceData = null) { - return $this->_objectManager->create('Magento\App\Config\Base', array('sourceData' => $sourceData)); + return $this->_objectManager->create('Magento\Framework\App\Config\Base', array('sourceData' => $sourceData)); } } diff --git a/lib/Magento/App/Config/Data.php b/lib/Magento/Framework/App/Config/Data.php similarity index 98% rename from lib/Magento/App/Config/Data.php rename to lib/Magento/Framework/App/Config/Data.php index 8c6269c191ae3fb4b3cec43eada9412b36d9389b..f99cbf6a345df81e71992a5bf0950f3b5ee6efa2 100644 --- a/lib/Magento/App/Config/Data.php +++ b/lib/Magento/Framework/App/Config/Data.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class Data implements DataInterface { diff --git a/lib/Magento/App/Config/Data/ProcessorFactory.php b/lib/Magento/Framework/App/Config/Data/ProcessorFactory.php similarity index 92% rename from lib/Magento/App/Config/Data/ProcessorFactory.php rename to lib/Magento/Framework/App/Config/Data/ProcessorFactory.php index ae2c546518c13147d9a2c6a69d0f992f6f37c243..789ecf2b1269e1193f84e3d5f3b4dcc3ee01e225 100644 --- a/lib/Magento/App/Config/Data/ProcessorFactory.php +++ b/lib/Magento/Framework/App/Config/Data/ProcessorFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Data; +namespace Magento\Framework\App\Config\Data; class ProcessorFactory { @@ -58,7 +58,7 @@ class ProcessorFactory $instance = $this->_objectManager->create($model); if (!$instance instanceof ProcessorInterface) { throw new \InvalidArgumentException( - $model . ' does not instance of \Magento\App\Config\Data\ProcessorInterface' + $model . ' does not instance of \Magento\Framework\App\Config\Data\ProcessorInterface' ); } $this->_pool[$model] = $instance; diff --git a/lib/Magento/App/Config/Data/ProcessorInterface.php b/lib/Magento/Framework/App/Config/Data/ProcessorInterface.php similarity index 96% rename from lib/Magento/App/Config/Data/ProcessorInterface.php rename to lib/Magento/Framework/App/Config/Data/ProcessorInterface.php index 22735e063994855dda08e2ac57226da94e8472af..bdf71b6c2043195574271dc9cec8d026563e24cd 100644 --- a/lib/Magento/App/Config/Data/ProcessorInterface.php +++ b/lib/Magento/Framework/App/Config/Data/ProcessorInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Data; +namespace Magento\Framework\App\Config\Data; interface ProcessorInterface { diff --git a/lib/Magento/App/Config/DataFactory.php b/lib/Magento/Framework/App/Config/DataFactory.php similarity index 89% rename from lib/Magento/App/Config/DataFactory.php rename to lib/Magento/Framework/App/Config/DataFactory.php index 59733800c40232fe56be9a1df3c6e3d68fdee846..373def5f234694ad8a4b4307cd070fc767095950 100644 --- a/lib/Magento/App/Config/DataFactory.php +++ b/lib/Magento/Framework/App/Config/DataFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class DataFactory { @@ -45,8 +45,10 @@ class DataFactory * @param \Magento\ObjectManager $objectManager * @param string $instanceName */ - public function __construct(\Magento\ObjectManager $objectManager, $instanceName = 'Magento\App\Config\Data') - { + public function __construct( + \Magento\ObjectManager $objectManager, + $instanceName = 'Magento\Framework\App\Config\Data' + ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } diff --git a/lib/Magento/App/Config/DataInterface.php b/lib/Magento/Framework/App/Config/DataInterface.php similarity index 96% rename from lib/Magento/App/Config/DataInterface.php rename to lib/Magento/Framework/App/Config/DataInterface.php index 1a9e977b1d1bb3b64582fa8828a156aa1c6426e5..fe236c8675c4e0a272056f34019a9bb3c0508ff3 100644 --- a/lib/Magento/App/Config/DataInterface.php +++ b/lib/Magento/Framework/App/Config/DataInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; interface DataInterface { diff --git a/lib/Magento/App/Config/Element.php b/lib/Magento/Framework/App/Config/Element.php similarity index 97% rename from lib/Magento/App/Config/Element.php rename to lib/Magento/Framework/App/Config/Element.php index af7e52397aec49fd4450d6fd1ecdad2684fa774b..8c67137e3b496d11e43511162418a7a02974ab58 100644 --- a/lib/Magento/App/Config/Element.php +++ b/lib/Magento/Framework/App/Config/Element.php @@ -25,7 +25,7 @@ /** * Config element model */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class Element extends \Magento\Simplexml\Element { diff --git a/lib/Magento/App/Config/FileResolver.php b/lib/Magento/Framework/App/Config/FileResolver.php similarity index 92% rename from lib/Magento/App/Config/FileResolver.php rename to lib/Magento/Framework/App/Config/FileResolver.php index b5ba6db4cf70f1c3b0b2ec37c18d64518df00517..4dc88a40fb6bd0f7ea2bf21265fb5af769b7aeeb 100644 --- a/lib/Magento/App/Config/FileResolver.php +++ b/lib/Magento/Framework/App/Config/FileResolver.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class FileResolver implements \Magento\Config\FileResolverInterface { @@ -43,12 +43,12 @@ class FileResolver implements \Magento\Config\FileResolverInterface /** * @param \Magento\Module\Dir\Reader $moduleReader - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Config\FileIteratorFactory $iteratorFactory */ public function __construct( \Magento\Module\Dir\Reader $moduleReader, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Config\FileIteratorFactory $iteratorFactory ) { $this->iteratorFactory = $iteratorFactory; @@ -63,7 +63,7 @@ class FileResolver implements \Magento\Config\FileResolverInterface { switch ($scope) { case 'primary': - $directory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::CONFIG_DIR); + $directory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::CONFIG_DIR); $iterator = $this->iteratorFactory->create( $directory, $directory->search('{' . $filename . ',*/' . $filename . '}') diff --git a/lib/Magento/App/Config/Initial.php b/lib/Magento/Framework/App/Config/Initial.php similarity index 85% rename from lib/Magento/App/Config/Initial.php rename to lib/Magento/Framework/App/Config/Initial.php index 87c9b00a541b7c8a603e76e671b1e1444316ba45..31e9873b6836f49d8e60e61dfa35d3f17405cd9b 100644 --- a/lib/Magento/App/Config/Initial.php +++ b/lib/Magento/Framework/App/Config/Initial.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class Initial { @@ -47,11 +47,13 @@ class Initial protected $_metadata = array(); /** - * @param \Magento\App\Config\Initial\Reader $reader - * @param \Magento\App\Cache\Type\Config $cache + * @param \Magento\Framework\App\Config\Initial\Reader $reader + * @param \Magento\Framework\App\Cache\Type\Config $cache */ - public function __construct(\Magento\App\Config\Initial\Reader $reader, \Magento\App\Cache\Type\Config $cache) - { + public function __construct( + \Magento\Framework\App\Config\Initial\Reader $reader, + \Magento\Framework\App\Cache\Type\Config $cache + ) { $data = $cache->load(self::CACHE_ID); if (!$data) { $data = $reader->read(); @@ -73,7 +75,7 @@ class Initial { list($scopeType, $scopeCode) = array_pad(explode('|', $scope), 2, null); - if (\Magento\App\ScopeInterface::SCOPE_DEFAULT == $scopeType) { + if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT == $scopeType) { return isset($this->_data[$scopeType]) ? $this->_data[$scopeType] : array(); } elseif ($scopeCode) { return isset($this->_data[$scopeType][$scopeCode]) ? $this->_data[$scopeType][$scopeCode] : array(); diff --git a/lib/Magento/App/Config/Initial/Converter.php b/lib/Magento/Framework/App/Config/Initial/Converter.php similarity index 98% rename from lib/Magento/App/Config/Initial/Converter.php rename to lib/Magento/Framework/App/Config/Initial/Converter.php index 3eec68816e4360f1e374b63717ae2632c5f4721d..8c2b72a6cfbaa196d52f34931ccb30d6b81f353d 100644 --- a/lib/Magento/App/Config/Initial/Converter.php +++ b/lib/Magento/Framework/App/Config/Initial/Converter.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; class Converter implements \Magento\Config\ConverterInterface { diff --git a/lib/Magento/App/Config/Initial/Reader.php b/lib/Magento/Framework/App/Config/Initial/Reader.php similarity index 98% rename from lib/Magento/App/Config/Initial/Reader.php rename to lib/Magento/Framework/App/Config/Initial/Reader.php index 07a08643e8beb08e7d91f99aea0a88658fd42e8f..e5245e102304c6ff33a7272b7c98670c24879a19 100644 --- a/lib/Magento/App/Config/Initial/Reader.php +++ b/lib/Magento/Framework/App/Config/Initial/Reader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; class Reader { diff --git a/lib/Magento/App/Config/Initial/SchemaLocator.php b/lib/Magento/Framework/App/Config/Initial/SchemaLocator.php similarity index 97% rename from lib/Magento/App/Config/Initial/SchemaLocator.php rename to lib/Magento/Framework/App/Config/Initial/SchemaLocator.php index a9ae5f56df10450bdcb6ca270800310070645130..b9eac4234deb41d77d3750f01efa7253a3eabbce 100644 --- a/lib/Magento/App/Config/Initial/SchemaLocator.php +++ b/lib/Magento/Framework/App/Config/Initial/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Initial; +namespace Magento\Framework\App\Config\Initial; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { diff --git a/lib/Magento/App/Config/MetadataProcessor.php b/lib/Magento/Framework/App/Config/MetadataProcessor.php similarity index 86% rename from lib/Magento/App/Config/MetadataProcessor.php rename to lib/Magento/Framework/App/Config/MetadataProcessor.php index 9e12f784e37de34bc5acf7b23caed6a420f05ebb..5d44bdfe549435fe2da3bbbd3715d8c8ed310a63 100644 --- a/lib/Magento/App/Config/MetadataProcessor.php +++ b/lib/Magento/Framework/App/Config/MetadataProcessor.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class MetadataProcessor { /** - * @var \Magento\App\Config\Data\ProcessorFactory + * @var \Magento\Framework\App\Config\Data\ProcessorFactory */ protected $_processorFactory; @@ -38,11 +38,13 @@ class MetadataProcessor protected $_metadata = array(); /** - * @param \Magento\App\Config\Data\ProcessorFactory $processorFactory + * @param \Magento\Framework\App\Config\Data\ProcessorFactory $processorFactory * @param Initial $initialConfig */ - public function __construct(\Magento\App\Config\Data\ProcessorFactory $processorFactory, Initial $initialConfig) - { + public function __construct( + \Magento\Framework\App\Config\Data\ProcessorFactory $processorFactory, + Initial $initialConfig + ) { $this->_processorFactory = $processorFactory; $this->_metadata = $initialConfig->getMetadata(); } @@ -97,7 +99,7 @@ class MetadataProcessor public function process(array $data) { foreach ($this->_metadata as $path => $metadata) { - /** @var \Magento\App\Config\Data\ProcessorInterface $processor */ + /** @var \Magento\Framework\App\Config\Data\ProcessorInterface $processor */ $processor = $this->_processorFactory->get($metadata['backendModel']); $value = $processor->processValue($this->_getValue($data, $path)); $this->_setValue($data, $path, $value); diff --git a/lib/Magento/App/Config/MutableScopeConfigInterface.php b/lib/Magento/Framework/App/Config/MutableScopeConfigInterface.php similarity index 79% rename from lib/Magento/App/Config/MutableScopeConfigInterface.php rename to lib/Magento/Framework/App/Config/MutableScopeConfigInterface.php index 59d2f023c9a2a55d4702b3d567492a55bcd0430d..07e42f64afb226e9c0b44f5832f42fac37dfcaef 100644 --- a/lib/Magento/App/Config/MutableScopeConfigInterface.php +++ b/lib/Magento/Framework/App/Config/MutableScopeConfigInterface.php @@ -24,9 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; -interface MutableScopeConfigInterface extends \Magento\App\Config\ScopeConfigInterface +interface MutableScopeConfigInterface extends \Magento\Framework\App\Config\ScopeConfigInterface { /** * Set config value in the corresponding config scope @@ -37,5 +37,10 @@ interface MutableScopeConfigInterface extends \Magento\App\Config\ScopeConfigInt * @param null|string $scopeCode * @return void */ - public function setValue($path, $value, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); + public function setValue( + $path, + $value, + $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scopeCode = null + ); } diff --git a/lib/Magento/App/Config/ReinitableConfigInterface.php b/lib/Magento/Framework/App/Config/ReinitableConfigInterface.php similarity index 83% rename from lib/Magento/App/Config/ReinitableConfigInterface.php rename to lib/Magento/Framework/App/Config/ReinitableConfigInterface.php index 907f2fed60b9154b47032556b3faa222498864f9..260e4f55992c6cfe55b17cbf18086fd31b71dd94 100644 --- a/lib/Magento/App/Config/ReinitableConfigInterface.php +++ b/lib/Magento/Framework/App/Config/ReinitableConfigInterface.php @@ -24,14 +24,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; -interface ReinitableConfigInterface extends \Magento\App\Config\MutableScopeConfigInterface +interface ReinitableConfigInterface extends \Magento\Framework\App\Config\MutableScopeConfigInterface { /** * Reinitialize config object * - * @return \Magento\App\Config\ReinitableConfigInterface + * @return \Magento\Framework\App\Config\ReinitableConfigInterface */ public function reinit(); } diff --git a/lib/Magento/App/Config/Resource/ConfigInterface.php b/lib/Magento/Framework/App/Config/Resource/ConfigInterface.php similarity index 96% rename from lib/Magento/App/Config/Resource/ConfigInterface.php rename to lib/Magento/Framework/App/Config/Resource/ConfigInterface.php index bec53622a691540dae3547426f42b6810728dafe..93ca51118e487f70bcfdfcedeb8b4ac855a96086 100644 --- a/lib/Magento/App/Config/Resource/ConfigInterface.php +++ b/lib/Magento/Framework/App/Config/Resource/ConfigInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Resource; +namespace Magento\Framework\App\Config\Resource; /** * Resource Config Interface diff --git a/lib/Magento/App/Config/Scope/Converter.php b/lib/Magento/Framework/App/Config/Scope/Converter.php similarity index 97% rename from lib/Magento/App/Config/Scope/Converter.php rename to lib/Magento/Framework/App/Config/Scope/Converter.php index a7c73ceed1a540642bd7aa765f2ffb6ce9920308..18bcb9723478e8e8c8de5354c12766f5e554dd51 100644 --- a/lib/Magento/App/Config/Scope/Converter.php +++ b/lib/Magento/Framework/App/Config/Scope/Converter.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Scope; +namespace Magento\Framework\App\Config\Scope; class Converter implements \Magento\Config\ConverterInterface { diff --git a/lib/Magento/App/Config/Scope/ReaderInterface.php b/lib/Magento/Framework/App/Config/Scope/ReaderInterface.php similarity index 95% rename from lib/Magento/App/Config/Scope/ReaderInterface.php rename to lib/Magento/Framework/App/Config/Scope/ReaderInterface.php index 715d78bfe76f01dfde88fe22999dfbce39f59df5..f64e442504de94aefe86fcddcb59a81a89474e97 100644 --- a/lib/Magento/App/Config/Scope/ReaderInterface.php +++ b/lib/Magento/Framework/App/Config/Scope/ReaderInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Scope; +namespace Magento\Framework\App\Config\Scope; interface ReaderInterface { diff --git a/lib/Magento/App/Config/Scope/ReaderPoolInterface.php b/lib/Magento/Framework/App/Config/Scope/ReaderPoolInterface.php similarity index 96% rename from lib/Magento/App/Config/Scope/ReaderPoolInterface.php rename to lib/Magento/Framework/App/Config/Scope/ReaderPoolInterface.php index 429ad3fba70cb4f31004b51e0a3eeb709f228cf7..aae2ab278ac827be3f7012b7bb986a663c3eb8b1 100644 --- a/lib/Magento/App/Config/Scope/ReaderPoolInterface.php +++ b/lib/Magento/Framework/App/Config/Scope/ReaderPoolInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Scope; +namespace Magento\Framework\App\Config\Scope; interface ReaderPoolInterface { diff --git a/lib/Magento/App/Config/ScopeConfigInterface.php b/lib/Magento/Framework/App/Config/ScopeConfigInterface.php similarity index 82% rename from lib/Magento/App/Config/ScopeConfigInterface.php rename to lib/Magento/Framework/App/Config/ScopeConfigInterface.php index 5932ea649dc8903de524462edeb024d73630722e..79d61740b0e320d36f460546384bbffab47ecfbd 100644 --- a/lib/Magento/App/Config/ScopeConfigInterface.php +++ b/lib/Magento/Framework/App/Config/ScopeConfigInterface.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; interface ScopeConfigInterface { @@ -36,7 +36,7 @@ interface ScopeConfigInterface * @param null|string $scopeCode * @return mixed */ - public function getValue($path, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); + public function getValue($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); /** * Retrieve config flag by path and scope @@ -46,5 +46,5 @@ interface ScopeConfigInterface * @param null|string $scopeCode * @return bool */ - public function isSetFlag($path, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); + public function isSetFlag($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); } diff --git a/lib/Magento/App/Config/ScopePool.php b/lib/Magento/Framework/App/Config/ScopePool.php similarity index 82% rename from lib/Magento/App/Config/ScopePool.php rename to lib/Magento/Framework/App/Config/ScopePool.php index ddf3538a75c258e8d5adc79c4e05f8ea70ca8d1c..d14998dd400423c00cba12c524b735c0a3a2f01c 100644 --- a/lib/Magento/App/Config/ScopePool.php +++ b/lib/Magento/Framework/App/Config/ScopePool.php @@ -21,14 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; class ScopePool { const CACHE_TAG = 'config_scopes'; /** - * @var \Magento\App\Config\Scope\ReaderPoolInterface + * @var \Magento\Framework\App\Config\Scope\ReaderPoolInterface */ protected $_readerPool; @@ -53,22 +53,22 @@ class ScopePool protected $_scopes = array(); /** - * @var \Magento\App\ScopeResolverPool + * @var \Magento\Framework\App\ScopeResolverPool */ protected $_scopeResolverPool; /** - * @param \Magento\App\Config\Scope\ReaderPoolInterface $readerPool + * @param \Magento\Framework\App\Config\Scope\ReaderPoolInterface $readerPool * @param DataFactory $dataFactory * @param \Magento\Cache\FrontendInterface $cache - * @param \Magento\App\ScopeResolverPool $scopeResolverPool + * @param \Magento\Framework\App\ScopeResolverPool $scopeResolverPool * @param string $cacheId */ public function __construct( - \Magento\App\Config\Scope\ReaderPoolInterface $readerPool, + \Magento\Framework\App\Config\Scope\ReaderPoolInterface $readerPool, DataFactory $dataFactory, \Magento\Cache\FrontendInterface $cache, - \Magento\App\ScopeResolverPool $scopeResolverPool, + \Magento\Framework\App\ScopeResolverPool $scopeResolverPool, $cacheId = 'default_config_cache' ) { $this->_readerPool = $readerPool; @@ -83,7 +83,7 @@ class ScopePool * * @param string $scopeType * @param string|\Magento\Object|null $scopeCode - * @return \Magento\App\Config\DataInterface + * @return \Magento\Framework\App\Config\DataInterface */ public function getScope($scopeType, $scopeCode = null) { @@ -96,7 +96,7 @@ class ScopePool $data = unserialize($data); } else { $reader = $this->_readerPool->getReader($scopeType); - if ($scopeType === \Magento\App\ScopeInterface::SCOPE_DEFAULT) { + if ($scopeType === \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT) { $data = $reader->read(); } else { $data = $reader->read($scopeCode); @@ -129,13 +129,13 @@ class ScopePool protected function _getScopeCode($scopeType, $scopeCode) { if ((is_null($scopeCode) || is_numeric($scopeCode)) - && $scopeType !== \Magento\App\ScopeInterface::SCOPE_DEFAULT + && $scopeType !== \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ) { $scopeResolver = $this->_scopeResolverPool->get($scopeType); $scopeCode = $scopeResolver->getScope($scopeCode); } - if ($scopeCode instanceof \Magento\App\ScopeInterface) { + if ($scopeCode instanceof \Magento\Framework\App\ScopeInterface) { $scopeCode = $scopeCode->getCode(); } diff --git a/lib/Magento/App/Config/Storage/Writer.php b/lib/Magento/Framework/App/Config/Storage/Writer.php similarity index 73% rename from lib/Magento/App/Config/Storage/Writer.php rename to lib/Magento/Framework/App/Config/Storage/Writer.php index 513b230c9f974f589d77ae13e74f44ae92c28dbc..765c8971268c75b6446e45117f0a1077a1324d6d 100644 --- a/lib/Magento/App/Config/Storage/Writer.php +++ b/lib/Magento/Framework/App/Config/Storage/Writer.php @@ -23,21 +23,21 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Storage; +namespace Magento\Framework\App\Config\Storage; -class Writer implements \Magento\App\Config\Storage\WriterInterface +class Writer implements \Magento\Framework\App\Config\Storage\WriterInterface { /** * Resource model of config data * - * @var \Magento\App\Config\Resource\ConfigInterface + * @var \Magento\Framework\App\Config\Resource\ConfigInterface */ protected $_resource; /** - * @param \Magento\App\Config\Resource\ConfigInterface $resource + * @param \Magento\Framework\App\Config\Resource\ConfigInterface $resource */ - public function __construct(\Magento\App\Config\Resource\ConfigInterface $resource) + public function __construct(\Magento\Framework\App\Config\Resource\ConfigInterface $resource) { $this->_resource = $resource; } @@ -50,7 +50,7 @@ class Writer implements \Magento\App\Config\Storage\WriterInterface * @param int $scopeId * @return void */ - public function delete($path, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) + public function delete($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) { $this->_resource->deleteConfig(rtrim($path, '/'), $scope, $scopeId); } @@ -64,7 +64,7 @@ class Writer implements \Magento\App\Config\Storage\WriterInterface * @param int $scopeId * @return void */ - public function save($path, $value, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) + public function save($path, $value, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) { $this->_resource->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId); } diff --git a/lib/Magento/App/Config/Storage/WriterInterface.php b/lib/Magento/Framework/App/Config/Storage/WriterInterface.php similarity index 83% rename from lib/Magento/App/Config/Storage/WriterInterface.php rename to lib/Magento/Framework/App/Config/Storage/WriterInterface.php index 62ddee7f7429a0a65d2e028adc0bad1088cb3db0..7c7fef119d6c28487ad0a4c380bcfbcd743262d5 100644 --- a/lib/Magento/App/Config/Storage/WriterInterface.php +++ b/lib/Magento/Framework/App/Config/Storage/WriterInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config\Storage; +namespace Magento\Framework\App\Config\Storage; interface WriterInterface { @@ -35,7 +35,7 @@ interface WriterInterface * @param int $scopeId * @return void */ - public function delete($path, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); + public function delete($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); /** * Save config value to storage @@ -46,5 +46,5 @@ interface WriterInterface * @param int $scopeId * @return void */ - public function save($path, $value, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); + public function save($path, $value, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); } diff --git a/lib/Magento/App/Config/Value.php b/lib/Magento/Framework/App/Config/Value.php similarity index 82% rename from lib/Magento/App/Config/Value.php rename to lib/Magento/Framework/App/Config/Value.php index f417bbe0dfdf4b9fff04b203cabd1d14606e4a38..eba081a0ed585e06b97b23b134b7f3177a7e69d2 100644 --- a/lib/Magento/App/Config/Value.php +++ b/lib/Magento/Framework/App/Config/Value.php @@ -21,23 +21,23 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; /** * Config data model * * @method \Magento\Model\Resource\Db\AbstractDb getResource() * @method string getScope() - * @method \Magento\App\Config\ValueInterface setScope(string $value) + * @method \Magento\Framework\App\Config\ValueInterface setScope(string $value) * @method int getScopeId() - * @method \Magento\App\Config\ValueInterface setScopeId(int $value) + * @method \Magento\Framework\App\Config\ValueInterface setScopeId(int $value) * @method string getPath() - * @method \Magento\App\Config\ValueInterface setPath(string $value) - * @method \Magento\App\Config\ValueInterface setValue(string $value) + * @method \Magento\Framework\App\Config\ValueInterface setPath(string $value) + * @method \Magento\Framework\App\Config\ValueInterface setValue(string $value) * * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Value extends \Magento\Model\AbstractModel implements \Magento\App\Config\ValueInterface +class Value extends \Magento\Model\AbstractModel implements \Magento\Framework\App\Config\ValueInterface { /** * Prefix of model events names @@ -56,14 +56,14 @@ class Value extends \Magento\Model\AbstractModel implements \Magento\App\Config\ protected $_eventObject = 'config_data'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_config; /** * @param \Magento\Model\Context $context * @param \Magento\Registry $registry - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config * @param \Magento\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -71,7 +71,7 @@ class Value extends \Magento\Model\AbstractModel implements \Magento\App\Config\ public function __construct( \Magento\Model\Context $context, \Magento\Registry $registry, - \Magento\App\Config\ScopeConfigInterface $config, + \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -109,7 +109,7 @@ class Value extends \Magento\Model\AbstractModel implements \Magento\App\Config\ { return (string)$this->_config->getValue( $this->getPath(), - $this->getScope() ?: \Magento\App\ScopeInterface::SCOPE_DEFAULT, + $this->getScope() ?: \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $this->getScopeCode() ); } diff --git a/lib/Magento/App/Config/ValueFactory.php b/lib/Magento/Framework/App/Config/ValueFactory.php similarity index 88% rename from lib/Magento/App/Config/ValueFactory.php rename to lib/Magento/Framework/App/Config/ValueFactory.php index d7ae0128b01d40563a1e06c270c8780ae609d8af..ed2ac84dc5d7fbbf0cc0733f740ae267baf12a1d 100644 --- a/lib/Magento/App/Config/ValueFactory.php +++ b/lib/Magento/Framework/App/Config/ValueFactory.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; /** * Factory class @@ -50,7 +50,7 @@ class ValueFactory */ public function __construct( \Magento\ObjectManager $objectManager, - $instanceName = 'Magento\App\Config\ValueInterface' + $instanceName = 'Magento\Framework\App\Config\ValueInterface' ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; @@ -60,13 +60,13 @@ class ValueFactory * Create class instance with specified parameters * * @param array $data - * @return \Magento\App\Config\ValueInterface + * @return \Magento\Framework\App\Config\ValueInterface * @throws \InvalidArgumentException */ public function create(array $data = array()) { $model = $this->_objectManager->create($this->_instanceName, $data); - if (!$model instanceof \Magento\App\Config\ValueInterface) { + if (!$model instanceof \Magento\Framework\App\Config\ValueInterface) { throw new \InvalidArgumentException('Invalid config field model: ' . $this->_instanceName); } return $model; diff --git a/lib/Magento/App/Config/ValueInterface.php b/lib/Magento/Framework/App/Config/ValueInterface.php similarity index 97% rename from lib/Magento/App/Config/ValueInterface.php rename to lib/Magento/Framework/App/Config/ValueInterface.php index 56905071070469787ce3fd5ef7e75cd8a76e8231..29fca8f0b841541023bcf0b0443ce19f94624865 100644 --- a/lib/Magento/App/Config/ValueInterface.php +++ b/lib/Magento/Framework/App/Config/ValueInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Config; +namespace Magento\Framework\App\Config; interface ValueInterface { diff --git a/lib/Magento/App/Console/Request.php b/lib/Magento/Framework/App/Console/Request.php similarity index 95% rename from lib/Magento/App/Console/Request.php rename to lib/Magento/Framework/App/Console/Request.php index 40a10dff105abb4ba00428ec382c667b2880fcd6..cfa00214f2e982d085a57c93c94543a612d24b5c 100644 --- a/lib/Magento/App/Console/Request.php +++ b/lib/Magento/Framework/App/Console/Request.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Console; +namespace Magento\Framework\App\Console; -class Request implements \Magento\App\RequestInterface +class Request implements \Magento\Framework\App\RequestInterface { /** * @var array diff --git a/lib/Magento/App/Console/Response.php b/lib/Magento/Framework/App/Console/Response.php similarity index 94% rename from lib/Magento/App/Console/Response.php rename to lib/Magento/Framework/App/Console/Response.php index af9d02d1a8e6ce23db968dd90d5f412cfaffa7ef..e42f93b2b283e56bbcaa91b43ebc96e2165d5d5f 100644 --- a/lib/Magento/App/Console/Response.php +++ b/lib/Magento/Framework/App/Console/Response.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Console; +namespace Magento\Framework\App\Console; /** * @SuppressWarnings(PHPMD.ExitExpression) */ -class Response implements \Magento\App\ResponseInterface +class Response implements \Magento\Framework\App\ResponseInterface { /** * Status code diff --git a/lib/Magento/App/Cron.php b/lib/Magento/Framework/App/Cron.php similarity index 93% rename from lib/Magento/App/Cron.php rename to lib/Magento/Framework/App/Cron.php index 9883a71e17fbf0c3bd8241e2e54d1cbc42dd31b2..067cc9ee6427a124cd6145d6aecfdf7941192ffe 100644 --- a/lib/Magento/App/Cron.php +++ b/lib/Magento/Framework/App/Cron.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -use Magento\App\ObjectManager\ConfigLoader; +use Magento\Framework\App\ObjectManager\ConfigLoader; use Magento\Event\ManagerInterface; -class Cron implements \Magento\AppInterface +class Cron implements \Magento\Framework\AppInterface { /** * @var \Magento\Event\ManagerInterface diff --git a/lib/Magento/App/DefaultPath/DefaultPath.php b/lib/Magento/Framework/App/DefaultPath/DefaultPath.php similarity index 92% rename from lib/Magento/App/DefaultPath/DefaultPath.php rename to lib/Magento/Framework/App/DefaultPath/DefaultPath.php index 74437de1c0bf37710f43b8314da3cad94185e6ab..9de2b6c6084d4a5f889227854c2ba13571cc529f 100644 --- a/lib/Magento/App/DefaultPath/DefaultPath.php +++ b/lib/Magento/Framework/App/DefaultPath/DefaultPath.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\DefaultPath; +namespace Magento\Framework\App\DefaultPath; -class DefaultPath implements \Magento\App\DefaultPathInterface +class DefaultPath implements \Magento\Framework\App\DefaultPathInterface { /** * Default path parts diff --git a/lib/Magento/App/DefaultPathInterface.php b/lib/Magento/Framework/App/DefaultPathInterface.php similarity index 97% rename from lib/Magento/App/DefaultPathInterface.php rename to lib/Magento/Framework/App/DefaultPathInterface.php index 3ac7c31ed0ff756533f402709bb2e743b5dddb39..52f90ddd6de00241c37ab1f7674464f49ffcf604 100644 --- a/lib/Magento/App/DefaultPathInterface.php +++ b/lib/Magento/Framework/App/DefaultPathInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface DefaultPathInterface { diff --git a/lib/Magento/App/EntryPoint/EntryPoint.php b/lib/Magento/Framework/App/EntryPoint/EntryPoint.php similarity index 93% rename from lib/Magento/App/EntryPoint/EntryPoint.php rename to lib/Magento/Framework/App/EntryPoint/EntryPoint.php index e2a5990ea1ac523c5765d2db2993b4f0aed11b9c..8a66780ac65c2945b5ae4be5dccaaa9d57eb46a0 100644 --- a/lib/Magento/App/EntryPoint/EntryPoint.php +++ b/lib/Magento/Framework/App/EntryPoint/EntryPoint.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\EntryPoint; +namespace Magento\Framework\App\EntryPoint; -use Magento\App\State; -use Magento\App\EntryPointInterface; +use Magento\Framework\App\State; +use Magento\Framework\App\EntryPointInterface; use Magento\ObjectManager; class EntryPoint implements EntryPointInterface @@ -73,7 +73,7 @@ class EntryPoint implements EntryPointInterface try { \Magento\Profiler::start('magento'); if (!$this->_locator) { - $locatorFactory = new \Magento\App\ObjectManagerFactory(); + $locatorFactory = new \Magento\Framework\App\ObjectManagerFactory(); $this->_locator = $locatorFactory->create($this->_rootDir, $this->_parameters); } $application = $this->_locator->create($applicationName, $arguments); diff --git a/lib/Magento/App/EntryPointInterface.php b/lib/Magento/Framework/App/EntryPointInterface.php similarity index 97% rename from lib/Magento/App/EntryPointInterface.php rename to lib/Magento/Framework/App/EntryPointInterface.php index ebe60a5849b6187e7dd6bb7ddcc48d2a943e2815..83c57a3b99bdac990676a66b65b351da0c3afb84 100644 --- a/lib/Magento/App/EntryPointInterface.php +++ b/lib/Magento/Framework/App/EntryPointInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface EntryPointInterface { diff --git a/lib/Magento/App/Error/Handler.php b/lib/Magento/Framework/App/Error/Handler.php similarity index 80% rename from lib/Magento/App/Error/Handler.php rename to lib/Magento/Framework/App/Error/Handler.php index 41d607f241e1f8e5ffa2071139b0334f5df16154..fedc58cb993c8a51c6031a54b7177b488098f381 100644 --- a/lib/Magento/App/Error/Handler.php +++ b/lib/Magento/Framework/App/Error/Handler.php @@ -25,7 +25,7 @@ /** * Default Error Handler */ -namespace Magento\App\Error; +namespace Magento\Framework\App\Error; class Handler extends \Magento\Error\Handler { @@ -35,24 +35,24 @@ class Handler extends \Magento\Error\Handler protected $_logger; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** * @param \Magento\Logger $logger - * @param \Magento\App\Filesystem $filesystem - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\Filesystem $filesystem + * @param \Magento\Framework\App\State $appState */ public function __construct( \Magento\Logger $logger, - \Magento\App\Filesystem $filesystem, - \Magento\App\State $appState + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\State $appState ) { $this->_logger = $logger; $this->_filesystem = $filesystem; @@ -68,7 +68,7 @@ class Handler extends \Magento\Error\Handler */ public function processException(\Exception $exception, array $params = array()) { - if ($this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { parent::processException($exception, $params); } else { $reportData = array($exception->getMessage(), $exception->getTraceAsString()) + $params; @@ -81,7 +81,7 @@ class Handler extends \Magento\Error\Handler $reportData['script_name'] = $_SERVER['SCRIPT_NAME']; } } - require_once $this->_filesystem->getPath(\Magento\App\Filesystem::PUB_DIR) . '/errors/report.php'; + require_once $this->_filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_DIR) . '/errors/report.php'; } } @@ -94,7 +94,7 @@ class Handler extends \Magento\Error\Handler */ protected function _processError($errorMessage) { - if ($this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { parent::_processError($errorMessage); } else { $exception = new \Exception($errorMessage); diff --git a/lib/Magento/App/Filesystem.php b/lib/Magento/Framework/App/Filesystem.php similarity index 99% rename from lib/Magento/App/Filesystem.php rename to lib/Magento/Framework/App/Filesystem.php index dd230103f30413c8479351609c9bbaf2c04d4deb..d641d8f3eca0348d81acd2c36959f61665af11cc 100644 --- a/lib/Magento/App/Filesystem.php +++ b/lib/Magento/Framework/App/Filesystem.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class Filesystem extends \Magento\Filesystem { diff --git a/lib/Magento/App/Filesystem/DirectoryList.php b/lib/Magento/Framework/App/Filesystem/DirectoryList.php similarity index 95% rename from lib/Magento/App/Filesystem/DirectoryList.php rename to lib/Magento/Framework/App/Filesystem/DirectoryList.php index fee12336044e42bad19ecd8ca9d93742889d0ad7..14911105d8fdbae4b987715144d2703254da15f0 100644 --- a/lib/Magento/App/Filesystem/DirectoryList.php +++ b/lib/Magento/Framework/App/Filesystem/DirectoryList.php @@ -21,13 +21,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Filesystem; +namespace Magento\Framework\App\Filesystem; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; /** * Class DirectoryList - * @package Magento\App\Filesystem + * @package Magento\Framework\App\Filesystem */ class DirectoryList extends \Magento\Filesystem\DirectoryList { diff --git a/lib/Magento/App/Filesystem/DirectoryList/Configuration.php b/lib/Magento/Framework/App/Filesystem/DirectoryList/Configuration.php similarity index 88% rename from lib/Magento/App/Filesystem/DirectoryList/Configuration.php rename to lib/Magento/Framework/App/Filesystem/DirectoryList/Configuration.php index 1199ae5032e6679f850603a77496d849ae0dee15..1e3d4cdd99341f674b97e2a052cc9dc8f3be280a 100644 --- a/lib/Magento/App/Filesystem/DirectoryList/Configuration.php +++ b/lib/Magento/Framework/App/Filesystem/DirectoryList/Configuration.php @@ -21,14 +21,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Filesystem\DirectoryList; +namespace Magento\Framework\App\Filesystem\DirectoryList; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\DirectoryList; /** * Class Configuration - * @package Magento\App\Filesystem\DirectoryList + * @package Magento\Framework\App\Filesystem\DirectoryList */ class Configuration { @@ -61,9 +61,9 @@ class Configuration /** * Store directory configuration * - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $config) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config) { $this->directories = $config->getValue(self::XML_FILESYSTEM_DIRECTORY_PATH) ?: array(); $this->protocols = $config->getValue(self::XML_FILESYSTEM_WRAPPER_PATH) ?: array(); diff --git a/lib/Magento/App/Filesystem/DirectoryList/Verification.php b/lib/Magento/Framework/App/Filesystem/DirectoryList/Verification.php similarity index 95% rename from lib/Magento/App/Filesystem/DirectoryList/Verification.php rename to lib/Magento/Framework/App/Filesystem/DirectoryList/Verification.php index 13fc0c3babeee73a052aada60128b51031b5de6e..948ec4a7cbfba7e55c91076ab78624835754152c 100644 --- a/lib/Magento/App/Filesystem/DirectoryList/Verification.php +++ b/lib/Magento/Framework/App/Filesystem/DirectoryList/Verification.php @@ -23,11 +23,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Filesystem\DirectoryList; +namespace Magento\Framework\App\Filesystem\DirectoryList; -use Magento\App\State; +use Magento\Framework\App\State; use Magento\BootstrapException; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\FilesystemException; class Verification @@ -47,7 +47,7 @@ class Verification protected static $nonProductionDirs = array(Filesystem::SESSION_DIR, Filesystem::CACHE_DIR, Filesystem::LOG_DIR); /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; diff --git a/lib/Magento/App/FrontController.php b/lib/Magento/Framework/App/FrontController.php similarity index 98% rename from lib/Magento/App/FrontController.php rename to lib/Magento/Framework/App/FrontController.php index 01526878d445863c04073d92d0ed96454f502b40..d2a034e0e23e0a53bb76d4ca82f39ed42af05923 100644 --- a/lib/Magento/App/FrontController.php +++ b/lib/Magento/Framework/App/FrontController.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class FrontController implements FrontControllerInterface { diff --git a/lib/Magento/App/FrontControllerInterface.php b/lib/Magento/Framework/App/FrontControllerInterface.php similarity index 97% rename from lib/Magento/App/FrontControllerInterface.php rename to lib/Magento/Framework/App/FrontControllerInterface.php index 147dd6336b24f0d6d72020998a2e75b9d121c533..a08ef01a9fb97b28ae1de55d255ae5066b238049 100644 --- a/lib/Magento/App/FrontControllerInterface.php +++ b/lib/Magento/Framework/App/FrontControllerInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface FrontControllerInterface { diff --git a/lib/Magento/App/Helper/AbstractHelper.php b/lib/Magento/Framework/App/Helper/AbstractHelper.php similarity index 97% rename from lib/Magento/App/Helper/AbstractHelper.php rename to lib/Magento/Framework/App/Helper/AbstractHelper.php index 1404b471136e573f8093577096e0120a97d981f2..1fea7b4d922f3d86b8b57c1cc8deee30e99fadd1 100644 --- a/lib/Magento/App/Helper/AbstractHelper.php +++ b/lib/Magento/Framework/App/Helper/AbstractHelper.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Helper; +namespace Magento\Framework\App\Helper; /** * Abstract helper @@ -40,7 +40,7 @@ abstract class AbstractHelper /** * Request object * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -100,7 +100,7 @@ abstract class AbstractHelper /** * Retrieve request object * - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ protected function _getRequest() { diff --git a/lib/Magento/App/Helper/Context.php b/lib/Magento/Framework/App/Helper/Context.php similarity index 94% rename from lib/Magento/App/Helper/Context.php rename to lib/Magento/Framework/App/Helper/Context.php index 4e3a97e2dbad9f98be31841bddf94300fc517b00..c3338622aa35d4061f186cbfe893a038cefd6bf5 100644 --- a/lib/Magento/App/Helper/Context.php +++ b/lib/Magento/Framework/App/Helper/Context.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Helper; +namespace Magento\Framework\App\Helper; class Context implements \Magento\ObjectManager\ContextInterface { @@ -48,7 +48,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_logger; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_httpRequest; @@ -76,7 +76,7 @@ class Context implements \Magento\ObjectManager\ContextInterface * @param \Magento\Logger $logger * @param \Magento\Translate\InlineInterface $translateInline * @param \Magento\Module\Manager $moduleManager - * @param \Magento\App\RequestInterface $httpRequest + * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Cache\ConfigInterface $cacheConfig * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder @@ -89,7 +89,7 @@ class Context implements \Magento\ObjectManager\ContextInterface \Magento\Logger $logger, \Magento\Translate\InlineInterface $translateInline, \Magento\Module\Manager $moduleManager, - \Magento\App\RequestInterface $httpRequest, + \Magento\Framework\App\RequestInterface $httpRequest, \Magento\Cache\ConfigInterface $cacheConfig, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, @@ -132,7 +132,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function getRequest() { diff --git a/lib/Magento/App/Http.php b/lib/Magento/Framework/App/Http.php similarity index 93% rename from lib/Magento/App/Http.php rename to lib/Magento/Framework/App/Http.php index 40e9c971504c7be2a2af7e8cf58e65d53c226f6f..0473fff7ac8ccd80e6d900f7006b631553c8a2df 100644 --- a/lib/Magento/App/Http.php +++ b/lib/Magento/Framework/App/Http.php @@ -23,17 +23,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -use Magento\App\ObjectManager\ConfigLoader; -use Magento\App\Request\Http as RequestHttp; -use Magento\App\Response\Http as ResponseHttp; +use Magento\Framework\App\ObjectManager\ConfigLoader; +use Magento\Framework\App\Request\Http as RequestHttp; +use Magento\Framework\App\Response\Http as ResponseHttp; use Magento\Event; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Http implements \Magento\AppInterface +class Http implements \Magento\Framework\AppInterface { /** * @var \Magento\ObjectManager @@ -117,7 +117,7 @@ class Http implements \Magento\AppInterface $this->_state->setAreaCode($areaCode); $this->_objectManager->configure($this->_configLoader->load($areaCode)); $this->_response = $this->_objectManager->get( - 'Magento\App\FrontControllerInterface' + 'Magento\Framework\App\FrontControllerInterface' )->dispatch( $this->_request ); diff --git a/lib/Magento/App/Http/Context.php b/lib/Magento/Framework/App/Http/Context.php similarity index 96% rename from lib/Magento/App/Http/Context.php rename to lib/Magento/Framework/App/Http/Context.php index 8c1a466503f0faa95d1cf30fa1db030d641a7a84..7faa4ee9545eae78a3dd43104f4b43aaf25303ab 100644 --- a/lib/Magento/App/Http/Context.php +++ b/lib/Magento/Framework/App/Http/Context.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Http; +namespace Magento\Framework\App\Http; /** * Context data for requests @@ -46,7 +46,7 @@ class Context * @param string $name * @param mixed $value * @param mixed $default - * @return \Magento\App\Http\Context + * @return \Magento\Framework\App\Http\Context */ public function setValue($name, $value, $default) { diff --git a/lib/Magento/App/MutableScopeConfig.php b/lib/Magento/Framework/App/MutableScopeConfig.php similarity index 78% rename from lib/Magento/App/MutableScopeConfig.php rename to lib/Magento/Framework/App/MutableScopeConfig.php index fdd2b085b985d8b5fd91c4140ae471cfbc77d43e..1aa509c636621ab3ffb50eb8bc394c99a3f891ee 100644 --- a/lib/Magento/App/MutableScopeConfig.php +++ b/lib/Magento/Framework/App/MutableScopeConfig.php @@ -24,9 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -class MutableScopeConfig extends \Magento\App\Config implements \Magento\App\Config\MutableScopeConfigInterface +use Magento\Framework\App\Config; +use Magento\Framework\App\Config\MutableScopeConfigInterface; + +class MutableScopeConfig extends Config implements MutableScopeConfigInterface { /** * Set config value in the corresponding config scope @@ -37,8 +40,12 @@ class MutableScopeConfig extends \Magento\App\Config implements \Magento\App\Con * @param null|string $scopeCode * @return void */ - public function setValue($path, $value, $scope = \Magento\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null) - { + public function setValue( + $path, + $value, + $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scopeCode = null + ) { if (empty($scopeCode)) { $scopeCode = null; } diff --git a/lib/Magento/App/ObjectManager.php b/lib/Magento/Framework/App/ObjectManager.php similarity index 98% rename from lib/Magento/App/ObjectManager.php rename to lib/Magento/Framework/App/ObjectManager.php index 5d0baf52abff5d60c0b310bf7633ff4f97664779..b756b978a891eb0b1cef53ebb341ea1d75c78f03 100644 --- a/lib/Magento/App/ObjectManager.php +++ b/lib/Magento/Framework/App/ObjectManager.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; use Magento\ObjectManager\Factory; diff --git a/lib/Magento/App/ObjectManager/ConfigCache.php b/lib/Magento/Framework/App/ObjectManager/ConfigCache.php similarity index 97% rename from lib/Magento/App/ObjectManager/ConfigCache.php rename to lib/Magento/Framework/App/ObjectManager/ConfigCache.php index cfba95a0eff722460828be023797259078e5105c..8a99f12e9d4d7c8aea66795f49c0caece12512d4 100644 --- a/lib/Magento/App/ObjectManager/ConfigCache.php +++ b/lib/Magento/Framework/App/ObjectManager/ConfigCache.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\ObjectManager; +namespace Magento\Framework\App\ObjectManager; class ConfigCache implements \Magento\ObjectManager\ConfigCache { diff --git a/lib/Magento/App/ObjectManager/ConfigLoader.php b/lib/Magento/Framework/App/ObjectManager/ConfigLoader.php similarity index 97% rename from lib/Magento/App/ObjectManager/ConfigLoader.php rename to lib/Magento/Framework/App/ObjectManager/ConfigLoader.php index 4962eb436968eedbdd7da5ef0d15ae81623579a7..2ac8d947826e2748fb435a6641ef6ff78dca2b1d 100644 --- a/lib/Magento/App/ObjectManager/ConfigLoader.php +++ b/lib/Magento/Framework/App/ObjectManager/ConfigLoader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\ObjectManager; +namespace Magento\Framework\App\ObjectManager; class ConfigLoader { diff --git a/lib/Magento/App/ObjectManagerFactory.php b/lib/Magento/Framework/App/ObjectManagerFactory.php similarity index 84% rename from lib/Magento/App/ObjectManagerFactory.php rename to lib/Magento/Framework/App/ObjectManagerFactory.php index 3bb06bff79c603a5fb932a985284bd7372a0cf4f..5152f80aef8e7f5b11f63d5308e479c1b0a0a236 100644 --- a/lib/Magento/App/ObjectManagerFactory.php +++ b/lib/Magento/Framework/App/ObjectManagerFactory.php @@ -23,15 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -use Magento\App\Filesystem\DirectoryList; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Profiler; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * Class ObjectManagerFactory - * @package Magento\App + * @package Magento\Framework\App */ class ObjectManagerFactory { @@ -112,8 +112,8 @@ class ObjectManagerFactory $className = $this->_locatorClassName; $sharedInstances = [ - 'Magento\App\Arguments' => $appArguments, - 'Magento\App\Filesystem\DirectoryList' => $directoryList, + 'Magento\Framework\App\Arguments' => $appArguments, + 'Magento\Framework\App\Filesystem\DirectoryList' => $directoryList, 'Magento\Filesystem\DirectoryList' => $directoryList, 'Magento\ObjectManager\Relations' => $relations, 'Magento\Interception\Definition' => $definitionFactory->createPluginDefinition(), @@ -130,14 +130,17 @@ class ObjectManagerFactory $this->factory->setObjectManager($objectManager); ObjectManager::setInstance($objectManager); - /** @var \Magento\App\Filesystem\DirectoryList\Verification $verification */ - $verification = $objectManager->get('Magento\App\Filesystem\DirectoryList\Verification'); + /** @var \Magento\Framework\App\Filesystem\DirectoryList\Verification $verification */ + $verification = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList\Verification'); $verification->createAndVerifyDirectories(); - $diConfig->setCache($objectManager->get('Magento\App\ObjectManager\ConfigCache')); - $objectManager->configure($objectManager->get('Magento\App\ObjectManager\ConfigLoader')->load('global')); + $diConfig->setCache($objectManager->get('Magento\Framework\App\ObjectManager\ConfigCache')); + $objectManager->configure( + $objectManager->get('Magento\Framework\App\ObjectManager\ConfigLoader')->load('global') + ); $objectManager->get('Magento\Config\ScopeInterface')->setCurrentScope('global'); - $objectManager->get('Magento\App\Resource')->setCache($objectManager->get('Magento\App\CacheInterface')); + $objectManager->get('Magento\Framework\App\Resource') + ->setCache($objectManager->get('Magento\Framework\App\CacheInterface')); $interceptionConfig = $objectManager->get('Magento\Interception\Config\Config'); $diConfig->setInterceptionConfig($interceptionConfig); @@ -157,11 +160,11 @@ class ObjectManagerFactory { return new Arguments( $arguments, - new \Magento\App\Arguments\Loader( + new \Magento\Framework\App\Arguments\Loader( $directoryList, isset( - $arguments[\Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE] - ) ? $arguments[\Magento\App\Arguments\Loader::PARAM_CUSTOM_FILE] : null + $arguments[\Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE] + ) ? $arguments[\Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE] : null ) ); } @@ -184,7 +187,7 @@ class ObjectManagerFactory 'null' => new \Magento\Data\Argument\Interpreter\NullType(), 'object' => new \Magento\Data\Argument\Interpreter\Object($booleanUtils), 'const' => $constInterpreter, - 'init_parameter' => new \Magento\App\Arguments\ArgumentInterpreter($constInterpreter) + 'init_parameter' => new \Magento\Framework\App\Arguments\ArgumentInterpreter($constInterpreter) ], \Magento\ObjectManager\Config\Reader\Dom::TYPE_ATTRIBUTE ); @@ -199,8 +202,8 @@ class ObjectManagerFactory */ protected function configureDirectories(\Magento\ObjectManager $objectManager) { - $directoryList = $objectManager->get('Magento\App\Filesystem\DirectoryList'); - $directoryListConfig = $objectManager->get('Magento\App\Filesystem\DirectoryList\Configuration'); + $directoryList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); + $directoryListConfig = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList\Configuration'); $directoryListConfig->configure($directoryList); } @@ -217,8 +220,8 @@ class ObjectManagerFactory { $configData = null; try { - $fileResolver = new \Magento\App\Arguments\FileResolver\Primary( - new \Magento\App\Filesystem( + $fileResolver = new \Magento\Framework\App\Arguments\FileResolver\Primary( + new \Magento\Framework\App\Filesystem( $directoryList, new \Magento\Filesystem\Directory\ReadFactory(), new \Magento\Filesystem\Directory\WriteFactory() @@ -226,7 +229,7 @@ class ObjectManagerFactory new \Magento\Config\FileIteratorFactory() ); $schemaLocator = new \Magento\ObjectManager\Config\SchemaLocator(); - $validationState = new \Magento\App\Arguments\ValidationState($appMode); + $validationState = new \Magento\Framework\App\Arguments\ValidationState($appMode); $reader = new \Magento\ObjectManager\Config\Reader\Dom( $fileResolver, diff --git a/lib/Magento/App/PageCache/Cache.php b/lib/Magento/Framework/App/PageCache/Cache.php similarity index 91% rename from lib/Magento/App/PageCache/Cache.php rename to lib/Magento/Framework/App/PageCache/Cache.php index 9aea75863c50c48d30f45a442c64273b5855ac9f..a3317cdc61fadb602c399b6e3dc11a2bf63a3a27 100644 --- a/lib/Magento/App/PageCache/Cache.php +++ b/lib/Magento/Framework/App/PageCache/Cache.php @@ -21,12 +21,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Cache model for builtin cache */ -class Cache extends \Magento\App\Cache +class Cache extends \Magento\Framework\App\Cache { /** * @var string diff --git a/lib/Magento/App/PageCache/FormKey.php b/lib/Magento/Framework/App/PageCache/FormKey.php similarity index 94% rename from lib/Magento/App/PageCache/FormKey.php rename to lib/Magento/Framework/App/PageCache/FormKey.php index 197f0c1d8ab7e81e86ef2ad7b3dbf1bfe7d98182..1e7b9e36ddd638442d6d32b19893e54a28ebd530 100644 --- a/lib/Magento/App/PageCache/FormKey.php +++ b/lib/Magento/Framework/App/PageCache/FormKey.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Class Version * - * @package Magento\App\PageCache + * @package Magento\Framework\App\PageCache */ class FormKey { diff --git a/lib/Magento/App/PageCache/Identifier.php b/lib/Magento/Framework/App/PageCache/Identifier.php similarity index 83% rename from lib/Magento/App/PageCache/Identifier.php rename to lib/Magento/Framework/App/PageCache/Identifier.php index 088550f4cd33d2dfc0d3324d14aa87d0c1997291..0aae3dbbe04ee689fabaf7a8d770a7caf3a1460d 100644 --- a/lib/Magento/App/PageCache/Identifier.php +++ b/lib/Magento/Framework/App/PageCache/Identifier.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Page unique identifier @@ -34,13 +34,13 @@ class Identifier protected $value; /** - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request */ - public function __construct(\Magento\App\Request\Http $request) + public function __construct(\Magento\Framework\App\Request\Http $request) { $data = array( $request->getRequestUri(), - $request->get(\Magento\App\Response\Http::COOKIE_VARY_STRING), + $request->get(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING), ); $this->value = md5(serialize($data)); } diff --git a/lib/Magento/App/PageCache/Kernel.php b/lib/Magento/Framework/App/PageCache/Kernel.php similarity index 83% rename from lib/Magento/App/PageCache/Kernel.php rename to lib/Magento/Framework/App/PageCache/Kernel.php index 1a2c6793897b0fba6773f94d67c8b817d2c96b3c..c8726ea996e1f56163bb37dfd1dd7190f692efbc 100644 --- a/lib/Magento/App/PageCache/Kernel.php +++ b/lib/Magento/Framework/App/PageCache/Kernel.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Builtin cache processor @@ -39,19 +39,19 @@ class Kernel protected $identifier; /** - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $request; /** * @param Cache $cache * @param Identifier $identifier - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request */ public function __construct( - \Magento\App\PageCache\Cache $cache, - \Magento\App\PageCache\Identifier $identifier, - \Magento\App\Request\Http $request + \Magento\Framework\App\PageCache\Cache $cache, + \Magento\Framework\App\PageCache\Identifier $identifier, + \Magento\Framework\App\Request\Http $request ) { $this->cache = $cache; $this->identifier = $identifier; @@ -61,7 +61,7 @@ class Kernel /** * Load response from cache * - * @return \Magento\App\Response\Http|false + * @return \Magento\Framework\App\Response\Http|false */ public function load() { @@ -74,10 +74,10 @@ class Kernel /** * Modify and cache application response * - * @param \Magento\App\Response\Http $response + * @param \Magento\Framework\App\Response\Http $response * @return void */ - public function process(\Magento\App\Response\Http $response) + public function process(\Magento\Framework\App\Response\Http $response) { if (preg_match('/public.*s-maxage=(\d+)/', $response->getHeader('Cache-Control')['value'], $matches)) { $maxAge = $matches[1]; diff --git a/lib/Magento/App/PageCache/Version.php b/lib/Magento/Framework/App/PageCache/Version.php similarity index 90% rename from lib/Magento/App/PageCache/Version.php rename to lib/Magento/Framework/App/PageCache/Version.php index 1eee1c5d4496b08ad27a866aef22a0f249160c44..60a89c233380e47d65e8a12f0f235513fefb3bb1 100644 --- a/lib/Magento/App/PageCache/Version.php +++ b/lib/Magento/Framework/App/PageCache/Version.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\PageCache; +namespace Magento\Framework\App\PageCache; /** * Class Version * - * @package Magento\App\PageCache + * @package Magento\Framework\App\PageCache */ class Version { @@ -52,15 +52,15 @@ class Version /** * Request * - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $request; /** * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request */ - public function __construct(\Magento\Stdlib\Cookie $cookie, \Magento\App\Request\Http $request) + public function __construct(\Magento\Stdlib\Cookie $cookie, \Magento\Framework\App\Request\Http $request) { $this->cookie = $cookie; $this->request = $request; diff --git a/lib/Magento/App/ReinitableConfig.php b/lib/Magento/Framework/App/ReinitableConfig.php similarity index 85% rename from lib/Magento/App/ReinitableConfig.php rename to lib/Magento/Framework/App/ReinitableConfig.php index 4a97d8f1f03f6cd95e911d76e04c2585c35e1c1f..705069a19c2d7359d4d0eab499b0fc9286618aef 100644 --- a/lib/Magento/App/ReinitableConfig.php +++ b/lib/Magento/Framework/App/ReinitableConfig.php @@ -21,9 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -class ReinitableConfig extends \Magento\App\MutableScopeConfig implements \Magento\App\Config\ReinitableConfigInterface +use Magento\Framework\App\Config\ReinitableConfigInterface; + +class ReinitableConfig extends MutableScopeConfig implements ReinitableConfigInterface { /** * {@inheritdoc} diff --git a/lib/Magento/App/Request/Http.php b/lib/Magento/Framework/App/Request/Http.php similarity index 98% rename from lib/Magento/App/Request/Http.php rename to lib/Magento/Framework/App/Request/Http.php index bc1ae8829b5139b68679cc0b152840833e795162..353e2e8c71c31f4dbf98d88359c6d019db332c82 100644 --- a/lib/Magento/App/Request/Http.php +++ b/lib/Magento/Framework/App/Request/Http.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Request; +namespace Magento\Framework\App\Request; -class Http extends \Zend_Controller_Request_Http implements \Magento\App\RequestInterface +class Http extends \Zend_Controller_Request_Http implements \Magento\Framework\App\RequestInterface { const DEFAULT_HTTP_PORT = 80; @@ -90,7 +90,7 @@ class Http extends \Zend_Controller_Request_Http implements \Magento\App\Request protected $_beforeForwardInfo = array(); /** - * @var \Magento\App\Route\ConfigInterface + * @var \Magento\Framework\App\Route\ConfigInterface */ protected $_routeConfig; @@ -100,13 +100,13 @@ class Http extends \Zend_Controller_Request_Http implements \Magento\App\Request private $_pathInfoProcessor; /** - * @param \Magento\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig * @param PathInfoProcessorInterface $pathInfoProcessor * @param string $uri * @param array $directFrontNames */ public function __construct( - \Magento\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, PathInfoProcessorInterface $pathInfoProcessor, $uri = null, $directFrontNames = array() diff --git a/lib/Magento/App/Request/PathInfoProcessorInterface.php b/lib/Magento/Framework/App/Request/PathInfoProcessorInterface.php similarity index 84% rename from lib/Magento/App/Request/PathInfoProcessorInterface.php rename to lib/Magento/Framework/App/Request/PathInfoProcessorInterface.php index 0ebc9ab1e9d9855613473ef08f61e6d801d1ea57..2b33f5c65c9efaee5f100895c8267bf39e4b6ce7 100644 --- a/lib/Magento/App/Request/PathInfoProcessorInterface.php +++ b/lib/Magento/Framework/App/Request/PathInfoProcessorInterface.php @@ -23,16 +23,16 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Request; +namespace Magento\Framework\App\Request; interface PathInfoProcessorInterface { /** * Process Request path info * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $pathInfo * @return string */ - public function process(\Magento\App\RequestInterface $request, $pathInfo); + public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo); } diff --git a/lib/Magento/App/RequestFactory.php b/lib/Magento/Framework/App/RequestFactory.php similarity index 91% rename from lib/Magento/App/RequestFactory.php rename to lib/Magento/Framework/App/RequestFactory.php index 78199b109de82bd593be31adf381143222261fcb..d3ea974657d74ab8ea227590b078cf09704698e9 100644 --- a/lib/Magento/App/RequestFactory.php +++ b/lib/Magento/Framework/App/RequestFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class RequestFactory { @@ -48,6 +48,6 @@ class RequestFactory */ public function create(array $arguments = array()) { - return $this->_objectManager->create('Magento\App\RequestInterface', $arguments); + return $this->_objectManager->create('Magento\Framework\App\RequestInterface', $arguments); } } diff --git a/lib/Magento/App/RequestInterface.php b/lib/Magento/Framework/App/RequestInterface.php similarity index 98% rename from lib/Magento/App/RequestInterface.php rename to lib/Magento/Framework/App/RequestInterface.php index 52977b4360fde078e203a6042231096ecd710a3f..b22916ac6b48814c07744f9154cf7bf27fed10f4 100644 --- a/lib/Magento/App/RequestInterface.php +++ b/lib/Magento/Framework/App/RequestInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface RequestInterface { diff --git a/lib/Magento/App/Resource.php b/lib/Magento/Framework/App/Resource.php similarity index 97% rename from lib/Magento/App/Resource.php rename to lib/Magento/Framework/App/Resource.php index faba429abe2b3735e6e93630a2de06563c88579f..a258d51eeaca80d9a9dc6dabd39748d89e697715 100644 --- a/lib/Magento/App/Resource.php +++ b/lib/Magento/Framework/App/Resource.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; -use Magento\App\Resource\ConfigInterface as ResourceConfigInterface; -use Magento\App\Resource\ConnectionFactory; +use Magento\Framework\App\Resource\ConfigInterface as ResourceConfigInterface; +use Magento\Framework\App\Resource\ConnectionFactory; class Resource { diff --git a/lib/Magento/App/Resource/Config.php b/lib/Magento/Framework/App/Resource/Config.php similarity index 98% rename from lib/Magento/App/Resource/Config.php rename to lib/Magento/Framework/App/Resource/Config.php index ae42fc4a98110bffb02d6b074ecc05e74d6a9c23..70b3e9db72bf334e21371217c93e86975bec26bd 100644 --- a/lib/Magento/App/Resource/Config.php +++ b/lib/Magento/Framework/App/Resource/Config.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource; +namespace Magento\Framework\App\Resource; class Config extends \Magento\Config\Data\Scoped implements ConfigInterface { diff --git a/lib/Magento/App/Resource/Config/Converter.php b/lib/Magento/Framework/App/Resource/Config/Converter.php similarity index 97% rename from lib/Magento/App/Resource/Config/Converter.php rename to lib/Magento/Framework/App/Resource/Config/Converter.php index 7b3703dac7a6658bb5562ec93ca54a76fc191a59..1a149899151c804f9a233aecd79fa8da850f426c 100644 --- a/lib/Magento/App/Resource/Config/Converter.php +++ b/lib/Magento/Framework/App/Resource/Config/Converter.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class Converter implements \Magento\Config\ConverterInterface { diff --git a/lib/Magento/App/Resource/Config/Reader.php b/lib/Magento/Framework/App/Resource/Config/Reader.php similarity index 98% rename from lib/Magento/App/Resource/Config/Reader.php rename to lib/Magento/Framework/App/Resource/Config/Reader.php index 6e2160108222b785a304037b98fe70834882c337..1bb9638cf6f282c0d25de303f182cb8394e18138 100644 --- a/lib/Magento/App/Resource/Config/Reader.php +++ b/lib/Magento/Framework/App/Resource/Config/Reader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class Reader extends \Magento\Config\Reader\Filesystem { diff --git a/lib/Magento/App/Resource/Config/SchemaLocator.php b/lib/Magento/Framework/App/Resource/Config/SchemaLocator.php similarity index 96% rename from lib/Magento/App/Resource/Config/SchemaLocator.php rename to lib/Magento/Framework/App/Resource/Config/SchemaLocator.php index 0b4744394527deed1ac9e543ac5a804e027ebc3b..b14b84b175e779066cce5482b573ae289a30b4f5 100644 --- a/lib/Magento/App/Resource/Config/SchemaLocator.php +++ b/lib/Magento/Framework/App/Resource/Config/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource\Config; +namespace Magento\Framework\App\Resource\Config; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { diff --git a/lib/Magento/App/Resource/ConfigInterface.php b/lib/Magento/Framework/App/Resource/ConfigInterface.php similarity index 96% rename from lib/Magento/App/Resource/ConfigInterface.php rename to lib/Magento/Framework/App/Resource/ConfigInterface.php index 2dc96ad7e06e4c65f75b667da9cc664199338bce..69024b6f3b99fa658b59e0ccf474cbde884b67d5 100644 --- a/lib/Magento/App/Resource/ConfigInterface.php +++ b/lib/Magento/Framework/App/Resource/ConfigInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource; +namespace Magento\Framework\App\Resource; interface ConfigInterface { diff --git a/lib/Magento/App/Resource/ConnectionAdapterInterface.php b/lib/Magento/Framework/App/Resource/ConnectionAdapterInterface.php similarity index 96% rename from lib/Magento/App/Resource/ConnectionAdapterInterface.php rename to lib/Magento/Framework/App/Resource/ConnectionAdapterInterface.php index 2097e73a454260d50ed15c0dc61b6b7e8c87454b..40a473a6ee1a1a6cf4efcd530215d1c7fd1e0b34 100644 --- a/lib/Magento/App/Resource/ConnectionAdapterInterface.php +++ b/lib/Magento/Framework/App/Resource/ConnectionAdapterInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource; +namespace Magento\Framework\App\Resource; interface ConnectionAdapterInterface { diff --git a/lib/Magento/App/Resource/ConnectionFactory.php b/lib/Magento/Framework/App/Resource/ConnectionFactory.php similarity index 92% rename from lib/Magento/App/Resource/ConnectionFactory.php rename to lib/Magento/Framework/App/Resource/ConnectionFactory.php index 2a4742a9ad902177ee7eb708811aaeffb0006346..8e347038f4d51119c754534d9535066eb6d77dfd 100644 --- a/lib/Magento/App/Resource/ConnectionFactory.php +++ b/lib/Magento/Framework/App/Resource/ConnectionFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Resource; +namespace Magento\Framework\App\Resource; class ConnectionFactory { @@ -33,15 +33,15 @@ class ConnectionFactory protected $_objectManager; /** - * @var \Magento\App\Arguments + * @var \Magento\Framework\App\Arguments */ protected $_localConfig; /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\Arguments $localConfig + * @param \Magento\Framework\App\Arguments $localConfig */ - public function __construct(\Magento\ObjectManager $objectManager, \Magento\App\Arguments $localConfig) + public function __construct(\Magento\ObjectManager $objectManager, \Magento\Framework\App\Arguments $localConfig) { $this->_objectManager = $objectManager; $this->_localConfig = $localConfig; diff --git a/lib/Magento/App/Response/Http.php b/lib/Magento/Framework/App/Response/Http.php similarity index 94% rename from lib/Magento/App/Response/Http.php rename to lib/Magento/Framework/App/Response/Http.php index 07fd5021ff73bda164f69b9e5596c93ace4baf68..066077b9601f269cd7c9d52b42ca01e10e2bac32 100644 --- a/lib/Magento/App/Response/Http.php +++ b/lib/Magento/Framework/App/Response/Http.php @@ -23,9 +23,9 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Response; +namespace Magento\Framework\App\Response; -class Http extends \Zend_Controller_Response_Http implements \Magento\App\ResponseInterface +class Http extends \Zend_Controller_Response_Http implements \Magento\Framework\App\ResponseInterface { /** * Cookie to store page vary string @@ -38,15 +38,15 @@ class Http extends \Zend_Controller_Response_Http implements \Magento\App\Respon protected $cookie; /** - * @var \Magento\App\Http\Context + * @var \Magento\Framework\App\Http\Context */ protected $context; /** * @param \Magento\Stdlib\Cookie $cookie - * @param \Magento\App\Http\Context $context + * @param \Magento\Framework\App\Http\Context $context */ - public function __construct(\Magento\Stdlib\Cookie $cookie, \Magento\App\Http\Context $context) + public function __construct(\Magento\Stdlib\Cookie $cookie, \Magento\Framework\App\Http\Context $context) { $this->cookie = $cookie; $this->context = $context; diff --git a/lib/Magento/App/Response/Http/FileFactory.php b/lib/Magento/Framework/App/Response/Http/FileFactory.php similarity index 88% rename from lib/Magento/App/Response/Http/FileFactory.php rename to lib/Magento/Framework/App/Response/Http/FileFactory.php index 5bc6d5055e06b3fe63436ac2d449ea42290d39a5..34e75ec86b06289cd7a164d0e8cf85ab17650ac5 100644 --- a/lib/Magento/App/Response/Http/FileFactory.php +++ b/lib/Magento/Framework/App/Response/Http/FileFactory.php @@ -22,26 +22,28 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Response\Http; +namespace Magento\Framework\App\Response\Http; class FileFactory { /** - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $_response; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** - * @param \Magento\App\ResponseInterface $response - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\ResponseInterface $response + * @param \Magento\Framework\App\Filesystem $filesystem */ - public function __construct(\Magento\App\ResponseInterface $response, \Magento\App\Filesystem $filesystem) - { + public function __construct( + \Magento\Framework\App\ResponseInterface $response, + \Magento\Framework\App\Filesystem $filesystem + ) { $this->_response = $response; $this->_filesystem = $filesystem; } @@ -57,7 +59,7 @@ class FileFactory * @param int $contentLength explicit content length, if strlen($content) isn't applicable * @throws \Exception * @throws \InvalidArgumentException - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -66,7 +68,7 @@ class FileFactory public function create( $fileName, $content, - $baseDir = \Magento\App\Filesystem::ROOT_DIR, + $baseDir = \Magento\Framework\App\Filesystem::ROOT_DIR, $contentType = 'application/octet-stream', $contentLength = null ) { diff --git a/lib/Magento/App/Response/RedirectInterface.php b/lib/Magento/Framework/App/Response/RedirectInterface.php similarity index 89% rename from lib/Magento/App/Response/RedirectInterface.php rename to lib/Magento/Framework/App/Response/RedirectInterface.php index 7c49cb2a764ad9452d74fa6f17dbe93992f38dfb..2470accf90059ed5cfe0c48867b15d2e5690ff7a 100644 --- a/lib/Magento/App/Response/RedirectInterface.php +++ b/lib/Magento/Framework/App/Response/RedirectInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Response; +namespace Magento\Framework\App\Response; interface RedirectInterface { @@ -67,10 +67,10 @@ interface RedirectInterface /** * Set redirect into response * - * @param \Magento\App\ResponseInterface $response + * @param \Magento\Framework\App\ResponseInterface $response * @param string $path * @param array $arguments * @return void */ - public function redirect(\Magento\App\ResponseInterface $response, $path, $arguments = array()); + public function redirect(\Magento\Framework\App\ResponseInterface $response, $path, $arguments = array()); } diff --git a/lib/Magento/App/ResponseFactory.php b/lib/Magento/Framework/App/ResponseFactory.php similarity index 91% rename from lib/Magento/App/ResponseFactory.php rename to lib/Magento/Framework/App/ResponseFactory.php index 0be2bff39b6e90a23bd2270543ee849975baa956..f8b91c1ca099b7c3d73b7e31d28f5c7c7741d236 100644 --- a/lib/Magento/App/ResponseFactory.php +++ b/lib/Magento/Framework/App/ResponseFactory.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ResponseFactory { @@ -48,6 +48,6 @@ class ResponseFactory */ public function create(array $arguments = array()) { - return $this->_objectManager->create('Magento\App\ResponseInterface', $arguments); + return $this->_objectManager->create('Magento\Framework\App\ResponseInterface', $arguments); } } diff --git a/lib/Magento/App/ResponseInterface.php b/lib/Magento/Framework/App/ResponseInterface.php similarity index 97% rename from lib/Magento/App/ResponseInterface.php rename to lib/Magento/Framework/App/ResponseInterface.php index 5ea3fb2f8fc2ea7a019130cfe4a1abd54d144ff8..0216f6061cec998231fa4e11f2b0df61fc4561b5 100644 --- a/lib/Magento/App/ResponseInterface.php +++ b/lib/Magento/Framework/App/ResponseInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface ResponseInterface { diff --git a/lib/Magento/App/Route/Config.php b/lib/Magento/Framework/App/Route/Config.php similarity index 94% rename from lib/Magento/App/Route/Config.php rename to lib/Magento/Framework/App/Route/Config.php index 7309124f664c3253279b885b0f2c7d91ee7fd316..493da0fc9eabb79d5ba1a55c378432439990c330 100644 --- a/lib/Magento/App/Route/Config.php +++ b/lib/Magento/Framework/App/Route/Config.php @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route; +namespace Magento\Framework\App\Route; class Config implements ConfigInterface { /** - * @var \Magento\App\Route\Config\Reader + * @var \Magento\Framework\App\Route\Config\Reader */ protected $_reader; @@ -48,7 +48,7 @@ class Config implements ConfigInterface protected $_configScope; /** - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_areaList; @@ -61,14 +61,14 @@ class Config implements ConfigInterface * @param Config\Reader $reader * @param \Magento\Config\CacheInterface $cache * @param \Magento\Config\ScopeInterface $configScope - * @param \Magento\App\AreaList $areaList + * @param \Magento\Framework\App\AreaList $areaList * @param string $cacheId */ public function __construct( Config\Reader $reader, \Magento\Config\CacheInterface $cache, \Magento\Config\ScopeInterface $configScope, - \Magento\App\AreaList $areaList, + \Magento\Framework\App\AreaList $areaList, $cacheId = 'RoutesConfig' ) { $this->_reader = $reader; diff --git a/lib/Magento/App/Route/Config/Converter.php b/lib/Magento/Framework/App/Route/Config/Converter.php similarity index 98% rename from lib/Magento/App/Route/Config/Converter.php rename to lib/Magento/Framework/App/Route/Config/Converter.php index 3aff54bc76f2553ce91a20382b8455a8bc612de5..ec6e9cceaea4391bb2dc6d57cb6a9f4ff2f6ed46 100644 --- a/lib/Magento/App/Route/Config/Converter.php +++ b/lib/Magento/Framework/App/Route/Config/Converter.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route\Config; +namespace Magento\Framework\App\Route\Config; class Converter implements \Magento\Config\ConverterInterface { diff --git a/lib/Magento/App/Route/Config/Reader.php b/lib/Magento/Framework/App/Route/Config/Reader.php similarity index 97% rename from lib/Magento/App/Route/Config/Reader.php rename to lib/Magento/Framework/App/Route/Config/Reader.php index 2149355a1759071f581f6445912a667e891e69ea..3e14700ae28a20e6dcba9715055aaa3453703105 100644 --- a/lib/Magento/App/Route/Config/Reader.php +++ b/lib/Magento/Framework/App/Route/Config/Reader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route\Config; +namespace Magento\Framework\App\Route\Config; class Reader extends \Magento\Config\Reader\Filesystem { diff --git a/lib/Magento/App/Route/Config/SchemaLocator.php b/lib/Magento/Framework/App/Route/Config/SchemaLocator.php similarity index 96% rename from lib/Magento/App/Route/Config/SchemaLocator.php rename to lib/Magento/Framework/App/Route/Config/SchemaLocator.php index 429c0e149a8b9dc266f494ba9ae3e6c4fe74e26c..44def275240949acc22365efdb618cd47a091e27 100644 --- a/lib/Magento/App/Route/Config/SchemaLocator.php +++ b/lib/Magento/Framework/App/Route/Config/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route\Config; +namespace Magento\Framework\App\Route\Config; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { diff --git a/lib/Magento/App/Route/ConfigInterface.php b/lib/Magento/Framework/App/Route/ConfigInterface.php similarity index 97% rename from lib/Magento/App/Route/ConfigInterface.php rename to lib/Magento/Framework/App/Route/ConfigInterface.php index d79e45c511d76e79d5526d5b14d216493923d2ba..9b4b800fbd91858009101a89143c82dac5d0c244 100644 --- a/lib/Magento/App/Route/ConfigInterface.php +++ b/lib/Magento/Framework/App/Route/ConfigInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Route; +namespace Magento\Framework\App\Route; interface ConfigInterface { diff --git a/lib/Magento/App/Router/AbstractRouter.php b/lib/Magento/Framework/App/Router/AbstractRouter.php similarity index 78% rename from lib/Magento/App/Router/AbstractRouter.php rename to lib/Magento/Framework/App/Router/AbstractRouter.php index f3e83c157b60337a74c1b8e151924b0f227d746b..da1539dee6647a975887e54e45159c6909b0b8cf 100644 --- a/lib/Magento/App/Router/AbstractRouter.php +++ b/lib/Magento/Framework/App/Router/AbstractRouter.php @@ -23,24 +23,24 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Router; +namespace Magento\Framework\App\Router; -use Magento\App\ActionFactory; +use Magento\Framework\App\ActionFactory; -abstract class AbstractRouter implements \Magento\App\RouterInterface +abstract class AbstractRouter implements \Magento\Framework\App\RouterInterface { /** - * @var \Magento\App\FrontController + * @var \Magento\Framework\App\FrontController */ protected $_front; /** - * @var \Magento\App\ActionFactory + * @var \Magento\Framework\App\ActionFactory */ protected $_actionFactory; /** - * @param \Magento\App\ActionFactory $actionFactory + * @param \Magento\Framework\App\ActionFactory $actionFactory */ public function __construct(ActionFactory $actionFactory) { diff --git a/lib/Magento/App/Router/DefaultRouter.php b/lib/Magento/Framework/App/Router/DefaultRouter.php similarity index 86% rename from lib/Magento/App/Router/DefaultRouter.php rename to lib/Magento/Framework/App/Router/DefaultRouter.php index d4378e9a37758ecd5587bda951e94e350de247cc..26ebec0935591b8fa0bf081a7e19f564396a7645 100644 --- a/lib/Magento/App/Router/DefaultRouter.php +++ b/lib/Magento/Framework/App/Router/DefaultRouter.php @@ -23,10 +23,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Router; +namespace Magento\Framework\App\Router; -use Magento\App\ActionFactory; -use Magento\App\RequestInterface; +use Magento\Framework\App\ActionFactory; +use Magento\Framework\App\RequestInterface; class DefaultRouter extends AbstractRouter { @@ -59,6 +59,9 @@ class DefaultRouter extends AbstractRouter } } - return $this->_actionFactory->createController('Magento\App\Action\Forward', array('request' => $request)); + return $this->_actionFactory->createController( + 'Magento\Framework\App\Action\Forward', + array('request' => $request) + ); } } diff --git a/lib/Magento/App/Router/NoRouteHandlerInterface.php b/lib/Magento/Framework/App/Router/NoRouteHandlerInterface.php similarity index 85% rename from lib/Magento/App/Router/NoRouteHandlerInterface.php rename to lib/Magento/Framework/App/Router/NoRouteHandlerInterface.php index 69d6771c33e4634002f874d7670a577c02b80bd9..b59508e621f012c50cc8df6958d3e7c928a5ff44 100644 --- a/lib/Magento/App/Router/NoRouteHandlerInterface.php +++ b/lib/Magento/Framework/App/Router/NoRouteHandlerInterface.php @@ -23,15 +23,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Router; +namespace Magento\Framework\App\Router; interface NoRouteHandlerInterface { /** * Check and process no route request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return bool */ - public function process(\Magento\App\RequestInterface $request); + public function process(\Magento\Framework\App\RequestInterface $request); } diff --git a/lib/Magento/App/Router/NoRouteHandlerList.php b/lib/Magento/Framework/App/Router/NoRouteHandlerList.php similarity index 98% rename from lib/Magento/App/Router/NoRouteHandlerList.php rename to lib/Magento/Framework/App/Router/NoRouteHandlerList.php index d9a55d3db96bd0430325d1b4dc5dd701e6b5d9e7..52b466aedf0105468c1318f93ab44a47f14df017 100644 --- a/lib/Magento/App/Router/NoRouteHandlerList.php +++ b/lib/Magento/Framework/App/Router/NoRouteHandlerList.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App\Router; +namespace Magento\Framework\App\Router; class NoRouteHandlerList { diff --git a/lib/Magento/App/RouterInterface.php b/lib/Magento/Framework/App/RouterInterface.php similarity index 97% rename from lib/Magento/App/RouterInterface.php rename to lib/Magento/Framework/App/RouterInterface.php index fa58b3cc5613196ba078ba0c52d8278cbf4ac4bf..46ee20fd511fe358c9f0316e8e12ee6450cedfad 100644 --- a/lib/Magento/App/RouterInterface.php +++ b/lib/Magento/Framework/App/RouterInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface RouterInterface { diff --git a/lib/Magento/App/RouterList.php b/lib/Magento/Framework/App/RouterList.php similarity index 99% rename from lib/Magento/App/RouterList.php rename to lib/Magento/Framework/App/RouterList.php index bfb3cc531ee3e867bbfb4bc7d90989a18c51cf74..031d1012b19e95f8ff9534bcd4921009b44ea3ab 100644 --- a/lib/Magento/App/RouterList.php +++ b/lib/Magento/Framework/App/RouterList.php @@ -24,7 +24,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class RouterList implements RouterListInterface { diff --git a/lib/Magento/App/RouterListInterface.php b/lib/Magento/Framework/App/RouterListInterface.php similarity index 96% rename from lib/Magento/App/RouterListInterface.php rename to lib/Magento/Framework/App/RouterListInterface.php index a0f106005b996c18cc48317cf4e7c9946562be4e..852437325599109919174ac699fa90986459ebdf 100644 --- a/lib/Magento/App/RouterListInterface.php +++ b/lib/Magento/Framework/App/RouterListInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface RouterListInterface extends \Iterator { diff --git a/lib/Magento/App/ScopeInterface.php b/lib/Magento/Framework/App/ScopeInterface.php similarity index 97% rename from lib/Magento/App/ScopeInterface.php rename to lib/Magento/Framework/App/ScopeInterface.php index 8a02f47896840fa6f33fe28083831e0b306edc24..9fd0e4c2df428aeeae939915b9dc755b1a8b031c 100644 --- a/lib/Magento/App/ScopeInterface.php +++ b/lib/Magento/Framework/App/ScopeInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface ScopeInterface { diff --git a/lib/Magento/App/ScopeResolverInterface.php b/lib/Magento/Framework/App/ScopeResolverInterface.php similarity index 92% rename from lib/Magento/App/ScopeResolverInterface.php rename to lib/Magento/Framework/App/ScopeResolverInterface.php index a1f9e887732659b5977df30a36f59cb5dd6ca15d..3ff7cdb18cdfb9998aa5bf6ca3e015f7c9f77fd9 100644 --- a/lib/Magento/App/ScopeResolverInterface.php +++ b/lib/Magento/Framework/App/ScopeResolverInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface ScopeResolverInterface { @@ -29,7 +29,7 @@ interface ScopeResolverInterface * Retrieve application scope object * * @param null|int $scopeId - * @return \Magento\App\ScopeInterface + * @return \Magento\Framework\App\ScopeInterface */ public function getScope($scopeId = null); } diff --git a/lib/Magento/App/ScopeResolverPool.php b/lib/Magento/Framework/App/ScopeResolverPool.php similarity index 88% rename from lib/Magento/App/ScopeResolverPool.php rename to lib/Magento/Framework/App/ScopeResolverPool.php index 33bddfebc202b4248c8436b4430ca8d537c52665..d597bce5ae4a0ffc5d4946a4140288d3db3b65bf 100644 --- a/lib/Magento/App/ScopeResolverPool.php +++ b/lib/Magento/Framework/App/ScopeResolverPool.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class ScopeResolverPool { @@ -32,7 +32,7 @@ class ScopeResolverPool protected $_scopeResolvers = array(); /** - * @param \Magento\App\ScopeResolverInterface[] $scopeResolvers + * @param \Magento\Framework\App\ScopeResolverInterface[] $scopeResolvers */ public function __construct( array $scopeResolvers @@ -45,12 +45,12 @@ class ScopeResolverPool * * @param string $scopeType * @throws \InvalidArgumentException - * @return \Magento\App\ScopeResolverInterface + * @return \Magento\Framework\App\ScopeResolverInterface */ public function get($scopeType) { if (!isset($this->_scopeResolvers[$scopeType]) || - !($this->_scopeResolvers[$scopeType] instanceof \Magento\App\ScopeResolverInterface) + !($this->_scopeResolvers[$scopeType] instanceof \Magento\Framework\App\ScopeResolverInterface) ) { throw new \InvalidArgumentException("Invalid scope type '{$scopeType}'"); } diff --git a/lib/Magento/App/State.php b/lib/Magento/Framework/App/State.php similarity index 99% rename from lib/Magento/App/State.php rename to lib/Magento/Framework/App/State.php index 159b0c9da1dc367e4a068aa24507cbee5be12dca..9fc06263a2d0e47fbfb54409fc3eced4ad51453a 100644 --- a/lib/Magento/App/State.php +++ b/lib/Magento/Framework/App/State.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class State { diff --git a/lib/Magento/App/TemplateTypesInterface.php b/lib/Magento/Framework/App/TemplateTypesInterface.php similarity index 97% rename from lib/Magento/App/TemplateTypesInterface.php rename to lib/Magento/Framework/App/TemplateTypesInterface.php index bce023ca28fdef461d6914081c47a955aa78bd1d..19fb8c99dd4f29a9a1d33f49a7914053c33a9c18 100644 --- a/lib/Magento/App/TemplateTypesInterface.php +++ b/lib/Magento/Framework/App/TemplateTypesInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface TemplateTypesInterface { diff --git a/lib/Magento/App/View.php b/lib/Magento/Framework/App/View.php similarity index 97% rename from lib/Magento/App/View.php rename to lib/Magento/Framework/App/View.php index 1c973a5cbaf56e9ae9cd8f2ae54240efff274159..2bccf5dc67f532ad72bcf73264bb6bb943acf166 100644 --- a/lib/Magento/App/View.php +++ b/lib/Magento/Framework/App/View.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; class View implements ViewInterface { @@ -232,7 +232,7 @@ class View implements ViewInterface \Magento\Profiler::start('LAYOUT'); // dispatch event for adding xml layout elements - if (!$this->_actionFlag->get('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT)) { + if (!$this->_actionFlag->get('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT)) { $this->_eventManager->dispatch( 'controller_action_layout_generate_blocks_before', array('full_action_name' => $this->_request->getFullActionName(), 'layout' => $this->getLayout()) @@ -244,7 +244,7 @@ class View implements ViewInterface $this->getLayout()->generateElements(); \Magento\Profiler::stop('layout_generate_blocks'); - if (!$this->_actionFlag->get('', \Magento\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT)) { + if (!$this->_actionFlag->get('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH_BLOCK_EVENT)) { $this->_eventManager->dispatch( 'controller_action_layout_generate_blocks_after', array('full_action_name' => $this->_request->getFullActionName(), 'layout' => $this->getLayout()) diff --git a/lib/Magento/App/ViewInterface.php b/lib/Magento/Framework/App/ViewInterface.php similarity index 98% rename from lib/Magento/App/ViewInterface.php rename to lib/Magento/Framework/App/ViewInterface.php index 0b3f96429e3f7e13f7c6ff9858b669095fb0009b..8c396a25d304474a0498267cf21a07709d403bf3 100644 --- a/lib/Magento/App/ViewInterface.php +++ b/lib/Magento/Framework/App/ViewInterface.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\App; +namespace Magento\Framework\App; interface ViewInterface { diff --git a/lib/Magento/App/etc/resources.xsd b/lib/Magento/Framework/App/etc/resources.xsd similarity index 100% rename from lib/Magento/App/etc/resources.xsd rename to lib/Magento/Framework/App/etc/resources.xsd diff --git a/lib/Magento/App/etc/routes.xsd b/lib/Magento/Framework/App/etc/routes.xsd similarity index 100% rename from lib/Magento/App/etc/routes.xsd rename to lib/Magento/Framework/App/etc/routes.xsd diff --git a/lib/Magento/App/etc/routes_merged.xsd b/lib/Magento/Framework/App/etc/routes_merged.xsd similarity index 100% rename from lib/Magento/App/etc/routes_merged.xsd rename to lib/Magento/Framework/App/etc/routes_merged.xsd diff --git a/lib/Magento/AppInterface.php b/lib/Magento/Framework/AppInterface.php similarity index 90% rename from lib/Magento/AppInterface.php rename to lib/Magento/Framework/AppInterface.php index 4822e8e0f1d20b44c98047ce4cf0d7c211583d2a..64e03347f0b39b96682274e514e76a872b90a0c5 100644 --- a/lib/Magento/AppInterface.php +++ b/lib/Magento/Framework/AppInterface.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento; +namespace Magento\Framework; interface AppInterface { @@ -35,12 +35,12 @@ interface AppInterface /** * Magento version */ - const VERSION = '2.0.0.0-dev73'; + const VERSION = '2.0.0.0-dev74'; /** * Launch application * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface */ public function launch(); } diff --git a/lib/Magento/HTTP/Authentication.php b/lib/Magento/HTTP/Authentication.php index f3293ea9d92e1e09e2625ea7a02b7f5e6bb210c5..eb88707d8b9585f95542d2c49e99a482a651bfb3 100644 --- a/lib/Magento/HTTP/Authentication.php +++ b/lib/Magento/HTTP/Authentication.php @@ -33,24 +33,24 @@ class Authentication /** * Request object * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; /** * Response object * - * @var \Magento\App\ResponseInterface + * @var \Magento\Framework\App\ResponseInterface */ protected $response; /** - * @param \Magento\App\RequestInterface $httpRequest - * @param \Magento\App\ResponseInterface $httpResponse + * @param \Magento\Framework\App\RequestInterface $httpRequest + * @param \Magento\Framework\App\ResponseInterface $httpResponse */ public function __construct( - \Magento\App\RequestInterface $httpRequest, - \Magento\App\ResponseInterface $httpResponse + \Magento\Framework\App\RequestInterface $httpRequest, + \Magento\Framework\App\ResponseInterface $httpResponse ) { $this->request = $httpRequest; $this->response = $httpResponse; diff --git a/lib/Magento/HTTP/Header.php b/lib/Magento/HTTP/Header.php index d63a3a98839fac6915186d315ea5e22392b2bc93..087fa289038e06e5fff8dd8de33f51dc621e09e7 100644 --- a/lib/Magento/HTTP/Header.php +++ b/lib/Magento/HTTP/Header.php @@ -33,7 +33,7 @@ class Header /** * Request object * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -43,10 +43,10 @@ class Header protected $_converter; /** - * @param \Magento\App\RequestInterface $httpRequest + * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Stdlib\String $converter */ - public function __construct(\Magento\App\RequestInterface $httpRequest, \Magento\Stdlib\String $converter) + public function __construct(\Magento\Framework\App\RequestInterface $httpRequest, \Magento\Stdlib\String $converter) { $this->_request = $httpRequest; $this->_converter = $converter; diff --git a/lib/Magento/HTTP/PhpEnvironment/RemoteAddress.php b/lib/Magento/HTTP/PhpEnvironment/RemoteAddress.php index 3356a66aa29558fcf8db8391536ce375ec1231e5..a96fa47d843acd7281812a1b119bc60f657dcfb7 100644 --- a/lib/Magento/HTTP/PhpEnvironment/RemoteAddress.php +++ b/lib/Magento/HTTP/PhpEnvironment/RemoteAddress.php @@ -33,7 +33,7 @@ class RemoteAddress /** * Request object * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -50,10 +50,10 @@ class RemoteAddress protected $alternativeHeaders; /** - * @param \Magento\App\RequestInterface $httpRequest + * @param \Magento\Framework\App\RequestInterface $httpRequest * @param array $alternativeHeaders */ - public function __construct(\Magento\App\RequestInterface $httpRequest, array $alternativeHeaders = array()) + public function __construct(\Magento\Framework\App\RequestInterface $httpRequest, array $alternativeHeaders = array()) { $this->request = $httpRequest; $this->alternativeHeaders = $alternativeHeaders; diff --git a/lib/Magento/HTTP/PhpEnvironment/ServerAddress.php b/lib/Magento/HTTP/PhpEnvironment/ServerAddress.php index d5731e5d41f777e7b5ead104246f6c57b49dfec3..4f6621d9e5e2c00999d5cc0c4b0d5b2037bbe2e0 100644 --- a/lib/Magento/HTTP/PhpEnvironment/ServerAddress.php +++ b/lib/Magento/HTTP/PhpEnvironment/ServerAddress.php @@ -25,7 +25,7 @@ */ namespace Magento\HTTP\PhpEnvironment; -use Magento\App\RequestInterface; +use Magento\Framework\App\RequestInterface; /** * Library for working with server ip address diff --git a/lib/Magento/Image/Adapter/AbstractAdapter.php b/lib/Magento/Image/Adapter/AbstractAdapter.php index c17064d166c28fb0208dc225eb9b743a78846f9e..512f49fd078f1938e93a2d578fd3c1b752a58c0b 100644 --- a/lib/Magento/Image/Adapter/AbstractAdapter.php +++ b/lib/Magento/Image/Adapter/AbstractAdapter.php @@ -162,7 +162,7 @@ abstract class AbstractAdapter implements AdapterInterface /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -278,13 +278,13 @@ abstract class AbstractAdapter implements AdapterInterface /** * Initialize default values * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param array $data */ - public function __construct(\Magento\App\Filesystem $filesystem, array $data = array()) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, array $data = array()) { $this->_filesystem = $filesystem; - $this->directoryWrite = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->directoryWrite = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); } /** diff --git a/lib/Magento/Image/Adapter/Config.php b/lib/Magento/Image/Adapter/Config.php index 8bbe3f5b524f37b12811c56d4d00333e0a8931d0..ca25ee1bd8b2e326bbed9abe2aca9fa9aaa020a2 100644 --- a/lib/Magento/Image/Adapter/Config.php +++ b/lib/Magento/Image/Adapter/Config.php @@ -30,14 +30,14 @@ class Config implements \Magento\Image\Adapter\ConfigInterface const XML_PATH_IMAGE_ADAPTERS = 'dev/image/adapters'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $config; /** - * @param \Magento\App\Config\ScopeConfigInterface $config + * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ - public function __construct(\Magento\App\Config\ScopeConfigInterface $config) + public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config) { $this->config = $config; } diff --git a/lib/Magento/Image/Adapter/Gd2.php b/lib/Magento/Image/Adapter/Gd2.php index 69214de7ac08a2a59a9e2d9e92e84608fcaaf555..a9feeebcab5e18ff8528463031b7bcfd669e60e3 100644 --- a/lib/Magento/Image/Adapter/Gd2.php +++ b/lib/Magento/Image/Adapter/Gd2.php @@ -79,14 +79,13 @@ class Gd2 extends \Magento\Image\Adapter\AbstractAdapter */ protected function _isMemoryLimitReached() { - $memory_limit = ini_get('memory_limit'); - if ($memory_limit == -1) { + $limit = $this->_convertToByte(ini_get('memory_limit')); + $requiredMemory = $this->_getImageNeedMemorySize($this->_fileName); + if ($limit === -1) { + // A limit of -1 means no limit: http://www.php.net/manual/en/ini.core.php#ini.memory-limit return false; - } else { - $limit = $this->_convertToByte($memory_limit); - $requiredMemory = $this->_getImageNeedMemorySize($this->_fileName); - return (memory_get_usage(true) + $requiredMemory) > $limit; } + return memory_get_usage(true) + $requiredMemory > $limit; } /** diff --git a/lib/Magento/Interception/Code/Generator/Interceptor.php b/lib/Magento/Interception/Code/Generator/Interceptor.php index 7b4ccc51c77d2e7c957d51d0a2dd5293deea6afe..b2249b46edf0b095487ea4f7afdec36792b84237 100644 --- a/lib/Magento/Interception/Code/Generator/Interceptor.php +++ b/lib/Magento/Interception/Code/Generator/Interceptor.php @@ -149,7 +149,7 @@ class Interceptor extends \Magento\Code\Generator\EntityAbstract $methods[] = array( 'name' => '__wakeup', - 'body' => "\$this->pluginLocator = \\Magento\\App\\ObjectManager::getInstance();\n" . + 'body' => "\$this->pluginLocator = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n" . "\$this->pluginList = \$this->pluginLocator->get('Magento\\Interception\\PluginList');\n" . "\$this->chain = \$this->pluginLocator->get('Magento\\Interception\\Chain');\n" . "\$this->subjectType = get_parent_class(\$this);\n" diff --git a/lib/Magento/Less/File/Source/Base.php b/lib/Magento/Less/File/Source/Base.php index 97a2f07d014706819a596c92090cadb5eeed813c..359f060599adb93e6ed30bb18296bede7dea8275 100644 --- a/lib/Magento/Less/File/Source/Base.php +++ b/lib/Magento/Less/File/Source/Base.php @@ -25,7 +25,7 @@ namespace Magento\Less\File\Source; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; diff --git a/lib/Magento/Less/File/Source/Library.php b/lib/Magento/Less/File/Source/Library.php index 94088147f745e1dd58089e7e2373e255e15f916d..d9c0d116da7265b0bb08783fdca3a8550acd59dd 100644 --- a/lib/Magento/Less/File/Source/Library.php +++ b/lib/Magento/Less/File/Source/Library.php @@ -25,7 +25,7 @@ namespace Magento\Less\File\Source; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; use Magento\View\Layout\File\FileList\Factory as FileListFactory; diff --git a/lib/Magento/Less/File/Source/Theme.php b/lib/Magento/Less/File/Source/Theme.php index 8a2a1473d5e187737eba2a21817afa1f3a28321a..e3fa8a9252713f29281b455111babc835fed4e7e 100644 --- a/lib/Magento/Less/File/Source/Theme.php +++ b/lib/Magento/Less/File/Source/Theme.php @@ -25,7 +25,7 @@ namespace Magento\Less\File\Source; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; diff --git a/lib/Magento/Less/PreProcessor/File/Less.php b/lib/Magento/Less/PreProcessor/File/Less.php index c85e146026514a822e03003acd379ecb88d6bf12..cdfea3a3718f62ea7586e0ae761b2c5ad200c4bf 100644 --- a/lib/Magento/Less/PreProcessor/File/Less.php +++ b/lib/Magento/Less/PreProcessor/File/Less.php @@ -41,7 +41,7 @@ class Less protected $viewFileSystem; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -67,14 +67,14 @@ class Less /** * @param View\FileSystem $viewFileSystem - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $filePath * @param array $viewParams * @param string|null $sourcePath */ public function __construct( View\FileSystem $viewFileSystem, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $filePath, array $viewParams, $sourcePath = null @@ -185,7 +185,7 @@ class Less */ public function getDirectoryRead() { - return $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + return $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); } /** @@ -195,6 +195,6 @@ class Less */ public function getDirectoryWrite() { - return $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::TMP_DIR); + return $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::TMP_DIR); } } diff --git a/lib/Magento/Locale/Format.php b/lib/Magento/Locale/Format.php index 8dff5335f334ff62373d293e3a13b955a44152a6..b6183c16733c0a17edf7d296de32557353b53d8b 100644 --- a/lib/Magento/Locale/Format.php +++ b/lib/Magento/Locale/Format.php @@ -26,7 +26,7 @@ namespace Magento\Locale; class Format implements \Magento\Locale\FormatInterface { /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; @@ -36,11 +36,11 @@ class Format implements \Magento\Locale\FormatInterface protected $_localeResolver; /** - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param ResolverInterface $localeResolver */ public function __construct( - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\Locale\ResolverInterface $localeResolver ) { $this->_scopeResolver = $scopeResolver; diff --git a/lib/Magento/Locale/Hierarchy/Config/FileResolver.php b/lib/Magento/Locale/Hierarchy/Config/FileResolver.php index 901cb5ce5917f1d24a057f98a5eb5c85472ef7cf..6b72c9e0db9564df3d8912bc2d6f062b34866c38 100644 --- a/lib/Magento/Locale/Hierarchy/Config/FileResolver.php +++ b/lib/Magento/Locale/Hierarchy/Config/FileResolver.php @@ -38,14 +38,14 @@ class FileResolver implements \Magento\Config\FileResolverInterface protected $iteratorFactory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Config\FileIteratorFactory $iteratorFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Config\FileIteratorFactory $iteratorFactory ) { - $this->directoryRead = $filesystem->getDirectoryRead(\Magento\App\Filesystem::APP_DIR); + $this->directoryRead = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::APP_DIR); $this->iteratorFactory = $iteratorFactory; } diff --git a/lib/Magento/Locale/Lists.php b/lib/Magento/Locale/Lists.php index 2b47ff76c516d462d5299ddc54798c794dfb2a00..b58a6254f6b01c1df668aad420ffb36b5d654e5b 100644 --- a/lib/Magento/Locale/Lists.php +++ b/lib/Magento/Locale/Lists.php @@ -26,12 +26,12 @@ namespace Magento\Locale; class Lists implements \Magento\Locale\ListsInterface { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; @@ -51,16 +51,16 @@ class Lists implements \Magento\Locale\ListsInterface protected $_currencyInstalled; /** - * @param \Magento\App\State $appState - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param \Magento\Locale\ConfigInterface $config * @param \Magento\Locale\ResolverInterface $localeResolver * @param string $currencyInstalled * @param string $locale */ public function __construct( - \Magento\App\State $appState, - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\Locale\ConfigInterface $config, \Magento\Locale\ResolverInterface $localeResolver, $currencyInstalled, diff --git a/lib/Magento/Locale/Resolver.php b/lib/Magento/Locale/Resolver.php index 69acaeb75704e1af2aaafda6cbb4505db7a46a29..958084414a27b6c5f574e28698b41199d120a35a 100644 --- a/lib/Magento/Locale/Resolver.php +++ b/lib/Magento/Locale/Resolver.php @@ -54,12 +54,12 @@ class Resolver implements \Magento\Locale\ResolverInterface protected $_localeCode; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -76,16 +76,16 @@ class Resolver implements \Magento\Locale\ResolverInterface protected $_localeFactory; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\LocaleFactory $localeFactory * @param string $defaultLocalePath * @param string $scopeType * @param mixed $locale */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\CacheInterface $cache, \Magento\LocaleFactory $localeFactory, $defaultLocalePath, $scopeType, diff --git a/lib/Magento/Logger.php b/lib/Magento/Logger.php index 3dd6efdcf03b5b3f8f3f764781d218422b78d63f..9585159f564e897450a39267a1d3ce88d57f2f44 100644 --- a/lib/Magento/Logger.php +++ b/lib/Magento/Logger.php @@ -43,15 +43,15 @@ class Logger protected $_loggers = array(); /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $defaultFile */ - public function __construct(\Magento\App\Filesystem $filesystem, $defaultFile = '') + public function __construct(\Magento\Framework\App\Filesystem $filesystem, $defaultFile = '') { $this->_filesystem = $filesystem; $this->addStreamLog(self::LOGGER_SYSTEM, $defaultFile)->addStreamLog(self::LOGGER_EXCEPTION, $defaultFile); @@ -72,7 +72,7 @@ class Logger { $file = $fileOrWrapper ?: "{$loggerKey}.log"; if (!preg_match('#^[a-z][a-z0-9+.-]*\://#i', $file)) { - $logDir = $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::LOG_DIR); + $logDir = $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::LOG_DIR); $logDir->create(); $file = $logDir->getAbsolutePath($file); } diff --git a/lib/Magento/Mail/Template/TransportBuilder.php b/lib/Magento/Mail/Template/TransportBuilder.php index a1782048d6367e6c75a33d71aa345edf0f5722ad..ead9aabec93be17de247acbb3f376c5cc0110db4 100644 --- a/lib/Magento/Mail/Template/TransportBuilder.php +++ b/lib/Magento/Mail/Template/TransportBuilder.php @@ -262,8 +262,8 @@ class TransportBuilder { $template = $this->getTemplate(); $types = array( - \Magento\App\TemplateTypesInterface::TYPE_TEXT => \Magento\Mail\MessageInterface::TYPE_TEXT, - \Magento\App\TemplateTypesInterface::TYPE_HTML => \Magento\Mail\MessageInterface::TYPE_HTML + \Magento\Framework\App\TemplateTypesInterface::TYPE_TEXT => \Magento\Mail\MessageInterface::TYPE_TEXT, + \Magento\Framework\App\TemplateTypesInterface::TYPE_HTML => \Magento\Mail\MessageInterface::TYPE_HTML ); $body = $template->processTemplate(); diff --git a/lib/Magento/Mail/TemplateInterface.php b/lib/Magento/Mail/TemplateInterface.php index cc4264c17d3cb0a60fd023074b1293b9e7a704b4..7ff4a1ad3355725b17ee4ae556b21f795add7c38 100644 --- a/lib/Magento/Mail/TemplateInterface.php +++ b/lib/Magento/Mail/TemplateInterface.php @@ -25,7 +25,7 @@ */ namespace Magento\Mail; -interface TemplateInterface extends \Magento\App\TemplateTypesInterface +interface TemplateInterface extends \Magento\Framework\App\TemplateTypesInterface { /** * Get processed template diff --git a/lib/Magento/Math/Calculator.php b/lib/Magento/Math/Calculator.php index ffa38e32d1be45de3c270e6f344c8be53cba7852..4c7ea7c60dfe7ae7e5eb36da8428ef8c1b8de695 100644 --- a/lib/Magento/Math/Calculator.php +++ b/lib/Magento/Math/Calculator.php @@ -38,16 +38,16 @@ class Calculator /** * Store instance * - * @var \Magento\App\ScopeInterface|null + * @var \Magento\Framework\App\ScopeInterface|null */ protected $_scope = null; /** * Initialize calculator * - * @param \Magento\App\ScopeInterface $scope + * @param \Magento\Framework\App\ScopeInterface $scope */ - public function __construct(\Magento\App\ScopeInterface $scope) + public function __construct(\Magento\Framework\App\ScopeInterface $scope) { $this->_scope = $scope; } diff --git a/lib/Magento/Model/AbstractModel.php b/lib/Magento/Model/AbstractModel.php index c18f80570d0fd456bed0b909371786d70f9234ce..46975a74fc73f7333fd9989098cb1380e888541e 100644 --- a/lib/Magento/Model/AbstractModel.php +++ b/lib/Magento/Model/AbstractModel.php @@ -117,7 +117,7 @@ abstract class AbstractModel extends \Magento\Object /** * Application Cache Manager * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cacheManager; @@ -132,7 +132,7 @@ abstract class AbstractModel extends \Magento\Object protected $_logger; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -210,9 +210,9 @@ abstract class AbstractModel extends \Magento\Object */ public function __wakeup() { - $objectManager = \Magento\App\ObjectManager::getInstance(); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $this->_eventManager = $objectManager->get('Magento\Event\ManagerInterface'); - $this->_cacheManager = $objectManager->get('Magento\App\CacheInterface'); + $this->_cacheManager = $objectManager->get('Magento\Framework\App\CacheInterface'); $this->_registry = $objectManager->get('Magento\Registry'); $context = $objectManager->get('Magento\Model\Context'); if ($context instanceof \Magento\Model\Context) { @@ -250,7 +250,7 @@ abstract class AbstractModel extends \Magento\Object throw new \Magento\Model\Exception(__('Resource is not set.')); } - return $this->_resource ? : \Magento\App\ObjectManager::getInstance()->get($this->_resourceName); + return $this->_resource ? : \Magento\Framework\App\ObjectManager::getInstance()->get($this->_resourceName); } /** @@ -276,7 +276,7 @@ abstract class AbstractModel extends \Magento\Object throw new \Magento\Model\Exception(__('Model collection resource name is not defined.')); } return $this->_resourceCollection ? clone $this - ->_resourceCollection : \Magento\App\ObjectManager::getInstance() + ->_resourceCollection : \Magento\Framework\App\ObjectManager::getInstance() ->create( $this->_collectionName ); diff --git a/lib/Magento/Model/Context.php b/lib/Magento/Model/Context.php index 1d3b1c594b0e4e3ac4b74327298b948e43fafb4b..30b15e48e0c60cbad3ef14fd0c3c51a8396075a2 100644 --- a/lib/Magento/Model/Context.php +++ b/lib/Magento/Model/Context.php @@ -33,7 +33,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_eventDispatcher; /** - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cacheManager; @@ -43,7 +43,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_logger; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -55,15 +55,15 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventDispatcher - * @param \Magento\App\CacheInterface $cacheManager - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\CacheInterface $cacheManager + * @param \Magento\Framework\App\State $appState * @param ActionValidator\RemoveAction $actionValidator */ public function __construct( \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventDispatcher, - \Magento\App\CacheInterface $cacheManager, - \Magento\App\State $appState, + \Magento\Framework\App\CacheInterface $cacheManager, + \Magento\Framework\App\State $appState, \Magento\Model\ActionValidator\RemoveAction $actionValidator ) { $this->_eventDispatcher = $eventDispatcher; @@ -74,7 +74,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\CacheInterface + * @return \Magento\Framework\App\CacheInterface */ public function getCacheManager() { @@ -98,7 +98,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\State + * @return \Magento\Framework\App\State */ public function getAppState() { diff --git a/lib/Magento/Model/Exception.php b/lib/Magento/Model/Exception.php index 3361c6d7e4cee29c580fbd6aff379dfac969745c..12c4c0827158be1f7835e4a58189ac778386d49f 100644 --- a/lib/Magento/Model/Exception.php +++ b/lib/Magento/Model/Exception.php @@ -33,7 +33,7 @@ class Exception extends \Exception /** * @var array */ - protected $_messages = array(); + protected $messages = array(); /** * @param \Magento\Message\AbstractMessage $message @@ -41,10 +41,10 @@ class Exception extends \Exception */ public function addMessage(\Magento\Message\AbstractMessage $message) { - if (!isset($this->_messages[$message->getType()])) { - $this->_messages[$message->getType()] = array(); + if (!isset($this->messages[$message->getType()])) { + $this->messages[$message->getType()] = array(); } - $this->_messages[$message->getType()][] = $message; + $this->messages[$message->getType()][] = $message; return $this; } @@ -56,12 +56,12 @@ class Exception extends \Exception { if ('' == $type) { $arrRes = array(); - foreach ($this->_messages as $messageType => $messages) { + foreach ($this->messages as $messages) { $arrRes = array_merge($arrRes, $messages); } return $arrRes; } - return isset($this->_messages[$type]) ? $this->_messages[$type] : array(); + return isset($this->messages[$type]) ? $this->messages[$type] : array(); } /** diff --git a/lib/Magento/Model/Resource/AbstractResource.php b/lib/Magento/Model/Resource/AbstractResource.php index 22feb833c54ea1e403323f1c614e5a266dd25521..79885a32ecb949bec3430022c273ad601857fa89 100644 --- a/lib/Magento/Model/Resource/AbstractResource.php +++ b/lib/Magento/Model/Resource/AbstractResource.php @@ -217,7 +217,7 @@ abstract class AbstractResource { $type = strtolower($type); if ($type == 'decimal' || $type == 'numeric' || $type == 'float') { - $value = \Magento\App\ObjectManager::getInstance()->get( + $value = \Magento\Framework\App\ObjectManager::getInstance()->get( 'Magento\Locale\FormatInterface' )->getNumber( $value diff --git a/lib/Magento/Model/Resource/Db/AbstractDb.php b/lib/Magento/Model/Resource/Db/AbstractDb.php index 743220e65a8141848d036f192236d37c7710e99e..4d660986de3571168d66906d5dd859eb1ce2ba99 100644 --- a/lib/Magento/Model/Resource/Db/AbstractDb.php +++ b/lib/Magento/Model/Resource/Db/AbstractDb.php @@ -31,7 +31,7 @@ abstract class AbstractDb extends \Magento\Model\Resource\AbstractResource /** * Cached resources singleton * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resources; @@ -132,9 +132,9 @@ abstract class AbstractDb extends \Magento\Model\Resource\AbstractResource /** * Class constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->_resources = $resource; parent::__construct(); @@ -159,7 +159,7 @@ abstract class AbstractDb extends \Magento\Model\Resource\AbstractResource */ public function __wakeup() { - $this->_resources = \Magento\App\ObjectManager::getInstance()->get('Magento\App\Resource'); + $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\App\Resource'); } /** diff --git a/lib/Magento/Model/Resource/Db/Collection/AbstractCollection.php b/lib/Magento/Model/Resource/Db/Collection/AbstractCollection.php index 55a49e34b9a0b571cdf46abb452f2e409df95554..714a6db58ce01d4870715796ba71dadb6b9874b4 100644 --- a/lib/Magento/Model/Resource/Db/Collection/AbstractCollection.php +++ b/lib/Magento/Model/Resource/Db/Collection/AbstractCollection.php @@ -470,7 +470,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db public function getResource() { if (empty($this->_resource)) { - $this->_resource = \Magento\App\ObjectManager::getInstance()->create($this->getResourceModelName()); + $this->_resource = \Magento\Framework\App\ObjectManager::getInstance()->create($this->getResourceModelName()); } return $this->_resource; } diff --git a/lib/Magento/Model/Resource/Type/Db/Pdo/Mysql.php b/lib/Magento/Model/Resource/Type/Db/Pdo/Mysql.php index c8d7a0884d43fc345413276c89a18b9707098258..705b17e943c4818929fdfbd8915fb263fb56abfd 100644 --- a/lib/Magento/Model/Resource/Type/Db/Pdo/Mysql.php +++ b/lib/Magento/Model/Resource/Type/Db/Pdo/Mysql.php @@ -23,12 +23,12 @@ */ namespace Magento\Model\Resource\Type\Db\Pdo; -class Mysql extends \Magento\Model\Resource\Type\Db implements \Magento\App\Resource\ConnectionAdapterInterface +class Mysql extends \Magento\Model\Resource\Type\Db implements \Magento\Framework\App\Resource\ConnectionAdapterInterface { /** * Filesystem class * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -58,7 +58,7 @@ class Mysql extends \Magento\Model\Resource\Type\Db implements \Magento\App\Reso protected $_isActive; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Stdlib\String $string * @param \Magento\Stdlib\DateTime $dateTime * @param string $host @@ -71,7 +71,7 @@ class Mysql extends \Magento\Model\Resource\Type\Db implements \Magento\App\Reso * @param bool $active */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Stdlib\String $string, \Magento\Stdlib\DateTime $dateTime, $host, diff --git a/lib/Magento/Module/Declaration/FileIterator.php b/lib/Magento/Module/Declaration/FileIterator.php index f065a64cc9cd230e84472a153eb5f2fa8c495390..e8adf3e9e920c522b3eda0a2ed101b48e3a4c8f5 100644 --- a/lib/Magento/Module/Declaration/FileIterator.php +++ b/lib/Magento/Module/Declaration/FileIterator.php @@ -23,7 +23,7 @@ */ namespace Magento\Module\Declaration; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; class FileIterator extends \Magento\Config\FileIterator { diff --git a/lib/Magento/Module/Declaration/FileResolver.php b/lib/Magento/Module/Declaration/FileResolver.php index f58c5062c70f19fc88853af2d8e9bece2f6df4e7..c608594589a8ac0da72980f7eb907f27351e8cbd 100644 --- a/lib/Magento/Module/Declaration/FileResolver.php +++ b/lib/Magento/Module/Declaration/FileResolver.php @@ -25,7 +25,7 @@ */ namespace Magento\Module\Declaration; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; class FileResolver implements \Magento\Config\FileResolverInterface diff --git a/lib/Magento/Module/Declaration/Reader/Filesystem.php b/lib/Magento/Module/Declaration/Reader/Filesystem.php index 4a9fa5a8f7797273cbe4a822fb4fe0255613ed24..e74ad0cee29848b6cba26b2e89da30dd7ae58314 100644 --- a/lib/Magento/Module/Declaration/Reader/Filesystem.php +++ b/lib/Magento/Module/Declaration/Reader/Filesystem.php @@ -30,7 +30,7 @@ use Magento\Module\Declaration\Converter\Dom; use Magento\Module\Declaration\SchemaLocator; use Magento\Module\DependencyManagerInterface; use Magento\Config\ValidationStateInterface; -use Magento\App\State; +use Magento\Framework\App\State; class Filesystem extends \Magento\Config\Reader\Filesystem { @@ -46,7 +46,7 @@ class Filesystem extends \Magento\Config\Reader\Filesystem protected $_allowedModules; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; diff --git a/lib/Magento/Module/Dir.php b/lib/Magento/Module/Dir.php index 47fab2b8f8225a5530f707109a9aa6a336651e17..d518d1b3aa856a3e60569bf5f0c651133072b628 100644 --- a/lib/Magento/Module/Dir.php +++ b/lib/Magento/Module/Dir.php @@ -25,7 +25,7 @@ */ namespace Magento\Module; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; class Dir diff --git a/lib/Magento/Module/Dir/Reader.php b/lib/Magento/Module/Dir/Reader.php index 6a30ac7c3a8726a217c875965050872c09d044a0..3bade7e3362593eac78555be3d9bc136f1b6e6d9 100644 --- a/lib/Magento/Module/Dir/Reader.php +++ b/lib/Magento/Module/Dir/Reader.php @@ -25,7 +25,7 @@ */ namespace Magento\Module\Dir; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Config\FileIterator; use Magento\Config\FileIteratorFactory; use Magento\Filesystem\Directory\Read; diff --git a/lib/Magento/Module/FrontController/Plugin/Install.php b/lib/Magento/Module/FrontController/Plugin/Install.php index d9b13f914db3ff0da0eaf81463dbcdb67decf0f6..ace9f1d0f577e5c7b232c26530340c6ff3319181 100644 --- a/lib/Magento/Module/FrontController/Plugin/Install.php +++ b/lib/Magento/Module/FrontController/Plugin/Install.php @@ -27,12 +27,12 @@ namespace Magento\Module\FrontController\Plugin; use Magento\Cache\FrontendInterface; use Magento\Module\UpdaterInterface; -use Magento\App\State; +use Magento\Framework\App\State; class Install { /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -59,17 +59,17 @@ class Install } /** - * @param \Magento\App\FrontController $subject + * @param \Magento\Framework\App\FrontController $subject * @param callable $proceed - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * - * @return \Magento\App\ResponseInterface + * @return \Magento\Framework\App\ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundDispatch( - \Magento\App\FrontController $subject, + \Magento\Framework\App\FrontController $subject, \Closure $proceed, - \Magento\App\RequestInterface $request + \Magento\Framework\App\RequestInterface $request ) { if ($this->_appState->isInstalled() && !$this->_cache->load('data_upgrade')) { $this->_dbUpdater->updateScheme(); diff --git a/lib/Magento/Module/Output/Config.php b/lib/Magento/Module/Output/Config.php index b366d4011ddfb20b00aa40b796b0bf0a523b5bfb..4c8f8f47eed19e3961664566efc2e114f14c8d4e 100644 --- a/lib/Magento/Module/Output/Config.php +++ b/lib/Magento/Module/Output/Config.php @@ -33,7 +33,7 @@ class Config implements \Magento\Module\Output\ConfigInterface const XML_PATH_MODULE_OUTPUT_STATUS = 'advanced/modules_disable_output/%s'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -43,11 +43,11 @@ class Config implements \Magento\Module\Output\ConfigInterface protected $_storeType; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $scopeType */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $scopeType ) { $this->_scopeConfig = $scopeConfig; diff --git a/lib/Magento/Module/Setup.php b/lib/Magento/Module/Setup.php index e64fa75db6b604ce2acbbd1fc8c5c86005ce2a65..ee223388bca582be66c6c388e12a1cb52d7f20f4 100644 --- a/lib/Magento/Module/Setup.php +++ b/lib/Magento/Module/Setup.php @@ -71,7 +71,7 @@ class Setup implements \Magento\Module\Updater\SetupInterface /** * Modules configuration * - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resourceModel; @@ -112,7 +112,7 @@ class Setup implements \Magento\Module\Updater\SetupInterface /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -142,7 +142,7 @@ class Setup implements \Magento\Module\Updater\SetupInterface $this->_migrationFactory = $context->getMigrationFactory(); $this->_moduleConfig = $context->getModuleList()->getModule($moduleName); $this->filesystem = $context->getFilesystem(); - $this->modulesDir = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::MODULES_DIR); + $this->modulesDir = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MODULES_DIR); $this->_connectionName = $connectionName; } @@ -781,7 +781,7 @@ class Setup implements \Magento\Module\Updater\SetupInterface } /** - * @return \Magento\App\Filesystem + * @return \Magento\Framework\App\Filesystem */ public function getFilesystem() { diff --git a/lib/Magento/Module/Setup/Context.php b/lib/Magento/Module/Setup/Context.php index c4275d097fdd76abdc77f0342eeffdcca77eedfe..f23c24956cbb9e5c9b6740983bd54a23e4457506 100644 --- a/lib/Magento/Module/Setup/Context.php +++ b/lib/Magento/Module/Setup/Context.php @@ -36,7 +36,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_eventManager; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $_resourceModel; @@ -66,7 +66,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_encryptor; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -75,24 +75,24 @@ class Context implements \Magento\ObjectManager\ContextInterface * * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\Module\ModuleListInterface $moduleList * @param \Magento\Module\ResourceInterface $resourceResource * @param \Magento\Module\Setup\MigrationFactory $migrationFactory * @param \Magento\Encryption\EncryptorInterface $encryptor - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\Module\Dir\Reader $modulesReader, \Magento\Module\ModuleListInterface $moduleList, \Magento\Module\ResourceInterface $resourceResource, \Magento\Module\Setup\MigrationFactory $migrationFactory, \Magento\Encryption\EncryptorInterface $encryptor, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_logger = $logger; $this->_eventManager = $eventManager; @@ -138,7 +138,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\Resource + * @return \Magento\Framework\App\Resource */ public function getResourceModel() { @@ -170,7 +170,7 @@ class Context implements \Magento\ObjectManager\ContextInterface } /** - * @return \Magento\App\Filesystem + * @return \Magento\Framework\App\Filesystem */ public function getFilesystem() { diff --git a/lib/Magento/Module/Setup/Migration.php b/lib/Magento/Module/Setup/Migration.php index 39df5a90e064d10d3abad5c76b0d4164ea5161b5..75a4ffb816034b436c019b9da99a25fbc19ed3cf 100644 --- a/lib/Magento/Module/Setup/Migration.php +++ b/lib/Magento/Module/Setup/Migration.php @@ -159,7 +159,7 @@ class Migration extends \Magento\Module\Setup $connectionName = \Magento\Module\Updater\SetupInterface::DEFAULT_SETUP_CONNECTION, $compositeModules = array() ) { - $this->_directory = $context->getFilesystem()->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->_directory = $context->getFilesystem()->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_pathToMapFile = $confPathToMapFile; $this->_migrationData = $migrationData; $this->_replacePatterns = array( diff --git a/lib/Magento/Module/Updater.php b/lib/Magento/Module/Updater.php index 09a4cd8cc4c32256d025d9dc7d1beb66e51ad99a..b1429c7c3c79d186c4dde17fc7b53bb7615eb303 100644 --- a/lib/Magento/Module/Updater.php +++ b/lib/Magento/Module/Updater.php @@ -25,7 +25,7 @@ */ namespace Magento\Module; -use Magento\App\State; +use Magento\Framework\App\State; use Magento\Module\Updater\SetupFactory; class Updater implements \Magento\Module\UpdaterInterface @@ -47,7 +47,7 @@ class Updater implements \Magento\Module\UpdaterInterface /** * Application state model * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; diff --git a/lib/Magento/Mview/Config/Data/Proxy.php b/lib/Magento/Mview/Config/Data/Proxy.php index a60e23af308a03104106d804222bc1a9697d0120..0c76f56d5ad0b7cdcbe0840b649581cf7713df05 100644 --- a/lib/Magento/Mview/Config/Data/Proxy.php +++ b/lib/Magento/Mview/Config/Data/Proxy.php @@ -86,7 +86,7 @@ class Proxy extends \Magento\Mview\Config\Data */ public function __wakeup() { - $this->objectManager = \Magento\App\ObjectManager::getInstance(); + $this->objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** diff --git a/lib/Magento/Mview/Config/SchemaLocator.php b/lib/Magento/Mview/Config/SchemaLocator.php index 927e591782cd6b7dcf513c7f41d78e22cf05cec5..4db8ba5a0d860c8250667411d797fe6c595ae60a 100644 --- a/lib/Magento/Mview/Config/SchemaLocator.php +++ b/lib/Magento/Mview/Config/SchemaLocator.php @@ -44,7 +44,7 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface */ public function __construct(\Magento\Filesystem\DirectoryList $directoryList) { - $etcDir = $directoryList->getDir(\Magento\App\Filesystem::LIB_DIR) . '/Magento/Mview/etc'; + $etcDir = $directoryList->getDir(\Magento\Framework\App\Filesystem::LIB_DIR) . '/Magento/Mview/etc'; $this->_schema = $etcDir . '/mview.xsd'; $this->_perFileSchema = $etcDir . '/mview.xsd'; } diff --git a/lib/Magento/Mview/View/Changelog.php b/lib/Magento/Mview/View/Changelog.php index 0fdbbeba2fad7921a6e45c6d022685423118a0b3..17a68cce44e32bfad3b75db5d67f77155cdd50f8 100644 --- a/lib/Magento/Mview/View/Changelog.php +++ b/lib/Magento/Mview/View/Changelog.php @@ -50,14 +50,14 @@ class Changelog implements ChangelogInterface protected $viewId; /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->write = $resource->getConnection('core_write'); $this->resource = $resource; diff --git a/lib/Magento/Mview/View/Subscription.php b/lib/Magento/Mview/View/Subscription.php index d9f23edb5c3b84ed4e48bd563f434ecb218e91c3..f93dac5dac7d1d1ff992df7bc527cf9607b1db86 100644 --- a/lib/Magento/Mview/View/Subscription.php +++ b/lib/Magento/Mview/View/Subscription.php @@ -70,12 +70,12 @@ class Subscription implements SubscriptionInterface protected $linkedViews = array(); /** - * @var \Magento\App\Resource + * @var \Magento\Framework\App\Resource */ protected $resource; /** - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource * @param \Magento\DB\Ddl\TriggerFactory $triggerFactory * @param \Magento\Mview\View\CollectionInterface $viewCollection * @param \Magento\Mview\ViewInterface $view @@ -83,7 +83,7 @@ class Subscription implements SubscriptionInterface * @param string $columnName */ public function __construct( - \Magento\App\Resource $resource, + \Magento\Framework\App\Resource $resource, \Magento\DB\Ddl\TriggerFactory $triggerFactory, \Magento\Mview\View\CollectionInterface $viewCollection, \Magento\Mview\ViewInterface $view, diff --git a/lib/Magento/Object/Copy/Config/SchemaLocator.php b/lib/Magento/Object/Copy/Config/SchemaLocator.php index 01ee450d55136a672748073642ad67d70f7c743b..fadbddbc59b13e531f9a20359c3797fd80bcb8b3 100644 --- a/lib/Magento/Object/Copy/Config/SchemaLocator.php +++ b/lib/Magento/Object/Copy/Config/SchemaLocator.php @@ -42,14 +42,14 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface protected $_perFileSchema; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $schema * @param string $perFileSchema */ - public function __construct(\Magento\App\Filesystem $filesystem, $schema, $perFileSchema) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, $schema, $perFileSchema) { - $this->_schema = $filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR) . '/' . $schema; - $this->_perFileSchema = $filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR) . '/' . $perFileSchema; + $this->_schema = $filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR) . '/' . $schema; + $this->_perFileSchema = $filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR) . '/' . $perFileSchema; } /** diff --git a/lib/Magento/ObjectManager/Code/Generator/Proxy.php b/lib/Magento/ObjectManager/Code/Generator/Proxy.php index 96662a0997abf339d8ce5a9d28146900a26f2c41..7f5ad34e88260413c4307c32839da3ce08a24116 100644 --- a/lib/Magento/ObjectManager/Code/Generator/Proxy.php +++ b/lib/Magento/ObjectManager/Code/Generator/Proxy.php @@ -99,7 +99,7 @@ class Proxy extends \Magento\Code\Generator\EntityAbstract ); $methods[] = array( 'name' => '__wakeup', - 'body' => '$this->_objectManager = \Magento\App\ObjectManager::getInstance();', + 'body' => '$this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance();', 'docblock' => array('shortDescription' => 'Retrieve ObjectManager from global scope') ); $methods[] = array( diff --git a/lib/Magento/Pear.php b/lib/Magento/Pear.php index 43425028f3078620557a1c0a7d78c19430160938..6c9a59f1bc8679555b2d20a1cae008bf55a4dc36 100644 --- a/lib/Magento/Pear.php +++ b/lib/Magento/Pear.php @@ -261,7 +261,7 @@ class Pear public function run($command, $options = array(), $params = array()) { @set_time_limit(0); - @ini_set('memory_limit', '2048M'); + @ini_set('memory_limit', '256M'); if (empty($this->_cmdCache[$command])) { $cmd = PEAR_Command::factory($command, $this->getConfig()); diff --git a/lib/Magento/Pricing/Adjustment/AdjustmentInterface.php b/lib/Magento/Pricing/Adjustment/AdjustmentInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..f0b008b34b7a657bb952a893f6c4ac0d8e58cf74 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/AdjustmentInterface.php @@ -0,0 +1,90 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * Interface AdjustmentInterface + */ +interface AdjustmentInterface +{ + /** + * Get adjustment code + * (as declared in DI configuration) + * + * @return string + */ + public function getAdjustmentCode(); + + /** + * Define if adjustment is included in base price + * + * @return bool + */ + public function isIncludedInBasePrice(); + + /** + * Define if adjustment is included in display price + * + * @return bool + */ + public function isIncludedInDisplayPrice(); + + /** + * Extract adjustment amount from the given amount value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function extractAdjustment($amount, SaleableInterface $saleableItem); + + /** + * Apply adjustment amount and return result value + * + * @param float $amount + * @param SaleableInterface $saleableItem + * @return float + */ + public function applyAdjustment($amount, SaleableInterface $saleableItem); + + /** + * Check if adjustment should be excluded from calculations along with the given adjustment + * + * @param string $adjustmentCode + * @return bool + */ + public function isExcludedWith($adjustmentCode); + + /** + * Return sort order position + * + * @return int + */ + public function getSortOrder(); +} diff --git a/lib/Magento/Pricing/Adjustment/Calculator.php b/lib/Magento/Pricing/Adjustment/Calculator.php new file mode 100644 index 0000000000000000000000000000000000000000..bb83b4fad03784de001d42f48ca8d6d0053dd976 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/Calculator.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +use Magento\Pricing\Amount\AmountFactory; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Class Calculator + */ +class Calculator implements CalculatorInterface +{ + /** + * @var AmountFactory + */ + protected $amountFactory; + + /** + * @param AmountFactory $amountFactory + */ + public function __construct(AmountFactory $amountFactory) + { + $this->amountFactory = $amountFactory; + } + + /** + * @param float|string $amount + * @param SaleableInterface $saleableItem + * @param null|bool|string $exclude + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getAmount($amount, SaleableInterface $saleableItem, $exclude = null) + { + $baseAmount = $fullAmount = $amount; + $adjustments = []; + foreach ($saleableItem->getPriceInfo()->getAdjustments() as $adjustment) { + $code = $adjustment->getAdjustmentCode(); + $toExclude = false; + if ($exclude === true || ($exclude !== null && $code === $exclude)) { + $toExclude = true; + } + if ($adjustment->isIncludedInBasePrice()) { + $adjust = $adjustment->extractAdjustment($baseAmount, $saleableItem); + $baseAmount -= $adjust; + if (!$toExclude) { + $adjustments[$code] = $adjust; + } + } elseif ($adjustment->isIncludedInDisplayPrice($saleableItem)) { + if ($toExclude) { + continue; + } + $newAmount = $adjustment->applyAdjustment($fullAmount, $saleableItem); + $adjust = $newAmount - $fullAmount; + $adjustments[$code] = $adjust; + $fullAmount = $newAmount; + } + } + + return $this->amountFactory->create($fullAmount, $adjustments); + } +} diff --git a/lib/Magento/Pricing/Adjustment/CalculatorInterface.php b/lib/Magento/Pricing/Adjustment/CalculatorInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..578dffdbd2074f43d81aec77ea37b2f51d1d2514 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/CalculatorInterface.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * Calculator interface + */ +interface CalculatorInterface +{ + /** + * @param float|string $amount + * @param SaleableInterface $saleableItem + * @param null|bool|string $exclude + * @return \Magento\Pricing\Amount\AmountInterface + */ + public function getAmount($amount, SaleableInterface $saleableItem, $exclude = null); +} diff --git a/lib/Magento/Pricing/Adjustment/Collection.php b/lib/Magento/Pricing/Adjustment/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..7f4f87e75c3718a85a079b563e3a3f4e27f659e3 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/Collection.php @@ -0,0 +1,123 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +use Magento\Pricing\Adjustment\AdjustmentInterface; + +/** + * Adjustment collection model + */ +class Collection +{ + /** + * @var Pool + */ + protected $adjustmentPool; + + /** + * @var string[] + */ + protected $adjustments; + + /** + * @var AdjustmentInterface[] + */ + protected $adjustmentInstances; + + /** + * @param Pool $adjustmentPool + * @param string[] $adjustments + */ + public function __construct( + Pool $adjustmentPool, + array $adjustments + ) { + $this->adjustmentPool = $adjustmentPool; + $this->adjustments = $adjustments; + } + + /** + * @return AdjustmentInterface[] + */ + public function getItems() + { + if ($this->adjustmentInstances === null) { + $this->adjustmentInstances = $this->fetchAdjustments($this->adjustments); + } + return $this->adjustmentInstances; + } + + /** + * Get adjustment by code + * + * @param string $adjustmentCode + * @throws \InvalidArgumentException + * @return AdjustmentInterface + */ + public function getItemByCode($adjustmentCode) + { + if ($this->adjustmentInstances === null) { + $this->adjustmentInstances = $this->fetchAdjustments($this->adjustments); + } + + if (!isset($this->adjustmentInstances[$adjustmentCode])) { + throw new \InvalidArgumentException(sprintf('Price adjustment "%s" is not found', $adjustmentCode)); + } + return $this->adjustmentInstances[$adjustmentCode]; + } + + /** + * @param string[] $adjustments + * @return AdjustmentInterface[] + */ + protected function fetchAdjustments($adjustments) + { + $instances = []; + foreach ($adjustments as $code) { + $instances[$code] = $this->adjustmentPool->getAdjustmentByCode($code); + } + + uasort($instances, [$this, 'sortAdjustments']); + + return $instances; + } + + /** + * Sort adjustments + * + * @param AdjustmentInterface $firstAdjustment + * @param AdjustmentInterface $secondAdjustment + * @return int + */ + protected function sortAdjustments(AdjustmentInterface $firstAdjustment, AdjustmentInterface $secondAdjustment) + { + if ($firstAdjustment->getSortOrder() === \Magento\Pricing\Adjustment\Pool::DEFAULT_SORT_ORDER) { + return 1; + } + return $firstAdjustment->getSortOrder() > $secondAdjustment->getSortOrder() ? 1 : -1; + } +} diff --git a/lib/Magento/Pricing/Adjustment/Factory.php b/lib/Magento/Pricing/Adjustment/Factory.php new file mode 100644 index 0000000000000000000000000000000000000000..17457e57b35e4ac35d921fbc4a98630c4cb95e91 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/Factory.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +/** + * Adjustment factory + */ +class Factory +{ + /** + * Object Manager + * + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * Construct + * + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create shared price adjustment + * + * @param string $className + * @param array $arguments + * @return \Magento\Pricing\Adjustment\AdjustmentInterface + * @throws \InvalidArgumentException + */ + public function create($className, array $arguments = []) + { + $price = $this->objectManager->create($className, $arguments); + if (!$price instanceof AdjustmentInterface) { + throw new \InvalidArgumentException( + $className . ' doesn\'t implement \Magento\Pricing\Adjustment\AdjustmentInterface' + ); + } + return $price; + } +} diff --git a/lib/Magento/Pricing/Adjustment/Pool.php b/lib/Magento/Pricing/Adjustment/Pool.php new file mode 100644 index 0000000000000000000000000000000000000000..bc2b9b77e1f6debc413590276c6d484db5c56b64 --- /dev/null +++ b/lib/Magento/Pricing/Adjustment/Pool.php @@ -0,0 +1,128 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Adjustment; + +use Magento\Pricing\Adjustment\Factory as AdjustmentFactory; +use Magento\Pricing\Adjustment\AdjustmentInterface; + +/** + * Global adjustment pool model + */ +class Pool +{ + /** + * Default adjustment sort order + */ + const DEFAULT_SORT_ORDER = -1; + + /** + * @var AdjustmentFactory + */ + protected $adjustmentFactory; + + /** + * @var array[] + */ + protected $adjustments; + + /** + * @var AdjustmentInterface[] + */ + protected $adjustmentInstances; + + /** + * @param AdjustmentFactory $adjustmentFactory + * @param array[] $adjustments + */ + public function __construct(AdjustmentFactory $adjustmentFactory, $adjustments = []) + { + $this->adjustmentFactory = $adjustmentFactory; + $this->adjustments = $adjustments; + } + + /** + * @return AdjustmentInterface[] + */ + public function getAdjustments() + { + if (!isset($this->adjustmentInstances)) { + $this->adjustmentInstances = $this->createAdjustments(array_keys($this->adjustments)); + } + return $this->adjustmentInstances; + } + + /** + * @param string $adjustmentCode + * @return AdjustmentInterface + * @throws \InvalidArgumentException + */ + public function getAdjustmentByCode($adjustmentCode) + { + if (!isset($this->adjustmentInstances)) { + $this->adjustmentInstances = $this->createAdjustments(array_keys($this->adjustments)); + } + if (!isset($this->adjustmentInstances[$adjustmentCode])) { + throw new \InvalidArgumentException(sprintf('Price adjustment "%s" is not registered', $adjustmentCode)); + } + return $this->adjustmentInstances[$adjustmentCode]; + } + + /** + * Instantiate adjustments + * + * @param string[] $adjustments + * @return AdjustmentInterface[] + */ + protected function createAdjustments($adjustments) + { + $instances = []; + foreach ($adjustments as $code) { + if (!isset($instances[$code])) { + $instances[$code] = $this->createAdjustment($code); + } + } + return $instances; + } + + /** + * Create adjustment by code + * + * @param string $adjustmentCode + * @return AdjustmentInterface + */ + protected function createAdjustment($adjustmentCode) + { + $adjustmentData = $this->adjustments[$adjustmentCode]; + $sortOrder = isset($adjustmentData['sortOrder']) ? (int)$adjustmentData['sortOrder'] : self::DEFAULT_SORT_ORDER; + return $this->adjustmentFactory->create( + $adjustmentData['className'], + [ + 'sortOrder' => $sortOrder + ] + ); + } +} diff --git a/lib/Magento/Pricing/Amount/AmountFactory.php b/lib/Magento/Pricing/Amount/AmountFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..5e0b089aaa5c6f46a81ba9932f719c7dd4e6c493 --- /dev/null +++ b/lib/Magento/Pricing/Amount/AmountFactory.php @@ -0,0 +1,78 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Amount; + +/** + * Class AmountFactory + */ +class AmountFactory +{ + /** + * Default amount class + */ + const DEFAULT_PRICE_AMOUNT_CLASS = 'Magento\Pricing\Amount\AmountInterface'; + + /** + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * Constructor + * + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create Amount object + * + * @param float $amount + * @param array $adjustmentAmounts + * @return \Magento\Pricing\Amount\AmountInterface + * @throws \InvalidArgumentException + */ + public function create($amount, array $adjustmentAmounts = []) + { + $amountModel = $this->objectManager->create( + self::DEFAULT_PRICE_AMOUNT_CLASS, + [ + 'amount' => $amount, + 'adjustmentAmounts' => $adjustmentAmounts + ] + ); + + if (!$amountModel instanceof \Magento\Pricing\Amount\AmountInterface) { + throw new \InvalidArgumentException( + get_class($amountModel) . ' doesn\'t implement \Magento\Pricing\Amount\AmountInterface' + ); + } + + return $amountModel; + } +} diff --git a/lib/Magento/Pricing/Amount/AmountInterface.php b/lib/Magento/Pricing/Amount/AmountInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..d6a5a0731266ce4ff9a35904fc31371752e65573 --- /dev/null +++ b/lib/Magento/Pricing/Amount/AmountInterface.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Amount; + +/** + * Amount interface + */ +interface AmountInterface +{ + /** + * Return full amount value + * + * @param null|string|array $exclude + * @return float + */ + public function getValue($exclude = null); + + /** + * Return full amount value in string format + * + * @return string + */ + public function __toString(); + + /** + * Return base amount part value + * + * @return float + */ + public function getBaseAmount(); + + /** + * Return adjustment amount part value by adjustment code + * + * @param string $adjustmentCode + * @return float + */ + public function getAdjustmentAmount($adjustmentCode); + + /** + * Return sum amount of all applied adjustments + * + * @return float + */ + public function getTotalAdjustmentAmount(); + + /** + * Return all applied adjustments as array + * + * @return float[] + */ + public function getAdjustmentAmounts(); + + /** + * Check if adjustment is contained in amount object + * + * @param string $adjustmentCode + * @return boolean + */ + public function hasAdjustment($adjustmentCode); +} diff --git a/lib/Magento/Pricing/Amount/Base.php b/lib/Magento/Pricing/Amount/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..bd48ae3fae2c758430561f557dd734f45c02b978 --- /dev/null +++ b/lib/Magento/Pricing/Amount/Base.php @@ -0,0 +1,183 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Amount; + +use Magento\Pricing\Adjustment\AdjustmentInterface; + +/** + * Amount base model + */ +class Base implements AmountInterface +{ + /** + * @var float + */ + protected $amount; + + /** + * @var float + */ + protected $baseAmount; + + /** + * @var float + */ + protected $totalAdjustmentAmount; + + /** + * @var float[] + */ + protected $adjustmentAmounts = []; + + /** + * @var AdjustmentInterface[] + */ + protected $adjustments = []; + + /** + * @param float $amount + * @param array $adjustmentAmounts + */ + public function __construct( + $amount, + array $adjustmentAmounts = [] + ) { + $this->amount = $amount; + $this->adjustmentAmounts = $adjustmentAmounts; + } + + /** + * Return full amount value + * + * @param null|string|array $exclude + * @return float + */ + public function getValue($exclude = null) + { + if ($exclude === null) { + return $this->amount; + } else { + if (!is_array($exclude)) { + $exclude = [(string)$exclude]; + } + $amount = $this->amount; + foreach ($exclude as $code) { + if ($this->hasAdjustment($code)) { + $amount -= $this->adjustmentAmounts[$code]; + } + } + return $amount; + } + } + + /** + * Return full amount value in string format + * + * @return string + */ + public function __toString() + { + return (string) $this->getValue(); + } + + /** + * Return base amount part value + * + * @return float|null + */ + public function getBaseAmount() + { + if ($this->baseAmount === null) { + $this->calculateAmounts(); + } + return $this->baseAmount; + } + + /** + * Return adjustment amount part value by adjustment code + * + * @param string $adjustmentCode + * @return bool|float + */ + public function getAdjustmentAmount($adjustmentCode) + { + return isset($this->adjustmentAmounts[$adjustmentCode]) + ? $this->adjustmentAmounts[$adjustmentCode] + : false; + } + + /** + * Return sum amount of all applied adjustments + * + * @return float|null + */ + public function getTotalAdjustmentAmount() + { + if ($this->totalAdjustmentAmount === null) { + $this->calculateAmounts(); + } + return $this->totalAdjustmentAmount; + } + + /** + * Return all applied adjustments as array + * + * @return float[] + */ + public function getAdjustmentAmounts() + { + return $this->adjustmentAmounts; + } + + /** + * Check if adjustment is contained in amount object + * + * @param string $adjustmentCode + * @return bool + */ + public function hasAdjustment($adjustmentCode) + { + return array_key_exists($adjustmentCode, $this->adjustmentAmounts); + } + + /** + * Calculate base amount + * + * @return void + */ + protected function calculateAmounts() + { + $this->baseAmount = $this->amount; + $this->totalAdjustmentAmount = 0.; + if ($this->adjustmentAmounts) { + foreach ($this->adjustmentAmounts as $amount) { + $this->baseAmount -= $amount; + $this->totalAdjustmentAmount += $amount; + } + } + } +} diff --git a/lib/Magento/Pricing/Object/SaleableInterface.php b/lib/Magento/Pricing/Object/SaleableInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..ba2b2b6c4bda104427a4a6608cff6e63eade38e3 --- /dev/null +++ b/lib/Magento/Pricing/Object/SaleableInterface.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Object; + +/** + * //@TODO Templates invoke methods that are not defined in the interface: + * getProductUrl(): + * /app\code\Magento\Catalog\view\frontend\product\price\final_price.phtml + * /app\code\Magento\Catalog\view\frontend\product\price\msrp_item.phtml + * + * getId() - /app\code\Magento\Catalog\view\frontend\product\price\final_price.phtml + * getMsrp() - /app\code\Magento\Catalog\view\frontend\product\price\msrp_item.phtml + */ +interface SaleableInterface +{ + /** + * @return \Magento\Pricing\PriceInfoInterface + */ + public function getPriceInfo(); + + /** + * @return string + */ + public function getTypeId(); + + /** + * @return int + */ + public function getId(); +} diff --git a/lib/Magento/Pricing/Price/Factory.php b/lib/Magento/Pricing/Price/Factory.php new file mode 100644 index 0000000000000000000000000000000000000000..44dd2b47a7e77baf60dd76a353d7c87d56d42136 --- /dev/null +++ b/lib/Magento/Pricing/Price/Factory.php @@ -0,0 +1,73 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Price; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * Price factory + */ +class Factory +{ + /** + * Object Manager + * + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * Construct + * + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Create Price object for particular product + * + * @param SaleableInterface $salableItem + * @param string $className + * @param float $quantity + * @param array $arguments + * @throws \InvalidArgumentException + * @return \Magento\Pricing\Price\PriceInterface + */ + public function create(SaleableInterface $salableItem, $className, $quantity, array $arguments = []) + { + $arguments['salableItem'] = $salableItem; + $arguments['quantity'] = $quantity; + $price = $this->objectManager->create($className, $arguments); + if (!$price instanceof PriceInterface) { + throw new \InvalidArgumentException( + $className . ' doesn\'t implement \Magento\Pricing\Price\PriceInterface' + ); + } + return $price; + } +} diff --git a/lib/Magento/Pricing/Price/PriceInterface.php b/lib/Magento/Pricing/Price/PriceInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..80310a5f7f8fbede5b67e77265b2903b00fda874 --- /dev/null +++ b/lib/Magento/Pricing/Price/PriceInterface.php @@ -0,0 +1,66 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Price; + +use Magento\Pricing\Amount\AmountInterface; + +/** + * Catalog price interface + */ +interface PriceInterface +{ + /** + * Get price type code + * + * @return string + */ + public function getPriceType(); + + /** + * Get price value + * + * @return float + */ + public function getValue(); + + /** + * Get Price Amount object + * + * @return AmountInterface + */ + public function getAmount(); + + /** + * Get Custom Amount object + * (specify adjustment code to exclude) + * + * @param float $amount + * @param null|bool|string $exclude + * @return AmountInterface + */ + public function getCustomAmount($amount = null, $exclude = null); +} diff --git a/lib/Magento/Pricing/PriceComposite.php b/lib/Magento/Pricing/PriceComposite.php new file mode 100644 index 0000000000000000000000000000000000000000..0dc2eb00536e7215010edaec981e60ddcb00ae5b --- /dev/null +++ b/lib/Magento/Pricing/PriceComposite.php @@ -0,0 +1,89 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing; + +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\Factory as PriceFactory; +use Magento\Pricing\Price\PriceInterface; + +/** + * Composite price model + */ +class PriceComposite +{ + /** + * @var PriceFactory + */ + protected $priceFactory; + + /** + * @var array + */ + protected $metadata; + + /** + * @param PriceFactory $priceFactory + * @param array $metadata + */ + public function __construct(PriceFactory $priceFactory, array $metadata = []) + { + $this->priceFactory = $priceFactory; + $this->metadata = $metadata; + } + + /** + * @return array + */ + public function getPriceCodes() + { + return array_keys($this->metadata); + } + + /** + * Returns metadata for prices + * + * @return array + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * @param SaleableInterface $salableItem + * @param string $priceCode + * @param float $quantity + * @return PriceInterface + * @throws \InvalidArgumentException + */ + public function createPriceObject(SaleableInterface $salableItem, $priceCode, $quantity) + { + if (!isset($this->metadata[$priceCode])) { + throw new \InvalidArgumentException($priceCode . ' is not registered in prices list'); + } + $className = $this->metadata[$priceCode]['class']; + return $this->priceFactory->create($salableItem, $className, $quantity); + } +} diff --git a/lib/Magento/Pricing/PriceCurrencyInterface.php b/lib/Magento/Pricing/PriceCurrencyInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..55f100c5f34cec450a401465e861b2f16ee3dd1d --- /dev/null +++ b/lib/Magento/Pricing/PriceCurrencyInterface.php @@ -0,0 +1,84 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing; + +/** + * Interface PriceCurrencyInterface + */ +interface PriceCurrencyInterface +{ + /** + * Default precision + */ + const DEFAULT_PRECISION = 2; + + /** + * Convert price value + * + * @param float $amount + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param \Magento\Directory\Model\Currency|string|null $currency + * @return float + */ + public function convert($amount, $store = null, $currency = null); + + /** + * Format price value + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param \Magento\Directory\Model\Currency|string|null $currency + * @return float + */ + public function format( + $amount, + $includeContainer = true, + $precision = self::DEFAULT_PRECISION, + $store = null, + $currency = null + ); + + /** + * Convert and format price value + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @param null|string|bool|int|\Magento\Store\Model\Store $store + * @param \Magento\Directory\Model\Currency|string|null $currency + * @return string + */ + public function convertAndFormat( + $amount, + $includeContainer = true, + $precision = self::DEFAULT_PRECISION, + $store = null, + $currency = null + ); +} diff --git a/lib/Magento/Pricing/PriceInfo/Base.php b/lib/Magento/Pricing/PriceInfo/Base.php new file mode 100644 index 0000000000000000000000000000000000000000..26ccee9ac424a729fa21d6fa21b928ba4000b375 --- /dev/null +++ b/lib/Magento/Pricing/PriceInfo/Base.php @@ -0,0 +1,184 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\PriceInfo; + +use Magento\Pricing\Amount\AmountFactory; +use Magento\Pricing\PriceInfoInterface; +use Magento\Pricing\PriceComposite; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\Adjustment\Collection; +use Magento\Pricing\Adjustment\AdjustmentInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Price info base model + */ +class Base implements PriceInfoInterface +{ + /** + * @var SaleableInterface + */ + protected $saleableItem; + + /** + * @var PriceComposite + */ + protected $prices; + + /** + * @var PriceInterface[] + */ + protected $priceInstances; + + /** + * @var Collection + */ + protected $adjustmentCollection; + + /** + * @var float + */ + protected $quantity; + + /** + * @var AmountFactory + */ + protected $amountFactory; + + /** + * @param SaleableInterface $saleableItem + * @param PriceComposite $prices + * @param Collection $adjustmentCollection + * @param AmountFactory $amountFactory + * @param float $quantity + */ + public function __construct( + SaleableInterface $saleableItem, + PriceComposite $prices, + Collection $adjustmentCollection, + AmountFactory $amountFactory, + $quantity = self::PRODUCT_QUANTITY_DEFAULT + ) { + $this->saleableItem = $saleableItem; + $this->prices = $prices; + $this->adjustmentCollection = $adjustmentCollection; + $this->amountFactory = $amountFactory; + $this->quantity = $quantity; + } + + /** + * @return PriceInterface[] + */ + public function getPrices() + { + // check if all prices initialized + $this->initPrices(); + return $this->priceInstances; + } + + /** + * Init price types + * + * @return $this + */ + protected function initPrices() + { + $prices = $this->prices->getPriceCodes(); + foreach ($prices as $code) { + if (!isset($this->priceInstances[$code])) { + $this->priceInstances[$code] = $this->prices->createPriceObject( + $this->saleableItem, + $code, + $this->quantity + ); + } + } + return $this; + } + + /** + * @param string $priceCode + * @param float|null $quantity + * @return PriceInterface + */ + public function getPrice($priceCode, $quantity = null) + { + if (!isset($this->priceInstances[$priceCode]) && $quantity === null) { + $this->priceInstances[$priceCode] = $this->prices->createPriceObject( + $this->saleableItem, + $priceCode, + $this->quantity + ); + return $this->priceInstances[$priceCode]; + } elseif (isset($this->priceInstances[$priceCode]) && $quantity === null) { + return $this->priceInstances[$priceCode]; + } else { + return $this->prices->createPriceObject($this->saleableItem, $priceCode, $quantity); + } + } + + /** + * Get all registered adjustments + * + * @return AdjustmentInterface[] + */ + public function getAdjustments() + { + return $this->adjustmentCollection->getItems(); + } + + /** + * Get adjustment by code + * + * @param string $adjustmentCode + * @throws \InvalidArgumentException + * @return AdjustmentInterface + */ + public function getAdjustment($adjustmentCode) + { + return $this->adjustmentCollection->getItemByCode($adjustmentCode); + } + + /** + * Returns prices included in base price + * + * @return array + */ + public function getPricesIncludedInBase() + { + $prices = []; + foreach ($this->prices->getMetadata() as $code => $price) { + if (isset($price['include_in_base_price']) && $price['include_in_base_price']) { + $priceModel = $this->getPrice($code, $this->quantity); + if ($priceModel->getValue() !== false) { + $prices[] = $priceModel; + } + } + } + return $prices; + } +} diff --git a/lib/Magento/Pricing/PriceInfo/Factory.php b/lib/Magento/Pricing/PriceInfo/Factory.php new file mode 100644 index 0000000000000000000000000000000000000000..ee2b1a19c0c7fadd0e3936ef656c2c8a7c5ea90c --- /dev/null +++ b/lib/Magento/Pricing/PriceInfo/Factory.php @@ -0,0 +1,94 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Price Info factory + */ +namespace Magento\Pricing\PriceInfo; + +use Magento\Pricing\Object\SaleableInterface; + +/** + * Price info model factory + */ +class Factory +{ + /** + * Default Price Info class + */ + const DEFAULT_PRICE_INFO_CLASS = 'Magento\Pricing\PriceInfoInterface'; + + /** + * List of Price Info classes by product types + * + * @var array + */ + protected $types = []; + + /** + * Object Manager + * + * @var \Magento\ObjectManager + */ + protected $objectManager; + + /** + * Construct + * + * @param array $types + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(array $types, \Magento\ObjectManager $objectManager) + { + $this->types = $types; + $this->objectManager = $objectManager; + } + + /** + * Create Price Info object for particular product + * + * @param SaleableInterface $saleableItem + * @param array $arguments + * @return \Magento\Pricing\PriceInfoInterface + * @throws \InvalidArgumentException + */ + public function create(SaleableInterface $saleableItem, array $arguments = []) + { + $type = $saleableItem->getTypeId(); + $className = isset($this->types[$type]) ? $this->types[$type] : self::DEFAULT_PRICE_INFO_CLASS; + + $arguments['saleableItem'] = $saleableItem; + if ($saleableItem->getQty()) { + $arguments['quantity'] = $saleableItem->getQty(); + } + $priceInfo = $this->objectManager->create($className, $arguments); + + if (!$priceInfo instanceof \Magento\Pricing\PriceInfoInterface) { + throw new \InvalidArgumentException( + $className . ' doesn\'t implement \Magento\Pricing\PriceInfoInterface' + ); + } + return $priceInfo; + } +} diff --git a/lib/Magento/Pricing/PriceInfoInterface.php b/lib/Magento/Pricing/PriceInfoInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..b68a528019c7ee7603cffe1a6e0663e4ff65fbf6 --- /dev/null +++ b/lib/Magento/Pricing/PriceInfoInterface.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing; + +use Magento\Pricing\Adjustment\AdjustmentInterface; +use Magento\Pricing\Price\PriceInterface; + +/** + * Price info model interface + */ +interface PriceInfoInterface +{ + /** + * Default product quantity + */ + const PRODUCT_QUANTITY_DEFAULT = 1.; + + /** + * @return PriceInterface[] + */ + public function getPrices(); + + /** + * @param string $priceCode + * @param float|null $quantity + * @return PriceInterface + */ + public function getPrice($priceCode, $quantity = null); + + /** + * @return AdjustmentInterface[] + */ + public function getAdjustments(); + + /** + * @param string $adjustmentCode + * @return AdjustmentInterface + */ + public function getAdjustment($adjustmentCode); + + /** + * @return PriceInterface[] + */ + public function getPricesIncludedInBase(); +} diff --git a/lib/Magento/Pricing/Render.php b/lib/Magento/Pricing/Render.php new file mode 100644 index 0000000000000000000000000000000000000000..5198dbefc2c1c4e3b85eb4a717c0fc436ff3ffca --- /dev/null +++ b/lib/Magento/Pricing/Render.php @@ -0,0 +1,162 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Render\Layout; +use Magento\View\Element\Template; +use Magento\View\Element\AbstractBlock; +use Magento\Pricing\Price\PriceInterface; + +/** + * Base price render + * + * @method string getPriceRenderHandle() + */ +class Render extends AbstractBlock +{ + /**@#+ + * Zones where prices displaying can be configured + */ + const ZONE_ITEM_VIEW = 'item_view'; + const ZONE_ITEM_LIST = 'item_list'; + const ZONE_ITEM_OPTION = 'item_option'; + const ZONE_SALES = 'sales'; + const ZONE_EMAIL = 'email'; + const ZONE_DEFAULT = null; + /**@#-*/ + + /** + * Default type renderer + * + * @var string + */ + protected $defaultTypeRender = 'default'; + + /** + * Price layout + * + * @var Layout + */ + protected $priceLayout; + + /** + * Constructor + * + * @param Template\Context $context + * @param Layout $priceLayout + * @param array $data + */ + public function __construct( + Template\Context $context, + Layout $priceLayout, + array $data = [] + ) { + $this->priceLayout = $priceLayout; + parent::__construct($context, $data); + } + + /** + * Prepare layout + * + * @return $this + */ + protected function _prepareLayout() + { + $this->priceLayout->addHandle($this->getPriceRenderHandle()); + $this->priceLayout->loadLayout(); + return parent::_prepareLayout(); + } + + /** + * Render price + * + * @param string $priceCode + * @param SaleableInterface $saleableItem + * @param array $arguments + * @return string + * @throws \InvalidArgumentException + * @throws \RuntimeException + */ + public function render($priceCode, SaleableInterface $saleableItem, array $arguments = []) + { + $useArguments = array_replace($this->_data, $arguments); + + /** @var \Magento\Pricing\Render\RendererPool $rendererPool */ + $rendererPool = $this->priceLayout->getBlock('render.product.prices'); + if (!$rendererPool) { + throw new \RuntimeException('Wrong Price Rendering layout configuration. Factory block is missed'); + } + + // obtain concrete Price Render + $priceRender = $rendererPool->createPriceRender($priceCode, $saleableItem, $useArguments); + if ($priceRender) { + //@TODO PriceBoxRenderInterface does not contain toHtml() method + $result = $priceRender->toHtml(); + } else { + $result = ''; + } + // return rendered output + return $result; + } + + /** + * Render price amount + * + * @param AmountInterface $amount + * @param PriceInterface $price + * @param SaleableInterface $saleableItem + * @param array $arguments + * @return string + * @throws \RuntimeException + */ + public function renderAmount( + AmountInterface $amount, + PriceInterface $price, + SaleableInterface $saleableItem = null, + array $arguments = [] + ) { + $useArguments = array_replace($this->_data, $arguments); + + /** @var \Magento\Pricing\Render\RendererPool $rendererPool */ + $rendererPool = $this->priceLayout->getBlock('render.product.prices'); + if (!$rendererPool) { + throw new \RuntimeException('Wrong Price Rendering layout configuration. Factory block is missed'); + } + + // obtain concrete Amount Render + $amountRender = $rendererPool->createAmountRender($amount, $saleableItem, $price, $useArguments); + if ($amountRender) { + $result = $amountRender->toHtml(); + } else { + $result = ''; + } + // return rendered output + return $result; + } +} diff --git a/lib/Magento/Pricing/Render/AbstractAdjustment.php b/lib/Magento/Pricing/Render/AbstractAdjustment.php new file mode 100644 index 0000000000000000000000000000000000000000..b8d434fe2e338500abe0394bf26057aea50dbf0d --- /dev/null +++ b/lib/Magento/Pricing/Render/AbstractAdjustment.php @@ -0,0 +1,144 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\View\Element\Template; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\PriceCurrencyInterface; + +/** + * Adjustment render abstract + * + * @method string getZone() + */ +abstract class AbstractAdjustment extends Template implements AdjustmentRenderInterface +{ + /** + * @var PriceCurrencyInterface + */ + protected $priceCurrency; + + /** + * @var AmountRenderInterface + */ + protected $amountRender; + + /** + * @param Template\Context $context + * @param PriceCurrencyInterface $priceCurrency + * @param array $data + */ + public function __construct( + Template\Context $context, + PriceCurrencyInterface $priceCurrency, + array $data = [] + ) { + $this->priceCurrency = $priceCurrency; + parent::__construct($context, $data); + } + + /** + * @param AmountRenderInterface $amountRender + * @param array $arguments + * @return void + */ + public function render(AmountRenderInterface $amountRender, array $arguments = []) + { + $this->amountRender = $amountRender; + + $origArguments = $this->getData(); + $this->setData(array_replace($origArguments, $arguments)); + + $this->apply(); + + // restore original block arguments + $this->setData($origArguments); + } + + /** + * @return AmountRenderInterface + */ + public function getAmountRender() + { + return $this->amountRender; + } + + /** + * @param string $priceCode + * @return PriceInterface + */ + public function getPriceType($priceCode) + { + return $this->getSaleableItem()->getPriceInfo()->getPrice($priceCode); + } + + /** + * @return \Magento\Pricing\Price\PriceInterface + */ + public function getPrice() + { + return $this->amountRender->getPrice(); + } + + /** + * @return SaleableInterface + */ + public function getSaleableItem() + { + return $this->amountRender->getSaleableItem(); + } + + /** + * Convert and format price value + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @return string + */ + public function convertAndFormatCurrency( + $amount, + $includeContainer = true, + $precision = PriceCurrencyInterface::DEFAULT_PRECISION + ) { + return $this->priceCurrency->convertAndFormat($amount, $includeContainer, $precision); + } + + /** + * @return \Magento\Pricing\Adjustment\AdjustmentInterface + */ + public function getAdjustment() + { + return $this->getSaleableItem()->getPriceInfo()->getAdjustment($this->getAdjustmentCode()); + } + + /** + * @return void + */ + abstract protected function apply(); +} diff --git a/lib/Magento/Pricing/Render/AdjustmentRenderInterface.php b/lib/Magento/Pricing/Render/AdjustmentRenderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..310b1d67d2544fb7715c373992eb9df10e8893d8 --- /dev/null +++ b/lib/Magento/Pricing/Render/AdjustmentRenderInterface.php @@ -0,0 +1,81 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Adjustment render interface + */ +interface AdjustmentRenderInterface +{ + /** + * @param AmountRenderInterface $amountRender + * @param array $arguments + * @return string + */ + public function render(AmountRenderInterface $amountRender, array $arguments = []); + + /** + * @return string + */ + public function getAdjustmentCode(); + + /** + * @return array + */ + public function getData(); + + /** + * (to use in templates only) + * + * @return AmountRenderInterface + */ + public function getAmountRender(); + + /** + * (to use in templates only) + * + * @return PriceInterface + */ + public function getPrice(); + + /** + * (to use in templates only) + * + * @return SaleableInterface + */ + public function getSaleableItem(); + + /** + * (to use in templates only) + * + * @return \Magento\Pricing\Adjustment\AdjustmentInterface + */ + public function getAdjustment(); +} diff --git a/lib/Magento/Pricing/Render/Amount.php b/lib/Magento/Pricing/Render/Amount.php new file mode 100644 index 0000000000000000000000000000000000000000..9981aae99c4c3289fdbaafd50ef357ce29fd51c9 --- /dev/null +++ b/lib/Magento/Pricing/Render/Amount.php @@ -0,0 +1,259 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\View\Element\Template; +use Magento\Pricing\PriceCurrencyInterface; + +/** + * Price amount renderer + * + * @method string getAdjustmentCssClasses() + * @method string getDisplayLabel() + * @method string getPriceId() + * @method bool getIncludeContainer() + * @method bool getSkipAdjustments() + */ +class Amount extends Template implements AmountRenderInterface +{ + /** + * @var SaleableInterface + */ + protected $saleableItem; + + /** + * @var PriceInterface + */ + protected $price; + + /** + * @var AdjustmentRenderInterface[] + */ + protected $adjustmentRenders; + + /** + * @var PriceCurrencyInterface + */ + protected $priceCurrency; + + /** + * @var RendererPool + */ + protected $rendererPool; + + /** + * @var float + */ + protected $amount; + + /** + * @var null|float + */ + protected $displayValue; + + /** + * @var string[] + */ + protected $adjustmentsHtml = []; + + /** + * @param Template\Context $context + * @param AmountInterface $amount + * @param PriceCurrencyInterface $priceCurrency + * @param RendererPool $rendererPool + * @param SaleableInterface $saleableItem + * @param \Magento\Pricing\Price\PriceInterface $price + * @param array $data + */ + public function __construct( + Template\Context $context, + AmountInterface $amount, + PriceCurrencyInterface $priceCurrency, + RendererPool $rendererPool, + SaleableInterface $saleableItem = null, + PriceInterface $price = null, + array $data = [] + ) { + parent::__construct($context, $data); + $this->amount = $amount; + $this->saleableItem = $saleableItem; + $this->price = $price; + $this->priceCurrency = $priceCurrency; + $this->rendererPool = $rendererPool; + } + + /** + * @param float $value + * @return void + */ + public function setDisplayValue($value) + { + $this->displayValue = $value; + } + + /** + * @return float + */ + public function getDisplayValue() + { + if ($this->displayValue !== null) { + return $this->displayValue; + } else { + return $this->getAmount()->getValue(); + } + } + + /** + * @return AmountInterface + */ + public function getAmount() + { + return $this->amount; + } + + /** + * @return SaleableInterface + */ + public function getSaleableItem() + { + return $this->saleableItem; + } + + /** + * @return \Magento\Pricing\Price\PriceInterface + */ + public function getPrice() + { + return $this->price; + } + + /** + * @param string $code + * @param string $html + * @return void + */ + public function addAdjustmentHtml($code, $html) + { + $this->adjustmentsHtml[$code] = $html; + } + + /** + * @return bool + */ + public function hasAdjustmentsHtml() + { + return (bool) count($this->adjustmentsHtml); + } + + /** + * @return string + */ + public function getAdjustmentsHtml() + { + return implode('', $this->adjustmentsHtml); + } + + /** + * @return string + */ + protected function _toHtml() + { + // apply Price Adjustment Renders if available + $adjustmentRenders = $this->getApplicableAdjustmentRenders(); + if ($adjustmentRenders) { + $this->applyAdjustments($adjustmentRenders); + } + $html = parent::_toHtml(); + return $html; + } + + /** + * Collect correspondent Price Adjustment Renders + * + * @return AdjustmentRenderInterface[] + */ + protected function getApplicableAdjustmentRenders() + { + if (!$this->hasSkipAdjustments()) { + return $this->getAdjustmentRenders(); + } else { + return []; + } + } + + /** + * @return AdjustmentRenderInterface[] + */ + protected function getAdjustmentRenders() + { + return $this->rendererPool->getAdjustmentRenders($this->saleableItem, $this->price); + } + + /** + * @param AdjustmentRenderInterface[] $adjustmentRenders + * @return void + */ + protected function applyAdjustments($adjustmentRenders) + { + $this->setAdjustmentCssClasses($adjustmentRenders); + $data = $this->getData(); + foreach ($adjustmentRenders as $adjustmentRender) { + $adjustmentRender->render($this, $data); + } + } + + /** + * Convert and format price value + * + * @param float $amount + * @param bool $includeContainer + * @param int $precision + * @return float + */ + public function convertAndFormatCurrency( + $amount, + $includeContainer = true, + $precision = PriceCurrencyInterface::DEFAULT_PRECISION + ) { + return $this->priceCurrency->convertAndFormat($amount, $includeContainer, $precision); + } + + /** + * @param AdjustmentRenderInterface[] $adjustmentRenders + * @return array + */ + protected function setAdjustmentCssClasses($adjustmentRenders) + { + $cssClasses = $this->hasData('css_classes') ? explode(' ', $this->getData('css_classes')) : []; + $cssClasses = array_merge($cssClasses, array_keys($adjustmentRenders)); + $this->setData('adjustment_css_classes', join(' ', $cssClasses)); + return $this; + } +} diff --git a/lib/Magento/Pricing/Render/AmountRenderInterface.php b/lib/Magento/Pricing/Render/AmountRenderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..51d0777cc25e955e234c6a7ac9359e219485c9be --- /dev/null +++ b/lib/Magento/Pricing/Render/AmountRenderInterface.php @@ -0,0 +1,79 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Price amount renderer interface + */ +interface AmountRenderInterface +{ + /** + * Enforce custom display price value + * + * @param float $value + * @return void + */ + public function setDisplayValue($value); + + /** + * @return float + */ + public function getDisplayValue(); + + /** + * Retrieve amount object + * + * @return AmountInterface + */ + public function getAmount(); + + /** + * @return SaleableInterface + */ + public function getSaleableItem(); + + /** + * @return PriceInterface + */ + public function getPrice(); + + /** + * @param string $code + * @param string $html + * @return void + */ + public function addAdjustmentHtml($code, $html); + + /** + * @return string + */ + public function getAdjustmentsHtml(); +} diff --git a/lib/Magento/Pricing/Render/Layout.php b/lib/Magento/Pricing/Render/Layout.php new file mode 100644 index 0000000000000000000000000000000000000000..7b2121d830647715443d94891d1713ff4ea7e8dc --- /dev/null +++ b/lib/Magento/Pricing/Render/Layout.php @@ -0,0 +1,90 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\View\LayoutFactory; +use Magento\View\LayoutInterface; + +/** + * Pricing render's layout model + */ +class Layout +{ + /** + * Layout Interface + * + * @var LayoutInterface + */ + protected $layout; + + /** + * Constructor + * + * @param LayoutFactory $layoutFactory + * @param LayoutInterface $generalLayout + */ + public function __construct( + LayoutFactory $layoutFactory, + \Magento\View\LayoutInterface $generalLayout + ) { + $this->layout = $layoutFactory->create(['cacheable' => $generalLayout->isCacheable()]); + } + + /** + * Add handle(s) to layout + * + * @param string|string[] $handle + * @return void + */ + public function addHandle($handle) + { + $this->layout->getUpdate()->addHandle($handle); + } + + /** + * Load layout + * + * @return void + */ + public function loadLayout() + { + $this->layout->getUpdate()->load(); + $this->layout->generateXml(); + $this->layout->generateElements(); + } + + /** + * Obtain block object + * + * @param string $name + * @return \Magento\View\Element\AbstractBlock + */ + public function getBlock($name) + { + return $this->layout->getBlock($name); + } +} diff --git a/lib/Magento/Pricing/Render/PriceBox.php b/lib/Magento/Pricing/Render/PriceBox.php new file mode 100644 index 0000000000000000000000000000000000000000..afd0b178bbc4104afdb39c8ca88b8166711076f3 --- /dev/null +++ b/lib/Magento/Pricing/Render/PriceBox.php @@ -0,0 +1,180 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\View\Element\Template; + +/** + * Default price box renderer + * + * @method bool hasListClass() + * @method string getListClass() + */ +class PriceBox extends Template implements PriceBoxRenderInterface +{ + /** + * @var SaleableInterface + */ + protected $saleableItem; + + /** + * @var PriceInterface + */ + protected $price; + + /** + * @var RendererPool + */ + protected $rendererPool; + + /** + * @param Template\Context $context + * @param SaleableInterface $saleableItem + * @param PriceInterface $price + * @param RendererPool $rendererPool + * @param array $data + */ + public function __construct( + Template\Context $context, + SaleableInterface $saleableItem, + PriceInterface $price, + RendererPool $rendererPool, + array $data = [] + ) { + $this->saleableItem = $saleableItem; + $this->price = $price; + $this->rendererPool = $rendererPool; + parent::__construct($context, $data); + } + + /** + * @return string + */ + protected function _toHtml() + { + $cssClasses = $this->hasData('css_classes') ? explode(' ', $this->getData('css_classes')) : []; + $cssClasses[] = 'price-' . $this->getPrice()->getPriceType(); + $this->setData('css_classes', implode(' ', $cssClasses)); + return parent::_toHtml(); + } + + /** + * @return SaleableInterface + */ + public function getSaleableItem() + { + // @todo move to abstract pricing block + return $this->saleableItem; + } + + /** + * @return PriceInterface + */ + public function getPrice() + { + // @todo move to abstract pricing block + return $this->price; + } + + /** + * Get price id + * + * @param null|string $defaultPrefix + * @param null|string $defaultSuffix + * @return string + */ + public function getPriceId($defaultPrefix = null, $defaultSuffix = null) + { + if ($this->hasData('price_id')) { + return $this->getData('price_id'); + } + $priceId = $this->saleableItem->getId(); + if ($this->hasData('price_id_prefix')) { + $prefix = $this->getData('price_id_prefix') . $priceId; + } else { + $prefix = $defaultPrefix; + } + if ($this->hasData('price_id_suffix')) { + $suffix = $this->getData('price_id_suffix'); + } else { + $suffix = $defaultSuffix; + } + $priceId = $prefix . $priceId . $suffix; + return $priceId; + } + + /** + * Retrieve price object of given type and quantity + * + * @param string $priceCode + * @param float|null $quantity + * @return PriceInterface + */ + public function getPriceType($priceCode, $quantity = null) + { + return $this->saleableItem->getPriceInfo()->getPrice($priceCode, $quantity); + } + + /** + * @param AmountInterface $amount + * @param array $arguments + * @return string + */ + public function renderAmount(AmountInterface $amount, array $arguments = []) + { + $arguments = array_replace($this->getData(), $arguments); + + //@TODO AmountInterface does not contain toHtml() method + return $this->getAmountRender($amount, $arguments)->toHtml(); + } + + /** + * @param AmountInterface $amount + * @param array $arguments + * @return AmountRenderInterface + */ + protected function getAmountRender(AmountInterface $amount, array $arguments = []) + { + return $this->rendererPool->createAmountRender( + $amount, + $this->getSaleableItem(), + $this->getPrice(), + $arguments + ); + } + + /** + * @return RendererPool + */ + public function getRendererPool() + { + return $this->rendererPool; + } +} diff --git a/lib/Magento/Pricing/Render/PriceBoxRenderInterface.php b/lib/Magento/Pricing/Render/PriceBoxRenderInterface.php new file mode 100644 index 0000000000000000000000000000000000000000..be1fb2c5154453d4cfa8732014dcd79041a33751 --- /dev/null +++ b/lib/Magento/Pricing/Render/PriceBoxRenderInterface.php @@ -0,0 +1,60 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Pricing + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Pricing\Render; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\Pricing\Object\SaleableInterface; + +/** + * Price box render interface + */ +interface PriceBoxRenderInterface +{ + /** + * @return SaleableInterface + */ + public function getSaleableItem(); + + /** + * Retrieve price object + * (to use in templates only) + * + * @return PriceInterface + */ + public function getPrice(); + + /** + * Retrieve amount html for given price and arguments + * (to use in templates only) + * + * @param AmountInterface $price + * @param array $arguments + * @return string + */ + public function renderAmount(AmountInterface $price, array $arguments = []); +} diff --git a/lib/Magento/Pricing/Render/RendererPool.php b/lib/Magento/Pricing/Render/RendererPool.php new file mode 100644 index 0000000000000000000000000000000000000000..e2bd2f945608bcfde700b115b76db32f493588b5 --- /dev/null +++ b/lib/Magento/Pricing/Render/RendererPool.php @@ -0,0 +1,257 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Pricing\Render; + +use Magento\Pricing\Amount\AmountInterface; +use Magento\Pricing\Object\SaleableInterface; +use Magento\Pricing\Price\PriceInterface; +use Magento\View\Element\AbstractBlock; + +/** + * RenderPool + */ +class RendererPool extends AbstractBlock +{ + /** + * Default price group type + */ + const DEFAULT_PRICE_GROUP_TYPE = 'default'; + + /** + * Default price renderer + */ + const PRICE_RENDERER_DEFAULT = 'Magento\Pricing\Render\PriceBox'; + + /** + * Default amount renderer + */ + const AMOUNT_RENDERER_DEFAULT = 'Magento\Pricing\Render\Amount'; + + /** + * Create amount renderer + * + * @param string $priceCode + * @param SaleableInterface $saleableItem + * @param array $data + * @throws \InvalidArgumentException + * @return PriceBoxRenderInterface + */ + public function createPriceRender( + $priceCode, + SaleableInterface $saleableItem, + array $data = [] + ) { + $type = $saleableItem->getTypeId(); + + // implement class resolving fallback + $pattern = [ + $type . '/prices/' . $priceCode . '/render_class', + $type . '/default_render_class', + 'default/prices/' . $priceCode . '/render_class', + 'default/default_render_class' + ]; + $renderClassName = $this->findDataByPattern($pattern); + if (!$renderClassName) { + throw new \InvalidArgumentException( + 'Class name for price code "' . $priceCode . '" not registered' + ); + } + + $price = $saleableItem->getPriceInfo()->getPrice($priceCode); + if (!$price) { + throw new \InvalidArgumentException( + 'Price model for price code "' . $priceCode . '" not registered' + ); + } + + $arguments['data'] = $data; + $arguments['rendererPool'] = $this; + $arguments['price'] = $price; + $arguments['saleableItem'] = $saleableItem; + + /** @var \Magento\View\Element\Template $renderBlock */ + $renderBlock = $this->getLayout()->createBlock($renderClassName, '', $arguments); + if (!$renderBlock instanceof PriceBoxRenderInterface) { + throw new \InvalidArgumentException( + 'Block "' . $renderClassName . '" must implement \Magento\Pricing\Render\PriceBoxRenderInterface' + ); + } + $renderBlock->setTemplate($this->getRenderBlockTemplate($type, $priceCode)); + return $renderBlock; + } + + /** + * Create amount renderer + * + * @param AmountInterface $amount + * @param SaleableInterface $saleableItem + * @param PriceInterface $price + * @param array $data + * @return AmountRenderInterface + * @throws \InvalidArgumentException + */ + public function createAmountRender( + AmountInterface $amount, + SaleableInterface $saleableItem = null, + PriceInterface $price = null, + array $data = [] + ) { + $type = self::DEFAULT_PRICE_GROUP_TYPE; + if ($saleableItem) { + $type = $saleableItem->getTypeId(); + } + + $priceCode = null; + $renderClassName = self::AMOUNT_RENDERER_DEFAULT; + + if ($price) { + $priceCode = $price->getPriceType(); + // implement class resolving fallback + $pattern = [ + $type . '/prices/' . $priceCode . '/amount_render_class', + $type . '/default_amount_render_class', + 'default/prices/' . $priceCode . '/amount_render_class', + 'default/default_amount_render_class' + ]; + $renderClassName = $this->findDataByPattern($pattern); + if (!$renderClassName) { + throw new \InvalidArgumentException( + 'There is no amount render class for price code "' . $priceCode . '"' + ); + } + } + + $arguments['data'] = $data; + $arguments['rendererPool'] = $this; + $arguments['amount'] = $amount; + + if ($saleableItem) { + $arguments['saleableItem'] = $saleableItem; + if ($price) { + $arguments['price'] = $price; + } + } + + /** @var \Magento\View\Element\Template $amountBlock */ + $amountBlock = $this->getLayout()->createBlock($renderClassName, '', $arguments); + if (!$amountBlock instanceof AmountRenderInterface) { + throw new \InvalidArgumentException( + 'Block "' . $renderClassName . '" must implement \Magento\Pricing\Render\AmountRenderInterface' + ); + } + $amountBlock->setTemplate($this->getAmountRenderBlockTemplate($type, $priceCode)); + return $amountBlock; + } + + /** + * @param SaleableInterface $saleableItem + * @param PriceInterface $price + * @return array + */ + public function getAdjustmentRenders(SaleableInterface $saleableItem = null, PriceInterface $price = null) + { + $itemType = is_null($saleableItem) ? 'default' : $saleableItem->getTypeId(); + $priceType = is_null($price) ? 'default' : $price->getPriceType(); + + $fallbackPattern = [ + "{$itemType}/adjustments/{$priceType}", + "{$itemType}/adjustments/default", + "default/adjustments/{$priceType}", + "default/adjustments/default" + ]; + $renders = $this->findDataByPattern($fallbackPattern); + if ($renders) { + foreach ($renders as $code => $configuration) { + /** @var \Magento\View\Element\Template $render */ + $render = $this->getLayout()->createBlock($configuration['adjustment_render_class']); + $render->setTemplate($configuration['adjustment_render_template']); + $renders[$code] = $render; + } + } + + return $renders; + } + + /** + * @param string $type + * @param string $priceCode + * @return string + * @throws \InvalidArgumentException + */ + protected function getAmountRenderBlockTemplate($type, $priceCode) + { + $pattern = [ + $type . '/prices/' . $priceCode . '/amount_render_template', + $type . '/default_amount_render_template', + 'default/prices/' . $priceCode . '/amount_render_template', + 'default/default_amount_render_template' + ]; + $template = $this->findDataByPattern($pattern); + if (!$template) { + throw new \InvalidArgumentException( + 'For type "'. $type . '" amount render block not configured' + ); + } + return $template; + } + + /** + * @param string $type + * @param string $priceCode + * @return string + * @throws \InvalidArgumentException + */ + protected function getRenderBlockTemplate($type, $priceCode) + { + $pattern = [ + $type . '/prices/' . $priceCode . '/render_template', + $type . '/default_render_template', + 'default/prices/' . $priceCode . '/render_template', + 'default/default_render_template' + ]; + $template = $this->findDataByPattern($pattern); + if (!$template) { + throw new \InvalidArgumentException( + 'Price code "' . $priceCode . '" render block not configured' + ); + } + return $template; + } + + /** + * @param array $pattern + * @return null|string + */ + protected function findDataByPattern(array $pattern) + { + $data = null; + foreach ($pattern as $key) { + $data = $this->getData($key); + if ($data) { + break; + } + } + return $data; + } +} diff --git a/lib/Magento/Service/V1/Data/Search/FilterGroup.php b/lib/Magento/Service/V1/Data/Search/FilterGroup.php new file mode 100644 index 0000000000000000000000000000000000000000..2c0518981a3093ba13ee1eb57603140ef103d840 --- /dev/null +++ b/lib/Magento/Service/V1/Data/Search/FilterGroup.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Service\V1\Data\Search; + +use Magento\Service\Data\AbstractObject; + +/** + * Groups two or more filters together using a logical OR + */ +class FilterGroup extends AbstractObject +{ + const FILTERS = 'filters'; + + /** + * Returns a list of filters in this group + * + * @return \Magento\Service\V1\Data\Filter[]|null + */ + public function getFilters() + { + $filters = $this->_get(self::FILTERS); + return is_null($filters) ? [] : $filters; + } +} diff --git a/lib/Magento/Service/V1/Data/Search/FilterGroupBuilder.php b/lib/Magento/Service/V1/Data/Search/FilterGroupBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..5682443be82a037a984cfad9f6f1e70bc6175dfb --- /dev/null +++ b/lib/Magento/Service/V1/Data/Search/FilterGroupBuilder.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Service\V1\Data\Search; + +use Magento\Service\Data\AbstractObjectBuilder; +use Magento\Service\V1\Data\FilterBuilder; + +/** + * Builder for FilterGroup Data. + */ +class FilterGroupBuilder extends AbstractObjectBuilder +{ + /** + * @var FilterBuilder + */ + protected $_filterBuilder; + + /** + * Constructor + * + * @param FilterBuilder $filterBuilder + */ + public function __construct(FilterBuilder $filterBuilder) + { + parent::__construct(); + $this->_filterBuilder = $filterBuilder; + } + + /** + * Add filter + * + * @param \Magento\Service\V1\Data\Filter $filter + * @return $this + */ + public function addFilter(\Magento\Service\V1\Data\Filter $filter) + { + $this->_data[FilterGroup::FILTERS][] = $filter; + return $this; + } + + /** + * Set filters + * + * @param \Magento\Service\V1\Data\Filter[] $filters + * @return $this + */ + public function setFilters($filters) + { + return $this->_set(FilterGroup::FILTERS, $filters); + } + + /** + * {@inheritdoc} + */ + protected function _setDataValues(array $data) + { + if (isset($data[FilterGroup::FILTERS])) { + $filters = []; + foreach ($data[FilterGroup::FILTERS] as $filter) { + $filters[] = $this->_filterBuilder->populateWithArray($filter)->create(); + } + $data[FilterGroup::FILTERS] = $filters; + } + return parent::_setDataValues($data); + } +} diff --git a/app/code/Magento/Customer/Service/V1/Data/SearchCriteria.php b/lib/Magento/Service/V1/Data/SearchCriteria.php similarity index 71% rename from app/code/Magento/Customer/Service/V1/Data/SearchCriteria.php rename to lib/Magento/Service/V1/Data/SearchCriteria.php index fc0ed4ebb03218ca7f1a6e00f2e717e32e4b2a3b..d9717ad7897452cdea0dd77fbf0dff097df95f2b 100644 --- a/app/code/Magento/Customer/Service/V1/Data/SearchCriteria.php +++ b/lib/Magento/Service/V1/Data/SearchCriteria.php @@ -21,7 +21,8 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Customer\Service\V1\Data; + +namespace Magento\Service\V1\Data; use Magento\Service\Data\AbstractObject; @@ -31,18 +32,24 @@ use Magento\Service\Data\AbstractObject; class SearchCriteria extends AbstractObject { const SORT_ASC = 1; - const SORT_DESC = -1; - const ROOT_GROUP_TYPE = 'andGroup'; + + /**#@+ + * Constants for Data Object keys + */ + const FILTER_GROUPS = 'filterGroups'; + const SORT_ORDERS = 'sort_orders'; + const PAGE_SIZE = 'page_size'; + const CURRENT_PAGE = 'current_page'; /** - * Get filters - * - * @return \Magento\Customer\Service\V1\Data\Search\AndGroup + * Returns a list of filter groups + * + * @return \Magento\Service\V1\Data\Search\FilterGroup[] */ - public function getAndGroup() + public function getFilterGroups() { - return $this->_get(self::ROOT_GROUP_TYPE); + return $this->_get(self::FILTER_GROUPS); } /** @@ -52,7 +59,7 @@ class SearchCriteria extends AbstractObject */ public function getSortOrders() { - return $this->_get('sort_orders'); + return $this->_get(self::SORT_ORDERS); } /** @@ -62,7 +69,7 @@ class SearchCriteria extends AbstractObject */ public function getPageSize() { - return $this->_get('page_size'); + return $this->_get(self::PAGE_SIZE); } /** @@ -72,6 +79,6 @@ class SearchCriteria extends AbstractObject */ public function getCurrentPage() { - return $this->_get('current_page'); + return $this->_get(self::CURRENT_PAGE); } } diff --git a/app/code/Magento/Customer/Service/V1/Data/SearchCriteriaBuilder.php b/lib/Magento/Service/V1/Data/SearchCriteriaBuilder.php similarity index 57% rename from app/code/Magento/Customer/Service/V1/Data/SearchCriteriaBuilder.php rename to lib/Magento/Service/V1/Data/SearchCriteriaBuilder.php index 911e188e06ee74e680b1ac6a51823e64c7394922..a21854f47377c18168f6a6a819880722ba2d2cb8 100644 --- a/app/code/Magento/Customer/Service/V1/Data/SearchCriteriaBuilder.php +++ b/lib/Magento/Service/V1/Data/SearchCriteriaBuilder.php @@ -21,11 +21,11 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Customer\Service\V1\Data; -use Magento\Customer\Service\V1\Data\Search\OrGroupBuilder; +namespace Magento\Service\V1\Data; + use Magento\Service\Data\AbstractObjectBuilder; -use Magento\Service\V1\Data\FilterBuilder; +use Magento\Service\V1\Data\Search\FilterGroupBuilder; /** * Builder for SearchCriteria Service Data Object @@ -33,19 +33,19 @@ use Magento\Service\V1\Data\FilterBuilder; class SearchCriteriaBuilder extends AbstractObjectBuilder { /** - * @var Search\AndGroupBuilder + * @var FilterGroupBuilder */ - protected $_andGroupBuilder; + protected $_filterGroupBuilder; /** * Constructor * - * @param Search\AndGroupBuilder $andGroupBuilder + * @param FilterGroupBuilder $filterGroupBuilder */ - public function __construct(Search\AndGroupBuilder $andGroupBuilder) + public function __construct(FilterGroupBuilder $filterGroupBuilder) { parent::__construct(); - $this->_andGroupBuilder = $andGroupBuilder; + $this->_filterGroupBuilder = $filterGroupBuilder; } /** @@ -55,65 +55,62 @@ class SearchCriteriaBuilder extends AbstractObjectBuilder */ public function create() { - $this->_set(SearchCriteria::ROOT_GROUP_TYPE, $this->_andGroupBuilder->create()); + //Initialize with empty array if not set + if (empty($this->_data[SearchCriteria::FILTER_GROUPS])) { + $this->_set(SearchCriteria::FILTER_GROUPS, []); + } return parent::create(); } /** - * Add filter + * Create a filter group based on the filter array provided and add to the filter groups * - * @param \Magento\Service\V1\Data\Filter $filter + * @param \Magento\Service\V1\Data\Filter[] $filter * @return $this */ - public function addFilter(\Magento\Service\V1\Data\Filter $filter) + public function addFilter(array $filter) { - $this->_andGroupBuilder->addFilter($filter); + $this->_data[SearchCriteria::FILTER_GROUPS][] = $this->_filterGroupBuilder->setFilters($filter)->create(); return $this; } /** - * Set filters + * Set filter groups * - * @param \Magento\Customer\Service\V1\Data\Search\AndGroup $filterGroup + * @param \Magento\Service\V1\Data\Search\FilterGroup[] $filterGroups * @return $this */ - public function setAndGroup($filterGroup) + public function setFilterGroups(array $filterGroups) { - $this->_andGroupBuilder->populate($filterGroup); - return $this; + return $this->_set(SearchCriteria::FILTER_GROUPS, $filterGroups); } /** - * Add an OR grouping of filters to this SearchCriteria. + * Add sort order * - * @param \Magento\Service\V1\Data\Filter[] $filters + * @param string $field + * @param int $direction * @return $this */ - public function addOrGroup($filters) + public function addSortOrder($field, $direction) { - $orGroup = new OrGroupBuilder(new FilterBuilder()); - foreach ($filters as $filter) { - $orGroup->addFilter($filter); + if (!isset($this->_data[SearchCriteria::SORT_ORDERS])) { + $this->_data[SearchCriteria::SORT_ORDERS] = array(); } - $this->_andGroupBuilder->addOrGroup($orGroup->create()); + + $this->_data[SearchCriteria::SORT_ORDERS][$field] = $direction; return $this; } /** - * Add sort order + * Set sort orders * - * @param string $field - * @param int $direction + * @param array $sortOrders * @return $this */ - public function addSortOrder($field, $direction) + public function setSortOrders(array $sortOrders) { - if (!isset($this->_data['sort_orders'])) { - $this->_data['sort_orders'] = array(); - } - - $this->_data['sort_orders'][$field] = $direction; - return $this; + return $this->_set(SearchCriteria::SORT_ORDERS, $sortOrders); } /** @@ -124,7 +121,7 @@ class SearchCriteriaBuilder extends AbstractObjectBuilder */ public function setPageSize($pageSize) { - return $this->_set('page_size', $pageSize); + return $this->_set(SearchCriteria::PAGE_SIZE, $pageSize); } /** @@ -135,6 +132,6 @@ class SearchCriteriaBuilder extends AbstractObjectBuilder */ public function setCurrentPage($currentPage) { - return $this->_set('current_page', $currentPage); + return $this->_set(SearchCriteria::CURRENT_PAGE, $currentPage); } } diff --git a/lib/Magento/Session/Config.php b/lib/Magento/Session/Config.php index 457aefc2a1f3f443d5ce8e5c461927d9cd4891b5..0d20bc736a73e53aac16e6b510fbd2e594a4254d 100644 --- a/lib/Magento/Session/Config.php +++ b/lib/Magento/Session/Config.php @@ -82,7 +82,7 @@ class Config implements ConfigInterface protected $options = array(); /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -92,7 +92,7 @@ class Config implements ConfigInterface protected $_stringHelper; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_httpRequest; @@ -109,12 +109,12 @@ class Config implements ConfigInterface ); /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -124,26 +124,28 @@ class Config implements ConfigInterface protected $_scopeType; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Stdlib\String $stringHelper - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\State $appState - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $scopeType * @param string $saveMethod * @param null|string $savePath * @param null|string $cacheLimiter + * @param string $lifetimePath */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Stdlib\String $stringHelper, - \Magento\App\RequestInterface $request, - \Magento\App\State $appState, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\Filesystem $filesystem, $scopeType, $saveMethod = \Magento\Session\SaveHandlerInterface::DEFAULT_HANDLER, $savePath = null, - $cacheLimiter = null + $cacheLimiter = null, + $lifetimePath = self::XML_PATH_COOKIE_LIFETIME ) { $this->_scopeConfig = $scopeConfig; $this->_stringHelper = $stringHelper; diff --git a/lib/Magento/Session/Generic.php b/lib/Magento/Session/Generic.php index 1ef191c18f4bbc907b1b9f2554407cd627977961..ed16f08c91e578a9d31df7d3732cedf79fdbada8 100644 --- a/lib/Magento/Session/Generic.php +++ b/lib/Magento/Session/Generic.php @@ -28,7 +28,7 @@ class Generic extends SessionManager /** * Constructor * - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param SidResolverInterface $sidResolver * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param SaveHandlerInterface $saveHandler @@ -37,7 +37,7 @@ class Generic extends SessionManager * @param null $sessionName */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, SidResolverInterface $sidResolver, \Magento\Session\Config\ConfigInterface $sessionConfig, SaveHandlerInterface $saveHandler, diff --git a/lib/Magento/Session/SaveHandler/DbTable.php b/lib/Magento/Session/SaveHandler/DbTable.php index 48f444f1fd39ea8b8911a9c03455f4338041404a..222ec053ea86bcfc0ce11032d6af1a7f888b8674 100644 --- a/lib/Magento/Session/SaveHandler/DbTable.php +++ b/lib/Magento/Session/SaveHandler/DbTable.php @@ -45,9 +45,9 @@ class DbTable extends \SessionHandler /** * Constructor * - * @param \Magento\App\Resource $resource + * @param \Magento\Framework\App\Resource $resource */ - public function __construct(\Magento\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource) { $this->_sessionTable = $resource->getTableName('core_session'); $this->_write = $resource->getConnection('core_write'); diff --git a/lib/Magento/Session/SessionManager.php b/lib/Magento/Session/SessionManager.php index 4fa10cdff90293a745b981bcc1bac5cd796f0799..1ff805f09f512f05a8a4c077b7e0cf04ec8d5da7 100644 --- a/lib/Magento/Session/SessionManager.php +++ b/lib/Magento/Session/SessionManager.php @@ -58,7 +58,7 @@ class SessionManager implements SessionManagerInterface /** * Request * - * @var \Magento\App\Request\Http + * @var \Magento\Framework\App\Request\Http */ protected $request; @@ -93,7 +93,7 @@ class SessionManager implements SessionManagerInterface /** * Constructor * - * @param \Magento\App\Request\Http $request + * @param \Magento\Framework\App\Request\Http $request * @param SidResolverInterface $sidResolver * @param Config\ConfigInterface $sessionConfig * @param SaveHandlerInterface $saveHandler @@ -101,7 +101,7 @@ class SessionManager implements SessionManagerInterface * @param StorageInterface $storage */ public function __construct( - \Magento\App\Request\Http $request, + \Magento\Framework\App\Request\Http $request, SidResolverInterface $sidResolver, Config\ConfigInterface $sessionConfig, SaveHandlerInterface $saveHandler, diff --git a/lib/Magento/Session/SidResolver.php b/lib/Magento/Session/SidResolver.php index e7cda077b8d04613c1e9fcf234b11229101e4966..c3614d8f9f95d5fc68452934845b28d97faa18da 100644 --- a/lib/Magento/Session/SidResolver.php +++ b/lib/Magento/Session/SidResolver.php @@ -35,7 +35,7 @@ class SidResolver implements SidResolverInterface const XML_PATH_USE_FRONTEND_SID = 'web/session/use_frontend_sid'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -45,7 +45,7 @@ class SidResolver implements SidResolverInterface protected $urlBuilder; /** - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $request; @@ -75,16 +75,16 @@ class SidResolver implements SidResolverInterface protected $_scopeType; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\UrlInterface $urlBuilder - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param string $scopeType * @param array $sidNameMap */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\UrlInterface $urlBuilder, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, $scopeType, array $sidNameMap = array() ) { diff --git a/lib/Magento/Session/Validator.php b/lib/Magento/Session/Validator.php index f18831125a1c1b7ec314f720d856beb041cd183d..a49008eb759a86cdde69d0e3ad2d8727f949ca7f 100644 --- a/lib/Magento/Session/Validator.php +++ b/lib/Magento/Session/Validator.php @@ -47,7 +47,7 @@ class Validator implements ValidatorInterface const XML_PATH_USE_USER_AGENT = 'web/session/use_http_user_agent'; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -67,13 +67,13 @@ class Validator implements ValidatorInterface protected $_scopeType; /** - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param string $scopeType * @param array $skippedUserAgentList */ public function __construct( - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, $scopeType, array $skippedUserAgentList = array() diff --git a/lib/Magento/Stdlib/DateTime/Timezone.php b/lib/Magento/Stdlib/DateTime/Timezone.php index 8a81d83d54661f0717b640e4faababbe3a7618a3..e87f997c2647a9d3288cabd6db8eef4d14abb941 100644 --- a/lib/Magento/Stdlib/DateTime/Timezone.php +++ b/lib/Magento/Stdlib/DateTime/Timezone.php @@ -23,16 +23,19 @@ */ namespace Magento\Stdlib\DateTime; -class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface +/** + * Timezone library + */ +class Timezone implements TimezoneInterface { /** * @var array */ protected $_allowedFormats = array( - \Magento\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_FULL, - \Magento\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_LONG, - \Magento\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, - \Magento\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT + TimezoneInterface::FORMAT_TYPE_FULL, + TimezoneInterface::FORMAT_TYPE_LONG, + TimezoneInterface::FORMAT_TYPE_MEDIUM, + TimezoneInterface::FORMAT_TYPE_SHORT ); /** @@ -41,7 +44,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface protected $_scopeType; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; @@ -61,25 +64,25 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface protected $_defaultTimezonePath; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param \Magento\Locale\ResolverInterface $localeResolver * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Stdlib\DateTime\DateFactory $dateFactory - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $scopeType * @param string $defaultTimezonePath */ public function __construct( - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\Locale\ResolverInterface $localeResolver, \Magento\Stdlib\DateTime $dateTime, - \Magento\Stdlib\DateTime\DateFactory $dateFactory, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + DateFactory $dateFactory, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $scopeType, $defaultTimezonePath ) { @@ -105,7 +108,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface */ public function getDefaultTimezone() { - return \Magento\Stdlib\DateTime\TimezoneInterface::DEFAULT_TIMEZONE; + return TimezoneInterface::DEFAULT_TIMEZONE; } /** @@ -132,7 +135,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface return preg_replace( '/(?<!y)yy(?!y)/', 'yyyy', - $this->_getTranslation(\Magento\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT, 'date') + $this->_getTranslation(TimezoneInterface::FORMAT_TYPE_SHORT, 'date') ); } @@ -235,7 +238,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface if (is_null($time)) { $date = $this->date(time()); - } elseif ($time instanceof \Magento\Stdlib\DateTime\DateInterface) { + } elseif ($time instanceof DateInterface) { $date = $time; } else { $date = $this->date(strtotime($time)); @@ -257,7 +260,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface { $dateObj = $this->scopeDate($scope, $date, $includeTime); $dateObj->set($date, $format); - $dateObj->setTimezone(\Magento\Stdlib\DateTime\TimezoneInterface::DEFAULT_TIMEZONE); + $dateObj->setTimezone(TimezoneInterface::DEFAULT_TIMEZONE); return $dateObj; } @@ -279,7 +282,7 @@ class Timezone implements \Magento\Stdlib\DateTime\TimezoneInterface */ public function isScopeDateInInterval($scope, $dateFrom = null, $dateTo = null) { - if (!$scope instanceof \Magento\App\ScopeInterface) { + if (!$scope instanceof \Magento\Framework\App\ScopeInterface) { $scope = $this->_scopeResolver->getScope($scope); } diff --git a/lib/Magento/Stdlib/DateTime/Timezone/Validator.php b/lib/Magento/Stdlib/DateTime/Timezone/Validator.php index 594d7b5c458cd005df67369682e811e99f3968c3..389f2deabf3100267fb17fe13ada101a9674e106 100644 --- a/lib/Magento/Stdlib/DateTime/Timezone/Validator.php +++ b/lib/Magento/Stdlib/DateTime/Timezone/Validator.php @@ -69,7 +69,7 @@ class Validator throw new ValidationException('Transition year is out of system date range.'); } - if ((int)$timestamp > (int)$toDate) { + if ((int) $timestamp > (int) $toDate) { throw new ValidationException('Transition year is out of specified date range.'); } } diff --git a/lib/Magento/Stdlib/DateTime/TimezoneInterface.php b/lib/Magento/Stdlib/DateTime/TimezoneInterface.php index 252e07f29ca5c9c83023179959d7e3000df7de2f..e79db74b13f3639f8ac4a9510748849871e70016 100644 --- a/lib/Magento/Stdlib/DateTime/TimezoneInterface.php +++ b/lib/Magento/Stdlib/DateTime/TimezoneInterface.php @@ -167,7 +167,7 @@ interface TimezoneInterface /** * Checks if current date of the given scope (in the scope timezone) is within the range * - * @param int|string|\Magento\App\ScopeInterface $scope + * @param int|string|\Magento\Framework\App\ScopeInterface $scope * @param string|null $dateFrom * @param string|null $dateTo * @return bool diff --git a/lib/Magento/Translate.php b/lib/Magento/Translate.php index 3371567d7d3f057b7010d3c23112a818f6dacd9c..a329ce1eb030a3a863af3ad140beabcf8a05cc36 100644 --- a/lib/Magento/Translate.php +++ b/lib/Magento/Translate.php @@ -99,7 +99,7 @@ class Translate implements \Magento\TranslateInterface protected $_modulesReader; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $_scopeResolver; @@ -114,7 +114,7 @@ class Translate implements \Magento\TranslateInterface protected $_locale; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -140,11 +140,11 @@ class Translate implements \Magento\TranslateInterface * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Module\ModuleList $moduleList * @param \Magento\Module\Dir\Reader $modulesReader - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param \Magento\Translate\ResourceInterface $translate * @param \Magento\Locale\ResolverInterface $locale - * @param \Magento\App\State $appState - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\Filesystem $filesystem * @param App\RequestInterface $request * @param \Magento\File\Csv $csvParser * @@ -157,12 +157,12 @@ class Translate implements \Magento\TranslateInterface \Magento\View\FileSystem $viewFileSystem, \Magento\Module\ModuleList $moduleList, \Magento\Module\Dir\Reader $modulesReader, - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\Translate\ResourceInterface $translate, \Magento\Locale\ResolverInterface $locale, - \Magento\App\State $appState, - \Magento\App\Filesystem $filesystem, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\State $appState, + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\RequestInterface $request, \Magento\File\Csv $csvParser ) { $this->_viewDesign = $viewDesign; @@ -175,7 +175,7 @@ class Translate implements \Magento\TranslateInterface $this->_locale = $locale; $this->_appState = $appState; $this->request = $request; - $this->directory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->directory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->_localeHierarchy = $config->getHierarchy(); $this->_csvParser = $csvParser; } @@ -375,7 +375,7 @@ class Translate implements \Magento\TranslateInterface */ protected function _getModuleTranslationFile($moduleName, $locale) { - $file = $this->_modulesReader->getModuleDir(\Magento\App\Filesystem::LOCALE_DIR, $moduleName); + $file = $this->_modulesReader->getModuleDir(\Magento\Framework\App\Filesystem::LOCALE_DIR, $moduleName); $file .= '/' . $locale . '.csv'; return $file; } @@ -389,7 +389,7 @@ class Translate implements \Magento\TranslateInterface protected function _getThemeTranslationFile($locale) { return $this->_viewFileSystem->getFilename( - \Magento\App\Filesystem::LOCALE_DIR . '/' . $locale . '.csv', + \Magento\Framework\App\Filesystem::LOCALE_DIR . '/' . $locale . '.csv', ['area' => $this->getConfig('area')] ); } @@ -470,7 +470,7 @@ class Translate implements \Magento\TranslateInterface protected function getCacheId() { if ($this->_cacheId === null) { - $this->_cacheId = \Magento\App\Cache\Type\Translate::TYPE_IDENTIFIER; + $this->_cacheId = \Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER; if (isset($this->_config['locale'])) { $this->_cacheId .= '_' . $this->_config['locale']; } diff --git a/lib/Magento/Translate/Inline.php b/lib/Magento/Translate/Inline.php index 733588c4db38e64ed851017885a32f0ccb93265d..3e69883fe16940b3e91a4054282efc249557e18d 100644 --- a/lib/Magento/Translate/Inline.php +++ b/lib/Magento/Translate/Inline.php @@ -62,7 +62,7 @@ class Inline implements \Magento\Translate\InlineInterface protected $config; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $scopeResolver; @@ -89,7 +89,7 @@ class Inline implements \Magento\Translate\InlineInterface /** * Initialize inline translation model * - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param \Magento\UrlInterface $url * @param \Magento\View\LayoutInterface $layout * @param Inline\ConfigInterface $config @@ -100,7 +100,7 @@ class Inline implements \Magento\Translate\InlineInterface * @param null $scope */ public function __construct( - \Magento\App\ScopeResolverInterface $scopeResolver, + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, \Magento\UrlInterface $url, \Magento\View\LayoutInterface $layout, \Magento\Translate\Inline\ConfigInterface $config, @@ -129,7 +129,7 @@ class Inline implements \Magento\Translate\InlineInterface public function isAllowed() { if ($this->isAllowed === null) { - if (!$this->scope instanceof \Magento\App\ScopeInterface) { + if (!$this->scope instanceof \Magento\Framework\App\ScopeInterface) { $scope = $this->scopeResolver->getScope($this->scope); } $this->isAllowed = $this->config->isActive($scope) diff --git a/lib/Magento/Translate/Inline/Proxy.php b/lib/Magento/Translate/Inline/Proxy.php index c4401226565feaded7213c73e957ecca3849aa0d..a755f8e2494de73bf4929f1f6dfc1ca241cb51c7 100644 --- a/lib/Magento/Translate/Inline/Proxy.php +++ b/lib/Magento/Translate/Inline/Proxy.php @@ -87,7 +87,7 @@ class Proxy extends \Magento\Translate\Inline */ public function __wakeup() { - $this->objectManager = \Magento\App\ObjectManager::getInstance(); + $this->objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** diff --git a/lib/Magento/Url.php b/lib/Magento/Url.php index eef1cc6105753ca22b3378a5eefe1c5369530e9c..c2fecebd13daca58f8e1fc5566181738eb74583f 100644 --- a/lib/Magento/Url.php +++ b/lib/Magento/Url.php @@ -114,7 +114,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface /** * Request instance * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -145,7 +145,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface /** * Constructor * - * @var \Magento\App\Route\ConfigInterface + * @var \Magento\Framework\App\Route\ConfigInterface */ protected $_routeConfig; @@ -165,33 +165,33 @@ class Url extends \Magento\Object implements \Magento\UrlInterface protected $_queryParamsResolver; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; /** - * @param \Magento\App\Route\ConfigInterface $routeConfig - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Url\SecurityInfoInterface $urlSecurityInfo * @param \Magento\Url\ScopeResolverInterface $scopeResolver * @param \Magento\Session\Generic $session * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Url\RouteParamsResolverFactory $routeParamsResolver * @param \Magento\Url\QueryParamsResolverInterface $queryParamsResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param string $scopeType * @param array $data */ public function __construct( - \Magento\App\Route\ConfigInterface $routeConfig, - \Magento\App\RequestInterface $request, + \Magento\Framework\App\Route\ConfigInterface $routeConfig, + \Magento\Framework\App\RequestInterface $request, \Magento\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Url\ScopeResolverInterface $scopeResolver, \Magento\Session\Generic $session, \Magento\Session\SidResolverInterface $sidResolver, \Magento\Url\RouteParamsResolverFactory $routeParamsResolver, \Magento\Url\QueryParamsResolverInterface $queryParamsResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $scopeType, array $data = array() ) { @@ -313,10 +313,10 @@ class Url extends \Magento\Object implements \Magento\UrlInterface /** * Set request * - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @return \Magento\UrlInterface */ - public function setRequest(\Magento\App\RequestInterface $request) + public function setRequest(\Magento\Framework\App\RequestInterface $request) { $this->_request = $request; return $this; @@ -325,7 +325,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface /** * Zend request object * - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ protected function _getRequest() { @@ -1037,8 +1037,8 @@ class Url extends \Magento\Object implements \Magento\UrlInterface $port = $this->_request->getServer('SERVER_PORT'); if ($port) { $defaultPorts = array( - \Magento\App\Request\Http::DEFAULT_HTTP_PORT, - \Magento\App\Request\Http::DEFAULT_HTTPS_PORT + \Magento\Framework\App\Request\Http::DEFAULT_HTTP_PORT, + \Magento\Framework\App\Request\Http::DEFAULT_HTTPS_PORT ); $port = in_array($port, $defaultPorts) ? '' : ':' . $port; } diff --git a/lib/Magento/Url/ScopeInterface.php b/lib/Magento/Url/ScopeInterface.php index 0ae5bef6ab5bf1f503a74084096b37df1c1a193a..ea540477d7f8e446835f58cd8ae2a77daa6a15dd 100644 --- a/lib/Magento/Url/ScopeInterface.php +++ b/lib/Magento/Url/ScopeInterface.php @@ -23,7 +23,7 @@ */ namespace Magento\Url; -interface ScopeInterface extends \Magento\App\ScopeInterface +interface ScopeInterface extends \Magento\Framework\App\ScopeInterface { /** * Retrieve base URL diff --git a/lib/Magento/Url/ScopeResolverInterface.php b/lib/Magento/Url/ScopeResolverInterface.php index 5eb970346f7ba0a24b9b5a0c8504b6557d8cd4d2..e469db423dedb6e468f781a0ae95e786e7e1870a 100644 --- a/lib/Magento/Url/ScopeResolverInterface.php +++ b/lib/Magento/Url/ScopeResolverInterface.php @@ -23,7 +23,7 @@ */ namespace Magento\Url; -interface ScopeResolverInterface extends \Magento\App\ScopeResolverInterface +interface ScopeResolverInterface extends \Magento\Framework\App\ScopeResolverInterface { /** * Retrieve scopes array diff --git a/lib/Magento/View/Asset/MergeService.php b/lib/Magento/View/Asset/MergeService.php index 198844168d631aebf80aaebef5334ea6c77d21a7..7ab4c6567a180e7de97ca328ebdbc97e8a5d0789 100644 --- a/lib/Magento/View/Asset/MergeService.php +++ b/lib/Magento/View/Asset/MergeService.php @@ -45,14 +45,14 @@ class MergeService /** * Filesystem * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; /** * State * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $state; @@ -61,14 +61,14 @@ class MergeService * * @param \Magento\ObjectManager $objectManager * @param ConfigInterface $config - * @param \Magento\App\Filesystem $filesystem - * @param \Magento\App\State $state + * @param \Magento\Framework\App\Filesystem $filesystem + * @param \Magento\Framework\App\State $state */ public function __construct( \Magento\ObjectManager $objectManager, ConfigInterface $config, - \Magento\App\Filesystem $filesystem, - \Magento\App\State $state + \Magento\Framework\App\Filesystem $filesystem, + \Magento\Framework\App\State $state ) { $this->objectManager = $objectManager; $this->config = $config; @@ -95,7 +95,7 @@ class MergeService $isCssMergeEnabled = $this->config->isMergeCssFiles(); $isJsMergeEnabled = $this->config->isMergeJsFiles(); if ($isCss && $isCssMergeEnabled || $isJs && $isJsMergeEnabled) { - if ($this->state->getMode() == \Magento\App\State::MODE_PRODUCTION) { + if ($this->state->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION) { $mergeStrategyClass = 'Magento\View\Asset\MergeStrategy\FileExists'; } else { $mergeStrategyClass = 'Magento\View\Asset\MergeStrategy\Checksum'; @@ -119,7 +119,7 @@ class MergeService public function cleanMergedJsCss() { $this->filesystem->getDirectoryWrite( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->delete( Merged::PUBLIC_MERGE_DIR ); diff --git a/lib/Magento/View/Asset/MergeStrategy/Checksum.php b/lib/Magento/View/Asset/MergeStrategy/Checksum.php index fa5bcaecb0d981002a3ed1718e742734c196f4c1..4cd1b8da5f1a35420f9588e343b58c4faaf68c45 100644 --- a/lib/Magento/View/Asset/MergeStrategy/Checksum.php +++ b/lib/Magento/View/Asset/MergeStrategy/Checksum.php @@ -39,7 +39,7 @@ class Checksum implements \Magento\View\Asset\MergeStrategyInterface /** * Filesystem * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -47,11 +47,11 @@ class Checksum implements \Magento\View\Asset\MergeStrategyInterface * Constructor * * @param \Magento\View\Asset\MergeStrategyInterface $strategy - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\View\Asset\MergeStrategyInterface $strategy, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->strategy = $strategy; $this->filesystem = $filesystem; @@ -62,7 +62,7 @@ class Checksum implements \Magento\View\Asset\MergeStrategyInterface */ public function mergeFiles(array $publicFiles, $destinationFile, $contentType) { - $directory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_DIR); + $directory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_DIR); $mergedMTimeFile = $directory->getRelativePath($destinationFile . '.dat'); // Check whether we have already merged these files diff --git a/lib/Magento/View/Asset/MergeStrategy/Direct.php b/lib/Magento/View/Asset/MergeStrategy/Direct.php index 47ecfb4934e488505e9dcbc4dc9040753cc16154..c358558e3bedaafa2257e30d9dee1b81d1fcb062 100644 --- a/lib/Magento/View/Asset/MergeStrategy/Direct.php +++ b/lib/Magento/View/Asset/MergeStrategy/Direct.php @@ -54,12 +54,14 @@ class Direct implements \Magento\View\Asset\MergeStrategyInterface /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Url\CssResolver $cssUrlResolver */ - public function __construct(\Magento\App\Filesystem $filesystem, \Magento\View\Url\CssResolver $cssUrlResolver) - { - $this->_directory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::PUB_DIR); + public function __construct( + \Magento\Framework\App\Filesystem $filesystem, + \Magento\View\Url\CssResolver $cssUrlResolver + ) { + $this->_directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::PUB_DIR); $this->_cssUrlResolver = $cssUrlResolver; } diff --git a/lib/Magento/View/Asset/MergeStrategy/FileExists.php b/lib/Magento/View/Asset/MergeStrategy/FileExists.php index b6712cbcb3da54424a5bdba3fb0328a7ba4ce8be..540237592977d5038c757997df07c5a4ad95165b 100644 --- a/lib/Magento/View/Asset/MergeStrategy/FileExists.php +++ b/lib/Magento/View/Asset/MergeStrategy/FileExists.php @@ -38,7 +38,7 @@ class FileExists implements \Magento\View\Asset\MergeStrategyInterface /** * Filesystem * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -46,11 +46,11 @@ class FileExists implements \Magento\View\Asset\MergeStrategyInterface * Constructor * * @param \Magento\View\Asset\MergeStrategyInterface $strategy - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\View\Asset\MergeStrategyInterface $strategy, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->strategy = $strategy; $this->filesystem = $filesystem; @@ -61,7 +61,7 @@ class FileExists implements \Magento\View\Asset\MergeStrategyInterface */ public function mergeFiles(array $publicFiles, $destinationFile, $contentType) { - $directory = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::PUB_DIR); + $directory = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::PUB_DIR); if (!$directory->isExist($directory->getRelativePath($destinationFile))) { $this->strategy->mergeFiles($publicFiles, $destinationFile, $contentType); } diff --git a/lib/Magento/View/Asset/Merged.php b/lib/Magento/View/Asset/Merged.php index a4c1ca26843bb168e35d96e1d03b6974aa2d3c5b..7280008a1c90c51981ab6b7f5cdfd832c6e93e91 100644 --- a/lib/Magento/View/Asset/Merged.php +++ b/lib/Magento/View/Asset/Merged.php @@ -173,10 +173,10 @@ class Merged implements \Iterator */ protected function getMergedFilePath(array $publicFiles) { - /** @var \Magento\App\Filesystem $filesystem */ - $filesystem = $this->objectManager->get('Magento\App\Filesystem'); - $jsDir = $filesystem->getPath(\Magento\App\Filesystem::PUB_LIB_DIR); - $publicDir = $filesystem->getPath(\Magento\App\Filesystem::STATIC_VIEW_DIR); + /** @var \Magento\Framework\App\Filesystem $filesystem */ + $filesystem = $this->objectManager->get('Magento\Framework\App\Filesystem'); + $jsDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_LIB_DIR); + $publicDir = $filesystem->getPath(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); $prefixRemovals = array($jsDir, $publicDir); @@ -186,7 +186,7 @@ class Merged implements \Iterator } $mergedDir = $filesystem->getDirectoryRead( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->getAbsolutePath( self::PUBLIC_MERGE_DIR ); diff --git a/lib/Magento/View/Asset/MinifyService.php b/lib/Magento/View/Asset/MinifyService.php index c3082aa918e02d77d861aee51161275d0576785a..d20aec6f02e5f247faa7d6522c2580c231834cc1 100644 --- a/lib/Magento/View/Asset/MinifyService.php +++ b/lib/Magento/View/Asset/MinifyService.php @@ -59,14 +59,14 @@ class MinifyService /** * Applicaiton State * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -75,14 +75,14 @@ class MinifyService * * @param ConfigInterface $config * @param \Magento\ObjectManager $objectManager - * @param \Magento\App\State $appState - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\State $appState + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( ConfigInterface $config, \Magento\ObjectManager $objectManager, - \Magento\App\State $appState, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\State $appState, + \Magento\Framework\App\Filesystem $filesystem ) { $this->config = $config; $this->objectManager = $objectManager; @@ -126,7 +126,7 @@ class MinifyService $adapter = $this->getAdapter($contentType); $strategyParams = array('adapter' => $adapter); switch ($this->appState->getMode()) { - case \Magento\App\State::MODE_PRODUCTION: + case \Magento\Framework\App\State::MODE_PRODUCTION: $strategy = $this->objectManager->create('Magento\Code\Minifier\Strategy\Lite', $strategyParams); break; default: @@ -136,7 +136,7 @@ class MinifyService ); } $baseDir = $this->_filesystem->getDirectoryRead( - \Magento\App\Filesystem::PUB_VIEW_CACHE_DIR + \Magento\Framework\App\Filesystem::PUB_VIEW_CACHE_DIR )->getAbsolutePath( 'minify' ); diff --git a/lib/Magento/View/Config.php b/lib/Magento/View/Config.php index 14914411a6a614b329014cbec05bfc37f0b32de0..36728ef9608bc1d04c715c1ee37b7e5993e9ada1 100644 --- a/lib/Magento/View/Config.php +++ b/lib/Magento/View/Config.php @@ -83,7 +83,7 @@ class Config implements \Magento\View\ConfigInterface * Constructor * * @param \Magento\Module\Dir\Reader $moduleReader - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Service $viewService * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\Config\FileIteratorFactory $fileIteratorFactory @@ -91,14 +91,14 @@ class Config implements \Magento\View\ConfigInterface */ public function __construct( \Magento\Module\Dir\Reader $moduleReader, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Service $viewService, \Magento\View\FileSystem $viewFileSystem, \Magento\Config\FileIteratorFactory $fileIteratorFactory, $filename = self::CONFIG_FILE_NAME ) { $this->moduleReader = $moduleReader; - $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->viewService = $viewService; $this->viewFileSystem = $viewFileSystem; $this->filename = $filename; diff --git a/lib/Magento/View/Context.php b/lib/Magento/View/Context.php index bc16e3ea759e046244e32cde5e26780e139679fa..01919c5fcb273ad8d103ae39c2f6eb985f207dbe 100644 --- a/lib/Magento/View/Context.php +++ b/lib/Magento/View/Context.php @@ -23,18 +23,18 @@ */ namespace Magento\View; -use Magento\App\Request\Http as Request; -use Magento\App\FrontControllerInterface; +use Magento\Framework\App\Request\Http as Request; +use Magento\Framework\App\FrontControllerInterface; use Magento\TranslateInterface; -use Magento\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\View\Url as ViewUrl; use Magento\View\ConfigInterface as ViewConfig; use Magento\Logger; -use Magento\App\State as AppState; +use Magento\Framework\App\State as AppState; use Magento\View\LayoutInterface; use Magento\Session\SessionManager; -use Magento\App\CacheInterface as Cache; -use Magento\App\Cache\StateInterface as CacheState; +use Magento\Framework\App\CacheInterface as Cache; +use Magento\Framework\App\Cache\StateInterface as CacheState; use Magento\UrlInterface; use Magento\Event\ManagerInterface; @@ -79,7 +79,7 @@ class Context /** * Cache * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $cache; @@ -100,7 +100,7 @@ class Context /** * Store config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -135,7 +135,7 @@ class Context /** * Cache state * - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $cacheState; @@ -149,7 +149,7 @@ class Context /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; @@ -213,7 +213,7 @@ class Context /** * Retrieve cache * - * @return \Magento\App\CacheInterface + * @return \Magento\Framework\App\CacheInterface */ public function getCache() { @@ -283,7 +283,7 @@ class Context /** * Retrieve scope config * - * @return \Magento\App\Config\ScopeConfigInterface + * @return \Magento\Framework\App\Config\ScopeConfigInterface */ public function getScopeConfig() { @@ -333,7 +333,7 @@ class Context /** * Retrieve cache state * - * @return \Magento\App\Cache\StateInterface + * @return \Magento\Framework\App\Cache\StateInterface */ public function getCacheState() { @@ -502,7 +502,7 @@ class Context /** * Retrieve application state * - * @return \Magento\App\State + * @return \Magento\Framework\App\State */ public function getAppState() { diff --git a/lib/Magento/View/Design/Fallback/Factory.php b/lib/Magento/View/Design/Fallback/Factory.php index 0f17b5e8ed0b2a950dde7af2ea9a329c4cf32a85..9ada2833d18bfc648b58e12cd662f7b7fb04861a 100644 --- a/lib/Magento/View/Design/Fallback/Factory.php +++ b/lib/Magento/View/Design/Fallback/Factory.php @@ -23,7 +23,7 @@ */ namespace Magento\View\Design\Fallback; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\View\Design\Fallback\Rule\Composite; use Magento\View\Design\Fallback\Rule\ModularSwitch; use Magento\View\Design\Fallback\Rule\RuleInterface; diff --git a/lib/Magento/View/Design/FileResolution/Strategy/Fallback.php b/lib/Magento/View/Design/FileResolution/Strategy/Fallback.php index 7668978b70dafe35bd831402c4433a3cf3857aee..e45c02fd3a33df8ddec600200d65e98c0b3d1544 100644 --- a/lib/Magento/View/Design/FileResolution/Strategy/Fallback.php +++ b/lib/Magento/View/Design/FileResolution/Strategy/Fallback.php @@ -23,7 +23,7 @@ */ namespace Magento\View\Design\FileResolution\Strategy; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\View\Design\Fallback\Factory; use Magento\View\Design\Fallback\Rule\RuleInterface; use Magento\View\Design\ThemeInterface; diff --git a/lib/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxy.php b/lib/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxy.php index c3889cfbf085a5192b0961586ef42934d5f46404..b064141f3d9415839ada2fab51798f5dcc93a74b 100644 --- a/lib/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxy.php +++ b/lib/Magento/View/Design/FileResolution/Strategy/Fallback/CachingProxy.php @@ -23,7 +23,7 @@ */ namespace Magento\View\Design\FileResolution\Strategy\Fallback; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\View\Design\FileResolution\Strategy\Fallback; use Magento\View\Design\FileResolution\Strategy\FileInterface; use Magento\View\Design\FileResolution\Strategy\LocaleInterface; diff --git a/lib/Magento/View/Design/FileResolution/StrategyPool.php b/lib/Magento/View/Design/FileResolution/StrategyPool.php index 94b3151b1fc1f72863056b26bc4c762c8c267ed8..ae8d9b7dc7dfcdad65e08682ac2dacc6c8d4ecdd 100644 --- a/lib/Magento/View/Design/FileResolution/StrategyPool.php +++ b/lib/Magento/View/Design/FileResolution/StrategyPool.php @@ -24,8 +24,8 @@ namespace Magento\View\Design\FileResolution; use Magento\Exception; -use Magento\App\State; -use Magento\App\Filesystem; +use Magento\Framework\App\State; +use Magento\Framework\App\Filesystem; use Magento\ObjectManager; /** diff --git a/lib/Magento/View/Design/Theme/Customization/AbstractFile.php b/lib/Magento/View/Design/Theme/Customization/AbstractFile.php index 6f7a91b53a7fb35fb980bcc5c3a8de45053d2dd5..117e0010eb43a93e45004d8af30b0e2e07e4f2b4 100644 --- a/lib/Magento/View/Design/Theme/Customization/AbstractFile.php +++ b/lib/Magento/View/Design/Theme/Customization/AbstractFile.php @@ -47,7 +47,7 @@ abstract class AbstractFile implements /** * File system * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -56,12 +56,12 @@ abstract class AbstractFile implements * * @param \Magento\View\Design\Theme\Customization\Path $customizationPath * @param \Magento\View\Design\Theme\FileFactory $fileFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( \Magento\View\Design\Theme\Customization\Path $customizationPath, \Magento\View\Design\Theme\FileFactory $fileFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_customizationPath = $customizationPath; $this->_fileFactory = $fileFactory; @@ -221,6 +221,6 @@ abstract class AbstractFile implements */ protected function getDirectoryWrite() { - return $this->_filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + return $this->_filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); } } diff --git a/lib/Magento/View/Design/Theme/Customization/Path.php b/lib/Magento/View/Design/Theme/Customization/Path.php index ffa510bbd16db3821894c6937e904e4220bce4ed..1ea8d69d9c1a59a24dfc8908db74012861258738 100644 --- a/lib/Magento/View/Design/Theme/Customization/Path.php +++ b/lib/Magento/View/Design/Theme/Customization/Path.php @@ -47,7 +47,7 @@ class Path /** * File system * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -68,17 +68,17 @@ class Path /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param string $filename */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, $filename = \Magento\View\ConfigInterface::CONFIG_FILE_NAME ) { $this->filesystem = $filesystem; $this->filename = $filename; - $this->mediaDirectoryRead = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::MEDIA_DIR); - $this->themeDirectoryRead = $this->filesystem->getDirectoryRead(\Magento\App\Filesystem::THEMES_DIR); + $this->mediaDirectoryRead = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::MEDIA_DIR); + $this->themeDirectoryRead = $this->filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::THEMES_DIR); } /** diff --git a/lib/Magento/View/Design/Theme/Image.php b/lib/Magento/View/Design/Theme/Image.php index 8821a57ec7f358c201b6adda7cd32000b4befa7a..14c7f48e3611f90a69b41c6f989de745ed4ab485 100644 --- a/lib/Magento/View/Design/Theme/Image.php +++ b/lib/Magento/View/Design/Theme/Image.php @@ -85,7 +85,7 @@ class Image /** * Initialize dependencies * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\Image\Factory $imageFactory * @param Image\Uploader $uploader * @param Image\PathInterface $themeImagePath @@ -93,14 +93,14 @@ class Image * @param \Magento\View\Design\ThemeInterface $theme */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\Image\Factory $imageFactory, Image\Uploader $uploader, Image\PathInterface $themeImagePath, \Magento\Logger $logger, \Magento\View\Design\ThemeInterface $theme = null ) { - $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::MEDIA_DIR); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::MEDIA_DIR); $this->_imageFactory = $imageFactory; $this->_uploader = $uploader; $this->_themeImagePath = $themeImagePath; diff --git a/lib/Magento/View/Design/Theme/Image/Uploader.php b/lib/Magento/View/Design/Theme/Image/Uploader.php index 8614a4d507c6738d249cde96a94cc3f3e90d857b..61f626db26df1474bfd091a3422176920778154e 100644 --- a/lib/Magento/View/Design/Theme/Image/Uploader.php +++ b/lib/Magento/View/Design/Theme/Image/Uploader.php @@ -38,7 +38,7 @@ class Uploader /** * File system * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -59,12 +59,12 @@ class Uploader /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\HTTP\Adapter\FileTransferFactory $adapterFactory * @param \Magento\File\UploaderFactory $uploaderFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\HTTP\Adapter\FileTransferFactory $adapterFactory, \Magento\File\UploaderFactory $uploaderFactory ) { diff --git a/lib/Magento/View/DesignLoader.php b/lib/Magento/View/DesignLoader.php index 24e44d4b5854a7d42b2c217ca51465607b6c6192..a1fc4de6b5b9b0c2163008c941ccfe6269cff227 100644 --- a/lib/Magento/View/DesignLoader.php +++ b/lib/Magento/View/DesignLoader.php @@ -28,33 +28,33 @@ class DesignLoader /** * Request * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; /** * Application * - * @var \Magento\App\AreaList + * @var \Magento\Framework\App\AreaList */ protected $_areaList; /** * Layout * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $appState; /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\AreaList $areaList - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magento\Framework\App\AreaList $areaList + * @param \Magento\Framework\App\State $appState */ public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\AreaList $areaList, - \Magento\App\State $appState + \Magento\Framework\App\RequestInterface $request, + \Magento\Framework\App\AreaList $areaList, + \Magento\Framework\App\State $appState ) { $this->_request = $request; $this->_areaList = $areaList; diff --git a/lib/Magento/View/Element/AbstractBlock.php b/lib/Magento/View/Element/AbstractBlock.php index 1947270e8fd8e4ea1ad6a8d50a59e3517634d63f..d74bcbc68cef135d6a5a3024576dc1cc69598a60 100644 --- a/lib/Magento/View/Element/AbstractBlock.php +++ b/lib/Magento/View/Element/AbstractBlock.php @@ -39,7 +39,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Cache group Tag */ - const CACHE_GROUP = \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER; + const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER; /** * Design @@ -86,7 +86,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Request * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -108,7 +108,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Application front controller * - * @var \Magento\App\FrontController + * @var \Magento\Framework\App\FrontController */ protected $_frontController; @@ -129,7 +129,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Cache State * - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; @@ -173,7 +173,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface protected $_isScopePrivate = false; /** - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -210,7 +210,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Get request * - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function getRequest() { @@ -226,6 +226,9 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface */ protected function _construct() { + /** + * Please override this one instead of overriding real __construct constructor + */ } /** diff --git a/lib/Magento/View/Element/Context.php b/lib/Magento/View/Element/Context.php index e829a36cc8ac28122476199d40b0c575a7439850..1ab36999b1859824d2599f98b55bb6f0067da0b1 100644 --- a/lib/Magento/View/Element/Context.php +++ b/lib/Magento/View/Element/Context.php @@ -37,7 +37,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Request * - * @var \Magento\App\RequestInterface + * @var \Magento\Framework\App\RequestInterface */ protected $_request; @@ -72,7 +72,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Cache * - * @var \Magento\App\CacheInterface + * @var \Magento\Framework\App\CacheInterface */ protected $_cache; @@ -100,7 +100,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Scope config * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -121,7 +121,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Cache state * - * @var \Magento\App\Cache\StateInterface + * @var \Magento\Framework\App\Cache\StateInterface */ protected $_cacheState; @@ -157,19 +157,19 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $inlineTranslation; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder * @param \Magento\TranslateInterface $translator - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager @@ -179,19 +179,19 @@ class Context implements \Magento\ObjectManager\ContextInterface * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, \Magento\TranslateInterface $translator, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Session\SessionManagerInterface $session, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, @@ -221,7 +221,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Get cache * - * @return \Magento\App\CacheInterface + * @return \Magento\Framework\App\CacheInterface */ public function getCache() { @@ -261,7 +261,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Get request * - * @return \Magento\App\RequestInterface + * @return \Magento\Framework\App\RequestInterface */ public function getRequest() { @@ -291,7 +291,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Get scope config * - * @return \Magento\App\Config\ScopeConfigInterface + * @return \Magento\Framework\App\Config\ScopeConfigInterface */ public function getScopeConfig() { @@ -351,7 +351,7 @@ class Context implements \Magento\ObjectManager\ContextInterface /** * Get cache state * - * @return \Magento\App\Cache\StateInterface + * @return \Magento\Framework\App\Cache\StateInterface */ public function getCacheState() { diff --git a/lib/Magento/View/Element/Html/Link/Current.php b/lib/Magento/View/Element/Html/Link/Current.php index d55c411e4a5ee91eaf5dff73348b2ca9668423e7..b293fbd43ef817169a7b622adce654f46bbbfc6c 100644 --- a/lib/Magento/View/Element/Html/Link/Current.php +++ b/lib/Magento/View/Element/Html/Link/Current.php @@ -38,7 +38,7 @@ class Current extends \Magento\View\Element\Template /** * Default path * - * @var \Magento\App\DefaultPathInterface + * @var \Magento\Framework\App\DefaultPathInterface */ protected $_defaultPath; @@ -46,12 +46,12 @@ class Current extends \Magento\View\Element\Template * Constructor * * @param \Magento\View\Element\Template\Context $context - * @param \Magento\App\DefaultPathInterface $defaultPath + * @param \Magento\Framework\App\DefaultPathInterface $defaultPath * @param array $data */ public function __construct( \Magento\View\Element\Template\Context $context, - \Magento\App\DefaultPathInterface $defaultPath, + \Magento\Framework\App\DefaultPathInterface $defaultPath, array $data = array() ) { parent::__construct($context, $data); diff --git a/lib/Magento/View/Element/Js/Components.php b/lib/Magento/View/Element/Js/Components.php index 93a8bae37398ef1ec5978d6ed376ee80223814f3..a667e172dfb97243c73b0c258f51ef36aec16500 100644 --- a/lib/Magento/View/Element/Js/Components.php +++ b/lib/Magento/View/Element/Js/Components.php @@ -23,7 +23,7 @@ */ namespace Magento\View\Element\Js; -use Magento\App\State; +use Magento\Framework\App\State; use Magento\View\Element\Template; class Components extends Template diff --git a/lib/Magento/View/Element/RendererList.php b/lib/Magento/View/Element/RendererList.php index dde19e62ac6f5092fac31c23623b78cc6f536146..7260190cadb9ae57e2cb431050ebd86f8a60baba 100644 --- a/lib/Magento/View/Element/RendererList.php +++ b/lib/Magento/View/Element/RendererList.php @@ -36,15 +36,15 @@ class RendererList extends AbstractBlock * Retrieve renderer by code * * @param string $type - * @param string $defalut + * @param string $default * @param string $rendererTemplate * @return bool|AbstractBlock * @throws \RuntimeException */ - public function getRenderer($type, $defalut = null, $rendererTemplate = null) + public function getRenderer($type, $default = null, $rendererTemplate = null) { /** @var \Magento\View\Element\Template $renderer */ - $renderer = $this->getChildBlock($type) ?: $this->getChildBlock($defalut); + $renderer = $this->getChildBlock($type) ?: $this->getChildBlock($default); if (!$renderer instanceof BlockInterface) { throw new \RuntimeException('Renderer for type "' . $type . '" does not exist.'); } diff --git a/lib/Magento/View/Element/Template.php b/lib/Magento/View/Element/Template.php index 1063986be1a1c6580cff9d227d68f1fc24aa1764..cbe925b72840330d7739e5d79ed10ce9263379a9 100644 --- a/lib/Magento/View/Element/Template.php +++ b/lib/Magento/View/Element/Template.php @@ -23,7 +23,7 @@ */ namespace Magento\View\Element; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; /** * Base html block @@ -102,7 +102,7 @@ class Template extends AbstractBlock /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; diff --git a/lib/Magento/View/Element/Template/Context.php b/lib/Magento/View/Element/Template/Context.php index 334125f26508662e84602cba2398e05d95a85883..2a0fe3d1ff144e032f5a2e609cbd59aaa5ee6664 100644 --- a/lib/Magento/View/Element/Template/Context.php +++ b/lib/Magento/View/Element/Template/Context.php @@ -26,7 +26,7 @@ class Context extends \Magento\View\Element\Context /** * Filesystem instance * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -47,7 +47,7 @@ class Context extends \Magento\View\Element\Context /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -59,55 +59,55 @@ class Context extends \Magento\View\Element\Context protected $_storeManager; /** - * @param \Magento\App\RequestInterface $request + * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\UrlInterface $urlBuilder * @param \Magento\TranslateInterface $translator - * @param \Magento\App\CacheInterface $cache + * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Session\SessionManagerInterface $session * @param \Magento\Session\SidResolverInterface $sidResolver - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\View\Url $viewUrl * @param \Magento\View\ConfigInterface $viewConfig - * @param \Magento\App\Cache\StateInterface $cacheState + * @param \Magento\Framework\App\Cache\StateInterface $cacheState * @param \Magento\Logger $logger * @param \Magento\Escaper $escaper * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Translate\Inline\StateInterface $inlineTranslation - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\View\TemplateEnginePool $enginePool - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\Store\Model\StoreManagerInterface $storeManager * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\App\RequestInterface $request, + \Magento\Framework\App\RequestInterface $request, \Magento\View\LayoutInterface $layout, \Magento\Event\ManagerInterface $eventManager, \Magento\UrlInterface $urlBuilder, \Magento\TranslateInterface $translator, - \Magento\App\CacheInterface $cache, + \Magento\Framework\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Session\SessionManagerInterface $session, \Magento\Session\SidResolverInterface $sidResolver, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\View\Url $viewUrl, \Magento\View\ConfigInterface $viewConfig, - \Magento\App\Cache\StateInterface $cacheState, + \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Logger $logger, \Magento\Escaper $escaper, \Magento\Filter\FilterManager $filterManager, \Magento\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Translate\Inline\StateInterface $inlineTranslation, - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem, \Magento\View\TemplateEnginePool $enginePool, - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\Store\Model\StoreManagerInterface $storeManager ) { parent::__construct( @@ -142,7 +142,7 @@ class Context extends \Magento\View\Element\Context /** * Get filesystem instance * - * @return \Magento\App\Filesystem + * @return \Magento\Framework\App\Filesystem */ public function getFilesystem() { @@ -182,7 +182,7 @@ class Context extends \Magento\View\Element\Context /** * Get app state object * - * @return \Magento\App\State + * @return \Magento\Framework\App\State */ public function getAppState() { diff --git a/lib/Magento/View/Layout.php b/lib/Magento/View/Layout.php index 8c9b05d3344ec96374d943c399e668761e1bc835..a1ebfd46e15bd1cd9378ca3ae420d985d87e386f 100644 --- a/lib/Magento/View/Layout.php +++ b/lib/Magento/View/Layout.php @@ -167,7 +167,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Application configuration * - * @var \Magento\App\Config\ScopeConfigInterface + * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig; @@ -182,7 +182,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn protected $_processorFactory; /** - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -207,10 +207,15 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn protected $themeResolver; /** - * @var \Magento\App\ScopeResolverInterface + * @var \Magento\Framework\App\ScopeResolverInterface */ protected $scopeResolver; + /** + * @var bool + */ + protected $cacheable; + /** * @param \Magento\View\Layout\ProcessorFactory $processorFactory * @param \Magento\Logger $logger @@ -220,12 +225,13 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * @param \Magento\View\Layout\Argument\Parser $argumentParser * @param \Magento\Data\Argument\InterpreterInterface $argumentInterpreter * @param \Magento\View\Layout\ScheduledStructure $scheduledStructure - * @param \Magento\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\App\State $appState * @param \Magento\Message\ManagerInterface $messageManager * @param \Magento\View\Design\Theme\ResolverInterface $themeResolver - * @param \Magento\App\ScopeResolverInterface $scopeResolver + * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param string $scopeType + * @param bool $cacheable */ public function __construct( \Magento\View\Layout\ProcessorFactory $processorFactory, @@ -236,12 +242,13 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn \Magento\View\Layout\Argument\Parser $argumentParser, \Magento\Data\Argument\InterpreterInterface $argumentInterpreter, \Magento\View\Layout\ScheduledStructure $scheduledStructure, - \Magento\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\App\State $appState, + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Framework\App\State $appState, \Magento\Message\ManagerInterface $messageManager, \Magento\View\Design\Theme\ResolverInterface $themeResolver, - \Magento\App\ScopeResolverInterface $scopeResolver, - $scopeType + \Magento\Framework\App\ScopeResolverInterface $scopeResolver, + $scopeType, + $cacheable = true ) { $this->_eventManager = $eventManager; $this->_scopeConfig = $scopeConfig; @@ -252,7 +259,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $this->argumentInterpreter = $argumentInterpreter; $this->_elementClass = 'Magento\View\Layout\Element'; $this->setXml(simplexml_load_string('<layout/>', $this->_elementClass)); - $this->_renderingOutput = new \Magento\Object(); + $this->_renderingOutput = new \Magento\Object; $this->_scheduledStructure = $scheduledStructure; $this->_processorFactory = $processorFactory; $this->_logger = $logger; @@ -260,6 +267,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $this->scopeType = $scopeType; $this->themeResolver = $themeResolver; $this->scopeResolver = $scopeResolver; + $this->cacheable = $cacheable; } /** @@ -1352,7 +1360,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * * @param string|\Magento\View\Element\AbstractBlock $block * @param array $attributes - * @throws \Magento\Model\Exception + * @throws \Exception * @return \Magento\View\Element\AbstractBlock */ protected function _getBlockInstance($block, array $attributes = array()) @@ -1361,7 +1369,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn try { $block = $this->_blockFactory->createBlock($block, $attributes); } catch (\ReflectionException $e) { - // incorrect class name + $this->_logger->log($e->getMessage()); } } if (!$block instanceof \Magento\View\Element\AbstractBlock) { @@ -1480,7 +1488,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * * @param string $type * @throws \Magento\Model\Exception - * @return \Magento\App\Helper\AbstractHelper + * @return \Magento\Framework\App\Helper\AbstractHelper */ public function getBlockSingleton($type) { @@ -1623,7 +1631,8 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn */ public function isCacheable() { - return !(bool)count($this->_xml->xpath('//' . Element::TYPE_BLOCK . '[@cacheable="false"]')); + $cacheableXml = !(bool)count($this->_xml->xpath('//' . Element::TYPE_BLOCK . '[@cacheable="false"]')); + return $this->cacheable && $cacheableXml; } /** diff --git a/lib/Magento/View/Layout/File/Source/Base.php b/lib/Magento/View/Layout/File/Source/Base.php index e7b7a427289bca6435e0980bab5e0252c2792621..c94c3c5a46db08da777ecf6c5806e0f341afe7fe 100644 --- a/lib/Magento/View/Layout/File/Source/Base.php +++ b/lib/Magento/View/Layout/File/Source/Base.php @@ -25,7 +25,7 @@ namespace Magento\View\Layout\File\Source; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; diff --git a/lib/Magento/View/Layout/File/Source/Override/Base.php b/lib/Magento/View/Layout/File/Source/Override/Base.php index 88fcd3b0a165dc509151bf6743596febecbc485a..5d84bd1854d2228c79b731a68cf572be3379d1c0 100644 --- a/lib/Magento/View/Layout/File/Source/Override/Base.php +++ b/lib/Magento/View/Layout/File/Source/Override/Base.php @@ -25,7 +25,7 @@ namespace Magento\View\Layout\File\Source\Override; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; diff --git a/lib/Magento/View/Layout/File/Source/Override/Theme.php b/lib/Magento/View/Layout/File/Source/Override/Theme.php index b985645d4a88f692b9ea5c799f61c092aa93c3c2..a141627b6ab306a05ee00841af1baaae9868904e 100644 --- a/lib/Magento/View/Layout/File/Source/Override/Theme.php +++ b/lib/Magento/View/Layout/File/Source/Override/Theme.php @@ -25,7 +25,7 @@ namespace Magento\View\Layout\File\Source\Override; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; use Magento\Exception; diff --git a/lib/Magento/View/Layout/File/Source/Theme.php b/lib/Magento/View/Layout/File/Source/Theme.php index fcfca6f158efb9912bca2582e039408e373ad624..94bf268d738ba9000662e5c976f41c7d99fc7ee8 100644 --- a/lib/Magento/View/Layout/File/Source/Theme.php +++ b/lib/Magento/View/Layout/File/Source/Theme.php @@ -25,7 +25,7 @@ namespace Magento\View\Layout\File\Source; use Magento\View\Layout\File\SourceInterface; use Magento\View\Design\ThemeInterface; -use Magento\App\Filesystem; +use Magento\Framework\App\Filesystem; use Magento\Filesystem\Directory\ReadInterface; use Magento\View\Layout\File\Factory; diff --git a/lib/Magento/View/Layout/Proxy.php b/lib/Magento/View/Layout/Proxy.php index c5ea24373660b7af77d642d922e68219069cf86a..488a3c2d8dedbdc31b84faea94dee36fed1d6a1b 100644 --- a/lib/Magento/View/Layout/Proxy.php +++ b/lib/Magento/View/Layout/Proxy.php @@ -88,7 +88,7 @@ class Proxy extends \Magento\View\Layout */ public function __wakeup() { - $this->objectManager = \Magento\App\ObjectManager::getInstance(); + $this->objectManager = \Magento\Framework\App\ObjectManager::getInstance(); } /** @@ -496,7 +496,7 @@ class Proxy extends \Magento\View\Layout * * @param string $type * @throws \Magento\Model\Exception - * @return \Magento\App\Helper\AbstractHelper + * @return \Magento\Framework\App\Helper\AbstractHelper */ public function getBlockSingleton($type) { diff --git a/lib/Magento/View/LayoutInterface.php b/lib/Magento/View/LayoutInterface.php index 6a16b94819cfddc7c973088213afda321caff77b..76010142da65251b14fbf97222ab3950d8391a75 100644 --- a/lib/Magento/View/LayoutInterface.php +++ b/lib/Magento/View/LayoutInterface.php @@ -321,4 +321,11 @@ interface LayoutInterface * @return LayoutInterface */ public function setBlock($name, $block); + + /** + * Check is exists non-cacheable layout elements + * + * @return bool + */ + public function isCacheable(); } diff --git a/lib/Magento/View/Publisher.php b/lib/Magento/View/Publisher.php index 76aedd2c0cdd36225d56c7ab01b25eb938a8ecfa..67f2cbf56e8b72d4dc40f7623f558e5093199a9d 100644 --- a/lib/Magento/View/Publisher.php +++ b/lib/Magento/View/Publisher.php @@ -93,20 +93,20 @@ class Publisher implements PublicFilesManagerInterface protected $pubDirectory; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param FileSystem $viewFileSystem * @param Asset\PreProcessor\PreProcessorInterface $preProcessor * @param Publisher\FileFactory $fileFactory */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem, \Magento\View\Asset\PreProcessor\PreProcessorInterface $preProcessor, Publisher\FileFactory $fileFactory ) { - $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); - $this->tmpDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::VAR_DIR); - $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::STATIC_VIEW_DIR); + $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); + $this->tmpDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::VAR_DIR); + $this->pubDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); $this->viewFileSystem = $viewFileSystem; $this->preProcessor = $preProcessor; $this->fileFactory = $fileFactory; diff --git a/lib/Magento/View/Publisher/CssFile.php b/lib/Magento/View/Publisher/CssFile.php index 3c97c3687e1fd481a3f418af9c71f03a60730cb0..4efa7c70084c748408bc2fbb53be2c9c601819fa 100644 --- a/lib/Magento/View/Publisher/CssFile.php +++ b/lib/Magento/View/Publisher/CssFile.php @@ -45,7 +45,8 @@ class CssFile extends FileAbstract } elseif (!$this->isViewStaticFile($filePath)) { $this->isPublicationAllowed = true; } else { - $this->isPublicationAllowed = $this->viewService->getAppMode() === \Magento\App\State::MODE_DEVELOPER; + $this->isPublicationAllowed = + $this->viewService->getAppMode() === \Magento\Framework\App\State::MODE_DEVELOPER; } } return $this->isPublicationAllowed; diff --git a/lib/Magento/View/Publisher/FileAbstract.php b/lib/Magento/View/Publisher/FileAbstract.php index e651684e853b9f4512195180462d1e2c72a90443..33b4bd46f6fc60b88d3ac7f91fc40a3f6e99f6b3 100644 --- a/lib/Magento/View/Publisher/FileAbstract.php +++ b/lib/Magento/View/Publisher/FileAbstract.php @@ -31,7 +31,7 @@ use Magento\Filesystem\Directory\WriteInterface; abstract class FileAbstract implements FileInterface { /** - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -102,7 +102,7 @@ abstract class FileAbstract implements FileInterface protected $isSourcePathProvided; /** - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\Service $viewService * @param \Magento\Module\Dir\Reader $modulesReader * @param \Magento\View\FileSystem $viewFileSystem @@ -112,7 +112,7 @@ abstract class FileAbstract implements FileInterface * @param string|null $sourcePath */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\View\Service $viewService, \Magento\Module\Dir\Reader $modulesReader, \Magento\View\FileSystem $viewFileSystem, @@ -128,7 +128,7 @@ abstract class FileAbstract implements FileInterface $this->allowDuplication = $allowDuplication; $this->viewParams = $viewParams; $this->viewFileSystem = $viewFileSystem; - $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); $this->setSourcePath($sourcePath); $this->isSourcePathProvided = $sourcePath !== null; } @@ -238,7 +238,7 @@ abstract class FileAbstract implements FileInterface */ protected function isLibFile($filePath) { - $pubLibDir = $this->filesystem->getPath(\Magento\App\Filesystem::PUB_LIB_DIR) . '/'; + $pubLibDir = $this->filesystem->getPath(\Magento\Framework\App\Filesystem::PUB_LIB_DIR) . '/'; if (strncmp($filePath, $pubLibDir, strlen($pubLibDir)) === 0) { return true; } @@ -251,7 +251,7 @@ abstract class FileAbstract implements FileInterface */ protected function isViewStaticFile($filePath) { - $pubStaticDir = $this->filesystem->getPath(\Magento\App\Filesystem::STATIC_VIEW_DIR) . '/'; + $pubStaticDir = $this->filesystem->getPath(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR) . '/'; if (strncmp($filePath, $pubStaticDir, strlen($pubStaticDir)) === 0) { return true; } @@ -295,7 +295,7 @@ abstract class FileAbstract implements FileInterface */ protected function buildPublicViewSufficientFilename() { - $designDir = $this->filesystem->getPath(\Magento\App\Filesystem::THEMES_DIR) . '/'; + $designDir = $this->filesystem->getPath(\Magento\Framework\App\Filesystem::THEMES_DIR) . '/'; if (0 === strpos($this->getSourcePath(), $designDir)) { // theme file $publicFile = substr($this->getSourcePath(), strlen($designDir)); @@ -336,14 +336,14 @@ abstract class FileAbstract implements FileInterface */ public function __wakeup() { - $objectManager = \Magento\App\ObjectManager::getInstance(); - $this->filesystem = $objectManager->get('\Magento\App\Filesystem'); + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $this->filesystem = $objectManager->get('\Magento\Framework\App\Filesystem'); $this->viewService = $objectManager->get('\Magento\View\Service'); $this->modulesReader = $objectManager->get('\Magento\Module\Dir\Reader'); $this->viewFileSystem = $objectManager->get('\Magento\View\FileSystem'); $this->viewService->updateDesignParams($this->viewParams); - $this->rootDirectory = $this->filesystem->getDirectoryWrite(\Magento\App\Filesystem::ROOT_DIR); + $this->rootDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem::ROOT_DIR); } } diff --git a/lib/Magento/View/Service.php b/lib/Magento/View/Service.php index a95f9a4be9381c79a89f08e89bd20ab8fa452fec..e4a83da660ca8e8021d57a1461ada39060a93809 100644 --- a/lib/Magento/View/Service.php +++ b/lib/Magento/View/Service.php @@ -36,7 +36,7 @@ class Service /** * Application state * - * @var \Magento\App\State + * @var \Magento\Framework\App\State */ protected $_appState; @@ -64,20 +64,20 @@ class Service /** * Constructor * - * @param \Magento\App\State $appState + * @param \Magento\Framework\App\State $appState * @param \Magento\View\DesignInterface $design * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem */ public function __construct( - \Magento\App\State $appState, + \Magento\Framework\App\State $appState, \Magento\View\DesignInterface $design, \Magento\View\Design\Theme\FlyweightFactory $themeFactory, - \Magento\App\Filesystem $filesystem + \Magento\Framework\App\Filesystem $filesystem ) { $this->_appState = $appState; $this->_design = $design; - $this->_pubDirectory = $filesystem->getPath(\Magento\App\Filesystem::STATIC_VIEW_DIR); + $this->_pubDirectory = $filesystem->getPath(\Magento\Framework\App\Filesystem::STATIC_VIEW_DIR); $this->themeFactory = $themeFactory; } @@ -117,7 +117,7 @@ class Service */ public function isViewFileOperationAllowed() { - return $this->getAppMode() != \Magento\App\State::MODE_PRODUCTION; + return $this->getAppMode() != \Magento\Framework\App\State::MODE_PRODUCTION; } /** diff --git a/lib/Magento/View/TemplateEngine/Php.php b/lib/Magento/View/TemplateEngine/Php.php index 5804767a103afeb2a96c0a1f9123476bc0e2929f..0a51732fb0df272bda460dd5e2e29e0afb35c5e3 100644 --- a/lib/Magento/View/TemplateEngine/Php.php +++ b/lib/Magento/View/TemplateEngine/Php.php @@ -132,14 +132,14 @@ class Php implements TemplateEngineInterface * Get helper singleton * * @param string $className - * @return \Magento\App\Helper\AbstractHelper + * @return \Magento\Framework\App\Helper\AbstractHelper * @throws \LogicException */ public function helper($className) { $helper = $this->_helperFactory->get($className); - if (false === $helper instanceof \Magento\App\Helper\AbstractHelper) { - throw new \LogicException($className . ' doesn\'t extends Magento\App\Helper\AbstractHelper'); + if (false === $helper instanceof \Magento\Framework\App\Helper\AbstractHelper) { + throw new \LogicException($className . ' doesn\'t extends Magento\Framework\App\Helper\AbstractHelper'); } return $helper; diff --git a/lib/Magento/View/Url.php b/lib/Magento/View/Url.php index 8da09d1e45667decd1d5455e3099a71280b43d97..d23be87c1780f7e51e3ed8aace511746c24d3e5f 100644 --- a/lib/Magento/View/Url.php +++ b/lib/Magento/View/Url.php @@ -36,7 +36,7 @@ class Url /** * File system * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $_filesystem; @@ -92,7 +92,7 @@ class Url /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\UrlInterface $urlBuilder * @param \Magento\View\Url\ConfigInterface $config * @param \Magento\View\Service $viewService @@ -102,7 +102,7 @@ class Url * @param array $fileUrlMap */ public function __construct( - \Magento\App\Filesystem $filesystem, + \Magento\Framework\App\Filesystem $filesystem, \Magento\UrlInterface $urlBuilder, \Magento\View\Url\ConfigInterface $config, \Magento\View\Service $viewService, @@ -179,7 +179,7 @@ class Url ) . $relativePath; if ($this->_isStaticFilesSigned() && $this->_viewService->isViewFileOperationAllowed()) { - $directory = $this->_filesystem->getDirectoryRead(\Magento\App\Filesystem::ROOT_DIR); + $directory = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem::ROOT_DIR); $fileMTime = $directory->stat($directory->getRelativePath($publicFilePath))['mtime']; $url .= '?' . $fileMTime; } diff --git a/lib/Magento/View/Url/CssResolver.php b/lib/Magento/View/Url/CssResolver.php index 3b512e6a9ba2c81bfe3225c6c171e8675f9001d8..8c5d0bd2aee888f385e7d8079e6b11b1d28316e1 100644 --- a/lib/Magento/View/Url/CssResolver.php +++ b/lib/Magento/View/Url/CssResolver.php @@ -37,7 +37,7 @@ class CssResolver /** * File system * - * @var \Magento\App\Filesystem + * @var \Magento\Framework\App\Filesystem */ protected $filesystem; @@ -51,10 +51,10 @@ class CssResolver /** * Constructor * - * @param \Magento\App\Filesystem $filesystem + * @param \Magento\Framework\App\Filesystem $filesystem * @param \Magento\View\FileSystem $viewFileSystem */ - public function __construct(\Magento\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem) + public function __construct(\Magento\Framework\App\Filesystem $filesystem, \Magento\View\FileSystem $viewFileSystem) { $this->filesystem = $filesystem; $this->viewFileSystem = $viewFileSystem; @@ -123,7 +123,7 @@ class CssResolver * Thus, calculating relative path is not possible in general case. So we just assume, * that urls follow the structure of directory paths. */ - $topDir = $this->filesystem->getPath(\Magento\App\Filesystem::ROOT_DIR); + $topDir = $this->filesystem->getPath(\Magento\Framework\App\Filesystem::ROOT_DIR); if (strpos($file, $topDir) !== 0 || strpos($referencedFile, $topDir) !== 0) { throw new \Magento\Exception('Offset can be calculated for internal resources only.'); } diff --git a/pub/.htaccess b/pub/.htaccess index 7aa0c2a553730b8b2adfcc1e5b20e370effc8e45..b00b2127289e31e93de0d23969e74d64611efd1c 100644 --- a/pub/.htaccess +++ b/pub/.htaccess @@ -32,7 +32,7 @@ ## adjust memory limit # php_value memory_limit 64M - php_value memory_limit 2048M + php_value memory_limit 256M php_value max_execution_time 18000 ############################################ diff --git a/pub/cron.php b/pub/cron.php index 436c43df683d8b18a04ad405455004f0cbd449c8..0d9152273bcbd58b537825836630a4a3ea4e58a6 100644 --- a/pub/cron.php +++ b/pub/cron.php @@ -31,5 +31,5 @@ use Magento\Store\Model\StoreManager; require dirname(__DIR__) . '/app/bootstrap.php'; umask(0); $params = array(StoreManager::PARAM_RUN_CODE => 'admin', \Magento\Store\Model\Store::CUSTOM_ENTRY_POINT_PARAM => true); -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); -$entryPoint->run('Magento\App\Cron', array('parameters' => array('group::'))); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); +$entryPoint->run('Magento\Framework\App\Cron', array('parameters' => array('group::'))); diff --git a/pub/errors/404.php b/pub/errors/404.php index af3a4c19bfe562b8dfc01db7fe323aecbd7e94da..c095b04014c237787e116511e762bef2dd4ff821 100644 --- a/pub/errors/404.php +++ b/pub/errors/404.php @@ -28,9 +28,9 @@ require_once __DIR__ . '/../../app/bootstrap.php'; require_once 'processor.php'; $processor = new Error_Processor( - new \Magento\App\Response\Http( + new \Magento\Framework\App\Response\Http( new \Magento\Stdlib\Cookie(), - new \Magento\App\Http\Context() + new \Magento\Framework\App\Http\Context() ) ); $response = $processor->process404(); diff --git a/pub/errors/503.php b/pub/errors/503.php index 3c43b4a9edfd7a58f84dd053dca6dde3d9babdc8..ebbdbb547b463778d48cacc70aa1a89735c66a23 100644 --- a/pub/errors/503.php +++ b/pub/errors/503.php @@ -28,9 +28,9 @@ require_once __DIR__ . '/../../app/bootstrap.php'; require_once 'processor.php'; $processor = new Error_Processor( - new \Magento\App\Response\Http( + new \Magento\Framework\App\Response\Http( new \Magento\Stdlib\Cookie(), - new \Magento\App\Http\Context() + new \Magento\Framework\App\Http\Context() ) ); $response = $processor->process503(); diff --git a/pub/errors/noCache.php b/pub/errors/noCache.php index de5ba4f266890a8e13505bc68fd168802cfe1461..9d71adb6b1d98da1ec7a4ab118de39d66e23d42f 100644 --- a/pub/errors/noCache.php +++ b/pub/errors/noCache.php @@ -27,9 +27,9 @@ require_once 'processor.php'; $processor = new Error_Processor( - new \Magento\App\Response\Http( + new \Magento\Framework\App\Response\Http( new \Magento\Stdlib\Cookie(), - new \Magento\App\Http\Context() + new \Magento\Framework\App\Http\Context() ) ); $response = $processor->processNoCache(); diff --git a/pub/errors/processor.php b/pub/errors/processor.php index 18dbdc4eb0e470e6f7af2cff239dc36d564f3b03..a3939406d20cc27cee9585ec4d2ef12b13df03e6 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -24,10 +24,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** +/** * Error processor - * - * @author Magento Core Team <core@magentocommerce.com> */ class Error_Processor { @@ -142,21 +140,23 @@ class Error_Processor /** * Http response * - * @var Magento\App\Response\Http + * @var Magento\Framework\App\Response\Http */ protected $_response; - public function __construct(\Magento\App\Response\Http $response) + /** + * @param \Magento\Framework\App\Response\Http $response + */ + public function __construct(\Magento\Framework\App\Response\Http $response) { $this->_response = $response; $this->_errorDir = __DIR__ . '/'; $this->_reportDir = dirname(dirname($this->_errorDir)) . '/var/report/'; if (!empty($_SERVER['SCRIPT_NAME'])) { - if (in_array(basename($_SERVER['SCRIPT_NAME'],'.php'), array('404','503','report'))) { + if (in_array(basename($_SERVER['SCRIPT_NAME'], '.php'), array('404', '503', 'report'))) { $this->_scriptName = dirname($_SERVER['SCRIPT_NAME']); - } - else { + } else { $this->_scriptName = $_SERVER['SCRIPT_NAME']; } } @@ -178,7 +178,7 @@ class Error_Processor /** * Process no cache error * - * @return \Magento\App\Response\Http + * @return \Magento\Framework\App\Response\Http */ public function processNoCache() { @@ -190,7 +190,7 @@ class Error_Processor /** * Process 404 error * - * @return \Magento\App\Response\Http + * @return \Magento\Framework\App\Response\Http */ public function process404() { @@ -204,7 +204,7 @@ class Error_Processor /** * Process 503 error * - * @return \Magento\App\Response\Http + * @return \Magento\Framework\App\Response\Http */ public function process503() { @@ -217,7 +217,7 @@ class Error_Processor /** * Process report * - * @return \Magento\App\Response\Http + * @return \Magento\Framework\App\Response\Http */ public function processReport() { @@ -230,7 +230,7 @@ class Error_Processor $this->reportAction = $this->_config->action; $this->_setReportUrl(); - if($this->reportAction == 'email') { + if ($this->reportAction == 'email') { $this->showSendForm = true; $this->sendReport(); } @@ -286,7 +286,7 @@ class Error_Processor { $path = $this->_scriptName; - if($param && !$this->_root) { + if ($param && !$this->_root) { $path = dirname($path); } @@ -313,7 +313,7 @@ class Error_Processor { $documentRoot = ''; if (!empty($_SERVER['DOCUMENT_ROOT'])) { - $documentRoot = rtrim($_SERVER['DOCUMENT_ROOT'],'/'); + $documentRoot = rtrim($_SERVER['DOCUMENT_ROOT'], '/'); } return dirname($documentRoot . $this->_scriptName) . '/'; } @@ -397,7 +397,7 @@ class Error_Processor * * @param string $file * @param array $directories - * return $string + * @return string */ protected function _getFilePath($file, $directories = null) { @@ -421,7 +421,7 @@ class Error_Processor * Find template path * * @param string $template - * return $string + * @return string */ protected function _getTemplatePath($template) { @@ -455,8 +455,7 @@ class Error_Processor if (!isset($reportData['url'])) { $this->reportData['url'] = ''; - } - else { + } else { $this->reportData['url'] = $this->getHostUrl() . $reportData['url']; } @@ -607,9 +606,8 @@ class Error_Processor protected function _setReportUrl() { if ($this->reportId && $this->_config && isset($this->_config->skin)) { - $this->reportUrl = "{$this->getBaseUrl(true)}pub/errors/report.php?" . http_build_query(array( - 'id' => $this->reportId, 'skin' => $this->_config->skin - )); + $this->reportUrl = "{$this->getBaseUrl(true)}pub/errors/report.php?" + . http_build_query(array('id' => $this->reportId, 'skin' => $this->_config->skin)); } } } diff --git a/pub/errors/report.php b/pub/errors/report.php index 40a546a08934fa4027ad49422db06a957cba652d..c066230ba6d2b665009663612f8e34a26d1cd783 100644 --- a/pub/errors/report.php +++ b/pub/errors/report.php @@ -28,9 +28,9 @@ require_once __DIR__ . '/../../app/bootstrap.php'; require_once 'processor.php'; $processor = new Error_Processor( - new \Magento\App\Response\Http( + new \Magento\Framework\App\Response\Http( new \Magento\Stdlib\Cookie(), - new \Magento\App\Http\Context() + new \Magento\Framework\App\Http\Context() ) ); if (isset($reportData) && is_array($reportData)) { diff --git a/pub/get.php b/pub/get.php index bf2e09045ba70100950a8f2f7f9f7788caebb4dc..6922b6d5cbb552ccceda2d3aebb0f23079ed1b4a 100644 --- a/pub/get.php +++ b/pub/get.php @@ -26,7 +26,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -use Magento\App\Cache\Frontend\Factory; +use Magento\Framework\App\Cache\Frontend\Factory; use Magento\Module\Declaration\Reader\Filesystem; require dirname(__DIR__) . '/app/bootstrap.php'; @@ -83,7 +83,7 @@ if (empty($mediaDirectory)) { $params[Factory::PARAM_CACHE_FORCED_OPTIONS]['frontend_options']['disable_save'] = true; } -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(dirname(__DIR__), $params); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(dirname(__DIR__), $params); $entryPoint->run('Magento\Core\App\Media', array( 'request' => $request, 'workingDirectory' => __DIR__, diff --git a/pub/index.php b/pub/index.php index ee5a238911156ec88a9b7364438ac6ce357c637a..663a8a076bd7e2eaff98a12ae52f4a2f92dbd6f2 100644 --- a/pub/index.php +++ b/pub/index.php @@ -25,6 +25,6 @@ */ require __DIR__ . '/../app/bootstrap.php'; $params = $_SERVER; -$params[\Magento\App\Filesystem::PARAM_APP_DIRS][\Magento\App\Filesystem::PUB_DIR] = array('uri' => ''); -$entryPoint = new \Magento\App\EntryPoint\EntryPoint(BP, $params); -$entryPoint->run('Magento\App\Http'); +$params[\Magento\Framework\App\Filesystem::PARAM_APP_DIRS][\Magento\Framework\App\Filesystem::PUB_DIR] = array('uri' => ''); +$entryPoint = new \Magento\Framework\App\EntryPoint\EntryPoint(BP, $params); +$entryPoint->run('Magento\Framework\App\Http'); diff --git a/pub/lib/css/source/lib/buttons.less b/pub/lib/css/source/lib/buttons.less index f3ba7ce56d847bd1f2d09e0e2910af923817b19d..a4b53b35be48c9272b5fb680b6d033cddc4713a8 100644 --- a/pub/lib/css/source/lib/buttons.less +++ b/pub/lib/css/source/lib/buttons.less @@ -311,6 +311,38 @@ ); } +// +// Button revert secondary color +//-------------------------------------- */ +.button-revert-secondary-color( + @_button-color: @button-color, + @_button-background: @button-background, + @_button-border: @button-border, + + @_button-color-hover: @button-color-hover, + @_button-background-hover: @button-background-hover, + @_button-border-hover: @button-border-hover, + + @_button-color-active: @button-color-active, + @_button-background-active: @button-background-active, + @_button-border-active: @button-border-active +) { + .css(background, @_button-background); + .css(color, @_button-color); + .css(border, @_button-border); + &:focus, + &:active { + .css(background, @_button-background-active); + .css(color, @_button-color-active); + .css(border, @_button-border-active); + } + &:hover { + .css(background, @_button-background-hover); + .css(color, @_button-color-hover); + .css(border, @_button-border-hover); + } +} + // // Inner buttons mixins //-------------------------------------- */ diff --git a/pub/lib/css/source/lib/forms.less b/pub/lib/css/source/lib/forms.less index 9398bd63cae86a3a01e5cc82354393f690eac7c9..6b37ceb731f1b6b1c3ce3a8b06b197e14e9a9e85 100644 --- a/pub/lib/css/source/lib/forms.less +++ b/pub/lib/css/source/lib/forms.less @@ -200,8 +200,25 @@ @_element-border-color-error: @form-element-validation-border-error, @_element-border-color-valid: @form-element-validation-border-valid, @_element-background-error: @form-element-validation-background-error, - @_element-background-valid: @form-element-validation-background-valid, + @_element-background-valid: @form-element-validation-background-valid +) { + &.mage-error { + .form-element-color( + @_border-color: @_element-border-color-error, + @_background: @_element-background-error, + @_color: @_element-color-error + ); + } + &.valid { + .form-element-color( + @_border-color: @_element-border-color-valid, + @_background: @_element-background-valid, + @_color: @_element-color-valid + ); + } +} +.form-validation-note( @_note-font-size: @form-validation-note-font-size, @_note-color: @form-validation-note-color-error, @_note-font-family: @form-validation-note-font-family, @@ -224,46 +241,28 @@ @_note-icon-font-position: @form-validation-note-icon-font-position, @_note-icon-font-text-hide: @form-validation-note-icon-font-text-hide ) { - &.mage-error { - .form-element-color( - @_border-color: @_element-border-color-error, - @_background: @_element-background-error, - @_color: @_element-color-error - ); - } - &.valid { - .form-element-color( - @_border-color: @_element-border-color-valid, - @_background: @_element-background-valid, - @_color: @_element-color-valid - ); - } - + div.mage-error { - .typography( - @_font-size: @_note-font-size, - @_color: @_note-color, - @_font-family: @_note-font-family, - @_font-weight: @_note-font-weight, - @_line-height: @_note-line-height, - @_font-style: @_note-font-style - ); - .add-margin(@_note-margin); - .add-padding(@_note-padding); - ._form-validation-icon( - @_note-icon-use, - @_note-icon-font-content, - @_note-icon-font, - @_note-icon-font-size, - @_note-icon-font-line-height, - @_note-icon-font-color, - @_note-icon-font-color-hover, - @_note-icon-font-color-active, - @_note-icon-font-margin, - @_note-icon-font-vertical-align, - @_note-icon-font-position, - @_note-icon-font-text-hide - ); - } + .typography( + @_font-size: @_note-font-size, + @_color: @_note-color, + @_font-family: @_note-font-family, + @_font-weight: @_note-font-weight, + @_line-height: @_note-line-height, + @_font-style: @_note-font-style + ); + ._form-validation-icon( + @_note-icon-use, + @_note-icon-font-content, + @_note-icon-font, + @_note-icon-font-size, + @_note-icon-font-line-height, + @_note-icon-font-color, + @_note-icon-font-color-hover, + @_note-icon-font-color-active, + @_note-icon-font-margin, + @_note-icon-font-vertical-align, + @_note-icon-font-position, + @_note-icon-font-text-hide + ); } .form-validation-color( @@ -272,8 +271,7 @@ @_element-color-error: '', @_element-border-color-valid: '', @_element-background-valid: '', - @_element-color-valid: '', - @_note-color: '' + @_element-color-valid: '' ) { &.mage-error { .form-element-color( @@ -289,9 +287,6 @@ @_color: @_element-color-valid ); } - + div.mage-error { - .add-color(@_note-color); - } } @@ -342,6 +337,10 @@ .form-validation(); } + div.mage-error[generated] { + .form-validation-note(); + } + input[type="button"], input[type="reset"], input[type="submit"] { diff --git a/pub/lib/css/source/lib/tooltips.less b/pub/lib/css/source/lib/tooltips.less index 81ed657af82c0ce19947b8b897bf3dc39a095165..ea4bc81015c2b4ca56b253ae46151a0211d96389 100644 --- a/pub/lib/css/source/lib/tooltips.less +++ b/pub/lib/css/source/lib/tooltips.less @@ -24,6 +24,8 @@ .tooltip( @_tooltip-position: top, + @_tooltip-selector-toggle: ~".tooltip-toggle", + @_tooltip-selector-content: ~".tooltip-content", @_tooltip-background: @tooltip-background, @_tooltip-color: @tooltip-color, @_tooltip-font-size: @tooltip-font-size, @@ -44,9 +46,9 @@ @_tooltip-z-index: @tooltip-z-index ) { position: relative; - display: inline-block; + //display: inline-block; - .tooltip-content { + @{_tooltip-selector-content} { z-index: @_tooltip-z-index; background: @_tooltip-background; min-width: @_tooltip-min-width; @@ -94,13 +96,13 @@ ._tooltip-arrow-position(@_tooltip-position); } - & > :first-child { + & @{_tooltip-selector-toggle} { cursor: @_tooltip-cursor; } - & > :first-child:hover + .tooltip-content, - & > :first-child:focus + .tooltip-content, - &:hover > .tooltip-content { + & @{_tooltip-selector-toggle}:hover + @{_tooltip-selector-content}, + & @{_tooltip-selector-toggle}:focus + @{_tooltip-selector-content}, + &:hover @{_tooltip-selector-content} { display: block; } } @@ -188,7 +190,6 @@ border-bottom-color: @_tooltip-background; margin-left: @_tooltip-arrow-after-margin; left: @_tooltip-arrow-offset + @_tooltip-arrow-size; - } &:before { border-bottom-color: @_tooltip-border-color; diff --git a/pub/lib/css/source/lib/variables.less b/pub/lib/css/source/lib/variables.less index 635f0d9d053b90b3e6e87482caecff711f196826..75d7049649994a432ac3b9f69b9376bd4052bb4a 100644 --- a/pub/lib/css/source/lib/variables.less +++ b/pub/lib/css/source/lib/variables.less @@ -238,7 +238,7 @@ @table-body-th-bg: @table-bg; @table-cell-padding-horizontal: @indent-s-base; -@table-cell-padding-vertical: 3px; +@table-cell-padding-vertical: 8px; @table-border-color: @border-color-base; @table-border-width: @border-width-base; @@ -784,7 +784,7 @@ @form-element-input-line-height: @line-height-base; @form-element-input-font-style: @font-style-base; // Placeholder -@form-element-input-placeholder-color: false; +@form-element-input-placeholder-color: #c2c2c2; @form-element-input-placeholder-font-style: @form-element-input-font-style; // Disabled state @form-element-input-disabled-background: @form-element-input-background; @@ -875,7 +875,7 @@ @textarea-height: auto; @textarea-width: @form-element-input-width; @textarea-padding: 10px; -@textarea-margin: @form-element-input-margin; +@textarea-margin: 0; @textarea-vertical-align: @form-element-input-vertical-align; @textarea-background-clip: @form-element-input-background-clip; // border-box, content-box @textarea-outline: @form-element-input-outline; // false diff --git a/pub/lib/mage/adminhtml/grid.js b/pub/lib/mage/adminhtml/grid.js index 3e3eed7dd6bd22958b97a3290a558c9bc0e88c7f..11e9107f76b99ba1bc6c65affd8e455fd22d0e4e 100644 --- a/pub/lib/mage/adminhtml/grid.js +++ b/pub/lib/mage/adminhtml/grid.js @@ -85,7 +85,7 @@ varienGrid.prototype = { this.initCallback(this); } catch (e) { - if (console) { + if (window.console) { console.log(e); } } @@ -102,7 +102,7 @@ varienGrid.prototype = { try { this.initRowCallback(this, this.rows[row]); } catch (e) { - if (console) { + if (window.console) { console.log(e); } } diff --git a/pub/lib/mage/dropdowns.js b/pub/lib/mage/dropdowns.js index f5bfe4946fcff5df0f97db9ea1a316a103acb35c..289b2da43354374c1e122657e1c4f9d1ce89984e 100644 --- a/pub/lib/mage/dropdowns.js +++ b/pub/lib/mage/dropdowns.js @@ -95,10 +95,6 @@ return false; }); - - menu.on('click.preventMenuClosing', function(e) { - e.stopPropagation(); - }); }); }; diff --git a/pub/lib/mage/loader.js b/pub/lib/mage/loader.js index 02c2122277c3aceafdc99b673753430947c83eeb..7a4fbc496a4076b90777b79ba836b33562fc62a7 100644 --- a/pub/lib/mage/loader.js +++ b/pub/lib/mage/loader.js @@ -140,7 +140,7 @@ this._bind(); // There should only be one instance of this widget, and it should be attached // to the body only. Having it on the page twice will trigger multiple processStarts. - if (!this.element.is(this.options.defaultContainer) && $.mage.isDevMode(undefined)) { + if (window.console && !this.element.is(this.options.defaultContainer) && $.mage.isDevMode(undefined)) { console.warn("This widget is intended to be attached to the body, not below."); } }, @@ -172,7 +172,7 @@ // Check to make sure the loader is there on the page if not report it on the console. // NOTE that this check should be removed before going live. It is just an aid to help // in finding the uses of the loader that maybe broken. - if (console && !ctx.parents('[data-role="loader"]').length) { + if (window.console && !ctx.parents('[data-role="loader"]').length) { console.warn('Expected to start loader but did not find one in the dom'); } }